agent-dealer 1.3.2 → 1.3.4
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/bundle/server/dist/adapters/agent-health.test.js +52 -0
- package/bundle/server/dist/capacity/service.js +66 -6
- package/bundle/server/dist/capacity/service.test.js +220 -0
- package/bundle/server/dist/coordinator/commands.js +79 -1
- package/bundle/server/dist/coordinator/commands.test.js +2 -0
- package/bundle/server/dist/coordinator/developer-effect.test.js +2 -0
- package/bundle/server/dist/coordinator/repair-cycle.integration.test.js +2 -0
- package/bundle/server/dist/coordinator/reviewer-effect.test.js +2 -0
- package/bundle/server/dist/coordinator/worker-loop.test.js +2 -0
- package/bundle/server/dist/db/auto-merge-default-migration.test.js +52 -0
- package/bundle/server/dist/db/index.js +12 -2
- package/bundle/server/dist/db/schema.sql +6 -2
- package/bundle/server/dist/dev-review-cli-happy-path.integration.test.js +2 -0
- package/bundle/server/dist/repository/runtime-availability.js +29 -11
- package/bundle/server/dist/routes/auto-merge-policy.test.js +378 -0
- package/bundle/server/dist/routes/human-actions.test.js +4 -4
- package/bundle/server/dist/routes/issues-execution-contract.test.js +4 -3
- package/bundle/server/dist/routes/issues.js +32 -2
- package/bundle/server/dist/routes/issues.test.js +25 -2
- package/bundle/server/dist/runners/usage-cap.js +66 -15
- package/bundle/server/dist/runners/usage-cap.test.js +96 -2
- package/bundle/server/package.json +2 -2
- package/bundle/server/static-ui/assets/index-CHCiztRI.css +1 -0
- package/bundle/server/static-ui/assets/index-CrLQFFpw.js +64 -0
- package/bundle/server/static-ui/index.html +2 -2
- package/bundle/shared/dist/issues.d.ts +8 -5
- package/bundle/shared/dist/issues.js +7 -4
- package/bundle/shared/dist/issues.test.js +11 -1
- package/bundle/shared/dist/runtime-capacity.d.ts +85 -0
- package/bundle/shared/dist/runtime-capacity.js +19 -0
- package/bundle/shared/package.json +1 -1
- package/dist/index.js +1 -1
- package/dist/issue.d.ts +1 -0
- package/dist/issue.js +3 -2
- package/dist/issue.test.js +37 -0
- package/package.json +1 -1
- package/bundle/server/static-ui/assets/index-DL8mEXzN.css +0 -1
- package/bundle/server/static-ui/assets/index-DQ5ivcyg.js +0 -64
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function i(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();var Wc={exports:{}},Ci={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ex;function z0(){if(ex)return Ci;ex=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(u,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var x in d)x!=="key"&&(f[x]=d[x])}else f=d;return d=f.ref,{$$typeof:a,type:u,key:m,ref:d!==void 0?d:null,props:f}}return Ci.Fragment=l,Ci.jsx=i,Ci.jsxs=i,Ci}var tx;function B0(){return tx||(tx=1,Wc.exports=z0()),Wc.exports}var r=B0(),Pc={exports:{}},ge={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ax;function q0(){if(ax)return ge;ax=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),D=Symbol.iterator;function X(N){return N===null||typeof N!="object"?null:(N=D&&N[D]||N["@@iterator"],typeof N=="function"?N:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$=Object.assign,L={};function H(N,Y,W){this.props=N,this.context=Y,this.refs=L,this.updater=W||C}H.prototype.isReactComponent={},H.prototype.setState=function(N,Y){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,Y,"setState")},H.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function F(){}F.prototype=H.prototype;function P(N,Y,W){this.props=N,this.context=Y,this.refs=L,this.updater=W||C}var ne=P.prototype=new F;ne.constructor=P,$(ne,H.prototype),ne.isPureReactComponent=!0;var V=Array.isArray;function _e(){}var I={H:null,A:null,T:null,S:null},ye=Object.prototype.hasOwnProperty;function Ue(N,Y,W){var te=W.ref;return{$$typeof:a,type:N,key:Y,ref:te!==void 0?te:null,props:W}}function gt(N,Y){return Ue(N.type,Y,N.props)}function At(N){return typeof N=="object"&&N!==null&&N.$$typeof===a}function rt(N){var Y={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(W){return Y[W]})}var mt=/\/+/g;function nt(N,Y){return typeof N=="object"&&N!==null&&N.key!=null?rt(""+N.key):Y.toString(36)}function Ge(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(_e,_e):(N.status="pending",N.then(function(Y){N.status==="pending"&&(N.status="fulfilled",N.value=Y)},function(Y){N.status==="pending"&&(N.status="rejected",N.reason=Y)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function U(N,Y,W,te,re){var z=typeof N;(z==="undefined"||z==="boolean")&&(N=null);var de=!1;if(N===null)de=!0;else switch(z){case"bigint":case"string":case"number":de=!0;break;case"object":switch(N.$$typeof){case a:case l:de=!0;break;case w:return de=N._init,U(de(N._payload),Y,W,te,re)}}if(de)return re=re(N),de=te===""?"."+nt(N,0):te,V(re)?(W="",de!=null&&(W=de.replace(mt,"$&/")+"/"),U(re,Y,W,"",function(Bt){return Bt})):re!=null&&(At(re)&&(re=gt(re,W+(re.key==null||N&&N.key===re.key?"":(""+re.key).replace(mt,"$&/")+"/")+de)),Y.push(re)),1;de=0;var Qe=te===""?".":te+":";if(V(N))for(var ze=0;ze<N.length;ze++)te=N[ze],z=Qe+nt(te,ze),de+=U(te,Y,W,z,re);else if(ze=X(N),typeof ze=="function")for(N=ze.call(N),ze=0;!(te=N.next()).done;)te=te.value,z=Qe+nt(te,ze++),de+=U(te,Y,W,z,re);else if(z==="object"){if(typeof N.then=="function")return U(Ge(N),Y,W,te,re);throw Y=String(N),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return de}function J(N,Y,W){if(N==null)return N;var te=[],re=0;return U(N,te,"","",function(z){return Y.call(W,z,re++)}),te}function ue(N){if(N._status===-1){var Y=N._result;Y=Y(),Y.then(function(W){(N._status===0||N._status===-1)&&(N._status=1,N._result=W)},function(W){(N._status===0||N._status===-1)&&(N._status=2,N._result=W)}),N._status===-1&&(N._status=0,N._result=Y)}if(N._status===1)return N._result.default;throw N._result}var Ce=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},De={map:J,forEach:function(N,Y,W){J(N,function(){Y.apply(this,arguments)},W)},count:function(N){var Y=0;return J(N,function(){Y++}),Y},toArray:function(N){return J(N,function(Y){return Y})||[]},only:function(N){if(!At(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return ge.Activity=j,ge.Children=De,ge.Component=H,ge.Fragment=i,ge.Profiler=d,ge.PureComponent=P,ge.StrictMode=u,ge.Suspense=y,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ge.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},ge.cache=function(N){return function(){return N.apply(null,arguments)}},ge.cacheSignal=function(){return null},ge.cloneElement=function(N,Y,W){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var te=$({},N.props),re=N.key;if(Y!=null)for(z in Y.key!==void 0&&(re=""+Y.key),Y)!ye.call(Y,z)||z==="key"||z==="__self"||z==="__source"||z==="ref"&&Y.ref===void 0||(te[z]=Y[z]);var z=arguments.length-2;if(z===1)te.children=W;else if(1<z){for(var de=Array(z),Qe=0;Qe<z;Qe++)de[Qe]=arguments[Qe+2];te.children=de}return Ue(N.type,re,te)},ge.createContext=function(N){return N={$$typeof:m,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},ge.createElement=function(N,Y,W){var te,re={},z=null;if(Y!=null)for(te in Y.key!==void 0&&(z=""+Y.key),Y)ye.call(Y,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(re[te]=Y[te]);var de=arguments.length-2;if(de===1)re.children=W;else if(1<de){for(var Qe=Array(de),ze=0;ze<de;ze++)Qe[ze]=arguments[ze+2];re.children=Qe}if(N&&N.defaultProps)for(te in de=N.defaultProps,de)re[te]===void 0&&(re[te]=de[te]);return Ue(N,z,re)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(N){return{$$typeof:x,render:N}},ge.isValidElement=At,ge.lazy=function(N){return{$$typeof:w,_payload:{_status:-1,_result:N},_init:ue}},ge.memo=function(N,Y){return{$$typeof:v,type:N,compare:Y===void 0?null:Y}},ge.startTransition=function(N){var Y=I.T,W={};I.T=W;try{var te=N(),re=I.S;re!==null&&re(W,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(_e,Ce)}catch(z){Ce(z)}finally{Y!==null&&W.types!==null&&(Y.types=W.types),I.T=Y}},ge.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ge.use=function(N){return I.H.use(N)},ge.useActionState=function(N,Y,W){return I.H.useActionState(N,Y,W)},ge.useCallback=function(N,Y){return I.H.useCallback(N,Y)},ge.useContext=function(N){return I.H.useContext(N)},ge.useDebugValue=function(){},ge.useDeferredValue=function(N,Y){return I.H.useDeferredValue(N,Y)},ge.useEffect=function(N,Y){return I.H.useEffect(N,Y)},ge.useEffectEvent=function(N){return I.H.useEffectEvent(N)},ge.useId=function(){return I.H.useId()},ge.useImperativeHandle=function(N,Y,W){return I.H.useImperativeHandle(N,Y,W)},ge.useInsertionEffect=function(N,Y){return I.H.useInsertionEffect(N,Y)},ge.useLayoutEffect=function(N,Y){return I.H.useLayoutEffect(N,Y)},ge.useMemo=function(N,Y){return I.H.useMemo(N,Y)},ge.useOptimistic=function(N,Y){return I.H.useOptimistic(N,Y)},ge.useReducer=function(N,Y,W){return I.H.useReducer(N,Y,W)},ge.useRef=function(N){return I.H.useRef(N)},ge.useState=function(N){return I.H.useState(N)},ge.useSyncExternalStore=function(N,Y,W){return I.H.useSyncExternalStore(N,Y,W)},ge.useTransition=function(){return I.H.useTransition()},ge.version="19.2.7",ge}var nx;function Yd(){return nx||(nx=1,Pc.exports=q0()),Pc.exports}var b=Yd(),ed={exports:{}},Ri={},td={exports:{}},ad={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var lx;function H0(){return lx||(lx=1,(function(a){function l(U,J){var ue=U.length;U.push(J);e:for(;0<ue;){var Ce=ue-1>>>1,De=U[Ce];if(0<d(De,J))U[Ce]=J,U[ue]=De,ue=Ce;else break e}}function i(U){return U.length===0?null:U[0]}function u(U){if(U.length===0)return null;var J=U[0],ue=U.pop();if(ue!==J){U[0]=ue;e:for(var Ce=0,De=U.length,N=De>>>1;Ce<N;){var Y=2*(Ce+1)-1,W=U[Y],te=Y+1,re=U[te];if(0>d(W,ue))te<De&&0>d(re,W)?(U[Ce]=re,U[te]=ue,Ce=te):(U[Ce]=W,U[Y]=ue,Ce=Y);else if(te<De&&0>d(re,ue))U[Ce]=re,U[te]=ue,Ce=te;else break e}}return J}function d(U,J){var ue=U.sortIndex-J.sortIndex;return ue!==0?ue:U.id-J.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var m=Date,x=m.now();a.unstable_now=function(){return m.now()-x}}var y=[],v=[],w=1,j=null,D=3,X=!1,C=!1,$=!1,L=!1,H=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function ne(U){for(var J=i(v);J!==null;){if(J.callback===null)u(v);else if(J.startTime<=U)u(v),J.sortIndex=J.expirationTime,l(y,J);else break;J=i(v)}}function V(U){if($=!1,ne(U),!C)if(i(y)!==null)C=!0,_e||(_e=!0,rt());else{var J=i(v);J!==null&&Ge(V,J.startTime-U)}}var _e=!1,I=-1,ye=5,Ue=-1;function gt(){return L?!0:!(a.unstable_now()-Ue<ye)}function At(){if(L=!1,_e){var U=a.unstable_now();Ue=U;var J=!0;try{e:{C=!1,$&&($=!1,F(I),I=-1),X=!0;var ue=D;try{t:{for(ne(U),j=i(y);j!==null&&!(j.expirationTime>U&>());){var Ce=j.callback;if(typeof Ce=="function"){j.callback=null,D=j.priorityLevel;var De=Ce(j.expirationTime<=U);if(U=a.unstable_now(),typeof De=="function"){j.callback=De,ne(U),J=!0;break t}j===i(y)&&u(y),ne(U)}else u(y);j=i(y)}if(j!==null)J=!0;else{var N=i(v);N!==null&&Ge(V,N.startTime-U),J=!1}}break e}finally{j=null,D=ue,X=!1}J=void 0}}finally{J?rt():_e=!1}}}var rt;if(typeof P=="function")rt=function(){P(At)};else if(typeof MessageChannel<"u"){var mt=new MessageChannel,nt=mt.port2;mt.port1.onmessage=At,rt=function(){nt.postMessage(null)}}else rt=function(){H(At,0)};function Ge(U,J){I=H(function(){U(a.unstable_now())},J)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(U){U.callback=null},a.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ye=0<U?Math.floor(1e3/U):5},a.unstable_getCurrentPriorityLevel=function(){return D},a.unstable_next=function(U){switch(D){case 1:case 2:case 3:var J=3;break;default:J=D}var ue=D;D=J;try{return U()}finally{D=ue}},a.unstable_requestPaint=function(){L=!0},a.unstable_runWithPriority=function(U,J){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ue=D;D=U;try{return J()}finally{D=ue}},a.unstable_scheduleCallback=function(U,J,ue){var Ce=a.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?Ce+ue:Ce):ue=Ce,U){case 1:var De=-1;break;case 2:De=250;break;case 5:De=1073741823;break;case 4:De=1e4;break;default:De=5e3}return De=ue+De,U={id:w++,callback:J,priorityLevel:U,startTime:ue,expirationTime:De,sortIndex:-1},ue>Ce?(U.sortIndex=ue,l(v,U),i(y)===null&&U===i(v)&&($?(F(I),I=-1):$=!0,Ge(V,ue-Ce))):(U.sortIndex=De,l(y,U),C||X||(C=!0,_e||(_e=!0,rt()))),U},a.unstable_shouldYield=gt,a.unstable_wrapCallback=function(U){var J=D;return function(){var ue=D;D=J;try{return U.apply(this,arguments)}finally{D=ue}}}})(ad)),ad}var sx;function $0(){return sx||(sx=1,td.exports=H0()),td.exports}var nd={exports:{}},zt={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var ix;function Y0(){if(ix)return zt;ix=1;var a=Yd();function l(y){var v="https://react.dev/errors/"+y;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)v+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+y+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var u={d:{f:i,r:function(){throw Error(l(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(y,v,w){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:y,containerInfo:v,implementation:w}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(y,v){if(y==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,zt.createPortal=function(y,v){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(l(299));return f(y,v,null,w)},zt.flushSync=function(y){var v=m.T,w=u.p;try{if(m.T=null,u.p=2,y)return y()}finally{m.T=v,u.p=w,u.d.f()}},zt.preconnect=function(y,v){typeof y=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,u.d.C(y,v))},zt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},zt.preinit=function(y,v){if(typeof y=="string"&&v&&typeof v.as=="string"){var w=v.as,j=x(w,v.crossOrigin),D=typeof v.integrity=="string"?v.integrity:void 0,X=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;w==="style"?u.d.S(y,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:j,integrity:D,fetchPriority:X}):w==="script"&&u.d.X(y,{crossOrigin:j,integrity:D,fetchPriority:X,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},zt.preinitModule=function(y,v){if(typeof y=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var w=x(v.as,v.crossOrigin);u.d.M(y,{crossOrigin:w,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&u.d.M(y)},zt.preload=function(y,v){if(typeof y=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var w=v.as,j=x(w,v.crossOrigin);u.d.L(y,w,{crossOrigin:j,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},zt.preloadModule=function(y,v){if(typeof y=="string")if(v){var w=x(v.as,v.crossOrigin);u.d.m(y,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:w,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else u.d.m(y)},zt.requestFormReset=function(y){u.d.r(y)},zt.unstable_batchedUpdates=function(y,v){return y(v)},zt.useFormState=function(y,v,w){return m.H.useFormState(y,v,w)},zt.useFormStatus=function(){return m.H.useHostTransitionStatus()},zt.version="19.2.7",zt}var rx;function V0(){if(rx)return nd.exports;rx=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),nd.exports=Y0(),nd.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var ux;function Z0(){if(ux)return Ri;ux=1;var a=$0(),l=Yd(),i=V0();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m(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 x(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 y(e){if(f(e)!==e)throw Error(u(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,s=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(s=o.return,s!==null){n=s;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return y(o),e;if(c===s)return y(o),t;c=c.sibling}throw Error(u(188))}if(n.return!==s.return)n=o,s=c;else{for(var h=!1,g=o.child;g;){if(g===n){h=!0,n=o,s=c;break}if(g===s){h=!0,s=o,n=c;break}g=g.sibling}if(!h){for(g=c.child;g;){if(g===n){h=!0,n=c,s=o;break}if(g===s){h=!0,s=c,n=o;break}g=g.sibling}if(!h)throw Error(u(189))}}if(n.alternate!==s)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function w(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=w(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,D=Symbol.for("react.element"),X=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),P=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),_e=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),ye=Symbol.for("react.lazy"),Ue=Symbol.for("react.activity"),gt=Symbol.for("react.memo_cache_sentinel"),At=Symbol.iterator;function rt(e){return e===null||typeof e!="object"?null:(e=At&&e[At]||e["@@iterator"],typeof e=="function"?e:null)}var mt=Symbol.for("react.client.reference");function nt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===mt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $:return"Fragment";case H:return"Profiler";case L:return"StrictMode";case V:return"Suspense";case _e:return"SuspenseList";case Ue:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case P:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:nt(e.type)||"Memo";case ye:t=e._payload,e=e._init;try{return nt(e(t))}catch{}}return null}var Ge=Array.isArray,U=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},Ce=[],De=-1;function N(e){return{current:e}}function Y(e){0>De||(e.current=Ce[De],Ce[De]=null,De--)}function W(e,t){De++,Ce[De]=e.current,e.current=t}var te=N(null),re=N(null),z=N(null),de=N(null);function Qe(e,t){switch(W(z,t),W(re,e),W(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?jp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=jp(t),e=Np(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(te),W(te,e)}function ze(){Y(te),Y(re),Y(z)}function Bt(e){e.memoizedState!==null&&W(de,e);var t=te.current,n=Np(t,e.type);t!==n&&(W(re,e),W(te,n))}function Ra(e){re.current===e&&(Y(te),Y(re)),de.current===e&&(Y(de),_i._currentValue=ue)}var ra,Ya;function qe(e){if(ra===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ra=t&&t[1]||"",Ya=-1<n.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+ra+e+Ya}var Va=!1;function ct(e,t){if(!e||Va)return"";Va=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(M){var O=M}Reflect.construct(e,[],Q)}else{try{Q.call()}catch(M){O=M}e.call(Q.prototype)}}else{try{throw Error()}catch(M){O=M}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(M){if(M&&O&&typeof M.stack=="string")return[M.stack,O.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=s.DetermineComponentFrameRoot(),h=c[0],g=c[1];if(h&&g){var S=h.split(`
|
|
44
|
-
`),T=g.split(`
|
|
45
|
-
`);for(o=s=0;s<S.length&&!S[s].includes("DetermineComponentFrameRoot");)s++;for(;o<T.length&&!T[o].includes("DetermineComponentFrameRoot");)o++;if(s===S.length||o===T.length)for(s=S.length-1,o=T.length-1;1<=s&&0<=o&&S[s]!==T[o];)o--;for(;1<=s&&0<=o;s--,o--)if(S[s]!==T[o]){if(s!==1||o!==1)do if(s--,o--,0>o||S[s]!==T[o]){var q=`
|
|
46
|
-
`+S[s].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=s&&0<=o);break}}}finally{Va=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?qe(n):""}function bt(e,t){switch(e.tag){case 26:case 27:case 5:return qe(e.type);case 16:return qe("Lazy");case 13:return e.child!==t&&t!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return ct(e.type,!1);case 11:return ct(e.type.render,!1);case 1:return ct(e.type,!0);case 31:return qe("Activity");default:return""}}function Rn(e){try{var t="",n=null;do t+=bt(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
|
|
47
|
-
Error generating stack: `+s.message+`
|
|
48
|
-
`+s.stack}}var Ye=Object.prototype.hasOwnProperty,Za=a.unstable_scheduleCallback,Tn=a.unstable_cancelCallback,an=a.unstable_shouldYield,nn=a.unstable_requestPaint,tt=a.unstable_now,dl=a.unstable_getCurrentPriorityLevel,ke=a.unstable_ImmediatePriority,fl=a.unstable_UserBlockingPriority,Ga=a.unstable_NormalPriority,On=a.unstable_LowPriority,Yt=a.unstable_IdlePriority,Yl=a.log,qs=a.unstable_setDisableYieldValue,Qa=null,at=null;function Ut(e){if(typeof Yl=="function"&&qs(e),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(Qa,e)}catch{}}var pt=Math.clz32?Math.clz32:Ln,ua=Math.log,Pe=Math.LN2;function Ln(e){return e>>>=0,e===0?32:31-(ua(e)/Pe|0)|0}var Xa=256,Ta=262144,Oa=4194304;function oa(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 Mn(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var g=s&134217727;return g!==0?(s=g&~c,s!==0?o=oa(s):(h&=g,h!==0?o=oa(h):n||(n=g&~e,n!==0&&(o=oa(n))))):(g=s&~c,g!==0?o=oa(g):h!==0?o=oa(h):n||(n=s&~e,n!==0&&(o=oa(n)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:o}function ln(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Tt(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 hl(){var e=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),e}function ml(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function sn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Hs(e,t,n,s,o,c){var h=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,S=e.expirationTimes,T=e.hiddenUpdates;for(n=h&~n;0<n;){var q=31-pt(n),Q=1<<q;g[q]=0,S[q]=-1;var O=T[q];if(O!==null)for(T[q]=null,q=0;q<O.length;q++){var M=O[q];M!==null&&(M.lane&=-536870913)}n&=~Q}s!==0&&Vl(e,s,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function Vl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-pt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function Zl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-pt(n),o=1<<s;o&t|e[s]&t&&(e[s]|=t),n&=~o}}function pl(e,t){var n=t&-t;return n=(n&42)!==0?1:Dn(n),(n&(e.suspendedLanes|t))!==0?0:n}function Dn(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 xl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Gl(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:Xp(e.type))}function La(e,t){var n=J.p;try{return J.p=e,t()}finally{J.p=n}}var ca=Math.random().toString(36).slice(2),dt="__reactFiber$"+ca,wt="__reactProps$"+ca,Z="__reactContainer$"+ca,Se="__reactEvents$"+ca,lt="__reactListeners$"+ca,E="__reactHandles$"+ca,le="__reactResources$"+ca,ve="__reactMarker$"+ca;function xt(e){delete e[dt],delete e[wt],delete e[Se],delete e[lt],delete e[E]}function Ql(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Z]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tp(e);e!==null;){if(n=e[dt])return n;e=Tp(e)}return t}e=n,n=e.parentNode}return null}function Xl(e){if(e=e[dt]||e[Z]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function $s(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Il(e){var t=e[le];return t||(t=e[le]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ct(e){e[ve]=!0}var df=new Set,ff={};function yl(e,t){Kl(e,t),Kl(e+"Capture",t)}function Kl(e,t){for(ff[e]=t,e=0;e<t.length;e++)df.add(t[e])}var Ev=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]*$"),hf={},mf={};function Cv(e){return Ye.call(mf,e)?!0:Ye.call(hf,e)?!1:Ev.test(e)?mf[e]=!0:(hf[e]=!0,!1)}function Qi(e,t,n){if(Cv(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Xi(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function rn(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function da(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Rv(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var o=s.get,c=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(h){n=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zu(e){if(!e._valueTracker){var t=pf(e)?"checked":"value";e._valueTracker=Rv(e,t,""+e[t])}}function xf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=pf(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ii(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 Tv=/[\n"\\]/g;function fa(e){return e.replace(Tv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Gu(e,t,n,s,o,c,h,g){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+da(t)):e.value!==""+da(t)&&(e.value=""+da(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Qu(e,h,da(t)):n!=null?Qu(e,h,da(n)):s!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+da(g):e.removeAttribute("name")}function yf(e,t,n,s,o,c,h,g){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Zu(e);return}n=n!=null?""+da(n):"",t=t!=null?""+da(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=g?e.checked:!!s,e.defaultChecked=!!s,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Zu(e)}function Qu(e,t,n){t==="number"&&Ii(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Jl(e,t,n,s){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&s&&(e[n].defaultSelected=!0)}else{for(n=""+da(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function vf(e,t,n){if(t!=null&&(t=""+da(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+da(n):""}function gf(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(u(92));if(Ge(s)){if(1<s.length)throw Error(u(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=da(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),Zu(e)}function Fl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ov=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 bf(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||Ov.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function wf(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var o in t)s=t[o],t.hasOwnProperty(o)&&n[o]!==s&&bf(e,o,s)}else for(var c in t)t.hasOwnProperty(c)&&bf(e,c,t[c])}function Xu(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 Lv=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"]]),Mv=/^[\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 Ki(e){return Mv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function un(){}var Iu=null;function Ku(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wl=null,Pl=null;function Sf(e){var t=Xl(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Gu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+fa(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var o=s[wt]||null;if(!o)throw Error(u(90));Gu(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&xf(s)}break e;case"textarea":vf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Jl(e,!!n.multiple,t,!1)}}}var Ju=!1;function jf(e,t,n){if(Ju)return e(t,n);Ju=!0;try{var s=e(t);return s}finally{if(Ju=!1,(Wl!==null||Pl!==null)&&(Ur(),Wl&&(t=Wl,e=Pl,Pl=Wl=null,Sf(t),e)))for(t=0;t<e.length;t++)Sf(e[t])}}function Ys(e,t){var n=e.stateNode;if(n===null)return null;var s=n[wt]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var on=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fu=!1;if(on)try{var Vs={};Object.defineProperty(Vs,"passive",{get:function(){Fu=!0}}),window.addEventListener("test",Vs,Vs),window.removeEventListener("test",Vs,Vs)}catch{Fu=!1}var Un=null,Wu=null,Ji=null;function Nf(){if(Ji)return Ji;var e,t=Wu,n=t.length,s,o="value"in Un?Un.value:Un.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var h=n-e;for(s=1;s<=h&&t[n-s]===o[c-s];s++);return Ji=o.slice(e,1<s?1-s:void 0)}function Fi(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 Wi(){return!0}function _f(){return!1}function Vt(e){function t(n,s,o,c,h){this._reactName=n,this._targetInst=o,this.type=s,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(c):c[g]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Wi:_f,this.isPropagationStopped=_f,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Wi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Wi)},persist:function(){},isPersistent:Wi}),t}var vl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pi=Vt(vl),Zs=j({},vl,{view:0,detail:0}),Dv=Vt(Zs),Pu,eo,Gs,er=j({},Zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ao,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!==Gs&&(Gs&&e.type==="mousemove"?(Pu=e.screenX-Gs.screenX,eo=e.screenY-Gs.screenY):eo=Pu=0,Gs=e),Pu)},movementY:function(e){return"movementY"in e?e.movementY:eo}}),kf=Vt(er),Uv=j({},er,{dataTransfer:0}),zv=Vt(Uv),Bv=j({},Zs,{relatedTarget:0}),to=Vt(Bv),qv=j({},vl,{animationName:0,elapsedTime:0,pseudoElement:0}),Hv=Vt(qv),$v=j({},vl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yv=Vt($v),Vv=j({},vl,{data:0}),Af=Vt(Vv),Zv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gv={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"},Qv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qv[e])?!!t[e]:!1}function ao(){return Xv}var Iv=j({},Zs,{key:function(e){if(e.key){var t=Zv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ao,charCode:function(e){return e.type==="keypress"?Fi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Kv=Vt(Iv),Jv=j({},er,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ef=Vt(Jv),Fv=j({},Zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ao}),Wv=Vt(Fv),Pv=j({},vl,{propertyName:0,elapsedTime:0,pseudoElement:0}),eg=Vt(Pv),tg=j({},er,{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}),ag=Vt(tg),ng=j({},vl,{newState:0,oldState:0}),lg=Vt(ng),sg=[9,13,27,32],no=on&&"CompositionEvent"in window,Qs=null;on&&"documentMode"in document&&(Qs=document.documentMode);var ig=on&&"TextEvent"in window&&!Qs,Cf=on&&(!no||Qs&&8<Qs&&11>=Qs),Rf=" ",Tf=!1;function Of(e,t){switch(e){case"keyup":return sg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function rg(e,t){switch(e){case"compositionend":return Lf(t);case"keypress":return t.which!==32?null:(Tf=!0,Rf);case"textInput":return e=t.data,e===Rf&&Tf?null:e;default:return null}}function ug(e,t){if(es)return e==="compositionend"||!no&&Of(e,t)?(e=Nf(),Ji=Wu=Un=null,es=!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 Cf&&t.locale!=="ko"?null:t.data;default:return null}}var og={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 Mf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!og[e.type]:t==="textarea"}function Df(e,t,n,s){Wl?Pl?Pl.push(s):Pl=[s]:Wl=s,t=Vr(t,"onChange"),0<t.length&&(n=new Pi("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Xs=null,Is=null;function cg(e){yp(e,0)}function tr(e){var t=$s(e);if(xf(t))return e}function Uf(e,t){if(e==="change")return t}var zf=!1;if(on){var lo;if(on){var so="oninput"in document;if(!so){var Bf=document.createElement("div");Bf.setAttribute("oninput","return;"),so=typeof Bf.oninput=="function"}lo=so}else lo=!1;zf=lo&&(!document.documentMode||9<document.documentMode)}function qf(){Xs&&(Xs.detachEvent("onpropertychange",Hf),Is=Xs=null)}function Hf(e){if(e.propertyName==="value"&&tr(Is)){var t=[];Df(t,Is,e,Ku(e)),jf(cg,t)}}function dg(e,t,n){e==="focusin"?(qf(),Xs=t,Is=n,Xs.attachEvent("onpropertychange",Hf)):e==="focusout"&&qf()}function fg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return tr(Is)}function hg(e,t){if(e==="click")return tr(t)}function mg(e,t){if(e==="input"||e==="change")return tr(t)}function pg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ft=typeof Object.is=="function"?Object.is:pg;function Ks(e,t){if(Ft(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var o=n[s];if(!Ye.call(t,o)||!Ft(e[o],t[o]))return!1}return!0}function $f(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yf(e,t){var n=$f(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$f(n)}}function Vf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ii(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ii(e.document)}return t}function io(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 xg=on&&"documentMode"in document&&11>=document.documentMode,ts=null,ro=null,Js=null,uo=!1;function Gf(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uo||ts==null||ts!==Ii(s)||(s=ts,"selectionStart"in s&&io(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Js&&Ks(Js,s)||(Js=s,s=Vr(ro,"onSelect"),0<s.length&&(t=new Pi("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=ts)))}function gl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var as={animationend:gl("Animation","AnimationEnd"),animationiteration:gl("Animation","AnimationIteration"),animationstart:gl("Animation","AnimationStart"),transitionrun:gl("Transition","TransitionRun"),transitionstart:gl("Transition","TransitionStart"),transitioncancel:gl("Transition","TransitionCancel"),transitionend:gl("Transition","TransitionEnd")},oo={},Qf={};on&&(Qf=document.createElement("div").style,"AnimationEvent"in window||(delete as.animationend.animation,delete as.animationiteration.animation,delete as.animationstart.animation),"TransitionEvent"in window||delete as.transitionend.transition);function bl(e){if(oo[e])return oo[e];if(!as[e])return e;var t=as[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qf)return oo[e]=t[n];return e}var Xf=bl("animationend"),If=bl("animationiteration"),Kf=bl("animationstart"),yg=bl("transitionrun"),vg=bl("transitionstart"),gg=bl("transitioncancel"),Jf=bl("transitionend"),Ff=new Map,co="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(" ");co.push("scrollEnd");function Ma(e,t){Ff.set(e,t),yl(t,[e])}var ar=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)},ha=[],ns=0,fo=0;function nr(){for(var e=ns,t=fo=ns=0;t<e;){var n=ha[t];ha[t++]=null;var s=ha[t];ha[t++]=null;var o=ha[t];ha[t++]=null;var c=ha[t];if(ha[t++]=null,s!==null&&o!==null){var h=s.pending;h===null?o.next=o:(o.next=h.next,h.next=o),s.pending=o}c!==0&&Wf(n,o,c)}}function lr(e,t,n,s){ha[ns++]=e,ha[ns++]=t,ha[ns++]=n,ha[ns++]=s,fo|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function ho(e,t,n,s){return lr(e,t,n,s),sr(e)}function wl(e,t){return lr(e,null,null,t),sr(e)}function Wf(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var o=!1,c=e.return;c!==null;)c.childLanes|=n,s=c.alternate,s!==null&&(s.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-pt(n),e=c.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=n|536870912),c):null}function sr(e){if(50<vi)throw vi=0,Sc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ls={};function bg(e,t,n,s){this.tag=e,this.key=n,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,t,n,s){return new bg(e,t,n,s)}function mo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cn(e,t){var n=e.alternate;return n===null?(n=Wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Pf(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ir(e,t,n,s,o,c){var h=0;if(s=e,typeof e=="function")mo(e)&&(h=1);else if(typeof e=="string")h=_0(e,n,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ue:return e=Wt(31,n,t,o),e.elementType=Ue,e.lanes=c,e;case $:return Sl(n.children,o,c,t);case L:h=8,o|=24;break;case H:return e=Wt(12,n,t,o|2),e.elementType=H,e.lanes=c,e;case V:return e=Wt(13,n,t,o),e.elementType=V,e.lanes=c,e;case _e:return e=Wt(19,n,t,o),e.elementType=_e,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P:h=10;break e;case F:h=9;break e;case ne:h=11;break e;case I:h=14;break e;case ye:h=16,s=null;break e}h=29,n=Error(u(130,e===null?"null":typeof e,"")),s=null}return t=Wt(h,n,t,o),t.elementType=e,t.type=s,t.lanes=c,t}function Sl(e,t,n,s){return e=Wt(7,e,s,t),e.lanes=n,e}function po(e,t,n){return e=Wt(6,e,null,t),e.lanes=n,e}function eh(e){var t=Wt(18,null,null,0);return t.stateNode=e,t}function xo(e,t,n){return t=Wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var th=new WeakMap;function ma(e,t){if(typeof e=="object"&&e!==null){var n=th.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Rn(t)},th.set(e,t),t)}return{value:e,source:t,stack:Rn(t)}}var ss=[],is=0,rr=null,Fs=0,pa=[],xa=0,zn=null,Ia=1,Ka="";function dn(e,t){ss[is++]=Fs,ss[is++]=rr,rr=e,Fs=t}function ah(e,t,n){pa[xa++]=Ia,pa[xa++]=Ka,pa[xa++]=zn,zn=e;var s=Ia;e=Ka;var o=32-pt(s)-1;s&=~(1<<o),n+=1;var c=32-pt(t)+o;if(30<c){var h=o-o%5;c=(s&(1<<h)-1).toString(32),s>>=h,o-=h,Ia=1<<32-pt(t)+o|n<<o|s,Ka=c+e}else Ia=1<<c|n<<o|s,Ka=e}function yo(e){e.return!==null&&(dn(e,1),ah(e,1,0))}function vo(e){for(;e===rr;)rr=ss[--is],ss[is]=null,Fs=ss[--is],ss[is]=null;for(;e===zn;)zn=pa[--xa],pa[xa]=null,Ka=pa[--xa],pa[xa]=null,Ia=pa[--xa],pa[xa]=null}function nh(e,t){pa[xa++]=Ia,pa[xa++]=Ka,pa[xa++]=zn,Ia=t.id,Ka=t.overflow,zn=e}var Ot=null,st=null,Le=!1,Bn=null,ya=!1,go=Error(u(519));function qn(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ws(ma(t,e)),go}function lh(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[dt]=e,t[wt]=s,n){case"dialog":Ee("cancel",t),Ee("close",t);break;case"iframe":case"object":case"embed":Ee("load",t);break;case"video":case"audio":for(n=0;n<bi.length;n++)Ee(bi[n],t);break;case"source":Ee("error",t);break;case"img":case"image":case"link":Ee("error",t),Ee("load",t);break;case"details":Ee("toggle",t);break;case"input":Ee("invalid",t),yf(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ee("invalid",t);break;case"textarea":Ee("invalid",t),gf(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||wp(t.textContent,n)?(s.popover!=null&&(Ee("beforetoggle",t),Ee("toggle",t)),s.onScroll!=null&&Ee("scroll",t),s.onScrollEnd!=null&&Ee("scrollend",t),s.onClick!=null&&(t.onclick=un),t=!0):t=!1,t||qn(e,!0)}function sh(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:ya=!1;return;case 27:case 3:ya=!0;return;default:Ot=Ot.return}}function rs(e){if(e!==Ot)return!1;if(!Le)return sh(e),Le=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||zc(e.type,e.memoizedProps)),n=!n),n&&st&&qn(e),sh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));st=Rp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));st=Rp(e)}else t===27?(t=st,Pn(e.type)?(e=Yc,Yc=null,st=e):st=t):st=Ot?ga(e.stateNode.nextSibling):null;return!0}function jl(){st=Ot=null,Le=!1}function bo(){var e=Bn;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),Bn=null),e}function Ws(e){Bn===null?Bn=[e]:Bn.push(e)}var wo=N(null),Nl=null,fn=null;function Hn(e,t,n){W(wo,t._currentValue),t._currentValue=n}function hn(e){e._currentValue=wo.current,Y(wo)}function So(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function jo(e,t,n,s){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var h=o.child;c=c.firstContext;e:for(;c!==null;){var g=c;c=o;for(var S=0;S<t.length;S++)if(g.context===t[S]){c.lanes|=n,g=c.alternate,g!==null&&(g.lanes|=n),So(c.return,n,e),s||(h=null);break e}c=g.next}}else if(o.tag===18){if(h=o.return,h===null)throw Error(u(341));h.lanes|=n,c=h.alternate,c!==null&&(c.lanes|=n),So(h,n,e),h=null}else h=o.child;if(h!==null)h.return=o;else for(h=o;h!==null;){if(h===e){h=null;break}if(o=h.sibling,o!==null){o.return=h.return,h=o;break}h=h.return}o=h}}function us(e,t,n,s){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var h=o.alternate;if(h===null)throw Error(u(387));if(h=h.memoizedProps,h!==null){var g=o.type;Ft(o.pendingProps.value,h.value)||(e!==null?e.push(g):e=[g])}}else if(o===de.current){if(h=o.alternate,h===null)throw Error(u(387));h.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(_i):e=[_i])}o=o.return}e!==null&&jo(t,e,n,s),t.flags|=262144}function ur(e){for(e=e.firstContext;e!==null;){if(!Ft(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _l(e){Nl=e,fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Lt(e){return ih(Nl,e)}function or(e,t){return Nl===null&&_l(e),ih(e,t)}function ih(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fn===null){if(e===null)throw Error(u(308));fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fn=fn.next=t;return n}var wg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Sg=a.unstable_scheduleCallback,jg=a.unstable_NormalPriority,St={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function No(){return{controller:new wg,data:new Map,refCount:0}}function Ps(e){e.refCount--,e.refCount===0&&Sg(jg,function(){e.controller.abort()})}var ei=null,_o=0,os=0,cs=null;function Ng(e,t){if(ei===null){var n=ei=[];_o=0,os=Ec(),cs={status:"pending",value:void 0,then:function(s){n.push(s)}}}return _o++,t.then(rh,rh),t}function rh(){if(--_o===0&&ei!==null){cs!==null&&(cs.status="fulfilled");var e=ei;ei=null,os=0,cs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _g(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),s}var uh=U.S;U.S=function(e,t){Gm=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ng(e,t),uh!==null&&uh(e,t)};var kl=N(null);function ko(){var e=kl.current;return e!==null?e:et.pooledCache}function cr(e,t){t===null?W(kl,kl.current):W(kl,t.pool)}function oh(){var e=ko();return e===null?null:{parent:St._currentValue,pool:e}}var ds=Error(u(460)),Ao=Error(u(474)),dr=Error(u(542)),fr={then:function(){}};function ch(e){return e=e.status,e==="fulfilled"||e==="rejected"}function dh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(un,un),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hh(e),e;default:if(typeof t.status=="string")t.then(un,un);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hh(e),e}throw El=t,ds}}function Al(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(El=n,ds):n}}var El=null;function fh(){if(El===null)throw Error(u(459));var e=El;return El=null,e}function hh(e){if(e===ds||e===dr)throw Error(u(483))}var fs=null,ti=0;function hr(e){var t=ti;return ti+=1,fs===null&&(fs=[]),dh(fs,e,t)}function ai(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function mr(e,t){throw t.$$typeof===D?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function mh(e){function t(k,_){if(e){var R=k.deletions;R===null?(k.deletions=[_],k.flags|=16):R.push(_)}}function n(k,_){if(!e)return null;for(;_!==null;)t(k,_),_=_.sibling;return null}function s(k){for(var _=new Map;k!==null;)k.key!==null?_.set(k.key,k):_.set(k.index,k),k=k.sibling;return _}function o(k,_){return k=cn(k,_),k.index=0,k.sibling=null,k}function c(k,_,R){return k.index=R,e?(R=k.alternate,R!==null?(R=R.index,R<_?(k.flags|=67108866,_):R):(k.flags|=67108866,_)):(k.flags|=1048576,_)}function h(k){return e&&k.alternate===null&&(k.flags|=67108866),k}function g(k,_,R,G){return _===null||_.tag!==6?(_=po(R,k.mode,G),_.return=k,_):(_=o(_,R),_.return=k,_)}function S(k,_,R,G){var fe=R.type;return fe===$?q(k,_,R.props.children,G,R.key):_!==null&&(_.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ye&&Al(fe)===_.type)?(_=o(_,R.props),ai(_,R),_.return=k,_):(_=ir(R.type,R.key,R.props,null,k.mode,G),ai(_,R),_.return=k,_)}function T(k,_,R,G){return _===null||_.tag!==4||_.stateNode.containerInfo!==R.containerInfo||_.stateNode.implementation!==R.implementation?(_=xo(R,k.mode,G),_.return=k,_):(_=o(_,R.children||[]),_.return=k,_)}function q(k,_,R,G,fe){return _===null||_.tag!==7?(_=Sl(R,k.mode,G,fe),_.return=k,_):(_=o(_,R),_.return=k,_)}function Q(k,_,R){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=po(""+_,k.mode,R),_.return=k,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case X:return R=ir(_.type,_.key,_.props,null,k.mode,R),ai(R,_),R.return=k,R;case C:return _=xo(_,k.mode,R),_.return=k,_;case ye:return _=Al(_),Q(k,_,R)}if(Ge(_)||rt(_))return _=Sl(_,k.mode,R,null),_.return=k,_;if(typeof _.then=="function")return Q(k,hr(_),R);if(_.$$typeof===P)return Q(k,or(k,_),R);mr(k,_)}return null}function O(k,_,R,G){var fe=_!==null?_.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return fe!==null?null:g(k,_,""+R,G);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case X:return R.key===fe?S(k,_,R,G):null;case C:return R.key===fe?T(k,_,R,G):null;case ye:return R=Al(R),O(k,_,R,G)}if(Ge(R)||rt(R))return fe!==null?null:q(k,_,R,G,null);if(typeof R.then=="function")return O(k,_,hr(R),G);if(R.$$typeof===P)return O(k,_,or(k,R),G);mr(k,R)}return null}function M(k,_,R,G,fe){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return k=k.get(R)||null,g(_,k,""+G,fe);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case X:return k=k.get(G.key===null?R:G.key)||null,S(_,k,G,fe);case C:return k=k.get(G.key===null?R:G.key)||null,T(_,k,G,fe);case ye:return G=Al(G),M(k,_,R,G,fe)}if(Ge(G)||rt(G))return k=k.get(R)||null,q(_,k,G,fe,null);if(typeof G.then=="function")return M(k,_,R,hr(G),fe);if(G.$$typeof===P)return M(k,_,R,or(_,G),fe);mr(_,G)}return null}function ie(k,_,R,G){for(var fe=null,He=null,oe=_,je=_=0,Te=null;oe!==null&&je<R.length;je++){oe.index>je?(Te=oe,oe=null):Te=oe.sibling;var $e=O(k,oe,R[je],G);if($e===null){oe===null&&(oe=Te);break}e&&oe&&$e.alternate===null&&t(k,oe),_=c($e,_,je),He===null?fe=$e:He.sibling=$e,He=$e,oe=Te}if(je===R.length)return n(k,oe),Le&&dn(k,je),fe;if(oe===null){for(;je<R.length;je++)oe=Q(k,R[je],G),oe!==null&&(_=c(oe,_,je),He===null?fe=oe:He.sibling=oe,He=oe);return Le&&dn(k,je),fe}for(oe=s(oe);je<R.length;je++)Te=M(oe,k,je,R[je],G),Te!==null&&(e&&Te.alternate!==null&&oe.delete(Te.key===null?je:Te.key),_=c(Te,_,je),He===null?fe=Te:He.sibling=Te,He=Te);return e&&oe.forEach(function(ll){return t(k,ll)}),Le&&dn(k,je),fe}function me(k,_,R,G){if(R==null)throw Error(u(151));for(var fe=null,He=null,oe=_,je=_=0,Te=null,$e=R.next();oe!==null&&!$e.done;je++,$e=R.next()){oe.index>je?(Te=oe,oe=null):Te=oe.sibling;var ll=O(k,oe,$e.value,G);if(ll===null){oe===null&&(oe=Te);break}e&&oe&&ll.alternate===null&&t(k,oe),_=c(ll,_,je),He===null?fe=ll:He.sibling=ll,He=ll,oe=Te}if($e.done)return n(k,oe),Le&&dn(k,je),fe;if(oe===null){for(;!$e.done;je++,$e=R.next())$e=Q(k,$e.value,G),$e!==null&&(_=c($e,_,je),He===null?fe=$e:He.sibling=$e,He=$e);return Le&&dn(k,je),fe}for(oe=s(oe);!$e.done;je++,$e=R.next())$e=M(oe,k,je,$e.value,G),$e!==null&&(e&&$e.alternate!==null&&oe.delete($e.key===null?je:$e.key),_=c($e,_,je),He===null?fe=$e:He.sibling=$e,He=$e);return e&&oe.forEach(function(U0){return t(k,U0)}),Le&&dn(k,je),fe}function We(k,_,R,G){if(typeof R=="object"&&R!==null&&R.type===$&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case X:e:{for(var fe=R.key;_!==null;){if(_.key===fe){if(fe=R.type,fe===$){if(_.tag===7){n(k,_.sibling),G=o(_,R.props.children),G.return=k,k=G;break e}}else if(_.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ye&&Al(fe)===_.type){n(k,_.sibling),G=o(_,R.props),ai(G,R),G.return=k,k=G;break e}n(k,_);break}else t(k,_);_=_.sibling}R.type===$?(G=Sl(R.props.children,k.mode,G,R.key),G.return=k,k=G):(G=ir(R.type,R.key,R.props,null,k.mode,G),ai(G,R),G.return=k,k=G)}return h(k);case C:e:{for(fe=R.key;_!==null;){if(_.key===fe)if(_.tag===4&&_.stateNode.containerInfo===R.containerInfo&&_.stateNode.implementation===R.implementation){n(k,_.sibling),G=o(_,R.children||[]),G.return=k,k=G;break e}else{n(k,_);break}else t(k,_);_=_.sibling}G=xo(R,k.mode,G),G.return=k,k=G}return h(k);case ye:return R=Al(R),We(k,_,R,G)}if(Ge(R))return ie(k,_,R,G);if(rt(R)){if(fe=rt(R),typeof fe!="function")throw Error(u(150));return R=fe.call(R),me(k,_,R,G)}if(typeof R.then=="function")return We(k,_,hr(R),G);if(R.$$typeof===P)return We(k,_,or(k,R),G);mr(k,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,_!==null&&_.tag===6?(n(k,_.sibling),G=o(_,R),G.return=k,k=G):(n(k,_),G=po(R,k.mode,G),G.return=k,k=G),h(k)):n(k,_)}return function(k,_,R,G){try{ti=0;var fe=We(k,_,R,G);return fs=null,fe}catch(oe){if(oe===ds||oe===dr)throw oe;var He=Wt(29,oe,null,k.mode);return He.lanes=G,He.return=k,He}finally{}}}var Cl=mh(!0),ph=mh(!1),$n=!1;function Eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Co(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 Yn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Vn(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ve&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=sr(e),Wf(e,null,n),t}return lr(e,s,t,n),sr(e)}function ni(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Zl(e,n)}}function Ro(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var To=!1;function li(){if(To){var e=cs;if(e!==null)throw e}}function si(e,t,n,s){To=!1;var o=e.updateQueue;$n=!1;var c=o.firstBaseUpdate,h=o.lastBaseUpdate,g=o.shared.pending;if(g!==null){o.shared.pending=null;var S=g,T=S.next;S.next=null,h===null?c=T:h.next=T,h=S;var q=e.alternate;q!==null&&(q=q.updateQueue,g=q.lastBaseUpdate,g!==h&&(g===null?q.firstBaseUpdate=T:g.next=T,q.lastBaseUpdate=S))}if(c!==null){var Q=o.baseState;h=0,q=T=S=null,g=c;do{var O=g.lane&-536870913,M=O!==g.lane;if(M?(Re&O)===O:(s&O)===O){O!==0&&O===os&&(To=!0),q!==null&&(q=q.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var ie=e,me=g;O=t;var We=n;switch(me.tag){case 1:if(ie=me.payload,typeof ie=="function"){Q=ie.call(We,Q,O);break e}Q=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=me.payload,O=typeof ie=="function"?ie.call(We,Q,O):ie,O==null)break e;Q=j({},Q,O);break e;case 2:$n=!0}}O=g.callback,O!==null&&(e.flags|=64,M&&(e.flags|=8192),M=o.callbacks,M===null?o.callbacks=[O]:M.push(O))}else M={lane:O,tag:g.tag,payload:g.payload,callback:g.callback,next:null},q===null?(T=q=M,S=Q):q=q.next=M,h|=O;if(g=g.next,g===null){if(g=o.shared.pending,g===null)break;M=g,g=M.next,M.next=null,o.lastBaseUpdate=M,o.shared.pending=null}}while(!0);q===null&&(S=Q),o.baseState=S,o.firstBaseUpdate=T,o.lastBaseUpdate=q,c===null&&(o.shared.lanes=0),In|=h,e.lanes=h,e.memoizedState=Q}}function xh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function yh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)xh(n[e],t)}var hs=N(null),pr=N(0);function vh(e,t){e=Sn,W(pr,e),W(hs,t),Sn=e|t.baseLanes}function Oo(){W(pr,Sn),W(hs,hs.current)}function Lo(){Sn=pr.current,Y(hs),Y(pr)}var Pt=N(null),va=null;function Zn(e){var t=e.alternate;W(yt,yt.current&1),W(Pt,e),va===null&&(t===null||hs.current!==null||t.memoizedState!==null)&&(va=e)}function Mo(e){W(yt,yt.current),W(Pt,e),va===null&&(va=e)}function gh(e){e.tag===22?(W(yt,yt.current),W(Pt,e),va===null&&(va=e)):Gn()}function Gn(){W(yt,yt.current),W(Pt,Pt.current)}function ea(e){Y(Pt),va===e&&(va=null),Y(yt)}var yt=N(0);function xr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Hc(n)||$c(n)))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 mn=0,be=null,Je=null,jt=null,yr=!1,ms=!1,Rl=!1,vr=0,ii=0,ps=null,kg=0;function ft(){throw Error(u(321))}function Do(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ft(e[n],t[n]))return!1;return!0}function Uo(e,t,n,s,o,c){return mn=c,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?am:Fo,Rl=!1,c=n(s,o),Rl=!1,ms&&(c=wh(t,n,s,o)),bh(e),c}function bh(e){U.H=oi;var t=Je!==null&&Je.next!==null;if(mn=0,jt=Je=be=null,yr=!1,ii=0,ps=null,t)throw Error(u(300));e===null||Nt||(e=e.dependencies,e!==null&&ur(e)&&(Nt=!0))}function wh(e,t,n,s){be=e;var o=0;do{if(ms&&(ps=null),ii=0,ms=!1,25<=o)throw Error(u(301));if(o+=1,jt=Je=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}U.H=nm,c=t(n,s)}while(ms);return c}function Ag(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?ri(t):t,e=e.useState()[0],(Je!==null?Je.memoizedState:null)!==e&&(be.flags|=1024),t}function zo(){var e=vr!==0;return vr=0,e}function Bo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function qo(e){if(yr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}yr=!1}mn=0,jt=Je=be=null,ms=!1,ii=vr=0,ps=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?be.memoizedState=jt=e:jt=jt.next=e,jt}function vt(){if(Je===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=jt===null?be.memoizedState:jt.next;if(t!==null)jt=t,Je=e;else{if(e===null)throw be.alternate===null?Error(u(467)):Error(u(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},jt===null?be.memoizedState=jt=e:jt=jt.next=e}return jt}function gr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ri(e){var t=ii;return ii+=1,ps===null&&(ps=[]),e=dh(ps,e,t),t=be,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?am:Fo),e}function br(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ri(e);if(e.$$typeof===P)return Lt(e)}throw Error(u(438,String(e)))}function Ho(e){var t=null,n=be.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=be.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=gr(),be.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=gt;return t.index++,n}function pn(e,t){return typeof t=="function"?t(e):t}function wr(e){var t=vt();return $o(t,Je,e)}function $o(e,t,n){var s=e.queue;if(s===null)throw Error(u(311));s.lastRenderedReducer=n;var o=e.baseQueue,c=s.pending;if(c!==null){if(o!==null){var h=o.next;o.next=c.next,c.next=h}t.baseQueue=o=c,s.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var g=h=null,S=null,T=t,q=!1;do{var Q=T.lane&-536870913;if(Q!==T.lane?(Re&Q)===Q:(mn&Q)===Q){var O=T.revertLane;if(O===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),Q===os&&(q=!0);else if((mn&O)===O){T=T.next,O===os&&(q=!0);continue}else Q={lane:0,revertLane:T.revertLane,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},S===null?(g=S=Q,h=c):S=S.next=Q,be.lanes|=O,In|=O;Q=T.action,Rl&&n(c,Q),c=T.hasEagerState?T.eagerState:n(c,Q)}else O={lane:Q,revertLane:T.revertLane,gesture:T.gesture,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},S===null?(g=S=O,h=c):S=S.next=O,be.lanes|=Q,In|=Q;T=T.next}while(T!==null&&T!==t);if(S===null?h=c:S.next=g,!Ft(c,e.memoizedState)&&(Nt=!0,q&&(n=cs,n!==null)))throw n;e.memoizedState=c,e.baseState=h,e.baseQueue=S,s.lastRenderedState=c}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Yo(e){var t=vt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var s=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var h=o=o.next;do c=e(c,h.action),h=h.next;while(h!==o);Ft(c,t.memoizedState)||(Nt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,s]}function Sh(e,t,n){var s=be,o=vt(),c=Le;if(c){if(n===void 0)throw Error(u(407));n=n()}else n=t();var h=!Ft((Je||o).memoizedState,n);if(h&&(o.memoizedState=n,Nt=!0),o=o.queue,Go(_h.bind(null,s,o,e),[e]),o.getSnapshot!==t||h||jt!==null&&jt.memoizedState.tag&1){if(s.flags|=2048,xs(9,{destroy:void 0},Nh.bind(null,s,o,n,t),null),et===null)throw Error(u(349));c||(mn&127)!==0||jh(s,t,n)}return n}function jh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=be.updateQueue,t===null?(t=gr(),be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nh(e,t,n,s){t.value=n,t.getSnapshot=s,kh(t)&&Ah(e)}function _h(e,t,n){return n(function(){kh(t)&&Ah(e)})}function kh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ft(e,n)}catch{return!0}}function Ah(e){var t=wl(e,2);t!==null&&It(t,e,2)}function Vo(e){var t=qt();if(typeof e=="function"){var n=e;if(e=n(),Rl){Ut(!0);try{n()}finally{Ut(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:e},t}function Eh(e,t,n,s){return e.baseState=n,$o(e,Je,typeof s=="function"?s:pn)}function Eg(e,t,n,s,o){if(Nr(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};U.T!==null?n(!0):c.isTransition=!1,s(c),n=t.pending,n===null?(c.next=t.pending=c,Ch(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Ch(e,t){var n=t.action,s=t.payload,o=e.state;if(t.isTransition){var c=U.T,h={};U.T=h;try{var g=n(o,s),S=U.S;S!==null&&S(h,g),Rh(e,t,g)}catch(T){Zo(e,t,T)}finally{c!==null&&h.types!==null&&(c.types=h.types),U.T=c}}else try{c=n(o,s),Rh(e,t,c)}catch(T){Zo(e,t,T)}}function Rh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){Th(e,t,s)},function(s){return Zo(e,t,s)}):Th(e,t,n)}function Th(e,t,n){t.status="fulfilled",t.value=n,Oh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ch(e,n)))}function Zo(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,Oh(t),t=t.next;while(t!==s)}e.action=null}function Oh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Lh(e,t){return t}function Mh(e,t){if(Le){var n=et.formState;if(n!==null){e:{var s=be;if(Le){if(st){t:{for(var o=st,c=ya;o.nodeType!==8;){if(!c){o=null;break t}if(o=ga(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){st=ga(o.nextSibling),s=o.data==="F!";break e}}qn(s)}s=!1}s&&(t=n[0])}}return n=qt(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lh,lastRenderedState:t},n.queue=s,n=Ph.bind(null,be,s),s.dispatch=n,s=Vo(!1),c=Jo.bind(null,be,!1,s.queue),s=qt(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,n=Eg.bind(null,be,o,c,n),o.dispatch=n,s.memoizedState=e,[t,n,!1]}function Dh(e){var t=vt();return Uh(t,Je,e)}function Uh(e,t,n){if(t=$o(e,t,Lh)[0],e=wr(pn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=ri(t)}catch(h){throw h===ds?dr:h}else s=t;t=vt();var o=t.queue,c=o.dispatch;return n!==t.memoizedState&&(be.flags|=2048,xs(9,{destroy:void 0},Cg.bind(null,o,n),null)),[s,c,e]}function Cg(e,t){e.action=t}function zh(e){var t=vt(),n=Je;if(n!==null)return Uh(t,n,e);vt(),t=t.memoizedState,n=vt();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function xs(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=be.updateQueue,t===null&&(t=gr(),be.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function Bh(){return vt().memoizedState}function Sr(e,t,n,s){var o=qt();be.flags|=e,o.memoizedState=xs(1|t,{destroy:void 0},n,s===void 0?null:s)}function jr(e,t,n,s){var o=vt();s=s===void 0?null:s;var c=o.memoizedState.inst;Je!==null&&s!==null&&Do(s,Je.memoizedState.deps)?o.memoizedState=xs(t,c,n,s):(be.flags|=e,o.memoizedState=xs(1|t,c,n,s))}function qh(e,t){Sr(8390656,8,e,t)}function Go(e,t){jr(2048,8,e,t)}function Rg(e){be.flags|=4;var t=be.updateQueue;if(t===null)t=gr(),be.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hh(e){var t=vt().memoizedState;return Rg({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function $h(e,t){return jr(4,2,e,t)}function Yh(e,t){return jr(4,4,e,t)}function Vh(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Zh(e,t,n){n=n!=null?n.concat([e]):null,jr(4,4,Vh.bind(null,t,e),n)}function Qo(){}function Gh(e,t){var n=vt();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Do(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Qh(e,t){var n=vt();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Do(t,s[1]))return s[0];if(s=e(),Rl){Ut(!0);try{e()}finally{Ut(!1)}}return n.memoizedState=[s,t],s}function Xo(e,t,n){return n===void 0||(mn&1073741824)!==0&&(Re&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Xm(),be.lanes|=e,In|=e,n)}function Xh(e,t,n,s){return Ft(n,t)?n:hs.current!==null?(e=Xo(e,n,s),Ft(e,t)||(Nt=!0),e):(mn&42)===0||(mn&1073741824)!==0&&(Re&261930)===0?(Nt=!0,e.memoizedState=n):(e=Xm(),be.lanes|=e,In|=e,t)}function Ih(e,t,n,s,o){var c=J.p;J.p=c!==0&&8>c?c:8;var h=U.T,g={};U.T=g,Jo(e,!1,t,n);try{var S=o(),T=U.S;if(T!==null&&T(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var q=_g(S,s);ui(e,t,q,na(e))}else ui(e,t,s,na(e))}catch(Q){ui(e,t,{then:function(){},status:"rejected",reason:Q},na())}finally{J.p=c,h!==null&&g.types!==null&&(h.types=g.types),U.T=h}}function Tg(){}function Io(e,t,n,s){if(e.tag!==5)throw Error(u(476));var o=Kh(e).queue;Ih(e,o,t,ue,n===null?Tg:function(){return Jh(e),n(s)})}function Kh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jh(e){var t=Kh(e);t.next===null&&(t=e.alternate.memoizedState),ui(e,t.next.queue,{},na())}function Ko(){return Lt(_i)}function Fh(){return vt().memoizedState}function Wh(){return vt().memoizedState}function Og(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=na();e=Yn(n);var s=Vn(t,e,n);s!==null&&(It(s,t,n),ni(s,t,n)),t={cache:No()},e.payload=t;return}t=t.return}}function Lg(e,t,n){var s=na();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Nr(e)?em(t,n):(n=ho(e,t,n,s),n!==null&&(It(n,e,s),tm(n,t,s)))}function Ph(e,t,n){var s=na();ui(e,t,n,s)}function ui(e,t,n,s){var o={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Nr(e))em(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,g=c(h,n);if(o.hasEagerState=!0,o.eagerState=g,Ft(g,h))return lr(e,t,o,0),et===null&&nr(),!1}catch{}finally{}if(n=ho(e,t,o,s),n!==null)return It(n,e,s),tm(n,t,s),!0}return!1}function Jo(e,t,n,s){if(s={lane:2,revertLane:Ec(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Nr(e)){if(t)throw Error(u(479))}else t=ho(e,n,s,2),t!==null&&It(t,e,2)}function Nr(e){var t=e.alternate;return e===be||t!==null&&t===be}function em(e,t){ms=yr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function tm(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Zl(e,n)}}var oi={readContext:Lt,use:br,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};oi.useEffectEvent=ft;var am={readContext:Lt,use:br,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:qh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Sr(4194308,4,Vh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Sr(4194308,4,e,t)},useInsertionEffect:function(e,t){Sr(4,2,e,t)},useMemo:function(e,t){var n=qt();t=t===void 0?null:t;var s=e();if(Rl){Ut(!0);try{e()}finally{Ut(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=qt();if(n!==void 0){var o=n(t);if(Rl){Ut(!0);try{n(t)}finally{Ut(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=Lg.bind(null,be,e),[s.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Ph.bind(null,be,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Qo,useDeferredValue:function(e,t){var n=qt();return Xo(n,e,t)},useTransition:function(){var e=Vo(!1);return e=Ih.bind(null,be,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=be,o=qt();if(Le){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),et===null)throw Error(u(349));(Re&127)!==0||jh(s,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,qh(_h.bind(null,s,c,e),[e]),s.flags|=2048,xs(9,{destroy:void 0},Nh.bind(null,s,c,n,t),null),n},useId:function(){var e=qt(),t=et.identifierPrefix;if(Le){var n=Ka,s=Ia;n=(s&~(1<<32-pt(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=vr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=kg++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ko,useFormState:Mh,useActionState:Mh,useOptimistic:function(e){var t=qt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Jo.bind(null,be,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ho,useCacheRefresh:function(){return qt().memoizedState=Og.bind(null,be)},useEffectEvent:function(e){var t=qt(),n={impl:e};return t.memoizedState=n,function(){if((Ve&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},Fo={readContext:Lt,use:br,useCallback:Gh,useContext:Lt,useEffect:Go,useImperativeHandle:Zh,useInsertionEffect:$h,useLayoutEffect:Yh,useMemo:Qh,useReducer:wr,useRef:Bh,useState:function(){return wr(pn)},useDebugValue:Qo,useDeferredValue:function(e,t){var n=vt();return Xh(n,Je.memoizedState,e,t)},useTransition:function(){var e=wr(pn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:ri(e),t]},useSyncExternalStore:Sh,useId:Fh,useHostTransitionStatus:Ko,useFormState:Dh,useActionState:Dh,useOptimistic:function(e,t){var n=vt();return Eh(n,Je,e,t)},useMemoCache:Ho,useCacheRefresh:Wh};Fo.useEffectEvent=Hh;var nm={readContext:Lt,use:br,useCallback:Gh,useContext:Lt,useEffect:Go,useImperativeHandle:Zh,useInsertionEffect:$h,useLayoutEffect:Yh,useMemo:Qh,useReducer:Yo,useRef:Bh,useState:function(){return Yo(pn)},useDebugValue:Qo,useDeferredValue:function(e,t){var n=vt();return Je===null?Xo(n,e,t):Xh(n,Je.memoizedState,e,t)},useTransition:function(){var e=Yo(pn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:ri(e),t]},useSyncExternalStore:Sh,useId:Fh,useHostTransitionStatus:Ko,useFormState:zh,useActionState:zh,useOptimistic:function(e,t){var n=vt();return Je!==null?Eh(n,Je,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Ho,useCacheRefresh:Wh};nm.useEffectEvent=Hh;function Wo(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Po={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=na(),o=Yn(s);o.payload=t,n!=null&&(o.callback=n),t=Vn(e,o,s),t!==null&&(It(t,e,s),ni(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=na(),o=Yn(s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Vn(e,o,s),t!==null&&(It(t,e,s),ni(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=na(),s=Yn(n);s.tag=2,t!=null&&(s.callback=t),t=Vn(e,s,n),t!==null&&(It(t,e,n),ni(t,e,n))}};function lm(e,t,n,s,o,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,c,h):t.prototype&&t.prototype.isPureReactComponent?!Ks(n,s)||!Ks(o,c):!0}function sm(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Po.enqueueReplaceState(t,t.state,null)}function Tl(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function im(e){ar(e)}function rm(e){console.error(e)}function um(e){ar(e)}function _r(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function om(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function ec(e,t,n){return n=Yn(n),n.tag=3,n.payload={element:null},n.callback=function(){_r(e,t)},n}function cm(e){return e=Yn(e),e.tag=3,e}function dm(e,t,n,s){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var c=s.value;e.payload=function(){return o(c)},e.callback=function(){om(t,n,s)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){om(t,n,s),typeof o!="function"&&(Kn===null?Kn=new Set([this]):Kn.add(this));var g=s.stack;this.componentDidCatch(s.value,{componentStack:g!==null?g:""})})}function Mg(e,t,n,s,o){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&us(t,n,o,!0),n=Pt.current,n!==null){switch(n.tag){case 31:case 13:return va===null?zr():n.alternate===null&&ht===0&&(ht=3),n.flags&=-257,n.flags|=65536,n.lanes=o,s===fr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),_c(e,s,o)),!1;case 22:return n.flags|=65536,s===fr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),_c(e,s,o)),!1}throw Error(u(435,n.tag))}return _c(e,s,o),zr(),!1}if(Le)return t=Pt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==go&&(e=Error(u(422),{cause:s}),Ws(ma(e,n)))):(s!==go&&(t=Error(u(423),{cause:s}),Ws(ma(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=ma(s,n),o=ec(e.stateNode,s,o),Ro(e,o),ht!==4&&(ht=2)),!1;var c=Error(u(520),{cause:s});if(c=ma(c,n),yi===null?yi=[c]:yi.push(c),ht!==4&&(ht=2),t===null)return!0;s=ma(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=ec(n.stateNode,s,e),Ro(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Kn===null||!Kn.has(c))))return n.flags|=65536,o&=-o,n.lanes|=o,o=cm(o),dm(o,e,n,s),Ro(n,o),!1}n=n.return}while(n!==null);return!1}var tc=Error(u(461)),Nt=!1;function Mt(e,t,n,s){t.child=e===null?ph(t,null,n,s):Cl(t,e.child,n,s)}function fm(e,t,n,s,o){n=n.render;var c=t.ref;if("ref"in s){var h={};for(var g in s)g!=="ref"&&(h[g]=s[g])}else h=s;return _l(t),s=Uo(e,t,n,h,c,o),g=zo(),e!==null&&!Nt?(Bo(e,t,o),xn(e,t,o)):(Le&&g&&yo(t),t.flags|=1,Mt(e,t,s,o),t.child)}function hm(e,t,n,s,o){if(e===null){var c=n.type;return typeof c=="function"&&!mo(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,mm(e,t,c,s,o)):(e=ir(n.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!oc(e,o)){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:Ks,n(h,s)&&e.ref===t.ref)return xn(e,t,o)}return t.flags|=1,e=cn(c,s),e.ref=t.ref,e.return=t,t.child=e}function mm(e,t,n,s,o){if(e!==null){var c=e.memoizedProps;if(Ks(c,s)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=s=c,oc(e,o))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,xn(e,t,o)}return ac(e,t,n,s,o)}function pm(e,t,n,s){var o=s.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(s=t.child=e.child,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~c}else s=0,t.child=null;return xm(e,t,c,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&cr(t,c!==null?c.cachePool:null),c!==null?vh(t,c):Oo(),gh(t);else return s=t.lanes=536870912,xm(e,t,c!==null?c.baseLanes|n:n,n,s)}else c!==null?(cr(t,c.cachePool),vh(t,c),Gn(),t.memoizedState=null):(e!==null&&cr(t,null),Oo(),Gn());return Mt(e,t,o,n),t.child}function ci(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function xm(e,t,n,s,o){var c=ko();return c=c===null?null:{parent:St._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&cr(t,null),Oo(),gh(t),e!==null&&us(e,t,s,!0),t.childLanes=o,null}function kr(e,t){return t=Er({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ym(e,t,n){return Cl(t,e.child,null,n),e=kr(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function Dg(e,t,n){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(s.mode==="hidden")return e=kr(t,s),t.lanes=536870912,ci(null,e);if(Mo(t),(e=st)?(e=Cp(e,ya),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zn!==null?{id:Ia,overflow:Ka}:null,retryLane:536870912,hydrationErrors:null},n=eh(e),n.return=t,t.child=n,Ot=t,st=null)):e=null,e===null)throw qn(t);return t.lanes=536870912,null}return kr(t,s)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(Mo(t),o)if(t.flags&256)t.flags&=-257,t=ym(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(Nt||us(e,t,n,!1),o=(n&e.childLanes)!==0,Nt||o){if(s=et,s!==null&&(h=pl(s,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,wl(e,h),It(s,e,h),tc;zr(),t=ym(e,t,n)}else e=c.treeContext,st=ga(h.nextSibling),Ot=t,Le=!0,Bn=null,ya=!1,e!==null&&nh(t,e),t=kr(t,s),t.flags|=4096;return t}return e=cn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ar(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ac(e,t,n,s,o){return _l(t),n=Uo(e,t,n,s,void 0,o),s=zo(),e!==null&&!Nt?(Bo(e,t,o),xn(e,t,o)):(Le&&s&&yo(t),t.flags|=1,Mt(e,t,n,o),t.child)}function vm(e,t,n,s,o,c){return _l(t),t.updateQueue=null,n=wh(t,s,n,o),bh(e),s=zo(),e!==null&&!Nt?(Bo(e,t,c),xn(e,t,c)):(Le&&s&&yo(t),t.flags|=1,Mt(e,t,n,c),t.child)}function gm(e,t,n,s,o){if(_l(t),t.stateNode===null){var c=ls,h=n.contextType;typeof h=="object"&&h!==null&&(c=Lt(h)),c=new n(s,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Po,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=s,c.state=t.memoizedState,c.refs={},Eo(t),h=n.contextType,c.context=typeof h=="object"&&h!==null?Lt(h):ls,c.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(Wo(t,n,h,s),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&Po.enqueueReplaceState(c,c.state,null),si(t,s,c,o),li(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){c=t.stateNode;var g=t.memoizedProps,S=Tl(n,g);c.props=S;var T=c.context,q=n.contextType;h=ls,typeof q=="object"&&q!==null&&(h=Lt(q));var Q=n.getDerivedStateFromProps;q=typeof Q=="function"||typeof c.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,q||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(g||T!==h)&&sm(t,c,s,h),$n=!1;var O=t.memoizedState;c.state=O,si(t,s,c,o),li(),T=t.memoizedState,g||O!==T||$n?(typeof Q=="function"&&(Wo(t,n,Q,s),T=t.memoizedState),(S=$n||lm(t,n,S,s,O,T,h))?(q||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=T),c.props=s,c.state=T,c.context=h,s=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{c=t.stateNode,Co(e,t),h=t.memoizedProps,q=Tl(n,h),c.props=q,Q=t.pendingProps,O=c.context,T=n.contextType,S=ls,typeof T=="object"&&T!==null&&(S=Lt(T)),g=n.getDerivedStateFromProps,(T=typeof g=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==Q||O!==S)&&sm(t,c,s,S),$n=!1,O=t.memoizedState,c.state=O,si(t,s,c,o),li();var M=t.memoizedState;h!==Q||O!==M||$n||e!==null&&e.dependencies!==null&&ur(e.dependencies)?(typeof g=="function"&&(Wo(t,n,g,s),M=t.memoizedState),(q=$n||lm(t,n,q,s,O,M,S)||e!==null&&e.dependencies!==null&&ur(e.dependencies))?(T||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,M,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,M,S)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=M),c.props=s,c.state=M,c.context=S,s=q):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),s=!1)}return c=s,Ar(e,t),s=(t.flags&128)!==0,c||s?(c=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&s?(t.child=Cl(t,e.child,null,o),t.child=Cl(t,null,n,o)):Mt(e,t,n,o),t.memoizedState=c.state,e=t.child):e=xn(e,t,o),e}function bm(e,t,n,s){return jl(),t.flags|=256,Mt(e,t,n,s),t.child}var nc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lc(e){return{baseLanes:e,cachePool:oh()}}function sc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=aa),e}function wm(e,t,n){var s=t.pendingProps,o=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(yt.current&2)!==0),h&&(o=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(o?Zn(t):Gn(),(e=st)?(e=Cp(e,ya),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zn!==null?{id:Ia,overflow:Ka}:null,retryLane:536870912,hydrationErrors:null},n=eh(e),n.return=t,t.child=n,Ot=t,st=null)):e=null,e===null)throw qn(t);return $c(e)?t.lanes=32:t.lanes=536870912,null}var g=s.children;return s=s.fallback,o?(Gn(),o=t.mode,g=Er({mode:"hidden",children:g},o),s=Sl(s,o,n,null),g.return=t,s.return=t,g.sibling=s,t.child=g,s=t.child,s.memoizedState=lc(n),s.childLanes=sc(e,h,n),t.memoizedState=nc,ci(null,s)):(Zn(t),ic(t,g))}var S=e.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(c)t.flags&256?(Zn(t),t.flags&=-257,t=rc(e,t,n)):t.memoizedState!==null?(Gn(),t.child=e.child,t.flags|=128,t=null):(Gn(),g=s.fallback,o=t.mode,s=Er({mode:"visible",children:s.children},o),g=Sl(g,o,n,null),g.flags|=2,s.return=t,g.return=t,s.sibling=g,t.child=s,Cl(t,e.child,null,n),s=t.child,s.memoizedState=lc(n),s.childLanes=sc(e,h,n),t.memoizedState=nc,t=ci(null,s));else if(Zn(t),$c(g)){if(h=g.nextSibling&&g.nextSibling.dataset,h)var T=h.dgst;h=T,s=Error(u(419)),s.stack="",s.digest=h,Ws({value:s,source:null,stack:null}),t=rc(e,t,n)}else if(Nt||us(e,t,n,!1),h=(n&e.childLanes)!==0,Nt||h){if(h=et,h!==null&&(s=pl(h,n),s!==0&&s!==S.retryLane))throw S.retryLane=s,wl(e,s),It(h,e,s),tc;Hc(g)||zr(),t=rc(e,t,n)}else Hc(g)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,st=ga(g.nextSibling),Ot=t,Le=!0,Bn=null,ya=!1,e!==null&&nh(t,e),t=ic(t,s.children),t.flags|=4096);return t}return o?(Gn(),g=s.fallback,o=t.mode,S=e.child,T=S.sibling,s=cn(S,{mode:"hidden",children:s.children}),s.subtreeFlags=S.subtreeFlags&65011712,T!==null?g=cn(T,g):(g=Sl(g,o,n,null),g.flags|=2),g.return=t,s.return=t,s.sibling=g,t.child=s,ci(null,s),s=t.child,g=e.child.memoizedState,g===null?g=lc(n):(o=g.cachePool,o!==null?(S=St._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=oh(),g={baseLanes:g.baseLanes|n,cachePool:o}),s.memoizedState=g,s.childLanes=sc(e,h,n),t.memoizedState=nc,ci(e.child,s)):(Zn(t),n=e.child,e=n.sibling,n=cn(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function ic(e,t){return t=Er({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Er(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function rc(e,t,n){return Cl(t,e.child,null,n),e=ic(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sm(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),So(e.return,t,n)}function uc(e,t,n,s,o,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:o,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=s,h.tail=n,h.tailMode=o,h.treeForkCount=c)}function jm(e,t,n){var s=t.pendingProps,o=s.revealOrder,c=s.tail;s=s.children;var h=yt.current,g=(h&2)!==0;if(g?(h=h&1|2,t.flags|=128):h&=1,W(yt,h),Mt(e,t,s,n),s=Le?Fs:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sm(e,n,t);else if(e.tag===19)Sm(e,n,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(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&xr(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),uc(t,!1,o,n,c,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&xr(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}uc(t,!0,n,null,c,s);break;case"together":uc(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function xn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),In|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(us(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=cn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function oc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ur(e)))}function Ug(e,t,n){switch(t.tag){case 3:Qe(t,t.stateNode.containerInfo),Hn(t,St,e.memoizedState.cache),jl();break;case 27:case 5:Bt(t);break;case 4:Qe(t,t.stateNode.containerInfo);break;case 10:Hn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Mo(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Zn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?wm(e,t,n):(Zn(t),e=xn(e,t,n),e!==null?e.sibling:null);Zn(t);break;case 19:var o=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(us(e,t,n,!1),s=(n&t.childLanes)!==0),o){if(s)return jm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),W(yt,yt.current),s)break;return null;case 22:return t.lanes=0,pm(e,t,n,t.pendingProps);case 24:Hn(t,St,e.memoizedState.cache)}return xn(e,t,n)}function Nm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!oc(e,n)&&(t.flags&128)===0)return Nt=!1,Ug(e,t,n);Nt=(e.flags&131072)!==0}else Nt=!1,Le&&(t.flags&1048576)!==0&&ah(t,Fs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Al(t.elementType),t.type=e,typeof e=="function")mo(e)?(s=Tl(e,s),t.tag=1,t=gm(null,t,e,s,n)):(t.tag=0,t=ac(null,t,e,s,n));else{if(e!=null){var o=e.$$typeof;if(o===ne){t.tag=11,t=fm(null,t,e,s,n);break e}else if(o===I){t.tag=14,t=hm(null,t,e,s,n);break e}}throw t=nt(e)||e,Error(u(306,t,""))}}return t;case 0:return ac(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,o=Tl(s,t.pendingProps),gm(e,t,s,o,n);case 3:e:{if(Qe(t,t.stateNode.containerInfo),e===null)throw Error(u(387));s=t.pendingProps;var c=t.memoizedState;o=c.element,Co(e,t),si(t,s,null,n);var h=t.memoizedState;if(s=h.cache,Hn(t,St,s),s!==c.cache&&jo(t,[St],n,!0),li(),s=h.element,c.isDehydrated)if(c={element:s,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=bm(e,t,s,n);break e}else if(s!==o){o=ma(Error(u(424)),t),Ws(o),t=bm(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(st=ga(e.firstChild),Ot=t,Le=!0,Bn=null,ya=!0,n=ph(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(jl(),s===o){t=xn(e,t,n);break e}Mt(e,t,s,n)}t=t.child}return t;case 26:return Ar(e,t),e===null?(n=Dp(t.type,null,t.pendingProps,null))?t.memoizedState=n:Le||(n=t.type,e=t.pendingProps,s=Zr(z.current).createElement(n),s[dt]=t,s[wt]=e,Dt(s,n,e),Ct(s),t.stateNode=s):t.memoizedState=Dp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Bt(t),e===null&&Le&&(s=t.stateNode=Op(t.type,t.pendingProps,z.current),Ot=t,ya=!0,o=st,Pn(t.type)?(Yc=o,st=ga(s.firstChild)):st=o),Mt(e,t,t.pendingProps.children,n),Ar(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((o=s=st)&&(s=f0(s,t.type,t.pendingProps,ya),s!==null?(t.stateNode=s,Ot=t,st=ga(s.firstChild),ya=!1,o=!0):o=!1),o||qn(t)),Bt(t),o=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,s=c.children,zc(o,c)?s=null:h!==null&&zc(o,h)&&(t.flags|=32),t.memoizedState!==null&&(o=Uo(e,t,Ag,null,null,n),_i._currentValue=o),Ar(e,t),Mt(e,t,s,n),t.child;case 6:return e===null&&Le&&((e=n=st)&&(n=h0(n,t.pendingProps,ya),n!==null?(t.stateNode=n,Ot=t,st=null,e=!0):e=!1),e||qn(t)),null;case 13:return wm(e,t,n);case 4:return Qe(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Cl(t,null,s,n):Mt(e,t,s,n),t.child;case 11:return fm(e,t,t.type,t.pendingProps,n);case 7:return Mt(e,t,t.pendingProps,n),t.child;case 8:return Mt(e,t,t.pendingProps.children,n),t.child;case 12:return Mt(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,Hn(t,t.type,s.value),Mt(e,t,s.children,n),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,_l(t),o=Lt(o),s=s(o),t.flags|=1,Mt(e,t,s,n),t.child;case 14:return hm(e,t,t.type,t.pendingProps,n);case 15:return mm(e,t,t.type,t.pendingProps,n);case 19:return jm(e,t,n);case 31:return Dg(e,t,n);case 22:return pm(e,t,n,t.pendingProps);case 24:return _l(t),s=Lt(St),e===null?(o=ko(),o===null&&(o=et,c=No(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=n),o=c),t.memoizedState={parent:s,cache:o},Eo(t),Hn(t,St,o)):((e.lanes&n)!==0&&(Co(e,t),si(t,null,null,n),li()),o=e.memoizedState,c=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Hn(t,St,s)):(s=c.cache,Hn(t,St,s),s!==o.cache&&jo(t,[St],n,!0))),Mt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function yn(e){e.flags|=4}function cc(e,t,n,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(Fm())e.flags|=8192;else throw El=fr,Ao}else e.flags&=-16777217}function _m(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Hp(t))if(Fm())e.flags|=8192;else throw El=fr,Ao}function Cr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hl():536870912,e.lanes|=t,bs|=t)}function di(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function zg(e,t,n){var s=t.pendingProps;switch(vo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),hn(St),ze(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(rs(t)?yn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,bo())),it(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(yn(t),c!==null?(it(t),_m(t,c)):(it(t),cc(t,o,null,s,n))):c?c!==e.memoizedState?(yn(t),it(t),_m(t,c)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&yn(t),it(t),cc(t,o,e,s,n)),null;case 27:if(Ra(t),n=z.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&yn(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return it(t),null}e=te.current,rs(t)?lh(t):(e=Op(o,s,n),t.stateNode=e,yn(t))}return it(t),null;case 5:if(Ra(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&yn(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return it(t),null}if(c=te.current,rs(t))lh(t);else{var h=Zr(z.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}c[dt]=t,c[wt]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(Dt(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&yn(t)}}return it(t),cc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&yn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(u(166));if(e=z.current,rs(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,o=Ot,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||wp(e.nodeValue,n)),e||qn(t,!0)}else e=Zr(e).createTextNode(s),e[dt]=t,t.stateNode=e}return it(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=rs(t),n!==null){if(e===null){if(!s)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[dt]=t}else jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else n=bo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ea(t),t):(ea(t),null);if((t.flags&128)!==0)throw Error(u(558))}return it(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=rs(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[dt]=t}else jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),o=!1}else o=bo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(ea(t),t):(ea(t),null)}return ea(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Cr(t,t.updateQueue),it(t),null);case 4:return ze(),e===null&&Oc(t.stateNode.containerInfo),it(t),null;case 10:return hn(t.type),it(t),null;case 19:if(Y(yt),s=t.memoizedState,s===null)return it(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)di(s,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=xr(e),c!==null){for(t.flags|=128,di(s,!1),e=c.updateQueue,t.updateQueue=e,Cr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Pf(n,e),n=n.sibling;return W(yt,yt.current&1|2),Le&&dn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&tt()>Mr&&(t.flags|=128,o=!0,di(s,!1),t.lanes=4194304)}else{if(!o)if(e=xr(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Cr(t,e),di(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!Le)return it(t),null}else 2*tt()-s.renderingStartTime>Mr&&n!==536870912&&(t.flags|=128,o=!0,di(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=tt(),e.sibling=null,n=yt.current,W(yt,o?n&1|2:n&1),Le&&dn(t,s.treeForkCount),e):(it(t),null);case 22:case 23:return ea(t),Lo(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),n=t.updateQueue,n!==null&&Cr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&Y(kl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),hn(St),it(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Bg(e,t){switch(vo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hn(St),ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ra(t),null;case 31:if(t.memoizedState!==null){if(ea(t),t.alternate===null)throw Error(u(340));jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ea(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(yt),null;case 4:return ze(),null;case 10:return hn(t.type),null;case 22:case 23:return ea(t),Lo(),e!==null&&Y(kl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return hn(St),null;case 25:return null;default:return null}}function km(e,t){switch(vo(t),t.tag){case 3:hn(St),ze();break;case 26:case 27:case 5:Ra(t);break;case 4:ze();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:Y(yt);break;case 10:hn(t.type);break;case 22:case 23:ea(t),Lo(),e!==null&&Y(kl);break;case 24:hn(St)}}function fi(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var o=s.next;n=o;do{if((n.tag&e)===e){s=void 0;var c=n.create,h=n.inst;s=c(),h.destroy=s}n=n.next}while(n!==o)}}catch(g){Ie(t,t.return,g)}}function Qn(e,t,n){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var h=s.inst,g=h.destroy;if(g!==void 0){h.destroy=void 0,o=t;var S=n,T=g;try{T()}catch(q){Ie(o,S,q)}}}s=s.next}while(s!==c)}}catch(q){Ie(t,t.return,q)}}function Am(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{yh(t,n)}catch(s){Ie(e,e.return,s)}}}function Em(e,t,n){n.props=Tl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Ie(e,t,s)}}function hi(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(o){Ie(e,t,o)}}function Ja(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(o){Ie(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){Ie(e,t,o)}else n.current=null}function Cm(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(o){Ie(e,e.return,o)}}function dc(e,t,n){try{var s=e.stateNode;i0(s,e.type,n,t),s[wt]=t}catch(o){Ie(e,e.return,o)}}function Rm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Pn(e.type)||e.tag===4}function fc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rm(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&&Pn(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 hc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=un));else if(s!==4&&(s===27&&Pn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(hc(e,t,n),e=e.sibling;e!==null;)hc(e,t,n),e=e.sibling}function Rr(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Pn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Rr(e,t,n),e=e.sibling;e!==null;)Rr(e,t,n),e=e.sibling}function Tm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Dt(t,s,n),t[dt]=e,t[wt]=n}catch(c){Ie(e,e.return,c)}}var vn=!1,_t=!1,mc=!1,Om=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function qg(e,t){if(e=e.containerInfo,Dc=Fr,e=Zf(e),io(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var o=s.anchorOffset,c=s.focusNode;s=s.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var h=0,g=-1,S=-1,T=0,q=0,Q=e,O=null;t:for(;;){for(var M;Q!==n||o!==0&&Q.nodeType!==3||(g=h+o),Q!==c||s!==0&&Q.nodeType!==3||(S=h+s),Q.nodeType===3&&(h+=Q.nodeValue.length),(M=Q.firstChild)!==null;)O=Q,Q=M;for(;;){if(Q===e)break t;if(O===n&&++T===o&&(g=h),O===c&&++q===s&&(S=h),(M=Q.nextSibling)!==null)break;Q=O,O=Q.parentNode}Q=M}n=g===-1||S===-1?null:{start:g,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uc={focusedElem:e,selectionRange:n},Fr=!1,Rt=t;Rt!==null;)if(t=Rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Rt=e;else for(;Rt!==null;){switch(t=Rt,c=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(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,o=c.memoizedProps,c=c.memoizedState,s=n.stateNode;try{var ie=Tl(n.type,o);e=s.getSnapshotBeforeUpdate(ie,c),s.__reactInternalSnapshotBeforeUpdate=e}catch(me){Ie(n,n.return,me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)qc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":qc(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(u(163))}if(e=t.sibling,e!==null){e.return=t.return,Rt=e;break}Rt=t.return}}function Lm(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:bn(e,n),s&4&&fi(5,n);break;case 1:if(bn(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Ie(n,n.return,h)}else{var o=Tl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Ie(n,n.return,h)}}s&64&&Am(n),s&512&&hi(n,n.return);break;case 3:if(bn(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{yh(e,t)}catch(h){Ie(n,n.return,h)}}break;case 27:t===null&&s&4&&Tm(n);case 26:case 5:bn(e,n),t===null&&s&4&&Cm(n),s&512&&hi(n,n.return);break;case 12:bn(e,n);break;case 31:bn(e,n),s&4&&Um(e,n);break;case 13:bn(e,n),s&4&&zm(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ig.bind(null,n),m0(e,n))));break;case 22:if(s=n.memoizedState!==null||vn,!s){t=t!==null&&t.memoizedState!==null||_t,o=vn;var c=_t;vn=s,(_t=t)&&!c?wn(e,n,(n.subtreeFlags&8772)!==0):bn(e,n),vn=o,_t=c}break;case 30:break;default:bn(e,n)}}function Mm(e){var t=e.alternate;t!==null&&(e.alternate=null,Mm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(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 ut=null,Zt=!1;function gn(e,t,n){for(n=n.child;n!==null;)Dm(e,t,n),n=n.sibling}function Dm(e,t,n){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Qa,n)}catch{}switch(n.tag){case 26:_t||Ja(n,t),gn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:_t||Ja(n,t);var s=ut,o=Zt;Pn(n.type)&&(ut=n.stateNode,Zt=!1),gn(e,t,n),Si(n.stateNode),ut=s,Zt=o;break;case 5:_t||Ja(n,t);case 6:if(s=ut,o=Zt,ut=null,gn(e,t,n),ut=s,Zt=o,ut!==null)if(Zt)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(n.stateNode)}catch(c){Ie(n,t,c)}else try{ut.removeChild(n.stateNode)}catch(c){Ie(n,t,c)}break;case 18:ut!==null&&(Zt?(e=ut,Ap(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Es(e)):Ap(ut,n.stateNode));break;case 4:s=ut,o=Zt,ut=n.stateNode.containerInfo,Zt=!0,gn(e,t,n),ut=s,Zt=o;break;case 0:case 11:case 14:case 15:Qn(2,n,t),_t||Qn(4,n,t),gn(e,t,n);break;case 1:_t||(Ja(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&Em(n,t,s)),gn(e,t,n);break;case 21:gn(e,t,n);break;case 22:_t=(s=_t)||n.memoizedState!==null,gn(e,t,n),_t=s;break;default:gn(e,t,n)}}function Um(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Es(e)}catch(n){Ie(t,t.return,n)}}}function zm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Es(e)}catch(n){Ie(t,t.return,n)}}function Hg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Om),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Om),t;default:throw Error(u(435,e.tag))}}function Tr(e,t){var n=Hg(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var o=Kg.bind(null,e,s);s.then(o,o)}})}function Gt(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var o=n[s],c=e,h=t,g=h;e:for(;g!==null;){switch(g.tag){case 27:if(Pn(g.type)){ut=g.stateNode,Zt=!1;break e}break;case 5:ut=g.stateNode,Zt=!1;break e;case 3:case 4:ut=g.stateNode.containerInfo,Zt=!0;break e}g=g.return}if(ut===null)throw Error(u(160));Dm(c,h,o),ut=null,Zt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Bm(t,e),t=t.sibling}var Da=null;function Bm(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Qt(e),s&4&&(Qn(3,e,e.return),fi(3,e),Qn(5,e,e.return));break;case 1:Gt(t,e),Qt(e),s&512&&(_t||n===null||Ja(n,n.return)),s&64&&vn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var o=Da;if(Gt(t,e),Qt(e),s&512&&(_t||n===null||Ja(n,n.return)),s&4){var c=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(s){case"title":c=o.getElementsByTagName("title")[0],(!c||c[ve]||c[dt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(s),o.head.insertBefore(c,o.querySelector("head > title"))),Dt(c,s,n),c[dt]=e,Ct(c),s=c;break e;case"link":var h=Bp("link","href",o).get(s+(n.href||""));if(h){for(var g=0;g<h.length;g++)if(c=h[g],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){h.splice(g,1);break t}}c=o.createElement(s),Dt(c,s,n),o.head.appendChild(c);break;case"meta":if(h=Bp("meta","content",o).get(s+(n.content||""))){for(g=0;g<h.length;g++)if(c=h[g],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){h.splice(g,1);break t}}c=o.createElement(s),Dt(c,s,n),o.head.appendChild(c);break;default:throw Error(u(468,s))}c[dt]=e,Ct(c),s=c}e.stateNode=s}else qp(o,e.type,e.stateNode);else e.stateNode=zp(o,s,e.memoizedProps);else c!==s?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,s===null?qp(o,e.type,e.stateNode):zp(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&dc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Gt(t,e),Qt(e),s&512&&(_t||n===null||Ja(n,n.return)),n!==null&&s&4&&dc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Gt(t,e),Qt(e),s&512&&(_t||n===null||Ja(n,n.return)),e.flags&32){o=e.stateNode;try{Fl(o,"")}catch(ie){Ie(e,e.return,ie)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,dc(e,o,n!==null?n.memoizedProps:o)),s&1024&&(mc=!0);break;case 6:if(Gt(t,e),Qt(e),s&4){if(e.stateNode===null)throw Error(u(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(ie){Ie(e,e.return,ie)}}break;case 3:if(Xr=null,o=Da,Da=Gr(t.containerInfo),Gt(t,e),Da=o,Qt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Es(t.containerInfo)}catch(ie){Ie(e,e.return,ie)}mc&&(mc=!1,qm(e));break;case 4:s=Da,Da=Gr(e.stateNode.containerInfo),Gt(t,e),Qt(e),Da=s;break;case 12:Gt(t,e),Qt(e);break;case 31:Gt(t,e),Qt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Tr(e,s)));break;case 13:Gt(t,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Lr=tt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Tr(e,s)));break;case 22:o=e.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,T=vn,q=_t;if(vn=T||o,_t=q||S,Gt(t,e),_t=q,vn=T,Qt(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||S||vn||_t||Ol(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){S=n=t;try{if(c=S.stateNode,o)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{g=S.stateNode;var Q=S.memoizedProps.style,O=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;g.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(ie){Ie(S,S.return,ie)}}}else if(t.tag===6){if(n===null){S=t;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch(ie){Ie(S,S.return,ie)}}}else if(t.tag===18){if(n===null){S=t;try{var M=S.stateNode;o?Ep(M,!0):Ep(S.stateNode,!1)}catch(ie){Ie(S,S.return,ie)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Tr(e,n))));break;case 19:Gt(t,e),Qt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Tr(e,s)));break;case 30:break;case 21:break;default:Gt(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(Rm(s)){n=s;break}s=s.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var o=n.stateNode,c=fc(e);Rr(e,c,o);break;case 5:var h=n.stateNode;n.flags&32&&(Fl(h,""),n.flags&=-33);var g=fc(e);Rr(e,g,h);break;case 3:case 4:var S=n.stateNode.containerInfo,T=fc(e);hc(e,T,S);break;default:throw Error(u(161))}}catch(q){Ie(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;qm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Lm(e,t.alternate,t),t=t.sibling}function Ol(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Qn(4,t,t.return),Ol(t);break;case 1:Ja(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Em(t,t.return,n),Ol(t);break;case 27:Si(t.stateNode);case 26:case 5:Ja(t,t.return),Ol(t);break;case 22:t.memoizedState===null&&Ol(t);break;case 30:Ol(t);break;default:Ol(t)}e=e.sibling}}function wn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,o=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:wn(o,c,n),fi(4,c);break;case 1:if(wn(o,c,n),s=c,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(T){Ie(s,s.return,T)}if(s=c,o=s.updateQueue,o!==null){var g=s.stateNode;try{var S=o.shared.hiddenCallbacks;if(S!==null)for(o.shared.hiddenCallbacks=null,o=0;o<S.length;o++)xh(S[o],g)}catch(T){Ie(s,s.return,T)}}n&&h&64&&Am(c),hi(c,c.return);break;case 27:Tm(c);case 26:case 5:wn(o,c,n),n&&s===null&&h&4&&Cm(c),hi(c,c.return);break;case 12:wn(o,c,n);break;case 31:wn(o,c,n),n&&h&4&&Um(o,c);break;case 13:wn(o,c,n),n&&h&4&&zm(o,c);break;case 22:c.memoizedState===null&&wn(o,c,n),hi(c,c.return);break;case 30:break;default:wn(o,c,n)}t=t.sibling}}function pc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ps(n))}function xc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e))}function Ua(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Hm(e,t,n,s),t=t.sibling}function Hm(e,t,n,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:Ua(e,t,n,s),o&2048&&fi(9,t);break;case 1:Ua(e,t,n,s);break;case 3:Ua(e,t,n,s),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e)));break;case 12:if(o&2048){Ua(e,t,n,s),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,g=c.onPostCommit;typeof g=="function"&&g(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Ie(t,t.return,S)}}else Ua(e,t,n,s);break;case 31:Ua(e,t,n,s);break;case 13:Ua(e,t,n,s);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Ua(e,t,n,s):mi(e,t):c._visibility&2?Ua(e,t,n,s):(c._visibility|=2,ys(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&pc(h,t);break;case 24:Ua(e,t,n,s),o&2048&&xc(t.alternate,t);break;default:Ua(e,t,n,s)}}function ys(e,t,n,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,g=n,S=s,T=h.flags;switch(h.tag){case 0:case 11:case 15:ys(c,h,g,S,o),fi(8,h);break;case 23:break;case 22:var q=h.stateNode;h.memoizedState!==null?q._visibility&2?ys(c,h,g,S,o):mi(c,h):(q._visibility|=2,ys(c,h,g,S,o)),o&&T&2048&&pc(h.alternate,h);break;case 24:ys(c,h,g,S,o),o&&T&2048&&xc(h.alternate,h);break;default:ys(c,h,g,S,o)}t=t.sibling}}function mi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,o=s.flags;switch(s.tag){case 22:mi(n,s),o&2048&&pc(s.alternate,s);break;case 24:mi(n,s),o&2048&&xc(s.alternate,s);break;default:mi(n,s)}t=t.sibling}}var pi=8192;function vs(e,t,n){if(e.subtreeFlags&pi)for(e=e.child;e!==null;)$m(e,t,n),e=e.sibling}function $m(e,t,n){switch(e.tag){case 26:vs(e,t,n),e.flags&pi&&e.memoizedState!==null&&k0(n,Da,e.memoizedState,e.memoizedProps);break;case 5:vs(e,t,n);break;case 3:case 4:var s=Da;Da=Gr(e.stateNode.containerInfo),vs(e,t,n),Da=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=pi,pi=16777216,vs(e,t,n),pi=s):vs(e,t,n));break;default:vs(e,t,n)}}function Ym(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 xi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Rt=s,Zm(s,e)}Ym(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vm(e),e=e.sibling}function Vm(e){switch(e.tag){case 0:case 11:case 15:xi(e),e.flags&2048&&Qn(9,e,e.return);break;case 3:xi(e);break;case 12:xi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Or(e)):xi(e);break;default:xi(e)}}function Or(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Rt=s,Zm(s,e)}Ym(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qn(8,t,t.return),Or(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Or(t));break;default:Or(t)}e=e.sibling}}function Zm(e,t){for(;Rt!==null;){var n=Rt;switch(n.tag){case 0:case 11:case 15:Qn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Ps(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Rt=s;else e:for(n=e;Rt!==null;){s=Rt;var o=s.sibling,c=s.return;if(Mm(s),s===n){Rt=null;break e}if(o!==null){o.return=c,Rt=o;break e}Rt=c}}}var $g={getCacheForType:function(e){var t=Lt(St),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Lt(St).controller.signal}},Yg=typeof WeakMap=="function"?WeakMap:Map,Ve=0,et=null,Ae=null,Re=0,Xe=0,ta=null,Xn=!1,gs=!1,yc=!1,Sn=0,ht=0,In=0,Ll=0,vc=0,aa=0,bs=0,yi=null,Xt=null,gc=!1,Lr=0,Gm=0,Mr=1/0,Dr=null,Kn=null,Et=0,Jn=null,ws=null,jn=0,bc=0,wc=null,Qm=null,vi=0,Sc=null;function na(){return(Ve&2)!==0&&Re!==0?Re&-Re:U.T!==null?Ec():Gl()}function Xm(){if(aa===0)if((Re&536870912)===0||Le){var e=Ta;Ta<<=1,(Ta&3932160)===0&&(Ta=262144),aa=e}else aa=536870912;return e=Pt.current,e!==null&&(e.flags|=32),aa}function It(e,t,n){(e===et&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)&&(Ss(e,0),Fn(e,Re,aa,!1)),sn(e,n),((Ve&2)===0||e!==et)&&(e===et&&((Ve&2)===0&&(Ll|=n),ht===4&&Fn(e,Re,aa,!1)),Fa(e))}function Im(e,t,n){if((Ve&6)!==0)throw Error(u(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ln(e,t),o=s?Gg(e,t):Nc(e,t,!0),c=s;do{if(o===0){gs&&!s&&Fn(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Vg(n)){o=Nc(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var g=e;o=yi;var S=g.current.memoizedState.isDehydrated;if(S&&(Ss(g,h).flags|=256),h=Nc(g,h,!1),h!==2){if(yc&&!S){g.errorRecoveryDisabledLanes|=c,Ll|=c,o=4;break e}c=Xt,Xt=o,c!==null&&(Xt===null?Xt=c:Xt.push.apply(Xt,c))}o=h}if(c=!1,o!==2)continue}}if(o===1){Ss(e,0),Fn(e,t,0,!0);break}e:{switch(s=e,c=o,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Fn(s,t,aa,!Xn);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=Lr+300-tt(),10<o)){if(Fn(s,t,aa,!Xn),Mn(s,0,!0)!==0)break e;jn=t,s.timeoutHandle=_p(Km.bind(null,s,n,Xt,Dr,gc,t,aa,Ll,bs,Xn,c,"Throttled",-0,0),o);break e}Km(s,n,Xt,Dr,gc,t,aa,Ll,bs,Xn,c,null,-0,0)}}break}while(!0);Fa(e)}function Km(e,t,n,s,o,c,h,g,S,T,q,Q,O,M){if(e.timeoutHandle=-1,Q=t.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:un},$m(t,c,Q);var ie=(c&62914560)===c?Lr-tt():(c&4194048)===c?Gm-tt():0;if(ie=A0(Q,ie),ie!==null){jn=c,e.cancelPendingCommit=ie(np.bind(null,e,t,c,n,s,o,h,g,S,q,Q,null,O,M)),Fn(e,c,h,!T);return}}np(e,t,c,n,s,o,h,g,S)}function Vg(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var o=n[s],c=o.getSnapshot;o=o.value;try{if(!Ft(c(),o))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Fn(e,t,n,s){t&=~vc,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var c=31-pt(o),h=1<<c;s[c]=-1,o&=~h}n!==0&&Vl(e,n,t)}function Ur(){return(Ve&6)===0?(gi(0),!1):!0}function jc(){if(Ae!==null){if(Xe===0)var e=Ae.return;else e=Ae,fn=Nl=null,qo(e),fs=null,ti=0,e=Ae;for(;e!==null;)km(e.alternate,e),e=e.return;Ae=null}}function Ss(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,o0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),jn=0,jc(),et=e,Ae=n=cn(e.current,null),Re=t,Xe=0,ta=null,Xn=!1,gs=ln(e,t),yc=!1,bs=aa=vc=Ll=In=ht=0,Xt=yi=null,gc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-pt(s),c=1<<o;t|=e[o],s&=~c}return Sn=t,nr(),n}function Jm(e,t){be=null,U.H=oi,t===ds||t===dr?(t=fh(),Xe=3):t===Ao?(t=fh(),Xe=4):Xe=t===tc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ta=t,Ae===null&&(ht=1,_r(e,ma(t,e.current)))}function Fm(){var e=Pt.current;return e===null?!0:(Re&4194048)===Re?va===null:(Re&62914560)===Re||(Re&536870912)!==0?e===va:!1}function Wm(){var e=U.H;return U.H=oi,e===null?oi:e}function Pm(){var e=U.A;return U.A=$g,e}function zr(){ht=4,Xn||(Re&4194048)!==Re&&Pt.current!==null||(gs=!0),(In&134217727)===0&&(Ll&134217727)===0||et===null||Fn(et,Re,aa,!1)}function Nc(e,t,n){var s=Ve;Ve|=2;var o=Wm(),c=Pm();(et!==e||Re!==t)&&(Dr=null,Ss(e,t)),t=!1;var h=ht;e:do try{if(Xe!==0&&Ae!==null){var g=Ae,S=ta;switch(Xe){case 8:jc(),h=6;break e;case 3:case 2:case 9:case 6:Pt.current===null&&(t=!0);var T=Xe;if(Xe=0,ta=null,js(e,g,S,T),n&&gs){h=0;break e}break;default:T=Xe,Xe=0,ta=null,js(e,g,S,T)}}Zg(),h=ht;break}catch(q){Jm(e,q)}while(!0);return t&&e.shellSuspendCounter++,fn=Nl=null,Ve=s,U.H=o,U.A=c,Ae===null&&(et=null,Re=0,nr()),h}function Zg(){for(;Ae!==null;)ep(Ae)}function Gg(e,t){var n=Ve;Ve|=2;var s=Wm(),o=Pm();et!==e||Re!==t?(Dr=null,Mr=tt()+500,Ss(e,t)):gs=ln(e,t);e:do try{if(Xe!==0&&Ae!==null){t=Ae;var c=ta;t:switch(Xe){case 1:Xe=0,ta=null,js(e,t,c,1);break;case 2:case 9:if(ch(c)){Xe=0,ta=null,tp(t);break}t=function(){Xe!==2&&Xe!==9||et!==e||(Xe=7),Fa(e)},c.then(t,t);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:ch(c)?(Xe=0,ta=null,tp(t)):(Xe=0,ta=null,js(e,t,c,7));break;case 5:var h=null;switch(Ae.tag){case 26:h=Ae.memoizedState;case 5:case 27:var g=Ae;if(h?Hp(h):g.stateNode.complete){Xe=0,ta=null;var S=g.sibling;if(S!==null)Ae=S;else{var T=g.return;T!==null?(Ae=T,Br(T)):Ae=null}break t}}Xe=0,ta=null,js(e,t,c,5);break;case 6:Xe=0,ta=null,js(e,t,c,6);break;case 8:jc(),ht=6;break e;default:throw Error(u(462))}}Qg();break}catch(q){Jm(e,q)}while(!0);return fn=Nl=null,U.H=s,U.A=o,Ve=n,Ae!==null?0:(et=null,Re=0,nr(),ht)}function Qg(){for(;Ae!==null&&!an();)ep(Ae)}function ep(e){var t=Nm(e.alternate,e,Sn);e.memoizedProps=e.pendingProps,t===null?Br(e):Ae=t}function tp(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=vm(n,t,t.pendingProps,t.type,void 0,Re);break;case 11:t=vm(n,t,t.pendingProps,t.type.render,t.ref,Re);break;case 5:qo(t);default:km(n,t),t=Ae=Pf(t,Sn),t=Nm(n,t,Sn)}e.memoizedProps=e.pendingProps,t===null?Br(e):Ae=t}function js(e,t,n,s){fn=Nl=null,qo(t),fs=null,ti=0;var o=t.return;try{if(Mg(e,o,t,n,Re)){ht=1,_r(e,ma(n,e.current)),Ae=null;return}}catch(c){if(o!==null)throw Ae=o,c;ht=1,_r(e,ma(n,e.current)),Ae=null;return}t.flags&32768?(Le||s===1?e=!0:gs||(Re&536870912)!==0?e=!1:(Xn=e=!0,(s===2||s===9||s===3||s===6)&&(s=Pt.current,s!==null&&s.tag===13&&(s.flags|=16384))),ap(t,e)):Br(t)}function Br(e){var t=e;do{if((t.flags&32768)!==0){ap(t,Xn);return}e=t.return;var n=zg(t.alternate,t,Sn);if(n!==null){Ae=n;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ht===0&&(ht=5)}function ap(e,t){do{var n=Bg(e.alternate,e);if(n!==null){n.flags&=32767,Ae=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=n}while(e!==null);ht=6,Ae=null}function np(e,t,n,s,o,c,h,g,S){e.cancelPendingCommit=null;do qr();while(Et!==0);if((Ve&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=fo,Hs(e,n,c,h,g,S),e===et&&(Ae=et=null,Re=0),ws=t,Jn=e,jn=n,bc=c,wc=o,Qm=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jg(Ga,function(){return up(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,o=J.p,J.p=2,h=Ve,Ve|=4;try{qg(e,t,n)}finally{Ve=h,J.p=o,U.T=s}}Et=1,lp(),sp(),ip()}}function lp(){if(Et===1){Et=0;var e=Jn,t=ws,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=U.T,U.T=null;var s=J.p;J.p=2;var o=Ve;Ve|=4;try{Bm(t,e);var c=Uc,h=Zf(e.containerInfo),g=c.focusedElem,S=c.selectionRange;if(h!==g&&g&&g.ownerDocument&&Vf(g.ownerDocument.documentElement,g)){if(S!==null&&io(g)){var T=S.start,q=S.end;if(q===void 0&&(q=T),"selectionStart"in g)g.selectionStart=T,g.selectionEnd=Math.min(q,g.value.length);else{var Q=g.ownerDocument||document,O=Q&&Q.defaultView||window;if(O.getSelection){var M=O.getSelection(),ie=g.textContent.length,me=Math.min(S.start,ie),We=S.end===void 0?me:Math.min(S.end,ie);!M.extend&&me>We&&(h=We,We=me,me=h);var k=Yf(g,me),_=Yf(g,We);if(k&&_&&(M.rangeCount!==1||M.anchorNode!==k.node||M.anchorOffset!==k.offset||M.focusNode!==_.node||M.focusOffset!==_.offset)){var R=Q.createRange();R.setStart(k.node,k.offset),M.removeAllRanges(),me>We?(M.addRange(R),M.extend(_.node,_.offset)):(R.setEnd(_.node,_.offset),M.addRange(R))}}}}for(Q=[],M=g;M=M.parentNode;)M.nodeType===1&&Q.push({element:M,left:M.scrollLeft,top:M.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<Q.length;g++){var G=Q[g];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}Fr=!!Dc,Uc=Dc=null}finally{Ve=o,J.p=s,U.T=n}}e.current=t,Et=2}}function sp(){if(Et===2){Et=0;var e=Jn,t=ws,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var s=J.p;J.p=2;var o=Ve;Ve|=4;try{Lm(e,t.alternate,t)}finally{Ve=o,J.p=s,U.T=n}}Et=3}}function ip(){if(Et===4||Et===3){Et=0,nn();var e=Jn,t=ws,n=jn,s=Qm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Et=5:(Et=0,ws=Jn=null,rp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Kn=null),xl(n),t=t.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Qa,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=U.T,o=J.p,J.p=2,U.T=null;try{for(var c=e.onRecoverableError,h=0;h<s.length;h++){var g=s[h];c(g.value,{componentStack:g.stack})}}finally{U.T=t,J.p=o}}(jn&3)!==0&&qr(),Fa(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===Sc?vi++:(vi=0,Sc=e):vi=0,gi(0)}}function rp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ps(t)))}function qr(){return lp(),sp(),ip(),up()}function up(){if(Et!==5)return!1;var e=Jn,t=bc;bc=0;var n=xl(jn),s=U.T,o=J.p;try{J.p=32>n?32:n,U.T=null,n=wc,wc=null;var c=Jn,h=jn;if(Et=0,ws=Jn=null,jn=0,(Ve&6)!==0)throw Error(u(331));var g=Ve;if(Ve|=4,Vm(c.current),Hm(c,c.current,h,n),Ve=g,gi(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Qa,c)}catch{}return!0}finally{J.p=o,U.T=s,rp(e,t)}}function op(e,t,n){t=ma(n,t),t=ec(e.stateNode,t,2),e=Vn(e,t,2),e!==null&&(sn(e,2),Fa(e))}function Ie(e,t,n){if(e.tag===3)op(e,e,n);else for(;t!==null;){if(t.tag===3){op(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Kn===null||!Kn.has(s))){e=ma(n,e),n=cm(2),s=Vn(t,n,2),s!==null&&(dm(n,s,t,e),sn(s,2),Fa(s));break}}t=t.return}}function _c(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Yg;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(n)||(yc=!0,o.add(n),e=Xg.bind(null,e,t,n),t.then(e,e))}function Xg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,et===e&&(Re&n)===n&&(ht===4||ht===3&&(Re&62914560)===Re&&300>tt()-Lr?(Ve&2)===0&&Ss(e,0):vc|=n,bs===Re&&(bs=0)),Fa(e)}function cp(e,t){t===0&&(t=hl()),e=wl(e,t),e!==null&&(sn(e,t),Fa(e))}function Ig(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),cp(e,n)}function Kg(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(u(314))}s!==null&&s.delete(t),cp(e,n)}function Jg(e,t){return Za(e,t)}var Hr=null,Ns=null,kc=!1,$r=!1,Ac=!1,Wn=0;function Fa(e){e!==Ns&&e.next===null&&(Ns===null?Hr=Ns=e:Ns=Ns.next=e),$r=!0,kc||(kc=!0,Wg())}function gi(e,t){if(!Ac&&$r){Ac=!0;do for(var n=!1,s=Hr;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var h=s.suspendedLanes,g=s.pingedLanes;c=(1<<31-pt(42|e)+1)-1,c&=o&~(h&~g),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,mp(s,c))}else c=Re,c=Mn(s,s===et?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||ln(s,c)||(n=!0,mp(s,c));s=s.next}while(n);Ac=!1}}function Fg(){dp()}function dp(){$r=kc=!1;var e=0;Wn!==0&&u0()&&(e=Wn);for(var t=tt(),n=null,s=Hr;s!==null;){var o=s.next,c=fp(s,t);c===0?(s.next=null,n===null?Hr=o:n.next=o,o===null&&(Ns=n)):(n=s,(e!==0||(c&3)!==0)&&($r=!0)),s=o}Et!==0&&Et!==5||gi(e),Wn!==0&&(Wn=0)}function fp(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-pt(c),g=1<<h,S=o[h];S===-1?((g&n)===0||(g&s)!==0)&&(o[h]=Tt(g,t)):S<=t&&(e.expiredLanes|=g),c&=~g}if(t=et,n=Re,n=Mn(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Tn(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ln(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Tn(s),xl(n)){case 2:case 8:n=fl;break;case 32:n=Ga;break;case 268435456:n=Yt;break;default:n=Ga}return s=hp.bind(null,e),n=Za(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Tn(s),e.callbackPriority=2,e.callbackNode=null,2}function hp(e,t){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(qr()&&e.callbackNode!==n)return null;var s=Re;return s=Mn(e,e===et?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Im(e,s,t),fp(e,tt()),e.callbackNode!=null&&e.callbackNode===n?hp.bind(null,e):null)}function mp(e,t){if(qr())return null;Im(e,t,!0)}function Wg(){c0(function(){(Ve&6)!==0?Za(ke,Fg):dp()})}function Ec(){if(Wn===0){var e=os;e===0&&(e=Xa,Xa<<=1,(Xa&261888)===0&&(Xa=256)),Wn=e}return Wn}function pp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ki(""+e)}function xp(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Pg(e,t,n,s,o){if(t==="submit"&&n&&n.stateNode===o){var c=pp((o[wt]||null).action),h=s.submitter;h&&(t=(t=h[wt]||null)?pp(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var g=new Pi("action","action",null,s,o);e.push({event:g,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Wn!==0){var S=h?xp(o,h):new FormData(o);Io(n,{pending:!0,data:S,method:o.method,action:c},null,S)}}else typeof c=="function"&&(g.preventDefault(),S=h?xp(o,h):new FormData(o),Io(n,{pending:!0,data:S,method:o.method,action:c},c,S))},currentTarget:o}]})}}for(var Cc=0;Cc<co.length;Cc++){var Rc=co[Cc],e0=Rc.toLowerCase(),t0=Rc[0].toUpperCase()+Rc.slice(1);Ma(e0,"on"+t0)}Ma(Xf,"onAnimationEnd"),Ma(If,"onAnimationIteration"),Ma(Kf,"onAnimationStart"),Ma("dblclick","onDoubleClick"),Ma("focusin","onFocus"),Ma("focusout","onBlur"),Ma(yg,"onTransitionRun"),Ma(vg,"onTransitionStart"),Ma(gg,"onTransitionCancel"),Ma(Jf,"onTransitionEnd"),Kl("onMouseEnter",["mouseout","mouseover"]),Kl("onMouseLeave",["mouseout","mouseover"]),Kl("onPointerEnter",["pointerout","pointerover"]),Kl("onPointerLeave",["pointerout","pointerover"]),yl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),yl("onBeforeInput",["compositionend","keypress","textInput","paste"]),yl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bi="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(" "),a0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bi));function yp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],o=s.event;s=s.listeners;e:{var c=void 0;if(t)for(var h=s.length-1;0<=h;h--){var g=s[h],S=g.instance,T=g.currentTarget;if(g=g.listener,S!==c&&o.isPropagationStopped())break e;c=g,o.currentTarget=T;try{c(o)}catch(q){ar(q)}o.currentTarget=null,c=S}else for(h=0;h<s.length;h++){if(g=s[h],S=g.instance,T=g.currentTarget,g=g.listener,S!==c&&o.isPropagationStopped())break e;c=g,o.currentTarget=T;try{c(o)}catch(q){ar(q)}o.currentTarget=null,c=S}}}}function Ee(e,t){var n=t[Se];n===void 0&&(n=t[Se]=new Set);var s=e+"__bubble";n.has(s)||(vp(t,e,2,!1),n.add(s))}function Tc(e,t,n){var s=0;t&&(s|=4),vp(n,e,s,t)}var Yr="_reactListening"+Math.random().toString(36).slice(2);function Oc(e){if(!e[Yr]){e[Yr]=!0,df.forEach(function(n){n!=="selectionchange"&&(a0.has(n)||Tc(n,!1,e),Tc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yr]||(t[Yr]=!0,Tc("selectionchange",!1,t))}}function vp(e,t,n,s){switch(Xp(t)){case 2:var o=R0;break;case 8:o=T0;break;default:o=Xc}n=o.bind(null,t,n,e),o=void 0,!Fu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Lc(e,t,n,s,o){var c=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var h=s.tag;if(h===3||h===4){var g=s.stateNode.containerInfo;if(g===o)break;if(h===4)for(h=s.return;h!==null;){var S=h.tag;if((S===3||S===4)&&h.stateNode.containerInfo===o)return;h=h.return}for(;g!==null;){if(h=Ql(g),h===null)return;if(S=h.tag,S===5||S===6||S===26||S===27){s=c=h;continue e}g=g.parentNode}}s=s.return}jf(function(){var T=c,q=Ku(n),Q=[];e:{var O=Ff.get(e);if(O!==void 0){var M=Pi,ie=e;switch(e){case"keypress":if(Fi(n)===0)break e;case"keydown":case"keyup":M=Kv;break;case"focusin":ie="focus",M=to;break;case"focusout":ie="blur",M=to;break;case"beforeblur":case"afterblur":M=to;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":M=kf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=zv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=Wv;break;case Xf:case If:case Kf:M=Hv;break;case Jf:M=eg;break;case"scroll":case"scrollend":M=Dv;break;case"wheel":M=ag;break;case"copy":case"cut":case"paste":M=Yv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=Ef;break;case"toggle":case"beforetoggle":M=lg}var me=(t&4)!==0,We=!me&&(e==="scroll"||e==="scrollend"),k=me?O!==null?O+"Capture":null:O;me=[];for(var _=T,R;_!==null;){var G=_;if(R=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||R===null||k===null||(G=Ys(_,k),G!=null&&me.push(wi(_,G,R))),We)break;_=_.return}0<me.length&&(O=new M(O,ie,null,n,q),Q.push({event:O,listeners:me}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",M=e==="mouseout"||e==="pointerout",O&&n!==Iu&&(ie=n.relatedTarget||n.fromElement)&&(Ql(ie)||ie[Z]))break e;if((M||O)&&(O=q.window===q?q:(O=q.ownerDocument)?O.defaultView||O.parentWindow:window,M?(ie=n.relatedTarget||n.toElement,M=T,ie=ie?Ql(ie):null,ie!==null&&(We=f(ie),me=ie.tag,ie!==We||me!==5&&me!==27&&me!==6)&&(ie=null)):(M=null,ie=T),M!==ie)){if(me=kf,G="onMouseLeave",k="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(me=Ef,G="onPointerLeave",k="onPointerEnter",_="pointer"),We=M==null?O:$s(M),R=ie==null?O:$s(ie),O=new me(G,_+"leave",M,n,q),O.target=We,O.relatedTarget=R,G=null,Ql(q)===T&&(me=new me(k,_+"enter",ie,n,q),me.target=R,me.relatedTarget=We,G=me),We=G,M&&ie)t:{for(me=n0,k=M,_=ie,R=0,G=k;G;G=me(G))R++;G=0;for(var fe=_;fe;fe=me(fe))G++;for(;0<R-G;)k=me(k),R--;for(;0<G-R;)_=me(_),G--;for(;R--;){if(k===_||_!==null&&k===_.alternate){me=k;break t}k=me(k),_=me(_)}me=null}else me=null;M!==null&&gp(Q,O,M,me,!1),ie!==null&&We!==null&&gp(Q,We,ie,me,!0)}}e:{if(O=T?$s(T):window,M=O.nodeName&&O.nodeName.toLowerCase(),M==="select"||M==="input"&&O.type==="file")var He=Uf;else if(Mf(O))if(zf)He=mg;else{He=fg;var oe=dg}else M=O.nodeName,!M||M.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?T&&Xu(T.elementType)&&(He=Uf):He=hg;if(He&&(He=He(e,T))){Df(Q,He,n,q);break e}oe&&oe(e,O,T),e==="focusout"&&T&&O.type==="number"&&T.memoizedProps.value!=null&&Qu(O,"number",O.value)}switch(oe=T?$s(T):window,e){case"focusin":(Mf(oe)||oe.contentEditable==="true")&&(ts=oe,ro=T,Js=null);break;case"focusout":Js=ro=ts=null;break;case"mousedown":uo=!0;break;case"contextmenu":case"mouseup":case"dragend":uo=!1,Gf(Q,n,q);break;case"selectionchange":if(xg)break;case"keydown":case"keyup":Gf(Q,n,q)}var je;if(no)e:{switch(e){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else es?Of(e,n)&&(Te="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Te="onCompositionStart");Te&&(Cf&&n.locale!=="ko"&&(es||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&es&&(je=Nf()):(Un=q,Wu="value"in Un?Un.value:Un.textContent,es=!0)),oe=Vr(T,Te),0<oe.length&&(Te=new Af(Te,e,null,n,q),Q.push({event:Te,listeners:oe}),je?Te.data=je:(je=Lf(n),je!==null&&(Te.data=je)))),(je=ig?rg(e,n):ug(e,n))&&(Te=Vr(T,"onBeforeInput"),0<Te.length&&(oe=new Af("onBeforeInput","beforeinput",null,n,q),Q.push({event:oe,listeners:Te}),oe.data=je)),Pg(Q,e,T,n,q)}yp(Q,t)})}function wi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vr(e,t){for(var n=t+"Capture",s=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=Ys(e,n),o!=null&&s.unshift(wi(e,o,c)),o=Ys(e,t),o!=null&&s.push(wi(e,o,c))),e.tag===3)return s;e=e.return}return[]}function n0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gp(e,t,n,s,o){for(var c=t._reactName,h=[];n!==null&&n!==s;){var g=n,S=g.alternate,T=g.stateNode;if(g=g.tag,S!==null&&S===s)break;g!==5&&g!==26&&g!==27||T===null||(S=T,o?(T=Ys(n,c),T!=null&&h.unshift(wi(n,T,S))):o||(T=Ys(n,c),T!=null&&h.push(wi(n,T,S)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var l0=/\r\n?/g,s0=/\u0000|\uFFFD/g;function bp(e){return(typeof e=="string"?e:""+e).replace(l0,`
|
|
49
|
-
`).replace(s0,"")}function wp(e,t){return t=bp(t),bp(e)===t}function Fe(e,t,n,s,o,c){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Fl(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Fl(e,""+s);break;case"className":Xi(e,"class",s);break;case"tabIndex":Xi(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Xi(e,n,s);break;case"style":wf(e,s,c);break;case"data":if(t!=="object"){Xi(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Ki(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(n==="formAction"?(t!=="input"&&Fe(e,t,"name",o.name,o,null),Fe(e,t,"formEncType",o.formEncType,o,null),Fe(e,t,"formMethod",o.formMethod,o,null),Fe(e,t,"formTarget",o.formTarget,o,null)):(Fe(e,t,"encType",o.encType,o,null),Fe(e,t,"method",o.method,o,null),Fe(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Ki(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=un);break;case"onScroll":s!=null&&Ee("scroll",e);break;case"onScrollEnd":s!=null&&Ee("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(n=s.__html,n!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=Ki(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Ee("beforetoggle",e),Ee("toggle",e),Qi(e,"popover",s);break;case"xlinkActuate":rn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":rn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":rn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":rn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":rn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":rn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":rn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":rn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":rn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Qi(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Lv.get(n)||n,Qi(e,n,s))}}function Mc(e,t,n,s,o,c){switch(n){case"style":wf(e,s,c);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(n=s.__html,n!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof s=="string"?Fl(e,s):(typeof s=="number"||typeof s=="bigint")&&Fl(e,""+s);break;case"onScroll":s!=null&&Ee("scroll",e);break;case"onScrollEnd":s!=null&&Ee("scrollend",e);break;case"onClick":s!=null&&(e.onclick=un);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ff.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),c=e[wt]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof s=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,o);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):Qi(e,n,s)}}}function Dt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ee("error",e),Ee("load",e);var s=!1,o=!1,c;for(c in n)if(n.hasOwnProperty(c)){var h=n[c];if(h!=null)switch(c){case"src":s=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Fe(e,t,c,h,n,null)}}o&&Fe(e,t,"srcSet",n.srcSet,n,null),s&&Fe(e,t,"src",n.src,n,null);return;case"input":Ee("invalid",e);var g=c=h=o=null,S=null,T=null;for(s in n)if(n.hasOwnProperty(s)){var q=n[s];if(q!=null)switch(s){case"name":o=q;break;case"type":h=q;break;case"checked":S=q;break;case"defaultChecked":T=q;break;case"value":c=q;break;case"defaultValue":g=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(u(137,t));break;default:Fe(e,t,s,q,n,null)}}yf(e,c,g,S,T,h,o,!1);return;case"select":Ee("invalid",e),s=h=c=null;for(o in n)if(n.hasOwnProperty(o)&&(g=n[o],g!=null))switch(o){case"value":c=g;break;case"defaultValue":h=g;break;case"multiple":s=g;default:Fe(e,t,o,g,n,null)}t=c,n=h,e.multiple=!!s,t!=null?Jl(e,!!s,t,!1):n!=null&&Jl(e,!!s,n,!0);return;case"textarea":Ee("invalid",e),c=o=s=null;for(h in n)if(n.hasOwnProperty(h)&&(g=n[h],g!=null))switch(h){case"value":s=g;break;case"defaultValue":o=g;break;case"children":c=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(u(91));break;default:Fe(e,t,h,g,n,null)}gf(e,s,o,c);return;case"option":for(S in n)if(n.hasOwnProperty(S)&&(s=n[S],s!=null))switch(S){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Fe(e,t,S,s,n,null)}return;case"dialog":Ee("beforetoggle",e),Ee("toggle",e),Ee("cancel",e),Ee("close",e);break;case"iframe":case"object":Ee("load",e);break;case"video":case"audio":for(s=0;s<bi.length;s++)Ee(bi[s],e);break;case"image":Ee("error",e),Ee("load",e);break;case"details":Ee("toggle",e);break;case"embed":case"source":case"link":Ee("error",e),Ee("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(T in n)if(n.hasOwnProperty(T)&&(s=n[T],s!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Fe(e,t,T,s,n,null)}return;default:if(Xu(t)){for(q in n)n.hasOwnProperty(q)&&(s=n[q],s!==void 0&&Mc(e,t,q,s,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(s=n[g],s!=null&&Fe(e,t,g,s,n,null))}function i0(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,h=null,g=null,S=null,T=null,q=null;for(M in n){var Q=n[M];if(n.hasOwnProperty(M)&&Q!=null)switch(M){case"checked":break;case"value":break;case"defaultValue":S=Q;default:s.hasOwnProperty(M)||Fe(e,t,M,null,s,Q)}}for(var O in s){var M=s[O];if(Q=n[O],s.hasOwnProperty(O)&&(M!=null||Q!=null))switch(O){case"type":c=M;break;case"name":o=M;break;case"checked":T=M;break;case"defaultChecked":q=M;break;case"value":h=M;break;case"defaultValue":g=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(u(137,t));break;default:M!==Q&&Fe(e,t,O,M,s,Q)}}Gu(e,h,g,S,T,q,c,o);return;case"select":M=h=g=O=null;for(c in n)if(S=n[c],n.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":M=S;default:s.hasOwnProperty(c)||Fe(e,t,c,null,s,S)}for(o in s)if(c=s[o],S=n[o],s.hasOwnProperty(o)&&(c!=null||S!=null))switch(o){case"value":O=c;break;case"defaultValue":g=c;break;case"multiple":h=c;default:c!==S&&Fe(e,t,o,c,s,S)}t=g,n=h,s=M,O!=null?Jl(e,!!n,O,!1):!!s!=!!n&&(t!=null?Jl(e,!!n,t,!0):Jl(e,!!n,n?[]:"",!1));return;case"textarea":M=O=null;for(g in n)if(o=n[g],n.hasOwnProperty(g)&&o!=null&&!s.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Fe(e,t,g,null,s,o)}for(h in s)if(o=s[h],c=n[h],s.hasOwnProperty(h)&&(o!=null||c!=null))switch(h){case"value":O=o;break;case"defaultValue":M=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(u(91));break;default:o!==c&&Fe(e,t,h,o,s,c)}vf(e,O,M);return;case"option":for(var ie in n)if(O=n[ie],n.hasOwnProperty(ie)&&O!=null&&!s.hasOwnProperty(ie))switch(ie){case"selected":e.selected=!1;break;default:Fe(e,t,ie,null,s,O)}for(S in s)if(O=s[S],M=n[S],s.hasOwnProperty(S)&&O!==M&&(O!=null||M!=null))switch(S){case"selected":e.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:Fe(e,t,S,O,s,M)}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 me in n)O=n[me],n.hasOwnProperty(me)&&O!=null&&!s.hasOwnProperty(me)&&Fe(e,t,me,null,s,O);for(T in s)if(O=s[T],M=n[T],s.hasOwnProperty(T)&&O!==M&&(O!=null||M!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:Fe(e,t,T,O,s,M)}return;default:if(Xu(t)){for(var We in n)O=n[We],n.hasOwnProperty(We)&&O!==void 0&&!s.hasOwnProperty(We)&&Mc(e,t,We,void 0,s,O);for(q in s)O=s[q],M=n[q],!s.hasOwnProperty(q)||O===M||O===void 0&&M===void 0||Mc(e,t,q,O,s,M);return}}for(var k in n)O=n[k],n.hasOwnProperty(k)&&O!=null&&!s.hasOwnProperty(k)&&Fe(e,t,k,null,s,O);for(Q in s)O=s[Q],M=n[Q],!s.hasOwnProperty(Q)||O===M||O==null&&M==null||Fe(e,t,Q,O,s,M)}function Sp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function r0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var o=n[s],c=o.transferSize,h=o.initiatorType,g=o.duration;if(c&&g&&Sp(h)){for(h=0,g=o.responseEnd,s+=1;s<n.length;s++){var S=n[s],T=S.startTime;if(T>g)break;var q=S.transferSize,Q=S.initiatorType;q&&Sp(Q)&&(S=S.responseEnd,h+=q*(S<g?1:(g-T)/(S-T)))}if(--s,t+=8*(c+h)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Dc=null,Uc=null;function Zr(e){return e.nodeType===9?e:e.ownerDocument}function jp(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 Np(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 Bc=null;function u0(){var e=window.event;return e&&e.type==="popstate"?e===Bc?!1:(Bc=e,!0):(Bc=null,!1)}var _p=typeof setTimeout=="function"?setTimeout:void 0,o0=typeof clearTimeout=="function"?clearTimeout:void 0,kp=typeof Promise=="function"?Promise:void 0,c0=typeof queueMicrotask=="function"?queueMicrotask:typeof kp<"u"?function(e){return kp.resolve(null).then(e).catch(d0)}:_p;function d0(e){setTimeout(function(){throw e})}function Pn(e){return e==="head"}function Ap(e,t){var n=t,s=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(o),Es(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")Si(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Si(n);for(var c=n.firstChild;c;){var h=c.nextSibling,g=c.nodeName;c[ve]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=h}}else n==="body"&&Si(e.ownerDocument.body);n=o}while(n);Es(t)}function Ep(e,t){var n=e;e=0;do{var s=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function qc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":qc(n),xt(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function f0(e,t,n,s){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[ve])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=ga(e.nextSibling),e===null)break}return null}function h0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ga(e.nextSibling),e===null))return null;return e}function Cp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ga(e.nextSibling),e===null))return null;return e}function Hc(e){return e.data==="$?"||e.data==="$~"}function $c(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function m0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function ga(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 Yc=null;function Rp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ga(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Tp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Op(e,t,n){switch(t=Zr(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Si(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var ba=new Map,Lp=new Set;function Gr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Nn=J.d;J.d={f:p0,r:x0,D:y0,C:v0,L:g0,m:b0,X:S0,S:w0,M:j0};function p0(){var e=Nn.f(),t=Ur();return e||t}function x0(e){var t=Xl(e);t!==null&&t.tag===5&&t.type==="form"?Jh(t):Nn.r(e)}var _s=typeof document>"u"?null:document;function Mp(e,t,n){var s=_s;if(s&&typeof t=="string"&&t){var o=fa(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),Lp.has(o)||(Lp.add(o),e={rel:e,crossOrigin:n,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),Dt(t,"link",e),Ct(t),s.head.appendChild(t)))}}function y0(e){Nn.D(e),Mp("dns-prefetch",e,null)}function v0(e,t){Nn.C(e,t),Mp("preconnect",e,t)}function g0(e,t,n){Nn.L(e,t,n);var s=_s;if(s&&e&&t){var o='link[rel="preload"][as="'+fa(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+fa(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+fa(n.imageSizes)+'"]')):o+='[href="'+fa(e)+'"]';var c=o;switch(t){case"style":c=ks(e);break;case"script":c=As(e)}ba.has(c)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ba.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(ji(c))||t==="script"&&s.querySelector(Ni(c))||(t=s.createElement("link"),Dt(t,"link",e),Ct(t),s.head.appendChild(t)))}}function b0(e,t){Nn.m(e,t);var n=_s;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+fa(s)+'"][href="'+fa(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=As(e)}if(!ba.has(c)&&(e=j({rel:"modulepreload",href:e},t),ba.set(c,e),n.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ni(c)))return}s=n.createElement("link"),Dt(s,"link",e),Ct(s),n.head.appendChild(s)}}}function w0(e,t,n){Nn.S(e,t,n);var s=_s;if(s&&e){var o=Il(s).hoistableStyles,c=ks(e);t=t||"default";var h=o.get(c);if(!h){var g={loading:0,preload:null};if(h=s.querySelector(ji(c)))g.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ba.get(c))&&Vc(e,n);var S=h=s.createElement("link");Ct(S),Dt(S,"link",e),S._p=new Promise(function(T,q){S.onload=T,S.onerror=q}),S.addEventListener("load",function(){g.loading|=1}),S.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Qr(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:g},o.set(c,h)}}}function S0(e,t){Nn.X(e,t);var n=_s;if(n&&e){var s=Il(n).hoistableScripts,o=As(e),c=s.get(o);c||(c=n.querySelector(Ni(o)),c||(e=j({src:e,async:!0},t),(t=ba.get(o))&&Zc(e,t),c=n.createElement("script"),Ct(c),Dt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function j0(e,t){Nn.M(e,t);var n=_s;if(n&&e){var s=Il(n).hoistableScripts,o=As(e),c=s.get(o);c||(c=n.querySelector(Ni(o)),c||(e=j({src:e,async:!0,type:"module"},t),(t=ba.get(o))&&Zc(e,t),c=n.createElement("script"),Ct(c),Dt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function Dp(e,t,n,s){var o=(o=z.current)?Gr(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ks(n.href),n=Il(o).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ks(n.href);var c=Il(o).hoistableStyles,h=c.get(e);if(h||(o=o.ownerDocument||o,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=o.querySelector(ji(e)))&&!c._p&&(h.instance=c,h.state.loading=5),ba.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ba.set(e,n),c||N0(o,e,n,h.state))),t&&s===null)throw Error(u(528,""));return h}if(t&&s!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=As(n),n=Il(o).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function ks(e){return'href="'+fa(e)+'"'}function ji(e){return'link[rel="stylesheet"]['+e+"]"}function Up(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function N0(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Dt(t,"link",n),Ct(t),e.head.appendChild(t))}function As(e){return'[src="'+fa(e)+'"]'}function Ni(e){return"script[async]"+e}function zp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+fa(n.href)+'"]');if(s)return t.instance=s,Ct(s),s;var o=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Ct(s),Dt(s,"style",o),Qr(s,n.precedence,e),t.instance=s;case"stylesheet":o=ks(n.href);var c=e.querySelector(ji(o));if(c)return t.state.loading|=4,t.instance=c,Ct(c),c;s=Up(n),(o=ba.get(o))&&Vc(s,o),c=(e.ownerDocument||e).createElement("link"),Ct(c);var h=c;return h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),Dt(c,"link",s),t.state.loading|=4,Qr(c,n.precedence,e),t.instance=c;case"script":return c=As(n.src),(o=e.querySelector(Ni(c)))?(t.instance=o,Ct(o),o):(s=n,(o=ba.get(c))&&(s=j({},n),Zc(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),Ct(o),Dt(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Qr(s,n.precedence,e));return t.instance}function Qr(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,h=0;h<s.length;h++){var g=s[h];if(g.dataset.precedence===t)c=g;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Vc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xr=null;function Bp(e,t,n){if(Xr===null){var s=new Map,o=Xr=new Map;o.set(n,s)}else o=Xr,s=o.get(n),s||(s=new Map,o.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var c=n[o];if(!(c[ve]||c[dt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var g=s.get(h);g?g.push(c):s.set(h,[c])}}return s}function qp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function _0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!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 Hp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function k0(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=ks(s.href),c=t.querySelector(ji(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ir.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,Ct(c);return}c=t.ownerDocument||t,s=Up(s),(o=ba.get(o))&&Vc(s,o),c=c.createElement("link"),Ct(c);var h=c;h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),Dt(c,"link",s),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ir.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Gc=0;function A0(e,t){return e.stylesheets&&e.count===0&&Jr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&Jr(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Gc===0&&(Gc=62500*r0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Jr(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Gc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function Ir(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Jr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Kr=null;function Jr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Kr=new Map,t.forEach(E0,e),Kr=null,Ir.call(e))}function E0(e,t){if(!(t.state.loading&4)){var n=Kr.get(e);if(n)var s=n.get(null);else{n=new Map,Kr.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var h=o[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),s=h)}s&&n.set(null,s)}o=t.instance,h=o.getAttribute("data-precedence"),c=n.get(h)||s,c===s&&n.set(null,o),n.set(h,o),this.count++,s=Ir.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var _i={$$typeof:P,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function C0(e,t,n,s,o,c,h,g,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=ml(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ml(0),this.hiddenUpdates=ml(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function $p(e,t,n,s,o,c,h,g,S,T,q,Q){return e=new C0(e,t,n,h,S,T,q,Q,g),t=1,c===!0&&(t|=24),c=Wt(3,null,null,t),e.current=c,c.stateNode=e,t=No(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:s,isDehydrated:n,cache:t},Eo(c),e}function Yp(e){return e?(e=ls,e):ls}function Vp(e,t,n,s,o,c){o=Yp(o),s.context===null?s.context=o:s.pendingContext=o,s=Yn(t),s.payload={element:n},c=c===void 0?null:c,c!==null&&(s.callback=c),n=Vn(e,s,t),n!==null&&(It(n,e,t),ni(n,e,t))}function Zp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Qc(e,t){Zp(e,t),(e=e.alternate)&&Zp(e,t)}function Gp(e){if(e.tag===13||e.tag===31){var t=wl(e,67108864);t!==null&&It(t,e,67108864),Qc(e,67108864)}}function Qp(e){if(e.tag===13||e.tag===31){var t=na();t=Dn(t);var n=wl(e,t);n!==null&&It(n,e,t),Qc(e,t)}}var Fr=!0;function R0(e,t,n,s){var o=U.T;U.T=null;var c=J.p;try{J.p=2,Xc(e,t,n,s)}finally{J.p=c,U.T=o}}function T0(e,t,n,s){var o=U.T;U.T=null;var c=J.p;try{J.p=8,Xc(e,t,n,s)}finally{J.p=c,U.T=o}}function Xc(e,t,n,s){if(Fr){var o=Ic(s);if(o===null)Lc(e,t,s,Wr,n),Ip(e,s);else if(L0(o,e,t,n,s))s.stopPropagation();else if(Ip(e,s),t&4&&-1<O0.indexOf(e)){for(;o!==null;){var c=Xl(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=oa(c.pendingLanes);if(h!==0){var g=c;for(g.pendingLanes|=2,g.entangledLanes|=2;h;){var S=1<<31-pt(h);g.entanglements[1]|=S,h&=~S}Fa(c),(Ve&6)===0&&(Mr=tt()+500,gi(0))}}break;case 31:case 13:g=wl(c,2),g!==null&&It(g,c,2),Ur(),Qc(c,2)}if(c=Ic(s),c===null&&Lc(e,t,s,Wr,n),c===o)break;o=c}o!==null&&s.stopPropagation()}else Lc(e,t,s,null,n)}}function Ic(e){return e=Ku(e),Kc(e)}var Wr=null;function Kc(e){if(Wr=null,e=Ql(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=x(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Wr=e,null}function Xp(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(dl()){case ke:return 2;case fl:return 8;case Ga:case On:return 32;case Yt:return 268435456;default:return 32}default:return 32}}var Jc=!1,el=null,tl=null,al=null,ki=new Map,Ai=new Map,nl=[],O0="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 Ip(e,t){switch(e){case"focusin":case"focusout":el=null;break;case"dragenter":case"dragleave":tl=null;break;case"mouseover":case"mouseout":al=null;break;case"pointerover":case"pointerout":ki.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ai.delete(t.pointerId)}}function Ei(e,t,n,s,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Xl(t),t!==null&&Gp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function L0(e,t,n,s,o){switch(t){case"focusin":return el=Ei(el,e,t,n,s,o),!0;case"dragenter":return tl=Ei(tl,e,t,n,s,o),!0;case"mouseover":return al=Ei(al,e,t,n,s,o),!0;case"pointerover":var c=o.pointerId;return ki.set(c,Ei(ki.get(c)||null,e,t,n,s,o)),!0;case"gotpointercapture":return c=o.pointerId,Ai.set(c,Ei(Ai.get(c)||null,e,t,n,s,o)),!0}return!1}function Kp(e){var t=Ql(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,La(e.priority,function(){Qp(n)});return}}else if(t===31){if(t=x(n),t!==null){e.blockedOn=t,La(e.priority,function(){Qp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ic(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Iu=s,n.target.dispatchEvent(s),Iu=null}else return t=Xl(n),t!==null&&Gp(t),e.blockedOn=n,!1;t.shift()}return!0}function Jp(e,t,n){Pr(e)&&n.delete(t)}function M0(){Jc=!1,el!==null&&Pr(el)&&(el=null),tl!==null&&Pr(tl)&&(tl=null),al!==null&&Pr(al)&&(al=null),ki.forEach(Jp),Ai.forEach(Jp)}function eu(e,t){e.blockedOn===t&&(e.blockedOn=null,Jc||(Jc=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,M0)))}var tu=null;function Fp(e){tu!==e&&(tu=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){tu===e&&(tu=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],o=e[t+2];if(typeof s!="function"){if(Kc(s||n)===null)continue;break}var c=Xl(n);c!==null&&(e.splice(t,3),t-=3,Io(c,{pending:!0,data:o,method:n.method,action:s},s,o))}}))}function Es(e){function t(S){return eu(S,e)}el!==null&&eu(el,e),tl!==null&&eu(tl,e),al!==null&&eu(al,e),ki.forEach(t),Ai.forEach(t);for(var n=0;n<nl.length;n++){var s=nl[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<nl.length&&(n=nl[0],n.blockedOn===null);)Kp(n),n.blockedOn===null&&nl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var o=n[s],c=n[s+1],h=o[wt]||null;if(typeof c=="function")h||Fp(n);else if(h){var g=null;if(c&&c.hasAttribute("formAction")){if(o=c,h=c[wt]||null)g=h.formAction;else if(Kc(o)!==null)continue}else g=h.action;typeof g=="function"?n[s+1]=g:(n.splice(s,3),s-=3),Fp(n)}}}function Wp(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return o=h})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Fc(e){this._internalRoot=e}au.prototype.render=Fc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,s=na();Vp(n,s,e,t,null,null)},au.prototype.unmount=Fc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Vp(e.current,2,null,e,null,null),Ur(),t[Z]=null}};function au(e){this._internalRoot=e}au.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<nl.length&&t!==0&&t<nl[n].priority;n++);nl.splice(n,0,e),n===0&&Kp(e)}};var Pp=l.version;if(Pp!=="19.2.7")throw Error(u(527,Pp,"19.2.7"));J.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=v(t),e=e!==null?w(e):null,e=e===null?null:e.stateNode,e};var D0={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nu.isDisabled&&nu.supportsFiber)try{Qa=nu.inject(D0),at=nu}catch{}}return Ri.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,s="",o=im,c=rm,h=um;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=$p(e,1,!1,null,null,n,s,null,o,c,h,Wp),e[Z]=t.current,Oc(e),new Fc(t)},Ri.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var s=!1,o="",c=im,h=rm,g=um,S=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),t=$p(e,1,!0,t,n??null,s,o,S,c,h,g,Wp),t.context=Yp(null),n=t.current,s=na(),s=Dn(s),o=Yn(s),o.callback=null,Vn(n,o,s),n=s,t.current.lanes=n,sn(t,n),Fa(t),e[Z]=t.current,Oc(e),new au(t)},Ri.version="19.2.7",Ri}var ox;function G0(){if(ox)return ed.exports;ox=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),ed.exports=Z0(),ed.exports}var Q0=G0();/**
|
|
50
|
-
* react-router v7.18.4
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var Vd=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ry=/^[\\/]{2}/;function X0(a,l){return l+a.replace(/\\/g,"/")}var cx="popstate";function dx(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function I0(a={}){function l(u,d){var v;let f=(v=d.state)==null?void 0:v.masked,{pathname:m,search:x,hash:y}=f||u.location;return _d("",{pathname:m,search:x,hash:y},d.state&&d.state.usr||null,d.state&&d.state.key||"default",f?{pathname:u.location.pathname,search:u.location.search,hash:u.location.hash}:void 0)}function i(u,d){return typeof d=="string"?d:Dl(d)}return J0(l,i,null,a)}function ot(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function Aa(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function K0(){return Math.random().toString(36).substring(2,10)}function fx(a,l){return{usr:a.state,key:a.key,idx:l,masked:a.mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function _d(a,l,i=null,u,d){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof l=="string"?Us(l):l,state:i,key:l&&l.key||u||K0(),mask:d}}function Dl({pathname:a="/",search:l="",hash:i=""}){return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function Us(a){let l={};if(a){let i=a.indexOf("#");i>=0&&(l.hash=a.substring(i),a=a.substring(0,i));let u=a.indexOf("?");u>=0&&(l.search=a.substring(u),a=a.substring(0,u)),a&&(l.pathname=a)}return l}function J0(a,l,i,u={}){let{window:d=document.defaultView,v5Compat:f=!1}=u,m=d.history,x="POP",y=null,v=w();v==null&&(v=0,m.replaceState({...m.state,idx:v},""));function w(){return(m.state||{idx:null}).idx}function j(){x="POP";let L=w(),H=L==null?null:L-v;v=L,y&&y({action:x,location:$.location,delta:H})}function D(L,H){x="PUSH";let F=dx(L)?L:_d($.location,L,H);v=w()+1;let P=fx(F,v),ne=$.createHref(F.mask||F);try{m.pushState(P,"",ne)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;d.location.assign(ne)}f&&y&&y({action:x,location:$.location,delta:1})}function X(L,H){x="REPLACE";let F=dx(L)?L:_d($.location,L,H);v=w();let P=fx(F,v),ne=$.createHref(F.mask||F);m.replaceState(P,"",ne),f&&y&&y({action:x,location:$.location,delta:0})}function C(L){return F0(d,L)}let $={get action(){return x},get location(){return a(d,m)},listen(L){if(y)throw new Error("A history only accepts one active listener");return d.addEventListener(cx,j),y=L,()=>{d.removeEventListener(cx,j),y=null}},createHref(L){return l(d,L)},createURL:C,encodeLocation(L){let H=C(L);return{pathname:H.pathname,search:H.search,hash:H.hash}},push:D,replace:X,go(L){return m.go(L)}};return $}function F0(a,l,i=!1){let u="http://localhost";a&&(u=a.location.origin!=="null"?a.location.origin:a.location.href),ot(u,"No window.location.(origin|href) available to create URL");let d=typeof l=="string"?l:Dl(l);return d=d.replace(/ $/,"%20"),!i&&ry.test(d)&&(d=u+d),new URL(d,u)}function uy(a,l,i="/"){return W0(a,l,i,!1)}function W0(a,l,i,u,d){let f=typeof l=="string"?Us(l):l,m=En(f.pathname||"/",i);if(m==null)return null;let x=P0(a),y=null,v=cb(m);for(let w=0;y==null&&w<x.length;++w)y=ob(x[w],v,u);return y}function P0(a){let l=oy(a);return eb(l),l}function oy(a,l=[],i=[],u="",d=!1){let f=(m,x,y=d,v)=>{let w={relativePath:v===void 0?m.path||"":v,caseSensitive:m.caseSensitive===!0,childrenIndex:x,route:m};if(w.relativePath.startsWith("/")){if(!w.relativePath.startsWith(u)&&y)return;ot(w.relativePath.startsWith(u),`Absolute route path "${w.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),w.relativePath=w.relativePath.slice(u.length)}let j=qa([u,w.relativePath]),D=i.concat(w);m.children&&m.children.length>0&&(ot(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),oy(m.children,l,D,j,y)),!(m.path==null&&!m.index)&&l.push({path:j,score:rb(j,m.index),routesMeta:D.map((X,C)=>{let[$,L]=fy(X.relativePath,X.caseSensitive,C===D.length-1);return{...X,matcher:$,compiledParams:L}})})};return a.forEach((m,x)=>{var y;if(m.path===""||!((y=m.path)!=null&&y.includes("?")))f(m,x);else for(let v of cy(m.path))f(m,x,!0,v)}),l}function cy(a){let l=a.split("/");if(l.length===0)return[];let[i,...u]=l,d=i.endsWith("?"),f=i.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let m=cy(u.join("/")),x=[];return x.push(...m.map(y=>y===""?f:[f,y].join("/"))),d&&x.push(...m),x.map(y=>a.startsWith("/")&&y===""?"/":y)}function eb(a){a.sort((l,i)=>l.score!==i.score?i.score-l.score:ub(l.routesMeta.map(u=>u.childrenIndex),i.routesMeta.map(u=>u.childrenIndex)))}var tb=/^:[\w-]+$/,ab=3,nb=2,lb=1,sb=10,ib=-2,hx=a=>a==="*";function rb(a,l){let i=a.split("/"),u=i.length;return i.some(hx)&&(u+=ib),l&&(u+=nb),i.filter(d=>!hx(d)).reduce((d,f)=>d+(tb.test(f)?ab:f===""?lb:sb),u)}function ub(a,l){return a.length===l.length&&a.slice(0,-1).every((u,d)=>u===l[d])?a[a.length-1]-l[l.length-1]:0}function ob(a,l,i=!1){let{routesMeta:u}=a,d={},f="/",m=[];for(let x=0;x<u.length;++x){let y=u[x],v=x===u.length-1,w=f==="/"?l:l.slice(f.length)||"/",j={path:y.relativePath,caseSensitive:y.caseSensitive,end:v},D=y.matcher&&y.compiledParams?dy(j,w,y.matcher,y.compiledParams):pu(j,w),X=y.route;if(!D&&v&&i&&!u[u.length-1].route.index&&(D=pu({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},w)),!D)return null;Object.assign(d,D.params),m.push({params:d,pathname:qa([f,D.pathname]),pathnameBase:hb(qa([f,D.pathnameBase])),route:X}),D.pathnameBase!=="/"&&(f=qa([f,D.pathnameBase]))}return m}function pu(a,l){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[i,u]=fy(a.path,a.caseSensitive,a.end);return dy(a,l,i,u)}function dy(a,l,i,u){let d=l.match(i);if(!d)return null;let f=d[0],m=Ls(f,1),x=d.slice(1);return{params:u.reduce((v,{paramName:w,isOptional:j},D)=>{if(w==="*"){let C=x[D]||"";m=Ls(f.slice(0,f.length-C.length),1)}const X=x[D];return j&&!X?v[w]=void 0:v[w]=(X||"").replace(/%2F/g,"/"),v},{}),pathname:f,pathnameBase:m,pattern:a}}function fy(a,l=!1,i=!0){Aa(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let u=[],d="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,x,y,v,w)=>{if(u.push({paramName:x,isOptional:y!=null}),y){let j=w.charAt(v+m.length);return j&&j!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(u.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,l?void 0:"i"),u]}function cb(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Aa(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),a}}function En(a,l){if(l==="/")return a;if(!a.toLowerCase().startsWith(l.toLowerCase()))return null;let i=l.endsWith("/")?l.length-1:l.length,u=a.charAt(i);return u&&u!=="/"?null:a.slice(i)||"/"}function db(a,l="/"){let{pathname:i,search:u="",hash:d=""}=typeof a=="string"?Us(a):a,f;return i?(i=hy(i),i.startsWith("/")||i.startsWith("\\")?f=mx(i.substring(1),"/"):f=mx(i,l)):f=l,{pathname:f,search:mb(u),hash:pb(d)}}function mx(a,l){let i=Ls(l).split("/");return a.split("/").forEach(d=>{d===".."?i.length>1&&i.pop():d!=="."&&i.push(d)}),i.length>1?i.join("/"):"/"}function ld(a,l,i,u){return`Cannot include a '${a}' character in a manually specified \`to.${l}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function fb(a){return a.filter((l,i)=>i===0||l.route.path&&l.route.path.length>0)}function Zd(a){let l=fb(a);return l.map((i,u)=>u===l.length-1?i.pathname:i.pathnameBase)}function Ru(a,l,i,u=!1){let d;typeof a=="string"?d=Us(a):(d={...a},ot(!d.pathname||!d.pathname.includes("?"),ld("?","pathname","search",d)),ot(!d.pathname||!d.pathname.includes("#"),ld("#","pathname","hash",d)),ot(!d.search||!d.search.includes("#"),ld("#","search","hash",d)));let f=a===""||d.pathname==="",m=f?"/":d.pathname,x;if(m==null)x=i;else{let j=l.length-1;if(!u&&m.startsWith("..")){let D=m.split("/");for(;D[0]==="..";)D.shift(),j-=1;d.pathname=D.join("/")}x=j>=0?l[j]:"/"}let y=db(d,x),v=m&&m!=="/"&&m.endsWith("/"),w=(f||m===".")&&i.endsWith("/");return!y.pathname.endsWith("/")&&(v||w)&&(y.pathname+="/"),y}var hy=a=>a.replace(/[\\/]{2,}/g,"/"),qa=a=>hy(a.join("/"));function Ls(a,l=0){let i=a.length;for(;i>l&&a.charCodeAt(i-1)===47;)i--;return i===a.length?a:a.slice(0,i)}var hb=a=>Ls(a).replace(/^\/*/,"/"),mb=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,pb=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,xb=class{constructor(a,l,i,u=!1){this.status=a,this.statusText=l||"",this.internal=u,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function yb(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function vb(a){let l=a.map(i=>i.route.path).filter(Boolean);return qa(l)||"/"}var my=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function py(a,l){let i=a;if(typeof i!="string"||!Vd.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let u=i,d=!1;if(my)try{let f=new URL(window.location.href),m=ry.test(i)?new URL(X0(i,f.protocol)):new URL(i),x=En(m.pathname,l);m.origin===f.origin&&x!=null?i=x+m.search+m.hash:d=!0}catch{Aa(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var px=new URL("http://localhost");function Gd(a){if(a.createURL)return a.createURL("/");try{return new URL(a.createHref("/"),px)}catch{return px}}function sd(a,l){return a.origin===l.origin&&(a.origin!=="null"||a.protocol===l.protocol&&a.host===l.host)}function gb(a,l){if(a.startsWith("//"))return!0;let i=l.protocol.toLowerCase();return a.toLowerCase().startsWith(i)?l.host===""||a.slice(i.length).startsWith("//"):!1}function Qd(a,l,i,u){let d=null;try{d=a==null?null:new URL(a,i)}catch{}let f=new URL(l,i),m=d!=null&&!sd(d,i),x=!sd(f,i);if(u==="reject"){if(m||x)throw new Error("External navigation is not allowed")}else if(x&&(d==null||!gb(a,d)||!sd(d,f)))throw new Error("External navigation is not allowed")}var xy=["POST","PUT","PATCH","DELETE"];new Set(xy);var bb=["GET",...xy];new Set(bb);var wb=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Sb(a){try{return wb.includes(new URL(a).protocol)}catch{return!1}}var zs=b.createContext(null);zs.displayName="DataRouter";var Tu=b.createContext(null);Tu.displayName="DataRouterState";var yy=b.createContext(!1);function jb(){return b.useContext(yy)}var vy=b.createContext({isTransitioning:!1});vy.displayName="ViewTransition";var Nb=b.createContext(new Map);Nb.displayName="Fetchers";var _b=b.createContext(null);_b.displayName="Await";var ia=b.createContext(null);ia.displayName="Navigation";var Vi=b.createContext(null);Vi.displayName="Location";var $a=b.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var Xd=b.createContext(null);Xd.displayName="RouteError";var gy="REACT_ROUTER_ERROR",kb="REDIRECT",Ab="ROUTE_ERROR_RESPONSE";function Eb(a){if(a.startsWith(`${gy}:${kb}:{`))try{let l=JSON.parse(a.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function Cb(a){if(a.startsWith(`${gy}:${Ab}:{`))try{let l=JSON.parse(a.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new xb(l.status,l.statusText,l.data)}catch{}}function Rb(a,{relative:l}={}){ot(Bs(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:u}=b.useContext(ia),{hash:d,pathname:f,search:m}=Zi(a,{relative:l}),x=f;return i!=="/"&&(x=f==="/"?i:qa([i,f])),u.createHref({pathname:x,search:m,hash:d})}function Bs(){return b.useContext(Vi)!=null}function Ea(){return ot(Bs(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Vi).location}var by="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wy(a){b.useContext(ia).static||b.useLayoutEffect(a)}function Ou(){let{isDataRoute:a}=b.useContext($a);return a?Zb():Tb()}function Tb(){ot(Bs(),"useNavigate() may be used only in the context of a <Router> component.");let a=b.useContext(zs),{basename:l,navigator:i}=b.useContext(ia),{matches:u}=b.useContext($a),{pathname:d}=Ea(),f=JSON.stringify(Zd(u)),m=b.useRef(!1);return wy(()=>{m.current=!0}),b.useCallback((y,v={})=>{if(Aa(m.current,by),!m.current)return;if(typeof y=="number"){i.go(y);return}let w=Ru(y,JSON.parse(f),d,v.relative==="path");a==null&&l!=="/"&&(w.pathname=w.pathname==="/"?l:qa([l,w.pathname])),Qd(typeof y=="string"?y:Dl(y),i.createHref(w),Gd(i),"reject"),(v.replace?i.replace:i.push)(w,v.state,v)},[l,i,f,d,a])}b.createContext(null);function Ob(){let{matches:a}=b.useContext($a),l=a[a.length-1];return(l==null?void 0:l.params)??{}}function Zi(a,{relative:l}={}){let{matches:i}=b.useContext($a),{pathname:u}=Ea(),d=JSON.stringify(Zd(i));return b.useMemo(()=>Ru(a,JSON.parse(d),u,l==="path"),[a,d,u,l])}function Lb(a,l){return Sy(a,l)}function Sy(a,l,i){var L;ot(Bs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=b.useContext(ia),{matches:d}=b.useContext($a),f=d[d.length-1],m=f?f.params:{},x=f?f.pathname:"/",y=f?f.pathnameBase:"/",v=f&&f.route;{let H=v&&v.path||"";Ny(x,!v||H.endsWith("*")||H.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${x}" (under <Route path="${H}">) 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.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${H}"> to <Route path="${H==="/"?"*":`${H}/*`}">.`)}let w=Ea(),j;if(l){let H=typeof l=="string"?Us(l):l;ot(y==="/"||((L=H.pathname)==null?void 0:L.startsWith(y)),`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 "${y}" but pathname "${H.pathname}" was given in the \`location\` prop.`),j=H}else j=w;let D=j.pathname||"/",X=D;if(y!=="/"){let H=y.replace(/^\//,"").split("/");X="/"+D.replace(/^\//,"").split("/").slice(H.length).join("/")}let C=i&&i.state.matches.length?i.state.matches.map(H=>Object.assign(H,{route:i.manifest[H.route.id]||H.route})):uy(a,{pathname:X});Aa(v||C!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),Aa(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${j.pathname}${j.search}${j.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 $=Bb(C&&C.map(H=>Object.assign({},H,{params:Object.assign({},m,H.params),pathname:qa([y,u.encodeLocation?u.encodeLocation(H.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?y:qa([y,u.encodeLocation?u.encodeLocation(H.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathnameBase])})),d,i);return l&&$?b.createElement(Vi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...j},navigationType:"POP"}},$):$}function Mb(){let a=Vb(),l=yb(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),i=a instanceof Error?a.stack:null,u="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:u},f={padding:"2px 4px",backgroundColor:u},m=null;return console.error("Error handled by React Router default ErrorBoundary:",a),m=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:f},"ErrorBoundary")," or"," ",b.createElement("code",{style:f},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},l),i?b.createElement("pre",{style:d},i):null,m)}var Db=b.createElement(Mb,null),jy=class extends b.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){this.props.onError?this.props.onError(a,l):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const i=Cb(a.digest);i&&(a=i)}let l=a!==void 0?b.createElement($a.Provider,{value:this.props.routeContext},b.createElement(Xd.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?b.createElement(Ub,{error:a},l):l}};jy.contextType=yy;var id=new WeakMap;function Ub({children:a,error:l}){let{basename:i,navigator:u}=b.useContext(ia);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let d=Eb(l.digest);if(d){let f=id.get(l);if(f)throw f;let m=py(d.location,i),x=m.absoluteURL||m.to;if(Qd(d.location,x,Gd(u),"allow-explicit"),Sb(x))throw new Error("Invalid redirect location");if(my&&!id.get(l))if(m.isExternal||d.reloadDocument)window.location.href=x;else{const y=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:d.replace}));throw id.set(l,y),y}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${x}`})}}return a}function zb({routeContext:a,match:l,children:i}){let u=b.useContext(zs);return u&&u.static&&u.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=l.route.id),b.createElement($a.Provider,{value:a},i)}function Bb(a,l=[],i){let u=i==null?void 0:i.state;if(a==null){if(!u)return null;if(u.errors)a=u.matches;else if(l.length===0&&!u.initialized&&u.matches.length>0)a=u.matches;else return null}let d=a,f=u==null?void 0:u.errors;if(f!=null){let w=d.findIndex(j=>j.route.id&&(f==null?void 0:f[j.route.id])!==void 0);ot(w>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,w+1))}let m=!1,x=-1;if(i&&u){m=u.renderFallback;for(let w=0;w<d.length;w++){let j=d[w];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(x=w),j.route.id){let{loaderData:D,errors:X}=u,C=j.route.loader&&!D.hasOwnProperty(j.route.id)&&(!X||X[j.route.id]===void 0);if(j.route.lazy||C){i.isStatic&&(m=!0),x>=0?d=d.slice(0,x+1):d=[d[0]];break}}}}let y=i==null?void 0:i.onError,v=u&&y?(w,j)=>{var D,X;y(w,{location:u.location,params:((X=(D=u.matches)==null?void 0:D[0])==null?void 0:X.params)??{},pattern:vb(u.matches),errorInfo:j})}:void 0;return d.reduceRight((w,j,D)=>{let X,C=!1,$=null,L=null;u&&(X=f&&j.route.id?f[j.route.id]:void 0,$=j.route.errorElement||Db,m&&(x<0&&D===0?(Ny("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,L=null):x===D&&(C=!0,L=j.route.hydrateFallbackElement||null)));let H=l.concat(d.slice(0,D+1)),F=()=>{let P;return X?P=$:C?P=L:j.route.Component?P=b.createElement(j.route.Component,null):j.route.element?P=j.route.element:P=w,b.createElement(zb,{match:j,routeContext:{outlet:w,matches:H,isDataRoute:u!=null},children:P})};return u&&(j.route.ErrorBoundary||j.route.errorElement||D===0)?b.createElement(jy,{location:u.location,revalidation:u.revalidation,component:$,error:X,children:F(),routeContext:{outlet:null,matches:H,isDataRoute:!0},onError:v}):F()},null)}function Id(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qb(a){let l=b.useContext(zs);return ot(l,Id(a)),l}function Hb(a){let l=b.useContext(Tu);return ot(l,Id(a)),l}function $b(a){let l=b.useContext($a);return ot(l,Id(a)),l}function Kd(a){let l=$b(a),i=l.matches[l.matches.length-1];return ot(i.route.id,`${a} can only be used on routes that contain a unique "id"`),i.route.id}function Yb(){return Kd("useRouteId")}function Vb(){var u;let a=b.useContext(Xd),l=Hb("useRouteError"),i=Kd("useRouteError");return a!==void 0?a:(u=l.errors)==null?void 0:u[i]}function Zb(){let{router:a}=qb("useNavigate"),l=Kd("useNavigate"),i=b.useRef(!1);return wy(()=>{i.current=!0}),b.useCallback(async(d,f={})=>{Aa(i.current,by),i.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:l,...f}))},[a,l])}var xx={};function Ny(a,l,i){!l&&!xx[a]&&(xx[a]=!0,Aa(!1,i))}b.memo(Gb);function Gb({routes:a,manifest:l,future:i,state:u,isStatic:d,onError:f}){return Sy(a,void 0,{manifest:l,state:u,isStatic:d,onError:f})}function _y({to:a,replace:l,state:i,relative:u}){ot(Bs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d,navigator:f}=b.useContext(ia);Aa(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:m}=b.useContext($a),{pathname:x}=Ea(),y=Ou(),v=Ru(a,Zd(m),x,u==="path");Qd(typeof a=="string"?a:Dl(a),f.createHref(v),Gd(f),"reject");let w=JSON.stringify(v);return b.useEffect(()=>{y(JSON.parse(w),{replace:l,state:i,relative:u})},[y,w,u,l,i]),null}function Ml(a){ot(!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 Qb({basename:a="/",children:l=null,location:i,navigationType:u="POP",navigator:d,static:f=!1,useTransitions:m}){ot(!Bs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=a.replace(/^\/*/,"/"),y=b.useMemo(()=>({basename:x,navigator:d,static:f,useTransitions:m,future:{}}),[x,d,f,m]);typeof i=="string"&&(i=Us(i));let{pathname:v="/",search:w="",hash:j="",state:D=null,key:X="default",mask:C}=i,$=b.useMemo(()=>{let L=En(v,x);return L==null?null:{location:{pathname:L,search:w,hash:j,state:D,key:X,mask:C},navigationType:u}},[x,v,w,j,D,X,u,C]);return Aa($!=null,`<Router basename="${x}"> is not able to match the URL "${v}${w}${j}" because it does not start with the basename, so the <Router> won't render anything.`),$==null?null:b.createElement(ia.Provider,{value:y},b.createElement(Vi.Provider,{children:l,value:$}))}function Xb({children:a,location:l}){return Lb(kd(a),l)}function kd(a,l=[]){let i=[];return b.Children.forEach(a,(u,d)=>{if(!b.isValidElement(u))return;let f=[...l,d];if(u.type===b.Fragment){i.push.apply(i,kd(u.props.children,f));return}ot(u.type===Ml,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ot(!u.props.index||!u.props.children,"An index route cannot have child routes.");let m={id:u.props.id||f.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(m.children=kd(u.props.children,f)),i.push(m)}),i}var cu="get",du="application/x-www-form-urlencoded";function Lu(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function Ib(a){return Lu(a)&&a.tagName.toLowerCase()==="button"}function Kb(a){return Lu(a)&&a.tagName.toLowerCase()==="form"}function Jb(a){return Lu(a)&&a.tagName.toLowerCase()==="input"}function Fb(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function Wb(a,l){return a.button===0&&(!l||l==="_self")&&!Fb(a)}function Ad(a=""){return new URLSearchParams(typeof a=="string"||Array.isArray(a)||a instanceof URLSearchParams?a:Object.keys(a).reduce((l,i)=>{let u=a[i];return l.concat(Array.isArray(u)?u.map(d=>[i,d]):[[i,u]])},[]))}function Pb(a,l){let i=Ad(a);return l&&l.forEach((u,d)=>{i.has(d)||l.getAll(d).forEach(f=>{i.append(d,f)})}),i}var lu=null;function e1(){if(lu===null)try{new FormData(document.createElement("form"),0),lu=!1}catch{lu=!0}return lu}var t1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rd(a){return a!=null&&!t1.has(a)?(Aa(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${du}"`),null):a}function a1(a,l){let i,u,d,f,m;if(Kb(a)){let x=a.getAttribute("action");u=x?En(x,l):null,i=a.getAttribute("method")||cu,d=rd(a.getAttribute("enctype"))||du,f=new FormData(a)}else if(Ib(a)||Jb(a)&&(a.type==="submit"||a.type==="image")){let x=a.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=a.getAttribute("formaction")||x.getAttribute("action");if(u=y?En(y,l):null,i=a.getAttribute("formmethod")||x.getAttribute("method")||cu,d=rd(a.getAttribute("formenctype"))||rd(x.getAttribute("enctype"))||du,f=new FormData(x,a),!e1()){let{name:v,type:w,value:j}=a;if(w==="image"){let D=v?`${v}.`:"";f.append(`${D}x`,"0"),f.append(`${D}y`,"0")}else v&&f.append(v,j)}}else{if(Lu(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=cu,u=null,d=du,m=a}return f&&d==="text/plain"&&(m=f,f=void 0),{action:u,method:i.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jd(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function ky(a,l,i,u){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return i?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:l&&En(d.pathname,l)==="/"?d.pathname=`${Ls(l)}/_root.${u}`:d.pathname=`${Ls(d.pathname)}.${u}`,d}async function n1(a,l){if(a.id in l)return l[a.id];try{let i=await import(a.module);return l[a.id]=i,i}catch(i){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function l1(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function s1(a,l,i){let u=await Promise.all(a.map(async d=>{let f=l.routes[d.route.id];if(f){let m=await n1(f,i);return m.links?m.links():[]}return[]}));return o1(u.flat(1).filter(l1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function yx(a,l,i,u,d,f){let m=(y,v)=>i[v]?y.route.id!==i[v].route.id:!0,x=(y,v)=>{var w;return i[v].pathname!==y.pathname||((w=i[v].route.path)==null?void 0:w.endsWith("*"))&&i[v].params["*"]!==y.params["*"]};return f==="assets"?l.filter((y,v)=>m(y,v)||x(y,v)):f==="data"?l.filter((y,v)=>{var j;let w=u.routes[y.route.id];if(!w||!w.hasLoader)return!1;if(m(y,v)||x(y,v))return!0;if(y.route.shouldRevalidate){let D=y.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((j=i[0])==null?void 0:j.params)||{},nextUrl:new URL(a,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof D=="boolean")return D}return!0}):[]}function i1(a,l,{includeHydrateFallback:i}={}){return r1(a.map(u=>{let d=l.routes[u.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),i&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function r1(a){return[...new Set(a)]}function u1(a){let l={},i=Object.keys(a).sort();for(let u of i)l[u]=a[u];return l}function o1(a,l){let i=new Set;return new Set(l),a.reduce((u,d)=>{let f=JSON.stringify(u1(d));return i.has(f)||(i.add(f),u.push({key:f,link:d})),u},[])}function Fd(){let a=b.useContext(zs);return Jd(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function c1(){let a=b.useContext(Tu);return Jd(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Wd=b.createContext(void 0);Wd.displayName="FrameworkContext";function Mu(){let a=b.useContext(Wd);return Jd(a,"You must render this element inside a <HydratedRouter> element"),a}function d1(a,l){let i=b.useContext(Wd),[u,d]=b.useState(!1),[f,m]=b.useState(!1),{onFocus:x,onBlur:y,onMouseEnter:v,onMouseLeave:w,onTouchStart:j}=l,D=b.useRef(null);b.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let $=H=>{H.forEach(F=>{m(F.isIntersecting)})},L=new IntersectionObserver($,{threshold:.5});return D.current&&L.observe(D.current),()=>{L.disconnect()}}},[a]),b.useEffect(()=>{if(u){let $=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout($)}}},[u]);let X=()=>{d(!0)},C=()=>{d(!1),m(!1)};return i?a!=="intent"?[f,D,{}]:[f,D,{onFocus:Ti(x,X),onBlur:Ti(y,C),onMouseEnter:Ti(v,X),onMouseLeave:Ti(w,C),onTouchStart:Ti(j,X)}]:[!1,D,{}]}function Ti(a,l){return i=>{a&&a(i),i.defaultPrevented||l(i)}}function f1({page:a,...l}){let i=jb(),{nonce:u}=Mu(),{router:d}=Fd(),f=b.useMemo(()=>uy(d.routes,a,d.basename),[d.routes,a,d.basename]);return f?(l.nonce==null&&u&&(l={...l,nonce:u}),i?b.createElement(m1,{page:a,matches:f,...l}):b.createElement(p1,{page:a,matches:f,...l})):null}function h1(a){let{manifest:l,routeModules:i}=Mu(),[u,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return s1(a,l,i).then(m=>{f||d(m)}),()=>{f=!0}},[a,l,i]),u}function m1({page:a,matches:l,...i}){let u=Ea(),{future:d}=Mu(),{basename:f}=Fd(),m=b.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let x=ky(a,f,d.v8_trailingSlashAwareDataRequests,"rsc"),y=!1,v=[];for(let w of l)typeof w.route.shouldRevalidate=="function"?y=!0:v.push(w.route.id);return y&&v.length>0&&x.searchParams.set("_routes",v.join(",")),[x.pathname+x.search]},[f,d.v8_trailingSlashAwareDataRequests,a,u,l]);return b.createElement(b.Fragment,null,m.map(x=>b.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...i})))}function p1({page:a,matches:l,...i}){let u=Ea(),{future:d,manifest:f,routeModules:m}=Mu(),{basename:x}=Fd(),{loaderData:y,matches:v}=c1(),w=b.useMemo(()=>yx(a,l,v,f,u,"data"),[a,l,v,f,u]),j=b.useMemo(()=>yx(a,l,v,f,u,"assets"),[a,l,v,f,u]),D=b.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let $=new Set,L=!1;if(l.forEach(F=>{var ne;let P=f.routes[F.route.id];!P||!P.hasLoader||(!w.some(V=>V.route.id===F.route.id)&&F.route.id in y&&((ne=m[F.route.id])!=null&&ne.shouldRevalidate)||P.hasClientLoader?L=!0:$.add(F.route.id))}),$.size===0)return[];let H=ky(a,x,d.v8_trailingSlashAwareDataRequests,"data");return L&&$.size>0&&H.searchParams.set("_routes",l.filter(F=>$.has(F.route.id)).map(F=>F.route.id).join(",")),[H.pathname+H.search]},[x,d.v8_trailingSlashAwareDataRequests,y,u,f,w,l,a,m]),X=b.useMemo(()=>i1(j,f),[j,f]),C=h1(j);return b.createElement(b.Fragment,null,D.map($=>b.createElement("link",{key:$,rel:"prefetch",as:"fetch",href:$,...i})),X.map($=>b.createElement("link",{key:$,rel:"modulepreload",href:$,...i})),C.map(({key:$,link:L})=>b.createElement("link",{key:$,nonce:i.nonce,...L,crossOrigin:L.crossOrigin??i.crossOrigin})))}function x1(...a){return l=>{a.forEach(i=>{typeof i=="function"?i(l):i!=null&&(i.current=l)})}}var y1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{y1&&(window.__reactRouterVersion="7.18.4")}catch{}function v1({basename:a,children:l,useTransitions:i,window:u}){let d=b.useRef();d.current==null&&(d.current=I0({window:u,v5Compat:!0}));let f=d.current,[m,x]=b.useState({action:f.action,location:f.location}),y=b.useCallback(v=>{i===!1?x(v):b.startTransition(()=>x(v))},[i]);return b.useLayoutEffect(()=>f.listen(y),[f,y]),b.createElement(Qb,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,useTransitions:i})}var sa=b.forwardRef(function({onClick:l,discover:i="render",prefetch:u="none",relative:d,reloadDocument:f,replace:m,mask:x,state:y,target:v,to:w,preventScrollReset:j,viewTransition:D,defaultShouldRevalidate:X,...C},$){let{basename:L,navigator:H,useTransitions:F}=b.useContext(ia),P=typeof w=="string"&&Vd.test(w),ne=py(w,L);w=ne.to;let V=Rb(w,{relative:d}),_e=Ea(),I=null;if(x){let Ge=Ru(x,[],_e.mask?_e.mask.pathname:"/",!0);L!=="/"&&(Ge.pathname=Ge.pathname==="/"?L:qa([L,Ge.pathname])),I=H.createHref(Ge)}let[ye,Ue,gt]=d1(u,C),At=w1(w,{replace:m,mask:x,state:y,target:v,preventScrollReset:j,relative:d,viewTransition:D,defaultShouldRevalidate:X,useTransitions:F});function rt(Ge){l&&l(Ge),Ge.defaultPrevented||At(Ge)}let mt=!(ne.isExternal||f),nt=b.createElement("a",{...C,...gt,href:(mt?I:void 0)||ne.absoluteURL||V,onClick:mt?rt:l,ref:x1($,Ue),target:v,"data-discover":!P&&i==="render"?"true":void 0});return ye&&!P?b.createElement(b.Fragment,null,nt,b.createElement(f1,{page:V})):nt});sa.displayName="Link";var fu=b.forwardRef(function({"aria-current":l="page",caseSensitive:i=!1,className:u="",end:d=!1,style:f,to:m,viewTransition:x,children:y,...v},w){let j=Zi(m,{relative:v.relative}),D=Ea(),X=b.useContext(Tu),{navigator:C,basename:$}=b.useContext(ia),L=X!=null&&k1(j)&&x===!0,H=C.encodeLocation?C.encodeLocation(j).pathname:j.pathname,F=D.pathname,P=X&&X.navigation&&X.navigation.location?X.navigation.location.pathname:null;i||(F=F.toLowerCase(),P=P?P.toLowerCase():null,H=H.toLowerCase()),P&&$&&(P=En(P,$)||P);const ne=H!=="/"&&H.endsWith("/")?H.length-1:H.length;let V=F===H||!d&&F.startsWith(H)&&F.charAt(ne)==="/",_e=P!=null&&(P===H||!d&&P.startsWith(H)&&P.charAt(H.length)==="/"),I={isActive:V,isPending:_e,isTransitioning:L},ye=V?l:void 0,Ue;typeof u=="function"?Ue=u(I):Ue=[u,V?"active":null,_e?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let gt=typeof f=="function"?f(I):f;return b.createElement(sa,{...v,"aria-current":ye,className:Ue,ref:w,style:gt,to:m,viewTransition:x},typeof y=="function"?y(I):y)});fu.displayName="NavLink";var g1=b.forwardRef(({discover:a="render",fetcherKey:l,navigate:i,reloadDocument:u,replace:d,state:f,method:m=cu,action:x,onSubmit:y,relative:v,preventScrollReset:w,viewTransition:j,defaultShouldRevalidate:D,...X},C)=>{let{useTransitions:$}=b.useContext(ia),L=N1(),H=_1(x,{relative:v}),F=m.toLowerCase()==="get"?"get":"post",P=typeof x=="string"&&Vd.test(x),ne=V=>{if(y&&y(V),V.defaultPrevented)return;V.preventDefault();let _e=V.nativeEvent.submitter,I=(_e==null?void 0:_e.getAttribute("formmethod"))||m,ye=()=>L(_e||V.currentTarget,{fetcherKey:l,method:I,navigate:i,replace:d,state:f,relative:v,preventScrollReset:w,viewTransition:j,defaultShouldRevalidate:D});$&&i!==!1?b.startTransition(()=>ye()):ye()};return b.createElement("form",{ref:C,method:F,action:H,onSubmit:u?y:ne,...X,"data-discover":!P&&a==="render"?"true":void 0})});g1.displayName="Form";function b1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ay(a){let l=b.useContext(zs);return ot(l,b1(a)),l}function w1(a,{target:l,replace:i,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:x,defaultShouldRevalidate:y,useTransitions:v}={}){let w=Ou(),j=Ea(),D=Zi(a,{relative:m});return b.useCallback(X=>{if(Wb(X,l)){X.preventDefault();let C=i!==void 0?i:Dl(j)===Dl(D),$=()=>w(a,{replace:C,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:x,defaultShouldRevalidate:y});v?b.startTransition(()=>$()):$()}},[j,w,D,i,u,d,l,a,f,m,x,y,v])}function Ey(a){Aa(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 l=b.useRef(Ad(a)),i=b.useRef(!1),u=Ea(),d=b.useMemo(()=>Pb(u.search,i.current?null:l.current),[u.search]),f=Ou(),m=b.useCallback((x,y)=>{const v=Ad(typeof x=="function"?x(new URLSearchParams(d)):x);i.current=!0,f("?"+v,y)},[f,d]);return[d,m]}var S1=0,j1=()=>`__${String(++S1)}__`;function N1(){let{router:a}=Ay("useSubmit"),{basename:l}=b.useContext(ia),i=Yb(),u=a.fetch,d=a.navigate;return b.useCallback(async(f,m={})=>{let{action:x,method:y,encType:v,formData:w,body:j}=a1(f,l);if(m.navigate===!1){let D=m.fetcherKey||j1();await u(D,i,m.action||x,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:w,body:j,formMethod:m.method||y,formEncType:m.encType||v,flushSync:m.flushSync})}else await d(m.action||x,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:w,body:j,formMethod:m.method||y,formEncType:m.encType||v,replace:m.replace,state:m.state,fromRouteId:i,flushSync:m.flushSync,viewTransition:m.viewTransition})},[u,d,l,i])}function _1(a,{relative:l}={}){let{basename:i}=b.useContext(ia),u=b.useContext($a);ot(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),f={...Zi(a||".",{relative:l})},m=Ea();if(a==null){f.search=m.search;let x=new URLSearchParams(f.search),y=x.getAll("index");if(y.some(w=>w==="")){x.delete("index"),y.filter(j=>j).forEach(j=>x.append("index",j));let w=x.toString();f.search=w?`?${w}`:""}}return(!a||a===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:qa([i,f.pathname])),Dl(f)}function k1(a,{relative:l}={}){let i=b.useContext(vy);ot(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=Ay("useViewTransitionState"),d=Zi(a,{relative:l});if(!i.isTransitioning)return!1;let f=En(i.currentLocation.pathname,u)||i.currentLocation.pathname,m=En(i.nextLocation.pathname,u)||i.nextLocation.pathname;return pu(d.pathname,m)!=null||pu(d.pathname,f)!=null}var Be;(function(a){a.assertEqual=d=>{};function l(d){}a.assertIs=l;function i(d){throw new Error}a.assertNever=i,a.arrayToEnum=d=>{const f={};for(const m of d)f[m]=m;return f},a.getValidEnumValues=d=>{const f=a.objectKeys(d).filter(x=>typeof d[d[x]]!="number"),m={};for(const x of f)m[x]=d[x];return a.objectValues(m)},a.objectValues=d=>a.objectKeys(d).map(function(f){return d[f]}),a.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{const f=[];for(const m in d)Object.prototype.hasOwnProperty.call(d,m)&&f.push(m);return f},a.find=(d,f)=>{for(const m of d)if(f(m))return m},a.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&Number.isFinite(d)&&Math.floor(d)===d;function u(d,f=" | "){return d.map(m=>typeof m=="string"?`'${m}'`:m).join(f)}a.joinValues=u,a.jsonStringifyReplacer=(d,f)=>typeof f=="bigint"?f.toString():f})(Be||(Be={}));var vx;(function(a){a.mergeShapes=(l,i)=>({...l,...i})})(vx||(vx={}));const se=Be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rl=a=>{switch(typeof a){case"undefined":return se.undefined;case"string":return se.string;case"number":return Number.isNaN(a)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(a)?se.array:a===null?se.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?se.promise:typeof Map<"u"&&a instanceof Map?se.map:typeof Set<"u"&&a instanceof Set?se.set:typeof Date<"u"&&a instanceof Date?se.date:se.object;default:return se.unknown}},K=Be.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Cn extends Error{get errors(){return this.issues}constructor(l){super(),this.issues=[],this.addIssue=u=>{this.issues=[...this.issues,u]},this.addIssues=(u=[])=>{this.issues=[...this.issues,...u]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=l}format(l){const i=l||function(f){return f.message},u={_errors:[]},d=f=>{for(const m of f.issues)if(m.code==="invalid_union")m.unionErrors.map(d);else if(m.code==="invalid_return_type")d(m.returnTypeError);else if(m.code==="invalid_arguments")d(m.argumentsError);else if(m.path.length===0)u._errors.push(i(m));else{let x=u,y=0;for(;y<m.path.length;){const v=m.path[y];y===m.path.length-1?(x[v]=x[v]||{_errors:[]},x[v]._errors.push(i(m))):x[v]=x[v]||{_errors:[]},x=x[v],y++}}};return d(this),u}static assert(l){if(!(l instanceof Cn))throw new Error(`Not a ZodError: ${l}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(l=i=>i.message){const i={},u=[];for(const d of this.issues)if(d.path.length>0){const f=d.path[0];i[f]=i[f]||[],i[f].push(l(d))}else u.push(l(d));return{formErrors:u,fieldErrors:i}}get formErrors(){return this.flatten()}}Cn.create=a=>new Cn(a);const Ed=(a,l)=>{let i;switch(a.code){case K.invalid_type:a.received===se.undefined?i="Required":i=`Expected ${a.expected}, received ${a.received}`;break;case K.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(a.expected,Be.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:i=`Unrecognized key(s) in object: ${Be.joinValues(a.keys,", ")}`;break;case K.invalid_union:i="Invalid input";break;case K.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${Be.joinValues(a.options)}`;break;case K.invalid_enum_value:i=`Invalid enum value. Expected ${Be.joinValues(a.options)}, received '${a.received}'`;break;case K.invalid_arguments:i="Invalid function arguments";break;case K.invalid_return_type:i="Invalid function return type";break;case K.invalid_date:i="Invalid date";break;case K.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(i=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?i=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?i=`Invalid input: must end with "${a.validation.endsWith}"`:Be.assertNever(a.validation):a.validation!=="regex"?i=`Invalid ${a.validation}`:i="Invalid";break;case K.too_small:a.type==="array"?i=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?i=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?i=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?i=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?i=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:i="Invalid input";break;case K.too_big:a.type==="array"?i=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?i=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?i=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?i=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?i=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:i="Invalid input";break;case K.custom:i="Invalid input";break;case K.invalid_intersection_types:i="Intersection results could not be merged";break;case K.not_multiple_of:i=`Number must be a multiple of ${a.multipleOf}`;break;case K.not_finite:i="Number must be finite";break;default:i=l.defaultError,Be.assertNever(a)}return{message:i}};let A1=Ed;function E1(){return A1}const C1=a=>{const{data:l,path:i,errorMaps:u,issueData:d}=a,f=[...i,...d.path||[]],m={...d,path:f};if(d.message!==void 0)return{...d,path:f,message:d.message};let x="";const y=u.filter(v=>!!v).slice().reverse();for(const v of y)x=v(m,{data:l,defaultError:x}).message;return{...d,path:f,message:x}};function ee(a,l){const i=E1(),u=C1({issueData:l,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,i,i===Ed?void 0:Ed].filter(d=>!!d)});a.common.issues.push(u)}class Ht{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(l,i){const u=[];for(const d of i){if(d.status==="aborted")return pe;d.status==="dirty"&&l.dirty(),u.push(d.value)}return{status:l.value,value:u}}static async mergeObjectAsync(l,i){const u=[];for(const d of i){const f=await d.key,m=await d.value;u.push({key:f,value:m})}return Ht.mergeObjectSync(l,u)}static mergeObjectSync(l,i){const u={};for(const d of i){const{key:f,value:m}=d;if(f.status==="aborted"||m.status==="aborted")return pe;f.status==="dirty"&&l.dirty(),m.status==="dirty"&&l.dirty(),f.value!=="__proto__"&&(typeof m.value<"u"||d.alwaysSet)&&(u[f.value]=m.value)}return{status:l.value,value:u}}}const pe=Object.freeze({status:"aborted"}),Li=a=>({status:"dirty",value:a}),Ca=a=>({status:"valid",value:a}),gx=a=>a.status==="aborted",bx=a=>a.status==="dirty",Ms=a=>a.status==="valid",xu=a=>typeof Promise<"u"&&a instanceof Promise;var ce;(function(a){a.errToObj=l=>typeof l=="string"?{message:l}:l||{},a.toString=l=>typeof l=="string"?l:l==null?void 0:l.message})(ce||(ce={}));class tn{constructor(l,i,u,d){this._cachedPath=[],this.parent=l,this.data=i,this._path=u,this._key=d}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const wx=(a,l)=>{if(Ms(l))return{success:!0,data:l.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new Cn(a.common.issues);return this._error=i,this._error}}};function Ne(a){if(!a)return{};const{errorMap:l,invalid_type_error:i,required_error:u,description:d}=a;if(l&&(i||u))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return l?{errorMap:l,description:d}:{errorMap:(m,x)=>{const{message:y}=a;return m.code==="invalid_enum_value"?{message:y??x.defaultError}:typeof x.data>"u"?{message:y??u??x.defaultError}:m.code!=="invalid_type"?{message:x.defaultError}:{message:y??i??x.defaultError}},description:d}}class Oe{get description(){return this._def.description}_getType(l){return rl(l.data)}_getOrReturnCtx(l,i){return i||{common:l.parent.common,data:l.data,parsedType:rl(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}_processInputParams(l){return{status:new Ht,ctx:{common:l.parent.common,data:l.data,parsedType:rl(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}}_parseSync(l){const i=this._parse(l);if(xu(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(l){const i=this._parse(l);return Promise.resolve(i)}parse(l,i){const u=this.safeParse(l,i);if(u.success)return u.data;throw u.error}safeParse(l,i){const u={common:{issues:[],async:(i==null?void 0:i.async)??!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:rl(l)},d=this._parseSync({data:l,path:u.path,parent:u});return wx(u,d)}"~validate"(l){var u,d;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:rl(l)};if(!this["~standard"].async)try{const f=this._parseSync({data:l,path:[],parent:i});return Ms(f)?{value:f.value}:{issues:i.common.issues}}catch(f){(d=(u=f==null?void 0:f.message)==null?void 0:u.toLowerCase())!=null&&d.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:l,path:[],parent:i}).then(f=>Ms(f)?{value:f.value}:{issues:i.common.issues})}async parseAsync(l,i){const u=await this.safeParseAsync(l,i);if(u.success)return u.data;throw u.error}async safeParseAsync(l,i){const u={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:rl(l)},d=this._parse({data:l,path:u.path,parent:u}),f=await(xu(d)?d:Promise.resolve(d));return wx(u,f)}refine(l,i){const u=d=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(d):i;return this._refinement((d,f)=>{const m=l(d),x=()=>f.addIssue({code:K.custom,...u(d)});return typeof Promise<"u"&&m instanceof Promise?m.then(y=>y?!0:(x(),!1)):m?!0:(x(),!1)})}refinement(l,i){return this._refinement((u,d)=>l(u)?!0:(d.addIssue(typeof i=="function"?i(u,d):i),!1))}_refinement(l){return new Hl({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:l}})}superRefine(l){return this._refinement(l)}constructor(l){this.spa=this.safeParseAsync,this._def=l,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return An.create(this,this._def)}nullable(){return $l.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return en.create(this)}promise(){return Su.create(this,this._def)}or(l){return vu.create([this,l],this._def)}and(l){return gu.create(this,l,this._def)}transform(l){return new Hl({...Ne(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:l}})}default(l){const i=typeof l=="function"?l:()=>l;return new ju({...Ne(this._def),innerType:this,defaultValue:i,typeName:xe.ZodDefault})}brand(){return new Oy({typeName:xe.ZodBranded,type:this,...Ne(this._def)})}catch(l){const i=typeof l=="function"?l:()=>l;return new Nu({...Ne(this._def),innerType:this,catchValue:i,typeName:xe.ZodCatch})}describe(l){const i=this.constructor;return new i({...this._def,description:l})}pipe(l){return ef.create(this,l)}readonly(){return _u.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const R1=/^c[^\s-]{8,}$/i,T1=/^[0-9a-z]+$/,O1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,L1=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,M1=/^[a-z0-9_-]{21}$/i,D1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,U1=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,z1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,B1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ud;const q1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,H1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$1=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Y1=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,V1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Z1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Cy="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",G1=new RegExp(`^${Cy}$`);function Ry(a){let l="[0-5]\\d";a.precision?l=`${l}\\.\\d{${a.precision}}`:a.precision==null&&(l=`${l}(\\.\\d+)?`);const i=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${l})${i}`}function Q1(a){return new RegExp(`^${Ry(a)}$`)}function X1(a){let l=`${Cy}T${Ry(a)}`;const i=[];return i.push(a.local?"Z?":"Z"),a.offset&&i.push("([+-]\\d{2}:?\\d{2})"),l=`${l}(${i.join("|")})`,new RegExp(`^${l}$`)}function I1(a,l){return!!((l==="v4"||!l)&&q1.test(a)||(l==="v6"||!l)&&$1.test(a))}function K1(a,l){if(!D1.test(a))return!1;try{const[i]=a.split(".");if(!i)return!1;const u=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),d=JSON.parse(atob(u));return!(typeof d!="object"||d===null||"typ"in d&&(d==null?void 0:d.typ)!=="JWT"||!d.alg||l&&d.alg!==l)}catch{return!1}}function J1(a,l){return!!((l==="v4"||!l)&&H1.test(a)||(l==="v6"||!l)&&Y1.test(a))}class Wa extends Oe{_parse(l){if(this._def.coerce&&(l.data=String(l.data)),this._getType(l)!==se.string){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_type,expected:se.string,received:f.parsedType}),pe}const u=new Ht;let d;for(const f of this._def.checks)if(f.kind==="min")l.data.length<f.value&&(d=this._getOrReturnCtx(l,d),ee(d,{code:K.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="max")l.data.length>f.value&&(d=this._getOrReturnCtx(l,d),ee(d,{code:K.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="length"){const m=l.data.length>f.value,x=l.data.length<f.value;(m||x)&&(d=this._getOrReturnCtx(l,d),m?ee(d,{code:K.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):x&&ee(d,{code:K.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),u.dirty())}else if(f.kind==="email")z1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"email",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="emoji")ud||(ud=new RegExp(B1,"u")),ud.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"emoji",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="uuid")L1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"uuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="nanoid")M1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"nanoid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid")R1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"cuid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid2")T1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"cuid2",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="ulid")O1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"ulid",code:K.invalid_string,message:f.message}),u.dirty());else if(f.kind==="url")try{new URL(l.data)}catch{d=this._getOrReturnCtx(l,d),ee(d,{validation:"url",code:K.invalid_string,message:f.message}),u.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"regex",code:K.invalid_string,message:f.message}),u.dirty())):f.kind==="trim"?l.data=l.data.trim():f.kind==="includes"?l.data.includes(f.value,f.position)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),u.dirty()):f.kind==="toLowerCase"?l.data=l.data.toLowerCase():f.kind==="toUpperCase"?l.data=l.data.toUpperCase():f.kind==="startsWith"?l.data.startsWith(f.value)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:{startsWith:f.value},message:f.message}),u.dirty()):f.kind==="endsWith"?l.data.endsWith(f.value)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:{endsWith:f.value},message:f.message}),u.dirty()):f.kind==="datetime"?X1(f).test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:"datetime",message:f.message}),u.dirty()):f.kind==="date"?G1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:"date",message:f.message}),u.dirty()):f.kind==="time"?Q1(f).test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:"time",message:f.message}),u.dirty()):f.kind==="duration"?U1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"duration",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="ip"?I1(l.data,f.version)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"ip",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="jwt"?K1(l.data,f.alg)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"jwt",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="cidr"?J1(l.data,f.version)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"cidr",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64"?V1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"base64",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64url"?Z1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"base64url",code:K.invalid_string,message:f.message}),u.dirty()):Be.assertNever(f);return{status:u.value,value:l.data}}_regex(l,i,u){return this.refinement(d=>l.test(d),{validation:i,code:K.invalid_string,...ce.errToObj(u)})}_addCheck(l){return new Wa({...this._def,checks:[...this._def.checks,l]})}email(l){return this._addCheck({kind:"email",...ce.errToObj(l)})}url(l){return this._addCheck({kind:"url",...ce.errToObj(l)})}emoji(l){return this._addCheck({kind:"emoji",...ce.errToObj(l)})}uuid(l){return this._addCheck({kind:"uuid",...ce.errToObj(l)})}nanoid(l){return this._addCheck({kind:"nanoid",...ce.errToObj(l)})}cuid(l){return this._addCheck({kind:"cuid",...ce.errToObj(l)})}cuid2(l){return this._addCheck({kind:"cuid2",...ce.errToObj(l)})}ulid(l){return this._addCheck({kind:"ulid",...ce.errToObj(l)})}base64(l){return this._addCheck({kind:"base64",...ce.errToObj(l)})}base64url(l){return this._addCheck({kind:"base64url",...ce.errToObj(l)})}jwt(l){return this._addCheck({kind:"jwt",...ce.errToObj(l)})}ip(l){return this._addCheck({kind:"ip",...ce.errToObj(l)})}cidr(l){return this._addCheck({kind:"cidr",...ce.errToObj(l)})}datetime(l){return typeof l=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:l}):this._addCheck({kind:"datetime",precision:typeof(l==null?void 0:l.precision)>"u"?null:l==null?void 0:l.precision,offset:(l==null?void 0:l.offset)??!1,local:(l==null?void 0:l.local)??!1,...ce.errToObj(l==null?void 0:l.message)})}date(l){return this._addCheck({kind:"date",message:l})}time(l){return typeof l=="string"?this._addCheck({kind:"time",precision:null,message:l}):this._addCheck({kind:"time",precision:typeof(l==null?void 0:l.precision)>"u"?null:l==null?void 0:l.precision,...ce.errToObj(l==null?void 0:l.message)})}duration(l){return this._addCheck({kind:"duration",...ce.errToObj(l)})}regex(l,i){return this._addCheck({kind:"regex",regex:l,...ce.errToObj(i)})}includes(l,i){return this._addCheck({kind:"includes",value:l,position:i==null?void 0:i.position,...ce.errToObj(i==null?void 0:i.message)})}startsWith(l,i){return this._addCheck({kind:"startsWith",value:l,...ce.errToObj(i)})}endsWith(l,i){return this._addCheck({kind:"endsWith",value:l,...ce.errToObj(i)})}min(l,i){return this._addCheck({kind:"min",value:l,...ce.errToObj(i)})}max(l,i){return this._addCheck({kind:"max",value:l,...ce.errToObj(i)})}length(l,i){return this._addCheck({kind:"length",value:l,...ce.errToObj(i)})}nonempty(l){return this.min(1,ce.errToObj(l))}trim(){return new Wa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(l=>l.kind==="datetime")}get isDate(){return!!this._def.checks.find(l=>l.kind==="date")}get isTime(){return!!this._def.checks.find(l=>l.kind==="time")}get isDuration(){return!!this._def.checks.find(l=>l.kind==="duration")}get isEmail(){return!!this._def.checks.find(l=>l.kind==="email")}get isURL(){return!!this._def.checks.find(l=>l.kind==="url")}get isEmoji(){return!!this._def.checks.find(l=>l.kind==="emoji")}get isUUID(){return!!this._def.checks.find(l=>l.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(l=>l.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(l=>l.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(l=>l.kind==="cuid2")}get isULID(){return!!this._def.checks.find(l=>l.kind==="ulid")}get isIP(){return!!this._def.checks.find(l=>l.kind==="ip")}get isCIDR(){return!!this._def.checks.find(l=>l.kind==="cidr")}get isBase64(){return!!this._def.checks.find(l=>l.kind==="base64")}get isBase64url(){return!!this._def.checks.find(l=>l.kind==="base64url")}get minLength(){let l=null;for(const i of this._def.checks)i.kind==="min"&&(l===null||i.value>l)&&(l=i.value);return l}get maxLength(){let l=null;for(const i of this._def.checks)i.kind==="max"&&(l===null||i.value<l)&&(l=i.value);return l}}Wa.create=a=>new Wa({checks:[],typeName:xe.ZodString,coerce:(a==null?void 0:a.coerce)??!1,...Ne(a)});function F1(a,l){const i=(a.toString().split(".")[1]||"").length,u=(l.toString().split(".")[1]||"").length,d=i>u?i:u,f=Number.parseInt(a.toFixed(d).replace(".","")),m=Number.parseInt(l.toFixed(d).replace(".",""));return f%m/10**d}class Ul extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(l){if(this._def.coerce&&(l.data=Number(l.data)),this._getType(l)!==se.number){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_type,expected:se.number,received:f.parsedType}),pe}let u;const d=new Ht;for(const f of this._def.checks)f.kind==="int"?Be.isInteger(l.data)||(u=this._getOrReturnCtx(l,u),ee(u,{code:K.invalid_type,expected:"integer",received:"float",message:f.message}),d.dirty()):f.kind==="min"?(f.inclusive?l.data<f.value:l.data<=f.value)&&(u=this._getOrReturnCtx(l,u),ee(u,{code:K.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),d.dirty()):f.kind==="max"?(f.inclusive?l.data>f.value:l.data>=f.value)&&(u=this._getOrReturnCtx(l,u),ee(u,{code:K.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),d.dirty()):f.kind==="multipleOf"?F1(l.data,f.value)!==0&&(u=this._getOrReturnCtx(l,u),ee(u,{code:K.not_multiple_of,multipleOf:f.value,message:f.message}),d.dirty()):f.kind==="finite"?Number.isFinite(l.data)||(u=this._getOrReturnCtx(l,u),ee(u,{code:K.not_finite,message:f.message}),d.dirty()):Be.assertNever(f);return{status:d.value,value:l.data}}gte(l,i){return this.setLimit("min",l,!0,ce.toString(i))}gt(l,i){return this.setLimit("min",l,!1,ce.toString(i))}lte(l,i){return this.setLimit("max",l,!0,ce.toString(i))}lt(l,i){return this.setLimit("max",l,!1,ce.toString(i))}setLimit(l,i,u,d){return new Ul({...this._def,checks:[...this._def.checks,{kind:l,value:i,inclusive:u,message:ce.toString(d)}]})}_addCheck(l){return new Ul({...this._def,checks:[...this._def.checks,l]})}int(l){return this._addCheck({kind:"int",message:ce.toString(l)})}positive(l){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(l)})}negative(l){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(l)})}multipleOf(l,i){return this._addCheck({kind:"multipleOf",value:l,message:ce.toString(i)})}finite(l){return this._addCheck({kind:"finite",message:ce.toString(l)})}safe(l){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(l)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(l)})}get minValue(){let l=null;for(const i of this._def.checks)i.kind==="min"&&(l===null||i.value>l)&&(l=i.value);return l}get maxValue(){let l=null;for(const i of this._def.checks)i.kind==="max"&&(l===null||i.value<l)&&(l=i.value);return l}get isInt(){return!!this._def.checks.find(l=>l.kind==="int"||l.kind==="multipleOf"&&Be.isInteger(l.value))}get isFinite(){let l=null,i=null;for(const u of this._def.checks){if(u.kind==="finite"||u.kind==="int"||u.kind==="multipleOf")return!0;u.kind==="min"?(i===null||u.value>i)&&(i=u.value):u.kind==="max"&&(l===null||u.value<l)&&(l=u.value)}return Number.isFinite(i)&&Number.isFinite(l)}}Ul.create=a=>new Ul({checks:[],typeName:xe.ZodNumber,coerce:(a==null?void 0:a.coerce)||!1,...Ne(a)});class zl extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(l){if(this._def.coerce)try{l.data=BigInt(l.data)}catch{return this._getInvalidInput(l)}if(this._getType(l)!==se.bigint)return this._getInvalidInput(l);let u;const d=new Ht;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?l.data<f.value:l.data<=f.value)&&(u=this._getOrReturnCtx(l,u),ee(u,{code:K.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),d.dirty()):f.kind==="max"?(f.inclusive?l.data>f.value:l.data>=f.value)&&(u=this._getOrReturnCtx(l,u),ee(u,{code:K.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),d.dirty()):f.kind==="multipleOf"?l.data%f.value!==BigInt(0)&&(u=this._getOrReturnCtx(l,u),ee(u,{code:K.not_multiple_of,multipleOf:f.value,message:f.message}),d.dirty()):Be.assertNever(f);return{status:d.value,value:l.data}}_getInvalidInput(l){const i=this._getOrReturnCtx(l);return ee(i,{code:K.invalid_type,expected:se.bigint,received:i.parsedType}),pe}gte(l,i){return this.setLimit("min",l,!0,ce.toString(i))}gt(l,i){return this.setLimit("min",l,!1,ce.toString(i))}lte(l,i){return this.setLimit("max",l,!0,ce.toString(i))}lt(l,i){return this.setLimit("max",l,!1,ce.toString(i))}setLimit(l,i,u,d){return new zl({...this._def,checks:[...this._def.checks,{kind:l,value:i,inclusive:u,message:ce.toString(d)}]})}_addCheck(l){return new zl({...this._def,checks:[...this._def.checks,l]})}positive(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(l)})}negative(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(l)})}multipleOf(l,i){return this._addCheck({kind:"multipleOf",value:l,message:ce.toString(i)})}get minValue(){let l=null;for(const i of this._def.checks)i.kind==="min"&&(l===null||i.value>l)&&(l=i.value);return l}get maxValue(){let l=null;for(const i of this._def.checks)i.kind==="max"&&(l===null||i.value<l)&&(l=i.value);return l}}zl.create=a=>new zl({checks:[],typeName:xe.ZodBigInt,coerce:(a==null?void 0:a.coerce)??!1,...Ne(a)});class yu extends Oe{_parse(l){if(this._def.coerce&&(l.data=!!l.data),this._getType(l)!==se.boolean){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:se.boolean,received:u.parsedType}),pe}return Ca(l.data)}}yu.create=a=>new yu({typeName:xe.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1,...Ne(a)});class Ds extends Oe{_parse(l){if(this._def.coerce&&(l.data=new Date(l.data)),this._getType(l)!==se.date){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_type,expected:se.date,received:f.parsedType}),pe}if(Number.isNaN(l.data.getTime())){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_date}),pe}const u=new Ht;let d;for(const f of this._def.checks)f.kind==="min"?l.data.getTime()<f.value&&(d=this._getOrReturnCtx(l,d),ee(d,{code:K.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),u.dirty()):f.kind==="max"?l.data.getTime()>f.value&&(d=this._getOrReturnCtx(l,d),ee(d,{code:K.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),u.dirty()):Be.assertNever(f);return{status:u.value,value:new Date(l.data.getTime())}}_addCheck(l){return new Ds({...this._def,checks:[...this._def.checks,l]})}min(l,i){return this._addCheck({kind:"min",value:l.getTime(),message:ce.toString(i)})}max(l,i){return this._addCheck({kind:"max",value:l.getTime(),message:ce.toString(i)})}get minDate(){let l=null;for(const i of this._def.checks)i.kind==="min"&&(l===null||i.value>l)&&(l=i.value);return l!=null?new Date(l):null}get maxDate(){let l=null;for(const i of this._def.checks)i.kind==="max"&&(l===null||i.value<l)&&(l=i.value);return l!=null?new Date(l):null}}Ds.create=a=>new Ds({checks:[],coerce:(a==null?void 0:a.coerce)||!1,typeName:xe.ZodDate,...Ne(a)});class Sx extends Oe{_parse(l){if(this._getType(l)!==se.symbol){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:se.symbol,received:u.parsedType}),pe}return Ca(l.data)}}Sx.create=a=>new Sx({typeName:xe.ZodSymbol,...Ne(a)});class Cd extends Oe{_parse(l){if(this._getType(l)!==se.undefined){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:se.undefined,received:u.parsedType}),pe}return Ca(l.data)}}Cd.create=a=>new Cd({typeName:xe.ZodUndefined,...Ne(a)});class Rd extends Oe{_parse(l){if(this._getType(l)!==se.null){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:se.null,received:u.parsedType}),pe}return Ca(l.data)}}Rd.create=a=>new Rd({typeName:xe.ZodNull,...Ne(a)});class jx extends Oe{constructor(){super(...arguments),this._any=!0}_parse(l){return Ca(l.data)}}jx.create=a=>new jx({typeName:xe.ZodAny,...Ne(a)});class Td extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(l){return Ca(l.data)}}Td.create=a=>new Td({typeName:xe.ZodUnknown,...Ne(a)});class cl extends Oe{_parse(l){const i=this._getOrReturnCtx(l);return ee(i,{code:K.invalid_type,expected:se.never,received:i.parsedType}),pe}}cl.create=a=>new cl({typeName:xe.ZodNever,...Ne(a)});class Nx extends Oe{_parse(l){if(this._getType(l)!==se.undefined){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:se.void,received:u.parsedType}),pe}return Ca(l.data)}}Nx.create=a=>new Nx({typeName:xe.ZodVoid,...Ne(a)});class en extends Oe{_parse(l){const{ctx:i,status:u}=this._processInputParams(l),d=this._def;if(i.parsedType!==se.array)return ee(i,{code:K.invalid_type,expected:se.array,received:i.parsedType}),pe;if(d.exactLength!==null){const m=i.data.length>d.exactLength.value,x=i.data.length<d.exactLength.value;(m||x)&&(ee(i,{code:m?K.too_big:K.too_small,minimum:x?d.exactLength.value:void 0,maximum:m?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),u.dirty())}if(d.minLength!==null&&i.data.length<d.minLength.value&&(ee(i,{code:K.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),u.dirty()),d.maxLength!==null&&i.data.length>d.maxLength.value&&(ee(i,{code:K.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),u.dirty()),i.common.async)return Promise.all([...i.data].map((m,x)=>d.type._parseAsync(new tn(i,m,i.path,x)))).then(m=>Ht.mergeArray(u,m));const f=[...i.data].map((m,x)=>d.type._parseSync(new tn(i,m,i.path,x)));return Ht.mergeArray(u,f)}get element(){return this._def.type}min(l,i){return new en({...this._def,minLength:{value:l,message:ce.toString(i)}})}max(l,i){return new en({...this._def,maxLength:{value:l,message:ce.toString(i)}})}length(l,i){return new en({...this._def,exactLength:{value:l,message:ce.toString(i)}})}nonempty(l){return this.min(1,l)}}en.create=(a,l)=>new en({type:a,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Ne(l)});function Rs(a){if(a instanceof kt){const l={};for(const i in a.shape){const u=a.shape[i];l[i]=An.create(Rs(u))}return new kt({...a._def,shape:()=>l})}else return a instanceof en?new en({...a._def,type:Rs(a.element)}):a instanceof An?An.create(Rs(a.unwrap())):a instanceof $l?$l.create(Rs(a.unwrap())):a instanceof Bl?Bl.create(a.items.map(l=>Rs(l))):a}class kt extends Oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const l=this._def.shape(),i=Be.objectKeys(l);return this._cached={shape:l,keys:i},this._cached}_parse(l){if(this._getType(l)!==se.object){const v=this._getOrReturnCtx(l);return ee(v,{code:K.invalid_type,expected:se.object,received:v.parsedType}),pe}const{status:u,ctx:d}=this._processInputParams(l),{shape:f,keys:m}=this._getCached(),x=[];if(!(this._def.catchall instanceof cl&&this._def.unknownKeys==="strip"))for(const v in d.data)m.includes(v)||x.push(v);const y=[];for(const v of m){const w=f[v],j=d.data[v];y.push({key:{status:"valid",value:v},value:w._parse(new tn(d,j,d.path,v)),alwaysSet:v in d.data})}if(this._def.catchall instanceof cl){const v=this._def.unknownKeys;if(v==="passthrough")for(const w of x)y.push({key:{status:"valid",value:w},value:{status:"valid",value:d.data[w]}});else if(v==="strict")x.length>0&&(ee(d,{code:K.unrecognized_keys,keys:x}),u.dirty());else if(v!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const v=this._def.catchall;for(const w of x){const j=d.data[w];y.push({key:{status:"valid",value:w},value:v._parse(new tn(d,j,d.path,w)),alwaysSet:w in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const v=[];for(const w of y){const j=await w.key,D=await w.value;v.push({key:j,value:D,alwaysSet:w.alwaysSet})}return v}).then(v=>Ht.mergeObjectSync(u,v)):Ht.mergeObjectSync(u,y)}get shape(){return this._def.shape()}strict(l){return ce.errToObj,new kt({...this._def,unknownKeys:"strict",...l!==void 0?{errorMap:(i,u)=>{var f,m;const d=((m=(f=this._def).errorMap)==null?void 0:m.call(f,i,u).message)??u.defaultError;return i.code==="unrecognized_keys"?{message:ce.errToObj(l).message??d}:{message:d}}}:{}})}strip(){return new kt({...this._def,unknownKeys:"strip"})}passthrough(){return new kt({...this._def,unknownKeys:"passthrough"})}extend(l){return new kt({...this._def,shape:()=>({...this._def.shape(),...l})})}merge(l){return new kt({unknownKeys:l._def.unknownKeys,catchall:l._def.catchall,shape:()=>({...this._def.shape(),...l._def.shape()}),typeName:xe.ZodObject})}setKey(l,i){return this.augment({[l]:i})}catchall(l){return new kt({...this._def,catchall:l})}pick(l){const i={};for(const u of Be.objectKeys(l))l[u]&&this.shape[u]&&(i[u]=this.shape[u]);return new kt({...this._def,shape:()=>i})}omit(l){const i={};for(const u of Be.objectKeys(this.shape))l[u]||(i[u]=this.shape[u]);return new kt({...this._def,shape:()=>i})}deepPartial(){return Rs(this)}partial(l){const i={};for(const u of Be.objectKeys(this.shape)){const d=this.shape[u];l&&!l[u]?i[u]=d:i[u]=d.optional()}return new kt({...this._def,shape:()=>i})}required(l){const i={};for(const u of Be.objectKeys(this.shape))if(l&&!l[u])i[u]=this.shape[u];else{let f=this.shape[u];for(;f instanceof An;)f=f._def.innerType;i[u]=f}return new kt({...this._def,shape:()=>i})}keyof(){return Ty(Be.objectKeys(this.shape))}}kt.create=(a,l)=>new kt({shape:()=>a,unknownKeys:"strip",catchall:cl.create(),typeName:xe.ZodObject,...Ne(l)});kt.strictCreate=(a,l)=>new kt({shape:()=>a,unknownKeys:"strict",catchall:cl.create(),typeName:xe.ZodObject,...Ne(l)});kt.lazycreate=(a,l)=>new kt({shape:a,unknownKeys:"strip",catchall:cl.create(),typeName:xe.ZodObject,...Ne(l)});class vu extends Oe{_parse(l){const{ctx:i}=this._processInputParams(l),u=this._def.options;function d(f){for(const x of f)if(x.result.status==="valid")return x.result;for(const x of f)if(x.result.status==="dirty")return i.common.issues.push(...x.ctx.common.issues),x.result;const m=f.map(x=>new Cn(x.ctx.common.issues));return ee(i,{code:K.invalid_union,unionErrors:m}),pe}if(i.common.async)return Promise.all(u.map(async f=>{const m={...i,common:{...i.common,issues:[]},parent:null};return{result:await f._parseAsync({data:i.data,path:i.path,parent:m}),ctx:m}})).then(d);{let f;const m=[];for(const y of u){const v={...i,common:{...i.common,issues:[]},parent:null},w=y._parseSync({data:i.data,path:i.path,parent:v});if(w.status==="valid")return w;w.status==="dirty"&&!f&&(f={result:w,ctx:v}),v.common.issues.length&&m.push(v.common.issues)}if(f)return i.common.issues.push(...f.ctx.common.issues),f.result;const x=m.map(y=>new Cn(y));return ee(i,{code:K.invalid_union,unionErrors:x}),pe}}get options(){return this._def.options}}vu.create=(a,l)=>new vu({options:a,typeName:xe.ZodUnion,...Ne(l)});const kn=a=>a instanceof Ld?kn(a.schema):a instanceof Hl?kn(a.innerType()):a instanceof wu?[a.value]:a instanceof ql?a.options:a instanceof Md?Be.objectValues(a.enum):a instanceof ju?kn(a._def.innerType):a instanceof Cd?[void 0]:a instanceof Rd?[null]:a instanceof An?[void 0,...kn(a.unwrap())]:a instanceof $l?[null,...kn(a.unwrap())]:a instanceof Oy||a instanceof _u?kn(a.unwrap()):a instanceof Nu?kn(a._def.innerType):[];class Pd extends Oe{_parse(l){const{ctx:i}=this._processInputParams(l);if(i.parsedType!==se.object)return ee(i,{code:K.invalid_type,expected:se.object,received:i.parsedType}),pe;const u=this.discriminator,d=i.data[u],f=this.optionsMap.get(d);return f?i.common.async?f._parseAsync({data:i.data,path:i.path,parent:i}):f._parseSync({data:i.data,path:i.path,parent:i}):(ee(i,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[u]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(l,i,u){const d=new Map;for(const f of i){const m=kn(f.shape[l]);if(!m.length)throw new Error(`A discriminator value for key \`${l}\` could not be extracted from all schema options`);for(const x of m){if(d.has(x))throw new Error(`Discriminator property ${String(l)} has duplicate value ${String(x)}`);d.set(x,f)}}return new Pd({typeName:xe.ZodDiscriminatedUnion,discriminator:l,options:i,optionsMap:d,...Ne(u)})}}function Od(a,l){const i=rl(a),u=rl(l);if(a===l)return{valid:!0,data:a};if(i===se.object&&u===se.object){const d=Be.objectKeys(l),f=Be.objectKeys(a).filter(x=>d.indexOf(x)!==-1),m={...a,...l};for(const x of f){const y=Od(a[x],l[x]);if(!y.valid)return{valid:!1};m[x]=y.data}return{valid:!0,data:m}}else if(i===se.array&&u===se.array){if(a.length!==l.length)return{valid:!1};const d=[];for(let f=0;f<a.length;f++){const m=a[f],x=l[f],y=Od(m,x);if(!y.valid)return{valid:!1};d.push(y.data)}return{valid:!0,data:d}}else return i===se.date&&u===se.date&&+a==+l?{valid:!0,data:a}:{valid:!1}}class gu extends Oe{_parse(l){const{status:i,ctx:u}=this._processInputParams(l),d=(f,m)=>{if(gx(f)||gx(m))return pe;const x=Od(f.value,m.value);return x.valid?((bx(f)||bx(m))&&i.dirty(),{status:i.value,value:x.data}):(ee(u,{code:K.invalid_intersection_types}),pe)};return u.common.async?Promise.all([this._def.left._parseAsync({data:u.data,path:u.path,parent:u}),this._def.right._parseAsync({data:u.data,path:u.path,parent:u})]).then(([f,m])=>d(f,m)):d(this._def.left._parseSync({data:u.data,path:u.path,parent:u}),this._def.right._parseSync({data:u.data,path:u.path,parent:u}))}}gu.create=(a,l,i)=>new gu({left:a,right:l,typeName:xe.ZodIntersection,...Ne(i)});class Bl extends Oe{_parse(l){const{status:i,ctx:u}=this._processInputParams(l);if(u.parsedType!==se.array)return ee(u,{code:K.invalid_type,expected:se.array,received:u.parsedType}),pe;if(u.data.length<this._def.items.length)return ee(u,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&u.data.length>this._def.items.length&&(ee(u,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const f=[...u.data].map((m,x)=>{const y=this._def.items[x]||this._def.rest;return y?y._parse(new tn(u,m,u.path,x)):null}).filter(m=>!!m);return u.common.async?Promise.all(f).then(m=>Ht.mergeArray(i,m)):Ht.mergeArray(i,f)}get items(){return this._def.items}rest(l){return new Bl({...this._def,rest:l})}}Bl.create=(a,l)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bl({items:a,typeName:xe.ZodTuple,rest:null,...Ne(l)})};class bu extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:i,ctx:u}=this._processInputParams(l);if(u.parsedType!==se.object)return ee(u,{code:K.invalid_type,expected:se.object,received:u.parsedType}),pe;const d=[],f=this._def.keyType,m=this._def.valueType;for(const x in u.data)d.push({key:f._parse(new tn(u,x,u.path,x)),value:m._parse(new tn(u,u.data[x],u.path,x)),alwaysSet:x in u.data});return u.common.async?Ht.mergeObjectAsync(i,d):Ht.mergeObjectSync(i,d)}get element(){return this._def.valueType}static create(l,i,u){return i instanceof Oe?new bu({keyType:l,valueType:i,typeName:xe.ZodRecord,...Ne(u)}):new bu({keyType:Wa.create(),valueType:l,typeName:xe.ZodRecord,...Ne(i)})}}class _x extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:i,ctx:u}=this._processInputParams(l);if(u.parsedType!==se.map)return ee(u,{code:K.invalid_type,expected:se.map,received:u.parsedType}),pe;const d=this._def.keyType,f=this._def.valueType,m=[...u.data.entries()].map(([x,y],v)=>({key:d._parse(new tn(u,x,u.path,[v,"key"])),value:f._parse(new tn(u,y,u.path,[v,"value"]))}));if(u.common.async){const x=new Map;return Promise.resolve().then(async()=>{for(const y of m){const v=await y.key,w=await y.value;if(v.status==="aborted"||w.status==="aborted")return pe;(v.status==="dirty"||w.status==="dirty")&&i.dirty(),x.set(v.value,w.value)}return{status:i.value,value:x}})}else{const x=new Map;for(const y of m){const v=y.key,w=y.value;if(v.status==="aborted"||w.status==="aborted")return pe;(v.status==="dirty"||w.status==="dirty")&&i.dirty(),x.set(v.value,w.value)}return{status:i.value,value:x}}}}_x.create=(a,l,i)=>new _x({valueType:l,keyType:a,typeName:xe.ZodMap,...Ne(i)});class qi extends Oe{_parse(l){const{status:i,ctx:u}=this._processInputParams(l);if(u.parsedType!==se.set)return ee(u,{code:K.invalid_type,expected:se.set,received:u.parsedType}),pe;const d=this._def;d.minSize!==null&&u.data.size<d.minSize.value&&(ee(u,{code:K.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),i.dirty()),d.maxSize!==null&&u.data.size>d.maxSize.value&&(ee(u,{code:K.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),i.dirty());const f=this._def.valueType;function m(y){const v=new Set;for(const w of y){if(w.status==="aborted")return pe;w.status==="dirty"&&i.dirty(),v.add(w.value)}return{status:i.value,value:v}}const x=[...u.data.values()].map((y,v)=>f._parse(new tn(u,y,u.path,v)));return u.common.async?Promise.all(x).then(y=>m(y)):m(x)}min(l,i){return new qi({...this._def,minSize:{value:l,message:ce.toString(i)}})}max(l,i){return new qi({...this._def,maxSize:{value:l,message:ce.toString(i)}})}size(l,i){return this.min(l,i).max(l,i)}nonempty(l){return this.min(1,l)}}qi.create=(a,l)=>new qi({valueType:a,minSize:null,maxSize:null,typeName:xe.ZodSet,...Ne(l)});class Ld extends Oe{get schema(){return this._def.getter()}_parse(l){const{ctx:i}=this._processInputParams(l);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Ld.create=(a,l)=>new Ld({getter:a,typeName:xe.ZodLazy,...Ne(l)});class wu extends Oe{_parse(l){if(l.data!==this._def.value){const i=this._getOrReturnCtx(l);return ee(i,{received:i.data,code:K.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:l.data}}get value(){return this._def.value}}wu.create=(a,l)=>new wu({value:a,typeName:xe.ZodLiteral,...Ne(l)});function Ty(a,l){return new ql({values:a,typeName:xe.ZodEnum,...Ne(l)})}class ql extends Oe{_parse(l){if(typeof l.data!="string"){const i=this._getOrReturnCtx(l),u=this._def.values;return ee(i,{expected:Be.joinValues(u),received:i.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(l.data)){const i=this._getOrReturnCtx(l),u=this._def.values;return ee(i,{received:i.data,code:K.invalid_enum_value,options:u}),pe}return Ca(l.data)}get options(){return this._def.values}get enum(){const l={};for(const i of this._def.values)l[i]=i;return l}get Values(){const l={};for(const i of this._def.values)l[i]=i;return l}get Enum(){const l={};for(const i of this._def.values)l[i]=i;return l}extract(l,i=this._def){return ql.create(l,{...this._def,...i})}exclude(l,i=this._def){return ql.create(this.options.filter(u=>!l.includes(u)),{...this._def,...i})}}ql.create=Ty;class Md extends Oe{_parse(l){const i=Be.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(l);if(u.parsedType!==se.string&&u.parsedType!==se.number){const d=Be.objectValues(i);return ee(u,{expected:Be.joinValues(d),received:u.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(Be.getValidEnumValues(this._def.values))),!this._cache.has(l.data)){const d=Be.objectValues(i);return ee(u,{received:u.data,code:K.invalid_enum_value,options:d}),pe}return Ca(l.data)}get enum(){return this._def.values}}Md.create=(a,l)=>new Md({values:a,typeName:xe.ZodNativeEnum,...Ne(l)});class Su extends Oe{unwrap(){return this._def.type}_parse(l){const{ctx:i}=this._processInputParams(l);if(i.parsedType!==se.promise&&i.common.async===!1)return ee(i,{code:K.invalid_type,expected:se.promise,received:i.parsedType}),pe;const u=i.parsedType===se.promise?i.data:Promise.resolve(i.data);return Ca(u.then(d=>this._def.type.parseAsync(d,{path:i.path,errorMap:i.common.contextualErrorMap})))}}Su.create=(a,l)=>new Su({type:a,typeName:xe.ZodPromise,...Ne(l)});class Hl extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(l){const{status:i,ctx:u}=this._processInputParams(l),d=this._def.effect||null,f={addIssue:m=>{ee(u,m),m.fatal?i.abort():i.dirty()},get path(){return u.path}};if(f.addIssue=f.addIssue.bind(f),d.type==="preprocess"){const m=d.transform(u.data,f);if(u.common.async)return Promise.resolve(m).then(async x=>{if(i.value==="aborted")return pe;const y=await this._def.schema._parseAsync({data:x,path:u.path,parent:u});return y.status==="aborted"?pe:y.status==="dirty"||i.value==="dirty"?Li(y.value):y});{if(i.value==="aborted")return pe;const x=this._def.schema._parseSync({data:m,path:u.path,parent:u});return x.status==="aborted"?pe:x.status==="dirty"||i.value==="dirty"?Li(x.value):x}}if(d.type==="refinement"){const m=x=>{const y=d.refinement(x,f);if(u.common.async)return Promise.resolve(y);if(y instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return x};if(u.common.async===!1){const x=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return x.status==="aborted"?pe:(x.status==="dirty"&&i.dirty(),m(x.value),{status:i.value,value:x.value})}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(x=>x.status==="aborted"?pe:(x.status==="dirty"&&i.dirty(),m(x.value).then(()=>({status:i.value,value:x.value}))))}if(d.type==="transform")if(u.common.async===!1){const m=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!Ms(m))return pe;const x=d.transform(m.value,f);if(x instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:x}}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(m=>Ms(m)?Promise.resolve(d.transform(m.value,f)).then(x=>({status:i.value,value:x})):pe);Be.assertNever(d)}}Hl.create=(a,l,i)=>new Hl({schema:a,typeName:xe.ZodEffects,effect:l,...Ne(i)});Hl.createWithPreprocess=(a,l,i)=>new Hl({schema:l,effect:{type:"preprocess",transform:a},typeName:xe.ZodEffects,...Ne(i)});class An extends Oe{_parse(l){return this._getType(l)===se.undefined?Ca(void 0):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}An.create=(a,l)=>new An({innerType:a,typeName:xe.ZodOptional,...Ne(l)});class $l extends Oe{_parse(l){return this._getType(l)===se.null?Ca(null):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}$l.create=(a,l)=>new $l({innerType:a,typeName:xe.ZodNullable,...Ne(l)});class ju extends Oe{_parse(l){const{ctx:i}=this._processInputParams(l);let u=i.data;return i.parsedType===se.undefined&&(u=this._def.defaultValue()),this._def.innerType._parse({data:u,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}ju.create=(a,l)=>new ju({innerType:a,typeName:xe.ZodDefault,defaultValue:typeof l.default=="function"?l.default:()=>l.default,...Ne(l)});class Nu extends Oe{_parse(l){const{ctx:i}=this._processInputParams(l),u={...i,common:{...i.common,issues:[]}},d=this._def.innerType._parse({data:u.data,path:u.path,parent:{...u}});return xu(d)?d.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new Cn(u.common.issues)},input:u.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new Cn(u.common.issues)},input:u.data})}}removeCatch(){return this._def.innerType}}Nu.create=(a,l)=>new Nu({innerType:a,typeName:xe.ZodCatch,catchValue:typeof l.catch=="function"?l.catch:()=>l.catch,...Ne(l)});class kx extends Oe{_parse(l){if(this._getType(l)!==se.nan){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:se.nan,received:u.parsedType}),pe}return{status:"valid",value:l.data}}}kx.create=a=>new kx({typeName:xe.ZodNaN,...Ne(a)});class Oy extends Oe{_parse(l){const{ctx:i}=this._processInputParams(l),u=i.data;return this._def.type._parse({data:u,path:i.path,parent:i})}unwrap(){return this._def.type}}class ef extends Oe{_parse(l){const{status:i,ctx:u}=this._processInputParams(l);if(u.common.async)return(async()=>{const f=await this._def.in._parseAsync({data:u.data,path:u.path,parent:u});return f.status==="aborted"?pe:f.status==="dirty"?(i.dirty(),Li(f.value)):this._def.out._parseAsync({data:f.value,path:u.path,parent:u})})();{const d=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return d.status==="aborted"?pe:d.status==="dirty"?(i.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:u.path,parent:u})}}static create(l,i){return new ef({in:l,out:i,typeName:xe.ZodPipeline})}}class _u extends Oe{_parse(l){const i=this._def.innerType._parse(l),u=d=>(Ms(d)&&(d.value=Object.freeze(d.value)),d);return xu(i)?i.then(d=>u(d)):u(i)}unwrap(){return this._def.innerType}}_u.create=(a,l)=>new _u({innerType:a,typeName:xe.ZodReadonly,...Ne(l)});var xe;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(xe||(xe={}));const p=Wa.create,A=Ul.create;zl.create;const Me=yu.create;Ds.create;const Ly=Td.create;cl.create;const ae=en.create,B=kt.create,W1=vu.create,My=Pd.create;gu.create;Bl.create;const Hi=bu.create,_a=wu.create,he=ql.create;Su.create;An.create;$l.create;const Ax={string:(a=>Wa.create({...a,coerce:!0})),number:(a=>Ul.create({...a,coerce:!0})),boolean:(a=>yu.create({...a,coerce:!0})),bigint:(a=>zl.create({...a,coerce:!0})),date:(a=>Ds.create({...a,coerce:!0}))},P1=pe,ew=p().regex(/^github\.com\/[^/]+\/[^/]+$/,"Expected github.com/<owner>/<repo>"),tw=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?$/;function aw(a){const l=a.trim();return l?!!(l.startsWith("/")||l.startsWith("~")||l.startsWith(".")||/^[A-Za-z]:[\\/]/.test(l)||l.startsWith("\\\\")):!1}function tf(a){const l=a.trim();if(!l)throw new Error("Repository is required");if(aw(l))throw new Error("Local filesystem paths are no longer accepted. Pass a GitHub URL or owner/repo (e.g. https://github.com/acme/app or acme/app).");let i,u;const d=tw.exec(l);if(d&&!l.includes("://")&&!l.toLowerCase().includes("github.com"))i=d[1],u=d[2];else{let m=l;/^[a-z][a-z0-9+.-]*:\/\//i.test(m)||(m.startsWith("git@")?m=m.replace(/^git@([^:]+):/,"https://$1/"):m=`https://${m}`);let x;try{x=new URL(m)}catch{throw new Error(`Unrecognized GitHub repository reference: ${a}`)}if(!/^([^.]+\.)?github\.com$/i.test(x.hostname))throw new Error(`Only github.com repositories are supported (got host ${x.hostname})`);const y=x.pathname.replace(/^\/+|\/+$/g,"").split("/");if(y.length<2||!y[0]||!y[1])throw new Error(`Unrecognized GitHub repository reference: ${a}`);i=y[0],u=y[1].replace(/\.git$/i,"")}if(!i||!u||i.includes("..")||u.includes(".."))throw new Error(`Unrecognized GitHub repository reference: ${a}`);const f=ew.parse(`github.com/${i}/${u}`);return{owner:i,repo:u,identity:f,cloneUrl:`https://github.com/${i}/${u}.git`}}const Dy=p().min(1).transform((a,l)=>{try{return tf(a).identity}catch(i){return l.addIssue({code:K.custom,message:i.message}),P1}}),Uy="repo:",nw=he(["resolved","unresolved","conflict","invalid"]),lw=B({status:nw,repository:p().optional(),sourceLabel:p().optional(),labels:ae(p()).optional(),error:p().optional()});function sw(a){return a?a.filter(l=>l.toLowerCase().startsWith(Uy)):[]}const iw=100,rw=B({label:p(),repository:p()});B({mappings:ae(rw).max(iw+1)});function zy(a){const l=sw(a);if(l.length===0)return{status:"unresolved",labels:[]};if(l.length>1)return{status:"conflict",labels:[...l]};const i=l[0],u=i.slice(Uy.length).trim();if(!u)return{status:"invalid",labels:[i],error:"Repository label has no value"};try{return{status:"resolved",repository:tf(u).identity,sourceLabel:i,labels:[i]}}catch(d){return{status:"invalid",labels:[i],error:d.message}}}const By=B({id:p(),title:p(),url:p(),subtitle:p().optional(),source:p().optional()});B({linearAttachmentId:p(),kind:he(["file","link"]),title:p(),safeFileName:p().optional(),blobPath:p().optional(),contentType:p().optional(),sizeBytes:A().int().nonnegative().optional(),sha256:p().optional(),url:p(),subtitle:p().optional(),source:p().optional()});const $t=he(["claude_code","cursor_local","codex_local","muse_code"]),Ha=B({maxTurns:A().positive().nullable().optional(),maxBudgetUsd:A().positive().nullable().optional()}),qy=B({plan:Ha.optional(),execute:Ha.optional(),reflect:Ha.optional()});function hu(a){if(!(a!=null&&a.trim()))return null;try{const l=Ha.parse(JSON.parse(a));return l.maxTurns==null&&l.maxBudgetUsd==null?null:l}catch{return null}}function uw(a){return!a||a.maxTurns==null&&a.maxBudgetUsd==null?null:JSON.stringify(a)}const af=he(["developer","reviewer","legacy"]),ow=he(["queued","running","done","failed","timed_out","cancelled"]);B({id:p().uuid(),issueId:p().uuid(),role:af,round:A().int().min(1),agentId:p().uuid().nullable(),runtime:$t.nullable(),model:p().nullable(),budgetJson:p().nullable(),worktreePath:p().nullable(),inputSha:p().nullable(),status:ow,sessionRef:p().nullable(),logPath:p().nullable(),exitCode:A().int().nullable(),errorJson:p().nullable(),metadataJson:p().nullable(),profileSnapshotJson:p().nullable(),processPid:A().int().nullable(),processOwner:p().nullable(),processStartedAt:p().nullable(),deckCorrelationId:p().uuid().nullable(),createdAt:p(),startedAt:p().nullable(),heartbeatAt:p().nullable(),completedAt:p().nullable(),updatedAt:p()});B({issueId:p().uuid(),role:af,round:A().int().min(1),agentId:p().uuid().nullable(),runtime:$t.nullable(),model:p().nullable().optional(),budgetJson:p().nullable().optional(),inputSha:p().nullable().optional(),metadataJson:p().nullable().optional(),profileSnapshotJson:p().nullable().optional()});const cw=B({worktreeWrite:Me(),publishReview:Me(),outboundMutation:Me(),resolveHumanAction:Me()}),Hy=B({worktreeWrite:Me().optional(),outboundMutation:Me().optional()}).strict(),Du=he(["low","medium","high"]);B({version:_a(1),agentId:p().nullable(),role:af,runtime:$t.nullable(),model:p().nullable(),effort:Du.nullable().default(null),budgetJson:p().nullable(),permissionPolicy:cw,deckId:p().nullable(),purpose:p().nullable(),capturedAt:p()});const $y="auto",dw="muse-spark-1.3-contributor",fw=B({code:he(["cli_missing","runtime_auth","runtime_unknown","runtime_capability","cursor_keychain","usage_capped","deck_offline","deck_unauthorized","workspace_missing","deck_missing","mcp_not_registered","github_cli_missing","github_auth","github_unreachable"]),message:p()}),hw=B({id:p().uuid(),name:p(),runtime:$t,workspaceRoot:p().nullable(),deckId:p().uuid().nullable(),deckName:p().nullable(),playbookId:p().nullable(),defaultPlanModel:p().nullable(),defaultExecuteModel:p().nullable(),defaultPlanBudgetJson:p().nullable(),defaultExecuteBudgetJson:p().nullable(),defaultModel:p().nullable(),defaultEffort:Du.nullable(),defaultBudgetJson:p().nullable(),purpose:p().nullable(),playbookIdsJson:p().nullable(),externalMemoryRefsJson:p().nullable(),permissionPolicyJson:p().nullable(),isBuiltin:Me(),createdAt:p(),updatedAt:p()}),Yy=hw.extend({healthy:Me(),issues:ae(fw)});B({name:p().min(1),runtime:$t,deckId:p().uuid(),defaultModel:p().nullable().optional(),defaultEffort:Du.nullable().optional(),defaultBudget:Ha.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:Hy.nullable().optional()});B({name:p().min(1).optional(),runtime:$t.optional(),deckId:p().uuid().nullable().optional(),defaultModel:p().nullable().optional(),defaultEffort:Du.nullable().optional(),defaultBudget:Ha.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:Hy.nullable().optional()});B({agents:ae(Yy),issueCount:A()});function Ex(a){return a.defaultModel??a.defaultExecuteModel??a.defaultPlanModel??null}function mw(a){const l=hu(a.defaultBudgetJson)??hu(a.defaultExecuteBudgetJson)??hu(a.defaultPlanBudgetJson);return uw(l)}const pw=he(["slack_message","email","service_tool_call"]),xw=B({target:p().min(1).max(120),body:p().min(1).max(4e3)}),yw=B({serviceName:p().min(1).max(120),toolName:p().min(1).max(120),arguments:Hi(Ly())}),vw=B({actionType:pw,summary:xw,toolCall:yw}),gw=he(["pending","sent","rejected"]);B({draft:vw,status:gw,sentAt:p().optional(),rejectedAt:p().optional(),bodyMismatch:Me().optional(),deliveryAttempts:A().int().min(0).default(0)});B({draftArtifactId:p().uuid(),sentAt:p(),toolResult:Hi(Ly()),permalink:p().url().optional()});const bw=B({failure_summary:p().min(1),user_feedback_excerpt:p().min(1),corrected_output_hint:p().optional()}),ww=My("op",[B({op:_a("add_item"),section:p().min(1),text:p().min(1)}),B({op:_a("amend_item"),section:p().min(1),anchor:p().min(1),text:p().min(1)}),B({op:_a("remove_item"),section:p().min(1),anchor:p().min(1)}),B({op:_a("set_triggers"),triggers:ae(p())}),B({op:_a("rewrite_body"),text:p()})]);B({rationale:p().min(1),ops:ae(ww).min(1),evidence:bw.optional()});const Sw="v1",Vy=he(["feature","bug fix","refactor","investigation","split child"]);Vy.options;const jw=B({text:p(),evidence:p().nullable()}),Nw=B({version:_a(Sw),executionMode:Vy,nonGoals:ae(p()),exitPredicate:p(),onePrStoppingPoint:p(),acceptanceCriteria:ae(jw)}),Zy={executionMode:"Builder execution mode",nonGoals:"Non-goals",exitPredicate:"Exit predicate",onePrStoppingPoint:"One-PR stopping point",acceptanceCriteria:"Acceptance criteria"},_w=Object.keys(Zy);function kw(a){return a.trim().toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ").trim()}Object.fromEntries(_w.map(a=>[kw(Zy[a]),a]));const Aw=he(["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"]),Ew=he(["human","developer","reviewer","system"]),Gy=he(["manual","linear","agent"]),Cw=B({id:p().uuid(),source:Gy,externalId:p().nullable(),externalLabel:p().nullable(),externalUrl:p().nullable(),title:p(),description:p().nullable(),acceptanceCriteria:p().nullable(),executionContract:Nw.nullable().optional(),repo:p(),baseBranch:p(),status:Aw,currentOwner:Ew,currentIntent:p().nullable(),developerAgentId:p().uuid().nullable(),reviewerAgentId:p().uuid().nullable(),maxReviewRounds:A().int().min(1),currentRound:A().int().min(1),maxInfraAttempts:A().int().min(0),infraAttempts:A().int().min(0),maxCiAttempts:A().int().min(0),ciAttempts:A().int().min(0),branch:p().nullable(),baseSha:p().nullable(),headSha:p().nullable(),prNumber:A().int().nullable(),prUrl:p().nullable(),autoMerge:Me(),createdAt:p(),updatedAt:p()});B({title:p().min(1),description:p().optional(),acceptanceCriteria:p().optional(),repo:Dy,baseBranch:p().min(1).default("main"),developerAgentId:p().uuid(),reviewerAgentId:p().uuid(),maxReviewRounds:A().int().min(1).default(3),maxInfraAttempts:A().int().min(0).default(3),autoMerge:Me().default(!1),source:Gy.default("manual"),externalId:p().optional(),externalLabel:p().optional(),externalUrl:p().optional(),enqueue:Me().default(!0),linearAttachments:ae(By).optional()});B({title:p().min(1).optional(),description:p().nullable().optional(),acceptanceCriteria:p().nullable().optional(),repo:Dy.optional(),baseBranch:p().min(1).optional(),developerAgentId:p().uuid().optional(),reviewerAgentId:p().uuid().optional(),maxReviewRounds:A().int().min(1).optional(),maxInfraAttempts:A().int().min(0).optional(),autoMerge:Me().optional()});const Cx={ready:["developing","closed"],developing:["developing","reviewing","needs_human","closed"],reviewing:["reviewing","repairing","final_review","needs_human","closed"],repairing:["repairing","reviewing","needs_human","closed"],needs_human:["developing","reviewing","repairing","final_review","done","closed"],final_review:["final_review","done","repairing","needs_human","closed"],done:[],closed:[]};Object.keys(Cx).filter(a=>Cx[a].length===0);const Rw=he(["enqueued","already_queued","not_queued"]);Cw.extend({created:Me(),queue:Rw,priorPasses:A().int().min(0)});B({id:p(),issueId:p().nullable(),workerSessionId:p().nullable(),kind:p(),contentJson:p().nullable(),blobPath:p().nullable(),author:he(["human","agent","system"]),createdAt:p()});const Tw=he(["authentication_configuration","provider_capacity_rate_limit","agent_cli_crash","tool_test_timeout","muse_no_progress","coordinator_crash","validation_failure","publish_git_failure","agent_deck_unavailable","host_sleep_liveness","unknown"]),Ow=he(["task","infrastructure","unknown"]),Lw=he(["high","medium","low"]),Mw=he(["outcome_kind","session_error","spawn_log","workflow_event","recovery"]),Dw=he(["exact","inferred"]),Dd=B({code:Tw,domain:Ow,primary:Me(),confidence:Lw,evidenceSource:Mw,occurredAt:p().nullable(),eventCursor:A().int().nullable(),rawReason:p(),sessionId:p().nullable(),logPath:p().nullable(),eventId:p().nullable(),eventType:p().nullable(),quality:Dw}),Uw=he(["commit","verification_receipt","branch_pushed"]),zw=he(["sampler","salvage","session_end"]),nf=he(["worktree","commit","verification_receipt","publish_only"]);B({kind:Uw,observedSha:p().nullable(),observedAt:p(),origin:zw.nullable(),inputSha:p().nullable(),samplingPrecisionMs:A().int().nullable(),branch:p().nullable()});B({kinds:ae(nf),retryReason:p().nullable()});const Bw=he(["done","closed","migrated"]);B({id:p().uuid(),issueId:p().uuid(),workflowVersion:p(),startedAt:p(),completedAt:p().nullable(),outcome:Bw.nullable()});const qw=he(["issue.created","issue.reassigned","issue.source_reloaded","workflow.started","worker.started","worker.completed","worker.failed","worker.deferred","worktree.ready","worktree.deps_ready","inputs.materialized","deck.connected","brief.resolved","branch.pushed","checks.started","pull_request.opened","pull_request.updated","checks.completed","review.submitted","repair.started","guidance.added","task_snapshot.refreshed","human_action.requested","human_action.resolved","final_review.requested","issue.completed","issue.closed","queue.enqueued","queue.wait_reason_changed","queue.admitted","queue.removed","agent.started","agent.completed","host.suspended","checkpoint.observed","retry.reused","auto_merge.conflict_sync","auto_merge.conflict_repair_queued","base.probe","base.advanced","operator_verification.waived","legacy.imported"]);B({id:p().uuid(),issueId:p().uuid(),workflowInstanceId:p().uuid().nullable(),workerSessionId:p().uuid().nullable(),type:qw,actorType:he(["human","developer","reviewer","system"]),actorRef:p().nullable(),stage:p(),round:A().int().nullable(),payloadJson:p().nullable(),artifactRef:p().nullable(),idempotencyKey:p().nullable(),causationEventId:p().uuid().nullable(),ts:p()});const Hw=he(["product_scope_decision","policy_escalation","attempts_exhausted","final_review","deck_interaction_required","reflection_interaction_required","outbound_delivery_interaction_required","muse_capability","operator_verification"]),$w=he(["open","resolved"]);B({id:p().uuid(),issueId:p().uuid().nullable(),runId:p().uuid().nullable(),workflowInstanceId:p().uuid().nullable(),actionType:Hw,reason:p(),question:p(),evidenceJson:p().nullable(),responseOptionsJson:p().nullable(),continuationPreviewJson:p().nullable(),requestId:p().nullable(),status:$w,resolutionJson:p().nullable(),resolvedBy:p().nullable(),requestedAt:p(),resolvedAt:p().nullable()});function Uu(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}function Yw(a){const l=Uu(a.responseOptionsJson);return Array.isArray(l)?l.filter(i=>typeof(i==null?void 0:i.choice)=="string"&&typeof(i==null?void 0:i.label)=="string"):[]}function lf(a){return Uu(a.evidenceJson)??{}}function zu(a){const i=lf(a).pushDivergence;return!i||typeof i!="object"?null:i}function Vw(a){const i=lf(a).worktreeBlocker;return!!i&&typeof i=="object"&&typeof i.fingerprint=="string"}function Zw(a){return lf(a).mergeFailure===!0}function Qy(a){const l=Uu(a.continuationPreviewJson);return typeof(l==null?void 0:l.resumeRole)=="string"?l.resumeRole:null}const Gw=/worktree|unpushed|uncommitted|dirty|preserved|non-fast-forward|diverged|already used by|recovery:|force-with-lease/i,Qw=/could not be pushed|non-fast-forward|rejected.*push|push.*rejected/i,Xw=/uncommitted|dirty worktree|has uncommitted changes/i;function Xy(a){const l=/\n?Recovery:\s*\n?/,i=a.match(l);if(!i||i.index===void 0)return{head:a.trim(),commands:[]};const u=a.slice(0,i.index).trim(),f=a.slice(i.index+i[0].length).split(`
|
|
61
|
-
`).map(m=>m.trim()).filter(m=>m.length>0);return{head:u,commands:f}}function Iw(a){const i=Xy(a).head.replace(/\s+/g," ").trim(),u=i.match(/^(.+?[.!?])(\s|$)/);return(u?u[1]:i).trim()}const Kw=/(?:~|\/(?:[^/\s\\:"'*?<>|][^/\s\\:"'*?<>|]*))+(?:\/[^/\s\\:"'*?<>|]+)*/g;function Jw(a){const l=[],i=new Set,u=f=>{const m=f.trim().replace(/[.,;:!?)"'\]]+$/,"");m.length<2||i.has(m)||(i.add(m),l.push(m))};for(const f of[a.reason,a.question])for(const m of f.matchAll(Kw)){const x=m[0];/^\/\d+(\.\d+)*$/.test(x)||!x.includes("/")&&!x.startsWith("~")||u(x)}const d=zu(a);return typeof(d==null?void 0:d.worktreePath)=="string"&&d.worktreePath&&u(d.worktreePath),l}function Rx(a){return a.length>12?a.slice(0,12):a}function Fw(a){const l=[],i=zu(a);if(i&&typeof i.localSha=="string"&&typeof i.remoteSha=="string"){const d=typeof i.branch=="string"?i.branch:"the branch",f=typeof i.ahead=="number"?` (+${i.ahead})`:"",m=typeof i.behind=="number"?` (+${i.behind})`:"";l.push(`Push: local ${i.localSha}${f} · origin/${d} ${i.remoteSha}${m}`),typeof i.observedRemoteSha=="string"&&i.observedRemoteSha!==i.remoteSha&&l.push(`Remote moved: origin/${d} is now at ${i.observedRemoteSha}`),typeof i.lastLeaseError=="string"&&i.lastLeaseError&&l.push(`Last lease attempt: ${i.lastLeaseError}`)}const u=Qy(a);return u&&l.push(`Continuation: resumes as ${u}`),l}function Ww(a){return a==="close"||a==="reject"||a==="abort"}function sl(a){return a.length===0?null:a.some(l=>l.choice==="push_with_lease")?"push_with_lease":(a.find(l=>!Ww(l.choice))??a[0]).choice}function Pw(a){if(a.actionType!=="policy_escalation")return"other";if(Zw(a))return"merge-failure";const l=zu(a);if((l==null?void 0:l.relationship)==="diverged")return"diverged-push";if(l&&(l.relationship==="behind"||typeof l.localSha=="string"))return"unpushed";const i=`${a.reason}
|
|
62
|
-
${a.question}`;return Qw.test(i)?"unpushed":Qy(a)==="reviewer"?"reviewer-retry":Xw.test(i)?"dirty-worktree":Vw(a)||/already used by worktree/i.test(i)||/worktree/i.test(i)&&/Recovery:/.test(i)?"worktree-conflict":"ordinary-escalation"}const e2="Resume safely";function Iy(a){const l=Pw(a),i=Yw(a),{commands:u}=Xy(a.reason),d=Jw(a),f=Fw(a),m=(()=>{const y=Uu(a.evidenceJson);return y==null?null:JSON.stringify(y,null,2)})(),x={question:a.question,reason:a.reason,commands:u,paths:d,factLines:f,evidencePretty:m};switch(l){case"diverged-push":{const y=zu(a),v=y&&typeof y.branch=="string"&&typeof y.localSha=="string"&&typeof y.remoteSha=="string"?` (origin/${y.branch}: local ${Rx(y.localSha)} against remote ${Rx(y.remoteSha)})`:"";return{kind:l,title:"Publish these finished commits with a pinned lease?",context:`Your branch diverged from the remote — confirm the pinned commits${v} under Details, then choose Push with lease.`,safeResume:!1,displayOptions:i,primaryChoice:sl(i),details:x}}case"unpushed":return{kind:l,title:"The push was rejected — how should we proceed?",context:"Your commits are saved; resuming continues development without discarding them.",safeResume:!1,displayOptions:i,primaryChoice:sl(i),details:x};case"worktree-conflict":return{kind:l,title:"A saved worktree still holds this branch — how should we proceed?",context:"Your work is preserved; check the worktree path and recovery steps under Details before choosing.",safeResume:!1,displayOptions:i,primaryChoice:sl(i),details:x};case"dirty-worktree":return{kind:l,title:"Uncommitted changes were preserved — how should we proceed?",context:"Nothing was discarded; review the saved changes under Details before choosing.",safeResume:!1,displayOptions:i,primaryChoice:sl(i),details:x};case"merge-failure":return{kind:l,title:"The merge failed after approval — retry it?",context:"The work is already approved; retrying the merge publishes the same commits without a new developer round.",safeResume:!1,displayOptions:i,primaryChoice:sl(i),details:x};case"reviewer-retry":return{kind:l,title:"The review attempt failed — retry it?",context:"Nothing is wrong with the code itself; retrying re-queues the reviewer at the same pinned commit.",safeResume:!0,displayOptions:i,primaryChoice:sl(i),details:x};case"ordinary-escalation":{const y=Iw(a.reason),v=!Gw.test(`${a.reason}
|
|
63
|
-
${a.question}`),w=v?i.map(j=>j.choice==="resume"&&j.label==="Resume development"?{...j,label:e2}:j):i;return{kind:l,title:"Development is parked — resume or close?",context:y?`${y} Choose ${v?"Resume safely":"Resume"} to continue, or Close to stop.`:null,safeResume:v,displayOptions:w,primaryChoice:sl(w),details:x}}case"other":default:return{kind:"other",title:a.question,context:null,safeResume:!1,displayOptions:i,primaryChoice:sl(i),details:x}}}const t2=he(["blocking","non_blocking"]),a2=he(["open","resolved","recurring","superseded"]);B({id:p().uuid(),issueId:p().uuid(),fingerprint:p(),severity:t2,title:p(),rationale:p(),evidenceRef:p().nullable(),file:p().nullable(),line:A().int().nullable(),status:a2,firstRound:A().int().min(1),lastRound:A().int().min(1)});B({id:p().uuid(),issueId:p().uuid(),workerSessionId:p().uuid(),role:he(["developer","reviewer","legacy"]),runtime:p().nullable(),tokensIn:A().int().nullable(),tokensOut:A().int().nullable(),costUsd:A().nullable(),durationMs:A().int().nullable(),ts:p(),model:p().nullable().optional()});const n2=B({available:_a(!0)}),l2=B({available:_a(!1),until:p(),reason:p()});My("available",[n2,l2]);const sf=he(["supported_protocol","observed_event","experimental_api","unavailable"]),Bu=he(["unsupported","missing","expired","unparsable","stale"]),s2=he(["five_hour","weekly"]),i2=B({message:p().min(1),consecutiveFailures:A().int().positive(),firstFailureAt:p(),lastFailureAt:p()}),r2=B({windowKey:p().min(1),providerBucket:p().min(1),durationMinutes:A().int().positive().nullable(),displayLabel:p().min(1),usedValue:A().nullable(),usedUnit:p().nullable(),remainingPercent:A().min(0).max(100).nullable(),resetAt:p().nullable(),observedAt:p(),freshUntil:p().nullable(),expiresAt:p().nullable(),source:sf,unavailableReason:Bu.nullable(),unavailableDetail:i2.nullable().optional(),criticalRole:s2.nullable()}),u2=B({runtime:$t,windows:ae(r2),unavailableReason:Bu.nullable()});B({runtimes:ae(u2),generatedAt:p()});B({configured:Me(),cycleStart:p().nullable(),cycleEnd:p().nullable(),spendValue:A().nullable(),spendUnit:p().nullable(),hardLimitValue:A().nullable(),hardLimitUnit:p().nullable(),memberCount:A().nullable(),memberLimitOverrideCount:A().nullable(),usagePeriodStart:p().nullable(),usagePeriodEnd:p().nullable(),usageSpendValue:A().nullable(),usageSpendUnit:p().nullable(),source:sf,unavailableReason:Bu.nullable(),observedAt:p().nullable(),generatedAt:p()});B({enabled:Me(),configured:Me(),cycleLabel:p().nullable(),cycleStart:p().nullable(),cycleEnd:p().nullable(),usageValue:A().nullable(),usageUnit:p().nullable(),remainingPercent:A().min(0).max(100).nullable(),source:sf,unavailableReason:Bu.nullable(),observedAt:p().nullable(),generatedAt:p()});function Ky(a,l=Date.now()){if(a.remainingPercent===null||a.source==="unavailable"||a.unavailableReason!==null)return!1;if(a.resetAt!==null){const i=Date.parse(a.resetAt);if(!Number.isFinite(i)||i<=l)return!1}if(a.freshUntil!==null){const i=Date.parse(a.freshUntil);if(!Number.isFinite(i)||i<=l)return!1}if(a.expiresAt!==null){const i=Date.parse(a.expiresAt);if(!Number.isFinite(i)||i<=l)return!1}if(a.observedAt){const i=Date.parse(a.observedAt);if(!Number.isFinite(i)||i>l+6e4)return!1}return!0}const o2=he(["queued","admitted","removed"]),c2=B({id:p().uuid(),issueId:p().uuid(),position:A().int(),enqueuedAt:p(),state:o2,waitReason:p().nullable(),waitReasonAt:p().nullable()});c2.extend({title:p().optional(),issueStatus:p().optional()});B({issueId:p().uuid()});const d2=W1([_a("top"),_a("bottom"),B({before:p().uuid()}).strict(),B({after:p().uuid()}).strict()]);B({to:d2});const Ud=5;B({maxActiveIssues:A().int().min(1).max(Ud)});B({active:A().int().min(0),waiting:A().int().min(0),limit:A().int().min(0),maxActiveIssues:A().int().min(1),ceiling:A().int().min(0),options:ae(A().int().min(1)),overCap:Me()});const la=he(["exact","inferred","unavailable"]),qu=B({quality:la,reasons:ae(p())}),Jy=he(["queue_wait","coordinator_setup","agent_process","coordinator_validation_publish","coordinator_work"]),zi=B({phase:Jy,startMs:A().int().nullable(),endMs:A().int().nullable(),durationMs:A().int().nullable(),quality:la,reasons:ae(p()),sessionId:p().nullable(),startCursor:A().int().nullable(),endCursor:A().int().nullable()}),f2=qu.extend({phase:Jy,durationMs:A().int().nullable(),rawCount:A().int(),known:A().int(),total:A().int()}),Fy=B({kind:he(["admission_dependency_wait","runtime_health_preflight","unexplained_silence","human_wait"]),startMs:A().int().nullable(),endMs:A().int().nullable(),durationMs:A().int().nullable(),quality:la,reasons:ae(p()),category:p().nullable(),sessionId:p().nullable()}),Jt=qu.extend({value:A().nullable(),known:A().int(),total:A().int()}),Pa=qu.extend({p50:A().nullable(),p95:A().nullable(),n:A().int()}),h2=B({sessionId:p(),role:p(),runtime:p().nullable(),model:p().nullable(),status:p(),round:A().int(),publishOnly:Me(),setup:zi,agentProcess:zi,validationPublish:zi,spawnEnvelopeMs:A().int().nullable(),spawnEnvelopeQuality:la,spawnEnvelopeReasons:ae(p()),failureCauses:ae(Dd),reuseKinds:ae(nf).optional(),silence:ae(Fy),silenceQuality:la,silenceReasons:ae(p()),tokensIn:A().int().nullable(),tokensOut:A().int().nullable(),costUsd:A().nullable(),usageDurationMs:A().int().nullable(),usageQuality:la,usageReasons:ae(p())}),m2=B({kind:p().nullable(),observedSha:p().nullable(),msSinceWorkflowStart:A().int().nullable(),quality:la,reasons:ae(p())}),p2=B({attempts:A().int(),retries:A().int(),cold:A().int(),reused:A().int(),unknown:A().int(),publishOnly:A().int(),reuseRate:A().nullable(),preservedKinds:ae(nf).optional(),quality:la,reasons:ae(p())}),x2=B({rounds:A().int(),verdicts:A().int(),changeRequests:A().int(),changeRequestRate:A().nullable(),quality:la,reasons:ae(p())});B({issueId:p(),elapsed:zi,rawIntervals:ae(zi),unionedDurations:ae(f2),exclusiveTotalMs:A().int().nullable(),exclusiveTotalQuality:la,exclusiveTotalReasons:ae(p()),nested:ae(Fy),attempts:ae(h2),primaryFailure:Dd.nullable(),primaryFailureQuality:la,primaryFailureReasons:ae(p()),consequenceCauses:ae(Dd),waste:B({failedAttempts:A().int(),publishOnlyAttempts:A().int(),runtimeMs:Jt,tokensIn:Jt,tokensOut:Jt,costUsd:Jt}),firstCheckpoint:m2,retry:p2,reviewer:x2,humanWaitMs:A().int().nullable(),humanWaitQuality:la,humanWaitReasons:ae(p()),interventionCount:A().int(),coverage:B({duration:Jt,tokens:Jt,cost:Jt})});B({from:p().nullable().default(null),to:p().nullable().default(null),role:p().nullable().default(null),runtime:p().nullable().default(null),model:p().nullable().default(null),status:p().nullable().default(null),repo:p().nullable().default(null),limit:A().int().min(1).max(200).default(50),offset:A().int().min(0).default(0)});const od=qu.extend({numerator:A().int(),denominator:A().int(),rate:A().nullable()}),cd=B({key:p(),attempts:A().int(),successes:A().int(),successRate:A().nullable(),retries:A().int(),retryRate:A().nullable(),wallTimeMs:Pa});B({window:B({from:p(),to:p(),defaultApplied:Me()}),pagination:B({limit:A().int(),offset:A().int(),totalIssues:A().int()}),issueIds:ae(p()),phaseWallTime:Hi(p(),Pa),attemptSuccess:od,issueSuccess:od,primaryFailures:ae(B({code:p(),count:A().int(),rate:A().nullable()})),primaryFailureDenominator:A().int(),waste:B({failedAttempts:A().int(),runtimeMs:Jt,tokensIn:Jt,tokensOut:Jt,costUsd:Jt}),checkpointLatencyMs:Pa,retryReuse:od,reviewer:B({rounds:A().int(),verdicts:A().int(),changeRequests:A().int(),changeRequestRate:A().nullable(),quality:la,reasons:ae(p())}),humanInterventions:B({totalActions:A().int(),issuesWithIntervention:A().int(),humanWaitMs:Pa}),byRole:ae(cd),byRuntime:ae(cd),byModel:ae(cd),coverage:B({duration:Jt,tokens:Jt,cost:Jt})});const y2=100,Wy=25,Py=5,v2=he(["developer","reviewer","legacy"]),g2=he(["authentication_configuration","provider_capacity_rate_limit","agent_cli_crash","tool_test_timeout","muse_no_progress","coordinator_crash","validation_failure","publish_git_failure","agent_deck_unavailable","host_sleep_liveness","unknown"]),b2=he(["task","infrastructure","unknown"]);B({from:p().optional(),to:p().optional(),repo:p().optional(),role:v2.optional(),runtime:p().optional(),model:p().optional(),status:p().optional(),page:Ax.number().int().min(1).default(1),limit:Ax.number().int().min(1).max(y2).default(Wy)});const ev=he(["exact","inferred","unavailable"]),wa=B({sum:A().nullable(),known:A().int().min(0),total:A().int().min(0),quality:ev,reasons:ae(p())}),dd=B({key:p(),issues:A().int().min(0),attempts:A().int().min(0),issueSuccess:A().nullable(),issueSuccessDenominator:A().int().min(0),attemptSuccess:A().nullable(),attemptSuccessDenominator:A().int().min(0),sessionWallMs:Pa,spawnEnvelopeMs:Pa,retryRate:A().nullable(),tokensIn:wa,tokensOut:wa,costUsd:wa,durationMs:wa,failedDurationMs:wa,failedTokensIn:wa,failedTokensOut:wa,failedCostUsd:wa}),w2=B({code:g2,domain:b2,count:A().int().min(0),share:A().nullable(),issueIds:ae(p()),issueTotal:A().int().min(0)}),S2=B({id:p(),title:p(),status:p(),repo:p(),attempts:A().int().min(0),updatedAt:p()}),j2=B({window:B({from:p(),to:p()}),filters:B({repo:p().nullable(),role:p().nullable(),runtime:p().nullable(),model:p().nullable(),status:ae(p())}),summary:B({issues:A().int().min(0),closedIssues:A().int().min(0),issueSuccess:A().nullable(),attempts:A().int().min(0),terminalAttempts:A().int().min(0),attemptSuccess:A().nullable(),retryRate:A().nullable(),retryExtraAttempts:A().int().min(0),reuseRate:A().nullable(),reuseDenominator:A().int().min(0),humanWaitMs:A().int().min(0),humanWaitQuality:ev,interventions:A().int().min(0),avgReviewerRounds:A().nullable(),reviewedIssues:A().int().min(0),changeRequestRate:A().nullable(),sessionWallMs:Pa,spawnEnvelopeMs:Pa,checkpointMs:Pa,phaseWallMs:ae(B({phase:p(),stat:Pa})),failedDurationMs:wa,failedTokensIn:wa,failedTokensOut:wa,failedCostUsd:wa}),byRole:ae(dd),byRuntime:ae(dd),byModel:ae(dd),failures:ae(w2),issues:ae(S2),pagination:B({page:A().int().min(1),limit:A().int().min(1),total:A().int().min(0),totalPages:A().int().min(0)}),meta:B({generatedAt:p(),partial:Me(),partialReasons:ae(p())})});function tv(a){const l=new URLSearchParams;for(const[i,u]of Object.entries(a)){if(u==null)continue;const d=String(u).trim();d&&(i==="page"&&d==="1"||i==="limit"&&d===String(Wy)||l.set(i,d))}return l.sort(),l.toString()}function il(a,l){return a.sum===null||a.known===0?"Unavailable":a.known<a.total?`${l(a.sum)} (${a.known}/${a.total} known)`:l(a.sum)}function av(a){return a<Py?`n=${a} (sparse)`:`n=${a}`}function zd(a){return a<Py}function Tx(a,l){if(a.n===0||a.p50===null&&a.p95===null)return"Unavailable";const i=u=>u===null?"–":l(u);return`P50 ${i(a.p50)} · P95 ${i(a.p95)} (${av(a.n)})`}function Mi(a){return`$${a.toFixed(2)}`}function Ke(a){return a.toLocaleString("en-US")}function N2(a){if(!Number.isFinite(a))return Ke(a);const l=Math.abs(a);if(l<1e3)return Ke(a);const i=u=>u>=100?String(Math.round(u)):u.toFixed(1).replace(/\.0$/,"");return l<1e6?`${i(a/1e3)}K`:`${i(a/1e6)}M`}function Kt(a){if(a<1e3)return`${Math.round(a)} ms`;const l=a/1e3;if(l<60)return`${l.toFixed(1)} s`;const i=Math.floor(l/60),u=Math.round(l%60);return i<60?`${i}m ${u}s`:`${Math.floor(i/60)}h ${i%60}m`}function Hu(a){return a===null||!Number.isFinite(a)?"Unavailable":`${(a*100).toFixed(1)}%`}const _2=he(["queued","plan_pending","plan_approved","running","review","done","failed","cancelled"]),nv=he(["code","communication","email","research","content","other"]),k2=he(["task_snapshot","draft_plan","approved_plan","plan_triage","plan_answers","acceptance_criteria","transcript","stream_trace","usage","agent_session","execution_result","diff","pr","email_draft","slack_draft","service_draft","document","research_brief","deliverable","feedback","playbook_patch","playbook_use_receipt","deck_feedback_signal","reflect_status","linear_sync","send_receipt","result_qa"]),$u=he(["plan","execute","reflect","qa"]),lv=he(["retry","approve"]);B({patchId:p(),playbookId:p().optional(),playbookTitle:p().optional(),rationale:p().optional(),status:_a("proposed"),trigger:lv,dashboardUrl:p().optional()});B({status:he(["pending","completed","failed","skipped"]),trigger:lv,error:p().optional()});const A2=B({type:he(["system","human","context","thinking","assistant","tool","rate_limit","result"]),text:p(),toolName:p().optional()});B({phase:$u,runtime:$t,entries:ae(A2)});const E2=B({phase:$u,runtime:$t,totalCostUsd:A().optional(),inputTokens:A().optional(),outputTokens:A().optional(),cacheReadTokens:A().optional(),cacheWriteTokens:A().optional(),durationMs:A().optional(),model:p().optional(),numTurns:A().optional(),maxTurns:A().optional(),maxBudgetUsd:A().optional()}),C2=B({label:p(),usage:E2,maxTurns:A().optional(),maxBudgetUsd:A().optional()});B({lines:ae(C2),total:B({totalCostUsd:A(),inputTokens:A(),outputTokens:A(),durationMs:A(),numTurns:A()})});B({phase:$u,runtime:$t,sessionId:p()});B({phase:$u,exitCode:A(),resultText:p().optional(),isError:Me().optional(),blocker:B({summary:p().optional()}).optional()});B({path:p(),title:p(),markdown:p()});B({markdown:p(),sessionId:p().optional()});const R2=he(["manual","linear"]);B({id:p(),title:p(),description:p().optional(),url:p().optional()});const _n=B({id:p().uuid(),source:R2,externalId:p().nullable(),externalLabel:p().nullable(),taskCategory:nv,title:p(),description:p().nullable(),repo:p().nullable(),artifactWorkspace:p().nullable(),agentId:p().uuid().nullable(),agentName:p().nullable(),deckId:p().nullable(),deckName:p().nullable(),playbookId:p().nullable(),runtime:$t.nullable(),planModel:p().nullable(),executeModel:p().nullable(),status:_2,lineageId:p().uuid().nullable(),acceptanceCriteria:p().nullable(),approvalGatesJson:p().nullable(),budgetJson:p().nullable(),createdAt:p(),updatedAt:p()});B({id:p().uuid(),runId:p().uuid(),kind:k2,contentJson:p().nullable(),blobPath:p().nullable(),author:he(["human","agent","system"]),createdAt:p()});B({id:p().uuid(),runId:p().uuid(),type:p(),payloadJson:p().nullable(),ts:p()});B({title:p().min(1),description:p().optional(),taskCategory:nv.default("other"),repo:p().optional(),artifactWorkspace:p().optional(),acceptanceCriteria:p().optional(),status:he(["queued","plan_pending","plan_approved"]).default("plan_pending"),agentId:p().uuid(),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),budget:qy.optional()});B({runtime:$t,deckId:p().uuid().optional(),playbookId:p().optional(),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),budget:qy.optional()});B({planMarkdown:p(),approve:Me().default(!1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),planBudget:Ha.nullable().optional(),executeBudget:Ha.nullable().optional()});B({runtime:$t.optional(),deckId:p().uuid().optional(),playbookId:p().optional(),executeModel:p().nullable().optional(),executeBudget:Ha.nullable().optional()});B({feedback:p().min(1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),executeBudget:Ha.nullable().optional()});B({outboundBody:p().min(1).max(4e3).optional()});const T2=B({id:p(),identifier:p(),title:p(),description:p().optional(),url:p(),state:p().optional(),labels:ae(p()).optional(),teamId:p().optional(),branchName:p().optional(),repoResolution:lw.optional(),attachments:ae(By).optional()});B({stateFilter:ae(p()),teamId:p().nullable(),assigneeMe:Me(),syncEnabled:Me()});const Bd=B({stateFilter:ae(p().min(1)).min(1),teamId:p().nullable(),assigneeMe:Me()});Bd.extend({persisted:Bd,envOverrides:B({stateFilter:Me(),teamId:Me()})});Bd.partial();const O2=B({id:p(),name:p(),key:p().optional()}),L2=B({name:p(),type:p().optional(),teamId:p().optional()});B({teams:ae(O2),workflowStates:ae(L2),viewer:B({id:p(),name:p(),email:p().optional()}).nullable()});B({candidates:ae(T2),hasMore:Me()});B({host:p(),port:A().int().min(1).max(65535),envOverride:Me()});const M2=he(["UNAUTHORIZED","DECK_UNAVAILABLE"]);B({connected:Me(),apiUrl:p(),mcpUrl:p(),deckCount:A().optional(),envOverride:Me(),error:p().optional(),deckAccessError:M2.optional(),deckAccessErrorMessage:p().optional()});B({agentId:p().uuid().optional(),autoAgent:Me().optional(),planModel:p().nullable().optional()}).refine(a=>a.agentId!==void 0||a.autoAgent===!0,{message:"Provide agentId or autoAgent: true"});B({planModel:p().nullable().optional(),planBudget:Ha.nullable().optional(),feedback:p().optional(),editedMarkdown:p().optional()});const D2=B({id:p(),label:p()});B({runtime:$t,models:ae(D2),source:he(["live","fallback"])});B({planReviewCount:A(),resultReviewCount:A(),maxConcurrent:A(),planningActiveRuns:ae(_n),planningQueuedRuns:ae(_n),runningRuns:ae(_n),waitingExecution:ae(_n),resultReviewRuns:ae(_n),recentDone:ae(_n),awaitingPlanReview:ae(_n),awaitingAnswerRuns:ae(_n),openQuestionCounts:Hi(p(),A()),pendingSendCounts:Hi(p(),A()),sentRunIds:ae(p()).optional(),autoApprovedRunIds:ae(p()),runs:ae(_n),agentDeckOnline:Me(),agents:ae(Yy),agentIssueCount:A()});const sv=new Map,fd=new Map;function qd(a){return sv.get(a)??null}function U2(a,l){l.models.length!==0&&sv.set(a,l)}function z2(a,l){const i=qd(a);if(i)return Promise.resolve(i);const u=fd.get(a);if(u)return u;const d=l().then(f=>(U2(a,f),f)).finally(()=>fd.delete(a));return fd.set(a,d),d}const we="";async function Ze(a){const l=await a.text();try{const i=JSON.parse(l),u=i.error??i.message;if(typeof u=="string"&&u.trim())return u.replace(/^Error:\s*/i,"")}catch{}return l}async function B2(){const a=await fetch(`${we}/api/intake/linear`);if(!a.ok)throw new Error(await a.text());const l=await a.json();return{candidates:l.candidates??[],hasMore:!!l.hasMore}}async function q2(a){const l=await fetch(`${we}/api/intake/linear/lookup?q=${encodeURIComponent(a)}`),i=await l.json().catch(()=>({}));if(!l.ok)throw new Error(i.error??`Lookup failed (${l.status})`);if(!i.candidate)throw new Error("Linear issue not found");return i.candidate}async function H2(){const a=await fetch(`${we}/api/intake/linear/config`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function $2(a){const l=await fetch(`${we}/api/intake/linear/config`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function Y2(){const a=await fetch(`${we}/api/intake/linear/metadata`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function V2(){const a=await fetch(`${we}/api/settings/repository-mappings`);if(!a.ok)throw new Error(await Ze(a));return(await a.json()).mappings??[]}async function Z2(a){const l=await fetch(`${we}/api/settings/repository-mappings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mappings:a})});if(!l.ok)throw new Error(await Ze(l));return(await l.json()).mappings??[]}async function G2(){const a=await fetch(`${we}/api/agents`);if(!a.ok)throw new Error("Failed to fetch agents");return a.json()}async function Q2(a){const l=await fetch(`${we}/api/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new Error(await l.text());return l.json()}async function X2(a,l){const i=await fetch(`${we}/api/agents/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok)throw new Error(await i.text());return i.json()}async function I2(a){const l=await fetch(`${we}/api/agents/${a}`,{method:"DELETE"});if(!l.ok)throw new Error(await l.text())}async function K2(a,l){return z2(a,async()=>{const u=await fetch(`${we}/api/runtimes/${a}/models`);if(!u.ok)throw new Error(await u.text());return u.json()})}async function iv(){const a=await fetch(`${we}/api/runtime-capacity`);if(!a.ok)throw new Error(await a.text());return a.json()}async function rv(){const a=await fetch(`${we}/api/agent-deck/status`);if(!a.ok)throw new Error(await a.text());return a.json()}async function J2(){const a=await fetch(`${we}/api/host-power`);if(!a.ok)throw new Error(await a.text());return a.json()}async function F2(){try{const a=await fetch(`${we}/api/agent-deck/decks`),l=await a.json().catch(()=>null);return a.ok?{ok:!0,decks:(l==null?void 0:l.data)??[]}:{ok:!1,code:l==null?void 0:l.code,message:(l==null?void 0:l.error)??`Agent Deck error (${a.status})`}}catch(a){return{ok:!1,message:a instanceof Error?a.message:String(a)}}}async function Ox(a){const l=new URLSearchParams,i=a.map(f=>f.trim()).filter(Boolean);i.length>0&&l.set("status",i.join(",")),l.set("page","1"),l.set("limit","1"),l.sort();const u=await fetch(`${we}/api/issues?${l.toString()}`);if(!u.ok)throw new Error(await Ze(u));const d=await u.json();return typeof d.total=="number"?d.total:0}async function W2(a){var u,d,f;const l=new URLSearchParams;(u=a.q)!=null&&u.trim()&&l.set("q",a.q.trim()),(d=a.status)!=null&&d.trim()&&l.set("status",a.status.trim()),(f=a.repo)!=null&&f.trim()&&l.set("repo",a.repo.trim()),a.needsAttention&&l.set("needsAttention","1"),l.set("page",String(a.page&&a.page>1?Math.floor(a.page):1)),l.set("direction",a.direction??"desc"),l.sort();const i=await fetch(`${we}/api/issues?${l.toString()}`);if(!i.ok)throw new Error(await Ze(i));return i.json()}async function P2(){const a=await fetch(`${we}/api/issues/recent-repos`);if(!a.ok)throw new Error(await Ze(a));return(await a.json()).repos??[]}async function uv(a){const l=await fetch(`${we}/api/issues/${a}`);if(!l.ok)throw new Error(await Ze(l));return l.json()}async function eS(a){const l=await fetch(`${we}/api/issues/${a}/execution-analysis`);if(!l.ok)throw new Error(await Ze(l));return l.json()}async function tS(a){const l=await fetch(`${we}/api/issues/${a}/evidence`);if(!l.ok)throw new Error(await Ze(l));return l.json()}async function aS(a,l){const i=await fetch(`${we}/api/issues/${a}/artifacts/${l}/trace`);if(!i.ok)throw new Error(await Ze(i));return i.json()}async function nS(a){const l=await fetch(`${we}/api/issues`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function mu(a,l){const i=await fetch(`${we}/api/issues/${a}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(l)});if(!i.ok)throw new Error(await Ze(i));return i.json()}async function lS(a){const l=await fetch(`${we}/api/issues/${a}/reload-source`,{method:"POST"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function ov(a){const l=await fetch(`${we}/api/issues/${a}/start`,{method:"POST"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function cv(a){const l=await fetch(`${we}/api/issues/${a}/execute`,{method:"POST"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function sS(a,l="web"){const i=await fetch(`${we}/api/issues/${a}/abort`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({resolvedBy:l})});if(!i.ok)throw new Error(await Ze(i));return i.json()}async function iS(a){const l=await fetch(`${we}/api/issues/${a}/park`,{method:"POST"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function rS(a,l="web"){const i=await fetch(`${we}/api/issues/${a}/close`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({closedBy:l})});if(!i.ok)throw new Error(await Ze(i));return i.json()}async function uS(a){const l=await fetch(`${we}/api/issues/${a}`,{method:"DELETE"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function oS(a){const l=await fetch(`${we}/api/queue`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({issueId:a})});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function dv(a){const l=await fetch(`${we}/api/queue/${a}`,{method:"DELETE"});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function su(a,l){const i=await fetch(`${we}/api/queue/${a}/move`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({to:l})});if(!i.ok)throw new Error(await Ze(i));return i.json()}async function hd(){const a=await fetch(`${we}/api/queue`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function cS(){const a=await fetch(`${we}/api/queue/status`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function dS(a){const l=await fetch(`${we}/api/queue/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({maxActiveIssues:a})});if(!l.ok)throw new Error(await Ze(l));return l.json()}async function fS(a,l){const i=await fetch(`${we}/api/issues/${a}/guidance`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({markdown:l})});if(!i.ok)throw new Error(await Ze(i));return i.json()}async function hS(a){const l=tv(a),i=await fetch(`${we}/api/execution-report${l?`?${l}`:""}`);if(!i.ok)throw new Error(await Ze(i));const u=await i.json(),d=j2.safeParse(u);if(!d.success)throw new Error(`Unexpected report shape: ${d.error.message}`);return d.data}async function mS(){const a=await fetch(`${we}/api/human-actions`);if(!a.ok)throw new Error(await Ze(a));return a.json()}async function fv(a,l,i,u){const d=await fetch(`${we}/api/human-actions/${a}/resolve`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(u!=null&&u.trim()?{resolvedBy:l,choice:i,note:u.trim()}:{resolvedBy:l,choice:i})});if(!d.ok)throw new Error(await Ze(d));return d.json()}function pS(a){return a||$y}function xS({runtime:a,label:l,value:i,onChange:u,defaultModelId:d,disabled:f,compact:m}){const x=qd(a),[y,v]=b.useState((x==null?void 0:x.models)??[]),[w,j]=b.useState((x==null?void 0:x.source)??"fallback"),[D,X]=b.useState(!x);b.useEffect(()=>{const L=qd(a);if(L){v(L.models),j(L.source),X(!1);return}X(!0),K2(a).then(H=>{v(H.models),j(H.source)}).catch(()=>v([])).finally(()=>X(!1))},[a]);const C=b.useMemo(()=>{var L,H;if(a==="cursor_local"){const F=pS(d);return((L=y.find(P=>P.id===F))==null?void 0:L.label)??"Auto (subscription pool)"}return d?((H=y.find(F=>F.id===d))==null?void 0:H.label)??d:"runtime default"},[a,d,y]),$=a==="cursor_local"?D?"Loading models…":`Agent default (${C})`:D?"Loading models…":`Default (${C})`;return r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:l}),r.jsxs("select",{className:"field text-sm",disabled:f||D,value:i,onChange:L=>u(L.target.value),children:[r.jsx("option",{value:"",children:$}),y.map(L=>r.jsx("option",{value:L.id,children:L.label},L.id))]}),a==="cursor_local"&&!D&&!m&&r.jsx("p",{className:"text-xs text-white/40",children:"Auto and Composer use your Cursor subscription pool. Other models draw API credits."}),w==="fallback"&&y.length>0&&!D&&a==="cursor_local"&&!m&&r.jsx("p",{className:"text-xs text-white/40",children:"Run cursor-agent login to load the full model list."})]})}function Lx(a){const l={};return a.allowWorktreeWrite||(l.worktreeWrite=!1),Object.keys(l).length?l:null}function yS(a){let l={};try{a!=null&&a.trim()&&(l=JSON.parse(a))}catch{l={}}return{allowWorktreeWrite:l.worktreeWrite!==!1}}function Mx({value:a,onChange:l,agentDeckOnline:i,disabled:u}){const[d,f]=b.useState([]),[m,x]=b.useState(null);b.useEffect(()=>{F2().then(w=>{w.ok?(f(w.decks),x(null)):(f([]),x(w.message))})},[]);const y=w=>l({...a,...w}),v=a.runtime==="codex_local"||a.runtime==="claude_code";return r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"font-ui-display text-base uppercase tracking-wide text-[#92E4DD]",children:"Agent"}),r.jsx("label",{className:"text-xs text-[#A8C4C0] uppercase",children:"Runtime (required)"}),r.jsxs("select",{className:"field",disabled:u,value:a.runtime,onChange:w=>{const j=w.target.value;y({runtime:j,defaultModel:j==="cursor_local"?$y:j==="muse_code"?dw:"",defaultEffort:j==="cursor_local"||j==="muse_code"?"":a.defaultEffort})},children:[r.jsx("option",{value:"claude_code",children:"Claude Code (claude -p)"}),r.jsx("option",{value:"cursor_local",children:"Cursor local (cursor-agent -p)"}),r.jsx("option",{value:"codex_local",children:"Codex local (codex exec)"}),r.jsx("option",{value:"muse_code",children:"Muse Code (muse exec) — developer only, trial"})]}),r.jsx("label",{className:"text-xs text-[#A8C4C0] uppercase",children:"Agent Deck (required)"}),r.jsxs("select",{className:"field",disabled:u||!i||!!m,value:a.deckId,onChange:w=>y({deckId:w.target.value}),required:!0,children:[r.jsx("option",{value:"",disabled:!!a.deckId,children:i?m?"Agent Deck error — see below":"Select a deck…":"Agent Deck offline"}),d.map(w=>r.jsxs("option",{value:w.id,children:["◆ ",w.name]},w.id))]}),i&&m&&r.jsx("p",{className:"text-xs text-amber-300/90",children:m}),r.jsxs("div",{className:"pt-2 mt-2 border-t border-white/10 space-y-2",children:[r.jsx("div",{className:"font-ui-display text-xs uppercase tracking-wide text-white/40",children:"Issue-centric session defaults"}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Purpose (optional)"}),r.jsx("input",{className:"field text-sm",placeholder:"e.g. backend refactors on the payments service",disabled:u,value:a.purpose,onChange:w=>y({purpose:w.target.value})})]}),r.jsxs("div",{className:`grid gap-2 ${v?"grid-cols-2":"grid-cols-1"}`,children:[r.jsx(xS,{runtime:a.runtime,label:"Default model",value:a.defaultModel,onChange:w=>y({defaultModel:w}),disabled:u,compact:!0}),v&&r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Reasoning effort"}),r.jsxs("select",{className:"field text-sm",disabled:u,value:a.defaultEffort,onChange:w=>y({defaultEffort:w.target.value}),children:[r.jsx("option",{value:"",children:"Runtime default"}),r.jsx("option",{value:"low",children:"Low"}),r.jsx("option",{value:"medium",children:"Medium"}),r.jsx("option",{value:"high",children:"High"})]})]})]}),a.runtime==="muse_code"&&r.jsx("p",{className:"text-xs text-white/40",children:"Developer role only — keep a Claude or Codex agent as the reviewer. The developer session receives the selected deck above. Contributor-tier content may be used for product improvement; use it on non-sensitive tickets."}),a.runtime==="cursor_local"&&r.jsx("p",{className:"text-xs text-white/40",children:"Cursor has no separate effort flag — put effort in the model id if needed (e.g. parameterized `[effort=high]`)."}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Max turns"}),r.jsx("input",{className:"field text-sm",type:"number",min:1,placeholder:"none",disabled:u,value:a.defaultBudget.maxTurns,onChange:w=>y({defaultBudget:{...a.defaultBudget,maxTurns:w.target.value}})})]}),r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Max $ / session"}),r.jsx("input",{className:"field text-sm",type:"number",min:0,step:"0.1",placeholder:"none",disabled:u,value:a.defaultBudget.maxBudgetUsd,onChange:w=>y({defaultBudget:{...a.defaultBudget,maxBudgetUsd:w.target.value}})})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Developer capabilities"}),r.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm text-white/70",children:r.jsxs("label",{className:"flex items-center gap-1.5",children:[r.jsx("input",{type:"checkbox",disabled:u,checked:a.allowWorktreeWrite,onChange:w=>y({allowWorktreeWrite:w.target.checked})}),"Write files"]})}),r.jsx("p",{className:"text-xs text-white/40",children:"Unchecking runs the developer read-only (no Write/Edit/Bash grant), same as a reviewer. There is no separate push / open-PR toggle — a session with file-write access can already push and open PRs, and no mechanism here can restrict just that without also removing write access."})]})]})]})}function ka(a){return a==="claude_code"?"Claude":a==="cursor_local"?"Cursor":a==="codex_local"?"Codex":a==="muse_code"?"Muse Code":"No agent"}function vS(){return{maxTurns:"",maxBudgetUsd:""}}function Dx(a){const l=a.maxTurns.trim()?Number(a.maxTurns):null,i=a.maxBudgetUsd.trim()?Number(a.maxBudgetUsd):null;return l==null&&i==null||l!=null&&(!Number.isFinite(l)||l<=0)||i!=null&&(!Number.isFinite(i)||i<=0)?null:{maxTurns:l,maxBudgetUsd:i}}function gS(a){const l=hu(a);return{maxTurns:(l==null?void 0:l.maxTurns)!=null?String(l.maxTurns):"",maxBudgetUsd:(l==null?void 0:l.maxBudgetUsd)!=null?String(l.maxBudgetUsd):""}}function Oi({children:a,className:l="",title:i}){return r.jsx("span",{title:i,className:`inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium uppercase tracking-wide border ${l}`,children:a})}function iu(a,l){const i=a.find(d=>d.runtime===l);if(!i)return{ok:!1,detail:"no agent"};const u=i.issues.find(d=>d.code==="cli_missing"||d.code==="runtime_auth"||d.code==="runtime_unknown"||d.code==="runtime_capability"||d.code==="cursor_keychain");return u?{ok:!1,detail:u.message}:{ok:!0,detail:"CLI ready"}}function bS(a){const l=a.flatMap(i=>i.issues).find(i=>i.code==="github_cli_missing"||i.code==="github_auth"||i.code==="github_unreachable");return l?{ok:!1,detail:l.message}:a.length===0?{ok:!1,detail:"no agent"}:{ok:!0,detail:"gh ready"}}function Cs({ok:a}){return r.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${a?"bg-emerald-400":"bg-amber-400"}`,"aria-hidden":!0})}function wS({agents:a,agentDeckOnline:l}){const[i,u]=b.useState(null);b.useEffect(()=>{rv().then(w=>u(w.mcpUrl)).catch(()=>u(null))},[l]);const d=iu(a,"claude_code"),f=iu(a,"cursor_local"),m=iu(a,"codex_local"),x=a.some(w=>w.runtime==="muse_code")?iu(a,"muse_code"):null,y=bS(a),v=a.flatMap(w=>w.issues).find(w=>w.code==="mcp_not_registered");return r.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-1.5 text-xs text-white/45",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Connections"}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:d.detail,children:[r.jsx(Cs,{ok:d.ok}),r.jsx("span",{className:d.ok?"text-white/55":"text-amber-200/90",children:"Claude"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:f.detail,children:[r.jsx(Cs,{ok:f.ok}),r.jsx("span",{className:f.ok?"text-white/55":"text-amber-200/90",children:"Cursor"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:m.detail,children:[r.jsx(Cs,{ok:m.ok}),r.jsx("span",{className:m.ok?"text-white/55":"text-amber-200/90",children:"Codex"})]}),x&&r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:x.detail,children:[r.jsx(Cs,{ok:x.ok}),r.jsx("span",{className:x.ok?"text-white/55":"text-amber-200/90",children:"Muse Code"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:y.detail,children:[r.jsx(Cs,{ok:y.ok}),r.jsx("span",{className:y.ok?"text-white/55":"text-amber-200/90",children:"GitHub"})]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",title:(v==null?void 0:v.message)??(i?`MCP ${i}`:"Agent Deck optional"),children:[r.jsx(Cs,{ok:l&&!v}),r.jsxs("span",{className:l&&!v?"text-[#92E4DD]/80":v?"text-amber-200/90":"text-white/35",children:["Agent Deck MCP",l?v?" (setup needed)":"":" (optional)"]})]})]})}function hv(a){return a<10?"critical":a<30?"warning":"normal"}function mv(a){const l=a.unavailableDetail;if(!l)return null;const i=l.consecutiveFailures,u=new Date(l.firstFailureAt).toLocaleString();return`unavailable: ${l.message} (${i} consecutive failed refresh${i===1?"":"es"} since ${u})`}const rf={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},SS={critical:"font-bold text-red-400",warning:"text-yellow-400",normal:"font-medium"},jS=new Set(["claude_code","codex_local","muse_code"]),NS="billing_cycle",_S="1M",kS="5H",AS="1W";function Ux(a,l,i,u){if(a!==null)return pv(a,l,null);const d=i??"missing";return{key:u,label:l,kind:"unknown",reason:d,title:`${l}: N/A (${rf[d]})`}}function pv(a,l,i){if(a.unavailableReason===null&&a.remainingPercent!==null){const d=a.remainingPercent,f=a.resetAt?`, resets ${new Date(a.resetAt).toLocaleString()}`:"",m=i?`, ${i}`:"";return{key:a.windowKey,label:l,kind:"known",remaining:Math.round(d),rawRemaining:d,title:`${l}: ${Math.round(d)}% remaining${m}${f}`}}const u=a.unavailableReason??"missing";return{key:a.windowKey,label:l,kind:"unknown",reason:u,title:`${l}: N/A (${mv(a)??rf[u]})`}}function ES(a){if(a.runtime==="cursor_local"){const l=a.windows.find(i=>i.windowKey===NS)??null;return l===null?[]:[pv(l,_S,"current billing cycle")]}if(jS.has(a.runtime)){const l=a.windows.find(u=>u.criticalRole==="five_hour")??null,i=a.windows.find(u=>u.criticalRole==="weekly")??null;return[Ux(l,kS,a.unavailableReason,"missing-5H"),Ux(i,AS,a.unavailableReason,"missing-1W")]}return[]}function CS({row:a}){const l=a.kind==="known";return r.jsxs("span",{"data-testid":`capacity-window-${a.key}`,"data-reason":a.kind==="unknown"?a.reason:void 0,title:a.title,className:`inline-flex items-center gap-1 rounded border px-1.5 py-0.5 whitespace-nowrap ${l?"border-white/15 bg-white/5 text-white/70":"border-white/10 bg-transparent text-white/35"}`,children:[r.jsx("span",{className:"text-white/40",children:a.label}),a.kind==="known"?(()=>{const i=hv(a.rawRemaining);return r.jsxs("span",{"data-severity":i,className:SS[i],children:[a.remaining,"%"]})})():r.jsx("span",{children:"N/A"})]})}function RS({data:a}){return a.runtimes.length===0?null:r.jsxs("div",{"data-testid":"runtime-capacity-strip",className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Runtime capacity"}),a.runtimes.map(l=>{const i=ES(l);return r.jsxs("span",{"data-testid":`capacity-entry-${l.runtime}`,className:"inline-flex min-w-0 flex-wrap items-center gap-1.5",children:[r.jsx("span",{className:"shrink-0 whitespace-nowrap font-medium text-white/55",children:ka(l.runtime)}),i.length===0?r.jsx("span",{"data-testid":`capacity-entry-${l.runtime}-na`,"data-reason":l.unavailableReason??"missing",title:`N/A (${rf[l.unavailableReason??"missing"]})`,className:"whitespace-nowrap text-white/35",children:"N/A"}):i.map(u=>r.jsx(CS,{row:u},u.key))]},l.runtime)})]})}function TS({refreshTick:a}){const[l,i]=b.useState(null);return b.useEffect(()=>{let u=!1;return iv().then(d=>{u||i(d)}).catch(()=>{u||i(null)}),()=>{u=!0}},[a]),l?r.jsx(RS,{data:l}):null}const OS="agent-dealer:host-power-sleep-notice-dismissed:";function xv(a){return`${OS}${a}`}function zx(a){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(xv(a))==="1"}catch{return!1}}function LS(a){if(!(typeof localStorage>"u"))try{localStorage.setItem(xv(a),"1")}catch{}}function MS({status:a}){const[l,i]=b.useState(()=>zx(a.serverInstanceId));b.useEffect(()=>{i(zx(a.serverInstanceId))},[a.serverInstanceId]);const u=a.sleepTimerNotice,d=!!u&&!l,f=()=>{LS(a.serverInstanceId),i(!0)};return r.jsxs("div",{className:"space-y-2","data-testid":"host-power-status",children:[r.jsx("p",{className:"text-xs text-white/45 font-mono","data-testid":"host-power-hold-line",children:a.holdStatusLine}),d&&u&&r.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2 rounded border border-amber-400/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/90","data-testid":"host-power-sleep-notice",role:"status",children:[r.jsx("p",{className:"min-w-0 flex-1 leading-relaxed font-mono",children:u.message}),r.jsx("button",{type:"button",onClick:f,className:"shrink-0 text-amber-100/70 hover:text-amber-50 underline-offset-2 hover:underline","data-testid":"host-power-sleep-notice-dismiss",children:"Dismiss"})]})]})}function DS({status:a,pollMs:l=5e3}){const[i,u]=b.useState(a??null);return b.useEffect(()=>{if(a!==void 0){u(a);return}let d=!1;const f=()=>{J2().then(x=>{d||u(x)}).catch(()=>{d||u(null)})};f();const m=setInterval(f,l);return()=>{d=!0,clearInterval(m)}},[a,l]),i?r.jsx(MS,{status:i}):null}const US="data:image/svg+xml,%3csvg%20viewBox='0%200%20248%20248'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20aria-hidden='true'%3e%3cpath%20d='M52.4285%20162.873L98.7844%20136.879L99.5485%20134.602L98.7844%20133.334H96.4921L88.7237%20132.862L62.2346%20132.153L39.3113%20131.207L17.0249%20130.026L11.4214%20128.844L6.2%20121.873L6.7094%20118.447L11.4214%20115.257L18.171%20115.847L33.0711%20116.911L55.485%20118.447L71.6586%20119.392L95.728%20121.873H99.5485L100.058%20120.337L98.7844%20119.392L97.7656%20118.447L74.5877%20102.732L49.4995%2086.1905L36.3823%2076.62L29.3779%2071.7757L25.8121%2067.2858L24.2839%2057.3608L30.6515%2050.2716L39.3113%2050.8623L41.4763%2051.4531L50.2636%2058.1879L68.9842%2072.7209L93.4357%2090.6804L97.0015%2093.6343L98.4374%2092.6652L98.6571%2091.9801L97.0015%2089.2625L83.757%2065.2772L69.621%2040.8192L63.2534%2030.6579L61.5978%2024.632C60.9565%2022.1032%2060.579%2020.0111%2060.579%2017.4246L67.8381%207.49965L71.9133%206.19995L81.7193%207.49965L85.7946%2011.0443L91.9074%2024.9865L101.714%2046.8451L116.996%2076.62L121.453%2085.4816L123.873%2093.6343L124.764%2096.1155H126.292V94.6976L127.566%2077.9197L129.858%2057.3608L132.15%2030.8942L132.915%2023.4505L136.608%2014.4708L143.994%209.62643L149.725%2012.344L154.437%2019.0788L153.8%2023.4505L150.998%2041.6463L145.522%2070.1215L141.957%2089.2625H143.994L146.414%2086.7813L156.093%2074.0206L172.266%2053.698L179.398%2045.6635L187.803%2036.802L193.152%2032.5484H203.34L210.726%2043.6549L207.415%2055.1159L196.972%2068.3492L188.312%2079.5739L175.896%2096.2095L168.191%20109.585L168.882%20110.689L170.738%20110.53L198.755%20104.504L213.91%20101.787L231.994%2098.7149L240.144%20102.496L241.036%20106.395L237.852%20114.311L218.495%20119.037L195.826%20123.645L162.07%20131.592L161.696%20131.893L162.137%20132.547L177.36%20133.925L183.855%20134.279H199.774L229.447%20136.524L237.215%20141.605L241.8%20147.867L241.036%20152.711L229.065%20158.737L213.019%20154.956L175.45%20145.977L162.587%20142.787H160.805V143.85L171.502%20154.366L191.242%20172.089L215.82%20195.011L217.094%20200.682L213.91%20205.172L210.599%20204.699L188.949%20188.394L180.544%20181.069L161.696%20165.118H160.422V166.772L164.752%20173.152L187.803%20207.771L188.949%20218.405L187.294%20221.832L181.308%20223.959L174.813%20222.777L161.187%20203.754L147.305%20182.486L136.098%20163.345L134.745%20164.2L128.075%20235.42L125.019%20239.082L117.887%20241.8L111.902%20237.31L108.718%20229.984L111.902%20215.452L115.722%20196.547L118.779%20181.541L121.58%20162.873L123.291%20156.636L123.14%20156.219L121.773%20156.449L107.699%20175.752L86.304%20204.699L69.3663%20222.777L65.291%20224.431L58.2867%20220.768L58.9235%20214.27L62.8713%20208.48L86.304%20178.705L100.44%20160.155L109.551%20149.507L109.462%20147.967L108.959%20147.924L46.6977%20188.512L35.6182%20189.93L30.7788%20185.44L31.4156%20178.115L33.7079%20175.752L52.4285%20162.873Z'%20fill='%23D97757'/%3e%3c/svg%3e",zS="/assets/codex-YZSpL-SB.png",BS="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20aria-hidden='true'%3e%3cpath%20fill='%23EDEDED'%20d='M11.503.131%201.891%205.678a.84.84%200%200%200-.42.726v11.188c0%20.3.162.575.42.724l9.609%205.55a1%201%200%200%200%20.998%200l9.61-5.55a.84.84%200%200%200%20.42-.724V6.404a.84.84%200%200%200-.42-.726L12.497.131a1.01%201.01%200%200%200-.996%200M2.657%206.338h18.55c.263%200%20.43.287.297.515L12.23%2022.918c-.062.107-.229.064-.229-.06V12.335a.59.59%200%200%200-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23'/%3e%3c/svg%3e",qS="/assets/muse-CtdcC6ve.svg";function Yu({src:a,className:l}){return r.jsx("span",{className:`inline-flex items-center justify-center rounded-lg bg-white/[0.04] ${l??"h-8 w-8"}`,children:r.jsx("img",{src:a,alt:"",className:"h-[70%] w-[70%] object-contain",draggable:!1})})}function HS({className:a="h-8 w-8"}){return r.jsx(Yu,{src:US,className:a})}function $S({className:a="h-8 w-8"}){return r.jsx(Yu,{src:BS,className:a})}function YS({className:a="h-8 w-8"}){return r.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:a,"aria-hidden":!0,children:[r.jsx("rect",{width:"32",height:"32",rx:"8",fill:"white",fillOpacity:"0.06"}),r.jsx("circle",{cx:"16",cy:"13",r:"4.5",stroke:"#92E4DD",strokeWidth:"1.75"}),r.jsx("path",{d:"M8.5 24.5c1.2-3.5 3.8-5.5 7.5-5.5s6.3 2 7.5 5.5",stroke:"#92E4DD",strokeWidth:"1.75",strokeLinecap:"round"})]})}function VS({className:a="h-8 w-8"}){return r.jsx(Yu,{src:zS,className:a})}function ZS({className:a="h-8 w-8"}){return r.jsx(Yu,{src:qS,className:a})}function yv({runtime:a,className:l="h-8 w-8 shrink-0"}){return a==="claude_code"?r.jsx(HS,{className:l}):a==="cursor_local"?r.jsx($S,{className:l}):a==="codex_local"?r.jsx(VS,{className:l}):a==="muse_code"?r.jsx(ZS,{className:l}):r.jsx(YS,{className:l})}const ru=()=>({runtime:"claude_code",deckId:"",purpose:"",defaultModel:"",defaultEffort:"",defaultBudget:vS(),allowWorktreeWrite:!0});function GS({agents:a,agentDeckOnline:l,onRefresh:i}){const[u,d]=b.useState(!1),[f,m]=b.useState(""),[x,y]=b.useState(ru()),[v,w]=b.useState(!1),[j,D]=b.useState(null),[X,C]=b.useState(""),[$,L]=b.useState(ru()),H=async I=>{if(I.preventDefault(),!(!f.trim()||!x.deckId)){w(!0);try{const ye={name:f.trim(),runtime:x.runtime,deckId:x.deckId,defaultModel:x.defaultModel.trim()||null,defaultEffort:x.defaultEffort||null,defaultBudget:Dx(x.defaultBudget),purpose:x.purpose.trim()||null,permissionPolicy:Lx(x)};await Q2(ye),m(""),y(ru()),d(!1),i()}catch(ye){alert(String(ye))}finally{w(!1)}}},F=I=>{D(I.id),C(I.name),L({runtime:I.runtime,deckId:I.deckId??"",purpose:I.purpose??"",defaultModel:Ex(I)??"",defaultEffort:I.defaultEffort??"",defaultBudget:gS(mw(I)),...yS(I.permissionPolicyJson)})},P=()=>{D(null),L(ru())},ne=async I=>{if(!(!X.trim()||!$.deckId)){w(!0);try{const ye={name:X.trim(),runtime:$.runtime,deckId:$.deckId,defaultModel:$.defaultModel.trim()||null,defaultEffort:$.defaultEffort||null,defaultBudget:Dx($.defaultBudget),purpose:$.purpose.trim()||null,permissionPolicy:Lx($)};await X2(I.id,ye),P(),i()}catch(ye){alert(String(ye))}finally{w(!1)}}},V=async I=>{if(confirm(`Delete agent "${I.name}"?`)){w(!0);try{await I2(I.id),i()}catch(ye){alert(String(ye))}finally{w(!1)}}},_e=a.filter(I=>!I.healthy).length;return r.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 max-w-6xl mx-auto w-full",children:[r.jsxs("div",{className:"mb-6 flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h1",{className:"heading-page",children:"Agents"}),r.jsx("p",{className:"text-sm text-white/50 mt-1",children:"Saved execution profiles — pick one when creating an issue instead of configuring each task"}),r.jsxs("p",{className:"text-sm text-white/45 mt-2",children:[a.length," agent",a.length===1?"":"s",_e>0&&r.jsxs("span",{className:"text-red-400 ml-2",children:["· ",_e," need",_e===1?"s":""," attention"]})]})]}),r.jsx(wS,{agents:a,agentDeckOnline:l})]}),r.jsxs("div",{className:"mb-4 overflow-x-auto space-y-2",children:[r.jsx(TS,{}),r.jsx(DS,{})]}),r.jsx("div",{className:"space-y-3 mb-6",children:a.map(I=>{const ye=Ex(I);return r.jsxs("div",{className:"panel flex flex-col sm:flex-row sm:items-start gap-3 justify-between",children:[r.jsxs("div",{className:"flex gap-3 min-w-0 flex-1",children:[r.jsx(yv,{runtime:I.runtime}),r.jsxs("div",{className:"space-y-2 min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-lg font-semibold text-[#E8F6F4]",children:I.name}),!I.healthy&&r.jsx(Oi,{className:"bg-red-500/15 text-red-300 border-red-400/30 normal-case",children:"Needs fix"})]}),r.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r.jsx(Oi,{className:"bg-white/5 text-white/55 border-white/15 normal-case",children:ka(I.runtime)}),I.deckName?r.jsxs(Oi,{className:"bg-[#92E4DD]/10 text-[#92E4DD] border-[#92E4DD]/25 normal-case",children:["◆ ",I.deckName]}):r.jsx(Oi,{className:"bg-white/5 text-white/40 border-white/10 normal-case",children:"No deck"}),ye&&r.jsx(Oi,{className:"bg-white/5 text-white/50 border-white/10 normal-case truncate max-w-[10rem]",title:ye,children:ye})]}),j===I.id&&r.jsxs("div",{className:"space-y-3 pt-2 border-t border-white/10",children:[r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Name"}),r.jsx("input",{className:"field text-sm",value:X,onChange:Ue=>C(Ue.target.value)})]}),r.jsx(Mx,{value:$,onChange:L,agentDeckOnline:l}),r.jsxs("div",{className:"flex gap-2 pt-1",children:[r.jsx("button",{type:"button",disabled:v||!X.trim()||!$.deckId,onClick:()=>ne(I),className:"btn-gold text-sm px-3 py-1.5",children:"Save"}),r.jsx("button",{type:"button",onClick:P,className:"btn-ghost text-sm px-3 py-1.5",children:"Cancel"})]})]}),I.issues.length>0&&r.jsx("ul",{className:"text-sm text-red-300/90 space-y-1",children:I.issues.map((Ue,gt)=>r.jsxs("li",{children:["· ",Ue.message]},gt))})]})]}),r.jsxs("div",{className:"flex gap-2 shrink-0",children:[j!==I.id&&r.jsx("button",{type:"button",disabled:v,onClick:()=>F(I),className:"btn-ghost text-sm px-3 py-1.5",children:"Edit"}),r.jsx("button",{type:"button",disabled:v,onClick:()=>V(I),className:"btn-ghost text-sm px-3 py-1.5",children:"Delete"})]})]},I.id)})}),u?r.jsxs("form",{onSubmit:H,className:"panel space-y-3",children:[r.jsx("h2",{className:"heading-panel",children:"New Agent"}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-[#A8C4C0] uppercase",children:"Name"}),r.jsx("input",{className:"field",placeholder:"e.g. Claude · Work",value:f,onChange:I=>m(I.target.value)})]}),r.jsx(Mx,{value:x,onChange:y,agentDeckOnline:l}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"submit",disabled:v||!f.trim()||!x.deckId,className:"btn-gold px-4 py-2",children:v?"Saving…":"Create agent"}),r.jsx("button",{type:"button",onClick:()=>d(!1),className:"btn-ghost px-4 py-2",children:"Cancel"})]})]}):r.jsx("button",{type:"button",onClick:()=>d(!0),className:"btn-gold px-4 py-2",children:"Add agent"})]})}function QS(a){try{return tf(a).identity}catch{return null}}function XS(a,l){return a!=="linear"||!l?null:l.repoResolution??zy(l.labels)}function IS(a,l){if(!l)return a;const i=l.repoResolution??zy(l.labels);return i.status==="resolved"&&i.repository?i.repository:a}function KS(a,l){var u;const i=XS(a,l);if(!i)return null;if(i.status==="conflict")return`Conflicting repo: labels (${(i.labels??[]).join(", ")}) — kept the current repository. Fix the labels in Linear or type a repository below.`;if(i.status==="invalid"){const d=((u=i.labels)==null?void 0:u[0])??"repo:",f=i.error?` — ${i.error}`:"";return`Invalid repository label ${d}${f}. Kept the current repository — fix the label in Linear or type a repository below.`}return null}function Bx(a){return a.title.trim().length>0&&QS(a.repo)!=null&&a.developerAgentId.length>0&&a.reviewerAgentId.length>0}function JS(a,l,i){const u=i?a.find(d=>d.id===i):void 0;return u&&!l.some(d=>d.id===u.id)?[u,...l]:[...l]}function FS(a,l){return{candidates:[l,...a.filter(i=>i.id!==l.id)],selectedId:l.id}}const md=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"],WS={q:"",status:"",repo:"",needsAttention:!1},vv=["latest"],uf="latest",of="desc";function Gi(a){return a.startsWith("?")?a.slice(1):a}function qx(a){var i,u,d;const l=new URLSearchParams(Gi(a));return{q:((i=l.get("q"))==null?void 0:i.trim())??"",status:((u=l.get("status"))==null?void 0:u.trim())??"",repo:((d=l.get("repo"))==null?void 0:d.trim())??"",needsAttention:l.get("needsAttention")==="1"||l.get("needsAttention")==="true"}}function Vu(a){const l=new URLSearchParams(Gi(a)),i=w=>{var D;const j=(D=l.get(w))==null?void 0:D.trim();return j||void 0},u={},d=i("q");d!==void 0&&(u.q=d);const f=i("status");f!==void 0&&(u.status=f);const m=i("repo");m!==void 0&&(u.repo=m),(l.get("needsAttention")==="1"||l.get("needsAttention")==="true")&&(u.needsAttention=!0);const x=Number(l.get("page"));Number.isInteger(x)&&x>=1&&(u.page=x);const y=i("sort");y!==void 0&&vv.includes(y)&&(u.sort=y);const v=i("direction");return(v==="asc"||v==="desc")&&(u.direction=v),u}function PS(a){return Vu(a).sort??uf}function gv(a){return Vu(a).direction??of}function ej(a){var i,u,d;const l=new URLSearchParams;return(i=a.q)!=null&&i.trim()&&l.set("q",a.q.trim()),(u=a.status)!=null&&u.trim()&&l.set("status",a.status.trim()),(d=a.repo)!=null&&d.trim()&&l.set("repo",a.repo.trim()),a.needsAttention&&l.set("needsAttention","1"),a.page!==void 0&&Number.isInteger(a.page)&&a.page>1&&l.set("page",String(a.page)),a.sort!==void 0&&a.sort!==uf&&l.set("sort",a.sort),a.direction!==void 0&&a.direction!==of&&l.set("direction",a.direction),l.sort(),l.toString()}function tj(a){const l={};return a.q.trim()&&(l.q=a.q.trim()),a.status.trim()&&(l.status=a.status.trim()),a.repo.trim()&&(l.repo=a.repo.trim()),a.needsAttention&&(l.needsAttention=!0),l}function aj(a,l){const i=new URLSearchParams(Gi(a));return l<=1?i.delete("page"):i.set("page",String(Math.floor(l))),i.sort(),i.toString()}function nj(a,l){const i=Vu(a),u=tj(l);return i.sort!==void 0&&(u.sort=i.sort),i.direction!==void 0&&(u.direction=i.direction),ej(u)}function lj(a,l){const i=new URLSearchParams(Gi(a));return l===uf?i.delete("sort"):i.set("sort",l),i.delete("page"),i.sort(),i.toString()}function sj(a){const l=new URLSearchParams(Gi(a)),i=gv(a)==="asc"?"desc":"asc";return i===of?l.delete("direction"):l.set("direction",i),l.delete("page"),l.sort(),l.toString()}function Hx(a){if(a.total===0)return"No issues match these filters";const l=(a.page-1)*a.limit+1,i=Math.min(a.total,a.page*a.limit);return`Showing ${l}–${i} of ${a.total} issues`}function $x(a){return a.totalPages<=1?"":`Page ${a.page} of ${a.totalPages}`}function Yx(a){return!!(a.q||a.status||a.repo||a.needsAttention)}const ij={ready:"bg-white/10 text-white/70 border-white/20",developing:"bg-cyber-violet/20 text-cyber-violet-light border-cyber-violet/40",reviewing:"bg-cyber-gold/20 text-[#E8DC7A] border-cyber-gold/40",repairing:"bg-cyber-violet/25 text-cyber-violet-light border-cyber-violet/50",final_review:"bg-amber-500/20 text-amber-300 border-amber-400/40",needs_human:"bg-red-500/20 text-red-300 border-red-400/40",done:"bg-cyber-teal/20 text-cyber-teal border-cyber-teal/40",closed:"bg-white/5 text-white/40 border-white/10"},rj={ready:"Ready",developing:"Developing",reviewing:"Reviewing",repairing:"Repairing",final_review:"Final review",needs_human:"Needs human",done:"Done",closed:"Closed"};function bv({status:a}){return r.jsx("span",{className:`text-xs leading-none px-2 py-1 rounded border tabular-nums ${ij[a]}`,children:rj[a]})}function uj(a){return a==="latest"?"Latest":a}function oj({sort:a,direction:l,onSortChange:i,onToggleDirection:u}){const d=l==="asc";return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-white/50",children:["Sort",r.jsx("select",{"aria-label":"Sort issues",className:"bg-black/30 border border-white/10 rounded px-2 py-1 text-xs text-white/80",value:a,onChange:f=>i(f.target.value),children:vv.map(f=>r.jsx("option",{value:f,children:uj(f)},f))})]}),r.jsxs("button",{type:"button",onClick:u,"aria-label":d?"Sort order: oldest first":"Sort order: newest first","aria-pressed":d,title:d?"Show newest first":"Show oldest first",className:"font-ui-display px-2 py-1 text-xs rounded border border-white/15 text-white/70 hover:text-white",children:[r.jsx("span",{"aria-hidden":"true",children:d?"↑":"↓"})," ",d?"Oldest first":"Newest first"]})]})}const wv="agent-dealer:first-issue-dismissed:v1";function cj(a){return a.healthy}function dj(a){return a.healthy&&a.runtime!=="muse_code"}function fj(a){const l=a.some(cj),i=a.some(dj);return l&&i?"new-issue":"agents"}function hj(a){return a.historyTotal===0&&!a.filtersActive&&!a.dismissed}function Sv(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function mj(a=Sv()){try{return(a==null?void 0:a.getItem(wv))==="1"}catch{return!1}}function pj(a=Sv()){try{a==null||a.setItem(wv,"1")}catch{}}function xj({agents:a,onStartIssue:l,onDismiss:i}){const u=fj(a);return r.jsx("section",{"aria-label":"Create your first issue","data-testid":"first-issue-strip",className:"mb-4 rounded border border-[#C4B643]/40 bg-[#C4B643]/5 px-4 py-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-ui-display text-sm font-medium text-white/90",children:"Create your first issue"}),r.jsx("p",{className:"mt-1 text-sm text-white/60",children:"Connect a developer and a reviewer agent, pick a GitHub repository, then create the issue. Capacity status in the header is informational — it never blocks creating an issue."}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[u==="agents"?r.jsx(sa,{to:"/agents","data-testid":"first-issue-primary",className:"btn-gold px-4 py-2 text-sm",children:"Configure agents"}):r.jsx("button",{type:"button","data-testid":"first-issue-primary",className:"btn-gold px-4 py-2 text-sm",onClick:l,children:"New issue"}),u==="agents"&&r.jsx("span",{className:"text-xs text-white/40",children:"then pick a repository and create the issue"})]})]}),r.jsx("button",{type:"button","aria-label":"Dismiss first-issue guide",title:"Dismiss",onClick:i,className:"shrink-0 rounded px-2 py-1 text-sm text-white/40 hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:"✕"})]})})}function jv({value:a,onChange:l,recentRepos:i=[],id:u}){return r.jsxs("div",{className:"space-y-1",children:[i.length>0&&r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:i.includes(a)?a:"",onChange:d=>{d.target.value&&l(d.target.value)},"aria-label":"Recent repositories",children:[r.jsx("option",{value:"",children:"Recent repositories…"}),i.map(d=>r.jsx("option",{value:d,children:d},d))]}),r.jsx("input",{id:u,className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"GitHub URL or owner/repo",value:a,onChange:d=>l(d.target.value)})]})}function yj(){return{label:"",repository:""}}function vj(a){const l=new Set;for(const i of a){const u=i.label.trim();if(!u)return"Labels must not be empty";if(u.length>100)return`Label "${u}" must be 1–100 characters`;const d=u.toLowerCase();if(l.has(d))return`Duplicate label "${u}"`;if(l.add(d),!i.repository.trim())return`Repository for "${u}" must not be empty`}return a.length>100?"At most 100 mappings are allowed":null}function gj({recentRepos:a=[],initialMappings:l,loadMappings:i=V2,saveMappings:u=Z2,onClose:d}){const[f,m]=b.useState(l??[]),[x,y]=b.useState(l!==void 0),[v,w]=b.useState(null),[j,D]=b.useState(null),[X,C]=b.useState(!1);b.useEffect(()=>{if(l!==void 0)return;let H=!0;return i().then(F=>{H&&(m(F),y(!0))}).catch(F=>{H&&(w(String(F)),y(!0))}),()=>{H=!1}},[l,i]);const $=(H,F)=>{m(P=>P.map((ne,V)=>V===H?{...ne,...F}:ne))},L=async()=>{w(null),D(null);const H=vj(f);if(H){w(H);return}C(!0);try{const F=await u(f.map(P=>({label:P.label.trim(),repository:P.repository})));m(F),D(F.length===0?"Mappings cleared":`Saved ${F.length} mapping${F.length===1?"":"s"}`)}catch(F){w(String(F))}finally{C(!1)}};return r.jsxs("div",{className:"rounded border border-white/10 bg-black/20 px-3 py-2 space-y-2","aria-label":"Repository mappings",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{className:"text-xs text-white/60",children:"Repository mappings"}),d&&r.jsx("button",{type:"button",className:"text-xs text-white/50 hover:text-white",onClick:d,children:"Close"})]}),x?f.length===0?r.jsx("p",{className:"text-xs text-white/40",children:"No mappings yet — add one to prefill the Repository field from a Linear label."}):f.map((H,F)=>r.jsxs("div",{className:"flex gap-2 items-start","data-testid":"mapping-row",children:[r.jsx("input",{className:"w-40 shrink-0 bg-black/30 border border-white/10 rounded px-2 py-1.5 text-sm",placeholder:"Linear label","aria-label":`Linear label for mapping ${F+1}`,value:H.label,onChange:P=>$(F,{label:P.target.value})}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(jv,{value:H.repository,onChange:P=>$(F,{repository:P}),recentRepos:a})}),r.jsx("button",{type:"button",className:"shrink-0 text-xs text-white/50 hover:text-white px-1 py-1.5",onClick:()=>m(P=>P.filter((ne,V)=>V!==F)),children:"Remove"})]},F)):r.jsx("p",{className:"text-xs text-white/40",children:"Loading…"}),v&&r.jsx("p",{className:"text-xs text-red-300","data-testid":"mappings-error",children:v}),j&&r.jsx("p",{className:"text-xs text-teal-200/80",children:j}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-white/15 text-white/70 hover:text-white",onClick:()=>m(H=>[...H,yj()]),children:"Add mapping"}),r.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-teal/40 text-teal disabled:opacity-50",disabled:X||!x,onClick:()=>void L(),children:X?"Saving…":"Save changes"})]})]})}const bj=["Backlog","Todo","In Progress","In Review"];function pd(a,l){const i=l?a.filter(f=>f.teamId===l):a,u=new Set,d=[];for(const f of i){const m=f.name.toLowerCase();u.has(m)||(u.add(m),d.push(f.name))}return d}function Vx(a,l){return l.length===0?[...a]:a.filter(i=>l.some(u=>u.toLowerCase()===i.toLowerCase()))}function wj(a,l){return a!==null&&!l}function Sj({initialConfig:a,initialMetadata:l,loadConfig:i=H2,loadMetadata:u=Y2,saveConfig:d=$2,onSaved:f,onClose:m}){var re;const[x,y]=b.useState(a===void 0?null:a),[v,w]=b.useState(l===void 0?null:l),[j,D]=b.useState((a==null?void 0:a.persisted.teamId)??""),[X,C]=b.useState((a==null?void 0:a.persisted.assigneeMe)??!1),[$,L]=b.useState((a==null?void 0:a.persisted.stateFilter)??[...bj]),[H,F]=b.useState(a!==void 0),[P,ne]=b.useState(l!==void 0),[V,_e]=b.useState(a===null?"Could not load saved Linear intake filters":null),[I,ye]=b.useState(l===null?"Could not load Linear teams and statuses":null),[Ue,gt]=b.useState(null),[At,rt]=b.useState(!1),[mt,nt]=b.useState(null);b.useEffect(()=>{if(a!==void 0)return;let z=!0;return i().then(de=>{z&&(y(de),D(de.persisted.teamId??""),C(de.persisted.assigneeMe),L(de.persisted.stateFilter),_e(null),F(!0))}).catch(de=>{z&&(y(null),_e(String(de)),F(!0))}),()=>{z=!1}},[a,i]),b.useEffect(()=>{if(l!==void 0)return;let z=!0;return u().then(de=>{z&&(w(de),ye(null),ne(!0))}).catch(de=>{z&&(w(null),ye(String(de)),ne(!0))}),()=>{z=!1}},[l,u]),b.useEffect(()=>{if(!v)return;const z=pd(v.workflowStates,j||null);L(de=>Vx(de,z))},[v,j]);const Ge=b.useMemo(()=>pd((v==null?void 0:v.workflowStates)??[],j||null),[v,j]),U=Ge.length>0?Ge:$,J=!!(x!=null&&x.envOverrides.teamId),ue=!!(x!=null&&x.envOverrides.stateFilter),Ce=J||ue,De=H&&P,N=wj(x,At),Y=z=>{L(de=>de.some(ze=>ze.toLowerCase()===z.toLowerCase())?de.filter(ze=>ze.toLowerCase()!==z.toLowerCase()):[...de,z])},W=async()=>{if(nt(null),gt(null),!x){nt("Saved filters are unavailable — reload before saving");return}if($.length===0){nt("Select at least one workflow status");return}rt(!0);try{const z=pd((v==null?void 0:v.workflowStates)??[],j.trim()||null),de=Vx($,z);if(de.length===0){nt("Select at least one workflow status"),rt(!1);return}const Qe=await d({stateFilter:de,teamId:j.trim()||null,assigneeMe:X});y(Qe),D(Qe.persisted.teamId??""),C(Qe.persisted.assigneeMe),L(Qe.persisted.stateFilter),gt(Qe.envOverrides.stateFilter||Qe.envOverrides.teamId?"Saved locally — env still overrides the disabled controls":"Saved"),f==null||f()}catch(z){nt(String(z))}finally{rt(!1)}},te=V||I||mt;return r.jsxs("div",{className:"rounded border border-white/10 bg-black/20 px-3 py-2 space-y-2","aria-label":"Linear intake filters",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{className:"text-xs text-white/60",children:"Linear intake filters"}),m&&r.jsx("button",{type:"button",className:"text-xs text-white/50 hover:text-white",onClick:m,children:"Close"})]}),De?r.jsxs(r.Fragment,{children:[Ce&&r.jsxs("p",{className:"text-xs text-amber-200/90 rounded bg-amber-500/10 border border-amber-400/20 px-2 py-1.5","data-testid":"linear-filter-env-notice",children:[J&&ue?r.jsxs(r.Fragment,{children:[r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_TEAM_ID"})," and"," ",r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_STATE_FILTER"})," override saved Team and Status."]}):J?r.jsxs(r.Fragment,{children:[r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_TEAM_ID"})," overrides saved Team."]}):r.jsxs(r.Fragment,{children:[r.jsx("code",{className:"text-amber-100/90",children:"LINEAR_STATE_FILTER"})," overrides saved Status."]})," ","Remove the env var to use the value below."]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/50",children:"Team"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-2 py-1.5 text-sm disabled:opacity-50","aria-label":"Team",value:j,disabled:J||!x,onChange:z=>D(z.target.value),children:[r.jsx("option",{value:"",children:"All teams"}),((v==null?void 0:v.teams)??[]).map(z=>r.jsxs("option",{value:z.id,children:[z.name,z.key?` (${z.key})`:""]},z.id))]})]}),r.jsxs("fieldset",{className:"space-y-1",disabled:!x,children:[r.jsx("legend",{className:"text-xs text-white/50",children:"Assignee"}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"linear-assignee",checked:!X,onChange:()=>C(!1),className:"accent-[#C4B643]"}),"Anyone"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"linear-assignee",checked:X,onChange:()=>C(!0),className:"accent-[#C4B643]"}),"Assigned to me",(re=v==null?void 0:v.viewer)!=null&&re.name?r.jsxs("span",{className:"text-xs text-white/40",children:["(",v.viewer.name,")"]}):null]})]}),r.jsxs("fieldset",{className:"space-y-1",disabled:ue||!x,children:[r.jsx("legend",{className:"text-xs text-white/50",children:"Status"}),U.length===0?r.jsx("p",{className:"text-xs text-white/40",children:"No workflow statuses available."}):r.jsx("div",{className:"max-h-40 overflow-y-auto space-y-1","data-testid":"linear-status-list",children:U.map(z=>{const de=$.some(Qe=>Qe.toLowerCase()===z.toLowerCase());return r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/80 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:de,disabled:ue||!x,onChange:()=>Y(z),className:"accent-[#C4B643]","aria-label":`Status ${z}`}),z]},z)})})]}),te&&r.jsx("p",{className:"text-xs text-red-300","data-testid":"linear-filters-error",children:te}),Ue&&r.jsx("p",{className:"text-xs text-teal-200/80","data-testid":"linear-filters-notice",children:Ue}),r.jsx("div",{className:"flex gap-2",children:r.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded border border-teal/40 text-teal disabled:opacity-50",disabled:!N,"data-testid":"linear-filters-save",onClick:()=>void W(),children:At?"Saving…":"Save"})})]}):r.jsx("p",{className:"text-xs text-white/40",children:"Loading…"})]})}function Nv(a){return a.issues.some(l=>l.code==="usage_capped")}function _v(a){return[...a].sort((l,i)=>Number(i.healthy)-Number(l.healthy))}function ol(a){var u;const l=`${a.name} · ${ka(a.runtime)}`,i=[];if(!a.healthy){const d=((u=a.issues[0])==null?void 0:u.message)??"unhealthy";i.push(`NEEDS FIX: ${d}`)}return Nv(a)&&i.push("USAGE CAPPED"),i.length>0?`${l} — ${i.join(" · ")}`:l}function ku(a){var l;return a?a.healthy?Nv(a)?"Usage capped — admission will refuse until the cap lifts":null:((l=a.issues[0])==null?void 0:l.message)??"Agent is unhealthy":null}function kv({agents:a,initialDeveloperId:l,initialReviewerId:i,busy:u,onSave:d,onCancel:f,variant:m="queued",notice:x=null}){var P,ne;const[y,v]=b.useState(l??""),[w,j]=b.useState(i??""),D=_v(a),X=a.find(V=>V.id===y),C=a.find(V=>V.id===w),$=ku(X),L=ku(C),H=y===(l??"")&&w===(i??""),F=m==="parked"?"Save via the issue PATCH contract — keeps the worktree and branch, records the change on the timeline; resume continues with the new agents":"Save via the issue PATCH contract — keeps queue position and rechecks the wait reason";return r.jsxs("div",{className:"p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsx("p",{className:"text-xs text-white/50",children:m==="parked"?r.jsx(r.Fragment,{children:"Swap the developer and/or reviewer to another profile — the worktree, branch and review rounds are kept, the change is recorded on the timeline, and a resume continues with the new agents."}):r.jsx(r.Fragment,{children:"Reassign agents — queue position is kept, the wait reason is rechecked, and the change is recorded on the timeline."})}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Developer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:y,disabled:u,title:X?`${X.name} · ${ka(X.runtime)}${X.healthy?" · healthy":` · ${((P=X.issues[0])==null?void 0:P.message)??"unhealthy"}`}`:"Pick a developer agent",onChange:V=>v(V.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),D.map(V=>r.jsx("option",{value:V.id,title:ol(V),children:(V.healthy?"● ":"○ ")+ol(V)},V.id))]}),$&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:$})]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Reviewer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:w,disabled:u,title:C?`${C.name} · ${ka(C.runtime)}${C.healthy?" · healthy":` · ${((ne=C.issues[0])==null?void 0:ne.message)??"unhealthy"}`}`:"Pick a reviewer agent",onChange:V=>j(V.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),D.map(V=>V.runtime==="muse_code"?r.jsx("option",{value:V.id,disabled:!0,title:"Muse Code cannot be a reviewer (developer role only)",children:`○ ${V.name} · ${ka(V.runtime)} — reviewer not supported`},V.id):r.jsx("option",{value:V.id,title:ol(V),children:(V.healthy?"● ":"○ ")+ol(V)},V.id))]}),L&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:L})]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:u||!y||!w||H,title:F,onClick:()=>d(y,w),children:"Save agents"}),r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm text-white/60 hover:text-white disabled:opacity-50",disabled:u,title:m==="parked"?"Reset the selectors to the issue's current agents":void 0,onClick:()=>{if(m==="parked"){v(l??""),j(i??""),f==null||f();return}f==null||f()},children:"Cancel"})]}),x&&r.jsx("p",{className:"text-xs text-emerald-200/90",children:x})]})}function Au({className:a="w-3.5 h-3.5"}){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:a,"aria-hidden":!0,children:r.jsx("path",{fillRule:"evenodd",d:"M8.982 1.566a1.13 1.13 0 0 0-1.964 0L.165 13.233c-.457.778.091 1.767.982 1.767h13.706c.891 0 1.439-.99.982-1.767L8.982 1.566zM8 5.697a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 5.697zm0 7.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"})})}const jj={final_review:"Final review",attempts_exhausted:"Attempts exhausted",policy_escalation:"Policy escalation",product_scope_decision:"Product scope decision",deck_interaction_required:"Agent Deck interaction required",reflection_interaction_required:"Reflection interaction required",outbound_delivery_interaction_required:"Outbound delivery interaction required",muse_capability:"Muse capability",operator_verification:"Operator verification"};function Nj(a){return jj[a]??a}function _j(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}function kj(a){const l=_j(a.responseOptionsJson);return Array.isArray(l)?l.filter(i=>typeof(i==null?void 0:i.choice)=="string"&&typeof(i==null?void 0:i.label)=="string"):[]}function Aj(a){return a==="close"||a==="reject"||a==="abort"}function Ej({options:a,disabled:l,onChoose:i}){return a.length===0?null:r.jsx("div",{className:"flex flex-wrap gap-2",children:a.map(u=>r.jsx("button",{type:"button",className:`${Aj(u.choice)?"btn-ghost-danger":"btn-gold"} px-3 py-1 text-xs disabled:opacity-50`,disabled:l,onClick:()=>i(u.choice),children:u.label},u.choice))})}function Bi({action:a,linkTo:l,onChoose:i,disabled:u,children:d,hideChoicesHint:f}){const m=Iy(a),x=l?r.jsx(sa,{to:l,className:"text-sm text-white/85 hover:text-white hover:underline",children:m.title}):r.jsx("span",{className:"text-sm text-white/85",children:m.title});return r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[r.jsx("span",{className:"text-xs uppercase tracking-wide text-red-300/80",children:Nj(a.actionType)}),r.jsx("span",{className:"text-xs text-white/35 shrink-0",children:new Date(a.requestedAt).toLocaleString()})]}),r.jsx("div",{children:x}),m.context&&r.jsx("p",{className:"text-xs text-white/55",children:m.context}),i?m.displayOptions.length>0?r.jsx(Ej,{options:m.displayOptions,disabled:u,onChoose:i}):r.jsxs("p",{className:"text-xs text-amber-200/80",children:["This item declares no response options — resolve it from the CLI (",r.jsx("code",{children:"agent-dealer action"}),")."]}):!f&&m.displayOptions.length>0&&r.jsxs("p",{className:"text-xs text-white/50",children:["To decide: ",m.displayOptions.map(y=>y.label).join(" · ")]}),d,r.jsxs("details",{children:[r.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"Details"}),r.jsxs("div",{className:"mt-1.5 space-y-1.5 rounded border border-white/10 bg-black/20 px-3 py-2",children:[r.jsx("p",{className:"text-xs text-white/60 whitespace-pre-wrap",children:m.details.question}),m.details.question!==m.details.reason&&r.jsx("p",{className:"text-xs text-white/60 whitespace-pre-wrap",children:m.details.reason}),m.details.factLines.map(y=>r.jsx("p",{className:"text-xs text-white/60",children:y},y)),m.details.paths.length>0&&r.jsxs("div",{className:"text-xs text-white/60",children:[r.jsx("p",{className:"text-white/40",children:"Saved paths:"}),m.details.paths.map(y=>r.jsx("p",{className:"font-mono break-all",children:y},y))]}),m.details.commands.length>0&&r.jsxs("div",{className:"text-xs text-white/60",children:[r.jsx("p",{className:"text-white/40",children:"Recovery commands:"}),r.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all",children:m.details.commands.join(`
|
|
64
|
-
`)})]}),m.details.evidencePretty&&r.jsxs("div",{className:"text-xs text-white/60",children:[r.jsx("p",{className:"text-white/40",children:"Evidence:"}),r.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all",children:m.details.evidencePretty})]})]})]})]})}function Cj({actions:a,busyActionId:l,onResolve:i}){const[u,d]=b.useState({});return a.length===0?null:r.jsxs("div",{className:"mb-4 rounded border border-red-400/30 bg-red-500/10",children:[r.jsxs("div",{className:"px-4 py-2 flex items-center gap-2 border-b border-red-400/20",children:[r.jsx(Au,{className:"w-4 h-4 shrink-0 text-red-300"}),r.jsxs("span",{className:"font-ui-display text-sm font-medium text-red-200",children:[a.length," ",a.length===1?"item needs":"items need"," your attention"]})]}),r.jsx("div",{className:"divide-y divide-white/5",children:a.map(f=>{if(f.issueId)return r.jsx("div",{className:"px-4 py-3 hover:bg-white/5 transition-colors",children:r.jsx(Bi,{action:f,linkTo:`/issues/${f.issueId}`})},f.id);const m=f.actionType==="operator_verification",x=u[f.id]??"";return r.jsx("div",{className:"px-4 py-3",children:r.jsx(Bi,{action:f,disabled:l===f.id||m&&!x.trim(),onChoose:y=>i(f.id,y,m?x:void 0),children:m&&r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm text-white/85 placeholder:text-white/30",rows:2,placeholder:"Result note (required) — paste the probe output, waiver reason, or repair note",value:x,disabled:l===f.id,onChange:y=>d(v=>({...v,[f.id]:y.target.value}))})})},f.id)})})]})}const Rj="web";function Tj(a){if(typeof a!="object"||a===null)return null;const l=a.deletedNotice;return typeof l=="string"&&l.length>0?l:null}function Oj(a){const l=Date.now()-new Date(a).getTime(),i=Math.floor(l/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const u=Math.floor(i/60);return u<24?`${u}h ago`:`${Math.floor(u/24)}d ago`}function Lj({agents:a,humanActions:l,onHumanActionsChanged:i}){const[u,d]=b.useState(null),[f,m]=b.useState(null),[x,y]=Ey(),v=x.toString(),w=Vu(v),j=b.useRef(w);j.current=w;const[D,X]=b.useState(()=>qx(v)),[C,$]=b.useState(!1),L=Yx(w),[H,F]=b.useState(!1),[P,ne]=b.useState(!1),[V,_e]=b.useState(!1),[I,ye]=b.useState("manual"),[Ue,gt]=b.useState([]),[At,rt]=b.useState(!1),[mt,nt]=b.useState(""),Ge=b.useRef(mt);Ge.current=mt;const[U,J]=b.useState(""),[ue,Ce]=b.useState(!1),[De,N]=b.useState([]),[Y,W]=b.useState(""),[te,re]=b.useState(""),[z,de]=b.useState("main"),[Qe,ze]=b.useState(""),[Bt,Ra]=b.useState(""),[ra,Ya]=b.useState(""),[qe,Va]=b.useState(""),[ct,bt]=b.useState(!0),[Rn,Ye]=b.useState(null),Za=Ea(),Tn=Tj(Za.state),[an,nn]=b.useState(!1),[tt,dl]=b.useState([]),[ke,fl]=b.useState(null),[Ga,On]=b.useState(!1),[Yt,Yl]=b.useState(null),[qs,Qa]=b.useState(()=>mj()),[at,Ut]=b.useState(null),[pt,ua]=b.useState(null),Pe=Ue.find(E=>E.id===mt)??null,Ln=I==="linear"&&Pe!=null,Xa=KS(I,Pe),Ta=Bx({title:Y,repo:te,developerAgentId:ra,reviewerAgentId:qe}),Oa=E=>{W2(E).then(d).catch(le=>Ye(String(le)))},oa=()=>{Ox([...md]).then(Yl).catch(()=>{})},Mn=()=>{pj(),Qa(!0)},ln=hj({historyTotal:Yt,filtersActive:L,dismissed:qs}),Tt=()=>{Oa(j.current),hd().then(dl).catch(()=>{}),cS().then(fl).catch(()=>{}),oa()},hl=async E=>{On(!0),Ye(null);try{const le=await dS(E);fl(le),Tt()}catch(le){Ye(String(le))}finally{On(!1)}},ml=async E=>{ua(E),Ye(null);try{const le=await uv(E);Ut({issueId:E,developerAgentId:le.issue.developerAgentId,reviewerAgentId:le.issue.reviewerAgentId})}catch(le){Ye(String(le))}finally{ua(null)}},sn=async(E,le)=>{if(at){ua(at.issueId);try{await mu(at.issueId,{developerAgentId:E,reviewerAgentId:le}),Ut(null),Tt()}catch(ve){Ut(null),Ye(String(ve)),Tt()}finally{ua(null)}}},Hs=async E=>{ua(E),Ye(null);try{await ov(E),Tt()}catch(le){Ye(String(le))}finally{ua(null)}},Vl=async E=>{ua(E),Ye(null);try{await cv(E),Tt()}catch(le){Ye(String(le)),Tt()}finally{ua(null)}},Zl=E=>{const le=nj(v,E);y(le?Object.fromEntries(new URLSearchParams(le)):{})},pl=()=>{X(WS),y({})},Dn=E=>{const le=aj(v,E);y(le?Object.fromEntries(new URLSearchParams(le)):{})},xl=E=>{const le=lj(v,E);y(le?Object.fromEntries(new URLSearchParams(le)):{})},Gl=()=>{const E=sj(v);y(E?Object.fromEntries(new URLSearchParams(E)):{})},La=E=>X(le=>({...le,...E})),ca=async(E,le,ve)=>{m(E),Ye(null);try{await fv(E,Rj,le,ve),i(),Tt()}catch(xt){Ye(String(xt))}finally{m(null)}};b.useEffect(()=>{X(qx(v))},[v]),b.useEffect(()=>{Oa(j.current),hd().then(dl).catch(()=>{}),Ox([...md]).then(Yl).catch(()=>{});const E=setInterval(()=>{Oa(j.current),hd().then(dl).catch(()=>{})},5e3);return()=>clearInterval(E)},[v]);const dt=()=>{B2().then(E=>{rt(E.hasMore),gt(le=>JS(le,E.candidates,Ge.current))}).catch(E=>Ye(`Linear inbox: ${String(E)}`))};b.useEffect(()=>{H&&(P2().then(N).catch(()=>N([])),I==="linear"&&dt())},[H,I]),b.useEffect(()=>{Pe&&(W(`${Pe.identifier}: ${Pe.title}`),ze(Pe.description??""),Ra(""),re(E=>IS(E,Pe)))},[Pe]);const wt=()=>{W(""),re(""),ze(""),Ra(""),nt(""),J(""),bt(!0),de("main")},Z=E=>{gt(le=>FS(le,E).candidates),nt(E.id),J(E.identifier)},Se=async()=>{const E=U.trim();if(!E){Ye("Paste a Linear id (e.g. NOT-103) or issue URL");return}Ce(!0),Ye(null);try{const le=await q2(E);Z(le)}catch(le){Ye(`Linear lookup: ${String(le)}`)}finally{Ce(!1)}},lt=async()=>{if(!Bx({title:Y,repo:te,developerAgentId:ra,reviewerAgentId:qe})){Ye("Title, GitHub repository, developer, and reviewer are required");return}try{await nS({title:Y.trim(),repo:te.trim(),baseBranch:z.trim()||"main",description:Qe.trim()||void 0,acceptanceCriteria:Bt.trim()||void 0,developerAgentId:ra,reviewerAgentId:qe,maxReviewRounds:3,maxInfraAttempts:3,autoMerge:ct,source:I==="linear"&&Pe?"linear":"manual",externalId:Pe==null?void 0:Pe.id,externalLabel:Pe==null?void 0:Pe.identifier,externalUrl:Pe==null?void 0:Pe.url,linearAttachments:Pe==null?void 0:Pe.attachments}),F(!1),wt(),Tt()}catch(E){Ye(String(E))}};return r.jsxs("div",{className:"flex-1 min-h-0 px-6 py-4 w-full overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Issues"}),r.jsx("button",{type:"button",className:"btn-gold px-4",onClick:()=>F(E=>!E),children:"New issue"})]}),Rn&&r.jsx("p",{className:"text-sm text-red-300 mb-3",children:Rn}),Tn&&!an&&r.jsxs("div",{className:"mb-3 p-3 rounded border border-white/15 bg-white/[0.04] flex items-start justify-between gap-3",children:[r.jsx("p",{className:"text-sm text-white/85",children:Tn}),r.jsx("button",{type:"button",className:"font-ui-display shrink-0 text-xs text-white/50 hover:text-white",onClick:()=>nn(!0),children:"Dismiss"})]}),ln&&r.jsx(xj,{agents:a,onStartIssue:()=>F(!0),onDismiss:Mn}),H&&r.jsxs("div",{className:"mb-4 p-4 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsxs("p",{className:"text-xs text-white/50",children:["Workflow:"," ",r.jsxs("span",{className:"text-white/75",children:["developer → reviewer → ",ct?"auto-merge on approve":"final human review"]}),"."]}),r.jsxs("div",{className:"flex gap-2 text-sm",children:[r.jsx("button",{type:"button",className:`font-ui-display px-3 py-1 rounded border ${I==="manual"?"border-teal/50 text-teal":"border-white/10 text-white/50"}`,onClick:()=>{ye("manual"),nt("")},children:"Manual"}),r.jsx("button",{type:"button",className:`font-ui-display px-3 py-1 rounded border ${I==="linear"?"border-teal/50 text-teal":"border-white/10 text-white/50"}`,onClick:()=>ye("linear"),children:"From Linear"})]}),I==="linear"&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{className:"flex-1 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"NOT-103 or Linear URL",value:U,onChange:E=>J(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),Se())}}),r.jsx("button",{type:"button",className:"font-ui-display px-3 py-2 rounded border border-teal/40 text-teal text-sm disabled:opacity-50",disabled:ue||!U.trim(),onClick:()=>void Se(),children:ue?"…":"Lookup"})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs text-white/50",children:"Or pick from open inbox…"}),r.jsx("button",{type:"button","aria-label":"Configure Linear intake filters",title:"Configure Linear intake filters","aria-expanded":V,onClick:()=>_e(E=>!E),className:"text-white/40 hover:text-white shrink-0 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M8 5.2a2.8 2.8 0 1 0 0 5.6 2.8 2.8 0 0 0 0-5.6Z",stroke:"currentColor",strokeWidth:"1.3"}),r.jsx("path",{d:"M8 1.5v1.7M8 12.8v1.7M1.5 8h1.7M12.8 8h1.7M3.4 3.4l1.2 1.2M11.4 11.4l1.2 1.2M12.6 3.4l-1.2 1.2M4.6 11.4l-1.2 1.2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})})]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm","aria-label":"Or pick from open inbox",value:mt,onChange:E=>{const le=E.target.value;nt(le);const ve=Ue.find(xt=>xt.id===le);ve&&J(ve.identifier)},children:[r.jsx("option",{value:"",children:"Select an issue…"}),Ue.map(E=>r.jsxs("option",{value:E.id,children:[E.identifier,": ",E.title]},E.id))]}),V&&r.jsx(Sj,{onClose:()=>_e(!1),onSaved:dt}),At&&r.jsx("p",{className:"text-xs text-white/40","data-testid":"linear-candidates-has-more",children:"Showing the 50 most recently updated matches. Use exact ID/URL lookup above for another issue."})]})]}),r.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm disabled:opacity-60",placeholder:"Title",value:Y,disabled:Ln,onChange:E=>W(E.target.value)}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm disabled:opacity-60",rows:3,placeholder:"Problem statement / description",value:Qe,disabled:Ln,onChange:E=>ze(E.target.value)}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:3,placeholder:"Acceptance criteria (derived from the ticket when left empty)",value:Bt,onChange:E=>Ra(E.target.value)}),r.jsxs("div",{className:"flex gap-2 items-stretch",children:[r.jsxs("div",{className:"flex-1 space-y-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs text-white/50",children:"Repository"}),r.jsx("button",{type:"button","aria-label":"Configure repository mappings",title:"Configure repository mappings","aria-expanded":P,onClick:()=>ne(E=>!E),className:"text-white/40 hover:text-white shrink-0 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r.jsx("path",{d:"M8 5.2a2.8 2.8 0 1 0 0 5.6 2.8 2.8 0 0 0 0-5.6Z",stroke:"currentColor",strokeWidth:"1.3"}),r.jsx("path",{d:"M8 1.5v1.7M8 12.8v1.7M1.5 8h1.7M12.8 8h1.7M3.4 3.4l1.2 1.2M11.4 11.4l1.2 1.2M12.6 3.4l-1.2 1.2M4.6 11.4l-1.2 1.2",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})})]}),r.jsx(jv,{value:te,onChange:re,recentRepos:De}),P&&r.jsx(gj,{recentRepos:De,onClose:()=>ne(!1)}),Xa&&r.jsx("p",{className:"text-xs text-amber-200/80","data-testid":"repo-label-warning",children:Xa})]}),r.jsx("input",{className:"w-32 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"Base (seed)",title:"Seed only — managed GitHub clones use the remote default at first checkout",value:z,onChange:E=>de(E.target.value)})]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:ra,onChange:E=>Ya(E.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),a.map(E=>r.jsx("option",{value:E.id,children:E.name},E.id))]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:qe,onChange:E=>Va(E.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),a.map(E=>r.jsx("option",{value:E.id,children:E.name},E.id))]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/70 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:ct,onChange:E=>bt(E.target.checked),className:"accent-[#C4B643]"}),"Auto-merge when reviewer approves (skip final human review)"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 disabled:opacity-40",disabled:!Ta,title:Ta?void 0:"Title, GitHub repository, developer, and reviewer are required",onClick:lt,children:I==="linear"?"Kick from Linear":"Create"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm text-white/60 hover:text-white",onClick:()=>{F(!1),wt()},children:"Cancel"})]})]}),tt.length>0?r.jsxs("div",{className:"mb-4 rounded border border-cyber-teal/25 bg-cyber-teal/5",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-cyber-teal/20 flex items-center justify-between gap-3",children:[r.jsx("span",{className:"font-ui-display text-sm font-medium text-cyber-teal",children:"Admission queue"}),r.jsx("span",{className:"flex items-center gap-2 text-xs text-white/40",children:ke?r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:[ke.active," active · ",ke.waiting," waiting · limit"," ",ke.limit,ke.overCap?" · over capacity":""]}),ke.options.length>0?r.jsxs("label",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-white/35",children:"limit"}),r.jsx("select",{className:"bg-black/30 border border-white/10 rounded px-1.5 py-0.5 text-xs text-white/80 disabled:opacity-50",value:ke.options.includes(ke.maxActiveIssues)?ke.maxActiveIssues:ke.limit,disabled:Ga,title:ke.ceiling<Ud?`Capped by the worker/spawn ceiling (${ke.ceiling})`:"How many issues may execute in parallel (same-repository issues may run together)",onChange:E=>void hl(Number(E.target.value)),children:ke.options.map(E=>r.jsx("option",{value:E,children:E},E))})]}):r.jsxs("span",{title:`Capped by the worker/spawn ceiling (${ke.ceiling})`,children:["max ",ke.ceiling]})]}):r.jsxs("span",{children:[tt.length," waiting · sequential"]})})]}),r.jsx("div",{className:"divide-y divide-white/5",children:tt.map((E,le)=>r.jsxs("div",{children:[r.jsxs("div",{className:"px-4 py-2 flex items-start gap-3",children:[r.jsx("span",{className:"text-xs text-white/35 w-5 shrink-0 pt-0.5",children:E.position}),r.jsxs(sa,{to:`/issues/${E.issueId}`,className:"flex-1 min-w-0 text-left hover:text-cyber-teal",children:[r.jsx("span",{className:"text-sm text-white/85 truncate block",children:E.title??E.issueId.slice(0,8)}),E.waitReason?r.jsx("span",{className:"text-xs text-amber-200/80 block mt-0.5",children:E.waitReason}):r.jsxs("span",{className:"text-xs text-white/35 block mt-0.5",children:[E.issueStatus??"queued"," · next up"]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0 flex-wrap justify-end",children:[r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:pt===E.issueId,title:"Change the developer/reviewer agents — keeps queue position and rechecks the wait reason",onClick:()=>void ml(E.issueId),children:"Edit"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:pt===E.issueId,title:"Run next — move to the front of the admission queue; runs now if a slot is free, otherwise waits first with a reason",onClick:()=>void Hs(E.issueId),children:"Run next"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:pt===E.issueId,title:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:()=>void Vl(E.issueId),children:"Execute now"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:le===0,title:"Move to top",onClick:()=>{su(E.issueId,"top").then(Tt).catch(ve=>Ye(String(ve)))},children:"Top"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:le===0,title:"Move up",onClick:()=>{const ve=tt[le-1];ve&&su(E.issueId,{before:ve.issueId}).then(Tt).catch(xt=>Ye(String(xt)))},children:"↑"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:le===tt.length-1,title:"Move down",onClick:()=>{const ve=tt[le+1];ve&&su(E.issueId,{after:ve.issueId}).then(Tt).catch(xt=>Ye(String(xt)))},children:"↓"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:le===tt.length-1,title:"Move to bottom",onClick:()=>{su(E.issueId,"bottom").then(Tt).catch(ve=>Ye(String(ve)))},children:"Bottom"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-white",onClick:()=>{dv(E.issueId).then(Tt).catch(ve=>Ye(String(ve)))},children:"Remove"})]})]}),(at==null?void 0:at.issueId)===E.issueId&&r.jsx("div",{className:"px-4 pb-3 pl-12",children:r.jsx(kv,{agents:a,initialDeveloperId:at.developerAgentId,initialReviewerId:at.reviewerAgentId,busy:pt===E.issueId,onSave:(ve,xt)=>void sn(ve,xt),onCancel:()=>Ut(null)})})]},E.id))})]}):ke?r.jsxs("p",{"data-testid":"admission-idle-status",className:"mb-4 text-xs text-white/35 tabular-nums",children:["Admission: ",ke.active," active · ",ke.waiting," waiting · limit"," ",ke.limit,ke.overCap?" · over capacity":"",ke.options.length>0&&r.jsxs("label",{className:"ml-2 inline-flex items-center gap-1",children:[r.jsx("span",{children:"limit"}),r.jsx("select",{className:"bg-black/30 border border-white/10 rounded px-1.5 py-0.5 text-xs text-white/60 disabled:opacity-50",value:ke.options.includes(ke.maxActiveIssues)?ke.maxActiveIssues:ke.limit,disabled:Ga,title:ke.ceiling<Ud?`Capped by the worker/spawn ceiling (${ke.ceiling})`:"How many issues may execute in parallel (same-repository issues may run together)",onChange:E=>void hl(Number(E.target.value)),children:ke.options.map(E=>r.jsx("option",{value:E,children:E},E))})]})]}):null,r.jsx(Cj,{actions:l,busyActionId:f,onResolve:(E,le,ve)=>void ca(E,le,ve)}),r.jsxs("div",{className:"mb-4 rounded border border-white/10 bg-panel-elevated/60",children:[r.jsxs("button",{type:"button","aria-expanded":C,"aria-controls":"issues-filter-form",onClick:()=>$(E=>!E),className:"w-full flex items-center gap-2 px-4 py-2.5 text-sm text-white/70 hover:text-white",children:[r.jsx("span",{"aria-hidden":"true",className:"text-xs text-white/40 w-3 shrink-0",children:C?"▾":"▸"}),r.jsx("span",{className:"font-ui-display",children:C?"Hide filters":"Show filters"}),L&&r.jsx("span",{"data-testid":"filters-active-indicator",title:"The issue list is filtered",className:"text-xs px-2 py-0.5 rounded-full border border-[#C4B643]/50 text-[#C4B643]",children:"Filtered"})]}),C&&r.jsx("form",{id:"issues-filter-form","aria-label":"Issues filters",className:"px-4 pb-4",onSubmit:E=>{E.preventDefault(),Zl(D)},children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Search"}),r.jsx("input",{type:"text",placeholder:"Title or label (e.g. NOT-175)",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.q,onChange:E=>La({q:E.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Status"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.status,onChange:E=>La({status:E.target.value}),children:[r.jsx("option",{value:"",children:"All statuses"}),md.map(E=>r.jsx("option",{value:E,children:E},E))]})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"block text-xs text-white/50 mb-1",children:"Repository"}),r.jsx("input",{type:"text",placeholder:"github.com/owner/repo",title:"Exact repository identity",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:D.repo,onChange:E=>La({repo:E.target.value})})]}),r.jsx("div",{className:"flex items-end gap-2",children:r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/70 cursor-pointer pb-2",children:[r.jsx("input",{type:"checkbox",checked:D.needsAttention,onChange:E=>La({needsAttention:E.target.checked}),className:"accent-[#C4B643]"}),"Needs attention"]})}),r.jsxs("div",{className:"flex items-end gap-2 sm:col-span-2 lg:col-span-4",children:[r.jsx("button",{type:"submit",className:"btn-gold px-4",children:"Apply"}),r.jsx("button",{type:"button",className:"px-4 py-2 text-sm text-white/60 hover:text-white",onClick:pl,children:"Reset"})]})]})})]}),u===null?r.jsx("p",{className:"text-white/50 text-sm",children:"Loading…"}):u.total===0&&!Yx(w)?r.jsx("p",{className:"text-white/45 text-sm",children:"No issues yet — create one to get started."}):u.total===0?r.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/40 px-4 py-3",children:[r.jsx("p",{className:"text-white/45 text-sm",children:Hx(u)}),r.jsx("button",{type:"button",className:"mt-2 px-3 py-1.5 text-sm rounded border border-white/15 text-white/70 hover:text-white",onClick:pl,children:"Reset filters"})]}):r.jsxs("div",{children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-2",children:[r.jsx(oj,{sort:PS(v),direction:gv(v),onSortChange:xl,onToggleDirection:Gl}),r.jsxs("p",{className:"text-xs text-white/40 tabular-nums",children:[Hx(u),$x(u)?` · ${$x(u)}`:""]})]}),r.jsx("div",{className:"space-y-2",children:u.issues.map(E=>{const le=tt.find(ve=>ve.issueId===E.id);return r.jsxs(sa,{to:`/issues/${E.id}`,className:"w-full text-left flex items-center gap-3 px-4 py-3 rounded border border-white/10 bg-panel-elevated/40 hover:bg-panel-elevated/70 transition-colors",children:[E.hasOpenHumanAction&&r.jsx(Au,{className:"w-4 h-4 shrink-0 text-red-400"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-white/90 truncate",children:E.title}),le!=null&&le.waitReason?r.jsx("p",{className:"text-xs text-amber-200/80 truncate",title:le.waitReason,children:le.waitReason}):E.currentIntent&&r.jsx("p",{className:"text-xs text-white/50 truncate",children:E.currentIntent})]}),r.jsx("span",{className:"text-xs text-white/40 capitalize shrink-0",children:E.currentOwner}),le&&r.jsxs("span",{className:"text-xs px-2 py-0.5 rounded border border-cyber-teal/40 text-cyber-teal shrink-0",title:le.waitReason??"Next up for admission",children:["Queued #",le.position]}),r.jsx(bv,{status:E.status}),r.jsx("span",{className:"text-xs text-white/35 shrink-0 w-16 text-right",children:Oj(E.updatedAt)})]},E.id)})}),u.totalPages>1&&r.jsxs("nav",{"aria-label":"Issues pages",className:"mt-3 flex items-center gap-2",children:[r.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded border border-white/15 text-white/70 hover:text-white disabled:opacity-40",disabled:u.page<=1,onClick:()=>Dn(u.page-1),children:"Previous"}),r.jsxs("span",{className:"text-xs text-white/45 tabular-nums",children:["Page ",u.page," of ",u.totalPages]}),r.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded border border-white/15 text-white/70 hover:text-white disabled:opacity-40",disabled:u.page>=u.totalPages,onClick:()=>Dn(u.page+1),children:"Next"})]})]})]})}const Mj=["developer","reviewer","legacy"],Zx=["claude_code","cursor_local","codex_local"],Dj=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"];function Ts(a,l){return a.n===0||a.p50===null&&a.p95===null?{available:!1,p50Text:null,p95Text:null,sampleText:"n=0",sampleTitle:"No observations in this cohort",sparse:!0}:{available:!0,p50Text:a.p50===null?null:l(a.p50),p95Text:a.p95===null?null:l(a.p95),sampleText:av(a.n),sampleTitle:`Sample size ${a.n}${zd(a.n)?" — fewer than 5 observations, compare with care":""}`,sparse:zd(a.n)}}function Sa(a,l,i){if(a.sum===null||a.known===0)return{available:!1,valueText:"N/A",exactText:null,noteText:null,noteTitle:null,incomplete:a.known<a.total};const u=l(a.sum),d=i!=null&&i.compact?N2(a.sum):u,f=a.known<a.total;return{available:!0,valueText:d,exactText:i!=null&&i.compact?u:null,noteText:f?`${Ke(a.known)}/${Ke(a.total)} known`:null,noteTitle:f?"Partial sample — missing provider metadata is excluded, never zero":null,incomplete:f}}function $i(a,l,i){return a===null||l===0?{available:!1,valueText:"N/A",evidenceCounts:null,evidenceNoun:null,title:`No ${i} in this cohort`}:{available:!0,valueText:Hu(a),evidenceCounts:`${Ke(Math.round(a*l))}/${Ke(l)}`,evidenceNoun:i,title:`Exact share over ${l} ${i}`}}function Gx(a,l,i){const u=$i(a,l,i);return u.available?{text:`${u.valueText} (${u.evidenceCounts} ${u.evidenceNoun})`,title:u.title}:{text:u.valueText,title:u.title}}function xd(a){const l=Gx(a.issueSuccess,a.issueSuccessDenominator,"closed"),i=Gx(a.attemptSuccess,a.attemptSuccessDenominator,"terminal attempts");return{key:a.key,issuesText:Ke(a.issues),attemptsText:Ke(a.attempts),issueSuccessText:l.text,issueSuccessTitle:l.title,attemptSuccessText:i.text,attemptSuccessTitle:i.title,issueSuccessDisplay:$i(a.issueSuccess,a.issueSuccessDenominator,"closed"),attemptSuccessDisplay:$i(a.attemptSuccess,a.attemptSuccessDenominator,"terminal attempts"),wallText:Tx(a.sessionWallMs,Kt),envelopeText:Tx(a.spawnEnvelopeMs,Kt),retryText:a.retryRate===null?"N/A":Hu(a.retryRate),retryTitle:"Extra attempts after a terminal attempt in the same issue/role/round ÷ attempts",tokensInText:il(a.tokensIn,Ke),tokensOutText:il(a.tokensOut,Ke),costText:il(a.costUsd,Mi),costIncomplete:a.costUsd.known<a.costUsd.total,durationText:il(a.durationMs,Kt),failedCostText:il(a.failedCostUsd,Mi),failedTokensText:`${il(a.failedTokensIn,Ke)} in · ${il(a.failedTokensOut,Ke)} out`,failedDurationText:il(a.failedDurationMs,Kt),wall:Ts(a.sessionWallMs,Kt),envelope:Ts(a.spawnEnvelopeMs,Kt),tokensIn:Sa(a.tokensIn,Ke,{compact:!0}),tokensOut:Sa(a.tokensOut,Ke,{compact:!0}),cost:Sa(a.costUsd,Mi),duration:Sa(a.durationMs,Kt),failedCost:Sa(a.failedCostUsd,Mi),failedTokensIn:Sa(a.failedTokensIn,Ke,{compact:!0}),failedTokensOut:Sa(a.failedTokensOut,Ke,{compact:!0}),failedDuration:Sa(a.failedDurationMs,Kt),failedIncomplete:a.failedCostUsd.known<a.failedCostUsd.total||a.failedTokensIn.known<a.failedTokensIn.total||a.failedTokensOut.known<a.failedTokensOut.total||a.failedDurationMs.known<a.failedDurationMs.total,sparse:a.attempts>0&&zd(a.attempts)}}function Uj(a,l){const i=a.code==="unknown";return{code:a.code,domain:a.domain,countText:Ke(a.count),shareText:a.share===null?"N/A":Hu(a.share),shareTitle:l>0?`${Ke(a.count)} of ${Ke(l)} issues with a failed attempt`:"No issues with a failed attempt in scope",isUnknown:i,blurb:i?"Ambiguous evidence — not promoted to a specific cause.":`Primary cause · ${a.domain} domain`,displayCode:i?"Cause not recorded":a.code,displayNote:i?"Needs more evidence":`Primary cause · ${a.domain} domain`,issueIds:a.issueIds,hiddenIssueCount:Math.max(0,a.issueTotal-a.issueIds.length)}}function zj(a){const l=a.reduce((i,u)=>i+u.count,0);return a.map(i=>Uj(i,l))}function Bj(a){return`/issues/${a}`}function Qx(a,l){if(a!=null&&a.trim()&&/^\d{4}-\d{2}-\d{2}$/.test(a.trim()))return l?`${a.trim()}T23:59:59.999Z`:`${a.trim()}T00:00:00.000Z`}function Xx(a){if(!a)return"";const l=a.match(/^(\d{4}-\d{2}-\d{2})/);return l?l[1]:""}function Ix(a){const l=new URLSearchParams(a.startsWith("?")?a.slice(1):a),i=u=>{var d;return((d=l.get(u))==null?void 0:d.trim())??""};return{fromDate:Xx(i("from")),toDate:Xx(i("to")),repo:i("repo"),role:i("role"),runtime:i("runtime"),model:i("model"),status:i("status")}}function qj(a){const l=new URLSearchParams(a.startsWith("?")?a.slice(1):a),i=d=>{var m;const f=(m=l.get(d))==null?void 0:m.trim();return f||void 0},u={};for(const d of["from","to","repo","role","runtime","model","status"]){const f=i(d);f!==void 0&&(u[d]=f)}return u}function Hj(a,l,i){const u=new URLSearchParams(a.startsWith("?")?a.slice(1):a);u.set(l,i),u.delete("page"),u.delete("limit"),u.sort();const d=u.toString();return`/reports/execution${d?`?${d}`:""}`}function $j(a){return{from:Qx(a.fromDate,!1),to:Qx(a.toDate,!0),repo:a.repo.trim()||void 0,role:a.role||void 0,runtime:a.runtime.trim()||void 0,model:a.model.trim()||void 0,status:a.status.trim()||void 0}}function yd(a){return a===null?"N/A":Hu(a)}function za({label:a,value:l,valueTitle:i,note:u}){return r.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/60 px-4 py-3",children:[r.jsx("p",{className:"font-ui-display text-xs uppercase tracking-wide text-white/40",children:a}),r.jsx("div",{className:"mt-1 font-mono text-lg font-semibold text-white/90 tabular-nums",title:i,children:l}),u&&r.jsx("div",{className:"mt-0.5 font-ui-display text-xs text-white/40",children:u})]})}function Eu({display:a,compact:l}){if(!a.available)return r.jsx("span",{className:"font-mono text-white/45",title:a.title,children:"N/A"});const i=l?"font-mono text-sm font-medium text-white/85 tabular-nums leading-tight whitespace-nowrap":"font-mono text-base sm:text-lg font-semibold text-white/90 tabular-nums leading-tight whitespace-nowrap";return r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",title:a.title,children:[r.jsx("span",{className:i,"aria-label":a.title,children:a.valueText}),r.jsxs("span",{className:"font-ui-display min-w-0 break-words text-xs text-white/40",children:["(",r.jsx("span",{className:"font-mono tabular-nums",children:a.evidenceCounts})," ",a.evidenceNoun,")"]})]})}function Di({display:a,compact:l}){if(!a.available)return r.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const i=l?"font-ui-display text-[11px] uppercase tracking-wide text-white/40":"font-ui-display text-xs uppercase tracking-wide text-white/40",u=l?"font-mono text-sm font-medium text-white/85 tabular-nums":"font-mono text-base font-semibold text-white/90 tabular-nums";return r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-3 gap-y-0.5",children:[r.jsxs("span",{className:"inline-flex items-baseline gap-x-1.5",children:[r.jsx("span",{className:i,children:"P50"}),r.jsx("span",{className:u,children:a.p50Text??"N/A"})]}),r.jsxs("span",{className:"inline-flex items-baseline gap-x-1.5",children:[r.jsx("span",{className:i,children:"P95"}),r.jsx("span",{className:u,children:a.p95Text??"N/A"})]}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",title:a.sampleTitle,children:a.sampleText})]})}function ja({display:a,compact:l}){if(!a.available)return r.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const i=a.exactText??a.valueText,u=l?"font-mono text-sm font-medium text-white/85 tabular-nums":"font-mono text-base font-semibold text-white/90 tabular-nums";return r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[r.jsx("span",{className:u,title:i,"aria-label":i,children:a.valueText}),a.noteText&&r.jsx("span",{className:"font-ui-display text-xs text-white/40",title:a.noteTitle??void 0,children:a.noteText})]})}function vd({caption:a,dimension:l,rows:i,cohortLink:u}){return i.length===0?r.jsxs("div",{className:"rounded border border-white/10 bg-panel-elevated/60 px-4 py-3",children:[r.jsx("h4",{className:"font-ui-display text-sm font-medium text-white/80",children:a}),r.jsx("p",{className:"font-ui-display mt-1 text-sm text-white/45",children:"No attempts in this dimension for these filters."})]}):r.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[1440px] text-sm",children:[r.jsxs("caption",{className:"sr-only",children:[a," — sorted by name, never by cost"]}),r.jsx("thead",{children:r.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[r.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:a}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issues"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Attempts"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issue success"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Attempt success"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Session wall P50/P95"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Retry rate"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Tokens in"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Tokens out"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Cost"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Duration"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed cost"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed tokens"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Failed runtime"})]})}),r.jsx("tbody",{className:"divide-y divide-white/5",children:i.map(d=>r.jsxs("tr",{className:"tabular-nums",children:[r.jsxs("th",{scope:"row",className:"px-4 py-2 text-left font-mono font-medium text-white/85",children:[u?r.jsx(sa,{to:u(l,d.key),className:"text-cyber-teal hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45",title:`Filter the report to ${l} ${d.key}`,children:d.key}):d.key,d.sparse&&r.jsx("span",{className:"font-ui-display ml-2 text-xs font-normal text-amber-200/80",title:"Fewer than 5 attempts — compare with care",children:"sparse"})]}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:d.issuesText}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:d.attemptsText}),r.jsx("td",{className:"px-3 py-2 text-white/75",title:d.issueSuccessTitle,children:r.jsx(Eu,{display:d.issueSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",title:d.attemptSuccessTitle,children:r.jsx(Eu,{display:d.attemptSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Di,{display:d.wall,compact:!0})}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",title:d.retryTitle,children:d.retryText}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.tokensIn,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.tokensOut,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.cost,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.duration,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.failedCost,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-1.5",children:[r.jsx(ja,{display:d.failedTokensIn,compact:!0}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"in"}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"·"}),r.jsx(ja,{display:d.failedTokensOut,compact:!0}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",children:"out"})]})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(ja,{display:d.failedDuration,compact:!0})})]},d.key))})]})})}const Yj={fromDate:"",toDate:"",repo:"",role:"",runtime:"",model:"",status:""};function Vj({loading:a,error:l,report:i,onRetry:u,cohortLink:d}){const f=(i==null?void 0:i.summary)??null,m=b.useMemo(()=>i?zj(i.failures):[],[i]),x=b.useMemo(()=>i?i.failures.reduce((y,v)=>y+v.count,0):0,[i]);return r.jsxs("div",{"aria-live":"polite",children:[a&&r.jsx("p",{role:"status",className:"text-sm text-white/50",children:"Loading execution report…"}),!a&&l&&r.jsxs("div",{className:"rounded border border-red-400/30 bg-red-500/10 px-4 py-3",role:"alert",children:[r.jsxs("p",{className:"font-ui-display text-sm text-red-200",children:["Couldn’t load the execution report: ",l]}),r.jsx("button",{type:"button",className:"font-ui-display mt-2 px-3 py-1.5 text-sm rounded border border-red-300/40 text-red-100 hover:bg-red-500/20",onClick:u,children:"Retry"})]}),!a&&!l&&i&&f&&r.jsxs("div",{className:"space-y-6",children:[i.meta.partial&&r.jsxs("div",{className:"rounded border border-amber-300/30 bg-amber-400/10 px-4 py-3",children:[r.jsx("p",{className:"font-ui-display text-sm text-amber-100 font-medium",children:"Partial metadata"}),r.jsx("ul",{className:"font-ui-display mt-1 list-disc list-inside text-sm text-amber-100/80",children:i.meta.partialReasons.map(y=>r.jsx("li",{children:y},y))})]}),f.issues===0?r.jsx("p",{className:"font-ui-display text-sm text-white/45",children:"No issues match these filters in this window. Widen the date range or clear filters."}):r.jsxs(r.Fragment,{children:[r.jsx("section",{"aria-label":"Summary",children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-3",children:[r.jsx(za,{label:"Issue success",value:r.jsx(Eu,{display:$i(f.issueSuccess,f.closedIssues,"closed")}),valueTitle:`done / (done + closed), denominator ${f.closedIssues}`,note:`${Ke(f.issues)} issues · ${Ke(f.closedIssues)} closed`}),r.jsx(za,{label:"Attempt success",value:r.jsx(Eu,{display:$i(f.attemptSuccess,f.terminalAttempts,"terminal")}),valueTitle:`done sessions / terminal sessions, denominator ${f.terminalAttempts}`,note:`${Ke(f.attempts)} attempts · ${Ke(f.terminalAttempts)} terminal`}),r.jsx(za,{label:"Retry rate",value:yd(f.retryRate),valueTitle:`${f.retryExtraAttempts} extra attempts after a terminal attempt in the same issue/role/round ÷ ${f.attempts} attempts`,note:`Reuse rate ${yd(f.reuseRate)} over ${Ke(f.reuseDenominator)} reviewer sessions with input SHA`}),r.jsx(za,{label:"Human wait",value:Kt(f.humanWaitMs),note:`${Ke(f.interventions)} interventions`}),r.jsx(za,{label:"Session wall P50/P95",value:r.jsx(Di,{display:Ts(f.sessionWallMs,Kt)}),note:"Session bookkeeping proxy — never CLI runtime"}),r.jsx(za,{label:"Spawn envelope P50/P95",value:r.jsx(Di,{display:Ts(f.spawnEnvelopeMs,Kt)}),note:"Coordinator-measured; includes slot wait + post-exit work"}),r.jsx(za,{label:"Checkpoint latency P50/P95",value:r.jsx(Di,{display:Ts(f.checkpointMs,Kt)}),note:"Session start → first heartbeat"}),r.jsx(za,{label:"Reviewer rounds (avg)",value:f.avgReviewerRounds===null?"N/A":f.avgReviewerRounds.toFixed(1),note:`Change-request rate ${yd(f.changeRequestRate)} over ${Ke(f.reviewedIssues)} reviewed`})]})}),r.jsxs("section",{"aria-label":"Failed-attempt waste",children:[r.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Failed-attempt waste (known values only)"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[r.jsx(za,{label:"Failed cost",value:r.jsx(ja,{display:Sa(f.failedCostUsd,Mi)})}),r.jsx(za,{label:"Failed tokens",value:r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[r.jsx(ja,{display:Sa(f.failedTokensIn,Ke,{compact:!0})}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"in"}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"·"}),r.jsx(ja,{display:Sa(f.failedTokensOut,Ke,{compact:!0})}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"out"})]})}),r.jsx(za,{label:"Failed runtime",value:r.jsx(ja,{display:Sa(f.failedDurationMs,Kt)})})]})]}),r.jsxs("section",{"aria-label":"Phase wall time",children:[r.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Phase wall time"}),r.jsx("p",{className:"font-ui-display text-xs text-white/40 mb-2",children:"Composed from the execution-analysis read model over the same issues: exact when agent start/complete events are recorded, inferred usage-envelope backfill otherwise. Rows without evidence read N/A — never a guess. See per-row reasons."}),r.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[r.jsx("caption",{className:"sr-only",children:"Exclusive phase wall times. Boundaries without defensible evidence are N/A."}),r.jsx("thead",{children:r.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[r.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:"Phase"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"P50 / P95"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Why"})]})}),r.jsx("tbody",{className:"divide-y divide-white/5",children:f.phaseWallMs.map(y=>r.jsxs("tr",{className:"tabular-nums",children:[r.jsx("th",{scope:"row",className:"px-4 py-2 text-left font-mono font-medium text-white/85",children:y.phase}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Di,{display:Ts(y.stat,Kt),compact:!0})}),r.jsx("td",{className:"font-ui-display px-3 py-2 text-xs text-white/45",children:y.stat.reasons.join(", ")})]},y.phase))})]})})]}),r.jsxs("section",{"aria-label":"Comparisons",className:"space-y-4",children:[r.jsxs("h3",{className:"font-ui-display text-sm font-medium text-white/80",children:["Comparisons ",r.jsx("span",{className:"font-normal text-white/40",children:"— sorted by name, never by cost"})]}),r.jsx(vd,{caption:"By role",dimension:"role",rows:i.byRole.map(xd),cohortLink:d}),r.jsx(vd,{caption:"By runtime",dimension:"runtime",rows:i.byRuntime.map(xd),cohortLink:d}),r.jsx(vd,{caption:"By model",dimension:"model",rows:i.byModel.map(xd),cohortLink:d})]}),r.jsxs("section",{"aria-label":"Why attempts failed",children:[r.jsx("h3",{className:"font-ui-display text-sm font-medium text-white/80 mb-2",children:"Why attempts failed"}),r.jsxs("p",{className:"font-ui-display text-xs text-white/40 mb-2",children:["Each issue with a failed attempt is counted once using its primary actionable cause, and may later have recovered. Share is over"," ",Ke(x)," failed ",x===1?"issue":"issues"," in scope."]}),m.length===0?r.jsx("p",{className:"font-ui-display text-sm text-white/45",children:"No failed attempts in this window."}):r.jsx("div",{className:"rounded border border-white/10 bg-panel-elevated/60 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[560px] text-sm",children:[r.jsx("caption",{className:"sr-only",children:"Why attempts failed: each issue counted once by primary cause. Cause not recorded is its own bucket and is never promoted."}),r.jsx("thead",{children:r.jsxs("tr",{className:"font-ui-display text-left text-xs uppercase tracking-wide text-white/40 border-b border-white/10",children:[r.jsx("th",{scope:"col",className:"px-4 py-2 font-medium",children:"Failure"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Domain"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Issues"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Share"}),r.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Example issues"})]})}),r.jsx("tbody",{className:"divide-y divide-white/5",children:m.map(y=>r.jsxs("tr",{className:y.isUnknown?"bg-amber-400/5 tabular-nums":"tabular-nums",children:[r.jsxs("th",{scope:"row",className:"px-4 py-2 text-left text-white/85",children:[r.jsx("span",{className:"font-ui-display block font-medium",title:y.code,children:y.displayCode}),r.jsx("span",{className:`font-ui-display block text-xs font-normal ${y.isUnknown?"text-amber-200/90":"text-white/40"}`,children:y.displayNote})]}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:y.domain}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",children:y.countText}),r.jsx("td",{className:"px-3 py-2 font-mono text-white/75",title:y.shareTitle,children:y.shareText}),r.jsx("td",{className:"px-3 py-2",children:r.jsxs("span",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[y.issueIds.map(v=>r.jsx(sa,{to:Bj(v),className:"text-cyber-teal hover:underline font-mono text-xs",children:v.slice(0,8)},v)),y.hiddenIssueCount>0&&r.jsxs("span",{className:"font-ui-display text-xs text-white/40",children:["+",y.hiddenIssueCount," more"]})]})})]},y.code))})]})})]})]})]})]})}function Zj(){const[a,l]=Ey(),i=a.toString(),u=b.useMemo(()=>qj(i),[i]),[d,f]=b.useState(()=>Ix(i)),[m,x]=b.useState(null),[y,v]=b.useState(!0),[w,j]=b.useState(null),[D,X]=b.useState(0);b.useEffect(()=>{f(Ix(i))},[i]),b.useEffect(()=>{let L=!1;return v(!0),j(null),hS(u).then(H=>{L||(x(H),v(!1))}).catch(H=>{L||(j(H instanceof Error?H.message:String(H)),v(!1))}),()=>{L=!0}},[i,D]);const C=L=>{const H=tv($j(L));l(H?Object.fromEntries(new URLSearchParams(H)):{})},$=L=>f(H=>({...H,...L}));return r.jsxs("div",{className:"flex-1 min-h-0 px-6 py-4 w-full overflow-y-auto",children:[r.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2 mb-1",children:[r.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Execution report"}),m&&r.jsxs("p",{className:"font-ui-display text-xs text-white/40",children:["Window ",new Date(m.window.from).toLocaleDateString()," –"," ",new Date(m.window.to).toLocaleDateString()," · generated"," ",new Date(m.meta.generatedAt).toLocaleTimeString()]})]}),r.jsx("p",{className:"font-ui-display text-sm text-white/50 mb-4",children:"Reliability, latency, retry waste, and metadata coverage by role, runtime, and model. Missing cost/token data reads as N/A — never as zero."}),r.jsx("form",{"aria-label":"Report filters",className:"mb-4 p-4 rounded border border-white/10 bg-panel-elevated/60",onSubmit:L=>{L.preventDefault(),C(d)},children:r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"From"}),r.jsx("input",{type:"date",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.fromDate,onChange:L=>$({fromDate:L.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"To"}),r.jsx("input",{type:"date",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.toDate,onChange:L=>$({toDate:L.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Repository"}),r.jsx("input",{type:"text",placeholder:"github.com/owner/repo",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.repo,onChange:L=>$({repo:L.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Role"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.role,onChange:L=>$({role:L.target.value}),children:[r.jsx("option",{value:"",children:"All roles"}),Mj.map(L=>r.jsx("option",{value:L,children:L},L))]})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Runtime"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.runtime,onChange:L=>{$({runtime:L.target.value})},children:[r.jsx("option",{value:"",children:"All runtimes"}),Zx.map(L=>r.jsx("option",{value:L,children:L},L)),r.jsx("option",{value:"unknown",children:"unknown (missing metadata)"}),d.runtime&&!Zx.includes(d.runtime)&&r.jsxs("option",{value:d.runtime,children:[d.runtime," (from URL)"]})]})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Model"}),r.jsx("input",{type:"text",placeholder:"Any model",className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.model,onChange:L=>$({model:L.target.value})})]}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"font-ui-display block text-xs text-white/50 mb-1",children:"Issue status"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2",value:d.status,onChange:L=>$({status:L.target.value}),children:[r.jsx("option",{value:"",children:"All statuses"}),Dj.map(L=>r.jsx("option",{value:L,children:L},L))]})]}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsx("button",{type:"submit",className:"btn-gold px-4",children:"Apply"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm text-white/60 hover:text-white",onClick:()=>{f(Yj),l({})},children:"Reset"})]})]})}),r.jsx(Vj,{loading:y,error:w,report:m,onRetry:()=>X(L=>L+1),cohortLink:(L,H)=>Hj(i,L,H)})]})}function Kx(a,l){var d;if(!a)return"Not assigned";const i=l.find(f=>f.id===a);if(!i)return"Unavailable — profile removed";const u=`${i.name} · ${ka(i.runtime)}`;return i.healthy?u:`${u} (unhealthy: ${((d=i.issues[0])==null?void 0:d.message)??"needs attention"})`}function Jx(a,l){var u;if(!a)return;const i=l.find(d=>d.id===a);return i?`${i.name} · ${ka(i.runtime)}${i.healthy?" · healthy":` · ${((u=i.issues[0])==null?void 0:u.message)??"unhealthy"}`}`:`Configured profile ${a} is not on record (deleted?)`}function Gj({agents:a,initialRepo:l,initialDeveloperId:i,initialReviewerId:u,busy:d,onSave:f,onCancel:m}){var P,ne;const[x,y]=b.useState(l),[v,w]=b.useState(i??""),[j,D]=b.useState(u??""),X=_v(a),C=a.find(V=>V.id===v),$=a.find(V=>V.id===j),L=ku(C),H=ku($),F=x.trim()===l&&v===(i??"")&&j===(u??"");return r.jsxs("div",{className:"p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsx("p",{className:"text-xs text-white/50",children:"Edit configuration — repository, developer, and reviewer save together. Queue position is kept, readiness and the wait reason are rechecked, and the change is recorded on the timeline."}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Repository"}),r.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:x,disabled:d,placeholder:"GitHub URL or owner/repo",title:"GitHub URL or owner/repo — normalized to github.com/owner/repo, same validation as issue creation",onChange:V=>y(V.target.value)})]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Developer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:v,disabled:d,title:C?`${C.name} · ${ka(C.runtime)}${C.healthy?" · healthy":` · ${((P=C.issues[0])==null?void 0:P.message)??"unhealthy"}`}`:"Pick a developer agent",onChange:V=>w(V.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),X.map(V=>r.jsx("option",{value:V.id,title:ol(V),children:(V.healthy?"● ":"○ ")+ol(V)},V.id))]}),L&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:L})]}),r.jsxs("label",{className:"block space-y-1",children:[r.jsx("span",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Reviewer"}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:j,disabled:d,title:$?`${$.name} · ${ka($.runtime)}${$.healthy?" · healthy":` · ${((ne=$.issues[0])==null?void 0:ne.message)??"unhealthy"}`}`:"Pick a reviewer agent",onChange:V=>D(V.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),X.map(V=>V.runtime==="muse_code"?r.jsx("option",{value:V.id,disabled:!0,title:"Muse Code cannot be a reviewer (developer role only)",children:`○ ${V.name} · ${ka(V.runtime)} — reviewer not supported`},V.id):r.jsx("option",{value:V.id,title:ol(V),children:(V.healthy?"● ":"○ ")+ol(V)},V.id))]}),H&&r.jsx("span",{className:"text-xs text-amber-200/80 block",children:H})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:d||!x.trim()||!v||!j||F,title:"Save via the issue PATCH contract — keeps queue position, rechecks readiness and the wait reason",onClick:()=>f(x.trim(),v,j),children:"Save configuration"}),r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm text-white/60 hover:text-white disabled:opacity-50",disabled:d,onClick:m,children:"Cancel"})]})]})}function Qj({issue:a,agents:l,canEdit:i,editing:u,busy:d,onBeginEdit:f,onSave:m,onCancel:x}){return r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1.5",children:[r.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Configuration"}),r.jsxs("p",{className:"text-sm text-white/85",title:`Exact repository identity: ${a.repo}`,children:[r.jsx("span",{className:"text-white/45",children:"Repository "}),a.repo]}),r.jsxs("p",{className:"text-sm text-white/85",title:Jx(a.developerAgentId,l),children:[r.jsx("span",{className:"text-white/45",children:"Developer "}),Kx(a.developerAgentId,l)]}),r.jsxs("p",{className:"text-sm text-white/85",title:Jx(a.reviewerAgentId,l),children:[r.jsx("span",{className:"text-white/45",children:"Reviewer "}),Kx(a.reviewerAgentId,l)]}),i&&!u&&r.jsx("button",{type:"button",className:"text-xs text-cyber-teal hover:underline disabled:opacity-50",disabled:d,onClick:f,children:"Edit configuration"}),i&&u&&r.jsx(Gj,{agents:l,initialRepo:a.repo,initialDeveloperId:a.developerAgentId,initialReviewerId:a.reviewerAgentId,busy:d,onSave:m,onCancel:x})]})}function Xj({contract:a}){return r.jsxs("section",{"aria-label":"Execution contract",className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Execution contract"}),r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-cyber-teal/40 text-cyber-teal",children:a.version}),r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 text-white/70",children:a.executionMode})]}),r.jsxs("div",{className:"text-sm text-white/85 space-y-1.5",children:[r.jsxs("p",{children:[r.jsx("span",{className:"text-white/45",children:"Exit predicate: "}),a.exitPredicate]}),r.jsxs("p",{children:[r.jsx("span",{className:"text-white/45",children:"One-PR stopping point: "}),a.onePrStoppingPoint]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45",children:"Non-goals:"}),r.jsx("ul",{className:"list-disc pl-5 text-white/75",children:a.nonGoals.map(l=>r.jsx("li",{children:l},l))})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45",children:"Acceptance criteria:"}),r.jsx("ul",{className:"space-y-1",children:a.acceptanceCriteria.map(l=>r.jsxs("li",{children:[r.jsxs("p",{className:"text-white/80",children:["☐ ",l.text]}),l.evidence&&r.jsxs("p",{className:"pl-5 text-xs text-white/55",children:["Evidence: ",l.evidence]})]},l.text))})]})]}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Compiled from the ticket description — edit the description to change it."})]})}function Ij(a){return a===void 0?"unknown size":`${a.toLocaleString("en-US")} bytes`}function Kj({attachments:a}){if(!(a!=null&&a.length))return null;const l=a.filter(u=>u.kind==="file"),i=a.filter(u=>u.kind==="link");return r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1","data-testid":"source-attachments",children:[r.jsx("p",{className:"text-xs text-white/45 font-medium uppercase tracking-wide",children:"Source attachments"}),l.map(u=>r.jsxs("p",{className:"text-sm text-white/85","data-testid":"source-attachment-file",children:[r.jsx("span",{className:"text-cyber-teal",children:"file"})," ",u.safeFileName??u.title,r.jsxs("span",{className:"text-white/45",children:[" ","· ",Ij(u.sizeBytes),u.sha256?` · sha256:${u.sha256.slice(0,16)}…`:"",u.contentType?` · ${u.contentType}`:""]})]},u.linearAttachmentId)),i.map(u=>r.jsxs("p",{className:"text-sm text-white/85","data-testid":"source-attachment-link",children:[r.jsx("span",{className:"text-amber-300",children:"link"})," ",u.title,r.jsxs("span",{className:"text-white/45",children:[" ","· ",u.url,u.subtitle?` · ${u.subtitle}`:""]})]},u.linearAttachmentId)),r.jsx("p",{className:"text-xs text-white/40",children:"Files are Dealer-stored snapshots — the Builder reads local bytes, never the expiring Linear URL. Links are metadata only, never downloaded. Files uploaded only inside Linear comments are not imported."})]})}function uu(a){return a==="developer"?"Developer":a==="reviewer"?"Reviewer":"Worker"}const gd={"issue.created":()=>"Issue created","issue.reassigned":()=>"Configuration updated","issue.source_reloaded":()=>"Task text reloaded from Linear","workflow.started":()=>"Workflow started","worker.started":a=>`${uu(a.actorType)} started${a.round?` (round ${a.round})`:""}`,"worker.completed":a=>`${uu(a.actorType)} finished${a.round?` (round ${a.round})`:""}`,"worker.failed":a=>`${uu(a.actorType)} failed${a.round?` (round ${a.round})`:""}`,"worker.deferred":a=>{var l;return((l=Os(a.payloadJson))==null?void 0:l.outcome)==="deck_unavailable"?`Waiting for Agent Deck${a.round?` (round ${a.round})`:""}`:`${uu(a.actorType)} deferred${a.round?` (round ${a.round})`:""}`},"worktree.ready":()=>"Worktree ready","worktree.deps_ready":()=>"Dependencies ready","deck.connected":()=>"Deck connected","brief.resolved":()=>"Brief resolved","base.probe":a=>{var i;const l=(i=Os(a.payloadJson))==null?void 0:i.result;return l==="conflict"?"Base conflict found before publish":l==="skipped"?"Base conflict probe skipped":l==="deferred"?"Base conflict probe waiting on base fetch":l==="failed"?"Base conflict probe failed; not published":"Base conflict probe clean"},"branch.pushed":()=>"Branch pushed","checks.started":()=>"Checks started","pull_request.opened":()=>"Developer opened the PR","pull_request.updated":()=>"Developer updated the PR","checks.completed":()=>"Checks completed","review.submitted":()=>"Reviewer submitted a review","repair.started":a=>`Repair round ${a.round??"?"} started`,"guidance.added":()=>"Guidance added","task_snapshot.refreshed":()=>"Task snapshot refreshed","human_action.requested":()=>"Human action requested","human_action.resolved":()=>"Human action resolved","final_review.requested":()=>"Final review requested","issue.completed":()=>"Issue completed","issue.closed":()=>"Issue closed"};function Os(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}const Jj={approved:"text-cyber-teal",changes_requested:"text-amber-300",escalated:"text-red-300"};function Fj({e:a}){var l;if(a.type==="pull_request.opened"||a.type==="pull_request.updated"){const i=Os(a.payloadJson);return a.artifactRef?r.jsxs("a",{href:a.artifactRef,target:"_blank",rel:"noreferrer",className:"text-sm text-cyber-teal hover:underline",children:["PR ",i!=null&&i.prNumber?`#${i.prNumber}`:""," ",i!=null&&i.branch?`(${i.branch})`:""]}):null}if(a.type==="review.submitted"){const i=Os(a.payloadJson);return i?r.jsxs("span",{className:"text-sm",children:[r.jsx("span",{className:Jj[i.verdict]??"text-white/70",children:i.verdict.replace("_"," ")}),(l=i.findings)!=null&&l.length?` · ${i.findings.length} finding(s)`:""]}):null}if(a.type==="guidance.added"){const i=Os(a.payloadJson);return i!=null&&i.markdown?r.jsxs("span",{className:"text-sm text-white/55 italic",children:["— ",i.markdown]}):null}if(a.type==="worker.started"||a.type==="worker.completed"||a.type==="worker.failed"||a.type==="worker.deferred"||a.type==="worktree.ready"||a.type==="deck.connected"||a.type==="brief.resolved"||a.type==="branch.pushed"||a.type==="checks.started"||a.type==="checks.completed"){const i=Os(a.payloadJson);if(!i)return null;const u=[];return i.runtime&&u.push(i.runtime),i.model&&u.push(i.model),i.sessionId&&u.push(i.sessionId.slice(0,8)),i.worktreePath&&u.push(i.worktreePath),i.resolution&&u.push(i.resolution),i.branch&&u.push(i.branch),i.commitsAhead!=null&&u.push(`${i.commitsAhead} ahead`),i.snapshot&&u.push(i.snapshot),(a.type==="worker.deferred"||a.type==="worker.failed")&&(i.reason&&u.push(i.reason),a.type==="worker.deferred"&&i.until&&u.push(`until ${new Date(i.until).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`)),u.length===0?null:r.jsxs("span",{className:"text-xs text-white/40",children:["· ",u.join(" · ")]})}return null}function Wj(a){var l;return((l=gd[a.type])==null?void 0:l.call(gd,a))??a.type}const Fx={human:"You",system:"System",developer:"Developer",reviewer:"Reviewer"},Pj={human:"bg-cyber-teal/15 text-cyber-teal",system:"bg-white/10 text-white/50",developer:"bg-cyber-violet/20 text-cyber-violet-light",reviewer:"bg-[#C4B643]/25 text-[#E8DC7A]"};function eN(a){return a.actorRef?`${Fx[a.actorType]} · ${a.actorRef}`:Fx[a.actorType]}function tN({events:a}){return a.length===0?r.jsx("p",{className:"text-white/40 text-sm",children:"No activity yet."}):r.jsx("div",{className:"space-y-1",children:a.map(l=>r.jsxs("div",{className:"flex items-baseline gap-3 py-1.5 border-b border-white/5 last:border-0",children:[r.jsx("span",{className:"text-xs text-white/35 w-20 shrink-0 tabular-nums",children:new Date(l.ts).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),r.jsx("span",{className:`text-[11px] leading-none px-1.5 py-0.5 rounded shrink-0 ${Pj[l.actorType]}`,children:eN(l)}),r.jsx("span",{className:"text-sm text-white/80",children:Wj(l)}),r.jsx(Fj,{e:l})]},l.id))})}function Ba(a){if(a==null||!Number.isFinite(a))return null;if(a<1e3)return"<1s";const l=Math.round(a/1e3);if(l<60)return`${l}s`;const i=Math.floor(l/60);if(i<60){const f=l%60;return f===0?`${i}m`:`${i}m ${f}s`}const u=Math.floor(i/60),d=i%60;return d===0?`${u}h`:`${u}h ${d}m`}function Wx(a){return a==null||!Number.isFinite(a)?null:`${Math.round(a).toLocaleString("en-US")} tokens`}function aN(a){return a==null||!Number.isFinite(a)?null:`$${a.toFixed(2)}`}const nN={queue_wait:"Queue / admission wait",coordinator_setup:"Setup",agent_process:"Agent process",coordinator_validation_publish:"Validation / publish",coordinator_work:"Coordinator work"},Px={model_provider_wait:"Silent · waiting on model provider",tool_or_subprocess_in_flight:"Silent · tool/subprocess in flight",host_suspended:"Silent · host suspended",no_structured_output:"Silent · no structured output yet",unknown:"Silent · unknown cause"},Hd={worktree:"worktree",commit:"commit",verification_receipt:"verification receipt",publish_only:"publish-only result"},lN=new Set(["failed","timed_out","error"]);function cf(a){return a.replace(/_/g," ")}function Yi(a,l){const i=`Evidence quality: ${a}`;return l.length>0?`${i} — ${l.join(", ")}`:i}function Na({quality:a,reasons:l}){return r.jsxs("span",{className:`text-[11px] tabular-nums ${a==="exact"?"text-white/60":a==="inferred"?"text-amber-300/90":"text-white/60 italic"}`,title:Yi(a,l),children:["· ",a,l.length>0&&r.jsxs("span",{className:"sr-only",children:[" (",l.join(", "),")"]})]})}function ul({reasons:a}){const l=a.length>0?a.join(", "):"no reason recorded";return r.jsxs("span",{className:"text-white/45 italic",title:`Unavailable — ${l}`,children:["Unavailable",r.jsxs("span",{className:"text-[11px]",children:[" — ",l]})]})}function ou({covered:a,format:l,unit:i}){if(a.value==null)return r.jsx(ul,{reasons:a.reasons});const u=a.known<a.total;return r.jsxs("span",{title:`${Yi(a.quality,a.reasons)} · known ${a.known} of ${a.total} ${i}`,children:[l(a.value),r.jsx(Na,{quality:a.quality,reasons:a.reasons}),u&&r.jsxs("span",{className:"text-[11px] text-white/60",title:`Known for ${a.known} of ${a.total} ${i}`,children:[" ","(known ",a.known," of ",a.total,")"]})]})}function ey({cause:a,primary:l}){return r.jsxs("div",{className:l?"p-2.5 rounded border border-red-400/30 bg-red-500/10 space-y-1":"p-2 rounded border border-white/10 bg-white/[0.02] space-y-1",children:[r.jsxs("p",{className:l?"text-sm font-medium text-red-200":"text-xs text-white/60",children:[l?"First failure: ":"Consequence: ",cf(a.code)]}),r.jsx("p",{className:l?"text-sm text-white/85 whitespace-pre-wrap break-words":"text-xs text-white/55 whitespace-pre-wrap break-words",children:a.rawReason}),r.jsxs("p",{className:"text-[11px] text-white/60",title:Yi(a.quality==="exact"?"exact":"inferred",[`evidence: ${a.evidenceSource}`,`confidence: ${a.confidence}`]),children:[a.domain," · ",a.confidence," confidence · via ",a.evidenceSource.replace(/_/g," ")," · ",a.quality,a.occurredAt?` · ${new Date(a.occurredAt).toLocaleString()}`:""]})]})}function sN({interval:a}){const l=Px[a.category??"unknown"]??Px.unknown,i=Ba(a.durationMs),u=a.category==="host_suspended";return r.jsxs("li",{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5 py-1 border-b border-white/5 last:border-0 ${u?"text-amber-200/90":"text-white/70"}`,children:[r.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded border shrink-0 ${u?"border-amber-400/40 bg-amber-500/10":"border-white/15 bg-white/5"}`,title:u?"Overlapping durable host-sleep evidence split this gap — the host was suspended, not the agent.":"Observational gap with no new structured activity — not a diagnosis of what the agent was doing.",children:l}),r.jsx("span",{className:"text-xs tabular-nums",children:i??r.jsx(ul,{reasons:a.reasons})}),r.jsx(Na,{quality:a.quality,reasons:a.reasons})]})}function iN({attempt:a}){const l=a.reuseKinds;return l===void 0?r.jsx("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60 italic",title:"Reuse unknown for this retry — no reuse evidence recorded.",children:"reuse unknown"}):l.length===0?r.jsx("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60",title:"Cold retry — no prior worktree, commit, or verification was reused.",children:"cold retry"}):r.jsx(r.Fragment,{children:l.map(i=>r.jsxs("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-cyber-teal/40 bg-cyber-teal/10 text-cyber-teal",title:`This retry preserved the prior ${Hd[i]??i} instead of starting cold.`,children:["reused ",Hd[i]??i]},i))})}function rN({attempt:a,isRetry:l}){const i=Ba(a.setup.durationMs),u=Ba(a.agentProcess.durationMs),d=Ba(a.validationPublish.durationMs),f=l&&a.role==="developer";return r.jsxs("li",{className:"py-1.5 border-b border-white/5 last:border-0 space-y-0.5",children:[r.jsxs("p",{className:"text-sm text-white/85",children:[r.jsx("span",{className:"capitalize",children:a.role}),r.jsxs("span",{className:"text-white/45",children:[a.runtime?` · ${a.runtime}`:"",a.model?` · ${a.model}`:"",` · round ${a.round} · ${a.status}`]}),a.publishOnly&&r.jsx("span",{className:"ml-2 text-[11px] px-1.5 py-0.5 rounded border border-cyber-violet/40 bg-cyber-violet/10 text-cyber-violet-light",title:"Publish-only attempt: no agent process ran — the coordinator published prior work.",children:"publish-only"}),f&&!a.publishOnly&&r.jsx(iN,{attempt:a})]}),r.jsxs("p",{className:"text-xs text-white/50 tabular-nums",children:[r.jsxs("span",{title:i?void 0:`Setup unavailable — ${a.setup.reasons.join(", ")||"no reason recorded"}`,children:["Setup ",i??r.jsxs("span",{className:"italic",children:["Unavailable — ",a.setup.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(Na,{quality:a.setup.quality,reasons:a.setup.reasons})," · ",r.jsxs("span",{title:u?void 0:`Agent process unavailable — ${a.agentProcess.reasons.join(", ")||"no reason recorded"}`,children:["Agent ",u??r.jsxs("span",{className:"italic",children:["Unavailable — ",a.agentProcess.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(Na,{quality:a.agentProcess.quality,reasons:a.agentProcess.reasons})," · ",r.jsxs("span",{title:d?void 0:`Validation/publish unavailable — ${a.validationPublish.reasons.join(", ")||"no reason recorded"}`,children:["Validation/publish ",d??r.jsxs("span",{className:"italic",children:["Unavailable — ",a.validationPublish.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(Na,{quality:a.validationPublish.quality,reasons:a.validationPublish.reasons})]}),a.failureCauses.length>0&&r.jsxs("p",{className:"text-[11px] text-white/60",children:["Failures: ",a.failureCauses.map(m=>cf(m.code)).join(", ")]})]})}function uN({analysis:a}){const l=Ba(a.elapsed.durationMs),i=Ba(a.exclusiveTotalMs),u=Ba(a.firstCheckpoint.msSinceWorkflowStart),d=a.nested.filter(C=>C.kind!=="unexplained_silence"),f=a.attempts.flatMap(C=>C.silence),m=a.attempts.length>0&&a.attempts.every(C=>C.silence.length===0&&C.silenceQuality==="unavailable"),x=a.attempts.filter(C=>C.silence.length===0&&C.silenceQuality==="unavailable"),y=a.waste.failedAttempts>0||a.waste.publishOnlyAttempts>0||a.attempts.some(C=>C.failureCauses.length>0||lN.has(C.status)),v=Ba(a.humanWaitMs),w=a.retry.reuseRate==null?null:`${Math.round(a.retry.reuseRate*100)}% reused`,D=(a.retry.preservedKinds??[]).map(C=>Hd[C]??C),X=a.waste.failedAttempts>0||a.waste.publishOnlyAttempts>0;return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsxs("p",{className:"text-sm text-white/85 tabular-nums",children:["Elapsed ",l??r.jsx(ul,{reasons:a.elapsed.reasons}),r.jsx(Na,{quality:a.elapsed.quality,reasons:a.elapsed.reasons})]}),r.jsxs("p",{className:"text-xs text-white/45 tabular-nums",title:"Unioned top-level phases with overlaps removed (human wait excluded). Nested waits below explain phases — they are never added to this total.",children:["Exclusive phase total ",i??r.jsx(ul,{reasons:a.exclusiveTotalReasons}),r.jsx(Na,{quality:a.exclusiveTotalQuality,reasons:a.exclusiveTotalReasons}),r.jsx("span",{children:" · overlaps unioned, not summed"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Phase breakdown"}),r.jsx("ul",{children:a.unionedDurations.map(C=>{const $=Ba(C.durationMs);return r.jsxs("li",{className:"flex flex-wrap items-baseline gap-x-2 py-0.5 text-sm",children:[r.jsx("span",{className:"text-white/70 w-36 shrink-0",children:nN[C.phase]??C.phase}),r.jsx("span",{className:"text-white/85 tabular-nums",children:$??r.jsx(ul,{reasons:C.reasons})}),r.jsx(Na,{quality:C.quality,reasons:C.reasons}),C.known<C.total&&r.jsxs("span",{className:"text-[11px] text-white/60",children:["(known ",C.known," of ",C.total,")"]})]},C.phase)})}),r.jsxs("p",{className:"text-xs text-white/45 tabular-nums mt-1",children:["Human wait ",v??r.jsx(ul,{reasons:a.humanWaitReasons}),r.jsx(Na,{quality:a.humanWaitQuality,reasons:a.humanWaitReasons}),r.jsx("span",{title:"Human wait is tracked separately — it never adds to the phase total.",children:" · never additive"})]}),d.length>0&&r.jsx("ul",{className:"mt-1",children:d.map((C,$)=>r.jsxs("li",{className:"text-xs text-white/50 tabular-nums",children:[r.jsxs("span",{title:"Nested drill-down: explains its parent phase, never adds to the total.",children:["↳ ",C.kind==="human_wait"?"Human wait":C.category??C.kind]})," ",Ba(C.durationMs)??r.jsx(ul,{reasons:C.reasons}),r.jsx(Na,{quality:C.quality,reasons:C.reasons})]},$))})]}),r.jsxs("div",{children:[r.jsxs("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:["Attempts (",a.attempts.length,")"]}),a.attempts.length===0?r.jsx("p",{className:"text-xs text-white/45 italic",children:"No attempts recorded yet."}):r.jsx("ul",{children:a.attempts.map((C,$)=>r.jsx(rN,{attempt:C,isRetry:$>0},C.sessionId))})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Failure"}),a.primaryFailure?r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ey,{cause:a.primaryFailure,primary:!0}),a.consequenceCauses.length>0&&r.jsx("div",{className:"space-y-1 opacity-80",children:a.consequenceCauses.map((C,$)=>r.jsx(ey,{cause:C,primary:!1},`${C.code}-${$}`))})]}):y?r.jsxs("p",{className:"text-sm text-white/60 italic",title:Yi("unavailable",a.primaryFailureReasons),children:["Unknown — ",a.primaryFailureReasons.join(", ")||"no failure evidence recorded"]}):r.jsx("p",{className:"text-sm text-white/45",children:"No failure recorded."})]}),r.jsxs("div",{children:[r.jsxs("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:["Retry waste (",a.waste.failedAttempts," failed attempt",a.waste.failedAttempts===1?"":"s",")"]}),X?r.jsxs("p",{className:"text-sm text-white/85 flex flex-wrap gap-x-3 gap-y-0.5 tabular-nums",children:[r.jsxs("span",{title:"Failed-attempt agent-process time over known values only",children:["Runtime ",r.jsx(ou,{covered:a.waste.runtimeMs,format:C=>Ba(Math.round(C))??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt input tokens over known values only",children:["In ",r.jsx(ou,{covered:a.waste.tokensIn,format:C=>Wx(C)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt output tokens over known values only",children:["Out ",r.jsx(ou,{covered:a.waste.tokensOut,format:C=>Wx(C)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt known cost over known values only",children:["Cost ",r.jsx(ou,{covered:a.waste.costUsd,format:C=>aN(C)??"?",unit:"attempts"})]})]}):r.jsx("p",{className:"text-sm text-white/45",children:"No failed attempts — no retry waste."})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"First checkpoint"}),a.firstCheckpoint.msSinceWorkflowStart==null&&a.firstCheckpoint.kind==null?r.jsxs("p",{className:"text-sm text-white/60 italic",title:Yi(a.firstCheckpoint.quality,a.firstCheckpoint.reasons),children:["Unavailable — ",a.firstCheckpoint.reasons.join(", ")||"no checkpoint recorded"]}):r.jsxs("p",{className:"text-sm text-white/85 tabular-nums",children:[a.firstCheckpoint.kind?cf(a.firstCheckpoint.kind):"Checkpoint",a.firstCheckpoint.observedSha?` · ${a.firstCheckpoint.observedSha.slice(0,12)}`:"",u?` · ${u} after workflow start`:"",r.jsx(Na,{quality:a.firstCheckpoint.quality,reasons:a.firstCheckpoint.reasons})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Retry reuse"}),r.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"Retry reuse summary",children:[r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-cyber-teal/40 bg-cyber-teal/10 text-cyber-teal",title:"Retries that preserved prior work — a reused worktree, commit, or verification receipt.",children:["Reused ",a.retry.reused]}),r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60",title:"Retries that started cold — no prior worktree, commit, or verification was reused.",children:["Cold ",a.retry.cold]}),a.retry.unknown>0&&r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 bg-white/5 text-white/60 italic",title:`Unknown reuse for ${a.retry.unknown} retr${a.retry.unknown===1?"y":"ies"} — ${a.retry.reasons.join(", ")||"no reuse evidence"}.`,children:["Unknown ",a.retry.unknown]}),a.retry.publishOnly>0&&r.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-cyber-violet/40 bg-cyber-violet/10 text-cyber-violet-light",title:"Publish-only retries ran no agent process — the coordinator published already-verified work.",children:["Publish-only ",a.retry.publishOnly]}),r.jsxs("span",{className:"text-[11px] text-white/60 tabular-nums self-center",children:[a.retry.retries===0?"No retries":w??r.jsx(ul,{reasons:a.retry.reasons}),r.jsx(Na,{quality:a.retry.quality,reasons:a.retry.reasons})]})]}),r.jsx("p",{className:"text-[11px] text-white/60 mt-0.5",children:a.retry.retries===0?"No retries — nothing to preserve.":D.length>0?`Preserved: ${D.join(", ")}.`:a.retry.unknown>0?`Preservation unknown for ${a.retry.unknown} retr${a.retry.unknown===1?"y":"ies"} — no reuse evidence.`:"No prior work preserved — every retry started cold."})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Silence"}),r.jsx("p",{className:"text-[11px] text-white/60 mb-1",children:"Silence is observational — gaps with no new structured activity. It describes what was observed, never a diagnosis."}),f.length===0?m?r.jsx("p",{className:"text-sm text-white/60 italic",children:"Unknown — silence cannot be derived without agent-process bounds."}):r.jsx("p",{className:"text-sm text-white/45",children:"No silence observed."}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{"aria-label":"Observed silence intervals",children:f.map((C,$)=>r.jsx(sN,{interval:C},$))}),x.length>0&&r.jsx("ul",{"aria-label":"Attempts with unknown silence",className:"mt-1",children:x.map(C=>r.jsxs("li",{className:"text-[11px] text-white/60 italic py-0.5",children:["Silence unknown for attempt ",C.sessionId.length>12?`${C.sessionId.slice(0,8)}…`:C.sessionId," —"," ",C.silenceReasons.join(", ")||"no silence evidence recorded"]},C.sessionId))})]})]})]})}function oN({issueId:a}){const[l,i]=b.useState(null),[u,d]=b.useState(null),[f,m]=b.useState(!0);return b.useEffect(()=>{i(null),d(null),m(!0);let x=!1;return eS(a).then(y=>{x||(i(y),m(!1))}).catch(y=>{x||(/not found/i.test(String(y))?(i(null),d(null)):d(String(y).replace(/^Error:\s*/i,"")),m(!1))}),()=>{x=!0}},[a]),r.jsxs("section",{"aria-labelledby":"execution-analysis-heading",className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03]",children:[r.jsx("h3",{id:"execution-analysis-heading",className:"font-ui-display text-sm font-medium text-white/85 mb-2",children:"Execution analysis"}),f&&r.jsx("p",{className:"text-xs text-white/40",children:"Loading execution analysis…"}),!f&&u&&r.jsx("p",{className:"text-xs text-red-300",children:u}),!f&&!u&&!l&&r.jsx("p",{className:"text-xs text-white/45",children:"No execution analysis yet — start the workflow to see where time goes."}),!f&&!u&&l&&r.jsx(uN,{analysis:l})]})}const cN="web";function dN(a){try{const l=JSON.parse(a);return typeof l.text=="string"?l.text:JSON.stringify(l,null,2)}catch{return a}}function bd(a){const l=Math.floor(a/6e4);return l<60?`${l}m`:`${Math.floor(l/60)}h ${l%60}m`}function fN(a){if(!a)return"no heartbeat yet";const l=Math.max(0,Math.floor((Date.now()-new Date(a).getTime())/1e3));return l<5?"just now":l<60?`${l}s ago`:`${Math.floor(l/60)}m ago`}function Ui(a){if(!a)return null;const l=a.split(/[/\\]/).filter(Boolean);return l.length<=2?a:l.slice(-2).join("/")}function wd(a){var l;return[a.branch,a.tipLabel,(l=a.worktree)!=null&&l.path?Ui(a.worktree.path):null].filter(Boolean).join(" · ")}function Sd(a){var l;return[a.restartRisk?"restart risk":null,(l=a.worktree)!=null&&l.preserved?"dirty worktree preserved":null].filter(Boolean).map(i=>` · ${i}`).join("")}function jd(a){var l;return!!(a.restartRisk||(l=a.worktree)!=null&&l.preserved)}function hN(a,l){return!a||!l?!1:a===l?!0:a.includes(l)}function mN({busy:a,onConfirm:l,onCancel:i}){return r.jsxs("div",{className:"mt-2 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[r.jsx("p",{className:"text-sm text-white/90 font-medium",children:"Close this issue?"}),r.jsx("p",{className:"text-sm text-white/70",children:"It will not execute. Any queue entry will be removed. History is retained and can be found as closed work — filter the Issues list by status closed or open this page directly."}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm rounded border border-red-400/50 text-red-200 hover:bg-red-500/20 disabled:opacity-50",disabled:a,onClick:l,children:"Close issue"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:i,children:"Keep issue"})]})]})}function pN(a){return a.externalLabel??a.id}function xN(a,l){return a===l}function yN({expectedToken:a,externalLabel:l,busy:i,onConfirm:u,onCancel:d}){const[f,m]=b.useState(""),x=xN(f,a);return r.jsxs("div",{className:"mt-2 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[r.jsx("p",{className:"text-sm text-white/90 font-medium",children:"Delete this issue from Dealer?"}),r.jsxs("p",{className:"text-sm text-white/70",children:["This permanently deletes the Dealer-local issue — its history, evidence, and files cannot be recovered.",l?` The Linear ticket ${l} will not be deleted.`:" There is no linked Linear ticket to affect."]}),r.jsxs("label",{className:"block text-xs text-white/60",children:["Type ",r.jsx("span",{className:"font-mono text-white/85",children:a})," to confirm",r.jsx("input",{className:"mt-1 block w-full bg-black/30 border border-white/10 rounded px-3 py-1.5 text-sm text-white/90 font-mono",value:f,onChange:y=>m(y.target.value),placeholder:a,autoComplete:"off"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm rounded border border-red-400/50 text-red-200 hover:bg-red-500/20 disabled:opacity-50",disabled:i||!x,onClick:u,children:"Delete from Dealer"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:d,children:"Keep issue"})]})]})}function vN(a){const l=a.externalLabel??a.issueId,i=a.residualPaths.length>0?` ${a.residualPaths.length} Dealer-owned file(s) could not be removed: ${a.residualPaths.join(", ")}`:"";return a.externalLabel?`Issue ${l} deleted from Dealer. The Linear ticket was not deleted.${i}`:`Issue ${l} permanently deleted from Dealer.${i}`}async function gN(a,l,i){try{const u=await i.removeIssue(a),d=vN({issueId:a,externalLabel:l.externalLabel,residualPaths:u.residualPaths});return i.closeConfirmation(),i.onHumanActionsChanged(),i.navigateToIssues(d),"deleted"}catch(u){return i.closeConfirmation(),i.reportError(u),i.refresh(),"refused"}}const bN="Agents updated. Resume to continue with the new agents.";function wN(a,l,i,u){const d={};return i!==(a??"")&&(d.developerAgentId=i),u!==(l??"")&&(d.reviewerAgentId=u),d}function SN(a){const l=a.humanActions.find(i=>i.status==="open");if(l)return Iy(l).title;switch(a.issue.currentOwner){case"developer":return"Waiting on the developer";case"reviewer":return"Waiting on the reviewer";case"human":return"Waiting on you";default:return a.issue.status==="done"||a.issue.status==="closed"?"Complete":"Idle"}}function jN({issueId:a,detail:l,agents:i,onHumanActionsChanged:u,refresh:d,onError:f}){var wt;const[m,x]=b.useState(null),[y,v]=b.useState({}),[w,j]=b.useState(""),[D,X]=b.useState(!1),[C,$]=b.useState(""),[L,H]=b.useState(""),[F,P]=b.useState(""),[ne,V]=b.useState(!1),[_e,I]=b.useState(null),[ye,Ue]=b.useState(!1),[gt,At]=b.useState(null),[rt,mt]=b.useState(!1),[nt,Ge]=b.useState(!1),U=Ou(),[J,ue]=b.useState(!1),[Ce,De]=b.useState(null),[N,Y]=b.useState({}),[W,te]=b.useState({}),re=Z=>f(String(Z)),{issue:z,timeline:de,humanActions:Qe,usageSummary:ze,readiness:Bt,humanWaitMs:Ra,interventionCount:ra,latestWorkflowInstance:Ya,activeWorkerSession:qe,liveProgress:Va,latestSessionFailure:ct,branchTipStatus:bt,queued:Rn,queueEntry:Ye,capWait:Za,pendingSnapshotChangedFields:Tn}=l,an=i.find(Z=>Z.id===z.developerAgentId),nn=an&&!an.healthy,tt=((wt=an==null?void 0:an.issues[0])==null?void 0:wt.message)??"Developer agent is unhealthy",dl=Ya?new Date(Ya.completedAt??Date.now()).getTime()-new Date(Ya.startedAt).getTime():0,ke=Qe.filter(Z=>Z.status==="open"),fl=z.status==="needs_human"&&ke.some(Z=>Z.actionType==="attempts_exhausted"||Z.actionType==="policy_escalation"),Ga=(qe==null?void 0:qe.status)==="running",On=ke.some(Z=>Z.actionType==="product_scope_decision"),Yt=Ya!=null&&Ya.completedAt===null,Yl=Bt.ok===!1||On&&!Ga,qs=z.status==="ready"&&!Yt,Qa=Yl||qs,at=z.source==="linear"&&!Ga&&(z.status==="ready"&&!Yt||z.status==="needs_human"&&Yt&&On),Ut=z.status==="needs_human"&&Yt&&On,pt=Tn??[],ua=Ut&&pt.length>0,Pe=z.status==="ready"&&!Yt,Ln=(z.status==="ready"||z.status==="done"||z.status==="closed")&&!Yt,Xa=z.status==="ready"&&!Yt,Ta=qe&&qe.status==="running"&&(z.status==="developing"||z.status==="reviewing"||z.status==="repairing"),Oa=!!ct&&!Ta,oa=async()=>{w.trim()&&(await fS(a,w),j(""),d())},Mn=()=>{$(z.title),H(z.description??""),P(z.acceptanceCriteria??""),X(!0)},ln=async()=>{V(!0),f(null);try{await mu(a,{title:C.trim()||void 0,description:L.trim()||null,acceptanceCriteria:F.trim()||null}),X(!1),d()}catch(Z){re(Z)}finally{V(!1)}},Tt=async()=>{V(!0),f(null);try{await lS(a),ue(!1),d()}catch(Z){ue(!1),re(Z),d()}finally{V(!1)}},hl=async()=>{V(!0),f(null);try{const Z=await ov(a);I(Z.state==="admitted"?null:`Queued at position ${Z.position}${Z.waitReason?` — ${Z.waitReason}`:""}`),d()}catch(Z){re(Z)}finally{V(!1)}},ml=async()=>{V(!0),f(null);try{await oS(a),d()}catch(Z){re(Z)}finally{V(!1)}},sn=async()=>{V(!0),f(null);try{await cv(a),I(null),Ue(!1),d()}catch(Z){re(Z),d()}finally{V(!1)}},Hs=async(Z,Se,lt)=>{V(!0),f(null);try{await mu(a,{repo:Z,developerAgentId:Se,reviewerAgentId:lt}),Ue(!1),d()}catch(E){Ue(!1),re(E),d()}finally{V(!1)}},Vl=async(Z,Se)=>{V(!0),f(null);try{await mu(a,wN(z.developerAgentId,z.reviewerAgentId,Z,Se)),At(bN),d()}catch(lt){re(lt),d()}finally{V(!1)}},Zl=async()=>{V(!0),f(null);try{await iS(a),u(),d()}catch(Z){re(Z)}finally{V(!1)}},pl=async()=>{V(!0),f(null);try{await dv(a),d()}catch(Z){re(Z)}finally{V(!1)}},Dn=async()=>{V(!0),f(null);try{await rS(a),mt(!1),De("Issue closed — it will not execute. History is retained and can be found as closed work."),d()}catch(Z){re(Z)}finally{V(!1)}},xl=async()=>{V(!0),f(null);try{await gN(a,{externalLabel:z.externalLabel},{removeIssue:uS,navigateToIssues:Z=>U("/issues",{state:{deletedNotice:Z}}),onHumanActionsChanged:u,closeConfirmation:()=>Ge(!1),reportError:Z=>re(Z),refresh:d})}finally{V(!1)}},Gl=async()=>{if(confirm("Abort this workflow? The current worker will stop and the issue will close. History and evidence are kept.")){V(!0),f(null);try{await sS(a),d()}catch(Z){re(Z)}finally{V(!1)}}},La=async(Z,Se,lt)=>{V(!0),f(null);try{await fv(Z,cN,Se,lt),u(),d()}catch(E){re(E)}finally{V(!1)}},ca=()=>{m||tS(a).then(x).catch(Z=>re(Z))},dt=Z=>{y[Z]||(v(Se=>({...Se,[Z]:{content:"",loading:!0}})),aS(a,Z).then(Se=>v(lt=>({...lt,[Z]:{content:Se.content,loading:!1}}))).catch(Se=>v(lt=>({...lt,[Z]:{content:"",loading:!1,error:String(Se)}}))))};return r.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",children:r.jsxs("div",{className:"max-w-3xl",children:[r.jsx(sa,{to:"/issues",className:"font-ui-display inline-block text-sm text-white/50 hover:text-white mb-3",children:"← Issues"}),r.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-white/90",children:z.title}),r.jsxs("p",{className:"text-xs text-white/45 mt-1",children:["Owner: ",r.jsx("span",{className:"capitalize",children:z.currentOwner}),z.currentIntent?` · ${z.currentIntent}`:""]}),r.jsxs("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-white/40",children:[z.prUrl&&r.jsxs("a",{href:z.prUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:["PR #",z.prNumber]}),z.externalUrl&&r.jsx("a",{href:z.externalUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:z.externalLabel??"External link"}),r.jsxs("span",{children:["Round ",z.currentRound,"/",z.maxReviewRounds]}),r.jsxs("span",{children:["Infra attempts ",z.infraAttempts,"/",z.maxInfraAttempts]}),r.jsxs("span",{title:"Wall-clock time from workflow start to completion (or now)",children:[bd(dl)," elapsed"]}),r.jsxs("span",{title:`${ze.totalTokensIn} in / ${ze.totalTokensOut} out tokens`,children:["$",ze.totalCostUsd.toFixed(2)]}),Ra>0&&r.jsxs("span",{title:"Time spent waiting on a human, excluding autonomous processing",children:[bd(Ra)," human wait"]}),ra>0&&r.jsxs("span",{children:[ra," intervention",ra===1?"":"s"]})]})]}),r.jsx(bv,{status:z.status})]}),Ce&&r.jsx("div",{className:"mb-4 p-3 rounded border border-white/15 bg-white/[0.04]",children:r.jsx("p",{className:"text-sm text-white/85",children:Ce})}),r.jsx(Qj,{issue:z,agents:i,canEdit:Xa,editing:ye,busy:ne,onBeginEdit:()=>Ue(!0),onSave:(Z,Se,lt)=>void Hs(Z,Se,lt),onCancel:()=>Ue(!1)}),z.executionContract&&r.jsx(Xj,{contract:z.executionContract}),r.jsx(Kj,{attachments:l.sourceAttachments}),r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-panel-elevated/40 flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-white/45",children:"Next"}),r.jsx("p",{className:"text-sm text-white/85",children:SN(l)})]}),Yt&&r.jsx("button",{type:"button",className:"btn-ghost-danger px-3 py-1.5 text-xs shrink-0 disabled:cursor-not-allowed disabled:opacity-60",disabled:ne,onClick:Gl,children:"Abort workflow"})]}),Ye&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/30 bg-cyber-teal/5",children:[r.jsxs("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:["Queued · position ",Ye.position]}),r.jsx("p",{className:"text-sm text-white/80 mt-0.5",children:Ye.waitReason??"Next up — starts as soon as the coordinator ticks"})]}),Za&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-amber-400/30 bg-amber-500/10 flex flex-wrap items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-xs text-amber-300 font-medium uppercase tracking-wide",children:Za.kind==="usage_capped"?"Waiting on usage cap":"Waiting on Agent Deck"}),r.jsx("p",{className:"text-sm text-white/80 mt-0.5 break-words",children:Za.reason}),r.jsxs("p",{className:"text-xs text-white/45 mt-0.5",children:["Wait until ",new Date(Za.until).toLocaleString()]})]}),r.jsx("button",{type:"button",className:"btn-gold px-3 py-1.5 text-xs shrink-0 disabled:opacity-50",disabled:ne,title:"Park this issue for a human — cancels the wait without touching the worktree; a resume continues with whichever agents are then set",onClick:Zl,children:"Park for human"})]}),Ta&&qe&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/35 bg-cyber-teal/5 space-y-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-cyber-teal animate-pulse","aria-hidden":!0}),r.jsx("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:"Running now"})]}),r.jsxs("p",{className:"text-sm text-white/90",children:[r.jsx("span",{className:"capitalize",children:qe.role}),qe.runtime?` · ${qe.runtime}`:"",qe.model?` · ${qe.model}`:"",` · round ${qe.round}`]}),r.jsxs("p",{className:"text-sm text-[#C4B643] truncate",title:Va??z.currentIntent??"session started",children:["Last progress: ",Va??z.currentIntent??"session started"]}),bt&&r.jsxs("p",{className:`text-xs ${jd(bt)?"text-amber-300":"text-white/55"}`,title:wd(bt),children:["Branch tip: ",bt.tipLabel,Sd(bt)]}),Va&&z.currentIntent&&!/session running/i.test(z.currentIntent)&&!hN(z.currentIntent,Va)&&r.jsx("p",{className:"text-xs text-white/45 truncate",title:z.currentIntent,children:z.currentIntent}),r.jsxs("p",{className:"text-xs text-white/45",children:["Heartbeat ",fN(qe.heartbeatAt),Ui(qe.worktreePath)?` · ${Ui(qe.worktreePath)}`:""]}),qe.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:qe.logPath,children:["Log: ",Ui(qe.logPath)??qe.logPath]})]}),Oa&&ct&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-1.5",children:[r.jsx("p",{className:"text-xs text-red-300 font-medium uppercase tracking-wide",children:"Latest session failure"}),r.jsx("p",{className:"text-sm text-white/90 whitespace-pre-wrap break-words",children:ct.reason}),r.jsxs("p",{className:"text-xs text-white/45",children:[ct.role?r.jsx("span",{className:"capitalize",children:ct.role}):"Worker",ct.outcome?` · ${ct.outcome}`:"",` · ${new Date(ct.when).toLocaleString()}`,` · infra ${ct.infraAttempts}/${ct.maxInfraAttempts}`]}),bt&&r.jsxs("p",{className:`text-xs ${jd(bt)?"text-amber-300":"text-white/55"}`,title:wd(bt),children:["Branch tip: ",bt.tipLabel,Sd(bt)]}),ct.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:ct.logPath,children:["Log: ",Ui(ct.logPath)??ct.logPath]})]}),bt&&!Ta&&!Oa&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-white/[0.03] space-y-1",children:[r.jsx("p",{className:"text-xs text-white/45 uppercase tracking-wide",children:"Branch tip"}),r.jsxs("p",{className:`text-sm ${jd(bt)?"text-amber-300":"text-white/80"}`,title:wd(bt),children:[bt.tipLabel,Sd(bt)]})]}),!Bt.ok&&!ke.some(Z=>Z.actionType==="product_scope_decision")&&r.jsx("div",{className:"mb-4 p-3 rounded border border-amber-400/30 bg-amber-500/10",children:r.jsxs("p",{className:"text-xs text-amber-300 font-medium",children:["Not startable yet — missing: ",Bt.missing.join(", ")]})}),ke.length>0&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-red-400/30 bg-red-500/10 space-y-2",children:[r.jsx("p",{className:"text-xs text-red-300 font-medium",children:"Human action needed"}),ke.map(Z=>{const Se=Z.actionType==="product_scope_decision";if(Z.actionType==="operator_verification"){const lt=kj(Z),E=W[Z.id]??"",le=E.trim().length>0;return r.jsx(Bi,{action:Z,hideChoicesHint:!0,children:r.jsxs("div",{className:"space-y-1",children:[r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm text-white/85 placeholder:text-white/30",rows:2,placeholder:"Result note (required) — paste the probe output, waiver reason, or repair note",value:E,disabled:ne,onChange:ve=>te(xt=>({...xt,[Z.id]:ve.target.value}))}),r.jsx("div",{className:"flex flex-wrap gap-2",children:lt.map(ve=>r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs disabled:opacity-50",disabled:ne||!le,title:le?void 0:"Enter the result note first — the server requires it",onClick:()=>La(Z.id,ve.choice,E),children:ve.label},ve.choice))})]})},Z.id)}return Se?r.jsx(Bi,{action:Z,hideChoicesHint:!0,children:Bt.ok&&r.jsxs("div",{className:"space-y-1",children:[r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm text-white/85 placeholder:text-white/30",rows:2,placeholder:"Decision note (optional) — shown to the next developer round",value:N[Z.id]??"",disabled:ne,onChange:lt=>Y(E=>({...E,[Z.id]:lt.target.value}))}),r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs",disabled:ne,onClick:()=>La(Z.id,"resume",N[Z.id]),children:"Resume"})]})},Z.id):r.jsx(Bi,{action:Z,disabled:ne,onChoose:lt=>La(Z.id,lt)},Z.id)})]}),fl&&r.jsx("div",{className:"mb-4",children:r.jsx(kv,{variant:"parked",agents:i,initialDeveloperId:z.developerAgentId,initialReviewerId:z.reviewerAgentId,busy:ne,notice:gt,onSave:(Z,Se)=>void Vl(Z,Se)},`${z.developerAgentId??""}:${z.reviewerAgentId??""}`)}),ua&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/30 bg-cyber-teal/5",children:[r.jsx("p",{className:"text-xs text-cyber-teal font-medium uppercase tracking-wide",children:"Amended contract pending for the next snapshot"}),r.jsxs("p",{className:"text-sm text-white/80 mt-0.5",children:["Changed: ",pt.join(", "),". Resume applies the amended task to the next developer round — the running snapshot is unchanged until then."]})]}),(Qa||at)&&!D&&!J&&r.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-1",children:[Qa&&r.jsx("button",{type:"button",className:"font-ui-display text-xs text-cyber-teal hover:underline",onClick:Mn,children:"Edit title / description / acceptance criteria"}),at&&r.jsx("button",{type:"button",className:"font-ui-display text-xs text-cyber-teal hover:underline",title:"Pull the latest title, description, and acceptance criteria from the linked Linear ticket — local edits will be replaced",onClick:()=>ue(!0),children:"Reload from Linear"})]}),at&&J&&!D&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-cyber-teal/30 bg-cyber-teal/5 space-y-2",children:[r.jsxs("p",{className:"text-sm text-white/90 font-medium",children:["Reload the latest task text from Linear",z.externalLabel?` ${z.externalLabel}`:"","?"]}),r.jsxs("p",{className:"text-sm text-white/70",children:["This replaces the local title, description, and acceptance criteria with the latest ticket text. Local edits will be lost."," ",Ut?"The workflow, PR, branch, and open scope decision are preserved — Resume applies the reloaded contract to the next snapshot.":"Repository, agents, and queue position are unchanged, and nothing is written back to Linear."]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm disabled:opacity-50",disabled:ne,onClick:Tt,children:"Reload from Linear"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:()=>ue(!1),children:"Cancel"})]})]}),D&&r.jsxs("div",{className:"mb-4 p-3 rounded border border-white/10 bg-panel-elevated/60 space-y-2",children:[r.jsx("input",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:C,onChange:Z=>$(Z.target.value),placeholder:"Title"}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:2,value:L,onChange:Z=>H(Z.target.value),placeholder:"Description"}),r.jsx("textarea",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",rows:2,value:F,onChange:Z=>P(Z.target.value),placeholder:"Acceptance criteria"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-1.5 text-sm",disabled:ne,onClick:ln,children:"Save"}),r.jsx("button",{type:"button",className:"font-ui-display px-4 py-1.5 text-sm text-white/60 hover:text-white",onClick:()=>X(!1),children:"Cancel"})]})]}),(z.status==="ready"||z.status==="needs_human"&&ke.length===0)&&r.jsxs("div",{className:"mb-4 space-y-2",children:[nn&&r.jsxs("p",{className:"text-sm text-amber-200/90",children:["Fix before Start: ",tt]}),_e&&r.jsx("p",{className:"text-sm text-amber-200/90",children:_e}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",className:"btn-gold px-4 py-2 disabled:opacity-50",disabled:!Bt.ok||ne||!!nn,title:nn?tt:"Run next — move to the front of the admission queue; runs now if a slot is free, otherwise waits first with a reason",onClick:hl,children:"Run next"}),r.jsx("button",{type:"button",className:"px-4 py-2 text-sm border border-cyber-teal/40 rounded text-cyber-teal hover:bg-cyber-teal/10 disabled:opacity-50",disabled:!Bt.ok||ne||!!nn,title:nn?tt:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:sn,children:"Execute now"}),Rn?r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm border border-white/15 rounded text-white/60 hover:text-white disabled:opacity-50",disabled:ne,onClick:pl,children:"Remove from queue"}):r.jsx("button",{type:"button",className:"font-ui-display px-4 py-2 text-sm border border-white/15 rounded text-white/80 hover:border-cyber-teal/50 hover:text-cyber-teal disabled:opacity-50",disabled:ne||Yt,title:"Add to queue — append to the end of the admission queue; does not start anything now",onClick:ml,children:"Add to queue"})]}),Rn&&Xa&&!ye&&r.jsx("p",{className:"text-xs text-white/40",children:"Queued — edit repository / agents from the Configuration section above; position is kept."})]}),r.jsx(oN,{issueId:a}),r.jsx("div",{className:"border-t border-white/10 pt-3",children:r.jsx(tN,{events:de})}),r.jsxs("div",{className:"mt-4 flex gap-2",children:[r.jsx("input",{className:"flex-1 bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",placeholder:"Guide this issue…",value:w,onChange:Z=>j(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&oa()}),r.jsx("button",{type:"button",className:"btn-gold px-4",onClick:oa,children:"Send"})]}),(Pe||Ln)&&r.jsxs("details",{className:"mt-6",children:[r.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"More actions"}),r.jsxs("div",{className:"mt-2 space-y-2",children:[r.jsxs("p",{className:"text-xs text-white/45",children:[Pe?"Remove from queue means do not run yet — the issue stays ready and can run later. Close issue means this work is no longer needed — it will never execute, but history is kept.":"This work is finished — there is nothing left to close or abort.",Ln?" Delete from Dealer permanently removes the local issue, its history, and its files.":""]}),Pe&&(rt?r.jsx(mN,{busy:ne,onConfirm:()=>void Dn(),onCancel:()=>mt(!1)}):r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/50 hover:text-red-300 underline underline-offset-2 disabled:opacity-50",disabled:ne,title:"Retire this issue without running it — removes any queue entry, keeps history as closed work",onClick:()=>mt(!0),children:"Close issue"})),Ln&&(nt?r.jsx(yN,{expectedToken:pN(z),externalLabel:z.externalLabel,busy:ne,onConfirm:()=>void xl(),onCancel:()=>Ge(!1)}):r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/50 hover:text-red-300 underline underline-offset-2 disabled:opacity-50",disabled:ne,title:"Permanently delete the Dealer-local issue, its history, and its files — the Linear ticket is not deleted",onClick:()=>Ge(!0),children:"Delete from Dealer"}))]})]}),r.jsxs("details",{className:"mt-6",onToggle:Z=>Z.currentTarget.open&&ca(),children:[r.jsx("summary",{className:"text-xs text-white/45 cursor-pointer hover:text-white/70",children:"Evidence & raw trace"}),m?r.jsxs("div",{className:"mt-2 space-y-3 text-xs text-white/60",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45 mb-1",children:"Worker sessions"}),m.workerSessions.map(Z=>{const Se=m.usageEvents.filter(ve=>ve.workerSessionId===Z.id),lt=Se.reduce((ve,xt)=>ve+(xt.costUsd??0),0),E=Se.reduce((ve,xt)=>ve+(xt.tokensIn??0),0),le=Se.reduce((ve,xt)=>ve+(xt.tokensOut??0),0);return r.jsxs("p",{children:[Z.role," round ",Z.round," · ",Z.status,Z.startedAt&&Z.completedAt?` · ${bd(new Date(Z.completedAt).getTime()-new Date(Z.startedAt).getTime())}`:"",Se.length>0?` · $${lt.toFixed(3)} · ${E}→${le} tok`:""]},Z.id)}),m.workerSessions.length===0&&r.jsx("p",{className:"text-white/35",children:"None yet."})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-white/45 mb-1",children:"Artifacts"}),m.artifacts.map(Z=>{const Se=y[Z.id];return r.jsxs("details",{className:"mb-1.5",onToggle:lt=>lt.currentTarget.open&&Z.blobPath&&dt(Z.id),children:[r.jsxs("summary",{className:"cursor-pointer hover:text-white/80",children:[Z.kind," · ",new Date(Z.createdAt).toLocaleString()]}),r.jsxs("div",{className:"mt-1 pl-3 border-l border-white/10 space-y-1",children:[Z.contentJson&&r.jsx("pre",{className:"whitespace-pre-wrap break-words text-white/55",children:dN(Z.contentJson)}),Z.blobPath&&r.jsxs("div",{children:[r.jsxs("p",{className:"text-white/40",children:["Raw trace: ",Z.blobPath]}),(Se==null?void 0:Se.loading)&&r.jsx("p",{className:"text-white/35",children:"Loading trace…"}),(Se==null?void 0:Se.error)&&r.jsx("p",{className:"text-red-300/80",children:Se.error}),Se&&!Se.loading&&!Se.error&&r.jsx("pre",{className:"mt-1 max-h-64 overflow-y-auto whitespace-pre-wrap break-words text-white/50 bg-black/20 rounded p-2",children:Se.content||"(empty)"})]}),!Z.contentJson&&!Z.blobPath&&r.jsx("p",{className:"text-white/35",children:"No content recorded."})]})]},Z.id)}),m.artifacts.length===0&&r.jsx("p",{className:"text-white/35",children:"None yet."})]})]}):r.jsx("p",{className:"text-xs text-white/40 mt-2",children:"Loading…"})]})]})})}function NN({issueId:a,agents:l,onHumanActionsChanged:i}){const[u,d]=b.useState(null),[f,m]=b.useState(null),[x,y]=b.useState(!1),v=()=>uv(a).then(w=>{d(w),m(null),y(!1)}).catch(w=>{const j=String(w).replace(/^Error:\s*/i,"").trim();/^not found$/i.test(j)?(y(!0),m(null),d(null)):(m(j),y(!1))});return b.useEffect(()=>{d(null),m(null),y(!1),v();const w=setInterval(v,4e3);return()=>clearInterval(w)},[a]),x?r.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-10",children:r.jsxs("div",{className:"max-w-md space-y-3",children:[r.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Issue not found"}),r.jsx("p",{className:"text-sm text-white/55",children:"No issue exists for this ID — it may have been deleted, or the link is wrong."}),r.jsx(sa,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]})}):f?r.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-6 space-y-3",children:[r.jsx("p",{className:"text-red-300 text-sm",children:f}),r.jsx(sa,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]}):u?r.jsx(jN,{issueId:a,detail:u,agents:l,onHumanActionsChanged:i,refresh:v,onError:w=>m(w)},a):r.jsx("div",{className:"p-6 text-white/50 text-sm",children:"Loading…"})}function _N(){return r.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-10",children:r.jsxs("div",{className:"max-w-md space-y-3",children:[r.jsx("h2",{className:"font-ui-display text-lg font-semibold text-white/90",children:"Page not found"}),r.jsx("p",{className:"text-sm text-white/55",children:"That URL is not a destination in Agent Dealer."}),r.jsx(sa,{to:"/issues",className:"font-ui-display inline-block text-sm text-cyber-teal hover:underline",children:"← Back to Issues"})]})})}function kN(){return r.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0 overflow-hidden","aria-hidden":!0,children:[r.jsx("div",{className:"absolute top-16 left-12",children:r.jsx("div",{className:"ambient-orb ambient-orb-a w-[26rem] h-[26rem] rounded-full bg-cyan-500/10 blur-3xl"})}),r.jsx("div",{className:"absolute bottom-20 right-12",children:r.jsx("div",{className:"ambient-orb ambient-orb-b w-[26rem] h-[26rem] rounded-full bg-pink-500/10 blur-3xl"})}),r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:r.jsx("div",{className:"ambient-orb ambient-orb-c w-[22rem] h-[22rem] rounded-full bg-blue-500/[0.07] blur-3xl"})})]})}function AN({className:a="w-5 h-5"}){return r.jsxs("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:a,"aria-hidden":!0,children:[r.jsx("circle",{cx:"6.75",cy:"6.25",r:"3.25"}),r.jsx("circle",{cx:"13.5",cy:"6.75",r:"2.85",opacity:"0.85"}),r.jsx("path",{d:"M1.75 16v-1.1c0-2.35 1.928-4.25 4.3-4.25 1.16 0 2.21.456 3 1.2.79-.744 1.84-1.2 3-1.2 2.372 0 4.3 1.9 4.3 4.25V16H1.75z"})]})}const EN="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAN5UlEQVR4AeydXagdVxmGF7loIKSpN/WHttqKktpAvWkVoRctp4gRtf4QbxRrREEb0wtRGkRovLCmKC1Y641CFGpBCtpIsVfHRvAm5KpIrMGfCCJUa8GmTWl6k+5nznlPvzOZ2Xtmz5o1a/Z8Ie/+vjU/a6351nPe/Xv22bFr185LLq9BbAZ2BP/nFeihAg5WD0X1LkNwsJyCXirgYPVSVu/UwXIGeqmAg9VLWTPsNPGUHKzEBZ/KcA7WVFY68XU6WIkLPpXhHKyprHTi63SwEhc89nDv37cndpdR+nOwopQxfScA9dDRfQGRM4O1ew+Fd3/wVtLB5WANtgTLDQxEwITI6eXoDz8dHvjrmbB2+J6ZDrFpcDlYgy9BswkAETAhcnvWnlfOBsS2G2aOlYNrOVisRsYCImBC5HVTveb5327tWjs8vGs5WFvLkVcCRMCEyO3szu/ea5tFjmMhGjm4loPFSmQkIAImRG6nBlDPvedbAZHbfeQ5uZaDxYpkICACJkRupwREwIR+c3w9fPu9+8LRb/7aHlLkOBaiMbRrOViswoACImBC5HYqVUCt/+jR4pBnz5wPqGiYm1xcy8F6c1GSZkAETIjcDj4PKHvcL574l20WuRyLxpCu5WCxAgkFRMCEyO3QTYHSOTgWUlvx2gyeITpYWo2eIxABEyK3w7UFyp5b5Vr27nAo13Kw7Cr1kAMRMCFyO0QXoNQPjoXUVhzatRwsrUTkCETAhMht9zGAsv3l6FoOll2hCDkQARMit13GBkp941hIbcUhXcvB0ip0jEAETIjcdtcXUHaM3Fwra7Bs4XLNgQiYELmdZwqgNB6OhdRWHMq1HCytQMsIRMCEyO3pKYGy4+bkWg6WXZkGORABEyK3pwwFlOaAYyG1FYdwLQdL1V8QgQiYELk93AJ16dyt4R2PXxNueXm/PSRZnotrOVgLlhyIgAmR28MtULw5/NID58LuP11ZHHLj9bcFVDQS3uBYqDxkatdysMorsNkGImBC5Jubi1AGik8b8ObwiWeOFft1c9cdR5QmjTm4loNVWnIgAiZEbnfXAaVj/vLPPwakNo6F1E4VcSxUHi+la7UDqzzTFWsDE2oLlC2Du9ZGNRysjTrU3sqliOdOnQ7c5dUePNuBY6FZWvzHsVDRSHiDY6HykKlcy8EylT91+l2mtZHy+SZEq+knBdy1gn+jH8DgKPcdfCp85AOPh4uv3symbbIfQ2nyGzA4FlIn9I/UThVxLFQeL4VrTdqxWGyAQhQfGF564XOk24RjITa6a1GFxZokWGWgHjz+sYC4C3vtws0r5Vp1CPTtWpMCqw4onIoFIKJVcC2e2fIMF3FtVjwRQdpW4cLatXScBFiLgLLVS+lad3/2urD+xIcCENg5dMnpC5gQue2Lx49/3/Odyt9LbPLY0fa1KF9psNoApULhWKhP1xJQXzhwbTHs3QeuK2KXGyACJkRu++IB/DeOngl/OPnxcOncLXbXVh7btVYSrGWA2qrwLDk7ewW9j8daV139y/Dhj34vCKjZUMV/QEBFo+UN5wETIrenCyigIseNr/jPznDFf3faw7bymK61UmB1BUoVfnLzPb9YrvX8ha+Fd960P1x19WMa4rLY1rWACJgQue0QiIAJkWsfToyu3HyjXNsVY7rWSoAVCygVmHji5LHQ1bXKd3n0WyfgQHX7tZ1jgAmRazsRiIAJkbOtrFSuNWqw+gBKC9HVtVj08l0effNsjO9gINK2muda9AdMiNyeB0TAhMjtvnKOY6G+XWuUYPUJlF2ILq718u69oQoe+mf7v9/+CdJtAhhkN9IGJkRu9wERMCFyu29ensK1RgVWKqC0KMu4Ft+m95XHfh6+PFMVPLyCj4ALaSxFuRYQARMi134iEAETImdbG+FYqE/XGgVYqYGyi9TGtQQUD4Lpg0VH5FZ677EKPCACJkRuz6MvYELkdl/bvG/XyhqsIYHSQrVxLQHFx2t+9vkvhp/OVPVpThwL4VhIYyn2CZTGwLFQX66VJVg5AKUFIDZ1LY4VUP84dZpm8R1WVe4i1+KxWHFgxQ3n4U6IvOKQTpv6dK2swMoNKK1aU9fS8eVY51rv+9sPggArnwNIfQGlsXAs1IdrZQFWrkBpAYi4FndbiLaVhaPq1WsgQfYccu4OiUOqL9caFKwxAKVFx7V4O+SFHQc2NplbAEFs4nEWzwzJrZ7983nbrM0Bl9e5fvz0rtpjYu7AsVBs1xoErDEBZRcR1+JNXBbfbievcy0eiPMMr+rFUs6T6BOgfvfi7eGhr34/6DGa9vcZ+3CtpGCNFSgtahvX+tSX7iz+zg1QAZf6KMcyUDyTTAkV88GxUEzXSgLW2IGi+NIi19rzytnAg/Kv779w2eesgAjRF9E61BBAMQ8ptmv1CtYqAaUFWORaQAVcOp4oiACJF0WJussbGijmh3AsFMu1egFrFYGi+NI819IxRAsUOdt4dshjqFyAYk5STNeKCtaqA6UFmOdaHANEuBIiZ5t9NT71YyjGbyIcC8VwrShg5QFUk9LFO6bKtYAImBC5Riu/Gq/tOcZYrtUJrCkCJRisawERMCFyHTPGiGOhrq61FFhTBsrCgms99/vXKn/rxR5X9Wq83Z9bHsO1WoHlQG1HANd6+MHPBB4/ofVHfrL9gM1W3avxm7uzCzgW6uJajcByoOavPc/wEN9EA2BVR0/NteaC5UBVITJ/2/ojj1YeMDXXqgTLgapko9FGXkpw1yp9jVFkoBotxCoeNCXXqlu/wrEsUOQ82+HbV3gAV3eib6+vwKRc695DlYUowGIPQBHR3utvI7g6VGAqrrV2+J7KKhVg4UxIRwAZUttj+wpM3bUKsCgbL4oRpaG+o1zjr0KcsmttgYVjIS0ojoXU9ti+AlN2rS2wKJu7FlWIq0m41qxk5cda28DCsdDsuOI/joWKht8sVYGputY2sKicuxZViKsputZlYOFYSKXFsZDaHttXYIqudRlYlM1diyrE1dRcqxIsHAuptDgWUttj+wpMzbUqwaJs7lpUIa6m5Fq1YOFYSKXFsZDaHttXIJ1rtZ9b2zMwHr5yoOobmPl0Ry1YDMTJRMlfjVcllo+r4lqvv+1iePHO/4XX33pxqxgApV8cmQsWjoV0Jo6F1PbYvgJjdy2+8ETfXCioLFBcH1WZCxYHuGtRhbgao2tZoPg0LBWpAortaCFYOBbiYIRjIXLXchXgp5pFqTp77XD155uqjk2xrS1QmtNCsDjQXYsqxFXurrUsUKpSI7BwLKSTcCyktsf2FcjVtboCpUo0AouD3bWowtKqPDEn14oFlC60MVg4FtKJOBZS22P7CuTgWrGBUhUag8UJ7lpUIa6Gcq2+gFJ1WoGFYyGdjGMhtT22r0Bq1+obKFWgFVic5K5FFeIqhWulAkqVaQ0WjoXUAY6F1PbYvgJ9ulZqoHT1rcHiRHctqhBXsV1rKKBUlaXAwrGQOsGxkNpjiLnNMZZrDQ2U6roUWJzsrkUV4qqLa+UClCqyNFg4FlJHOBZS22P7CizjWrkBpateGiw6cNeiCnHV1LVyBUrV6AQWjoXUGY6F1PbYvgKLXCt3oHTFncCiE3ctqhBX81yLvzXd5PNQcWfUvrfOYOFYSEPjWEhtj+0rMM+16I3PcukjwBzLttzUGSwuKIpr0ZFrqwJVrjUGoHQBUcDCsZA6xbGQ2h7bVYDaHbjp/qDfgBkTULrSKGDRmbsWVegmgLrv4FMB0RNf7537XR7zrFI0sHAspEEoElLbY30FqBMwIY7i+1/R0796OOlfWmXsWIoGFhNy16IKzVUHlP0Bbd5bXkdGBYuCIF0ihUNqe9yoADXBnRBbcCdka8f2MSsqWBTCXYsqVGsKQOnK54ClQ9pFfuqQzqKYSO0pRq4fd0JcP+6EbJ3YvkqKDhbFcdeiCiFMEaiNKy/9yRNt7Br5SUTqhwIjtVc9cq24E+JacSdka8L2VVYvjkXBpuhaDhQrv6HewOKnE20Ms3G3QOHVXqXIdeFOiOvCnZC9frZPSb2BRRFX3bUcKFa5Wr2CxU8s0tAsBFJ7rJFrwJ0Q14A7IXutbB+L+phnr2Ax4VVyLQeKFW2m3sHipxhpOiwOUnsMkfniToj54k7IXhfbXW9WoHewGGqsruVAsXrLKQlY/GQjTZEFQ2rnFpkb7oSYG+6E7DWw3VVfgSRgMfwYXOuTdxwJx7/7/63PQwETcqBYwXZKBhaLgzQ9XAGpPWQUUHfdfiQwR2BC5EPOa8xjJwOLIpVd68Ybhv3b09kCRbFGrqRg4QBINcMhlKeMDlT/1U4KFpdTdi0Wme0pxFg8hgJoAOfuDpGnGH9KYyQHi0VEKjKLrLyv6ED1Vdn6fpODxVRSuZYDRbWH0SBg4VhIlxzbtSxQJ04eCwfvf0vwuzxVO00cBCwurQ/XqgLqyWeOMZwrcQUGAwvHQrreLq7VP1CapcemFRgMLCbY1bUcKKqYpwYFC8dCKk1T13KgVLF846BgUZY2ruVAUbFxaHCwcCykclW5lgOl6ownDg4WpapzLQeK6oxTWYCFYyGVENfSWy96HcpfNlB1xhGzAItSlV1rAVCc4sq4AtmAhWMhBypjWlpMLRuwmDNvu/hdHpUYv7ICa/zl9CtQBRwsVcJj1Ao4WFHL6Z2pAg6WKuExagWigRV1Vt7Z6CvgYI1+CfO8AAcrz3UZ/awcrNEvYZ4X4GDluS6jn5WDNfolzPMCHKw81yXjWTWb2hsAAAD//0DhVxwAAAAGSURBVAMA8NLI/5AoLlwAAAAASUVORK5CYII=";function CN({className:a="",size:l=36}){return r.jsx("img",{src:EN,alt:"",width:l,height:l,className:`shrink-0 object-contain ${a}`,"aria-hidden":!0,draggable:!1})}const Cu={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},ty="5H",ay="1W",RN=new Set(["claude_code","codex_local","muse_code"]),TN="billing_cycle",ON="1M",LN=new Set($t.options),MN={critical:"font-medium text-red-300",warning:"font-medium text-yellow-300",normal:"font-medium text-white/75"};function DN(a){return{fiveHour:a.find(l=>l.criticalRole==="five_hour")??null,weekly:a.find(l=>l.criticalRole==="weekly")??null}}function Av(a,l,i){if(a.unavailableReason!==null)return a.unavailableReason;if(a.remainingPercent===null||a.source==="unavailable")return i??"missing";if(a.resetAt!==null){const u=Date.parse(a.resetAt);if(!Number.isFinite(u)||u<=l)return"expired"}if(a.freshUntil!==null){const u=Date.parse(a.freshUntil);if(!Number.isFinite(u)||u<=l)return"stale"}if(a.expiresAt!==null){const u=Date.parse(a.expiresAt);if(!Number.isFinite(u)||u<=l)return"expired"}if(a.observedAt){const u=Date.parse(a.observedAt);if(!Number.isFinite(u)||u>l+6e4)return"stale"}return i??"missing"}function ny(a,l,i,u,d=null){if(Ky(a,l)){const m=Math.round(a.remainingPercent??0),x=a.resetAt?`, resets ${new Date(a.resetAt).toLocaleString()}`:"",y=d?`, ${d}`:"";return`${u}: ${m}% available (${100-m}% used${y}${x})`}const f=mv(a);return f!==null?`${u}: N/A (${f})`:`${u}: N/A (${Cu[Av(a,l,i)]})`}function $d(a,l,i,u,d,f=null){if(Ky(a,i)){const x=a.remainingPercent??0;return{key:a.windowKey,label:d,kind:"known",remaining:Math.round(x),rawRemaining:x,detail:ny(a,i,l.unavailableReason,d,f),isCritical:u}}const m=Av(a,i,l.unavailableReason);return{key:a.windowKey,label:d,kind:"unknown",reason:m,detail:ny(a,i,l.unavailableReason,d,f),isCritical:u}}function ly(a,l){const i=l.unavailableReason??"missing";return{key:`missing:${a}`,label:a,kind:"unknown",reason:i,detail:`${a}: N/A (${Cu[i]})`,isCritical:!0}}function UN(a,l,i){return $d(a,l,i,!0,ON,"current billing cycle")}function zN(a,l=Date.now()){return a.runtimes.map(i=>{const u=ka(i.runtime),d=i.runtime;if(i.runtime==="cursor_local"){const f=i.windows.find(x=>x.windowKey===TN)??null;if(f===null)return{runtime:u,runtimeKey:d,windows:[],exhausted:!1,detail:`N/A (${Cu[i.unavailableReason??"missing"]})`};const m=UN(f,i,l);return{runtime:u,runtimeKey:d,windows:[m],exhausted:m.kind==="known"&&m.rawRemaining===0,detail:m.detail}}if(RN.has(i.runtime)){const{fiveHour:f,weekly:m}=DN(i.windows),x=f!==null?$d(f,i,l,!0,ty):ly(ty,i),y=m!==null?$d(m,i,l,!0,ay):ly(ay,i),v=[x,y],w=v.some(D=>D.kind==="known"&&D.rawRemaining===0),j=v.map(D=>D.detail).join("; ");return{runtime:u,runtimeKey:d,windows:v,exhausted:w,detail:j}}return{runtime:u,runtimeKey:d,windows:[],exhausted:!1,detail:`N/A (${Cu[i.unavailableReason??"missing"]})`}})}function sy(a){return a.exhausted?`${a.runtime} exhausted — a capacity window is at 0%: ${a.detail}`:`${a.runtime}: ${a.detail}`}function BN({state:a,nowMs:l}){if(a.status==="loading")return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":"loading",title:"Agent capacity is loading",className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-2 gap-y-1 whitespace-nowrap text-xs text-white/40",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),r.jsx("span",{"aria-live":"polite",children:"loading…"})]});if(a.status==="unavailable")return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":"unavailable",title:"Agent capacity is unavailable — the capacity read failed",className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-2 gap-y-1 whitespace-nowrap text-xs text-white/40",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),r.jsx("span",{children:"unavailable"})]});const i=zN(a.data,l),u=i.length===0||i.every(d=>!d.windows.some(f=>f.kind==="known"));return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":u?"unknown":"ready",title:i.length===0?"Agent capacity: no runtime accounts reported":i.map(sy).join(" · "),className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-x-3 gap-y-1 text-xs",children:[r.jsx("span",{className:"uppercase tracking-wider text-white/30",children:"Capacity"}),i.length===0?r.jsx("span",{className:"whitespace-nowrap text-white/35",children:"N/A"}):i.map(d=>{const f=d.windows.some(m=>m.kind==="known");return r.jsxs("span",{"data-testid":`topbar-capacity-${d.runtime}`,"data-known":f?"true":"false","data-exhausted":d.exhausted?"true":"false",title:sy(d),role:"group","aria-label":`${LN.has(d.runtimeKey)?d.runtime:"Unknown runtime"} capacity`,className:d.exhausted?"inline-flex items-center gap-1.5 whitespace-nowrap rounded border border-red-400/40 bg-red-500/10 px-1.5 py-0.5":"inline-flex items-center gap-1.5 whitespace-nowrap",children:[r.jsx(yv,{runtime:d.runtimeKey,className:"h-4 w-4 shrink-0"}),d.windows.length===0?r.jsx("span",{className:"text-white/35",children:"N/A"}):r.jsx("span",{className:"inline-flex flex-col leading-tight",children:d.windows.map(m=>r.jsxs("span",{"data-window":m.label,"data-window-known":m.kind==="known"?"true":"false",className:"inline-flex items-center gap-1 whitespace-nowrap tabular-nums",children:[r.jsx("span",{className:"text-white/40",children:m.label}),m.kind==="known"?(()=>{const x=hv(m.rawRemaining);return r.jsxs("span",{"data-severity":x,className:MN[x],children:[m.remaining,"%"]})})():r.jsx("span",{className:"text-white/35",children:"N/A"})]},m.key))})]},d.runtime)})]})}const iy=5e3;function Nd({isActive:a}){return`font-ui-display px-3 py-2 text-base rounded ${a?"bg-cyber-teal/20 text-cyber-teal":"text-white/60 hover:text-white"}`}function qN({agents:a,onHumanActionsChanged:l}){const{issueId:i}=Ob();return i?r.jsx(NN,{issueId:i,agents:a,onHumanActionsChanged:l},i):r.jsx(_y,{to:"/issues",replace:!0})}function HN({openHumanActionCount:a,agentCount:l,agentIssueCount:i,capacity:u={status:"loading"}}){return r.jsxs("header",{className:"px-6 py-3 border-b border-white/10 flex flex-wrap gap-4 items-center justify-between glass-header shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-6",children:[r.jsxs(sa,{to:"/issues",className:"flex items-center gap-3 text-left rounded hover:opacity-90 transition-opacity focus-visible:outline focus-visible:outline-2 focus-visible:outline-cyber-teal/45","aria-label":"AgentDealer — go to Issues",title:"AgentDealer — go to Issues",children:[r.jsx(CN,{size:40}),r.jsx("h1",{className:"font-mono text-xl font-bold sm:text-2xl",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"AgentDealer"})]}),r.jsxs("nav",{className:"flex gap-1",children:[r.jsxs(fu,{to:"/issues",className:Nd,children:["Issues",a>0&&r.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-0.5 font-mono text-xs leading-none bg-red-500/20 text-red-300 px-1.5 py-0.5 rounded tabular-nums border border-red-400/30 align-middle",title:`${a} open human action${a===1?"":"s"}`,children:[r.jsx(Au,{className:"w-3 h-3 shrink-0"}),a]})]}),r.jsx(fu,{to:"/reports/execution",className:Nd,children:"Reports"})]})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 min-w-0",children:[r.jsx(BN,{state:u}),r.jsxs(fu,{to:"/agents",className:({isActive:d})=>`${Nd({isActive:d})} inline-flex items-center gap-1.5 transition-colors`,"aria-label":"Agents",title:"Agents",children:[r.jsx(AN,{className:"w-6 h-6 shrink-0"}),r.jsx("span",{children:"Agents"}),l>0&&r.jsx("span",{className:"font-mono text-xs leading-none bg-white/10 text-white/55 px-1.5 py-0.5 rounded tabular-nums border border-white/10",title:`${l} configured agent${l===1?"":"s"}`,children:l}),i>0&&r.jsxs("span",{className:"inline-flex items-center gap-0.5 font-mono text-xs leading-none bg-red-500/20 text-red-300 px-1.5 py-0.5 rounded tabular-nums border border-red-400/30",title:`${i} need${i===1?"s":""} attention`,children:[r.jsx(Au,{className:"w-3 h-3 shrink-0"}),i]})]})]})]})}function $N(){const[a,l]=b.useState([]),[i,u]=b.useState(0),[d,f]=b.useState(!1),[m,x]=b.useState([]),[y,v]=b.useState({status:"loading"}),w=b.useCallback(()=>{G2().then(({agents:C,issueCount:$})=>{l(C),u($)}).catch(console.error),rv().then(C=>f(C.connected)).catch(()=>f(!1)),iv().then(C=>v({status:"ready",data:C})).catch(()=>v({status:"unavailable"}))},[]),j=b.useCallback(()=>mS().then(x).catch(()=>{}),[]);b.useEffect(()=>{w();const C=setInterval(w,iy);return()=>clearInterval(C)},[w]),b.useEffect(()=>{j();const C=setInterval(()=>void j(),iy);return()=>clearInterval(C)},[j]);const D=m.length,X=a.length;return r.jsxs(r.Fragment,{children:[r.jsx(kN,{}),r.jsxs("div",{className:"relative z-10 min-h-screen flex flex-col",children:[r.jsx(HN,{openHumanActionCount:D,agentCount:X,agentIssueCount:i,capacity:y}),r.jsx("main",{className:"flex-1 flex overflow-hidden",children:r.jsxs(Xb,{children:[r.jsx(Ml,{path:"/",element:r.jsx(_y,{to:"/issues",replace:!0})}),r.jsx(Ml,{path:"/issues",element:r.jsx(Lj,{agents:a,humanActions:m,onHumanActionsChanged:j})}),r.jsx(Ml,{path:"/issues/:issueId",element:r.jsx(qN,{agents:a,onHumanActionsChanged:j})}),r.jsx(Ml,{path:"/agents",element:r.jsx(GS,{agents:a,agentDeckOnline:d,onRefresh:w})}),r.jsx(Ml,{path:"/reports/execution",element:r.jsx(Zj,{})}),r.jsx(Ml,{path:"*",element:r.jsx(_N,{})})]})})]})]})}function YN(){return typeof document>"u"?Promise.resolve():document.fonts.load('13px "Monaco"').then(()=>{}).catch(()=>{})}YN();Q0.createRoot(document.getElementById("root")).render(r.jsx(b.StrictMode,{children:r.jsx(v1,{children:r.jsx($N,{})})}));
|