agent-dealer 1.3.0 → 1.3.2

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.
Files changed (44) hide show
  1. package/bundle/server/dist/adapters/git-worktree.js +38 -1
  2. package/bundle/server/dist/adapters/github.js +50 -0
  3. package/bundle/server/dist/adapters/github.test.js +89 -1
  4. package/bundle/server/dist/coordinator/admission.test.js +115 -0
  5. package/bundle/server/dist/coordinator/auto-merge.js +46 -9
  6. package/bundle/server/dist/coordinator/commands.js +89 -9
  7. package/bundle/server/dist/coordinator/commands.test.js +228 -2
  8. package/bundle/server/dist/coordinator/developer-effect.js +36 -0
  9. package/bundle/server/dist/coordinator/operator-verification.integration.test.js +102 -1
  10. package/bundle/server/dist/coordinator/product-scope-contract.test.js +249 -0
  11. package/bundle/server/dist/coordinator/prompts.js +57 -2
  12. package/bundle/server/dist/coordinator/prompts.test.js +236 -2
  13. package/bundle/server/dist/coordinator/reviewer-browser-probe.js +1083 -0
  14. package/bundle/server/dist/coordinator/reviewer-browser-probe.test.js +780 -0
  15. package/bundle/server/dist/coordinator/reviewer-effect.js +30 -1
  16. package/bundle/server/dist/coordinator/reviewer-effect.test.js +54 -0
  17. package/bundle/server/dist/coordinator/reviewer-visual-evidence.js +594 -0
  18. package/bundle/server/dist/coordinator/reviewer-visual-evidence.test.js +496 -0
  19. package/bundle/server/dist/coordinator/source-reload.js +44 -9
  20. package/bundle/server/dist/coordinator/visual-qa-collection.test.js +619 -0
  21. package/bundle/server/dist/coordinator/visual-qa.js +630 -0
  22. package/bundle/server/dist/coordinator/visual-qa.test.js +493 -0
  23. package/bundle/server/dist/coordinator/worker-loop.js +1 -1
  24. package/bundle/server/dist/paths.js +24 -0
  25. package/bundle/server/dist/repository/admission-settings.js +5 -5
  26. package/bundle/server/dist/repository/admission-settings.test.js +71 -15
  27. package/bundle/server/dist/repository/issues.js +8 -1
  28. package/bundle/server/dist/repository/issues.test.js +34 -0
  29. package/bundle/server/dist/routes/issues-execution-contract.test.js +293 -0
  30. package/bundle/server/dist/routes/issues-source-attachments.test.js +277 -0
  31. package/bundle/server/dist/routes/issues.js +23 -8
  32. package/bundle/server/dist/routes/issues.test.js +80 -0
  33. package/bundle/server/dist/routes/queue.js +1 -1
  34. package/bundle/server/dist/routes/queue.test.js +55 -20
  35. package/bundle/server/dist/runners/process-registry.js +1 -1
  36. package/bundle/server/package.json +2 -2
  37. package/bundle/server/static-ui/assets/index-DQ5ivcyg.js +64 -0
  38. package/bundle/server/static-ui/index.html +1 -1
  39. package/bundle/shared/dist/queue-entries.d.ts +5 -4
  40. package/bundle/shared/dist/queue-entries.js +5 -4
  41. package/bundle/shared/package.json +1 -1
  42. package/package.json +1 -1
  43. package/templates/prod.env.example +5 -2
  44. package/bundle/server/static-ui/assets/index-Bm74Vq_X.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 s(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=s(d);fetch(d.href,f)}})();var Jc={exports:{}},Es={};/**
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 Jp;function T0(){if(Jp)return Es;Jp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(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:n,type:u,key:m,ref:d!==void 0?d:null,props:f}}return Es.Fragment=l,Es.jsx=s,Es.jsxs=s,Es}var Fp;function O0(){return Fp||(Fp=1,Jc.exports=T0()),Jc.exports}var r=O0(),Fc={exports:{}},ve={};/**
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 Wp;function L0(){if(Wp)return ve;Wp=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=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 E={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||E}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||E}var ne=P.prototype=new F;ne.constructor=P,$(ne,H.prototype),ne.isPureReactComponent=!0;var V=Array.isArray;function Ne(){}var I={H:null,A:null,T:null,S:null},ye=Object.prototype.hasOwnProperty;function Me(N,Y,W){var te=W.ref;return{$$typeof:n,type:N,key:Y,ref:te!==void 0?te:null,props:W}}function bt(N,Y){return Me(N.type,Y,N.props)}function At(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function rt(N){var Y={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(W){return Y[W]})}var yt=/\/+/g;function lt(N,Y){return typeof N=="object"&&N!==null&&N.key!=null?rt(""+N.key):Y.toString(36)}function Qe(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(Ne,Ne):(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,se){var B=typeof N;(B==="undefined"||B==="boolean")&&(N=null);var ce=!1;if(N===null)ce=!0;else switch(B){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(N.$$typeof){case n:case l:ce=!0;break;case w:return ce=N._init,U(ce(N._payload),Y,W,te,se)}}if(ce)return se=se(N),ce=te===""?"."+lt(N,0):te,V(se)?(W="",ce!=null&&(W=ce.replace(yt,"$&/")+"/"),U(se,Y,W,"",function(Bt){return Bt})):se!=null&&(At(se)&&(se=bt(se,W+(se.key==null||N&&N.key===se.key?"":(""+se.key).replace(yt,"$&/")+"/")+ce)),Y.push(se)),1;ce=0;var Xe=te===""?".":te+":";if(V(N))for(var De=0;De<N.length;De++)te=N[De],B=Xe+lt(te,De),ce+=U(te,Y,W,B,se);else if(De=X(N),typeof De=="function")for(N=De.call(N),De=0;!(te=N.next()).done;)te=te.value,B=Xe+lt(te,De++),ce+=U(te,Y,W,B,se);else if(B==="object"){if(typeof N.then=="function")return U(Qe(N),Y,W,te,se);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 ce}function J(N,Y,W){if(N==null)return N;var te=[],se=0;return U(N,te,"","",function(B){return Y.call(W,B,se++)}),te}function re(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 Ae=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)},Le={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 ve.Activity=j,ve.Children=Le,ve.Component=H,ve.Fragment=s,ve.Profiler=d,ve.PureComponent=P,ve.StrictMode=u,ve.Suspense=y,ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ve.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},ve.cache=function(N){return function(){return N.apply(null,arguments)}},ve.cacheSignal=function(){return null},ve.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),se=N.key;if(Y!=null)for(B in Y.key!==void 0&&(se=""+Y.key),Y)!ye.call(Y,B)||B==="key"||B==="__self"||B==="__source"||B==="ref"&&Y.ref===void 0||(te[B]=Y[B]);var B=arguments.length-2;if(B===1)te.children=W;else if(1<B){for(var ce=Array(B),Xe=0;Xe<B;Xe++)ce[Xe]=arguments[Xe+2];te.children=ce}return Me(N.type,se,te)},ve.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},ve.createElement=function(N,Y,W){var te,se={},B=null;if(Y!=null)for(te in Y.key!==void 0&&(B=""+Y.key),Y)ye.call(Y,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(se[te]=Y[te]);var ce=arguments.length-2;if(ce===1)se.children=W;else if(1<ce){for(var Xe=Array(ce),De=0;De<ce;De++)Xe[De]=arguments[De+2];se.children=Xe}if(N&&N.defaultProps)for(te in ce=N.defaultProps,ce)se[te]===void 0&&(se[te]=ce[te]);return Me(N,B,se)},ve.createRef=function(){return{current:null}},ve.forwardRef=function(N){return{$$typeof:x,render:N}},ve.isValidElement=At,ve.lazy=function(N){return{$$typeof:w,_payload:{_status:-1,_result:N},_init:re}},ve.memo=function(N,Y){return{$$typeof:v,type:N,compare:Y===void 0?null:Y}},ve.startTransition=function(N){var Y=I.T,W={};I.T=W;try{var te=N(),se=I.S;se!==null&&se(W,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(Ne,Ae)}catch(B){Ae(B)}finally{Y!==null&&W.types!==null&&(Y.types=W.types),I.T=Y}},ve.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ve.use=function(N){return I.H.use(N)},ve.useActionState=function(N,Y,W){return I.H.useActionState(N,Y,W)},ve.useCallback=function(N,Y){return I.H.useCallback(N,Y)},ve.useContext=function(N){return I.H.useContext(N)},ve.useDebugValue=function(){},ve.useDeferredValue=function(N,Y){return I.H.useDeferredValue(N,Y)},ve.useEffect=function(N,Y){return I.H.useEffect(N,Y)},ve.useEffectEvent=function(N){return I.H.useEffectEvent(N)},ve.useId=function(){return I.H.useId()},ve.useImperativeHandle=function(N,Y,W){return I.H.useImperativeHandle(N,Y,W)},ve.useInsertionEffect=function(N,Y){return I.H.useInsertionEffect(N,Y)},ve.useLayoutEffect=function(N,Y){return I.H.useLayoutEffect(N,Y)},ve.useMemo=function(N,Y){return I.H.useMemo(N,Y)},ve.useOptimistic=function(N,Y){return I.H.useOptimistic(N,Y)},ve.useReducer=function(N,Y,W){return I.H.useReducer(N,Y,W)},ve.useRef=function(N){return I.H.useRef(N)},ve.useState=function(N){return I.H.useState(N)},ve.useSyncExternalStore=function(N,Y,W){return I.H.useSyncExternalStore(N,Y,W)},ve.useTransition=function(){return I.H.useTransition()},ve.version="19.2.7",ve}var Pp;function qd(){return Pp||(Pp=1,Fc.exports=L0()),Fc.exports}var b=qd(),Wc={exports:{}},Cs={},Pc={exports:{}},ed={};/**
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 ex;function M0(){return ex||(ex=1,(function(n){function l(U,J){var re=U.length;U.push(J);e:for(;0<re;){var Ae=re-1>>>1,Le=U[Ae];if(0<d(Le,J))U[Ae]=J,U[re]=Le,re=Ae;else break e}}function s(U){return U.length===0?null:U[0]}function u(U){if(U.length===0)return null;var J=U[0],re=U.pop();if(re!==J){U[0]=re;e:for(var Ae=0,Le=U.length,N=Le>>>1;Ae<N;){var Y=2*(Ae+1)-1,W=U[Y],te=Y+1,se=U[te];if(0>d(W,re))te<Le&&0>d(se,W)?(U[Ae]=se,U[te]=re,Ae=te):(U[Ae]=W,U[Y]=re,Ae=Y);else if(te<Le&&0>d(se,re))U[Ae]=se,U[te]=re,Ae=te;else break e}}return J}function d(U,J){var re=U.sortIndex-J.sortIndex;return re!==0?re:U.id-J.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,x=m.now();n.unstable_now=function(){return m.now()-x}}var y=[],v=[],w=1,j=null,D=3,X=!1,E=!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=s(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=s(v)}}function V(U){if($=!1,ne(U),!E)if(s(y)!==null)E=!0,Ne||(Ne=!0,rt());else{var J=s(v);J!==null&&Qe(V,J.startTime-U)}}var Ne=!1,I=-1,ye=5,Me=-1;function bt(){return L?!0:!(n.unstable_now()-Me<ye)}function At(){if(L=!1,Ne){var U=n.unstable_now();Me=U;var J=!0;try{e:{E=!1,$&&($=!1,F(I),I=-1),X=!0;var re=D;try{t:{for(ne(U),j=s(y);j!==null&&!(j.expirationTime>U&&bt());){var Ae=j.callback;if(typeof Ae=="function"){j.callback=null,D=j.priorityLevel;var Le=Ae(j.expirationTime<=U);if(U=n.unstable_now(),typeof Le=="function"){j.callback=Le,ne(U),J=!0;break t}j===s(y)&&u(y),ne(U)}else u(y);j=s(y)}if(j!==null)J=!0;else{var N=s(v);N!==null&&Qe(V,N.startTime-U),J=!1}}break e}finally{j=null,D=re,X=!1}J=void 0}}finally{J?rt():Ne=!1}}}var rt;if(typeof P=="function")rt=function(){P(At)};else if(typeof MessageChannel<"u"){var yt=new MessageChannel,lt=yt.port2;yt.port1.onmessage=At,rt=function(){lt.postMessage(null)}}else rt=function(){H(At,0)};function Qe(U,J){I=H(function(){U(n.unstable_now())},J)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.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},n.unstable_getCurrentPriorityLevel=function(){return D},n.unstable_next=function(U){switch(D){case 1:case 2:case 3:var J=3;break;default:J=D}var re=D;D=J;try{return U()}finally{D=re}},n.unstable_requestPaint=function(){L=!0},n.unstable_runWithPriority=function(U,J){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var re=D;D=U;try{return J()}finally{D=re}},n.unstable_scheduleCallback=function(U,J,re){var Ae=n.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?Ae+re:Ae):re=Ae,U){case 1:var Le=-1;break;case 2:Le=250;break;case 5:Le=1073741823;break;case 4:Le=1e4;break;default:Le=5e3}return Le=re+Le,U={id:w++,callback:J,priorityLevel:U,startTime:re,expirationTime:Le,sortIndex:-1},re>Ae?(U.sortIndex=re,l(v,U),s(y)===null&&U===s(v)&&($?(F(I),I=-1):$=!0,Qe(V,re-Ae))):(U.sortIndex=Le,l(y,U),E||X||(E=!0,Ne||(Ne=!0,rt()))),U},n.unstable_shouldYield=bt,n.unstable_wrapCallback=function(U){var J=D;return function(){var re=D;D=J;try{return U.apply(this,arguments)}finally{D=re}}}})(ed)),ed}var tx;function D0(){return tx||(tx=1,Pc.exports=M0()),Pc.exports}var td={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 ax;function U0(){if(ax)return zt;ax=1;var n=qd();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 s(){}var u={d:{f:s,r:function(){throw Error(l(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},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=n.__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 nx;function z0(){if(nx)return td.exports;nx=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),td.exports=U0(),td.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 lx;function B0(){if(lx)return Cs;lx=1;var n=D0(),l=qd(),s=z0();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function 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 a=e,i=t;;){var o=a.return;if(o===null)break;var c=o.alternate;if(c===null){if(i=o.return,i!==null){a=i;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===a)return y(o),e;if(c===i)return y(o),t;c=c.sibling}throw Error(u(188))}if(a.return!==i.return)a=o,i=c;else{for(var h=!1,g=o.child;g;){if(g===a){h=!0,a=o,i=c;break}if(g===i){h=!0,i=o,a=c;break}g=g.sibling}if(!h){for(g=c.child;g;){if(g===a){h=!0,a=c,i=o;break}if(g===i){h=!0,i=c,a=o;break}g=g.sibling}if(!h)throw Error(u(189))}}if(a.alternate!==i)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?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"),E=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"),Ne=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),ye=Symbol.for("react.lazy"),Me=Symbol.for("react.activity"),bt=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 yt=Symbol.for("react.client.reference");function lt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===yt?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 Ne:return"SuspenseList";case Me:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E: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:lt(e.type)||"Memo";case ye:t=e._payload,e=e._init;try{return lt(e(t))}catch{}}return null}var Qe=Array.isArray,U=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},Ae=[],Le=-1;function N(e){return{current:e}}function Y(e){0>Le||(e.current=Ae[Le],Ae[Le]=null,Le--)}function W(e,t){Le++,Ae[Le]=e.current,e.current=t}var te=N(null),se=N(null),B=N(null),ce=N(null);function Xe(e,t){switch(W(B,t),W(se,e),W(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gp(t),e=bp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(te),W(te,e)}function De(){Y(te),Y(se),Y(B)}function Bt(e){e.memoizedState!==null&&W(ce,e);var t=te.current,a=bp(t,e.type);t!==a&&(W(se,e),W(te,a))}function Ta(e){se.current===e&&(Y(te),Y(se)),ce.current===e&&(Y(ce),Ns._currentValue=re)}var ua,Va;function qe(e){if(ua===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ua=t&&t[1]||"",Va=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+ua+e+Va}var Za=!1;function dt(e,t){if(!e||Za)return"";Za=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={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]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=i.DetermineComponentFrameRoot(),h=c[0],g=c[1];if(h&&g){var S=h.split(`
44
- `),T=g.split(`
45
- `);for(o=i=0;i<S.length&&!S[i].includes("DetermineComponentFrameRoot");)i++;for(;o<T.length&&!T[o].includes("DetermineComponentFrameRoot");)o++;if(i===S.length||o===T.length)for(i=S.length-1,o=T.length-1;1<=i&&0<=o&&S[i]!==T[o];)o--;for(;1<=i&&0<=o;i--,o--)if(S[i]!==T[o]){if(i!==1||o!==1)do if(i--,o--,0>o||S[i]!==T[o]){var q=`
46
- `+S[i].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=i&&0<=o);break}}}finally{Za=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?qe(a):""}function wt(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 dt(e.type,!1);case 11:return dt(e.type.render,!1);case 1:return dt(e.type,!0);case 31:return qe("Activity");default:return""}}function Rn(e){try{var t="",a=null;do t+=wt(e,a),a=e,e=e.return;while(e);return t}catch(i){return`
47
- Error generating stack: `+i.message+`
48
- `+i.stack}}var Ye=Object.prototype.hasOwnProperty,Ga=n.unstable_scheduleCallback,oa=n.unstable_cancelCallback,tn=n.unstable_shouldYield,ol=n.unstable_requestPaint,ut=n.unstable_now,ca=n.unstable_getCurrentPriorityLevel,Ue=n.unstable_ImmediatePriority,cl=n.unstable_UserBlockingPriority,qt=n.unstable_NormalPriority,$l=n.unstable_LowPriority,dl=n.unstable_IdlePriority,Yl=n.log,fl=n.unstable_setDisableYieldValue,Oa=null,tt=null;function Ut(e){if(typeof Yl=="function"&&fl(e),tt&&typeof tt.setStrictMode=="function")try{tt.setStrictMode(Oa,e)}catch{}}var ft=Math.clz32?Math.clz32:Vl,Ft=Math.log,at=Math.LN2;function Vl(e){return e>>>=0,e===0?32:31-(Ft(e)/at|0)|0}var an=256,nn=262144,Qa=4194304;function La(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 Tn(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var g=i&134217727;return g!==0?(i=g&~c,i!==0?o=La(i):(h&=g,h!==0?o=La(h):a||(a=g&~e,a!==0&&(o=La(a))))):(g=i&~c,g!==0?o=La(g):h!==0?o=La(h):a||(a=i&~e,a!==0&&(o=La(a)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,a=t&-t,c>=a||c===32&&(a&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=Qa;return Qa<<=1,(Qa&62914560)===0&&(Qa=4194304),e}function ml(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function sn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Bi(e,t,a,i,o,c){var h=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var g=e.entanglements,S=e.expirationTimes,T=e.hiddenUpdates;for(a=h&~a;0<a;){var q=31-ft(a),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)}a&=~Q}i!==0&&Zl(e,i,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function Zl(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-ft(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|a&261930}function On(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var i=31-ft(a),o=1<<i;o&t|e[i]&t&&(e[i]|=t),a&=~o}}function pl(e,t){var a=t&-t;return a=(a&42)!==0?1:Ln(a),(a&(e.suspendedLanes|t))!==0?0:a}function Ln(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 Ma(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function G(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:Vp(e.type))}function je(e,t){var a=J.p;try{return J.p=e,t()}finally{J.p=a}}var ze=Math.random().toString(36).slice(2),Ve="__reactFiber$"+ze,ht="__reactProps$"+ze,mt="__reactContainer$"+ze,C="__reactEvents$"+ze,de="__reactListeners$"+ze,nt="__reactHandles$"+ze,da="__reactResources$"+ze,qi="__reactMarker$"+ze;function $u(e){delete e[Ve],delete e[ht],delete e[C],delete e[de],delete e[nt]}function Gl(e){var t=e[Ve];if(t)return t;for(var a=e.parentNode;a;){if(t=a[mt]||a[Ve]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Ap(e);e!==null;){if(a=e[Ve])return a;e=Ap(e)}return t}e=a,a=e.parentNode}return null}function Ql(e){if(e=e[Ve]||e[mt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Hi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Xl(e){var t=e[da];return t||(t=e[da]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ct(e){e[qi]=!0}var rf=new Set,uf={};function xl(e,t){Il(e,t),Il(e+"Capture",t)}function Il(e,t){for(uf[e]=t,e=0;e<t.length;e++)rf.add(t[e])}var Sv=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]*$"),of={},cf={};function jv(e){return Ye.call(cf,e)?!0:Ye.call(of,e)?!1:Sv.test(e)?cf[e]=!0:(of[e]=!0,!1)}function Zs(e,t,a){if(jv(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Gs(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function rn(e,t,a,i){if(i===null)e.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+i)}}function fa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function df(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Nv(e,t,a){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var o=i.get,c=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(h){a=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yu(e){if(!e._valueTracker){var t=df(e)?"checked":"value";e._valueTracker=Nv(e,t,""+e[t])}}function ff(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=df(e)?e.checked?"true":"false":e.value),e=i,e!==a?(t.setValue(e),!0):!1}function Qs(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 _v=/[\n"\\]/g;function ha(e){return e.replace(_v,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Vu(e,t,a,i,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=""+fa(t)):e.value!==""+fa(t)&&(e.value=""+fa(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Zu(e,h,fa(t)):a!=null?Zu(e,h,fa(a)):i!=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=""+fa(g):e.removeAttribute("name")}function hf(e,t,a,i,o,c,h,g){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Yu(e);return}a=a!=null?""+fa(a):"",t=t!=null?""+fa(t):a,g||t===e.value||(e.value=t),e.defaultValue=t}i=i??o,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=g?e.checked:!!i,e.defaultChecked=!!i,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Yu(e)}function Zu(e,t,a){t==="number"&&Qs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Kl(e,t,a,i){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&i&&(e[a].defaultSelected=!0)}else{for(a=""+fa(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,i&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function mf(e,t,a){if(t!=null&&(t=""+fa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+fa(a):""}function pf(e,t,a,i){if(t==null){if(i!=null){if(a!=null)throw Error(u(92));if(Qe(i)){if(1<i.length)throw Error(u(93));i=i[0]}a=i}a==null&&(a=""),t=a}a=fa(t),e.defaultValue=a,i=e.textContent,i===a&&i!==""&&i!==null&&(e.value=i),Yu(e)}function Jl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var kv=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 xf(e,t,a){var i=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,a):typeof a!="number"||a===0||kv.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function yf(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var i in a)!a.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var o in t)i=t[o],t.hasOwnProperty(o)&&a[o]!==i&&xf(e,o,i)}else for(var c in t)t.hasOwnProperty(c)&&xf(e,c,t[c])}function Gu(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 Av=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"]]),Ev=/^[\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 Xs(e){return Ev.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function un(){}var Qu=null;function Xu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fl=null,Wl=null;function vf(e){var t=Ql(e);if(t&&(e=t.stateNode)){var a=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Vu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ha(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var i=a[t];if(i!==e&&i.form===e.form){var o=i[ht]||null;if(!o)throw Error(u(90));Vu(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<a.length;t++)i=a[t],i.form===e.form&&ff(i)}break e;case"textarea":mf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Kl(e,!!a.multiple,t,!1)}}}var Iu=!1;function gf(e,t,a){if(Iu)return e(t,a);Iu=!0;try{var i=e(t);return i}finally{if(Iu=!1,(Fl!==null||Wl!==null)&&(Mr(),Fl&&(t=Fl,e=Wl,Wl=Fl=null,vf(t),e)))for(t=0;t<e.length;t++)vf(e[t])}}function $i(e,t){var a=e.stateNode;if(a===null)return null;var i=a[ht]||null;if(i===null)return null;a=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var on=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ku=!1;if(on)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){Ku=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{Ku=!1}var Mn=null,Ju=null,Is=null;function bf(){if(Is)return Is;var e,t=Ju,a=t.length,i,o="value"in Mn?Mn.value:Mn.textContent,c=o.length;for(e=0;e<a&&t[e]===o[e];e++);var h=a-e;for(i=1;i<=h&&t[a-i]===o[c-i];i++);return Is=o.slice(e,1<i?1-i:void 0)}function Ks(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 Js(){return!0}function wf(){return!1}function Vt(e){function t(a,i,o,c,h){this._reactName=a,this._targetInst=o,this.type=i,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(a=e[g],this[g]=a?a(c):c[g]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Js:wf,this.isPropagationStopped=wf,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Js)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Js)},persist:function(){},isPersistent:Js}),t}var yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fs=Vt(yl),Vi=j({},yl,{view:0,detail:0}),Cv=Vt(Vi),Fu,Wu,Zi,Ws=j({},Vi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eo,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!==Zi&&(Zi&&e.type==="mousemove"?(Fu=e.screenX-Zi.screenX,Wu=e.screenY-Zi.screenY):Wu=Fu=0,Zi=e),Fu)},movementY:function(e){return"movementY"in e?e.movementY:Wu}}),Sf=Vt(Ws),Rv=j({},Ws,{dataTransfer:0}),Tv=Vt(Rv),Ov=j({},Vi,{relatedTarget:0}),Pu=Vt(Ov),Lv=j({},yl,{animationName:0,elapsedTime:0,pseudoElement:0}),Mv=Vt(Lv),Dv=j({},yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Uv=Vt(Dv),zv=j({},yl,{data:0}),jf=Vt(zv),Bv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qv={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"},Hv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $v(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hv[e])?!!t[e]:!1}function eo(){return $v}var Yv=j({},Vi,{key:function(e){if(e.key){var t=Bv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ks(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eo,charCode:function(e){return e.type==="keypress"?Ks(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ks(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Vv=Vt(Yv),Zv=j({},Ws,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nf=Vt(Zv),Gv=j({},Vi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eo}),Qv=Vt(Gv),Xv=j({},yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Iv=Vt(Xv),Kv=j({},Ws,{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}),Jv=Vt(Kv),Fv=j({},yl,{newState:0,oldState:0}),Wv=Vt(Fv),Pv=[9,13,27,32],to=on&&"CompositionEvent"in window,Gi=null;on&&"documentMode"in document&&(Gi=document.documentMode);var eg=on&&"TextEvent"in window&&!Gi,_f=on&&(!to||Gi&&8<Gi&&11>=Gi),kf=" ",Af=!1;function Ef(e,t){switch(e){case"keyup":return Pv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pl=!1;function tg(e,t){switch(e){case"compositionend":return Cf(t);case"keypress":return t.which!==32?null:(Af=!0,kf);case"textInput":return e=t.data,e===kf&&Af?null:e;default:return null}}function ag(e,t){if(Pl)return e==="compositionend"||!to&&Ef(e,t)?(e=bf(),Is=Ju=Mn=null,Pl=!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 _f&&t.locale!=="ko"?null:t.data;default:return null}}var ng={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 Rf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ng[e.type]:t==="textarea"}function Tf(e,t,a,i){Fl?Wl?Wl.push(i):Wl=[i]:Fl=i,t=$r(t,"onChange"),0<t.length&&(a=new Fs("onChange","change",null,a,i),e.push({event:a,listeners:t}))}var Qi=null,Xi=null;function lg(e){hp(e,0)}function Ps(e){var t=Hi(e);if(ff(t))return e}function Of(e,t){if(e==="change")return t}var Lf=!1;if(on){var ao;if(on){var no="oninput"in document;if(!no){var Mf=document.createElement("div");Mf.setAttribute("oninput","return;"),no=typeof Mf.oninput=="function"}ao=no}else ao=!1;Lf=ao&&(!document.documentMode||9<document.documentMode)}function Df(){Qi&&(Qi.detachEvent("onpropertychange",Uf),Xi=Qi=null)}function Uf(e){if(e.propertyName==="value"&&Ps(Xi)){var t=[];Tf(t,Xi,e,Xu(e)),gf(lg,t)}}function ig(e,t,a){e==="focusin"?(Df(),Qi=t,Xi=a,Qi.attachEvent("onpropertychange",Uf)):e==="focusout"&&Df()}function sg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ps(Xi)}function rg(e,t){if(e==="click")return Ps(t)}function ug(e,t){if(e==="input"||e==="change")return Ps(t)}function og(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wt=typeof Object.is=="function"?Object.is:og;function Ii(e,t){if(Wt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(i=0;i<a.length;i++){var o=a[i];if(!Ye.call(t,o)||!Wt(e[o],t[o]))return!1}return!0}function zf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bf(e,t){var a=zf(e);e=0;for(var i;a;){if(a.nodeType===3){if(i=e+a.textContent.length,e<=t&&i>=t)return{node:a,offset:t-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=zf(a)}}function qf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Qs(e.document)}return t}function lo(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 cg=on&&"documentMode"in document&&11>=document.documentMode,ei=null,io=null,Ki=null,so=!1;function $f(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;so||ei==null||ei!==Qs(i)||(i=ei,"selectionStart"in i&&lo(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ki&&Ii(Ki,i)||(Ki=i,i=$r(io,"onSelect"),0<i.length&&(t=new Fs("onSelect","select",null,t,a),e.push({event:t,listeners:i}),t.target=ei)))}function vl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var ti={animationend:vl("Animation","AnimationEnd"),animationiteration:vl("Animation","AnimationIteration"),animationstart:vl("Animation","AnimationStart"),transitionrun:vl("Transition","TransitionRun"),transitionstart:vl("Transition","TransitionStart"),transitioncancel:vl("Transition","TransitionCancel"),transitionend:vl("Transition","TransitionEnd")},ro={},Yf={};on&&(Yf=document.createElement("div").style,"AnimationEvent"in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),"TransitionEvent"in window||delete ti.transitionend.transition);function gl(e){if(ro[e])return ro[e];if(!ti[e])return e;var t=ti[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Yf)return ro[e]=t[a];return e}var Vf=gl("animationend"),Zf=gl("animationiteration"),Gf=gl("animationstart"),dg=gl("transitionrun"),fg=gl("transitionstart"),hg=gl("transitioncancel"),Qf=gl("transitionend"),Xf=new Map,uo="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(" ");uo.push("scrollEnd");function Da(e,t){Xf.set(e,t),xl(t,[e])}var er=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)},ma=[],ai=0,oo=0;function tr(){for(var e=ai,t=oo=ai=0;t<e;){var a=ma[t];ma[t++]=null;var i=ma[t];ma[t++]=null;var o=ma[t];ma[t++]=null;var c=ma[t];if(ma[t++]=null,i!==null&&o!==null){var h=i.pending;h===null?o.next=o:(o.next=h.next,h.next=o),i.pending=o}c!==0&&If(a,o,c)}}function ar(e,t,a,i){ma[ai++]=e,ma[ai++]=t,ma[ai++]=a,ma[ai++]=i,oo|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function co(e,t,a,i){return ar(e,t,a,i),nr(e)}function bl(e,t){return ar(e,null,null,t),nr(e)}function If(e,t,a){e.lanes|=a;var i=e.alternate;i!==null&&(i.lanes|=a);for(var o=!1,c=e.return;c!==null;)c.childLanes|=a,i=c.alternate,i!==null&&(i.childLanes|=a),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-ft(a),e=c.hiddenUpdates,i=e[o],i===null?e[o]=[t]:i.push(t),t.lane=a|536870912),c):null}function nr(e){if(50<ys)throw ys=0,bc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ni={};function mg(e,t,a,i){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pt(e,t,a,i){return new mg(e,t,a,i)}function fo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cn(e,t){var a=e.alternate;return a===null?(a=Pt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Kf(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function lr(e,t,a,i,o,c){var h=0;if(i=e,typeof e=="function")fo(e)&&(h=1);else if(typeof e=="string")h=g0(e,a,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Me:return e=Pt(31,a,t,o),e.elementType=Me,e.lanes=c,e;case $:return wl(a.children,o,c,t);case L:h=8,o|=24;break;case H:return e=Pt(12,a,t,o|2),e.elementType=H,e.lanes=c,e;case V:return e=Pt(13,a,t,o),e.elementType=V,e.lanes=c,e;case Ne:return e=Pt(19,a,t,o),e.elementType=Ne,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,i=null;break e}h=29,a=Error(u(130,e===null?"null":typeof e,"")),i=null}return t=Pt(h,a,t,o),t.elementType=e,t.type=i,t.lanes=c,t}function wl(e,t,a,i){return e=Pt(7,e,i,t),e.lanes=a,e}function ho(e,t,a){return e=Pt(6,e,null,t),e.lanes=a,e}function Jf(e){var t=Pt(18,null,null,0);return t.stateNode=e,t}function mo(e,t,a){return t=Pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ff=new WeakMap;function pa(e,t){if(typeof e=="object"&&e!==null){var a=Ff.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Rn(t)},Ff.set(e,t),t)}return{value:e,source:t,stack:Rn(t)}}var li=[],ii=0,ir=null,Ji=0,xa=[],ya=0,Dn=null,Xa=1,Ia="";function dn(e,t){li[ii++]=Ji,li[ii++]=ir,ir=e,Ji=t}function Wf(e,t,a){xa[ya++]=Xa,xa[ya++]=Ia,xa[ya++]=Dn,Dn=e;var i=Xa;e=Ia;var o=32-ft(i)-1;i&=~(1<<o),a+=1;var c=32-ft(t)+o;if(30<c){var h=o-o%5;c=(i&(1<<h)-1).toString(32),i>>=h,o-=h,Xa=1<<32-ft(t)+o|a<<o|i,Ia=c+e}else Xa=1<<c|a<<o|i,Ia=e}function po(e){e.return!==null&&(dn(e,1),Wf(e,1,0))}function xo(e){for(;e===ir;)ir=li[--ii],li[ii]=null,Ji=li[--ii],li[ii]=null;for(;e===Dn;)Dn=xa[--ya],xa[ya]=null,Ia=xa[--ya],xa[ya]=null,Xa=xa[--ya],xa[ya]=null}function Pf(e,t){xa[ya++]=Xa,xa[ya++]=Ia,xa[ya++]=Dn,Xa=t.id,Ia=t.overflow,Dn=e}var Ot=null,it=null,Te=!1,Un=null,va=!1,yo=Error(u(519));function zn(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fi(pa(t,e)),yo}function eh(e){var t=e.stateNode,a=e.type,i=e.memoizedProps;switch(t[Ve]=e,t[ht]=i,a){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(a=0;a<gs.length;a++)ke(gs[a],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),hf(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),pf(t,i.value,i.defaultValue,i.children)}a=i.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||i.suppressHydrationWarning===!0||yp(t.textContent,a)?(i.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),i.onScroll!=null&&ke("scroll",t),i.onScrollEnd!=null&&ke("scrollend",t),i.onClick!=null&&(t.onclick=un),t=!0):t=!1,t||zn(e,!0)}function th(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:va=!1;return;case 27:case 3:va=!0;return;default:Ot=Ot.return}}function si(e){if(e!==Ot)return!1;if(!Te)return th(e),Te=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Dc(e.type,e.memoizedProps)),a=!a),a&&it&&zn(e),th(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));it=kp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));it=kp(e)}else t===27?(t=it,Fn(e.type)?(e=Hc,Hc=null,it=e):it=t):it=Ot?ba(e.stateNode.nextSibling):null;return!0}function Sl(){it=Ot=null,Te=!1}function vo(){var e=Un;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),Un=null),e}function Fi(e){Un===null?Un=[e]:Un.push(e)}var go=N(null),jl=null,fn=null;function Bn(e,t,a){W(go,t._currentValue),t._currentValue=a}function hn(e){e._currentValue=go.current,Y(go)}function bo(e,t,a){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===a)break;e=e.return}}function wo(e,t,a,i){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|=a,g=c.alternate,g!==null&&(g.lanes|=a),bo(c.return,a,e),i||(h=null);break e}c=g.next}}else if(o.tag===18){if(h=o.return,h===null)throw Error(u(341));h.lanes|=a,c=h.alternate,c!==null&&(c.lanes|=a),bo(h,a,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 ri(e,t,a,i){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;Wt(o.pendingProps.value,h.value)||(e!==null?e.push(g):e=[g])}}else if(o===ce.current){if(h=o.alternate,h===null)throw Error(u(387));h.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Ns):e=[Ns])}o=o.return}e!==null&&wo(t,e,a,i),t.flags|=262144}function sr(e){for(e=e.firstContext;e!==null;){if(!Wt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Nl(e){jl=e,fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Lt(e){return ah(jl,e)}function rr(e,t){return jl===null&&Nl(e),ah(e,t)}function ah(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,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 a}var pg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},xg=n.unstable_scheduleCallback,yg=n.unstable_NormalPriority,St={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function So(){return{controller:new pg,data:new Map,refCount:0}}function Wi(e){e.refCount--,e.refCount===0&&xg(yg,function(){e.controller.abort()})}var Pi=null,jo=0,ui=0,oi=null;function vg(e,t){if(Pi===null){var a=Pi=[];jo=0,ui=kc(),oi={status:"pending",value:void 0,then:function(i){a.push(i)}}}return jo++,t.then(nh,nh),t}function nh(){if(--jo===0&&Pi!==null){oi!==null&&(oi.status="fulfilled");var e=Pi;Pi=null,ui=0,oi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function gg(e,t){var a=[],i={status:"pending",value:null,reason:null,then:function(o){a.push(o)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var o=0;o<a.length;o++)(0,a[o])(t)},function(o){for(i.status="rejected",i.reason=o,o=0;o<a.length;o++)(0,a[o])(void 0)}),i}var lh=U.S;U.S=function(e,t){$m=ut(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&vg(e,t),lh!==null&&lh(e,t)};var _l=N(null);function No(){var e=_l.current;return e!==null?e:et.pooledCache}function ur(e,t){t===null?W(_l,_l.current):W(_l,t.pool)}function ih(){var e=No();return e===null?null:{parent:St._currentValue,pool:e}}var ci=Error(u(460)),_o=Error(u(474)),or=Error(u(542)),cr={then:function(){}};function sh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function rh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(un,un),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,oh(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(i){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=i}},function(i){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,oh(e),e}throw Al=t,ci}}function kl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Al=a,ci):a}}var Al=null;function uh(){if(Al===null)throw Error(u(459));var e=Al;return Al=null,e}function oh(e){if(e===ci||e===or)throw Error(u(483))}var di=null,es=0;function dr(e){var t=es;return es+=1,di===null&&(di=[]),rh(di,e,t)}function ts(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function fr(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 ch(e){function t(k,_){if(e){var R=k.deletions;R===null?(k.deletions=[_],k.flags|=16):R.push(_)}}function a(k,_){if(!e)return null;for(;_!==null;)t(k,_),_=_.sibling;return null}function i(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,Z){return _===null||_.tag!==6?(_=ho(R,k.mode,Z),_.return=k,_):(_=o(_,R),_.return=k,_)}function S(k,_,R,Z){var fe=R.type;return fe===$?q(k,_,R.props.children,Z,R.key):_!==null&&(_.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ye&&kl(fe)===_.type)?(_=o(_,R.props),ts(_,R),_.return=k,_):(_=lr(R.type,R.key,R.props,null,k.mode,Z),ts(_,R),_.return=k,_)}function T(k,_,R,Z){return _===null||_.tag!==4||_.stateNode.containerInfo!==R.containerInfo||_.stateNode.implementation!==R.implementation?(_=mo(R,k.mode,Z),_.return=k,_):(_=o(_,R.children||[]),_.return=k,_)}function q(k,_,R,Z,fe){return _===null||_.tag!==7?(_=wl(R,k.mode,Z,fe),_.return=k,_):(_=o(_,R),_.return=k,_)}function Q(k,_,R){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=ho(""+_,k.mode,R),_.return=k,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case X:return R=lr(_.type,_.key,_.props,null,k.mode,R),ts(R,_),R.return=k,R;case E:return _=mo(_,k.mode,R),_.return=k,_;case ye:return _=kl(_),Q(k,_,R)}if(Qe(_)||rt(_))return _=wl(_,k.mode,R,null),_.return=k,_;if(typeof _.then=="function")return Q(k,dr(_),R);if(_.$$typeof===P)return Q(k,rr(k,_),R);fr(k,_)}return null}function O(k,_,R,Z){var fe=_!==null?_.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return fe!==null?null:g(k,_,""+R,Z);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case X:return R.key===fe?S(k,_,R,Z):null;case E:return R.key===fe?T(k,_,R,Z):null;case ye:return R=kl(R),O(k,_,R,Z)}if(Qe(R)||rt(R))return fe!==null?null:q(k,_,R,Z,null);if(typeof R.then=="function")return O(k,_,dr(R),Z);if(R.$$typeof===P)return O(k,_,rr(k,R),Z);fr(k,R)}return null}function M(k,_,R,Z,fe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return k=k.get(R)||null,g(_,k,""+Z,fe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case X:return k=k.get(Z.key===null?R:Z.key)||null,S(_,k,Z,fe);case E:return k=k.get(Z.key===null?R:Z.key)||null,T(_,k,Z,fe);case ye:return Z=kl(Z),M(k,_,R,Z,fe)}if(Qe(Z)||rt(Z))return k=k.get(R)||null,q(_,k,Z,fe,null);if(typeof Z.then=="function")return M(k,_,R,dr(Z),fe);if(Z.$$typeof===P)return M(k,_,R,rr(_,Z),fe);fr(_,Z)}return null}function ie(k,_,R,Z){for(var fe=null,He=null,ue=_,we=_=0,Ce=null;ue!==null&&we<R.length;we++){ue.index>we?(Ce=ue,ue=null):Ce=ue.sibling;var $e=O(k,ue,R[we],Z);if($e===null){ue===null&&(ue=Ce);break}e&&ue&&$e.alternate===null&&t(k,ue),_=c($e,_,we),He===null?fe=$e:He.sibling=$e,He=$e,ue=Ce}if(we===R.length)return a(k,ue),Te&&dn(k,we),fe;if(ue===null){for(;we<R.length;we++)ue=Q(k,R[we],Z),ue!==null&&(_=c(ue,_,we),He===null?fe=ue:He.sibling=ue,He=ue);return Te&&dn(k,we),fe}for(ue=i(ue);we<R.length;we++)Ce=M(ue,k,we,R[we],Z),Ce!==null&&(e&&Ce.alternate!==null&&ue.delete(Ce.key===null?we:Ce.key),_=c(Ce,_,we),He===null?fe=Ce:He.sibling=Ce,He=Ce);return e&&ue.forEach(function(al){return t(k,al)}),Te&&dn(k,we),fe}function me(k,_,R,Z){if(R==null)throw Error(u(151));for(var fe=null,He=null,ue=_,we=_=0,Ce=null,$e=R.next();ue!==null&&!$e.done;we++,$e=R.next()){ue.index>we?(Ce=ue,ue=null):Ce=ue.sibling;var al=O(k,ue,$e.value,Z);if(al===null){ue===null&&(ue=Ce);break}e&&ue&&al.alternate===null&&t(k,ue),_=c(al,_,we),He===null?fe=al:He.sibling=al,He=al,ue=Ce}if($e.done)return a(k,ue),Te&&dn(k,we),fe;if(ue===null){for(;!$e.done;we++,$e=R.next())$e=Q(k,$e.value,Z),$e!==null&&(_=c($e,_,we),He===null?fe=$e:He.sibling=$e,He=$e);return Te&&dn(k,we),fe}for(ue=i(ue);!$e.done;we++,$e=R.next())$e=M(ue,k,we,$e.value,Z),$e!==null&&(e&&$e.alternate!==null&&ue.delete($e.key===null?we:$e.key),_=c($e,_,we),He===null?fe=$e:He.sibling=$e,He=$e);return e&&ue.forEach(function(R0){return t(k,R0)}),Te&&dn(k,we),fe}function Pe(k,_,R,Z){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){a(k,_.sibling),Z=o(_,R.props.children),Z.return=k,k=Z;break e}}else if(_.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ye&&kl(fe)===_.type){a(k,_.sibling),Z=o(_,R.props),ts(Z,R),Z.return=k,k=Z;break e}a(k,_);break}else t(k,_);_=_.sibling}R.type===$?(Z=wl(R.props.children,k.mode,Z,R.key),Z.return=k,k=Z):(Z=lr(R.type,R.key,R.props,null,k.mode,Z),ts(Z,R),Z.return=k,k=Z)}return h(k);case E:e:{for(fe=R.key;_!==null;){if(_.key===fe)if(_.tag===4&&_.stateNode.containerInfo===R.containerInfo&&_.stateNode.implementation===R.implementation){a(k,_.sibling),Z=o(_,R.children||[]),Z.return=k,k=Z;break e}else{a(k,_);break}else t(k,_);_=_.sibling}Z=mo(R,k.mode,Z),Z.return=k,k=Z}return h(k);case ye:return R=kl(R),Pe(k,_,R,Z)}if(Qe(R))return ie(k,_,R,Z);if(rt(R)){if(fe=rt(R),typeof fe!="function")throw Error(u(150));return R=fe.call(R),me(k,_,R,Z)}if(typeof R.then=="function")return Pe(k,_,dr(R),Z);if(R.$$typeof===P)return Pe(k,_,rr(k,R),Z);fr(k,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,_!==null&&_.tag===6?(a(k,_.sibling),Z=o(_,R),Z.return=k,k=Z):(a(k,_),Z=ho(R,k.mode,Z),Z.return=k,k=Z),h(k)):a(k,_)}return function(k,_,R,Z){try{es=0;var fe=Pe(k,_,R,Z);return di=null,fe}catch(ue){if(ue===ci||ue===or)throw ue;var He=Pt(29,ue,null,k.mode);return He.lanes=Z,He.return=k,He}finally{}}}var El=ch(!0),dh=ch(!1),qn=!1;function ko(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ao(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 Hn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function $n(e,t,a){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ze&2)!==0){var o=i.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),i.pending=t,t=nr(e),If(e,null,a),t}return ar(e,i,t,a),nr(e)}function as(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,On(e,a)}}function Eo(e,t){var a=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var o=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var h={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,a=a.next}while(a!==null);c===null?o=c=t:c=c.next=t}else o=c=t;a={baseState:i.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Co=!1;function ns(){if(Co){var e=oi;if(e!==null)throw e}}function ls(e,t,a,i){Co=!1;var o=e.updateQueue;qn=!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?(Ee&O)===O:(i&O)===O){O!==0&&O===ui&&(Co=!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 Pe=a;switch(me.tag){case 1:if(ie=me.payload,typeof ie=="function"){Q=ie.call(Pe,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(Pe,Q,O):ie,O==null)break e;Q=j({},Q,O);break e;case 2:qn=!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),Qn|=h,e.lanes=h,e.memoizedState=Q}}function fh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function hh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)fh(a[e],t)}var fi=N(null),hr=N(0);function mh(e,t){e=Sn,W(hr,e),W(fi,t),Sn=e|t.baseLanes}function Ro(){W(hr,Sn),W(fi,fi.current)}function To(){Sn=hr.current,Y(fi),Y(hr)}var ea=N(null),ga=null;function Yn(e){var t=e.alternate;W(vt,vt.current&1),W(ea,e),ga===null&&(t===null||fi.current!==null||t.memoizedState!==null)&&(ga=e)}function Oo(e){W(vt,vt.current),W(ea,e),ga===null&&(ga=e)}function ph(e){e.tag===22?(W(vt,vt.current),W(ea,e),ga===null&&(ga=e)):Vn()}function Vn(){W(vt,vt.current),W(ea,ea.current)}function ta(e){Y(ea),ga===e&&(ga=null),Y(vt)}var vt=N(0);function mr(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Bc(a)||qc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mn=0,ge=null,Fe=null,jt=null,pr=!1,hi=!1,Cl=!1,xr=0,is=0,mi=null,bg=0;function pt(){throw Error(u(321))}function Lo(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Wt(e[a],t[a]))return!1;return!0}function Mo(e,t,a,i,o,c){return mn=c,ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Wh:Ko,Cl=!1,c=a(i,o),Cl=!1,hi&&(c=yh(t,a,i,o)),xh(e),c}function xh(e){U.H=us;var t=Fe!==null&&Fe.next!==null;if(mn=0,jt=Fe=ge=null,pr=!1,is=0,mi=null,t)throw Error(u(300));e===null||Nt||(e=e.dependencies,e!==null&&sr(e)&&(Nt=!0))}function yh(e,t,a,i){ge=e;var o=0;do{if(hi&&(mi=null),is=0,hi=!1,25<=o)throw Error(u(301));if(o+=1,jt=Fe=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=Ph,c=t(a,i)}while(hi);return c}function wg(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?ss(t):t,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(ge.flags|=1024),t}function Do(){var e=xr!==0;return xr=0,e}function Uo(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function zo(e){if(pr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}pr=!1}mn=0,jt=Fe=ge=null,hi=!1,is=xr=0,mi=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?ge.memoizedState=jt=e:jt=jt.next=e,jt}function gt(){if(Fe===null){var e=ge.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=jt===null?ge.memoizedState:jt.next;if(t!==null)jt=t,Fe=e;else{if(e===null)throw ge.alternate===null?Error(u(467)):Error(u(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},jt===null?ge.memoizedState=jt=e:jt=jt.next=e}return jt}function yr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ss(e){var t=is;return is+=1,mi===null&&(mi=[]),e=rh(mi,e,t),t=ge,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Wh:Ko),e}function vr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ss(e);if(e.$$typeof===P)return Lt(e)}throw Error(u(438,String(e)))}function Bo(e){var t=null,a=ge.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var i=ge.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=yr(),ge.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),i=0;i<e;i++)a[i]=bt;return t.index++,a}function pn(e,t){return typeof t=="function"?t(e):t}function gr(e){var t=gt();return qo(t,Fe,e)}function qo(e,t,a){var i=e.queue;if(i===null)throw Error(u(311));i.lastRenderedReducer=a;var o=e.baseQueue,c=i.pending;if(c!==null){if(o!==null){var h=o.next;o.next=c.next,c.next=h}t.baseQueue=o=c,i.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?(Ee&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===ui&&(q=!0);else if((mn&O)===O){T=T.next,O===ui&&(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,ge.lanes|=O,Qn|=O;Q=T.action,Cl&&a(c,Q),c=T.hasEagerState?T.eagerState:a(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,ge.lanes|=Q,Qn|=Q;T=T.next}while(T!==null&&T!==t);if(S===null?h=c:S.next=g,!Wt(c,e.memoizedState)&&(Nt=!0,q&&(a=oi,a!==null)))throw a;e.memoizedState=c,e.baseState=h,e.baseQueue=S,i.lastRenderedState=c}return o===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Ho(e){var t=gt(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var i=a.dispatch,o=a.pending,c=t.memoizedState;if(o!==null){a.pending=null;var h=o=o.next;do c=e(c,h.action),h=h.next;while(h!==o);Wt(c,t.memoizedState)||(Nt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),a.lastRenderedState=c}return[c,i]}function vh(e,t,a){var i=ge,o=gt(),c=Te;if(c){if(a===void 0)throw Error(u(407));a=a()}else a=t();var h=!Wt((Fe||o).memoizedState,a);if(h&&(o.memoizedState=a,Nt=!0),o=o.queue,Vo(wh.bind(null,i,o,e),[e]),o.getSnapshot!==t||h||jt!==null&&jt.memoizedState.tag&1){if(i.flags|=2048,pi(9,{destroy:void 0},bh.bind(null,i,o,a,t),null),et===null)throw Error(u(349));c||(mn&127)!==0||gh(i,t,a)}return a}function gh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ge.updateQueue,t===null?(t=yr(),ge.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function bh(e,t,a,i){t.value=a,t.getSnapshot=i,Sh(t)&&jh(e)}function wh(e,t,a){return a(function(){Sh(t)&&jh(e)})}function Sh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Wt(e,a)}catch{return!0}}function jh(e){var t=bl(e,2);t!==null&&It(t,e,2)}function $o(e){var t=Ht();if(typeof e=="function"){var a=e;if(e=a(),Cl){Ut(!0);try{a()}finally{Ut(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:e},t}function Nh(e,t,a,i){return e.baseState=a,qo(e,Fe,typeof i=="function"?i:pn)}function Sg(e,t,a,i,o){if(Sr(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?a(!0):c.isTransition=!1,i(c),a=t.pending,a===null?(c.next=t.pending=c,_h(t,c)):(c.next=a.next,t.pending=a.next=c)}}function _h(e,t){var a=t.action,i=t.payload,o=e.state;if(t.isTransition){var c=U.T,h={};U.T=h;try{var g=a(o,i),S=U.S;S!==null&&S(h,g),kh(e,t,g)}catch(T){Yo(e,t,T)}finally{c!==null&&h.types!==null&&(c.types=h.types),U.T=c}}else try{c=a(o,i),kh(e,t,c)}catch(T){Yo(e,t,T)}}function kh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){Ah(e,t,i)},function(i){return Yo(e,t,i)}):Ah(e,t,a)}function Ah(e,t,a){t.status="fulfilled",t.value=a,Eh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,_h(e,a)))}function Yo(e,t,a){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=a,Eh(t),t=t.next;while(t!==i)}e.action=null}function Eh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ch(e,t){return t}function Rh(e,t){if(Te){var a=et.formState;if(a!==null){e:{var i=ge;if(Te){if(it){t:{for(var o=it,c=va;o.nodeType!==8;){if(!c){o=null;break t}if(o=ba(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){it=ba(o.nextSibling),i=o.data==="F!";break e}}zn(i)}i=!1}i&&(t=a[0])}}return a=Ht(),a.memoizedState=a.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ch,lastRenderedState:t},a.queue=i,a=Kh.bind(null,ge,i),i.dispatch=a,i=$o(!1),c=Io.bind(null,ge,!1,i.queue),i=Ht(),o={state:t,dispatch:null,action:e,pending:null},i.queue=o,a=Sg.bind(null,ge,o,c,a),o.dispatch=a,i.memoizedState=e,[t,a,!1]}function Th(e){var t=gt();return Oh(t,Fe,e)}function Oh(e,t,a){if(t=qo(e,t,Ch)[0],e=gr(pn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=ss(t)}catch(h){throw h===ci?or:h}else i=t;t=gt();var o=t.queue,c=o.dispatch;return a!==t.memoizedState&&(ge.flags|=2048,pi(9,{destroy:void 0},jg.bind(null,o,a),null)),[i,c,e]}function jg(e,t){e.action=t}function Lh(e){var t=gt(),a=Fe;if(a!==null)return Oh(t,a,e);gt(),t=t.memoizedState,a=gt();var i=a.queue.dispatch;return a.memoizedState=e,[t,i,!1]}function pi(e,t,a,i){return e={tag:e,create:a,deps:i,inst:t,next:null},t=ge.updateQueue,t===null&&(t=yr(),ge.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(i=a.next,a.next=e,e.next=i,t.lastEffect=e),e}function Mh(){return gt().memoizedState}function br(e,t,a,i){var o=Ht();ge.flags|=e,o.memoizedState=pi(1|t,{destroy:void 0},a,i===void 0?null:i)}function wr(e,t,a,i){var o=gt();i=i===void 0?null:i;var c=o.memoizedState.inst;Fe!==null&&i!==null&&Lo(i,Fe.memoizedState.deps)?o.memoizedState=pi(t,c,a,i):(ge.flags|=e,o.memoizedState=pi(1|t,c,a,i))}function Dh(e,t){br(8390656,8,e,t)}function Vo(e,t){wr(2048,8,e,t)}function Ng(e){ge.flags|=4;var t=ge.updateQueue;if(t===null)t=yr(),ge.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Uh(e){var t=gt().memoizedState;return Ng({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function zh(e,t){return wr(4,2,e,t)}function Bh(e,t){return wr(4,4,e,t)}function qh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hh(e,t,a){a=a!=null?a.concat([e]):null,wr(4,4,qh.bind(null,t,e),a)}function Zo(){}function $h(e,t){var a=gt();t=t===void 0?null:t;var i=a.memoizedState;return t!==null&&Lo(t,i[1])?i[0]:(a.memoizedState=[e,t],e)}function Yh(e,t){var a=gt();t=t===void 0?null:t;var i=a.memoizedState;if(t!==null&&Lo(t,i[1]))return i[0];if(i=e(),Cl){Ut(!0);try{e()}finally{Ut(!1)}}return a.memoizedState=[i,t],i}function Go(e,t,a){return a===void 0||(mn&1073741824)!==0&&(Ee&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Vm(),ge.lanes|=e,Qn|=e,a)}function Vh(e,t,a,i){return Wt(a,t)?a:fi.current!==null?(e=Go(e,a,i),Wt(e,t)||(Nt=!0),e):(mn&42)===0||(mn&1073741824)!==0&&(Ee&261930)===0?(Nt=!0,e.memoizedState=a):(e=Vm(),ge.lanes|=e,Qn|=e,t)}function Zh(e,t,a,i,o){var c=J.p;J.p=c!==0&&8>c?c:8;var h=U.T,g={};U.T=g,Io(e,!1,t,a);try{var S=o(),T=U.S;if(T!==null&&T(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var q=gg(S,i);rs(e,t,q,la(e))}else rs(e,t,i,la(e))}catch(Q){rs(e,t,{then:function(){},status:"rejected",reason:Q},la())}finally{J.p=c,h!==null&&g.types!==null&&(h.types=g.types),U.T=h}}function _g(){}function Qo(e,t,a,i){if(e.tag!==5)throw Error(u(476));var o=Gh(e).queue;Zh(e,o,t,re,a===null?_g:function(){return Qh(e),a(i)})}function Gh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:re},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qh(e){var t=Gh(e);t.next===null&&(t=e.alternate.memoizedState),rs(e,t.next.queue,{},la())}function Xo(){return Lt(Ns)}function Xh(){return gt().memoizedState}function Ih(){return gt().memoizedState}function kg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=la();e=Hn(a);var i=$n(t,e,a);i!==null&&(It(i,t,a),as(i,t,a)),t={cache:So()},e.payload=t;return}t=t.return}}function Ag(e,t,a){var i=la();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Sr(e)?Jh(t,a):(a=co(e,t,a,i),a!==null&&(It(a,e,i),Fh(a,t,i)))}function Kh(e,t,a){var i=la();rs(e,t,a,i)}function rs(e,t,a,i){var o={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Sr(e))Jh(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,a);if(o.hasEagerState=!0,o.eagerState=g,Wt(g,h))return ar(e,t,o,0),et===null&&tr(),!1}catch{}finally{}if(a=co(e,t,o,i),a!==null)return It(a,e,i),Fh(a,t,i),!0}return!1}function Io(e,t,a,i){if(i={lane:2,revertLane:kc(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Sr(e)){if(t)throw Error(u(479))}else t=co(e,a,i,2),t!==null&&It(t,e,2)}function Sr(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function Jh(e,t){hi=pr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Fh(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,On(e,a)}}var us={readContext:Lt,use:vr,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt};us.useEffectEvent=pt;var Wh={readContext:Lt,use:vr,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Dh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,br(4194308,4,qh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return br(4194308,4,e,t)},useInsertionEffect:function(e,t){br(4,2,e,t)},useMemo:function(e,t){var a=Ht();t=t===void 0?null:t;var i=e();if(Cl){Ut(!0);try{e()}finally{Ut(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=Ht();if(a!==void 0){var o=a(t);if(Cl){Ut(!0);try{a(t)}finally{Ut(!1)}}}else o=t;return i.memoizedState=i.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},i.queue=e,e=e.dispatch=Ag.bind(null,ge,e),[i.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=$o(e);var t=e.queue,a=Kh.bind(null,ge,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Zo,useDeferredValue:function(e,t){var a=Ht();return Go(a,e,t)},useTransition:function(){var e=$o(!1);return e=Zh.bind(null,ge,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=ge,o=Ht();if(Te){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),et===null)throw Error(u(349));(Ee&127)!==0||gh(i,t,a)}o.memoizedState=a;var c={value:a,getSnapshot:t};return o.queue=c,Dh(wh.bind(null,i,c,e),[e]),i.flags|=2048,pi(9,{destroy:void 0},bh.bind(null,i,c,a,t),null),a},useId:function(){var e=Ht(),t=et.identifierPrefix;if(Te){var a=Ia,i=Xa;a=(i&~(1<<32-ft(i)-1)).toString(32)+a,t="_"+t+"R_"+a,a=xr++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=bg++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Xo,useFormState:Rh,useActionState:Rh,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Io.bind(null,ge,!0,a),a.dispatch=t,[e,t]},useMemoCache:Bo,useCacheRefresh:function(){return Ht().memoizedState=kg.bind(null,ge)},useEffectEvent:function(e){var t=Ht(),a={impl:e};return t.memoizedState=a,function(){if((Ze&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},Ko={readContext:Lt,use:vr,useCallback:$h,useContext:Lt,useEffect:Vo,useImperativeHandle:Hh,useInsertionEffect:zh,useLayoutEffect:Bh,useMemo:Yh,useReducer:gr,useRef:Mh,useState:function(){return gr(pn)},useDebugValue:Zo,useDeferredValue:function(e,t){var a=gt();return Vh(a,Fe.memoizedState,e,t)},useTransition:function(){var e=gr(pn)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:ss(e),t]},useSyncExternalStore:vh,useId:Xh,useHostTransitionStatus:Xo,useFormState:Th,useActionState:Th,useOptimistic:function(e,t){var a=gt();return Nh(a,Fe,e,t)},useMemoCache:Bo,useCacheRefresh:Ih};Ko.useEffectEvent=Uh;var Ph={readContext:Lt,use:vr,useCallback:$h,useContext:Lt,useEffect:Vo,useImperativeHandle:Hh,useInsertionEffect:zh,useLayoutEffect:Bh,useMemo:Yh,useReducer:Ho,useRef:Mh,useState:function(){return Ho(pn)},useDebugValue:Zo,useDeferredValue:function(e,t){var a=gt();return Fe===null?Go(a,e,t):Vh(a,Fe.memoizedState,e,t)},useTransition:function(){var e=Ho(pn)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:ss(e),t]},useSyncExternalStore:vh,useId:Xh,useHostTransitionStatus:Xo,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,t){var a=gt();return Fe!==null?Nh(a,Fe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Bo,useCacheRefresh:Ih};Ph.useEffectEvent=Uh;function Jo(e,t,a,i){t=e.memoizedState,a=a(i,t),a=a==null?t:j({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Fo={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=la(),o=Hn(i);o.payload=t,a!=null&&(o.callback=a),t=$n(e,o,i),t!==null&&(It(t,e,i),as(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=la(),o=Hn(i);o.tag=1,o.payload=t,a!=null&&(o.callback=a),t=$n(e,o,i),t!==null&&(It(t,e,i),as(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=la(),i=Hn(a);i.tag=2,t!=null&&(i.callback=t),t=$n(e,i,a),t!==null&&(It(t,e,a),as(t,e,a))}};function em(e,t,a,i,o,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,h):t.prototype&&t.prototype.isPureReactComponent?!Ii(a,i)||!Ii(o,c):!0}function tm(e,t,a,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,i),t.state!==e&&Fo.enqueueReplaceState(t,t.state,null)}function Rl(e,t){var a=t;if("ref"in t){a={};for(var i in t)i!=="ref"&&(a[i]=t[i])}if(e=e.defaultProps){a===t&&(a=j({},a));for(var o in e)a[o]===void 0&&(a[o]=e[o])}return a}function am(e){er(e)}function nm(e){console.error(e)}function lm(e){er(e)}function jr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function im(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Wo(e,t,a){return a=Hn(a),a.tag=3,a.payload={element:null},a.callback=function(){jr(e,t)},a}function sm(e){return e=Hn(e),e.tag=3,e}function rm(e,t,a,i){var o=a.type.getDerivedStateFromError;if(typeof o=="function"){var c=i.value;e.payload=function(){return o(c)},e.callback=function(){im(t,a,i)}}var h=a.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){im(t,a,i),typeof o!="function"&&(Xn===null?Xn=new Set([this]):Xn.add(this));var g=i.stack;this.componentDidCatch(i.value,{componentStack:g!==null?g:""})})}function Eg(e,t,a,i,o){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&ri(t,a,o,!0),a=ea.current,a!==null){switch(a.tag){case 31:case 13:return ga===null?Dr():a.alternate===null&&xt===0&&(xt=3),a.flags&=-257,a.flags|=65536,a.lanes=o,i===cr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),jc(e,i,o)),!1;case 22:return a.flags|=65536,i===cr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([i]):a.add(i)),jc(e,i,o)),!1}throw Error(u(435,a.tag))}return jc(e,i,o),Dr(),!1}if(Te)return t=ea.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,i!==yo&&(e=Error(u(422),{cause:i}),Fi(pa(e,a)))):(i!==yo&&(t=Error(u(423),{cause:i}),Fi(pa(t,a))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,i=pa(i,a),o=Wo(e.stateNode,i,o),Eo(e,o),xt!==4&&(xt=2)),!1;var c=Error(u(520),{cause:i});if(c=pa(c,a),xs===null?xs=[c]:xs.push(c),xt!==4&&(xt=2),t===null)return!0;i=pa(i,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=o&-o,a.lanes|=e,e=Wo(a.stateNode,i,e),Eo(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Xn===null||!Xn.has(c))))return a.flags|=65536,o&=-o,a.lanes|=o,o=sm(o),rm(o,e,a,i),Eo(a,o),!1}a=a.return}while(a!==null);return!1}var Po=Error(u(461)),Nt=!1;function Mt(e,t,a,i){t.child=e===null?dh(t,null,a,i):El(t,e.child,a,i)}function um(e,t,a,i,o){a=a.render;var c=t.ref;if("ref"in i){var h={};for(var g in i)g!=="ref"&&(h[g]=i[g])}else h=i;return Nl(t),i=Mo(e,t,a,h,c,o),g=Do(),e!==null&&!Nt?(Uo(e,t,o),xn(e,t,o)):(Te&&g&&po(t),t.flags|=1,Mt(e,t,i,o),t.child)}function om(e,t,a,i,o){if(e===null){var c=a.type;return typeof c=="function"&&!fo(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,cm(e,t,c,i,o)):(e=lr(a.type,null,i,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!rc(e,o)){var h=c.memoizedProps;if(a=a.compare,a=a!==null?a:Ii,a(h,i)&&e.ref===t.ref)return xn(e,t,o)}return t.flags|=1,e=cn(c,i),e.ref=t.ref,e.return=t,t.child=e}function cm(e,t,a,i,o){if(e!==null){var c=e.memoizedProps;if(Ii(c,i)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=i=c,rc(e,o))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,xn(e,t,o)}return ec(e,t,a,i,o)}function dm(e,t,a,i){var o=i.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,e!==null){for(i=t.child=e.child,o=0;i!==null;)o=o|i.lanes|i.childLanes,i=i.sibling;i=o&~c}else i=0,t.child=null;return fm(e,t,c,a,i)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ur(t,c!==null?c.cachePool:null),c!==null?mh(t,c):Ro(),ph(t);else return i=t.lanes=536870912,fm(e,t,c!==null?c.baseLanes|a:a,a,i)}else c!==null?(ur(t,c.cachePool),mh(t,c),Vn(),t.memoizedState=null):(e!==null&&ur(t,null),Ro(),Vn());return Mt(e,t,o,a),t.child}function os(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fm(e,t,a,i,o){var c=No();return c=c===null?null:{parent:St._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&ur(t,null),Ro(),ph(t),e!==null&&ri(e,t,i,!0),t.childLanes=o,null}function Nr(e,t){return t=kr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function hm(e,t,a){return El(t,e.child,null,a),e=Nr(t,t.pendingProps),e.flags|=2,ta(t),t.memoizedState=null,e}function Cg(e,t,a){var i=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Te){if(i.mode==="hidden")return e=Nr(t,i),t.lanes=536870912,os(null,e);if(Oo(t),(e=it)?(e=_p(e,va),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dn!==null?{id:Xa,overflow:Ia}:null,retryLane:536870912,hydrationErrors:null},a=Jf(e),a.return=t,t.child=a,Ot=t,it=null)):e=null,e===null)throw zn(t);return t.lanes=536870912,null}return Nr(t,i)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(Oo(t),o)if(t.flags&256)t.flags&=-257,t=hm(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(Nt||ri(e,t,a,!1),o=(a&e.childLanes)!==0,Nt||o){if(i=et,i!==null&&(h=pl(i,a),h!==0&&h!==c.retryLane))throw c.retryLane=h,bl(e,h),It(i,e,h),Po;Dr(),t=hm(e,t,a)}else e=c.treeContext,it=ba(h.nextSibling),Ot=t,Te=!0,Un=null,va=!1,e!==null&&Pf(t,e),t=Nr(t,i),t.flags|=4096;return t}return e=cn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _r(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ec(e,t,a,i,o){return Nl(t),a=Mo(e,t,a,i,void 0,o),i=Do(),e!==null&&!Nt?(Uo(e,t,o),xn(e,t,o)):(Te&&i&&po(t),t.flags|=1,Mt(e,t,a,o),t.child)}function mm(e,t,a,i,o,c){return Nl(t),t.updateQueue=null,a=yh(t,i,a,o),xh(e),i=Do(),e!==null&&!Nt?(Uo(e,t,c),xn(e,t,c)):(Te&&i&&po(t),t.flags|=1,Mt(e,t,a,c),t.child)}function pm(e,t,a,i,o){if(Nl(t),t.stateNode===null){var c=ni,h=a.contextType;typeof h=="object"&&h!==null&&(c=Lt(h)),c=new a(i,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Fo,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=i,c.state=t.memoizedState,c.refs={},ko(t),h=a.contextType,c.context=typeof h=="object"&&h!==null?Lt(h):ni,c.state=t.memoizedState,h=a.getDerivedStateFromProps,typeof h=="function"&&(Jo(t,a,h,i),c.state=t.memoizedState),typeof a.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&&Fo.enqueueReplaceState(c,c.state,null),ls(t,i,c,o),ns(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){c=t.stateNode;var g=t.memoizedProps,S=Rl(a,g);c.props=S;var T=c.context,q=a.contextType;h=ni,typeof q=="object"&&q!==null&&(h=Lt(q));var Q=a.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)&&tm(t,c,i,h),qn=!1;var O=t.memoizedState;c.state=O,ls(t,i,c,o),ns(),T=t.memoizedState,g||O!==T||qn?(typeof Q=="function"&&(Jo(t,a,Q,i),T=t.memoizedState),(S=qn||em(t,a,S,i,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=i,t.memoizedState=T),c.props=i,c.state=T,c.context=h,i=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{c=t.stateNode,Ao(e,t),h=t.memoizedProps,q=Rl(a,h),c.props=q,Q=t.pendingProps,O=c.context,T=a.contextType,S=ni,typeof T=="object"&&T!==null&&(S=Lt(T)),g=a.getDerivedStateFromProps,(T=typeof g=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==Q||O!==S)&&tm(t,c,i,S),qn=!1,O=t.memoizedState,c.state=O,ls(t,i,c,o),ns();var M=t.memoizedState;h!==Q||O!==M||qn||e!==null&&e.dependencies!==null&&sr(e.dependencies)?(typeof g=="function"&&(Jo(t,a,g,i),M=t.memoizedState),(q=qn||em(t,a,q,i,O,M,S)||e!==null&&e.dependencies!==null&&sr(e.dependencies))?(T||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,M,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,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=i,t.memoizedState=M),c.props=i,c.state=M,c.context=S,i=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),i=!1)}return c=i,_r(e,t),i=(t.flags&128)!==0,c||i?(c=t.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&i?(t.child=El(t,e.child,null,o),t.child=El(t,null,a,o)):Mt(e,t,a,o),t.memoizedState=c.state,e=t.child):e=xn(e,t,o),e}function xm(e,t,a,i){return Sl(),t.flags|=256,Mt(e,t,a,i),t.child}var tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(e){return{baseLanes:e,cachePool:ih()}}function nc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=na),e}function ym(e,t,a){var i=t.pendingProps,o=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),h&&(o=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(o?Yn(t):Vn(),(e=it)?(e=_p(e,va),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dn!==null?{id:Xa,overflow:Ia}:null,retryLane:536870912,hydrationErrors:null},a=Jf(e),a.return=t,t.child=a,Ot=t,it=null)):e=null,e===null)throw zn(t);return qc(e)?t.lanes=32:t.lanes=536870912,null}var g=i.children;return i=i.fallback,o?(Vn(),o=t.mode,g=kr({mode:"hidden",children:g},o),i=wl(i,o,a,null),g.return=t,i.return=t,g.sibling=i,t.child=g,i=t.child,i.memoizedState=ac(a),i.childLanes=nc(e,h,a),t.memoizedState=tc,os(null,i)):(Yn(t),lc(t,g))}var S=e.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(c)t.flags&256?(Yn(t),t.flags&=-257,t=ic(e,t,a)):t.memoizedState!==null?(Vn(),t.child=e.child,t.flags|=128,t=null):(Vn(),g=i.fallback,o=t.mode,i=kr({mode:"visible",children:i.children},o),g=wl(g,o,a,null),g.flags|=2,i.return=t,g.return=t,i.sibling=g,t.child=i,El(t,e.child,null,a),i=t.child,i.memoizedState=ac(a),i.childLanes=nc(e,h,a),t.memoizedState=tc,t=os(null,i));else if(Yn(t),qc(g)){if(h=g.nextSibling&&g.nextSibling.dataset,h)var T=h.dgst;h=T,i=Error(u(419)),i.stack="",i.digest=h,Fi({value:i,source:null,stack:null}),t=ic(e,t,a)}else if(Nt||ri(e,t,a,!1),h=(a&e.childLanes)!==0,Nt||h){if(h=et,h!==null&&(i=pl(h,a),i!==0&&i!==S.retryLane))throw S.retryLane=i,bl(e,i),It(h,e,i),Po;Bc(g)||Dr(),t=ic(e,t,a)}else Bc(g)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,it=ba(g.nextSibling),Ot=t,Te=!0,Un=null,va=!1,e!==null&&Pf(t,e),t=lc(t,i.children),t.flags|=4096);return t}return o?(Vn(),g=i.fallback,o=t.mode,S=e.child,T=S.sibling,i=cn(S,{mode:"hidden",children:i.children}),i.subtreeFlags=S.subtreeFlags&65011712,T!==null?g=cn(T,g):(g=wl(g,o,a,null),g.flags|=2),g.return=t,i.return=t,i.sibling=g,t.child=i,os(null,i),i=t.child,g=e.child.memoizedState,g===null?g=ac(a):(o=g.cachePool,o!==null?(S=St._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=ih(),g={baseLanes:g.baseLanes|a,cachePool:o}),i.memoizedState=g,i.childLanes=nc(e,h,a),t.memoizedState=tc,os(e.child,i)):(Yn(t),a=e.child,e=a.sibling,a=cn(a,{mode:"visible",children:i.children}),a.return=t,a.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=a,t.memoizedState=null,a)}function lc(e,t){return t=kr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function kr(e,t){return e=Pt(22,e,null,t),e.lanes=0,e}function ic(e,t,a){return El(t,e.child,null,a),e=lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vm(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),bo(e.return,t,a)}function sc(e,t,a,i,o,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:o,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=a,h.tailMode=o,h.treeForkCount=c)}function gm(e,t,a){var i=t.pendingProps,o=i.revealOrder,c=i.tail;i=i.children;var h=vt.current,g=(h&2)!==0;if(g?(h=h&1|2,t.flags|=128):h&=1,W(vt,h),Mt(e,t,i,a),i=Te?Ji:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vm(e,a,t);else if(e.tag===19)vm(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&mr(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),sc(t,!1,o,a,c,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&mr(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}sc(t,!0,a,null,c,i);break;case"together":sc(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function xn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Qn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(ri(e,t,a,!1),(a&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,a=cn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=cn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function rc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&sr(e)))}function Rg(e,t,a){switch(t.tag){case 3:Xe(t,t.stateNode.containerInfo),Bn(t,St,e.memoizedState.cache),Sl();break;case 27:case 5:Bt(t);break;case 4:Xe(t,t.stateNode.containerInfo);break;case 10:Bn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Oo(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Yn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?ym(e,t,a):(Yn(t),e=xn(e,t,a),e!==null?e.sibling:null);Yn(t);break;case 19:var o=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(ri(e,t,a,!1),i=(a&t.childLanes)!==0),o){if(i)return gm(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),W(vt,vt.current),i)break;return null;case 22:return t.lanes=0,dm(e,t,a,t.pendingProps);case 24:Bn(t,St,e.memoizedState.cache)}return xn(e,t,a)}function bm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!rc(e,a)&&(t.flags&128)===0)return Nt=!1,Rg(e,t,a);Nt=(e.flags&131072)!==0}else Nt=!1,Te&&(t.flags&1048576)!==0&&Wf(t,Ji,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=kl(t.elementType),t.type=e,typeof e=="function")fo(e)?(i=Rl(e,i),t.tag=1,t=pm(null,t,e,i,a)):(t.tag=0,t=ec(null,t,e,i,a));else{if(e!=null){var o=e.$$typeof;if(o===ne){t.tag=11,t=um(null,t,e,i,a);break e}else if(o===I){t.tag=14,t=om(null,t,e,i,a);break e}}throw t=lt(e)||e,Error(u(306,t,""))}}return t;case 0:return ec(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,o=Rl(i,t.pendingProps),pm(e,t,i,o,a);case 3:e:{if(Xe(t,t.stateNode.containerInfo),e===null)throw Error(u(387));i=t.pendingProps;var c=t.memoizedState;o=c.element,Ao(e,t),ls(t,i,null,a);var h=t.memoizedState;if(i=h.cache,Bn(t,St,i),i!==c.cache&&wo(t,[St],a,!0),ns(),i=h.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=xm(e,t,i,a);break e}else if(i!==o){o=pa(Error(u(424)),t),Fi(o),t=xm(e,t,i,a);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(it=ba(e.firstChild),Ot=t,Te=!0,Un=null,va=!0,a=dh(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Sl(),i===o){t=xn(e,t,a);break e}Mt(e,t,i,a)}t=t.child}return t;case 26:return _r(e,t),e===null?(a=Tp(t.type,null,t.pendingProps,null))?t.memoizedState=a:Te||(a=t.type,e=t.pendingProps,i=Yr(B.current).createElement(a),i[Ve]=t,i[ht]=e,Dt(i,a,e),Ct(i),t.stateNode=i):t.memoizedState=Tp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Bt(t),e===null&&Te&&(i=t.stateNode=Ep(t.type,t.pendingProps,B.current),Ot=t,va=!0,o=it,Fn(t.type)?(Hc=o,it=ba(i.firstChild)):it=o),Mt(e,t,t.pendingProps.children,a),_r(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((o=i=it)&&(i=s0(i,t.type,t.pendingProps,va),i!==null?(t.stateNode=i,Ot=t,it=ba(i.firstChild),va=!1,o=!0):o=!1),o||zn(t)),Bt(t),o=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,i=c.children,Dc(o,c)?i=null:h!==null&&Dc(o,h)&&(t.flags|=32),t.memoizedState!==null&&(o=Mo(e,t,wg,null,null,a),Ns._currentValue=o),_r(e,t),Mt(e,t,i,a),t.child;case 6:return e===null&&Te&&((e=a=it)&&(a=r0(a,t.pendingProps,va),a!==null?(t.stateNode=a,Ot=t,it=null,e=!0):e=!1),e||zn(t)),null;case 13:return ym(e,t,a);case 4:return Xe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=El(t,null,i,a):Mt(e,t,i,a),t.child;case 11:return um(e,t,t.type,t.pendingProps,a);case 7:return Mt(e,t,t.pendingProps,a),t.child;case 8:return Mt(e,t,t.pendingProps.children,a),t.child;case 12:return Mt(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,Bn(t,t.type,i.value),Mt(e,t,i.children,a),t.child;case 9:return o=t.type._context,i=t.pendingProps.children,Nl(t),o=Lt(o),i=i(o),t.flags|=1,Mt(e,t,i,a),t.child;case 14:return om(e,t,t.type,t.pendingProps,a);case 15:return cm(e,t,t.type,t.pendingProps,a);case 19:return gm(e,t,a);case 31:return Cg(e,t,a);case 22:return dm(e,t,a,t.pendingProps);case 24:return Nl(t),i=Lt(St),e===null?(o=No(),o===null&&(o=et,c=So(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=a),o=c),t.memoizedState={parent:i,cache:o},ko(t),Bn(t,St,o)):((e.lanes&a)!==0&&(Ao(e,t),ls(t,null,null,a),ns()),o=e.memoizedState,c=t.memoizedState,o.parent!==i?(o={parent:i,cache:i},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Bn(t,St,i)):(i=c.cache,Bn(t,St,i),i!==o.cache&&wo(t,[St],a,!0))),Mt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function yn(e){e.flags|=4}function uc(e,t,a,i,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(Xm())e.flags|=8192;else throw Al=cr,_o}else e.flags&=-16777217}function wm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Up(t))if(Xm())e.flags|=8192;else throw Al=cr,_o}function Ar(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hl():536870912,e.lanes|=t,gi|=t)}function cs(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,i|=o.subtreeFlags&65011712,i|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,i|=o.subtreeFlags,i|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function Tg(e,t,a){var i=t.pendingProps;switch(xo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return a=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),hn(St),De(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(si(t)?yn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,vo())),st(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(yn(t),c!==null?(st(t),wm(t,c)):(st(t),uc(t,o,null,i,a))):c?c!==e.memoizedState?(yn(t),st(t),wm(t,c)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&yn(t),st(t),uc(t,o,e,i,a)),null;case 27:if(Ta(t),a=B.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&yn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return st(t),null}e=te.current,si(t)?eh(t):(e=Ep(o,i,a),t.stateNode=e,yn(t))}return st(t),null;case 5:if(Ta(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&yn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return st(t),null}if(c=te.current,si(t))eh(t);else{var h=Yr(B.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 i.is=="string"?h.createElement("select",{is:i.is}):h.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?h.createElement(o,{is:i.is}):h.createElement(o)}}c[Ve]=t,c[ht]=i;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,i),o){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&yn(t)}}return st(t),uc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&yn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=B.current,si(t)){if(e=t.stateNode,a=t.memoizedProps,i=null,o=Ot,o!==null)switch(o.tag){case 27:case 5:i=o.memoizedProps}e[Ve]=t,e=!!(e.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||yp(e.nodeValue,a)),e||zn(t,!0)}else e=Yr(e).createTextNode(i),e[Ve]=t,t.stateNode=e}return st(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(i=si(t),a!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Ve]=t}else Sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else a=vo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ta(t),t):(ta(t),null);if((t.flags&128)!==0)throw Error(u(558))}return st(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=si(t),i!==null&&i.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[Ve]=t}else Sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),o=!1}else o=vo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(ta(t),t):(ta(t),null)}return ta(t),(t.flags&128)!==0?(t.lanes=a,t):(a=i!==null,e=e!==null&&e.memoizedState!==null,a&&(i=t.child,o=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(o=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ar(t,t.updateQueue),st(t),null);case 4:return De(),e===null&&Rc(t.stateNode.containerInfo),st(t),null;case 10:return hn(t.type),st(t),null;case 19:if(Y(vt),i=t.memoizedState,i===null)return st(t),null;if(o=(t.flags&128)!==0,c=i.rendering,c===null)if(o)cs(i,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=mr(e),c!==null){for(t.flags|=128,cs(i,!1),e=c.updateQueue,t.updateQueue=e,Ar(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Kf(a,e),a=a.sibling;return W(vt,vt.current&1|2),Te&&dn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&ut()>Or&&(t.flags|=128,o=!0,cs(i,!1),t.lanes=4194304)}else{if(!o)if(e=mr(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Ar(t,e),cs(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!Te)return st(t),null}else 2*ut()-i.renderingStartTime>Or&&a!==536870912&&(t.flags|=128,o=!0,cs(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ut(),e.sibling=null,a=vt.current,W(vt,o?a&1|2:a&1),Te&&dn(t,i.treeForkCount),e):(st(t),null);case 22:case 23:return ta(t),To(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(a&536870912)!==0&&(t.flags&128)===0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),a=t.updateQueue,a!==null&&Ar(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==a&&(t.flags|=2048),e!==null&&Y(_l),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),hn(St),st(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Og(e,t){switch(xo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hn(St),De(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ta(t),null;case 31:if(t.memoizedState!==null){if(ta(t),t.alternate===null)throw Error(u(340));Sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ta(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(vt),null;case 4:return De(),null;case 10:return hn(t.type),null;case 22:case 23:return ta(t),To(),e!==null&&Y(_l),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 Sm(e,t){switch(xo(t),t.tag){case 3:hn(St),De();break;case 26:case 27:case 5:Ta(t);break;case 4:De();break;case 31:t.memoizedState!==null&&ta(t);break;case 13:ta(t);break;case 19:Y(vt);break;case 10:hn(t.type);break;case 22:case 23:ta(t),To(),e!==null&&Y(_l);break;case 24:hn(St)}}function ds(e,t){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var o=i.next;a=o;do{if((a.tag&e)===e){i=void 0;var c=a.create,h=a.inst;i=c(),h.destroy=i}a=a.next}while(a!==o)}}catch(g){Ke(t,t.return,g)}}function Zn(e,t,a){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var c=o.next;i=c;do{if((i.tag&e)===e){var h=i.inst,g=h.destroy;if(g!==void 0){h.destroy=void 0,o=t;var S=a,T=g;try{T()}catch(q){Ke(o,S,q)}}}i=i.next}while(i!==c)}}catch(q){Ke(t,t.return,q)}}function jm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{hh(t,a)}catch(i){Ke(e,e.return,i)}}}function Nm(e,t,a){a.props=Rl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(i){Ke(e,t,i)}}function fs(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof a=="function"?e.refCleanup=a(i):a.current=i}}catch(o){Ke(e,t,o)}}function Ka(e,t){var a=e.ref,i=e.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(o){Ke(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(o){Ke(e,t,o)}else a.current=null}function _m(e){var t=e.type,a=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break e;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(o){Ke(e,e.return,o)}}function oc(e,t,a){try{var i=e.stateNode;e0(i,e.type,a,t),i[ht]=t}catch(o){Ke(e,e.return,o)}}function km(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Fn(e.type)||e.tag===4}function cc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||km(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&&Fn(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 dc(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=un));else if(i!==4&&(i===27&&Fn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(dc(e,t,a),e=e.sibling;e!==null;)dc(e,t,a),e=e.sibling}function Er(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(i!==4&&(i===27&&Fn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Er(e,t,a),e=e.sibling;e!==null;)Er(e,t,a),e=e.sibling}function Am(e){var t=e.stateNode,a=e.memoizedProps;try{for(var i=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Dt(t,i,a),t[Ve]=e,t[ht]=a}catch(c){Ke(e,e.return,c)}}var vn=!1,_t=!1,fc=!1,Em=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function Lg(e,t){if(e=e.containerInfo,Lc=Kr,e=Hf(e),lo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var o=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break e}var h=0,g=-1,S=-1,T=0,q=0,Q=e,O=null;t:for(;;){for(var M;Q!==a||o!==0&&Q.nodeType!==3||(g=h+o),Q!==c||i!==0&&Q.nodeType!==3||(S=h+i),Q.nodeType===3&&(h+=Q.nodeValue.length),(M=Q.firstChild)!==null;)O=Q,Q=M;for(;;){if(Q===e)break t;if(O===a&&++T===o&&(g=h),O===c&&++q===i&&(S=h),(M=Q.nextSibling)!==null)break;Q=O,O=Q.parentNode}Q=M}a=g===-1||S===-1?null:{start:g,end:S}}else a=null}a=a||{start:0,end:0}}else a=null;for(Mc={focusedElem:e,selectionRange:a},Kr=!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(a=0;a<e.length;a++)o=e[a],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,a=t,o=c.memoizedProps,c=c.memoizedState,i=a.stateNode;try{var ie=Rl(a.type,o);e=i.getSnapshotBeforeUpdate(ie,c),i.__reactInternalSnapshotBeforeUpdate=e}catch(me){Ke(a,a.return,me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)zc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zc(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 Cm(e,t,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:bn(e,a),i&4&&ds(5,a);break;case 1:if(bn(e,a),i&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(h){Ke(a,a.return,h)}else{var o=Rl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Ke(a,a.return,h)}}i&64&&jm(a),i&512&&fs(a,a.return);break;case 3:if(bn(e,a),i&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{hh(e,t)}catch(h){Ke(a,a.return,h)}}break;case 27:t===null&&i&4&&Am(a);case 26:case 5:bn(e,a),t===null&&i&4&&_m(a),i&512&&fs(a,a.return);break;case 12:bn(e,a);break;case 31:bn(e,a),i&4&&Om(e,a);break;case 13:bn(e,a),i&4&&Lm(e,a),i&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Yg.bind(null,a),u0(e,a))));break;case 22:if(i=a.memoizedState!==null||vn,!i){t=t!==null&&t.memoizedState!==null||_t,o=vn;var c=_t;vn=i,(_t=t)&&!c?wn(e,a,(a.subtreeFlags&8772)!==0):bn(e,a),vn=o,_t=c}break;case 30:break;default:bn(e,a)}}function Rm(e){var t=e.alternate;t!==null&&(e.alternate=null,Rm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$u(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 ot=null,Zt=!1;function gn(e,t,a){for(a=a.child;a!==null;)Tm(e,t,a),a=a.sibling}function Tm(e,t,a){if(tt&&typeof tt.onCommitFiberUnmount=="function")try{tt.onCommitFiberUnmount(Oa,a)}catch{}switch(a.tag){case 26:_t||Ka(a,t),gn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:_t||Ka(a,t);var i=ot,o=Zt;Fn(a.type)&&(ot=a.stateNode,Zt=!1),gn(e,t,a),ws(a.stateNode),ot=i,Zt=o;break;case 5:_t||Ka(a,t);case 6:if(i=ot,o=Zt,ot=null,gn(e,t,a),ot=i,Zt=o,ot!==null)if(Zt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(a.stateNode)}catch(c){Ke(a,t,c)}else try{ot.removeChild(a.stateNode)}catch(c){Ke(a,t,c)}break;case 18:ot!==null&&(Zt?(e=ot,jp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ai(e)):jp(ot,a.stateNode));break;case 4:i=ot,o=Zt,ot=a.stateNode.containerInfo,Zt=!0,gn(e,t,a),ot=i,Zt=o;break;case 0:case 11:case 14:case 15:Zn(2,a,t),_t||Zn(4,a,t),gn(e,t,a);break;case 1:_t||(Ka(a,t),i=a.stateNode,typeof i.componentWillUnmount=="function"&&Nm(a,t,i)),gn(e,t,a);break;case 21:gn(e,t,a);break;case 22:_t=(i=_t)||a.memoizedState!==null,gn(e,t,a),_t=i;break;default:gn(e,t,a)}}function Om(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ai(e)}catch(a){Ke(t,t.return,a)}}}function Lm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ai(e)}catch(a){Ke(t,t.return,a)}}function Mg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Em),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Em),t;default:throw Error(u(435,e.tag))}}function Cr(e,t){var a=Mg(e);t.forEach(function(i){if(!a.has(i)){a.add(i);var o=Vg.bind(null,e,i);i.then(o,o)}})}function Gt(e,t){var a=t.deletions;if(a!==null)for(var i=0;i<a.length;i++){var o=a[i],c=e,h=t,g=h;e:for(;g!==null;){switch(g.tag){case 27:if(Fn(g.type)){ot=g.stateNode,Zt=!1;break e}break;case 5:ot=g.stateNode,Zt=!1;break e;case 3:case 4:ot=g.stateNode.containerInfo,Zt=!0;break e}g=g.return}if(ot===null)throw Error(u(160));Tm(c,h,o),ot=null,Zt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mm(t,e),t=t.sibling}var Ua=null;function Mm(e,t){var a=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Qt(e),i&4&&(Zn(3,e,e.return),ds(3,e),Zn(5,e,e.return));break;case 1:Gt(t,e),Qt(e),i&512&&(_t||a===null||Ka(a,a.return)),i&64&&vn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?i:a.concat(i))));break;case 26:var o=Ua;if(Gt(t,e),Qt(e),i&512&&(_t||a===null||Ka(a,a.return)),i&4){var c=a!==null?a.memoizedState:null;if(i=e.memoizedState,a===null)if(i===null)if(e.stateNode===null){e:{i=e.type,a=e.memoizedProps,o=o.ownerDocument||o;t:switch(i){case"title":c=o.getElementsByTagName("title")[0],(!c||c[qi]||c[Ve]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(i),o.head.insertBefore(c,o.querySelector("head > title"))),Dt(c,i,a),c[Ve]=e,Ct(c),i=c;break e;case"link":var h=Mp("link","href",o).get(i+(a.href||""));if(h){for(var g=0;g<h.length;g++)if(c=h[g],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){h.splice(g,1);break t}}c=o.createElement(i),Dt(c,i,a),o.head.appendChild(c);break;case"meta":if(h=Mp("meta","content",o).get(i+(a.content||""))){for(g=0;g<h.length;g++)if(c=h[g],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){h.splice(g,1);break t}}c=o.createElement(i),Dt(c,i,a),o.head.appendChild(c);break;default:throw Error(u(468,i))}c[Ve]=e,Ct(c),i=c}e.stateNode=i}else Dp(o,e.type,e.stateNode);else e.stateNode=Lp(o,i,e.memoizedProps);else c!==i?(c===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):c.count--,i===null?Dp(o,e.type,e.stateNode):Lp(o,i,e.memoizedProps)):i===null&&e.stateNode!==null&&oc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Gt(t,e),Qt(e),i&512&&(_t||a===null||Ka(a,a.return)),a!==null&&i&4&&oc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Gt(t,e),Qt(e),i&512&&(_t||a===null||Ka(a,a.return)),e.flags&32){o=e.stateNode;try{Jl(o,"")}catch(ie){Ke(e,e.return,ie)}}i&4&&e.stateNode!=null&&(o=e.memoizedProps,oc(e,o,a!==null?a.memoizedProps:o)),i&1024&&(fc=!0);break;case 6:if(Gt(t,e),Qt(e),i&4){if(e.stateNode===null)throw Error(u(162));i=e.memoizedProps,a=e.stateNode;try{a.nodeValue=i}catch(ie){Ke(e,e.return,ie)}}break;case 3:if(Gr=null,o=Ua,Ua=Vr(t.containerInfo),Gt(t,e),Ua=o,Qt(e),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Ai(t.containerInfo)}catch(ie){Ke(e,e.return,ie)}fc&&(fc=!1,Dm(e));break;case 4:i=Ua,Ua=Vr(e.stateNode.containerInfo),Gt(t,e),Qt(e),Ua=i;break;case 12:Gt(t,e),Qt(e);break;case 31:Gt(t,e),Qt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Cr(e,i)));break;case 13:Gt(t,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Tr=ut()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Cr(e,i)));break;case 22:o=e.memoizedState!==null;var S=a!==null&&a.memoizedState!==null,T=vn,q=_t;if(vn=T||o,_t=q||S,Gt(t,e),_t=q,vn=T,Qt(e),i&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(a===null||S||vn||_t||Tl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){S=a=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){Ke(S,S.return,ie)}}}else if(t.tag===6){if(a===null){S=t;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch(ie){Ke(S,S.return,ie)}}}else if(t.tag===18){if(a===null){S=t;try{var M=S.stateNode;o?Np(M,!0):Np(S.stateNode,!1)}catch(ie){Ke(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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(a=i.retryQueue,a!==null&&(i.retryQueue=null,Cr(e,a))));break;case 19:Gt(t,e),Qt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Cr(e,i)));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 a,i=e.return;i!==null;){if(km(i)){a=i;break}i=i.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var o=a.stateNode,c=cc(e);Er(e,c,o);break;case 5:var h=a.stateNode;a.flags&32&&(Jl(h,""),a.flags&=-33);var g=cc(e);Er(e,g,h);break;case 3:case 4:var S=a.stateNode.containerInfo,T=cc(e);dc(e,T,S);break;default:throw Error(u(161))}}catch(q){Ke(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Dm(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;)Cm(e,t.alternate,t),t=t.sibling}function Tl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Zn(4,t,t.return),Tl(t);break;case 1:Ka(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Nm(t,t.return,a),Tl(t);break;case 27:ws(t.stateNode);case 26:case 5:Ka(t,t.return),Tl(t);break;case 22:t.memoizedState===null&&Tl(t);break;case 30:Tl(t);break;default:Tl(t)}e=e.sibling}}function wn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,o=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:wn(o,c,a),ds(4,c);break;case 1:if(wn(o,c,a),i=c,o=i.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(T){Ke(i,i.return,T)}if(i=c,o=i.updateQueue,o!==null){var g=i.stateNode;try{var S=o.shared.hiddenCallbacks;if(S!==null)for(o.shared.hiddenCallbacks=null,o=0;o<S.length;o++)fh(S[o],g)}catch(T){Ke(i,i.return,T)}}a&&h&64&&jm(c),fs(c,c.return);break;case 27:Am(c);case 26:case 5:wn(o,c,a),a&&i===null&&h&4&&_m(c),fs(c,c.return);break;case 12:wn(o,c,a);break;case 31:wn(o,c,a),a&&h&4&&Om(o,c);break;case 13:wn(o,c,a),a&&h&4&&Lm(o,c);break;case 22:c.memoizedState===null&&wn(o,c,a),fs(c,c.return);break;case 30:break;default:wn(o,c,a)}t=t.sibling}}function hc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Wi(a))}function mc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wi(e))}function za(e,t,a,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Um(e,t,a,i),t=t.sibling}function Um(e,t,a,i){var o=t.flags;switch(t.tag){case 0:case 11:case 15:za(e,t,a,i),o&2048&&ds(9,t);break;case 1:za(e,t,a,i);break;case 3:za(e,t,a,i),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wi(e)));break;case 12:if(o&2048){za(e,t,a,i),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){Ke(t,t.return,S)}}else za(e,t,a,i);break;case 31:za(e,t,a,i);break;case 13:za(e,t,a,i);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?za(e,t,a,i):hs(e,t):c._visibility&2?za(e,t,a,i):(c._visibility|=2,xi(e,t,a,i,(t.subtreeFlags&10256)!==0||!1)),o&2048&&hc(h,t);break;case 24:za(e,t,a,i),o&2048&&mc(t.alternate,t);break;default:za(e,t,a,i)}}function xi(e,t,a,i,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,g=a,S=i,T=h.flags;switch(h.tag){case 0:case 11:case 15:xi(c,h,g,S,o),ds(8,h);break;case 23:break;case 22:var q=h.stateNode;h.memoizedState!==null?q._visibility&2?xi(c,h,g,S,o):hs(c,h):(q._visibility|=2,xi(c,h,g,S,o)),o&&T&2048&&hc(h.alternate,h);break;case 24:xi(c,h,g,S,o),o&&T&2048&&mc(h.alternate,h);break;default:xi(c,h,g,S,o)}t=t.sibling}}function hs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,i=t,o=i.flags;switch(i.tag){case 22:hs(a,i),o&2048&&hc(i.alternate,i);break;case 24:hs(a,i),o&2048&&mc(i.alternate,i);break;default:hs(a,i)}t=t.sibling}}var ms=8192;function yi(e,t,a){if(e.subtreeFlags&ms)for(e=e.child;e!==null;)zm(e,t,a),e=e.sibling}function zm(e,t,a){switch(e.tag){case 26:yi(e,t,a),e.flags&ms&&e.memoizedState!==null&&b0(a,Ua,e.memoizedState,e.memoizedProps);break;case 5:yi(e,t,a);break;case 3:case 4:var i=Ua;Ua=Vr(e.stateNode.containerInfo),yi(e,t,a),Ua=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ms,ms=16777216,yi(e,t,a),ms=i):yi(e,t,a));break;default:yi(e,t,a)}}function Bm(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 ps(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];Rt=i,Hm(i,e)}Bm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qm(e),e=e.sibling}function qm(e){switch(e.tag){case 0:case 11:case 15:ps(e),e.flags&2048&&Zn(9,e,e.return);break;case 3:ps(e);break;case 12:ps(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Rr(e)):ps(e);break;default:ps(e)}}function Rr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];Rt=i,Hm(i,e)}Bm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Zn(8,t,t.return),Rr(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Rr(t));break;default:Rr(t)}e=e.sibling}}function Hm(e,t){for(;Rt!==null;){var a=Rt;switch(a.tag){case 0:case 11:case 15:Zn(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var i=a.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Wi(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,Rt=i;else e:for(a=e;Rt!==null;){i=Rt;var o=i.sibling,c=i.return;if(Rm(i),i===a){Rt=null;break e}if(o!==null){o.return=c,Rt=o;break e}Rt=c}}}var Dg={getCacheForType:function(e){var t=Lt(St),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Lt(St).controller.signal}},Ug=typeof WeakMap=="function"?WeakMap:Map,Ze=0,et=null,_e=null,Ee=0,Ie=0,aa=null,Gn=!1,vi=!1,pc=!1,Sn=0,xt=0,Qn=0,Ol=0,xc=0,na=0,gi=0,xs=null,Xt=null,yc=!1,Tr=0,$m=0,Or=1/0,Lr=null,Xn=null,Et=0,In=null,bi=null,jn=0,vc=0,gc=null,Ym=null,ys=0,bc=null;function la(){return(Ze&2)!==0&&Ee!==0?Ee&-Ee:U.T!==null?kc():G()}function Vm(){if(na===0)if((Ee&536870912)===0||Te){var e=nn;nn<<=1,(nn&3932160)===0&&(nn=262144),na=e}else na=536870912;return e=ea.current,e!==null&&(e.flags|=32),na}function It(e,t,a){(e===et&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)&&(wi(e,0),Kn(e,Ee,na,!1)),sn(e,a),((Ze&2)===0||e!==et)&&(e===et&&((Ze&2)===0&&(Ol|=a),xt===4&&Kn(e,Ee,na,!1)),Ja(e))}function Zm(e,t,a){if((Ze&6)!==0)throw Error(u(327));var i=!a&&(t&127)===0&&(t&e.expiredLanes)===0||ln(e,t),o=i?qg(e,t):Sc(e,t,!0),c=i;do{if(o===0){vi&&!i&&Kn(e,t,0,!1);break}else{if(a=e.current.alternate,c&&!zg(a)){o=Sc(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=xs;var S=g.current.memoizedState.isDehydrated;if(S&&(wi(g,h).flags|=256),h=Sc(g,h,!1),h!==2){if(pc&&!S){g.errorRecoveryDisabledLanes|=c,Ol|=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){wi(e,0),Kn(e,t,0,!0);break}e:{switch(i=e,c=o,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Kn(i,t,na,!Gn);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=Tr+300-ut(),10<o)){if(Kn(i,t,na,!Gn),Tn(i,0,!0)!==0)break e;jn=t,i.timeoutHandle=wp(Gm.bind(null,i,a,Xt,Lr,yc,t,na,Ol,gi,Gn,c,"Throttled",-0,0),o);break e}Gm(i,a,Xt,Lr,yc,t,na,Ol,gi,Gn,c,null,-0,0)}}break}while(!0);Ja(e)}function Gm(e,t,a,i,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},zm(t,c,Q);var ie=(c&62914560)===c?Tr-ut():(c&4194048)===c?$m-ut():0;if(ie=w0(Q,ie),ie!==null){jn=c,e.cancelPendingCommit=ie(Pm.bind(null,e,t,c,a,i,o,h,g,S,q,Q,null,O,M)),Kn(e,c,h,!T);return}}Pm(e,t,c,a,i,o,h,g,S)}function zg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var i=0;i<a.length;i++){var o=a[i],c=o.getSnapshot;o=o.value;try{if(!Wt(c(),o))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Kn(e,t,a,i){t&=~xc,t&=~Ol,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var o=t;0<o;){var c=31-ft(o),h=1<<c;i[c]=-1,o&=~h}a!==0&&Zl(e,a,t)}function Mr(){return(Ze&6)===0?(vs(0),!1):!0}function wc(){if(_e!==null){if(Ie===0)var e=_e.return;else e=_e,fn=jl=null,zo(e),di=null,es=0,e=_e;for(;e!==null;)Sm(e.alternate,e),e=e.return;_e=null}}function wi(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,n0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),jn=0,wc(),et=e,_e=a=cn(e.current,null),Ee=t,Ie=0,aa=null,Gn=!1,vi=ln(e,t),pc=!1,gi=na=xc=Ol=Qn=xt=0,Xt=xs=null,yc=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var o=31-ft(i),c=1<<o;t|=e[o],i&=~c}return Sn=t,tr(),a}function Qm(e,t){ge=null,U.H=us,t===ci||t===or?(t=uh(),Ie=3):t===_o?(t=uh(),Ie=4):Ie=t===Po?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,aa=t,_e===null&&(xt=1,jr(e,pa(t,e.current)))}function Xm(){var e=ea.current;return e===null?!0:(Ee&4194048)===Ee?ga===null:(Ee&62914560)===Ee||(Ee&536870912)!==0?e===ga:!1}function Im(){var e=U.H;return U.H=us,e===null?us:e}function Km(){var e=U.A;return U.A=Dg,e}function Dr(){xt=4,Gn||(Ee&4194048)!==Ee&&ea.current!==null||(vi=!0),(Qn&134217727)===0&&(Ol&134217727)===0||et===null||Kn(et,Ee,na,!1)}function Sc(e,t,a){var i=Ze;Ze|=2;var o=Im(),c=Km();(et!==e||Ee!==t)&&(Lr=null,wi(e,t)),t=!1;var h=xt;e:do try{if(Ie!==0&&_e!==null){var g=_e,S=aa;switch(Ie){case 8:wc(),h=6;break e;case 3:case 2:case 9:case 6:ea.current===null&&(t=!0);var T=Ie;if(Ie=0,aa=null,Si(e,g,S,T),a&&vi){h=0;break e}break;default:T=Ie,Ie=0,aa=null,Si(e,g,S,T)}}Bg(),h=xt;break}catch(q){Qm(e,q)}while(!0);return t&&e.shellSuspendCounter++,fn=jl=null,Ze=i,U.H=o,U.A=c,_e===null&&(et=null,Ee=0,tr()),h}function Bg(){for(;_e!==null;)Jm(_e)}function qg(e,t){var a=Ze;Ze|=2;var i=Im(),o=Km();et!==e||Ee!==t?(Lr=null,Or=ut()+500,wi(e,t)):vi=ln(e,t);e:do try{if(Ie!==0&&_e!==null){t=_e;var c=aa;t:switch(Ie){case 1:Ie=0,aa=null,Si(e,t,c,1);break;case 2:case 9:if(sh(c)){Ie=0,aa=null,Fm(t);break}t=function(){Ie!==2&&Ie!==9||et!==e||(Ie=7),Ja(e)},c.then(t,t);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:sh(c)?(Ie=0,aa=null,Fm(t)):(Ie=0,aa=null,Si(e,t,c,7));break;case 5:var h=null;switch(_e.tag){case 26:h=_e.memoizedState;case 5:case 27:var g=_e;if(h?Up(h):g.stateNode.complete){Ie=0,aa=null;var S=g.sibling;if(S!==null)_e=S;else{var T=g.return;T!==null?(_e=T,Ur(T)):_e=null}break t}}Ie=0,aa=null,Si(e,t,c,5);break;case 6:Ie=0,aa=null,Si(e,t,c,6);break;case 8:wc(),xt=6;break e;default:throw Error(u(462))}}Hg();break}catch(q){Qm(e,q)}while(!0);return fn=jl=null,U.H=i,U.A=o,Ze=a,_e!==null?0:(et=null,Ee=0,tr(),xt)}function Hg(){for(;_e!==null&&!tn();)Jm(_e)}function Jm(e){var t=bm(e.alternate,e,Sn);e.memoizedProps=e.pendingProps,t===null?Ur(e):_e=t}function Fm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=mm(a,t,t.pendingProps,t.type,void 0,Ee);break;case 11:t=mm(a,t,t.pendingProps,t.type.render,t.ref,Ee);break;case 5:zo(t);default:Sm(a,t),t=_e=Kf(t,Sn),t=bm(a,t,Sn)}e.memoizedProps=e.pendingProps,t===null?Ur(e):_e=t}function Si(e,t,a,i){fn=jl=null,zo(t),di=null,es=0;var o=t.return;try{if(Eg(e,o,t,a,Ee)){xt=1,jr(e,pa(a,e.current)),_e=null;return}}catch(c){if(o!==null)throw _e=o,c;xt=1,jr(e,pa(a,e.current)),_e=null;return}t.flags&32768?(Te||i===1?e=!0:vi||(Ee&536870912)!==0?e=!1:(Gn=e=!0,(i===2||i===9||i===3||i===6)&&(i=ea.current,i!==null&&i.tag===13&&(i.flags|=16384))),Wm(t,e)):Ur(t)}function Ur(e){var t=e;do{if((t.flags&32768)!==0){Wm(t,Gn);return}e=t.return;var a=Tg(t.alternate,t,Sn);if(a!==null){_e=a;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);xt===0&&(xt=5)}function Wm(e,t){do{var a=Og(e.alternate,e);if(a!==null){a.flags&=32767,_e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=a}while(e!==null);xt=6,_e=null}function Pm(e,t,a,i,o,c,h,g,S){e.cancelPendingCommit=null;do zr();while(Et!==0);if((Ze&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=oo,Bi(e,a,c,h,g,S),e===et&&(_e=et=null,Ee=0),bi=t,In=e,jn=a,vc=c,gc=o,Ym=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Zg(qt,function(){return lp(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null,o=J.p,J.p=2,h=Ze,Ze|=4;try{Lg(e,t,a)}finally{Ze=h,J.p=o,U.T=i}}Et=1,ep(),tp(),ap()}}function ep(){if(Et===1){Et=0;var e=In,t=bi,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var i=J.p;J.p=2;var o=Ze;Ze|=4;try{Mm(t,e);var c=Mc,h=Hf(e.containerInfo),g=c.focusedElem,S=c.selectionRange;if(h!==g&&g&&g.ownerDocument&&qf(g.ownerDocument.documentElement,g)){if(S!==null&&lo(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),Pe=S.end===void 0?me:Math.min(S.end,ie);!M.extend&&me>Pe&&(h=Pe,Pe=me,me=h);var k=Bf(g,me),_=Bf(g,Pe);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>Pe?(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 Z=Q[g];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Kr=!!Lc,Mc=Lc=null}finally{Ze=o,J.p=i,U.T=a}}e.current=t,Et=2}}function tp(){if(Et===2){Et=0;var e=In,t=bi,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=U.T,U.T=null;var i=J.p;J.p=2;var o=Ze;Ze|=4;try{Cm(e,t.alternate,t)}finally{Ze=o,J.p=i,U.T=a}}Et=3}}function ap(){if(Et===4||Et===3){Et=0,ol();var e=In,t=bi,a=jn,i=Ym;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Et=5:(Et=0,bi=In=null,np(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Xn=null),Ma(a),t=t.stateNode,tt&&typeof tt.onCommitFiberRoot=="function")try{tt.onCommitFiberRoot(Oa,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=U.T,o=J.p,J.p=2,U.T=null;try{for(var c=e.onRecoverableError,h=0;h<i.length;h++){var g=i[h];c(g.value,{componentStack:g.stack})}}finally{U.T=t,J.p=o}}(jn&3)!==0&&zr(),Ja(e),o=e.pendingLanes,(a&261930)!==0&&(o&42)!==0?e===bc?ys++:(ys=0,bc=e):ys=0,vs(0)}}function np(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Wi(t)))}function zr(){return ep(),tp(),ap(),lp()}function lp(){if(Et!==5)return!1;var e=In,t=vc;vc=0;var a=Ma(jn),i=U.T,o=J.p;try{J.p=32>a?32:a,U.T=null,a=gc,gc=null;var c=In,h=jn;if(Et=0,bi=In=null,jn=0,(Ze&6)!==0)throw Error(u(331));var g=Ze;if(Ze|=4,qm(c.current),Um(c,c.current,h,a),Ze=g,vs(0,!1),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(Oa,c)}catch{}return!0}finally{J.p=o,U.T=i,np(e,t)}}function ip(e,t,a){t=pa(a,t),t=Wo(e.stateNode,t,2),e=$n(e,t,2),e!==null&&(sn(e,2),Ja(e))}function Ke(e,t,a){if(e.tag===3)ip(e,e,a);else for(;t!==null;){if(t.tag===3){ip(t,e,a);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Xn===null||!Xn.has(i))){e=pa(a,e),a=sm(2),i=$n(t,a,2),i!==null&&(rm(a,i,t,e),sn(i,2),Ja(i));break}}t=t.return}}function jc(e,t,a){var i=e.pingCache;if(i===null){i=e.pingCache=new Ug;var o=new Set;i.set(t,o)}else o=i.get(t),o===void 0&&(o=new Set,i.set(t,o));o.has(a)||(pc=!0,o.add(a),e=$g.bind(null,e,t,a),t.then(e,e))}function $g(e,t,a){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,et===e&&(Ee&a)===a&&(xt===4||xt===3&&(Ee&62914560)===Ee&&300>ut()-Tr?(Ze&2)===0&&wi(e,0):xc|=a,gi===Ee&&(gi=0)),Ja(e)}function sp(e,t){t===0&&(t=hl()),e=bl(e,t),e!==null&&(sn(e,t),Ja(e))}function Yg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),sp(e,a)}function Vg(e,t){var a=0;switch(e.tag){case 31:case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),sp(e,a)}function Zg(e,t){return Ga(e,t)}var Br=null,ji=null,Nc=!1,qr=!1,_c=!1,Jn=0;function Ja(e){e!==ji&&e.next===null&&(ji===null?Br=ji=e:ji=ji.next=e),qr=!0,Nc||(Nc=!0,Qg())}function vs(e,t){if(!_c&&qr){_c=!0;do for(var a=!1,i=Br;i!==null;){if(e!==0){var o=i.pendingLanes;if(o===0)var c=0;else{var h=i.suspendedLanes,g=i.pingedLanes;c=(1<<31-ft(42|e)+1)-1,c&=o&~(h&~g),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,cp(i,c))}else c=Ee,c=Tn(i,i===et?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||ln(i,c)||(a=!0,cp(i,c));i=i.next}while(a);_c=!1}}function Gg(){rp()}function rp(){qr=Nc=!1;var e=0;Jn!==0&&a0()&&(e=Jn);for(var t=ut(),a=null,i=Br;i!==null;){var o=i.next,c=up(i,t);c===0?(i.next=null,a===null?Br=o:a.next=o,o===null&&(ji=a)):(a=i,(e!==0||(c&3)!==0)&&(qr=!0)),i=o}Et!==0&&Et!==5||vs(e),Jn!==0&&(Jn=0)}function up(e,t){for(var a=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-ft(c),g=1<<h,S=o[h];S===-1?((g&a)===0||(g&i)!==0)&&(o[h]=Tt(g,t)):S<=t&&(e.expiredLanes|=g),c&=~g}if(t=et,a=Ee,a=Tn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,a===0||e===t&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&oa(i),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ln(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(i!==null&&oa(i),Ma(a)){case 2:case 8:a=cl;break;case 32:a=qt;break;case 268435456:a=dl;break;default:a=qt}return i=op.bind(null,e),a=Ga(a,i),e.callbackPriority=t,e.callbackNode=a,t}return i!==null&&i!==null&&oa(i),e.callbackPriority=2,e.callbackNode=null,2}function op(e,t){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(zr()&&e.callbackNode!==a)return null;var i=Ee;return i=Tn(e,e===et?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Zm(e,i,t),up(e,ut()),e.callbackNode!=null&&e.callbackNode===a?op.bind(null,e):null)}function cp(e,t){if(zr())return null;Zm(e,t,!0)}function Qg(){l0(function(){(Ze&6)!==0?Ga(Ue,Gg):rp()})}function kc(){if(Jn===0){var e=ui;e===0&&(e=an,an<<=1,(an&261888)===0&&(an=256)),Jn=e}return Jn}function dp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xs(""+e)}function fp(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Xg(e,t,a,i,o){if(t==="submit"&&a&&a.stateNode===o){var c=dp((o[ht]||null).action),h=i.submitter;h&&(t=(t=h[ht]||null)?dp(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var g=new Fs("action","action",null,i,o);e.push({event:g,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Jn!==0){var S=h?fp(o,h):new FormData(o);Qo(a,{pending:!0,data:S,method:o.method,action:c},null,S)}}else typeof c=="function"&&(g.preventDefault(),S=h?fp(o,h):new FormData(o),Qo(a,{pending:!0,data:S,method:o.method,action:c},c,S))},currentTarget:o}]})}}for(var Ac=0;Ac<uo.length;Ac++){var Ec=uo[Ac],Ig=Ec.toLowerCase(),Kg=Ec[0].toUpperCase()+Ec.slice(1);Da(Ig,"on"+Kg)}Da(Vf,"onAnimationEnd"),Da(Zf,"onAnimationIteration"),Da(Gf,"onAnimationStart"),Da("dblclick","onDoubleClick"),Da("focusin","onFocus"),Da("focusout","onBlur"),Da(dg,"onTransitionRun"),Da(fg,"onTransitionStart"),Da(hg,"onTransitionCancel"),Da(Qf,"onTransitionEnd"),Il("onMouseEnter",["mouseout","mouseover"]),Il("onMouseLeave",["mouseout","mouseover"]),Il("onPointerEnter",["pointerout","pointerover"]),Il("onPointerLeave",["pointerout","pointerover"]),xl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xl("onBeforeInput",["compositionend","keypress","textInput","paste"]),xl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gs="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(" "),Jg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gs));function hp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var i=e[a],o=i.event;i=i.listeners;e:{var c=void 0;if(t)for(var h=i.length-1;0<=h;h--){var g=i[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){er(q)}o.currentTarget=null,c=S}else for(h=0;h<i.length;h++){if(g=i[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){er(q)}o.currentTarget=null,c=S}}}}function ke(e,t){var a=t[C];a===void 0&&(a=t[C]=new Set);var i=e+"__bubble";a.has(i)||(mp(t,e,2,!1),a.add(i))}function Cc(e,t,a){var i=0;t&&(i|=4),mp(a,e,i,t)}var Hr="_reactListening"+Math.random().toString(36).slice(2);function Rc(e){if(!e[Hr]){e[Hr]=!0,rf.forEach(function(a){a!=="selectionchange"&&(Jg.has(a)||Cc(a,!1,e),Cc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hr]||(t[Hr]=!0,Cc("selectionchange",!1,t))}}function mp(e,t,a,i){switch(Vp(t)){case 2:var o=N0;break;case 8:o=_0;break;default:o=Gc}a=o.bind(null,t,a,e),o=void 0,!Ku||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),i?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function Tc(e,t,a,i,o){var c=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var h=i.tag;if(h===3||h===4){var g=i.stateNode.containerInfo;if(g===o)break;if(h===4)for(h=i.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=Gl(g),h===null)return;if(S=h.tag,S===5||S===6||S===26||S===27){i=c=h;continue e}g=g.parentNode}}i=i.return}gf(function(){var T=c,q=Xu(a),Q=[];e:{var O=Xf.get(e);if(O!==void 0){var M=Fs,ie=e;switch(e){case"keypress":if(Ks(a)===0)break e;case"keydown":case"keyup":M=Vv;break;case"focusin":ie="focus",M=Pu;break;case"focusout":ie="blur",M=Pu;break;case"beforeblur":case"afterblur":M=Pu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":M=Sf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=Tv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=Qv;break;case Vf:case Zf:case Gf:M=Mv;break;case Qf:M=Iv;break;case"scroll":case"scrollend":M=Cv;break;case"wheel":M=Jv;break;case"copy":case"cut":case"paste":M=Uv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=Nf;break;case"toggle":case"beforetoggle":M=Wv}var me=(t&4)!==0,Pe=!me&&(e==="scroll"||e==="scrollend"),k=me?O!==null?O+"Capture":null:O;me=[];for(var _=T,R;_!==null;){var Z=_;if(R=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||R===null||k===null||(Z=$i(_,k),Z!=null&&me.push(bs(_,Z,R))),Pe)break;_=_.return}0<me.length&&(O=new M(O,ie,null,a,q),Q.push({event:O,listeners:me}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",M=e==="mouseout"||e==="pointerout",O&&a!==Qu&&(ie=a.relatedTarget||a.fromElement)&&(Gl(ie)||ie[mt]))break e;if((M||O)&&(O=q.window===q?q:(O=q.ownerDocument)?O.defaultView||O.parentWindow:window,M?(ie=a.relatedTarget||a.toElement,M=T,ie=ie?Gl(ie):null,ie!==null&&(Pe=f(ie),me=ie.tag,ie!==Pe||me!==5&&me!==27&&me!==6)&&(ie=null)):(M=null,ie=T),M!==ie)){if(me=Sf,Z="onMouseLeave",k="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(me=Nf,Z="onPointerLeave",k="onPointerEnter",_="pointer"),Pe=M==null?O:Hi(M),R=ie==null?O:Hi(ie),O=new me(Z,_+"leave",M,a,q),O.target=Pe,O.relatedTarget=R,Z=null,Gl(q)===T&&(me=new me(k,_+"enter",ie,a,q),me.target=R,me.relatedTarget=Pe,Z=me),Pe=Z,M&&ie)t:{for(me=Fg,k=M,_=ie,R=0,Z=k;Z;Z=me(Z))R++;Z=0;for(var fe=_;fe;fe=me(fe))Z++;for(;0<R-Z;)k=me(k),R--;for(;0<Z-R;)_=me(_),Z--;for(;R--;){if(k===_||_!==null&&k===_.alternate){me=k;break t}k=me(k),_=me(_)}me=null}else me=null;M!==null&&pp(Q,O,M,me,!1),ie!==null&&Pe!==null&&pp(Q,Pe,ie,me,!0)}}e:{if(O=T?Hi(T):window,M=O.nodeName&&O.nodeName.toLowerCase(),M==="select"||M==="input"&&O.type==="file")var He=Of;else if(Rf(O))if(Lf)He=ug;else{He=sg;var ue=ig}else M=O.nodeName,!M||M.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?T&&Gu(T.elementType)&&(He=Of):He=rg;if(He&&(He=He(e,T))){Tf(Q,He,a,q);break e}ue&&ue(e,O,T),e==="focusout"&&T&&O.type==="number"&&T.memoizedProps.value!=null&&Zu(O,"number",O.value)}switch(ue=T?Hi(T):window,e){case"focusin":(Rf(ue)||ue.contentEditable==="true")&&(ei=ue,io=T,Ki=null);break;case"focusout":Ki=io=ei=null;break;case"mousedown":so=!0;break;case"contextmenu":case"mouseup":case"dragend":so=!1,$f(Q,a,q);break;case"selectionchange":if(cg)break;case"keydown":case"keyup":$f(Q,a,q)}var we;if(to)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Pl?Ef(e,a)&&(Ce="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ce="onCompositionStart");Ce&&(_f&&a.locale!=="ko"&&(Pl||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Pl&&(we=bf()):(Mn=q,Ju="value"in Mn?Mn.value:Mn.textContent,Pl=!0)),ue=$r(T,Ce),0<ue.length&&(Ce=new jf(Ce,e,null,a,q),Q.push({event:Ce,listeners:ue}),we?Ce.data=we:(we=Cf(a),we!==null&&(Ce.data=we)))),(we=eg?tg(e,a):ag(e,a))&&(Ce=$r(T,"onBeforeInput"),0<Ce.length&&(ue=new jf("onBeforeInput","beforeinput",null,a,q),Q.push({event:ue,listeners:Ce}),ue.data=we)),Xg(Q,e,T,a,q)}hp(Q,t)})}function bs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function $r(e,t){for(var a=t+"Capture",i=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=$i(e,a),o!=null&&i.unshift(bs(e,o,c)),o=$i(e,t),o!=null&&i.push(bs(e,o,c))),e.tag===3)return i;e=e.return}return[]}function Fg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pp(e,t,a,i,o){for(var c=t._reactName,h=[];a!==null&&a!==i;){var g=a,S=g.alternate,T=g.stateNode;if(g=g.tag,S!==null&&S===i)break;g!==5&&g!==26&&g!==27||T===null||(S=T,o?(T=$i(a,c),T!=null&&h.unshift(bs(a,T,S))):o||(T=$i(a,c),T!=null&&h.push(bs(a,T,S)))),a=a.return}h.length!==0&&e.push({event:t,listeners:h})}var Wg=/\r\n?/g,Pg=/\u0000|\uFFFD/g;function xp(e){return(typeof e=="string"?e:""+e).replace(Wg,`
49
- `).replace(Pg,"")}function yp(e,t){return t=xp(t),xp(e)===t}function We(e,t,a,i,o,c){switch(a){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Jl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Jl(e,""+i);break;case"className":Gs(e,"class",i);break;case"tabIndex":Gs(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Gs(e,a,i);break;case"style":yf(e,i,c);break;case"data":if(t!=="object"){Gs(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Xs(""+i),e.setAttribute(a,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(a==="formAction"?(t!=="input"&&We(e,t,"name",o.name,o,null),We(e,t,"formEncType",o.formEncType,o,null),We(e,t,"formMethod",o.formMethod,o,null),We(e,t,"formTarget",o.formTarget,o,null)):(We(e,t,"encType",o.encType,o,null),We(e,t,"method",o.method,o,null),We(e,t,"target",o.target,o,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Xs(""+i),e.setAttribute(a,i);break;case"onClick":i!=null&&(e.onclick=un);break;case"onScroll":i!=null&&ke("scroll",e);break;case"onScrollEnd":i!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}a=Xs(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""+i):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":i===!0?e.setAttribute(a,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,i):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(a,i):e.removeAttribute(a);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(a):e.setAttribute(a,i);break;case"popover":ke("beforetoggle",e),ke("toggle",e),Zs(e,"popover",i);break;case"xlinkActuate":rn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":rn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":rn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":rn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":rn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":rn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":rn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":rn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":rn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Zs(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Av.get(a)||a,Zs(e,a,i))}}function Oc(e,t,a,i,o,c){switch(a){case"style":yf(e,i,c);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof i=="string"?Jl(e,i):(typeof i=="number"||typeof i=="bigint")&&Jl(e,""+i);break;case"onScroll":i!=null&&ke("scroll",e);break;case"onScrollEnd":i!=null&&ke("scrollend",e);break;case"onClick":i!=null&&(e.onclick=un);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!uf.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(o=a.endsWith("Capture"),t=a.slice(2,o?a.length-7:void 0),c=e[ht]||null,c=c!=null?c[a]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof i=="function")){typeof c!="function"&&c!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,i,o);break e}a in e?e[a]=i:i===!0?e.setAttribute(a,""):Zs(e,a,i)}}}function Dt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var i=!1,o=!1,c;for(c in a)if(a.hasOwnProperty(c)){var h=a[c];if(h!=null)switch(c){case"src":i=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:We(e,t,c,h,a,null)}}o&&We(e,t,"srcSet",a.srcSet,a,null),i&&We(e,t,"src",a.src,a,null);return;case"input":ke("invalid",e);var g=c=h=o=null,S=null,T=null;for(i in a)if(a.hasOwnProperty(i)){var q=a[i];if(q!=null)switch(i){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:We(e,t,i,q,a,null)}}hf(e,c,g,S,T,h,o,!1);return;case"select":ke("invalid",e),i=h=c=null;for(o in a)if(a.hasOwnProperty(o)&&(g=a[o],g!=null))switch(o){case"value":c=g;break;case"defaultValue":h=g;break;case"multiple":i=g;default:We(e,t,o,g,a,null)}t=c,a=h,e.multiple=!!i,t!=null?Kl(e,!!i,t,!1):a!=null&&Kl(e,!!i,a,!0);return;case"textarea":ke("invalid",e),c=o=i=null;for(h in a)if(a.hasOwnProperty(h)&&(g=a[h],g!=null))switch(h){case"value":i=g;break;case"defaultValue":o=g;break;case"children":c=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(u(91));break;default:We(e,t,h,g,a,null)}pf(e,i,o,c);return;case"option":for(S in a)if(a.hasOwnProperty(S)&&(i=a[S],i!=null))switch(S){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:We(e,t,S,i,a,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(i=0;i<gs.length;i++)ke(gs[i],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("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 a)if(a.hasOwnProperty(T)&&(i=a[T],i!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:We(e,t,T,i,a,null)}return;default:if(Gu(t)){for(q in a)a.hasOwnProperty(q)&&(i=a[q],i!==void 0&&Oc(e,t,q,i,a,void 0));return}}for(g in a)a.hasOwnProperty(g)&&(i=a[g],i!=null&&We(e,t,g,i,a,null))}function e0(e,t,a,i){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 a){var Q=a[M];if(a.hasOwnProperty(M)&&Q!=null)switch(M){case"checked":break;case"value":break;case"defaultValue":S=Q;default:i.hasOwnProperty(M)||We(e,t,M,null,i,Q)}}for(var O in i){var M=i[O];if(Q=a[O],i.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&&We(e,t,O,M,i,Q)}}Vu(e,h,g,S,T,q,c,o);return;case"select":M=h=g=O=null;for(c in a)if(S=a[c],a.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":M=S;default:i.hasOwnProperty(c)||We(e,t,c,null,i,S)}for(o in i)if(c=i[o],S=a[o],i.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&&We(e,t,o,c,i,S)}t=g,a=h,i=M,O!=null?Kl(e,!!a,O,!1):!!i!=!!a&&(t!=null?Kl(e,!!a,t,!0):Kl(e,!!a,a?[]:"",!1));return;case"textarea":M=O=null;for(g in a)if(o=a[g],a.hasOwnProperty(g)&&o!=null&&!i.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:We(e,t,g,null,i,o)}for(h in i)if(o=i[h],c=a[h],i.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&&We(e,t,h,o,i,c)}mf(e,O,M);return;case"option":for(var ie in a)if(O=a[ie],a.hasOwnProperty(ie)&&O!=null&&!i.hasOwnProperty(ie))switch(ie){case"selected":e.selected=!1;break;default:We(e,t,ie,null,i,O)}for(S in i)if(O=i[S],M=a[S],i.hasOwnProperty(S)&&O!==M&&(O!=null||M!=null))switch(S){case"selected":e.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:We(e,t,S,O,i,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 a)O=a[me],a.hasOwnProperty(me)&&O!=null&&!i.hasOwnProperty(me)&&We(e,t,me,null,i,O);for(T in i)if(O=i[T],M=a[T],i.hasOwnProperty(T)&&O!==M&&(O!=null||M!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:We(e,t,T,O,i,M)}return;default:if(Gu(t)){for(var Pe in a)O=a[Pe],a.hasOwnProperty(Pe)&&O!==void 0&&!i.hasOwnProperty(Pe)&&Oc(e,t,Pe,void 0,i,O);for(q in i)O=i[q],M=a[q],!i.hasOwnProperty(q)||O===M||O===void 0&&M===void 0||Oc(e,t,q,O,i,M);return}}for(var k in a)O=a[k],a.hasOwnProperty(k)&&O!=null&&!i.hasOwnProperty(k)&&We(e,t,k,null,i,O);for(Q in i)O=i[Q],M=a[Q],!i.hasOwnProperty(Q)||O===M||O==null&&M==null||We(e,t,Q,O,i,M)}function vp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function t0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var o=a[i],c=o.transferSize,h=o.initiatorType,g=o.duration;if(c&&g&&vp(h)){for(h=0,g=o.responseEnd,i+=1;i<a.length;i++){var S=a[i],T=S.startTime;if(T>g)break;var q=S.transferSize,Q=S.initiatorType;q&&vp(Q)&&(S=S.responseEnd,h+=q*(S<g?1:(g-T)/(S-T)))}if(--i,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 Lc=null,Mc=null;function Yr(e){return e.nodeType===9?e:e.ownerDocument}function gp(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 bp(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 Dc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Uc=null;function a0(){var e=window.event;return e&&e.type==="popstate"?e===Uc?!1:(Uc=e,!0):(Uc=null,!1)}var wp=typeof setTimeout=="function"?setTimeout:void 0,n0=typeof clearTimeout=="function"?clearTimeout:void 0,Sp=typeof Promise=="function"?Promise:void 0,l0=typeof queueMicrotask=="function"?queueMicrotask:typeof Sp<"u"?function(e){return Sp.resolve(null).then(e).catch(i0)}:wp;function i0(e){setTimeout(function(){throw e})}function Fn(e){return e==="head"}function jp(e,t){var a=t,i=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"||a==="/&"){if(i===0){e.removeChild(o),Ai(t);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")ws(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ws(a);for(var c=a.firstChild;c;){var h=c.nextSibling,g=c.nodeName;c[qi]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=h}}else a==="body"&&ws(e.ownerDocument.body);a=o}while(a);Ai(t)}function Np(e,t){var a=e;e=0;do{var i=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),i&&i.nodeType===8)if(a=i.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=i}while(a)}function zc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":zc(a),$u(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function s0(e,t,a,i){for(;e.nodeType===1;){var o=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[qi])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=ba(e.nextSibling),e===null)break}return null}function r0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ba(e.nextSibling),e===null))return null;return e}function _p(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ba(e.nextSibling),e===null))return null;return e}function Bc(e){return e.data==="$?"||e.data==="$~"}function qc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function u0(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var i=function(){t(),a.removeEventListener("DOMContentLoaded",i)};a.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function ba(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Hc=null;function kp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ba(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Ap(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Ep(e,t,a){switch(t=Yr(a),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 ws(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$u(e)}var wa=new Map,Cp=new Set;function Vr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Nn=J.d;J.d={f:o0,r:c0,D:d0,C:f0,L:h0,m:m0,X:x0,S:p0,M:y0};function o0(){var e=Nn.f(),t=Mr();return e||t}function c0(e){var t=Ql(e);t!==null&&t.tag===5&&t.type==="form"?Qh(t):Nn.r(e)}var Ni=typeof document>"u"?null:document;function Rp(e,t,a){var i=Ni;if(i&&typeof t=="string"&&t){var o=ha(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof a=="string"&&(o+='[crossorigin="'+a+'"]'),Cp.has(o)||(Cp.add(o),e={rel:e,crossOrigin:a,href:t},i.querySelector(o)===null&&(t=i.createElement("link"),Dt(t,"link",e),Ct(t),i.head.appendChild(t)))}}function d0(e){Nn.D(e),Rp("dns-prefetch",e,null)}function f0(e,t){Nn.C(e,t),Rp("preconnect",e,t)}function h0(e,t,a){Nn.L(e,t,a);var i=Ni;if(i&&e&&t){var o='link[rel="preload"][as="'+ha(t)+'"]';t==="image"&&a&&a.imageSrcSet?(o+='[imagesrcset="'+ha(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(o+='[imagesizes="'+ha(a.imageSizes)+'"]')):o+='[href="'+ha(e)+'"]';var c=o;switch(t){case"style":c=_i(e);break;case"script":c=ki(e)}wa.has(c)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),wa.set(c,e),i.querySelector(o)!==null||t==="style"&&i.querySelector(Ss(c))||t==="script"&&i.querySelector(js(c))||(t=i.createElement("link"),Dt(t,"link",e),Ct(t),i.head.appendChild(t)))}}function m0(e,t){Nn.m(e,t);var a=Ni;if(a&&e){var i=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+ha(i)+'"][href="'+ha(e)+'"]',c=o;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ki(e)}if(!wa.has(c)&&(e=j({rel:"modulepreload",href:e},t),wa.set(c,e),a.querySelector(o)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(js(c)))return}i=a.createElement("link"),Dt(i,"link",e),Ct(i),a.head.appendChild(i)}}}function p0(e,t,a){Nn.S(e,t,a);var i=Ni;if(i&&e){var o=Xl(i).hoistableStyles,c=_i(e);t=t||"default";var h=o.get(c);if(!h){var g={loading:0,preload:null};if(h=i.querySelector(Ss(c)))g.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=wa.get(c))&&$c(e,a);var S=h=i.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,Zr(h,t,i)}h={type:"stylesheet",instance:h,count:1,state:g},o.set(c,h)}}}function x0(e,t){Nn.X(e,t);var a=Ni;if(a&&e){var i=Xl(a).hoistableScripts,o=ki(e),c=i.get(o);c||(c=a.querySelector(js(o)),c||(e=j({src:e,async:!0},t),(t=wa.get(o))&&Yc(e,t),c=a.createElement("script"),Ct(c),Dt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function y0(e,t){Nn.M(e,t);var a=Ni;if(a&&e){var i=Xl(a).hoistableScripts,o=ki(e),c=i.get(o);c||(c=a.querySelector(js(o)),c||(e=j({src:e,async:!0,type:"module"},t),(t=wa.get(o))&&Yc(e,t),c=a.createElement("script"),Ct(c),Dt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Tp(e,t,a,i){var o=(o=B.current)?Vr(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=_i(a.href),a=Xl(o).hoistableStyles,i=a.get(t),i||(i={type:"style",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=_i(a.href);var c=Xl(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(Ss(e)))&&!c._p&&(h.instance=c,h.state.loading=5),wa.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},wa.set(e,a),c||v0(o,e,a,h.state))),t&&i===null)throw Error(u(528,""));return h}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ki(a),a=Xl(o).hoistableScripts,i=a.get(t),i||(i={type:"script",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function _i(e){return'href="'+ha(e)+'"'}function Ss(e){return'link[rel="stylesheet"]['+e+"]"}function Op(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function v0(e,t,a,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),Dt(t,"link",a),Ct(t),e.head.appendChild(t))}function ki(e){return'[src="'+ha(e)+'"]'}function js(e){return"script[async]"+e}function Lp(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+ha(a.href)+'"]');if(i)return t.instance=i,Ct(i),i;var o=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ct(i),Dt(i,"style",o),Zr(i,a.precedence,e),t.instance=i;case"stylesheet":o=_i(a.href);var c=e.querySelector(Ss(o));if(c)return t.state.loading|=4,t.instance=c,Ct(c),c;i=Op(a),(o=wa.get(o))&&$c(i,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",i),t.state.loading|=4,Zr(c,a.precedence,e),t.instance=c;case"script":return c=ki(a.src),(o=e.querySelector(js(c)))?(t.instance=o,Ct(o),o):(i=a,(o=wa.get(c))&&(i=j({},a),Yc(i,o)),e=e.ownerDocument||e,o=e.createElement("script"),Ct(o),Dt(o,"link",i),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&&(i=t.instance,t.state.loading|=4,Zr(i,a.precedence,e));return t.instance}function Zr(e,t,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=i.length?i[i.length-1]:null,c=o,h=0;h<i.length;h++){var g=i[h];if(g.dataset.precedence===t)c=g;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function $c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Yc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Gr=null;function Mp(e,t,a){if(Gr===null){var i=new Map,o=Gr=new Map;o.set(a,i)}else o=Gr,i=o.get(a),i||(i=new Map,o.set(a,i));if(i.has(e))return i;for(i.set(e,null),a=a.getElementsByTagName(e),o=0;o<a.length;o++){var c=a[o];if(!(c[qi]||c[Ve]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var g=i.get(h);g?g.push(c):i.set(h,[c])}}return i}function Dp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function g0(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;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 Up(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function b0(e,t,a,i){if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var o=_i(i.href),c=t.querySelector(Ss(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,Ct(c);return}c=t.ownerDocument||t,i=Op(i),(o=wa.get(o))&&$c(i,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",i),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Qr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Vc=0;function w0(e,t){return e.stylesheets&&e.count===0&&Ir(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var i=setTimeout(function(){if(e.stylesheets&&Ir(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Vc===0&&(Vc=62500*t0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ir(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Vc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(o)}}:null}function Qr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ir(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xr=null;function Ir(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xr=new Map,t.forEach(S0,e),Xr=null,Qr.call(e))}function S0(e,t){if(!(t.state.loading&4)){var a=Xr.get(e);if(a)var i=a.get(null);else{a=new Map,Xr.set(e,a);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")&&(a.set(h.dataset.precedence,h),i=h)}i&&a.set(null,i)}o=t.instance,h=o.getAttribute("data-precedence"),c=a.get(h)||i,c===i&&a.set(null,o),a.set(h,o),this.count++,i=Qr.bind(this),o.addEventListener("load",i),o.addEventListener("error",i),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Ns={$$typeof:P,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function j0(e,t,a,i,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=i,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function zp(e,t,a,i,o,c,h,g,S,T,q,Q){return e=new j0(e,t,a,h,S,T,q,Q,g),t=1,c===!0&&(t|=24),c=Pt(3,null,null,t),e.current=c,c.stateNode=e,t=So(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:i,isDehydrated:a,cache:t},ko(c),e}function Bp(e){return e?(e=ni,e):ni}function qp(e,t,a,i,o,c){o=Bp(o),i.context===null?i.context=o:i.pendingContext=o,i=Hn(t),i.payload={element:a},c=c===void 0?null:c,c!==null&&(i.callback=c),a=$n(e,i,t),a!==null&&(It(a,e,t),as(a,e,t))}function Hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Zc(e,t){Hp(e,t),(e=e.alternate)&&Hp(e,t)}function $p(e){if(e.tag===13||e.tag===31){var t=bl(e,67108864);t!==null&&It(t,e,67108864),Zc(e,67108864)}}function Yp(e){if(e.tag===13||e.tag===31){var t=la();t=Ln(t);var a=bl(e,t);a!==null&&It(a,e,t),Zc(e,t)}}var Kr=!0;function N0(e,t,a,i){var o=U.T;U.T=null;var c=J.p;try{J.p=2,Gc(e,t,a,i)}finally{J.p=c,U.T=o}}function _0(e,t,a,i){var o=U.T;U.T=null;var c=J.p;try{J.p=8,Gc(e,t,a,i)}finally{J.p=c,U.T=o}}function Gc(e,t,a,i){if(Kr){var o=Qc(i);if(o===null)Tc(e,t,i,Jr,a),Zp(e,i);else if(A0(o,e,t,a,i))i.stopPropagation();else if(Zp(e,i),t&4&&-1<k0.indexOf(e)){for(;o!==null;){var c=Ql(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=La(c.pendingLanes);if(h!==0){var g=c;for(g.pendingLanes|=2,g.entangledLanes|=2;h;){var S=1<<31-ft(h);g.entanglements[1]|=S,h&=~S}Ja(c),(Ze&6)===0&&(Or=ut()+500,vs(0))}}break;case 31:case 13:g=bl(c,2),g!==null&&It(g,c,2),Mr(),Zc(c,2)}if(c=Qc(i),c===null&&Tc(e,t,i,Jr,a),c===o)break;o=c}o!==null&&i.stopPropagation()}else Tc(e,t,i,null,a)}}function Qc(e){return e=Xu(e),Xc(e)}var Jr=null;function Xc(e){if(Jr=null,e=Gl(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=x(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Jr=e,null}function Vp(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(ca()){case Ue:return 2;case cl:return 8;case qt:case $l:return 32;case dl:return 268435456;default:return 32}default:return 32}}var Ic=!1,Wn=null,Pn=null,el=null,_s=new Map,ks=new Map,tl=[],k0="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 Zp(e,t){switch(e){case"focusin":case"focusout":Wn=null;break;case"dragenter":case"dragleave":Pn=null;break;case"mouseover":case"mouseout":el=null;break;case"pointerover":case"pointerout":_s.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ks.delete(t.pointerId)}}function As(e,t,a,i,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:a,eventSystemFlags:i,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Ql(t),t!==null&&$p(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function A0(e,t,a,i,o){switch(t){case"focusin":return Wn=As(Wn,e,t,a,i,o),!0;case"dragenter":return Pn=As(Pn,e,t,a,i,o),!0;case"mouseover":return el=As(el,e,t,a,i,o),!0;case"pointerover":var c=o.pointerId;return _s.set(c,As(_s.get(c)||null,e,t,a,i,o)),!0;case"gotpointercapture":return c=o.pointerId,ks.set(c,As(ks.get(c)||null,e,t,a,i,o)),!0}return!1}function Gp(e){var t=Gl(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,je(e.priority,function(){Yp(a)});return}}else if(t===31){if(t=x(a),t!==null){e.blockedOn=t,je(e.priority,function(){Yp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Qc(e.nativeEvent);if(a===null){a=e.nativeEvent;var i=new a.constructor(a.type,a);Qu=i,a.target.dispatchEvent(i),Qu=null}else return t=Ql(a),t!==null&&$p(t),e.blockedOn=a,!1;t.shift()}return!0}function Qp(e,t,a){Fr(e)&&a.delete(t)}function E0(){Ic=!1,Wn!==null&&Fr(Wn)&&(Wn=null),Pn!==null&&Fr(Pn)&&(Pn=null),el!==null&&Fr(el)&&(el=null),_s.forEach(Qp),ks.forEach(Qp)}function Wr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ic||(Ic=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,E0)))}var Pr=null;function Xp(e){Pr!==e&&(Pr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Pr===e&&(Pr=null);for(var t=0;t<e.length;t+=3){var a=e[t],i=e[t+1],o=e[t+2];if(typeof i!="function"){if(Xc(i||a)===null)continue;break}var c=Ql(a);c!==null&&(e.splice(t,3),t-=3,Qo(c,{pending:!0,data:o,method:a.method,action:i},i,o))}}))}function Ai(e){function t(S){return Wr(S,e)}Wn!==null&&Wr(Wn,e),Pn!==null&&Wr(Pn,e),el!==null&&Wr(el,e),_s.forEach(t),ks.forEach(t);for(var a=0;a<tl.length;a++){var i=tl[a];i.blockedOn===e&&(i.blockedOn=null)}for(;0<tl.length&&(a=tl[0],a.blockedOn===null);)Gp(a),a.blockedOn===null&&tl.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var o=a[i],c=a[i+1],h=o[ht]||null;if(typeof c=="function")h||Xp(a);else if(h){var g=null;if(c&&c.hasAttribute("formAction")){if(o=c,h=c[ht]||null)g=h.formAction;else if(Xc(o)!==null)continue}else g=h.action;typeof g=="function"?a[i+1]=g:(a.splice(i,3),i-=3),Xp(a)}}}function Ip(){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),i||setTimeout(a,20)}function a(){if(!i&&!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 i=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Kc(e){this._internalRoot=e}eu.prototype.render=Kc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,i=la();qp(a,i,e,t,null,null)},eu.prototype.unmount=Kc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qp(e.current,2,null,e,null,null),Mr(),t[mt]=null}};function eu(e){this._internalRoot=e}eu.prototype.unstable_scheduleHydration=function(e){if(e){var t=G();e={blockedOn:null,target:e,priority:t};for(var a=0;a<tl.length&&t!==0&&t<tl[a].priority;a++);tl.splice(a,0,e),a===0&&Gp(e)}};var Kp=l.version;if(Kp!=="19.2.7")throw Error(u(527,Kp,"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 C0={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{Oa=tu.inject(C0),tt=tu}catch{}}return Cs.createRoot=function(e,t){if(!d(e))throw Error(u(299));var a=!1,i="",o=am,c=nm,h=lm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=zp(e,1,!1,null,null,a,i,null,o,c,h,Ip),e[mt]=t.current,Rc(e),new Kc(t)},Cs.hydrateRoot=function(e,t,a){if(!d(e))throw Error(u(299));var i=!1,o="",c=am,h=nm,g=lm,S=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(g=a.onRecoverableError),a.formState!==void 0&&(S=a.formState)),t=zp(e,1,!0,t,a??null,i,o,S,c,h,g,Ip),t.context=Bp(null),a=t.current,i=la(),i=Ln(i),o=Hn(i),o.callback=null,$n(a,o,i),a=i,t.current.lanes=a,sn(t,a),Ja(t),e[mt]=t.current,Rc(e),new eu(t)},Cs.version="19.2.7",Cs}var ix;function q0(){if(ix)return Wc.exports;ix=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Wc.exports=B0(),Wc.exports}var H0=q0();/**
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 Hd=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ny=/^[\\/]{2}/;function $0(n,l){return l+n.replace(/\\/g,"/")}var sx="popstate";function rx(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function Y0(n={}){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 jd("",{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 s(u,d){return typeof d=="string"?d:Ml(d)}return Z0(l,s,null,n)}function ct(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Ea(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function V0(){return Math.random().toString(36).substring(2,10)}function ux(n,l){return{usr:n.state,key:n.key,idx:l,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function jd(n,l,s=null,u,d){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof l=="string"?Di(l):l,state:s,key:l&&l.key||u||V0(),mask:d}}function Ml({pathname:n="/",search:l="",hash:s=""}){return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Di(n){let l={};if(n){let s=n.indexOf("#");s>=0&&(l.hash=n.substring(s),n=n.substring(0,s));let u=n.indexOf("?");u>=0&&(l.search=n.substring(u),n=n.substring(0,u)),n&&(l.pathname=n)}return l}function Z0(n,l,s,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=rx(L)?L:jd($.location,L,H);v=w()+1;let P=ux(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=rx(L)?L:jd($.location,L,H);v=w();let P=ux(F,v),ne=$.createHref(F.mask||F);m.replaceState(P,"",ne),f&&y&&y({action:x,location:$.location,delta:0})}function E(L){return G0(d,L)}let $={get action(){return x},get location(){return n(d,m)},listen(L){if(y)throw new Error("A history only accepts one active listener");return d.addEventListener(sx,j),y=L,()=>{d.removeEventListener(sx,j),y=null}},createHref(L){return l(d,L)},createURL:E,encodeLocation(L){let H=E(L);return{pathname:H.pathname,search:H.search,hash:H.hash}},push:D,replace:X,go(L){return m.go(L)}};return $}function G0(n,l,s=!1){let u="http://localhost";n&&(u=n.location.origin!=="null"?n.location.origin:n.location.href),ct(u,"No window.location.(origin|href) available to create URL");let d=typeof l=="string"?l:Ml(l);return d=d.replace(/ $/,"%20"),!s&&ny.test(d)&&(d=u+d),new URL(d,u)}function ly(n,l,s="/"){return Q0(n,l,s,!1)}function Q0(n,l,s,u,d){let f=typeof l=="string"?Di(l):l,m=En(f.pathname||"/",s);if(m==null)return null;let x=X0(n),y=null,v=lb(m);for(let w=0;y==null&&w<x.length;++w)y=nb(x[w],v,u);return y}function X0(n){let l=iy(n);return I0(l),l}function iy(n,l=[],s=[],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;ct(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=Ha([u,w.relativePath]),D=s.concat(w);m.children&&m.children.length>0&&(ct(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),iy(m.children,l,D,j,y)),!(m.path==null&&!m.index)&&l.push({path:j,score:tb(j,m.index),routesMeta:D.map((X,E)=>{let[$,L]=uy(X.relativePath,X.caseSensitive,E===D.length-1);return{...X,matcher:$,compiledParams:L}})})};return n.forEach((m,x)=>{var y;if(m.path===""||!((y=m.path)!=null&&y.includes("?")))f(m,x);else for(let v of sy(m.path))f(m,x,!0,v)}),l}function sy(n){let l=n.split("/");if(l.length===0)return[];let[s,...u]=l,d=s.endsWith("?"),f=s.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let m=sy(u.join("/")),x=[];return x.push(...m.map(y=>y===""?f:[f,y].join("/"))),d&&x.push(...m),x.map(y=>n.startsWith("/")&&y===""?"/":y)}function I0(n){n.sort((l,s)=>l.score!==s.score?s.score-l.score:ab(l.routesMeta.map(u=>u.childrenIndex),s.routesMeta.map(u=>u.childrenIndex)))}var K0=/^:[\w-]+$/,J0=3,F0=2,W0=1,P0=10,eb=-2,ox=n=>n==="*";function tb(n,l){let s=n.split("/"),u=s.length;return s.some(ox)&&(u+=eb),l&&(u+=F0),s.filter(d=>!ox(d)).reduce((d,f)=>d+(K0.test(f)?J0:f===""?W0:P0),u)}function ab(n,l){return n.length===l.length&&n.slice(0,-1).every((u,d)=>u===l[d])?n[n.length-1]-l[l.length-1]:0}function nb(n,l,s=!1){let{routesMeta:u}=n,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?ry(j,w,y.matcher,y.compiledParams):hu(j,w),X=y.route;if(!D&&v&&s&&!u[u.length-1].route.index&&(D=hu({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},w)),!D)return null;Object.assign(d,D.params),m.push({params:d,pathname:Ha([f,D.pathname]),pathnameBase:rb(Ha([f,D.pathnameBase])),route:X}),D.pathnameBase!=="/"&&(f=Ha([f,D.pathnameBase]))}return m}function hu(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,u]=uy(n.path,n.caseSensitive,n.end);return ry(n,l,s,u)}function ry(n,l,s,u){let d=l.match(s);if(!d)return null;let f=d[0],m=Oi(f,1),x=d.slice(1);return{params:u.reduce((v,{paramName:w,isOptional:j},D)=>{if(w==="*"){let E=x[D]||"";m=Oi(f.slice(0,f.length-E.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:n}}function uy(n,l=!1,s=!0){Ea(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let u=[],d="^"+n.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 n.endsWith("*")?(u.push({paramName:"*"}),d+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?d+="\\/*$":n!==""&&n!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,l?void 0:"i"),u]}function lb(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Ea(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),n}}function En(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let s=l.endsWith("/")?l.length-1:l.length,u=n.charAt(s);return u&&u!=="/"?null:n.slice(s)||"/"}function ib(n,l="/"){let{pathname:s,search:u="",hash:d=""}=typeof n=="string"?Di(n):n,f;return s?(s=oy(s),s.startsWith("/")||s.startsWith("\\")?f=cx(s.substring(1),"/"):f=cx(s,l)):f=l,{pathname:f,search:ub(u),hash:ob(d)}}function cx(n,l){let s=Oi(l).split("/");return n.split("/").forEach(d=>{d===".."?s.length>1&&s.pop():d!=="."&&s.push(d)}),s.length>1?s.join("/"):"/"}function ad(n,l,s,u){return`Cannot include a '${n}' character in a manually specified \`to.${l}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function sb(n){return n.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function $d(n){let l=sb(n);return l.map((s,u)=>u===l.length-1?s.pathname:s.pathnameBase)}function Eu(n,l,s,u=!1){let d;typeof n=="string"?d=Di(n):(d={...n},ct(!d.pathname||!d.pathname.includes("?"),ad("?","pathname","search",d)),ct(!d.pathname||!d.pathname.includes("#"),ad("#","pathname","hash",d)),ct(!d.search||!d.search.includes("#"),ad("#","search","hash",d)));let f=n===""||d.pathname==="",m=f?"/":d.pathname,x;if(m==null)x=s;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=ib(d,x),v=m&&m!=="/"&&m.endsWith("/"),w=(f||m===".")&&s.endsWith("/");return!y.pathname.endsWith("/")&&(v||w)&&(y.pathname+="/"),y}var oy=n=>n.replace(/[\\/]{2,}/g,"/"),Ha=n=>oy(n.join("/"));function Oi(n,l=0){let s=n.length;for(;s>l&&n.charCodeAt(s-1)===47;)s--;return s===n.length?n:n.slice(0,s)}var rb=n=>Oi(n).replace(/^\/*/,"/"),ub=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,ob=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,cb=class{constructor(n,l,s,u=!1){this.status=n,this.statusText=l||"",this.internal=u,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function db(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function fb(n){let l=n.map(s=>s.route.path).filter(Boolean);return Ha(l)||"/"}var cy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function dy(n,l){let s=n;if(typeof s!="string"||!Hd.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let u=s,d=!1;if(cy)try{let f=new URL(window.location.href),m=ny.test(s)?new URL($0(s,f.protocol)):new URL(s),x=En(m.pathname,l);m.origin===f.origin&&x!=null?s=x+m.search+m.hash:d=!0}catch{Ea(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var dx=new URL("http://localhost");function Yd(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),dx)}catch{return dx}}function nd(n,l){return n.origin===l.origin&&(n.origin!=="null"||n.protocol===l.protocol&&n.host===l.host)}function hb(n,l){if(n.startsWith("//"))return!0;let s=l.protocol.toLowerCase();return n.toLowerCase().startsWith(s)?l.host===""||n.slice(s.length).startsWith("//"):!1}function Vd(n,l,s,u){let d=null;try{d=n==null?null:new URL(n,s)}catch{}let f=new URL(l,s),m=d!=null&&!nd(d,s),x=!nd(f,s);if(u==="reject"){if(m||x)throw new Error("External navigation is not allowed")}else if(x&&(d==null||!hb(n,d)||!nd(d,f)))throw new Error("External navigation is not allowed")}var fy=["POST","PUT","PATCH","DELETE"];new Set(fy);var mb=["GET",...fy];new Set(mb);var pb=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function xb(n){try{return pb.includes(new URL(n).protocol)}catch{return!1}}var Ui=b.createContext(null);Ui.displayName="DataRouter";var Cu=b.createContext(null);Cu.displayName="DataRouterState";var hy=b.createContext(!1);function yb(){return b.useContext(hy)}var my=b.createContext({isTransitioning:!1});my.displayName="ViewTransition";var vb=b.createContext(new Map);vb.displayName="Fetchers";var gb=b.createContext(null);gb.displayName="Await";var ra=b.createContext(null);ra.displayName="Navigation";var Ys=b.createContext(null);Ys.displayName="Location";var Ya=b.createContext({outlet:null,matches:[],isDataRoute:!1});Ya.displayName="Route";var Zd=b.createContext(null);Zd.displayName="RouteError";var py="REACT_ROUTER_ERROR",bb="REDIRECT",wb="ROUTE_ERROR_RESPONSE";function Sb(n){if(n.startsWith(`${py}:${bb}:{`))try{let l=JSON.parse(n.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 jb(n){if(n.startsWith(`${py}:${wb}:{`))try{let l=JSON.parse(n.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new cb(l.status,l.statusText,l.data)}catch{}}function Nb(n,{relative:l}={}){ct(zi(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:u}=b.useContext(ra),{hash:d,pathname:f,search:m}=Vs(n,{relative:l}),x=f;return s!=="/"&&(x=f==="/"?s:Ha([s,f])),u.createHref({pathname:x,search:m,hash:d})}function zi(){return b.useContext(Ys)!=null}function Ca(){return ct(zi(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Ys).location}var xy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function yy(n){b.useContext(ra).static||b.useLayoutEffect(n)}function Ru(){let{isDataRoute:n}=b.useContext(Ya);return n?Bb():_b()}function _b(){ct(zi(),"useNavigate() may be used only in the context of a <Router> component.");let n=b.useContext(Ui),{basename:l,navigator:s}=b.useContext(ra),{matches:u}=b.useContext(Ya),{pathname:d}=Ca(),f=JSON.stringify($d(u)),m=b.useRef(!1);return yy(()=>{m.current=!0}),b.useCallback((y,v={})=>{if(Ea(m.current,xy),!m.current)return;if(typeof y=="number"){s.go(y);return}let w=Eu(y,JSON.parse(f),d,v.relative==="path");n==null&&l!=="/"&&(w.pathname=w.pathname==="/"?l:Ha([l,w.pathname])),Vd(typeof y=="string"?y:Ml(y),s.createHref(w),Yd(s),"reject"),(v.replace?s.replace:s.push)(w,v.state,v)},[l,s,f,d,n])}b.createContext(null);function kb(){let{matches:n}=b.useContext(Ya),l=n[n.length-1];return(l==null?void 0:l.params)??{}}function Vs(n,{relative:l}={}){let{matches:s}=b.useContext(Ya),{pathname:u}=Ca(),d=JSON.stringify($d(s));return b.useMemo(()=>Eu(n,JSON.parse(d),u,l==="path"),[n,d,u,l])}function Ab(n,l){return vy(n,l)}function vy(n,l,s){var L;ct(zi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=b.useContext(ra),{matches:d}=b.useContext(Ya),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||"";by(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=Ca(),j;if(l){let H=typeof l=="string"?Di(l):l;ct(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 E=s&&s.state.matches.length?s.state.matches.map(H=>Object.assign(H,{route:s.manifest[H.route.id]||H.route})):ly(n,{pathname:X});Ea(v||E!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),Ea(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.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 $=Ob(E&&E.map(H=>Object.assign({},H,{params:Object.assign({},m,H.params),pathname:Ha([y,u.encodeLocation?u.encodeLocation(H.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?y:Ha([y,u.encodeLocation?u.encodeLocation(H.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathnameBase])})),d,s);return l&&$?b.createElement(Ys.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...j},navigationType:"POP"}},$):$}function Eb(){let n=zb(),l=db(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.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:",n),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),s?b.createElement("pre",{style:d},s):null,m)}var Cb=b.createElement(Eb,null),gy=class extends b.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){this.props.onError?this.props.onError(n,l):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=jb(n.digest);s&&(n=s)}let l=n!==void 0?b.createElement(Ya.Provider,{value:this.props.routeContext},b.createElement(Zd.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?b.createElement(Rb,{error:n},l):l}};gy.contextType=hy;var ld=new WeakMap;function Rb({children:n,error:l}){let{basename:s,navigator:u}=b.useContext(ra);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let d=Sb(l.digest);if(d){let f=ld.get(l);if(f)throw f;let m=dy(d.location,s),x=m.absoluteURL||m.to;if(Vd(d.location,x,Yd(u),"allow-explicit"),xb(x))throw new Error("Invalid redirect location");if(cy&&!ld.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 ld.set(l,y),y}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${x}`})}}return n}function Tb({routeContext:n,match:l,children:s}){let u=b.useContext(Ui);return u&&u.static&&u.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=l.route.id),b.createElement(Ya.Provider,{value:n},s)}function Ob(n,l=[],s){let u=s==null?void 0:s.state;if(n==null){if(!u)return null;if(u.errors)n=u.matches;else if(l.length===0&&!u.initialized&&u.matches.length>0)n=u.matches;else return null}let d=n,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);ct(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(s&&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,E=j.route.loader&&!D.hasOwnProperty(j.route.id)&&(!X||X[j.route.id]===void 0);if(j.route.lazy||E){s.isStatic&&(m=!0),x>=0?d=d.slice(0,x+1):d=[d[0]];break}}}}let y=s==null?void 0:s.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:fb(u.matches),errorInfo:j})}:void 0;return d.reduceRight((w,j,D)=>{let X,E=!1,$=null,L=null;u&&(X=f&&j.route.id?f[j.route.id]:void 0,$=j.route.errorElement||Cb,m&&(x<0&&D===0?(by("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,L=null):x===D&&(E=!0,L=j.route.hydrateFallbackElement||null)));let H=l.concat(d.slice(0,D+1)),F=()=>{let P;return X?P=$:E?P=L:j.route.Component?P=b.createElement(j.route.Component,null):j.route.element?P=j.route.element:P=w,b.createElement(Tb,{match:j,routeContext:{outlet:w,matches:H,isDataRoute:u!=null},children:P})};return u&&(j.route.ErrorBoundary||j.route.errorElement||D===0)?b.createElement(gy,{location:u.location,revalidation:u.revalidation,component:$,error:X,children:F(),routeContext:{outlet:null,matches:H,isDataRoute:!0},onError:v}):F()},null)}function Gd(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lb(n){let l=b.useContext(Ui);return ct(l,Gd(n)),l}function Mb(n){let l=b.useContext(Cu);return ct(l,Gd(n)),l}function Db(n){let l=b.useContext(Ya);return ct(l,Gd(n)),l}function Qd(n){let l=Db(n),s=l.matches[l.matches.length-1];return ct(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function Ub(){return Qd("useRouteId")}function zb(){var u;let n=b.useContext(Zd),l=Mb("useRouteError"),s=Qd("useRouteError");return n!==void 0?n:(u=l.errors)==null?void 0:u[s]}function Bb(){let{router:n}=Lb("useNavigate"),l=Qd("useNavigate"),s=b.useRef(!1);return yy(()=>{s.current=!0}),b.useCallback(async(d,f={})=>{Ea(s.current,xy),s.current&&(typeof d=="number"?await n.navigate(d):await n.navigate(d,{fromRouteId:l,...f}))},[n,l])}var fx={};function by(n,l,s){!l&&!fx[n]&&(fx[n]=!0,Ea(!1,s))}b.memo(qb);function qb({routes:n,manifest:l,future:s,state:u,isStatic:d,onError:f}){return vy(n,void 0,{manifest:l,state:u,isStatic:d,onError:f})}function wy({to:n,replace:l,state:s,relative:u}){ct(zi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d,navigator:f}=b.useContext(ra);Ea(!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(Ya),{pathname:x}=Ca(),y=Ru(),v=Eu(n,$d(m),x,u==="path");Vd(typeof n=="string"?n:Ml(n),f.createHref(v),Yd(f),"reject");let w=JSON.stringify(v);return b.useEffect(()=>{y(JSON.parse(w),{replace:l,state:s,relative:u})},[y,w,u,l,s]),null}function Ll(n){ct(!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 Hb({basename:n="/",children:l=null,location:s,navigationType:u="POP",navigator:d,static:f=!1,useTransitions:m}){ct(!zi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=n.replace(/^\/*/,"/"),y=b.useMemo(()=>({basename:x,navigator:d,static:f,useTransitions:m,future:{}}),[x,d,f,m]);typeof s=="string"&&(s=Di(s));let{pathname:v="/",search:w="",hash:j="",state:D=null,key:X="default",mask:E}=s,$=b.useMemo(()=>{let L=En(v,x);return L==null?null:{location:{pathname:L,search:w,hash:j,state:D,key:X,mask:E},navigationType:u}},[x,v,w,j,D,X,u,E]);return Ea($!=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(ra.Provider,{value:y},b.createElement(Ys.Provider,{children:l,value:$}))}function $b({children:n,location:l}){return Ab(Nd(n),l)}function Nd(n,l=[]){let s=[];return b.Children.forEach(n,(u,d)=>{if(!b.isValidElement(u))return;let f=[...l,d];if(u.type===b.Fragment){s.push.apply(s,Nd(u.props.children,f));return}ct(u.type===Ll,`[${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>`),ct(!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=Nd(u.props.children,f)),s.push(m)}),s}var uu="get",ou="application/x-www-form-urlencoded";function Tu(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function Yb(n){return Tu(n)&&n.tagName.toLowerCase()==="button"}function Vb(n){return Tu(n)&&n.tagName.toLowerCase()==="form"}function Zb(n){return Tu(n)&&n.tagName.toLowerCase()==="input"}function Gb(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Qb(n,l){return n.button===0&&(!l||l==="_self")&&!Gb(n)}function _d(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,s)=>{let u=n[s];return l.concat(Array.isArray(u)?u.map(d=>[s,d]):[[s,u]])},[]))}function Xb(n,l){let s=_d(n);return l&&l.forEach((u,d)=>{s.has(d)||l.getAll(d).forEach(f=>{s.append(d,f)})}),s}var au=null;function Ib(){if(au===null)try{new FormData(document.createElement("form"),0),au=!1}catch{au=!0}return au}var Kb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function id(n){return n!=null&&!Kb.has(n)?(Ea(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ou}"`),null):n}function Jb(n,l){let s,u,d,f,m;if(Vb(n)){let x=n.getAttribute("action");u=x?En(x,l):null,s=n.getAttribute("method")||uu,d=id(n.getAttribute("enctype"))||ou,f=new FormData(n)}else if(Yb(n)||Zb(n)&&(n.type==="submit"||n.type==="image")){let x=n.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=n.getAttribute("formaction")||x.getAttribute("action");if(u=y?En(y,l):null,s=n.getAttribute("formmethod")||x.getAttribute("method")||uu,d=id(n.getAttribute("formenctype"))||id(x.getAttribute("enctype"))||ou,f=new FormData(x,n),!Ib()){let{name:v,type:w,value:j}=n;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(Tu(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=uu,u=null,d=ou,m=n}return f&&d==="text/plain"&&(m=f,f=void 0),{action:u,method:s.toLowerCase(),encType:d,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xd(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Sy(n,l,s,u){let d=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return s?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=`${Oi(l)}/_root.${u}`:d.pathname=`${Oi(d.pathname)}.${u}`,d}async function Fb(n,l){if(n.id in l)return l[n.id];try{let s=await import(n.module);return l[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Wb(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function Pb(n,l,s){let u=await Promise.all(n.map(async d=>{let f=l.routes[d.route.id];if(f){let m=await Fb(f,s);return m.links?m.links():[]}return[]}));return n1(u.flat(1).filter(Wb).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function hx(n,l,s,u,d,f){let m=(y,v)=>s[v]?y.route.id!==s[v].route.id:!0,x=(y,v)=>{var w;return s[v].pathname!==y.pathname||((w=s[v].route.path)==null?void 0:w.endsWith("*"))&&s[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=s[0])==null?void 0:j.params)||{},nextUrl:new URL(n,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof D=="boolean")return D}return!0}):[]}function e1(n,l,{includeHydrateFallback:s}={}){return t1(n.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)),s&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function t1(n){return[...new Set(n)]}function a1(n){let l={},s=Object.keys(n).sort();for(let u of s)l[u]=n[u];return l}function n1(n,l){let s=new Set;return new Set(l),n.reduce((u,d)=>{let f=JSON.stringify(a1(d));return s.has(f)||(s.add(f),u.push({key:f,link:d})),u},[])}function Id(){let n=b.useContext(Ui);return Xd(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function l1(){let n=b.useContext(Cu);return Xd(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Kd=b.createContext(void 0);Kd.displayName="FrameworkContext";function Ou(){let n=b.useContext(Kd);return Xd(n,"You must render this element inside a <HydratedRouter> element"),n}function i1(n,l){let s=b.useContext(Kd),[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(n==="render"&&m(!0),n==="viewport"){let $=H=>{H.forEach(F=>{m(F.isIntersecting)})},L=new IntersectionObserver($,{threshold:.5});return D.current&&L.observe(D.current),()=>{L.disconnect()}}},[n]),b.useEffect(()=>{if(u){let $=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout($)}}},[u]);let X=()=>{d(!0)},E=()=>{d(!1),m(!1)};return s?n!=="intent"?[f,D,{}]:[f,D,{onFocus:Rs(x,X),onBlur:Rs(y,E),onMouseEnter:Rs(v,X),onMouseLeave:Rs(w,E),onTouchStart:Rs(j,X)}]:[!1,D,{}]}function Rs(n,l){return s=>{n&&n(s),s.defaultPrevented||l(s)}}function s1({page:n,...l}){let s=yb(),{nonce:u}=Ou(),{router:d}=Id(),f=b.useMemo(()=>ly(d.routes,n,d.basename),[d.routes,n,d.basename]);return f?(l.nonce==null&&u&&(l={...l,nonce:u}),s?b.createElement(u1,{page:n,matches:f,...l}):b.createElement(o1,{page:n,matches:f,...l})):null}function r1(n){let{manifest:l,routeModules:s}=Ou(),[u,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return Pb(n,l,s).then(m=>{f||d(m)}),()=>{f=!0}},[n,l,s]),u}function u1({page:n,matches:l,...s}){let u=Ca(),{future:d}=Ou(),{basename:f}=Id(),m=b.useMemo(()=>{if(n===u.pathname+u.search+u.hash)return[];let x=Sy(n,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,n,u,l]);return b.createElement(b.Fragment,null,m.map(x=>b.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...s})))}function o1({page:n,matches:l,...s}){let u=Ca(),{future:d,manifest:f,routeModules:m}=Ou(),{basename:x}=Id(),{loaderData:y,matches:v}=l1(),w=b.useMemo(()=>hx(n,l,v,f,u,"data"),[n,l,v,f,u]),j=b.useMemo(()=>hx(n,l,v,f,u,"assets"),[n,l,v,f,u]),D=b.useMemo(()=>{if(n===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=Sy(n,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,n,m]),X=b.useMemo(()=>e1(j,f),[j,f]),E=r1(j);return b.createElement(b.Fragment,null,D.map($=>b.createElement("link",{key:$,rel:"prefetch",as:"fetch",href:$,...s})),X.map($=>b.createElement("link",{key:$,rel:"modulepreload",href:$,...s})),E.map(({key:$,link:L})=>b.createElement("link",{key:$,nonce:s.nonce,...L,crossOrigin:L.crossOrigin??s.crossOrigin})))}function c1(...n){return l=>{n.forEach(s=>{typeof s=="function"?s(l):s!=null&&(s.current=l)})}}var d1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{d1&&(window.__reactRouterVersion="7.18.4")}catch{}function f1({basename:n,children:l,useTransitions:s,window:u}){let d=b.useRef();d.current==null&&(d.current=Y0({window:u,v5Compat:!0}));let f=d.current,[m,x]=b.useState({action:f.action,location:f.location}),y=b.useCallback(v=>{s===!1?x(v):b.startTransition(()=>x(v))},[s]);return b.useLayoutEffect(()=>f.listen(y),[f,y]),b.createElement(Hb,{basename:n,children:l,location:m.location,navigationType:m.action,navigator:f,useTransitions:s})}var sa=b.forwardRef(function({onClick:l,discover:s="render",prefetch:u="none",relative:d,reloadDocument:f,replace:m,mask:x,state:y,target:v,to:w,preventScrollReset:j,viewTransition:D,defaultShouldRevalidate:X,...E},$){let{basename:L,navigator:H,useTransitions:F}=b.useContext(ra),P=typeof w=="string"&&Hd.test(w),ne=dy(w,L);w=ne.to;let V=Nb(w,{relative:d}),Ne=Ca(),I=null;if(x){let Qe=Eu(x,[],Ne.mask?Ne.mask.pathname:"/",!0);L!=="/"&&(Qe.pathname=Qe.pathname==="/"?L:Ha([L,Qe.pathname])),I=H.createHref(Qe)}let[ye,Me,bt]=i1(u,E),At=p1(w,{replace:m,mask:x,state:y,target:v,preventScrollReset:j,relative:d,viewTransition:D,defaultShouldRevalidate:X,useTransitions:F});function rt(Qe){l&&l(Qe),Qe.defaultPrevented||At(Qe)}let yt=!(ne.isExternal||f),lt=b.createElement("a",{...E,...bt,href:(yt?I:void 0)||ne.absoluteURL||V,onClick:yt?rt:l,ref:c1($,Me),target:v,"data-discover":!P&&s==="render"?"true":void 0});return ye&&!P?b.createElement(b.Fragment,null,lt,b.createElement(s1,{page:V})):lt});sa.displayName="Link";var cu=b.forwardRef(function({"aria-current":l="page",caseSensitive:s=!1,className:u="",end:d=!1,style:f,to:m,viewTransition:x,children:y,...v},w){let j=Vs(m,{relative:v.relative}),D=Ca(),X=b.useContext(Cu),{navigator:E,basename:$}=b.useContext(ra),L=X!=null&&b1(j)&&x===!0,H=E.encodeLocation?E.encodeLocation(j).pathname:j.pathname,F=D.pathname,P=X&&X.navigation&&X.navigation.location?X.navigation.location.pathname:null;s||(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)==="/",Ne=P!=null&&(P===H||!d&&P.startsWith(H)&&P.charAt(H.length)==="/"),I={isActive:V,isPending:Ne,isTransitioning:L},ye=V?l:void 0,Me;typeof u=="function"?Me=u(I):Me=[u,V?"active":null,Ne?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let bt=typeof f=="function"?f(I):f;return b.createElement(sa,{...v,"aria-current":ye,className:Me,ref:w,style:bt,to:m,viewTransition:x},typeof y=="function"?y(I):y)});cu.displayName="NavLink";var h1=b.forwardRef(({discover:n="render",fetcherKey:l,navigate:s,reloadDocument:u,replace:d,state:f,method:m=uu,action:x,onSubmit:y,relative:v,preventScrollReset:w,viewTransition:j,defaultShouldRevalidate:D,...X},E)=>{let{useTransitions:$}=b.useContext(ra),L=v1(),H=g1(x,{relative:v}),F=m.toLowerCase()==="get"?"get":"post",P=typeof x=="string"&&Hd.test(x),ne=V=>{if(y&&y(V),V.defaultPrevented)return;V.preventDefault();let Ne=V.nativeEvent.submitter,I=(Ne==null?void 0:Ne.getAttribute("formmethod"))||m,ye=()=>L(Ne||V.currentTarget,{fetcherKey:l,method:I,navigate:s,replace:d,state:f,relative:v,preventScrollReset:w,viewTransition:j,defaultShouldRevalidate:D});$&&s!==!1?b.startTransition(()=>ye()):ye()};return b.createElement("form",{ref:E,method:F,action:H,onSubmit:u?y:ne,...X,"data-discover":!P&&n==="render"?"true":void 0})});h1.displayName="Form";function m1(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jy(n){let l=b.useContext(Ui);return ct(l,m1(n)),l}function p1(n,{target:l,replace:s,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:x,defaultShouldRevalidate:y,useTransitions:v}={}){let w=Ru(),j=Ca(),D=Vs(n,{relative:m});return b.useCallback(X=>{if(Qb(X,l)){X.preventDefault();let E=s!==void 0?s:Ml(j)===Ml(D),$=()=>w(n,{replace:E,mask:u,state:d,preventScrollReset:f,relative:m,viewTransition:x,defaultShouldRevalidate:y});v?b.startTransition(()=>$()):$()}},[j,w,D,s,u,d,l,n,f,m,x,y,v])}function Ny(n){Ea(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(_d(n)),s=b.useRef(!1),u=Ca(),d=b.useMemo(()=>Xb(u.search,s.current?null:l.current),[u.search]),f=Ru(),m=b.useCallback((x,y)=>{const v=_d(typeof x=="function"?x(new URLSearchParams(d)):x);s.current=!0,f("?"+v,y)},[f,d]);return[d,m]}var x1=0,y1=()=>`__${String(++x1)}__`;function v1(){let{router:n}=jy("useSubmit"),{basename:l}=b.useContext(ra),s=Ub(),u=n.fetch,d=n.navigate;return b.useCallback(async(f,m={})=>{let{action:x,method:y,encType:v,formData:w,body:j}=Jb(f,l);if(m.navigate===!1){let D=m.fetcherKey||y1();await u(D,s,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:s,flushSync:m.flushSync,viewTransition:m.viewTransition})},[u,d,l,s])}function g1(n,{relative:l}={}){let{basename:s}=b.useContext(ra),u=b.useContext(Ya);ct(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),f={...Vs(n||".",{relative:l})},m=Ca();if(n==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(!n||n===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(f.pathname=f.pathname==="/"?s:Ha([s,f.pathname])),Ml(f)}function b1(n,{relative:l}={}){let s=b.useContext(my);ct(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=jy("useViewTransitionState"),d=Vs(n,{relative:l});if(!s.isTransitioning)return!1;let f=En(s.currentLocation.pathname,u)||s.currentLocation.pathname,m=En(s.nextLocation.pathname,u)||s.nextLocation.pathname;return hu(d.pathname,m)!=null||hu(d.pathname,f)!=null}var Be;(function(n){n.assertEqual=d=>{};function l(d){}n.assertIs=l;function s(d){throw new Error}n.assertNever=s,n.arrayToEnum=d=>{const f={};for(const m of d)f[m]=m;return f},n.getValidEnumValues=d=>{const f=n.objectKeys(d).filter(x=>typeof d[d[x]]!="number"),m={};for(const x of f)m[x]=d[x];return n.objectValues(m)},n.objectValues=d=>n.objectKeys(d).map(function(f){return d[f]}),n.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},n.find=(d,f)=>{for(const m of d)if(f(m))return m},n.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)}n.joinValues=u,n.jsonStringifyReplacer=(d,f)=>typeof f=="bigint"?f.toString():f})(Be||(Be={}));var mx;(function(n){n.mergeShapes=(l,s)=>({...l,...s})})(mx||(mx={}));const le=Be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),il=n=>{switch(typeof n){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(n)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(n)?le.array:n===null?le.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?le.promise:typeof Map<"u"&&n instanceof Map?le.map:typeof Set<"u"&&n instanceof Set?le.set:typeof Date<"u"&&n instanceof Date?le.date:le.object;default:return le.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 s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=l}format(l){const s=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(s(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(s(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=s=>s.message){const s={},u=[];for(const d of this.issues)if(d.path.length>0){const f=d.path[0];s[f]=s[f]||[],s[f].push(l(d))}else u.push(l(d));return{formErrors:u,fieldErrors:s}}get formErrors(){return this.flatten()}}Cn.create=n=>new Cn(n);const kd=(n,l)=>{let s;switch(n.code){case K.invalid_type:n.received===le.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case K.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,Be.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:s=`Unrecognized key(s) in object: ${Be.joinValues(n.keys,", ")}`;break;case K.invalid_union:s="Invalid input";break;case K.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Be.joinValues(n.options)}`;break;case K.invalid_enum_value:s=`Invalid enum value. Expected ${Be.joinValues(n.options)}, received '${n.received}'`;break;case K.invalid_arguments:s="Invalid function arguments";break;case K.invalid_return_type:s="Invalid function return type";break;case K.invalid_date:s="Invalid date";break;case K.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:Be.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case K.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case K.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case K.custom:s="Invalid input";break;case K.invalid_intersection_types:s="Intersection results could not be merged";break;case K.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case K.not_finite:s="Number must be finite";break;default:s=l.defaultError,Be.assertNever(n)}return{message:s}};let w1=kd;function S1(){return w1}const j1=n=>{const{data:l,path:s,errorMaps:u,issueData:d}=n,f=[...s,...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(n,l){const s=S1(),u=j1({issueData:l,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===kd?void 0:kd].filter(d=>!!d)});n.common.issues.push(u)}class $t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(l,s){const u=[];for(const d of s){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,s){const u=[];for(const d of s){const f=await d.key,m=await d.value;u.push({key:f,value:m})}return $t.mergeObjectSync(l,u)}static mergeObjectSync(l,s){const u={};for(const d of s){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"}),Os=n=>({status:"dirty",value:n}),Ra=n=>({status:"valid",value:n}),px=n=>n.status==="aborted",xx=n=>n.status==="dirty",Li=n=>n.status==="valid",mu=n=>typeof Promise<"u"&&n instanceof Promise;var oe;(function(n){n.errToObj=l=>typeof l=="string"?{message:l}:l||{},n.toString=l=>typeof l=="string"?l:l==null?void 0:l.message})(oe||(oe={}));class en{constructor(l,s,u,d){this._cachedPath=[],this.parent=l,this.data=s,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 yx=(n,l)=>{if(Li(l))return{success:!0,data:l.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new Cn(n.common.issues);return this._error=s,this._error}}};function Se(n){if(!n)return{};const{errorMap:l,invalid_type_error:s,required_error:u,description:d}=n;if(l&&(s||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}=n;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??s??x.defaultError}},description:d}}class Re{get description(){return this._def.description}_getType(l){return il(l.data)}_getOrReturnCtx(l,s){return s||{common:l.parent.common,data:l.data,parsedType:il(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}_processInputParams(l){return{status:new $t,ctx:{common:l.parent.common,data:l.data,parsedType:il(l.data),schemaErrorMap:this._def.errorMap,path:l.path,parent:l.parent}}}_parseSync(l){const s=this._parse(l);if(mu(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(l){const s=this._parse(l);return Promise.resolve(s)}parse(l,s){const u=this.safeParse(l,s);if(u.success)return u.data;throw u.error}safeParse(l,s){const u={common:{issues:[],async:(s==null?void 0:s.async)??!1,contextualErrorMap:s==null?void 0:s.errorMap},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:il(l)},d=this._parseSync({data:l,path:u.path,parent:u});return yx(u,d)}"~validate"(l){var u,d;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:il(l)};if(!this["~standard"].async)try{const f=this._parseSync({data:l,path:[],parent:s});return Li(f)?{value:f.value}:{issues:s.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),s.common={issues:[],async:!0}}return this._parseAsync({data:l,path:[],parent:s}).then(f=>Li(f)?{value:f.value}:{issues:s.common.issues})}async parseAsync(l,s){const u=await this.safeParseAsync(l,s);if(u.success)return u.data;throw u.error}async safeParseAsync(l,s){const u={common:{issues:[],contextualErrorMap:s==null?void 0:s.errorMap,async:!0},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:l,parsedType:il(l)},d=this._parse({data:l,path:u.path,parent:u}),f=await(mu(d)?d:Promise.resolve(d));return yx(u,f)}refine(l,s){const u=d=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(d):s;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,s){return this._refinement((u,d)=>l(u)?!0:(d.addIssue(typeof s=="function"?s(u,d):s),!1))}_refinement(l){return new ql({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:s=>this["~validate"](s)}}optional(){return An.create(this,this._def)}nullable(){return Hl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pa.create(this)}promise(){return bu.create(this,this._def)}or(l){return xu.create([this,l],this._def)}and(l){return yu.create(this,l,this._def)}transform(l){return new ql({...Se(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:l}})}default(l){const s=typeof l=="function"?l:()=>l;return new wu({...Se(this._def),innerType:this,defaultValue:s,typeName:xe.ZodDefault})}brand(){return new Ey({typeName:xe.ZodBranded,type:this,...Se(this._def)})}catch(l){const s=typeof l=="function"?l:()=>l;return new Su({...Se(this._def),innerType:this,catchValue:s,typeName:xe.ZodCatch})}describe(l){const s=this.constructor;return new s({...this._def,description:l})}pipe(l){return Fd.create(this,l)}readonly(){return ju.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const N1=/^c[^\s-]{8,}$/i,_1=/^[0-9a-z]+$/,k1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,A1=/^[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,E1=/^[a-z0-9_-]{21}$/i,C1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,R1=/^[-+]?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)?)??$/,T1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,O1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let sd;const L1=/^(?:(?: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])$/,M1=/^(?:(?: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])$/,D1=/^(([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]))$/,U1=/^(([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])$/,z1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,B1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_y="((\\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])))",q1=new RegExp(`^${_y}$`);function ky(n){let l="[0-5]\\d";n.precision?l=`${l}\\.\\d{${n.precision}}`:n.precision==null&&(l=`${l}(\\.\\d+)?`);const s=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${l})${s}`}function H1(n){return new RegExp(`^${ky(n)}$`)}function $1(n){let l=`${_y}T${ky(n)}`;const s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),l=`${l}(${s.join("|")})`,new RegExp(`^${l}$`)}function Y1(n,l){return!!((l==="v4"||!l)&&L1.test(n)||(l==="v6"||!l)&&D1.test(n))}function V1(n,l){if(!C1.test(n))return!1;try{const[s]=n.split(".");if(!s)return!1;const u=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.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 Z1(n,l){return!!((l==="v4"||!l)&&M1.test(n)||(l==="v6"||!l)&&U1.test(n))}class Fa extends Re{_parse(l){if(this._def.coerce&&(l.data=String(l.data)),this._getType(l)!==le.string){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_type,expected:le.string,received:f.parsedType}),pe}const u=new $t;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")T1.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")sd||(sd=new RegExp(O1,"u")),sd.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")A1.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")E1.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")N1.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")_1.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")k1.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"?$1(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"?q1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{code:K.invalid_string,validation:"date",message:f.message}),u.dirty()):f.kind==="time"?H1(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"?R1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"duration",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="ip"?Y1(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"?V1(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"?Z1(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"?z1.test(l.data)||(d=this._getOrReturnCtx(l,d),ee(d,{validation:"base64",code:K.invalid_string,message:f.message}),u.dirty()):f.kind==="base64url"?B1.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,s,u){return this.refinement(d=>l.test(d),{validation:s,code:K.invalid_string,...oe.errToObj(u)})}_addCheck(l){return new Fa({...this._def,checks:[...this._def.checks,l]})}email(l){return this._addCheck({kind:"email",...oe.errToObj(l)})}url(l){return this._addCheck({kind:"url",...oe.errToObj(l)})}emoji(l){return this._addCheck({kind:"emoji",...oe.errToObj(l)})}uuid(l){return this._addCheck({kind:"uuid",...oe.errToObj(l)})}nanoid(l){return this._addCheck({kind:"nanoid",...oe.errToObj(l)})}cuid(l){return this._addCheck({kind:"cuid",...oe.errToObj(l)})}cuid2(l){return this._addCheck({kind:"cuid2",...oe.errToObj(l)})}ulid(l){return this._addCheck({kind:"ulid",...oe.errToObj(l)})}base64(l){return this._addCheck({kind:"base64",...oe.errToObj(l)})}base64url(l){return this._addCheck({kind:"base64url",...oe.errToObj(l)})}jwt(l){return this._addCheck({kind:"jwt",...oe.errToObj(l)})}ip(l){return this._addCheck({kind:"ip",...oe.errToObj(l)})}cidr(l){return this._addCheck({kind:"cidr",...oe.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,...oe.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,...oe.errToObj(l==null?void 0:l.message)})}duration(l){return this._addCheck({kind:"duration",...oe.errToObj(l)})}regex(l,s){return this._addCheck({kind:"regex",regex:l,...oe.errToObj(s)})}includes(l,s){return this._addCheck({kind:"includes",value:l,position:s==null?void 0:s.position,...oe.errToObj(s==null?void 0:s.message)})}startsWith(l,s){return this._addCheck({kind:"startsWith",value:l,...oe.errToObj(s)})}endsWith(l,s){return this._addCheck({kind:"endsWith",value:l,...oe.errToObj(s)})}min(l,s){return this._addCheck({kind:"min",value:l,...oe.errToObj(s)})}max(l,s){return this._addCheck({kind:"max",value:l,...oe.errToObj(s)})}length(l,s){return this._addCheck({kind:"length",value:l,...oe.errToObj(s)})}nonempty(l){return this.min(1,oe.errToObj(l))}trim(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fa({...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 s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l}get maxLength(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l}}Fa.create=n=>new Fa({checks:[],typeName:xe.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...Se(n)});function G1(n,l){const s=(n.toString().split(".")[1]||"").length,u=(l.toString().split(".")[1]||"").length,d=s>u?s:u,f=Number.parseInt(n.toFixed(d).replace(".","")),m=Number.parseInt(l.toFixed(d).replace(".",""));return f%m/10**d}class Dl extends Re{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)!==le.number){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_type,expected:le.number,received:f.parsedType}),pe}let u;const d=new $t;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"?G1(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,s){return this.setLimit("min",l,!0,oe.toString(s))}gt(l,s){return this.setLimit("min",l,!1,oe.toString(s))}lte(l,s){return this.setLimit("max",l,!0,oe.toString(s))}lt(l,s){return this.setLimit("max",l,!1,oe.toString(s))}setLimit(l,s,u,d){return new Dl({...this._def,checks:[...this._def.checks,{kind:l,value:s,inclusive:u,message:oe.toString(d)}]})}_addCheck(l){return new Dl({...this._def,checks:[...this._def.checks,l]})}int(l){return this._addCheck({kind:"int",message:oe.toString(l)})}positive(l){return this._addCheck({kind:"min",value:0,inclusive:!1,message:oe.toString(l)})}negative(l){return this._addCheck({kind:"max",value:0,inclusive:!1,message:oe.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:0,inclusive:!0,message:oe.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:0,inclusive:!0,message:oe.toString(l)})}multipleOf(l,s){return this._addCheck({kind:"multipleOf",value:l,message:oe.toString(s)})}finite(l){return this._addCheck({kind:"finite",message:oe.toString(l)})}safe(l){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:oe.toString(l)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:oe.toString(l)})}get minValue(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l}get maxValue(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.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,s=null;for(const u of this._def.checks){if(u.kind==="finite"||u.kind==="int"||u.kind==="multipleOf")return!0;u.kind==="min"?(s===null||u.value>s)&&(s=u.value):u.kind==="max"&&(l===null||u.value<l)&&(l=u.value)}return Number.isFinite(s)&&Number.isFinite(l)}}Dl.create=n=>new Dl({checks:[],typeName:xe.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Se(n)});class Ul extends Re{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)!==le.bigint)return this._getInvalidInput(l);let u;const d=new $t;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 s=this._getOrReturnCtx(l);return ee(s,{code:K.invalid_type,expected:le.bigint,received:s.parsedType}),pe}gte(l,s){return this.setLimit("min",l,!0,oe.toString(s))}gt(l,s){return this.setLimit("min",l,!1,oe.toString(s))}lte(l,s){return this.setLimit("max",l,!0,oe.toString(s))}lt(l,s){return this.setLimit("max",l,!1,oe.toString(s))}setLimit(l,s,u,d){return new Ul({...this._def,checks:[...this._def.checks,{kind:l,value:s,inclusive:u,message:oe.toString(d)}]})}_addCheck(l){return new Ul({...this._def,checks:[...this._def.checks,l]})}positive(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:oe.toString(l)})}negative(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:oe.toString(l)})}nonpositive(l){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:oe.toString(l)})}nonnegative(l){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:oe.toString(l)})}multipleOf(l,s){return this._addCheck({kind:"multipleOf",value:l,message:oe.toString(s)})}get minValue(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l}get maxValue(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l}}Ul.create=n=>new Ul({checks:[],typeName:xe.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...Se(n)});class pu extends Re{_parse(l){if(this._def.coerce&&(l.data=!!l.data),this._getType(l)!==le.boolean){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:le.boolean,received:u.parsedType}),pe}return Ra(l.data)}}pu.create=n=>new pu({typeName:xe.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Se(n)});class Mi extends Re{_parse(l){if(this._def.coerce&&(l.data=new Date(l.data)),this._getType(l)!==le.date){const f=this._getOrReturnCtx(l);return ee(f,{code:K.invalid_type,expected:le.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 $t;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 Mi({...this._def,checks:[...this._def.checks,l]})}min(l,s){return this._addCheck({kind:"min",value:l.getTime(),message:oe.toString(s)})}max(l,s){return this._addCheck({kind:"max",value:l.getTime(),message:oe.toString(s)})}get minDate(){let l=null;for(const s of this._def.checks)s.kind==="min"&&(l===null||s.value>l)&&(l=s.value);return l!=null?new Date(l):null}get maxDate(){let l=null;for(const s of this._def.checks)s.kind==="max"&&(l===null||s.value<l)&&(l=s.value);return l!=null?new Date(l):null}}Mi.create=n=>new Mi({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:xe.ZodDate,...Se(n)});class vx extends Re{_parse(l){if(this._getType(l)!==le.symbol){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:le.symbol,received:u.parsedType}),pe}return Ra(l.data)}}vx.create=n=>new vx({typeName:xe.ZodSymbol,...Se(n)});class Ad extends Re{_parse(l){if(this._getType(l)!==le.undefined){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:le.undefined,received:u.parsedType}),pe}return Ra(l.data)}}Ad.create=n=>new Ad({typeName:xe.ZodUndefined,...Se(n)});class Ed extends Re{_parse(l){if(this._getType(l)!==le.null){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:le.null,received:u.parsedType}),pe}return Ra(l.data)}}Ed.create=n=>new Ed({typeName:xe.ZodNull,...Se(n)});class gx extends Re{constructor(){super(...arguments),this._any=!0}_parse(l){return Ra(l.data)}}gx.create=n=>new gx({typeName:xe.ZodAny,...Se(n)});class Cd extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(l){return Ra(l.data)}}Cd.create=n=>new Cd({typeName:xe.ZodUnknown,...Se(n)});class ul extends Re{_parse(l){const s=this._getOrReturnCtx(l);return ee(s,{code:K.invalid_type,expected:le.never,received:s.parsedType}),pe}}ul.create=n=>new ul({typeName:xe.ZodNever,...Se(n)});class bx extends Re{_parse(l){if(this._getType(l)!==le.undefined){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:le.void,received:u.parsedType}),pe}return Ra(l.data)}}bx.create=n=>new bx({typeName:xe.ZodVoid,...Se(n)});class Pa extends Re{_parse(l){const{ctx:s,status:u}=this._processInputParams(l),d=this._def;if(s.parsedType!==le.array)return ee(s,{code:K.invalid_type,expected:le.array,received:s.parsedType}),pe;if(d.exactLength!==null){const m=s.data.length>d.exactLength.value,x=s.data.length<d.exactLength.value;(m||x)&&(ee(s,{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&&s.data.length<d.minLength.value&&(ee(s,{code:K.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),u.dirty()),d.maxLength!==null&&s.data.length>d.maxLength.value&&(ee(s,{code:K.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),u.dirty()),s.common.async)return Promise.all([...s.data].map((m,x)=>d.type._parseAsync(new en(s,m,s.path,x)))).then(m=>$t.mergeArray(u,m));const f=[...s.data].map((m,x)=>d.type._parseSync(new en(s,m,s.path,x)));return $t.mergeArray(u,f)}get element(){return this._def.type}min(l,s){return new Pa({...this._def,minLength:{value:l,message:oe.toString(s)}})}max(l,s){return new Pa({...this._def,maxLength:{value:l,message:oe.toString(s)}})}length(l,s){return new Pa({...this._def,exactLength:{value:l,message:oe.toString(s)}})}nonempty(l){return this.min(1,l)}}Pa.create=(n,l)=>new Pa({type:n,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Se(l)});function Ci(n){if(n instanceof kt){const l={};for(const s in n.shape){const u=n.shape[s];l[s]=An.create(Ci(u))}return new kt({...n._def,shape:()=>l})}else return n instanceof Pa?new Pa({...n._def,type:Ci(n.element)}):n instanceof An?An.create(Ci(n.unwrap())):n instanceof Hl?Hl.create(Ci(n.unwrap())):n instanceof zl?zl.create(n.items.map(l=>Ci(l))):n}class kt extends Re{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(),s=Be.objectKeys(l);return this._cached={shape:l,keys:s},this._cached}_parse(l){if(this._getType(l)!==le.object){const v=this._getOrReturnCtx(l);return ee(v,{code:K.invalid_type,expected:le.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 ul&&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 en(d,j,d.path,v)),alwaysSet:v in d.data})}if(this._def.catchall instanceof ul){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 en(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=>$t.mergeObjectSync(u,v)):$t.mergeObjectSync(u,y)}get shape(){return this._def.shape()}strict(l){return oe.errToObj,new kt({...this._def,unknownKeys:"strict",...l!==void 0?{errorMap:(s,u)=>{var f,m;const d=((m=(f=this._def).errorMap)==null?void 0:m.call(f,s,u).message)??u.defaultError;return s.code==="unrecognized_keys"?{message:oe.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,s){return this.augment({[l]:s})}catchall(l){return new kt({...this._def,catchall:l})}pick(l){const s={};for(const u of Be.objectKeys(l))l[u]&&this.shape[u]&&(s[u]=this.shape[u]);return new kt({...this._def,shape:()=>s})}omit(l){const s={};for(const u of Be.objectKeys(this.shape))l[u]||(s[u]=this.shape[u]);return new kt({...this._def,shape:()=>s})}deepPartial(){return Ci(this)}partial(l){const s={};for(const u of Be.objectKeys(this.shape)){const d=this.shape[u];l&&!l[u]?s[u]=d:s[u]=d.optional()}return new kt({...this._def,shape:()=>s})}required(l){const s={};for(const u of Be.objectKeys(this.shape))if(l&&!l[u])s[u]=this.shape[u];else{let f=this.shape[u];for(;f instanceof An;)f=f._def.innerType;s[u]=f}return new kt({...this._def,shape:()=>s})}keyof(){return Ay(Be.objectKeys(this.shape))}}kt.create=(n,l)=>new kt({shape:()=>n,unknownKeys:"strip",catchall:ul.create(),typeName:xe.ZodObject,...Se(l)});kt.strictCreate=(n,l)=>new kt({shape:()=>n,unknownKeys:"strict",catchall:ul.create(),typeName:xe.ZodObject,...Se(l)});kt.lazycreate=(n,l)=>new kt({shape:n,unknownKeys:"strip",catchall:ul.create(),typeName:xe.ZodObject,...Se(l)});class xu extends Re{_parse(l){const{ctx:s}=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 s.common.issues.push(...x.ctx.common.issues),x.result;const m=f.map(x=>new Cn(x.ctx.common.issues));return ee(s,{code:K.invalid_union,unionErrors:m}),pe}if(s.common.async)return Promise.all(u.map(async f=>{const m={...s,common:{...s.common,issues:[]},parent:null};return{result:await f._parseAsync({data:s.data,path:s.path,parent:m}),ctx:m}})).then(d);{let f;const m=[];for(const y of u){const v={...s,common:{...s.common,issues:[]},parent:null},w=y._parseSync({data:s.data,path:s.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 s.common.issues.push(...f.ctx.common.issues),f.result;const x=m.map(y=>new Cn(y));return ee(s,{code:K.invalid_union,unionErrors:x}),pe}}get options(){return this._def.options}}xu.create=(n,l)=>new xu({options:n,typeName:xe.ZodUnion,...Se(l)});const kn=n=>n instanceof Td?kn(n.schema):n instanceof ql?kn(n.innerType()):n instanceof gu?[n.value]:n instanceof Bl?n.options:n instanceof Od?Be.objectValues(n.enum):n instanceof wu?kn(n._def.innerType):n instanceof Ad?[void 0]:n instanceof Ed?[null]:n instanceof An?[void 0,...kn(n.unwrap())]:n instanceof Hl?[null,...kn(n.unwrap())]:n instanceof Ey||n instanceof ju?kn(n.unwrap()):n instanceof Su?kn(n._def.innerType):[];class Jd extends Re{_parse(l){const{ctx:s}=this._processInputParams(l);if(s.parsedType!==le.object)return ee(s,{code:K.invalid_type,expected:le.object,received:s.parsedType}),pe;const u=this.discriminator,d=s.data[u],f=this.optionsMap.get(d);return f?s.common.async?f._parseAsync({data:s.data,path:s.path,parent:s}):f._parseSync({data:s.data,path:s.path,parent:s}):(ee(s,{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,s,u){const d=new Map;for(const f of s){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 Jd({typeName:xe.ZodDiscriminatedUnion,discriminator:l,options:s,optionsMap:d,...Se(u)})}}function Rd(n,l){const s=il(n),u=il(l);if(n===l)return{valid:!0,data:n};if(s===le.object&&u===le.object){const d=Be.objectKeys(l),f=Be.objectKeys(n).filter(x=>d.indexOf(x)!==-1),m={...n,...l};for(const x of f){const y=Rd(n[x],l[x]);if(!y.valid)return{valid:!1};m[x]=y.data}return{valid:!0,data:m}}else if(s===le.array&&u===le.array){if(n.length!==l.length)return{valid:!1};const d=[];for(let f=0;f<n.length;f++){const m=n[f],x=l[f],y=Rd(m,x);if(!y.valid)return{valid:!1};d.push(y.data)}return{valid:!0,data:d}}else return s===le.date&&u===le.date&&+n==+l?{valid:!0,data:n}:{valid:!1}}class yu extends Re{_parse(l){const{status:s,ctx:u}=this._processInputParams(l),d=(f,m)=>{if(px(f)||px(m))return pe;const x=Rd(f.value,m.value);return x.valid?((xx(f)||xx(m))&&s.dirty(),{status:s.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}))}}yu.create=(n,l,s)=>new yu({left:n,right:l,typeName:xe.ZodIntersection,...Se(s)});class zl extends Re{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==le.array)return ee(u,{code:K.invalid_type,expected:le.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"}),s.dirty());const f=[...u.data].map((m,x)=>{const y=this._def.items[x]||this._def.rest;return y?y._parse(new en(u,m,u.path,x)):null}).filter(m=>!!m);return u.common.async?Promise.all(f).then(m=>$t.mergeArray(s,m)):$t.mergeArray(s,f)}get items(){return this._def.items}rest(l){return new zl({...this._def,rest:l})}}zl.create=(n,l)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zl({items:n,typeName:xe.ZodTuple,rest:null,...Se(l)})};class vu extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==le.object)return ee(u,{code:K.invalid_type,expected:le.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 en(u,x,u.path,x)),value:m._parse(new en(u,u.data[x],u.path,x)),alwaysSet:x in u.data});return u.common.async?$t.mergeObjectAsync(s,d):$t.mergeObjectSync(s,d)}get element(){return this._def.valueType}static create(l,s,u){return s instanceof Re?new vu({keyType:l,valueType:s,typeName:xe.ZodRecord,...Se(u)}):new vu({keyType:Fa.create(),valueType:l,typeName:xe.ZodRecord,...Se(s)})}}class wx extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==le.map)return ee(u,{code:K.invalid_type,expected:le.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 en(u,x,u.path,[v,"key"])),value:f._parse(new en(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")&&s.dirty(),x.set(v.value,w.value)}return{status:s.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")&&s.dirty(),x.set(v.value,w.value)}return{status:s.value,value:x}}}}wx.create=(n,l,s)=>new wx({valueType:l,keyType:n,typeName:xe.ZodMap,...Se(s)});class Bs extends Re{_parse(l){const{status:s,ctx:u}=this._processInputParams(l);if(u.parsedType!==le.set)return ee(u,{code:K.invalid_type,expected:le.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}),s.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}),s.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"&&s.dirty(),v.add(w.value)}return{status:s.value,value:v}}const x=[...u.data.values()].map((y,v)=>f._parse(new en(u,y,u.path,v)));return u.common.async?Promise.all(x).then(y=>m(y)):m(x)}min(l,s){return new Bs({...this._def,minSize:{value:l,message:oe.toString(s)}})}max(l,s){return new Bs({...this._def,maxSize:{value:l,message:oe.toString(s)}})}size(l,s){return this.min(l,s).max(l,s)}nonempty(l){return this.min(1,l)}}Bs.create=(n,l)=>new Bs({valueType:n,minSize:null,maxSize:null,typeName:xe.ZodSet,...Se(l)});class Td extends Re{get schema(){return this._def.getter()}_parse(l){const{ctx:s}=this._processInputParams(l);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Td.create=(n,l)=>new Td({getter:n,typeName:xe.ZodLazy,...Se(l)});class gu extends Re{_parse(l){if(l.data!==this._def.value){const s=this._getOrReturnCtx(l);return ee(s,{received:s.data,code:K.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:l.data}}get value(){return this._def.value}}gu.create=(n,l)=>new gu({value:n,typeName:xe.ZodLiteral,...Se(l)});function Ay(n,l){return new Bl({values:n,typeName:xe.ZodEnum,...Se(l)})}class Bl extends Re{_parse(l){if(typeof l.data!="string"){const s=this._getOrReturnCtx(l),u=this._def.values;return ee(s,{expected:Be.joinValues(u),received:s.parsedType,code:K.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(l.data)){const s=this._getOrReturnCtx(l),u=this._def.values;return ee(s,{received:s.data,code:K.invalid_enum_value,options:u}),pe}return Ra(l.data)}get options(){return this._def.values}get enum(){const l={};for(const s of this._def.values)l[s]=s;return l}get Values(){const l={};for(const s of this._def.values)l[s]=s;return l}get Enum(){const l={};for(const s of this._def.values)l[s]=s;return l}extract(l,s=this._def){return Bl.create(l,{...this._def,...s})}exclude(l,s=this._def){return Bl.create(this.options.filter(u=>!l.includes(u)),{...this._def,...s})}}Bl.create=Ay;class Od extends Re{_parse(l){const s=Be.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(l);if(u.parsedType!==le.string&&u.parsedType!==le.number){const d=Be.objectValues(s);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(s);return ee(u,{received:u.data,code:K.invalid_enum_value,options:d}),pe}return Ra(l.data)}get enum(){return this._def.values}}Od.create=(n,l)=>new Od({values:n,typeName:xe.ZodNativeEnum,...Se(l)});class bu extends Re{unwrap(){return this._def.type}_parse(l){const{ctx:s}=this._processInputParams(l);if(s.parsedType!==le.promise&&s.common.async===!1)return ee(s,{code:K.invalid_type,expected:le.promise,received:s.parsedType}),pe;const u=s.parsedType===le.promise?s.data:Promise.resolve(s.data);return Ra(u.then(d=>this._def.type.parseAsync(d,{path:s.path,errorMap:s.common.contextualErrorMap})))}}bu.create=(n,l)=>new bu({type:n,typeName:xe.ZodPromise,...Se(l)});class ql extends Re{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:s,ctx:u}=this._processInputParams(l),d=this._def.effect||null,f={addIssue:m=>{ee(u,m),m.fatal?s.abort():s.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(s.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"||s.value==="dirty"?Os(y.value):y});{if(s.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"||s.value==="dirty"?Os(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"&&s.dirty(),m(x.value),{status:s.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"&&s.dirty(),m(x.value).then(()=>({status:s.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(!Li(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:s.value,value:x}}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(m=>Li(m)?Promise.resolve(d.transform(m.value,f)).then(x=>({status:s.value,value:x})):pe);Be.assertNever(d)}}ql.create=(n,l,s)=>new ql({schema:n,typeName:xe.ZodEffects,effect:l,...Se(s)});ql.createWithPreprocess=(n,l,s)=>new ql({schema:l,effect:{type:"preprocess",transform:n},typeName:xe.ZodEffects,...Se(s)});class An extends Re{_parse(l){return this._getType(l)===le.undefined?Ra(void 0):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}An.create=(n,l)=>new An({innerType:n,typeName:xe.ZodOptional,...Se(l)});class Hl extends Re{_parse(l){return this._getType(l)===le.null?Ra(null):this._def.innerType._parse(l)}unwrap(){return this._def.innerType}}Hl.create=(n,l)=>new Hl({innerType:n,typeName:xe.ZodNullable,...Se(l)});class wu extends Re{_parse(l){const{ctx:s}=this._processInputParams(l);let u=s.data;return s.parsedType===le.undefined&&(u=this._def.defaultValue()),this._def.innerType._parse({data:u,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}wu.create=(n,l)=>new wu({innerType:n,typeName:xe.ZodDefault,defaultValue:typeof l.default=="function"?l.default:()=>l.default,...Se(l)});class Su extends Re{_parse(l){const{ctx:s}=this._processInputParams(l),u={...s,common:{...s.common,issues:[]}},d=this._def.innerType._parse({data:u.data,path:u.path,parent:{...u}});return mu(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}}Su.create=(n,l)=>new Su({innerType:n,typeName:xe.ZodCatch,catchValue:typeof l.catch=="function"?l.catch:()=>l.catch,...Se(l)});class Sx extends Re{_parse(l){if(this._getType(l)!==le.nan){const u=this._getOrReturnCtx(l);return ee(u,{code:K.invalid_type,expected:le.nan,received:u.parsedType}),pe}return{status:"valid",value:l.data}}}Sx.create=n=>new Sx({typeName:xe.ZodNaN,...Se(n)});class Ey extends Re{_parse(l){const{ctx:s}=this._processInputParams(l),u=s.data;return this._def.type._parse({data:u,path:s.path,parent:s})}unwrap(){return this._def.type}}class Fd extends Re{_parse(l){const{status:s,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"?(s.dirty(),Os(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"?(s.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:u.path,parent:u})}}static create(l,s){return new Fd({in:l,out:s,typeName:xe.ZodPipeline})}}class ju extends Re{_parse(l){const s=this._def.innerType._parse(l),u=d=>(Li(d)&&(d.value=Object.freeze(d.value)),d);return mu(s)?s.then(d=>u(d)):u(s)}unwrap(){return this._def.innerType}}ju.create=(n,l)=>new ju({innerType:n,typeName:xe.ZodReadonly,...Se(l)});var xe;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(xe||(xe={}));const p=Fa.create,A=Dl.create;Ul.create;const Oe=pu.create;Mi.create;const Cy=Cd.create;ul.create;const ae=Pa.create,z=kt.create,Q1=xu.create,Ry=Jd.create;yu.create;zl.create;const qs=vu.create,ka=gu.create,he=Bl.create;bu.create;An.create;Hl.create;const jx={string:(n=>Fa.create({...n,coerce:!0})),number:(n=>Dl.create({...n,coerce:!0})),boolean:(n=>pu.create({...n,coerce:!0})),bigint:(n=>Ul.create({...n,coerce:!0})),date:(n=>Mi.create({...n,coerce:!0}))},X1=pe,I1=p().regex(/^github\.com\/[^/]+\/[^/]+$/,"Expected github.com/<owner>/<repo>"),K1=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?$/;function J1(n){const l=n.trim();return l?!!(l.startsWith("/")||l.startsWith("~")||l.startsWith(".")||/^[A-Za-z]:[\\/]/.test(l)||l.startsWith("\\\\")):!1}function Wd(n){const l=n.trim();if(!l)throw new Error("Repository is required");if(J1(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 s,u;const d=K1.exec(l);if(d&&!l.includes("://")&&!l.toLowerCase().includes("github.com"))s=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: ${n}`)}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: ${n}`);s=y[0],u=y[1].replace(/\.git$/i,"")}if(!s||!u||s.includes("..")||u.includes(".."))throw new Error(`Unrecognized GitHub repository reference: ${n}`);const f=I1.parse(`github.com/${s}/${u}`);return{owner:s,repo:u,identity:f,cloneUrl:`https://github.com/${s}/${u}.git`}}const Ty=p().min(1).transform((n,l)=>{try{return Wd(n).identity}catch(s){return l.addIssue({code:K.custom,message:s.message}),X1}}),Oy="repo:",F1=he(["resolved","unresolved","conflict","invalid"]),W1=z({status:F1,repository:p().optional(),sourceLabel:p().optional(),labels:ae(p()).optional(),error:p().optional()});function P1(n){return n?n.filter(l=>l.toLowerCase().startsWith(Oy)):[]}const ew=100,tw=z({label:p(),repository:p()});z({mappings:ae(tw).max(ew+1)});function Ly(n){const l=P1(n);if(l.length===0)return{status:"unresolved",labels:[]};if(l.length>1)return{status:"conflict",labels:[...l]};const s=l[0],u=s.slice(Oy.length).trim();if(!u)return{status:"invalid",labels:[s],error:"Repository label has no value"};try{return{status:"resolved",repository:Wd(u).identity,sourceLabel:s,labels:[s]}}catch(d){return{status:"invalid",labels:[s],error:d.message}}}const My=z({id:p(),title:p(),url:p(),subtitle:p().optional(),source:p().optional()});z({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 Yt=he(["claude_code","cursor_local","codex_local","muse_code"]),$a=z({maxTurns:A().positive().nullable().optional(),maxBudgetUsd:A().positive().nullable().optional()}),Dy=z({plan:$a.optional(),execute:$a.optional(),reflect:$a.optional()});function du(n){if(!(n!=null&&n.trim()))return null;try{const l=$a.parse(JSON.parse(n));return l.maxTurns==null&&l.maxBudgetUsd==null?null:l}catch{return null}}function aw(n){return!n||n.maxTurns==null&&n.maxBudgetUsd==null?null:JSON.stringify(n)}const Pd=he(["developer","reviewer","legacy"]),nw=he(["queued","running","done","failed","timed_out","cancelled"]);z({id:p().uuid(),issueId:p().uuid(),role:Pd,round:A().int().min(1),agentId:p().uuid().nullable(),runtime:Yt.nullable(),model:p().nullable(),budgetJson:p().nullable(),worktreePath:p().nullable(),inputSha:p().nullable(),status:nw,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()});z({issueId:p().uuid(),role:Pd,round:A().int().min(1),agentId:p().uuid().nullable(),runtime:Yt.nullable(),model:p().nullable().optional(),budgetJson:p().nullable().optional(),inputSha:p().nullable().optional(),metadataJson:p().nullable().optional(),profileSnapshotJson:p().nullable().optional()});const lw=z({worktreeWrite:Oe(),publishReview:Oe(),outboundMutation:Oe(),resolveHumanAction:Oe()}),Uy=z({worktreeWrite:Oe().optional(),outboundMutation:Oe().optional()}).strict(),Lu=he(["low","medium","high"]);z({version:ka(1),agentId:p().nullable(),role:Pd,runtime:Yt.nullable(),model:p().nullable(),effort:Lu.nullable().default(null),budgetJson:p().nullable(),permissionPolicy:lw,deckId:p().nullable(),purpose:p().nullable(),capturedAt:p()});const zy="auto",iw="muse-spark-1.3-contributor",sw=z({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()}),rw=z({id:p().uuid(),name:p(),runtime:Yt,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:Lu.nullable(),defaultBudgetJson:p().nullable(),purpose:p().nullable(),playbookIdsJson:p().nullable(),externalMemoryRefsJson:p().nullable(),permissionPolicyJson:p().nullable(),isBuiltin:Oe(),createdAt:p(),updatedAt:p()}),By=rw.extend({healthy:Oe(),issues:ae(sw)});z({name:p().min(1),runtime:Yt,deckId:p().uuid(),defaultModel:p().nullable().optional(),defaultEffort:Lu.nullable().optional(),defaultBudget:$a.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:Uy.nullable().optional()});z({name:p().min(1).optional(),runtime:Yt.optional(),deckId:p().uuid().nullable().optional(),defaultModel:p().nullable().optional(),defaultEffort:Lu.nullable().optional(),defaultBudget:$a.nullable().optional(),purpose:p().nullable().optional(),permissionPolicy:Uy.nullable().optional()});z({agents:ae(By),issueCount:A()});function Nx(n){return n.defaultModel??n.defaultExecuteModel??n.defaultPlanModel??null}function uw(n){const l=du(n.defaultBudgetJson)??du(n.defaultExecuteBudgetJson)??du(n.defaultPlanBudgetJson);return aw(l)}const ow=he(["slack_message","email","service_tool_call"]),cw=z({target:p().min(1).max(120),body:p().min(1).max(4e3)}),dw=z({serviceName:p().min(1).max(120),toolName:p().min(1).max(120),arguments:qs(Cy())}),fw=z({actionType:ow,summary:cw,toolCall:dw}),hw=he(["pending","sent","rejected"]);z({draft:fw,status:hw,sentAt:p().optional(),rejectedAt:p().optional(),bodyMismatch:Oe().optional(),deliveryAttempts:A().int().min(0).default(0)});z({draftArtifactId:p().uuid(),sentAt:p(),toolResult:qs(Cy()),permalink:p().url().optional()});const mw=z({failure_summary:p().min(1),user_feedback_excerpt:p().min(1),corrected_output_hint:p().optional()}),pw=Ry("op",[z({op:ka("add_item"),section:p().min(1),text:p().min(1)}),z({op:ka("amend_item"),section:p().min(1),anchor:p().min(1),text:p().min(1)}),z({op:ka("remove_item"),section:p().min(1),anchor:p().min(1)}),z({op:ka("set_triggers"),triggers:ae(p())}),z({op:ka("rewrite_body"),text:p()})]);z({rationale:p().min(1),ops:ae(pw).min(1),evidence:mw.optional()});const xw="v1",qy=he(["feature","bug fix","refactor","investigation","split child"]);qy.options;const yw=z({text:p(),evidence:p().nullable()}),vw=z({version:ka(xw),executionMode:qy,nonGoals:ae(p()),exitPredicate:p(),onePrStoppingPoint:p(),acceptanceCriteria:ae(yw)}),Hy={executionMode:"Builder execution mode",nonGoals:"Non-goals",exitPredicate:"Exit predicate",onePrStoppingPoint:"One-PR stopping point",acceptanceCriteria:"Acceptance criteria"},gw=Object.keys(Hy);function bw(n){return n.trim().toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ").trim()}Object.fromEntries(gw.map(n=>[bw(Hy[n]),n]));const ww=he(["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"]),Sw=he(["human","developer","reviewer","system"]),$y=he(["manual","linear","agent"]),jw=z({id:p().uuid(),source:$y,externalId:p().nullable(),externalLabel:p().nullable(),externalUrl:p().nullable(),title:p(),description:p().nullable(),acceptanceCriteria:p().nullable(),executionContract:vw.nullable().optional(),repo:p(),baseBranch:p(),status:ww,currentOwner:Sw,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:Oe(),createdAt:p(),updatedAt:p()});z({title:p().min(1),description:p().optional(),acceptanceCriteria:p().optional(),repo:Ty,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:Oe().default(!1),source:$y.default("manual"),externalId:p().optional(),externalLabel:p().optional(),externalUrl:p().optional(),enqueue:Oe().default(!0),linearAttachments:ae(My).optional()});z({title:p().min(1).optional(),description:p().nullable().optional(),acceptanceCriteria:p().nullable().optional(),repo:Ty.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:Oe().optional()});const _x={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(_x).filter(n=>_x[n].length===0);const Nw=he(["enqueued","already_queued","not_queued"]);jw.extend({created:Oe(),queue:Nw,priorPasses:A().int().min(0)});z({id:p(),issueId:p().nullable(),workerSessionId:p().nullable(),kind:p(),contentJson:p().nullable(),blobPath:p().nullable(),author:he(["human","agent","system"]),createdAt:p()});const _w=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"]),kw=he(["task","infrastructure","unknown"]),Aw=he(["high","medium","low"]),Ew=he(["outcome_kind","session_error","spawn_log","workflow_event","recovery"]),Cw=he(["exact","inferred"]),Ld=z({code:_w,domain:kw,primary:Oe(),confidence:Aw,evidenceSource:Ew,occurredAt:p().nullable(),eventCursor:A().int().nullable(),rawReason:p(),sessionId:p().nullable(),logPath:p().nullable(),eventId:p().nullable(),eventType:p().nullable(),quality:Cw}),Rw=he(["commit","verification_receipt","branch_pushed"]),Tw=he(["sampler","salvage","session_end"]),ef=he(["worktree","commit","verification_receipt","publish_only"]);z({kind:Rw,observedSha:p().nullable(),observedAt:p(),origin:Tw.nullable(),inputSha:p().nullable(),samplingPrecisionMs:A().int().nullable(),branch:p().nullable()});z({kinds:ae(ef),retryReason:p().nullable()});const Ow=he(["done","closed","migrated"]);z({id:p().uuid(),issueId:p().uuid(),workflowVersion:p(),startedAt:p(),completedAt:p().nullable(),outcome:Ow.nullable()});const Lw=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"]);z({id:p().uuid(),issueId:p().uuid(),workflowInstanceId:p().uuid().nullable(),workerSessionId:p().uuid().nullable(),type:Lw,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 Mw=he(["product_scope_decision","policy_escalation","attempts_exhausted","final_review","deck_interaction_required","reflection_interaction_required","outbound_delivery_interaction_required","muse_capability","operator_verification"]),Dw=he(["open","resolved"]);z({id:p().uuid(),issueId:p().uuid().nullable(),runId:p().uuid().nullable(),workflowInstanceId:p().uuid().nullable(),actionType:Mw,reason:p(),question:p(),evidenceJson:p().nullable(),responseOptionsJson:p().nullable(),continuationPreviewJson:p().nullable(),requestId:p().nullable(),status:Dw,resolutionJson:p().nullable(),resolvedBy:p().nullable(),requestedAt:p(),resolvedAt:p().nullable()});function Mu(n){if(!n)return null;try{return JSON.parse(n)}catch{return null}}function Uw(n){const l=Mu(n.responseOptionsJson);return Array.isArray(l)?l.filter(s=>typeof(s==null?void 0:s.choice)=="string"&&typeof(s==null?void 0:s.label)=="string"):[]}function tf(n){return Mu(n.evidenceJson)??{}}function Du(n){const s=tf(n).pushDivergence;return!s||typeof s!="object"?null:s}function zw(n){const s=tf(n).worktreeBlocker;return!!s&&typeof s=="object"&&typeof s.fingerprint=="string"}function Bw(n){return tf(n).mergeFailure===!0}function Yy(n){const l=Mu(n.continuationPreviewJson);return typeof(l==null?void 0:l.resumeRole)=="string"?l.resumeRole:null}const qw=/worktree|unpushed|uncommitted|dirty|preserved|non-fast-forward|diverged|already used by|recovery:|force-with-lease/i,Hw=/could not be pushed|non-fast-forward|rejected.*push|push.*rejected/i,$w=/uncommitted|dirty worktree|has uncommitted changes/i;function Vy(n){const l=/\n?Recovery:\s*\n?/,s=n.match(l);if(!s||s.index===void 0)return{head:n.trim(),commands:[]};const u=n.slice(0,s.index).trim(),f=n.slice(s.index+s[0].length).split(`
61
- `).map(m=>m.trim()).filter(m=>m.length>0);return{head:u,commands:f}}function Yw(n){const s=Vy(n).head.replace(/\s+/g," ").trim(),u=s.match(/^(.+?[.!?])(\s|$)/);return(u?u[1]:s).trim()}const Vw=/(?:~|\/(?:[^/\s\\:"'*?<>|][^/\s\\:"'*?<>|]*))+(?:\/[^/\s\\:"'*?<>|]+)*/g;function Zw(n){const l=[],s=new Set,u=f=>{const m=f.trim().replace(/[.,;:!?)"'\]]+$/,"");m.length<2||s.has(m)||(s.add(m),l.push(m))};for(const f of[n.reason,n.question])for(const m of f.matchAll(Vw)){const x=m[0];/^\/\d+(\.\d+)*$/.test(x)||!x.includes("/")&&!x.startsWith("~")||u(x)}const d=Du(n);return typeof(d==null?void 0:d.worktreePath)=="string"&&d.worktreePath&&u(d.worktreePath),l}function kx(n){return n.length>12?n.slice(0,12):n}function Gw(n){const l=[],s=Du(n);if(s&&typeof s.localSha=="string"&&typeof s.remoteSha=="string"){const d=typeof s.branch=="string"?s.branch:"the branch",f=typeof s.ahead=="number"?` (+${s.ahead})`:"",m=typeof s.behind=="number"?` (+${s.behind})`:"";l.push(`Push: local ${s.localSha}${f} · origin/${d} ${s.remoteSha}${m}`),typeof s.observedRemoteSha=="string"&&s.observedRemoteSha!==s.remoteSha&&l.push(`Remote moved: origin/${d} is now at ${s.observedRemoteSha}`),typeof s.lastLeaseError=="string"&&s.lastLeaseError&&l.push(`Last lease attempt: ${s.lastLeaseError}`)}const u=Yy(n);return u&&l.push(`Continuation: resumes as ${u}`),l}function Qw(n){return n==="close"||n==="reject"||n==="abort"}function nl(n){return n.length===0?null:n.some(l=>l.choice==="push_with_lease")?"push_with_lease":(n.find(l=>!Qw(l.choice))??n[0]).choice}function Xw(n){if(n.actionType!=="policy_escalation")return"other";if(Bw(n))return"merge-failure";const l=Du(n);if((l==null?void 0:l.relationship)==="diverged")return"diverged-push";if(l&&(l.relationship==="behind"||typeof l.localSha=="string"))return"unpushed";const s=`${n.reason}
62
- ${n.question}`;return Hw.test(s)?"unpushed":Yy(n)==="reviewer"?"reviewer-retry":$w.test(s)?"dirty-worktree":zw(n)||/already used by worktree/i.test(s)||/worktree/i.test(s)&&/Recovery:/.test(s)?"worktree-conflict":"ordinary-escalation"}const Iw="Resume safely";function Zy(n){const l=Xw(n),s=Uw(n),{commands:u}=Vy(n.reason),d=Zw(n),f=Gw(n),m=(()=>{const y=Mu(n.evidenceJson);return y==null?null:JSON.stringify(y,null,2)})(),x={question:n.question,reason:n.reason,commands:u,paths:d,factLines:f,evidencePretty:m};switch(l){case"diverged-push":{const y=Du(n),v=y&&typeof y.branch=="string"&&typeof y.localSha=="string"&&typeof y.remoteSha=="string"?` (origin/${y.branch}: local ${kx(y.localSha)} against remote ${kx(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:s,primaryChoice:nl(s),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:s,primaryChoice:nl(s),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:s,primaryChoice:nl(s),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:s,primaryChoice:nl(s),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:s,primaryChoice:nl(s),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:s,primaryChoice:nl(s),details:x};case"ordinary-escalation":{const y=Yw(n.reason),v=!qw.test(`${n.reason}
63
- ${n.question}`),w=v?s.map(j=>j.choice==="resume"&&j.label==="Resume development"?{...j,label:Iw}:j):s;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:nl(w),details:x}}case"other":default:return{kind:"other",title:n.question,context:null,safeResume:!1,displayOptions:s,primaryChoice:nl(s),details:x}}}const Kw=he(["blocking","non_blocking"]),Jw=he(["open","resolved","recurring","superseded"]);z({id:p().uuid(),issueId:p().uuid(),fingerprint:p(),severity:Kw,title:p(),rationale:p(),evidenceRef:p().nullable(),file:p().nullable(),line:A().int().nullable(),status:Jw,firstRound:A().int().min(1),lastRound:A().int().min(1)});z({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 Fw=z({available:ka(!0)}),Ww=z({available:ka(!1),until:p(),reason:p()});Ry("available",[Fw,Ww]);const af=he(["supported_protocol","observed_event","experimental_api","unavailable"]),Uu=he(["unsupported","missing","expired","unparsable","stale"]),Pw=he(["five_hour","weekly"]),e2=z({message:p().min(1),consecutiveFailures:A().int().positive(),firstFailureAt:p(),lastFailureAt:p()}),t2=z({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:af,unavailableReason:Uu.nullable(),unavailableDetail:e2.nullable().optional(),criticalRole:Pw.nullable()}),a2=z({runtime:Yt,windows:ae(t2),unavailableReason:Uu.nullable()});z({runtimes:ae(a2),generatedAt:p()});z({configured:Oe(),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:af,unavailableReason:Uu.nullable(),observedAt:p().nullable(),generatedAt:p()});z({enabled:Oe(),configured:Oe(),cycleLabel:p().nullable(),cycleStart:p().nullable(),cycleEnd:p().nullable(),usageValue:A().nullable(),usageUnit:p().nullable(),remainingPercent:A().min(0).max(100).nullable(),source:af,unavailableReason:Uu.nullable(),observedAt:p().nullable(),generatedAt:p()});function Gy(n,l=Date.now()){if(n.remainingPercent===null||n.source==="unavailable"||n.unavailableReason!==null)return!1;if(n.resetAt!==null){const s=Date.parse(n.resetAt);if(!Number.isFinite(s)||s<=l)return!1}if(n.freshUntil!==null){const s=Date.parse(n.freshUntil);if(!Number.isFinite(s)||s<=l)return!1}if(n.expiresAt!==null){const s=Date.parse(n.expiresAt);if(!Number.isFinite(s)||s<=l)return!1}if(n.observedAt){const s=Date.parse(n.observedAt);if(!Number.isFinite(s)||s>l+6e4)return!1}return!0}const n2=he(["queued","admitted","removed"]),l2=z({id:p().uuid(),issueId:p().uuid(),position:A().int(),enqueuedAt:p(),state:n2,waitReason:p().nullable(),waitReasonAt:p().nullable()});l2.extend({title:p().optional(),issueStatus:p().optional()});z({issueId:p().uuid()});const i2=Q1([ka("top"),ka("bottom"),z({before:p().uuid()}).strict(),z({after:p().uuid()}).strict()]);z({to:i2});const s2=2;z({maxActiveIssues:A().int().min(1).max(s2)});z({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:Oe()});const ia=he(["exact","inferred","unavailable"]),zu=z({quality:ia,reasons:ae(p())}),Qy=he(["queue_wait","coordinator_setup","agent_process","coordinator_validation_publish","coordinator_work"]),Us=z({phase:Qy,startMs:A().int().nullable(),endMs:A().int().nullable(),durationMs:A().int().nullable(),quality:ia,reasons:ae(p()),sessionId:p().nullable(),startCursor:A().int().nullable(),endCursor:A().int().nullable()}),r2=zu.extend({phase:Qy,durationMs:A().int().nullable(),rawCount:A().int(),known:A().int(),total:A().int()}),Xy=z({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:ia,reasons:ae(p()),category:p().nullable(),sessionId:p().nullable()}),Jt=zu.extend({value:A().nullable(),known:A().int(),total:A().int()}),Wa=zu.extend({p50:A().nullable(),p95:A().nullable(),n:A().int()}),u2=z({sessionId:p(),role:p(),runtime:p().nullable(),model:p().nullable(),status:p(),round:A().int(),publishOnly:Oe(),setup:Us,agentProcess:Us,validationPublish:Us,spawnEnvelopeMs:A().int().nullable(),spawnEnvelopeQuality:ia,spawnEnvelopeReasons:ae(p()),failureCauses:ae(Ld),reuseKinds:ae(ef).optional(),silence:ae(Xy),silenceQuality:ia,silenceReasons:ae(p()),tokensIn:A().int().nullable(),tokensOut:A().int().nullable(),costUsd:A().nullable(),usageDurationMs:A().int().nullable(),usageQuality:ia,usageReasons:ae(p())}),o2=z({kind:p().nullable(),observedSha:p().nullable(),msSinceWorkflowStart:A().int().nullable(),quality:ia,reasons:ae(p())}),c2=z({attempts:A().int(),retries:A().int(),cold:A().int(),reused:A().int(),unknown:A().int(),publishOnly:A().int(),reuseRate:A().nullable(),preservedKinds:ae(ef).optional(),quality:ia,reasons:ae(p())}),d2=z({rounds:A().int(),verdicts:A().int(),changeRequests:A().int(),changeRequestRate:A().nullable(),quality:ia,reasons:ae(p())});z({issueId:p(),elapsed:Us,rawIntervals:ae(Us),unionedDurations:ae(r2),exclusiveTotalMs:A().int().nullable(),exclusiveTotalQuality:ia,exclusiveTotalReasons:ae(p()),nested:ae(Xy),attempts:ae(u2),primaryFailure:Ld.nullable(),primaryFailureQuality:ia,primaryFailureReasons:ae(p()),consequenceCauses:ae(Ld),waste:z({failedAttempts:A().int(),publishOnlyAttempts:A().int(),runtimeMs:Jt,tokensIn:Jt,tokensOut:Jt,costUsd:Jt}),firstCheckpoint:o2,retry:c2,reviewer:d2,humanWaitMs:A().int().nullable(),humanWaitQuality:ia,humanWaitReasons:ae(p()),interventionCount:A().int(),coverage:z({duration:Jt,tokens:Jt,cost:Jt})});z({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 rd=zu.extend({numerator:A().int(),denominator:A().int(),rate:A().nullable()}),ud=z({key:p(),attempts:A().int(),successes:A().int(),successRate:A().nullable(),retries:A().int(),retryRate:A().nullable(),wallTimeMs:Wa});z({window:z({from:p(),to:p(),defaultApplied:Oe()}),pagination:z({limit:A().int(),offset:A().int(),totalIssues:A().int()}),issueIds:ae(p()),phaseWallTime:qs(p(),Wa),attemptSuccess:rd,issueSuccess:rd,primaryFailures:ae(z({code:p(),count:A().int(),rate:A().nullable()})),primaryFailureDenominator:A().int(),waste:z({failedAttempts:A().int(),runtimeMs:Jt,tokensIn:Jt,tokensOut:Jt,costUsd:Jt}),checkpointLatencyMs:Wa,retryReuse:rd,reviewer:z({rounds:A().int(),verdicts:A().int(),changeRequests:A().int(),changeRequestRate:A().nullable(),quality:ia,reasons:ae(p())}),humanInterventions:z({totalActions:A().int(),issuesWithIntervention:A().int(),humanWaitMs:Wa}),byRole:ae(ud),byRuntime:ae(ud),byModel:ae(ud),coverage:z({duration:Jt,tokens:Jt,cost:Jt})});const f2=100,Iy=25,Ky=5,h2=he(["developer","reviewer","legacy"]),m2=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"]),p2=he(["task","infrastructure","unknown"]);z({from:p().optional(),to:p().optional(),repo:p().optional(),role:h2.optional(),runtime:p().optional(),model:p().optional(),status:p().optional(),page:jx.number().int().min(1).default(1),limit:jx.number().int().min(1).max(f2).default(Iy)});const Jy=he(["exact","inferred","unavailable"]),Sa=z({sum:A().nullable(),known:A().int().min(0),total:A().int().min(0),quality:Jy,reasons:ae(p())}),od=z({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:Wa,spawnEnvelopeMs:Wa,retryRate:A().nullable(),tokensIn:Sa,tokensOut:Sa,costUsd:Sa,durationMs:Sa,failedDurationMs:Sa,failedTokensIn:Sa,failedTokensOut:Sa,failedCostUsd:Sa}),x2=z({code:m2,domain:p2,count:A().int().min(0),share:A().nullable(),issueIds:ae(p()),issueTotal:A().int().min(0)}),y2=z({id:p(),title:p(),status:p(),repo:p(),attempts:A().int().min(0),updatedAt:p()}),v2=z({window:z({from:p(),to:p()}),filters:z({repo:p().nullable(),role:p().nullable(),runtime:p().nullable(),model:p().nullable(),status:ae(p())}),summary:z({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:Jy,interventions:A().int().min(0),avgReviewerRounds:A().nullable(),reviewedIssues:A().int().min(0),changeRequestRate:A().nullable(),sessionWallMs:Wa,spawnEnvelopeMs:Wa,checkpointMs:Wa,phaseWallMs:ae(z({phase:p(),stat:Wa})),failedDurationMs:Sa,failedTokensIn:Sa,failedTokensOut:Sa,failedCostUsd:Sa}),byRole:ae(od),byRuntime:ae(od),byModel:ae(od),failures:ae(x2),issues:ae(y2),pagination:z({page:A().int().min(1),limit:A().int().min(1),total:A().int().min(0),totalPages:A().int().min(0)}),meta:z({generatedAt:p(),partial:Oe(),partialReasons:ae(p())})});function Fy(n){const l=new URLSearchParams;for(const[s,u]of Object.entries(n)){if(u==null)continue;const d=String(u).trim();d&&(s==="page"&&d==="1"||s==="limit"&&d===String(Iy)||l.set(s,d))}return l.sort(),l.toString()}function ll(n,l){return n.sum===null||n.known===0?"Unavailable":n.known<n.total?`${l(n.sum)} (${n.known}/${n.total} known)`:l(n.sum)}function Wy(n){return n<Ky?`n=${n} (sparse)`:`n=${n}`}function Md(n){return n<Ky}function Ax(n,l){if(n.n===0||n.p50===null&&n.p95===null)return"Unavailable";const s=u=>u===null?"–":l(u);return`P50 ${s(n.p50)} · P95 ${s(n.p95)} (${Wy(n.n)})`}function Ls(n){return`$${n.toFixed(2)}`}function Je(n){return n.toLocaleString("en-US")}function g2(n){if(!Number.isFinite(n))return Je(n);const l=Math.abs(n);if(l<1e3)return Je(n);const s=u=>u>=100?String(Math.round(u)):u.toFixed(1).replace(/\.0$/,"");return l<1e6?`${s(n/1e3)}K`:`${s(n/1e6)}M`}function Kt(n){if(n<1e3)return`${Math.round(n)} ms`;const l=n/1e3;if(l<60)return`${l.toFixed(1)} s`;const s=Math.floor(l/60),u=Math.round(l%60);return s<60?`${s}m ${u}s`:`${Math.floor(s/60)}h ${s%60}m`}function Bu(n){return n===null||!Number.isFinite(n)?"Unavailable":`${(n*100).toFixed(1)}%`}const b2=he(["queued","plan_pending","plan_approved","running","review","done","failed","cancelled"]),Py=he(["code","communication","email","research","content","other"]),w2=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"]),qu=he(["plan","execute","reflect","qa"]),ev=he(["retry","approve"]);z({patchId:p(),playbookId:p().optional(),playbookTitle:p().optional(),rationale:p().optional(),status:ka("proposed"),trigger:ev,dashboardUrl:p().optional()});z({status:he(["pending","completed","failed","skipped"]),trigger:ev,error:p().optional()});const S2=z({type:he(["system","human","context","thinking","assistant","tool","rate_limit","result"]),text:p(),toolName:p().optional()});z({phase:qu,runtime:Yt,entries:ae(S2)});const j2=z({phase:qu,runtime:Yt,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()}),N2=z({label:p(),usage:j2,maxTurns:A().optional(),maxBudgetUsd:A().optional()});z({lines:ae(N2),total:z({totalCostUsd:A(),inputTokens:A(),outputTokens:A(),durationMs:A(),numTurns:A()})});z({phase:qu,runtime:Yt,sessionId:p()});z({phase:qu,exitCode:A(),resultText:p().optional(),isError:Oe().optional(),blocker:z({summary:p().optional()}).optional()});z({path:p(),title:p(),markdown:p()});z({markdown:p(),sessionId:p().optional()});const _2=he(["manual","linear"]);z({id:p(),title:p(),description:p().optional(),url:p().optional()});const _n=z({id:p().uuid(),source:_2,externalId:p().nullable(),externalLabel:p().nullable(),taskCategory:Py,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:Yt.nullable(),planModel:p().nullable(),executeModel:p().nullable(),status:b2,lineageId:p().uuid().nullable(),acceptanceCriteria:p().nullable(),approvalGatesJson:p().nullable(),budgetJson:p().nullable(),createdAt:p(),updatedAt:p()});z({id:p().uuid(),runId:p().uuid(),kind:w2,contentJson:p().nullable(),blobPath:p().nullable(),author:he(["human","agent","system"]),createdAt:p()});z({id:p().uuid(),runId:p().uuid(),type:p(),payloadJson:p().nullable(),ts:p()});z({title:p().min(1),description:p().optional(),taskCategory:Py.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:Dy.optional()});z({runtime:Yt,deckId:p().uuid().optional(),playbookId:p().optional(),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),budget:Dy.optional()});z({planMarkdown:p(),approve:Oe().default(!1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),planBudget:$a.nullable().optional(),executeBudget:$a.nullable().optional()});z({runtime:Yt.optional(),deckId:p().uuid().optional(),playbookId:p().optional(),executeModel:p().nullable().optional(),executeBudget:$a.nullable().optional()});z({feedback:p().min(1),planModel:p().nullable().optional(),executeModel:p().nullable().optional(),executeBudget:$a.nullable().optional()});z({outboundBody:p().min(1).max(4e3).optional()});const k2=z({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:W1.optional(),attachments:ae(My).optional()});z({stateFilter:ae(p()),teamId:p().nullable(),assigneeMe:Oe(),syncEnabled:Oe()});const Dd=z({stateFilter:ae(p().min(1)).min(1),teamId:p().nullable(),assigneeMe:Oe()});Dd.extend({persisted:Dd,envOverrides:z({stateFilter:Oe(),teamId:Oe()})});Dd.partial();const A2=z({id:p(),name:p(),key:p().optional()}),E2=z({name:p(),type:p().optional(),teamId:p().optional()});z({teams:ae(A2),workflowStates:ae(E2),viewer:z({id:p(),name:p(),email:p().optional()}).nullable()});z({candidates:ae(k2),hasMore:Oe()});z({host:p(),port:A().int().min(1).max(65535),envOverride:Oe()});const C2=he(["UNAUTHORIZED","DECK_UNAVAILABLE"]);z({connected:Oe(),apiUrl:p(),mcpUrl:p(),deckCount:A().optional(),envOverride:Oe(),error:p().optional(),deckAccessError:C2.optional(),deckAccessErrorMessage:p().optional()});z({agentId:p().uuid().optional(),autoAgent:Oe().optional(),planModel:p().nullable().optional()}).refine(n=>n.agentId!==void 0||n.autoAgent===!0,{message:"Provide agentId or autoAgent: true"});z({planModel:p().nullable().optional(),planBudget:$a.nullable().optional(),feedback:p().optional(),editedMarkdown:p().optional()});const R2=z({id:p(),label:p()});z({runtime:Yt,models:ae(R2),source:he(["live","fallback"])});z({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:qs(p(),A()),pendingSendCounts:qs(p(),A()),sentRunIds:ae(p()).optional(),autoApprovedRunIds:ae(p()),runs:ae(_n),agentDeckOnline:Oe(),agents:ae(By),agentIssueCount:A()});const tv=new Map,cd=new Map;function Ud(n){return tv.get(n)??null}function T2(n,l){l.models.length!==0&&tv.set(n,l)}function O2(n,l){const s=Ud(n);if(s)return Promise.resolve(s);const u=cd.get(n);if(u)return u;const d=l().then(f=>(T2(n,f),f)).finally(()=>cd.delete(n));return cd.set(n,d),d}const be="";async function Ge(n){const l=await n.text();try{const s=JSON.parse(l),u=s.error??s.message;if(typeof u=="string"&&u.trim())return u.replace(/^Error:\s*/i,"")}catch{}return l}async function L2(){const n=await fetch(`${be}/api/intake/linear`);if(!n.ok)throw new Error(await n.text());const l=await n.json();return{candidates:l.candidates??[],hasMore:!!l.hasMore}}async function M2(n){const l=await fetch(`${be}/api/intake/linear/lookup?q=${encodeURIComponent(n)}`),s=await l.json().catch(()=>({}));if(!l.ok)throw new Error(s.error??`Lookup failed (${l.status})`);if(!s.candidate)throw new Error("Linear issue not found");return s.candidate}async function D2(){const n=await fetch(`${be}/api/intake/linear/config`);if(!n.ok)throw new Error(await Ge(n));return n.json()}async function U2(n){const l=await fetch(`${be}/api/intake/linear/config`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function z2(){const n=await fetch(`${be}/api/intake/linear/metadata`);if(!n.ok)throw new Error(await Ge(n));return n.json()}async function B2(){const n=await fetch(`${be}/api/settings/repository-mappings`);if(!n.ok)throw new Error(await Ge(n));return(await n.json()).mappings??[]}async function q2(n){const l=await fetch(`${be}/api/settings/repository-mappings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mappings:n})});if(!l.ok)throw new Error(await Ge(l));return(await l.json()).mappings??[]}async function H2(){const n=await fetch(`${be}/api/agents`);if(!n.ok)throw new Error("Failed to fetch agents");return n.json()}async function $2(n){const l=await fetch(`${be}/api/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!l.ok)throw new Error(await l.text());return l.json()}async function Y2(n,l){const s=await fetch(`${be}/api/agents/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!s.ok)throw new Error(await s.text());return s.json()}async function V2(n){const l=await fetch(`${be}/api/agents/${n}`,{method:"DELETE"});if(!l.ok)throw new Error(await l.text())}async function Z2(n,l){return O2(n,async()=>{const u=await fetch(`${be}/api/runtimes/${n}/models`);if(!u.ok)throw new Error(await u.text());return u.json()})}async function av(){const n=await fetch(`${be}/api/runtime-capacity`);if(!n.ok)throw new Error(await n.text());return n.json()}async function nv(){const n=await fetch(`${be}/api/agent-deck/status`);if(!n.ok)throw new Error(await n.text());return n.json()}async function G2(){const n=await fetch(`${be}/api/host-power`);if(!n.ok)throw new Error(await n.text());return n.json()}async function Q2(){try{const n=await fetch(`${be}/api/agent-deck/decks`),l=await n.json().catch(()=>null);return n.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 (${n.status})`}}catch(n){return{ok:!1,message:n instanceof Error?n.message:String(n)}}}async function Ex(n){const l=new URLSearchParams,s=n.map(f=>f.trim()).filter(Boolean);s.length>0&&l.set("status",s.join(",")),l.set("page","1"),l.set("limit","1"),l.sort();const u=await fetch(`${be}/api/issues?${l.toString()}`);if(!u.ok)throw new Error(await Ge(u));const d=await u.json();return typeof d.total=="number"?d.total:0}async function X2(n){var u,d,f;const l=new URLSearchParams;(u=n.q)!=null&&u.trim()&&l.set("q",n.q.trim()),(d=n.status)!=null&&d.trim()&&l.set("status",n.status.trim()),(f=n.repo)!=null&&f.trim()&&l.set("repo",n.repo.trim()),n.needsAttention&&l.set("needsAttention","1"),l.set("page",String(n.page&&n.page>1?Math.floor(n.page):1)),l.sort();const s=await fetch(`${be}/api/issues?${l.toString()}`);if(!s.ok)throw new Error(await Ge(s));return s.json()}async function I2(){const n=await fetch(`${be}/api/issues/recent-repos`);if(!n.ok)throw new Error(await Ge(n));return(await n.json()).repos??[]}async function lv(n){const l=await fetch(`${be}/api/issues/${n}`);if(!l.ok)throw new Error(await Ge(l));return l.json()}async function K2(n){const l=await fetch(`${be}/api/issues/${n}/execution-analysis`);if(!l.ok)throw new Error(await Ge(l));return l.json()}async function J2(n){const l=await fetch(`${be}/api/issues/${n}/evidence`);if(!l.ok)throw new Error(await Ge(l));return l.json()}async function F2(n,l){const s=await fetch(`${be}/api/issues/${n}/artifacts/${l}/trace`);if(!s.ok)throw new Error(await Ge(s));return s.json()}async function W2(n){const l=await fetch(`${be}/api/issues`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function fu(n,l){const s=await fetch(`${be}/api/issues/${n}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(l)});if(!s.ok)throw new Error(await Ge(s));return s.json()}async function P2(n){const l=await fetch(`${be}/api/issues/${n}/reload-source`,{method:"POST"});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function iv(n){const l=await fetch(`${be}/api/issues/${n}/start`,{method:"POST"});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function sv(n){const l=await fetch(`${be}/api/issues/${n}/execute`,{method:"POST"});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function eS(n,l="web"){const s=await fetch(`${be}/api/issues/${n}/abort`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({resolvedBy:l})});if(!s.ok)throw new Error(await Ge(s));return s.json()}async function tS(n){const l=await fetch(`${be}/api/issues/${n}/park`,{method:"POST"});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function aS(n,l="web"){const s=await fetch(`${be}/api/issues/${n}/close`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({closedBy:l})});if(!s.ok)throw new Error(await Ge(s));return s.json()}async function nS(n){const l=await fetch(`${be}/api/issues/${n}`,{method:"DELETE"});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function lS(n){const l=await fetch(`${be}/api/queue`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({issueId:n})});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function rv(n){const l=await fetch(`${be}/api/queue/${n}`,{method:"DELETE"});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function nu(n,l){const s=await fetch(`${be}/api/queue/${n}/move`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({to:l})});if(!s.ok)throw new Error(await Ge(s));return s.json()}async function dd(){const n=await fetch(`${be}/api/queue`);if(!n.ok)throw new Error(await Ge(n));return n.json()}async function iS(){const n=await fetch(`${be}/api/queue/status`);if(!n.ok)throw new Error(await Ge(n));return n.json()}async function sS(n){const l=await fetch(`${be}/api/queue/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({maxActiveIssues:n})});if(!l.ok)throw new Error(await Ge(l));return l.json()}async function rS(n,l){const s=await fetch(`${be}/api/issues/${n}/guidance`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({markdown:l})});if(!s.ok)throw new Error(await Ge(s));return s.json()}async function uS(n){const l=Fy(n),s=await fetch(`${be}/api/execution-report${l?`?${l}`:""}`);if(!s.ok)throw new Error(await Ge(s));const u=await s.json(),d=v2.safeParse(u);if(!d.success)throw new Error(`Unexpected report shape: ${d.error.message}`);return d.data}async function oS(){const n=await fetch(`${be}/api/human-actions`);if(!n.ok)throw new Error(await Ge(n));return n.json()}async function uv(n,l,s,u){const d=await fetch(`${be}/api/human-actions/${n}/resolve`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(u!=null&&u.trim()?{resolvedBy:l,choice:s,note:u.trim()}:{resolvedBy:l,choice:s})});if(!d.ok)throw new Error(await Ge(d));return d.json()}function cS(n){return n||zy}function dS({runtime:n,label:l,value:s,onChange:u,defaultModelId:d,disabled:f,compact:m}){const x=Ud(n),[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=Ud(n);if(L){v(L.models),j(L.source),X(!1);return}X(!0),Z2(n).then(H=>{v(H.models),j(H.source)}).catch(()=>v([])).finally(()=>X(!1))},[n]);const E=b.useMemo(()=>{var L,H;if(n==="cursor_local"){const F=cS(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"},[n,d,y]),$=n==="cursor_local"?D?"Loading models…":`Agent default (${E})`:D?"Loading models…":`Default (${E})`;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:s,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))]}),n==="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&&n==="cursor_local"&&!m&&r.jsx("p",{className:"text-xs text-white/40",children:"Run cursor-agent login to load the full model list."})]})}function Cx(n){const l={};return n.allowWorktreeWrite||(l.worktreeWrite=!1),Object.keys(l).length?l:null}function fS(n){let l={};try{n!=null&&n.trim()&&(l=JSON.parse(n))}catch{l={}}return{allowWorktreeWrite:l.worktreeWrite!==!1}}function Rx({value:n,onChange:l,agentDeckOnline:s,disabled:u}){const[d,f]=b.useState([]),[m,x]=b.useState(null);b.useEffect(()=>{Q2().then(w=>{w.ok?(f(w.decks),x(null)):(f([]),x(w.message))})},[]);const y=w=>l({...n,...w}),v=n.runtime==="codex_local"||n.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:n.runtime,onChange:w=>{const j=w.target.value;y({runtime:j,defaultModel:j==="cursor_local"?zy:j==="muse_code"?iw:"",defaultEffort:j==="cursor_local"||j==="muse_code"?"":n.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||!s||!!m,value:n.deckId,onChange:w=>y({deckId:w.target.value}),required:!0,children:[r.jsx("option",{value:"",disabled:!!n.deckId,children:s?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))]}),s&&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:n.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(dS,{runtime:n.runtime,label:"Default model",value:n.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:n.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"})]})]})]}),n.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."}),n.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:n.defaultBudget.maxTurns,onChange:w=>y({defaultBudget:{...n.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:n.defaultBudget.maxBudgetUsd,onChange:w=>y({defaultBudget:{...n.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:n.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 Aa(n){return n==="claude_code"?"Claude":n==="cursor_local"?"Cursor":n==="codex_local"?"Codex":n==="muse_code"?"Muse Code":"No agent"}function hS(){return{maxTurns:"",maxBudgetUsd:""}}function Tx(n){const l=n.maxTurns.trim()?Number(n.maxTurns):null,s=n.maxBudgetUsd.trim()?Number(n.maxBudgetUsd):null;return l==null&&s==null||l!=null&&(!Number.isFinite(l)||l<=0)||s!=null&&(!Number.isFinite(s)||s<=0)?null:{maxTurns:l,maxBudgetUsd:s}}function mS(n){const l=du(n);return{maxTurns:(l==null?void 0:l.maxTurns)!=null?String(l.maxTurns):"",maxBudgetUsd:(l==null?void 0:l.maxBudgetUsd)!=null?String(l.maxBudgetUsd):""}}function Ts({children:n,className:l="",title:s}){return r.jsx("span",{title:s,className:`inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium uppercase tracking-wide border ${l}`,children:n})}function lu(n,l){const s=n.find(d=>d.runtime===l);if(!s)return{ok:!1,detail:"no agent"};const u=s.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 pS(n){const l=n.flatMap(s=>s.issues).find(s=>s.code==="github_cli_missing"||s.code==="github_auth"||s.code==="github_unreachable");return l?{ok:!1,detail:l.message}:n.length===0?{ok:!1,detail:"no agent"}:{ok:!0,detail:"gh ready"}}function Ei({ok:n}){return r.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${n?"bg-emerald-400":"bg-amber-400"}`,"aria-hidden":!0})}function xS({agents:n,agentDeckOnline:l}){const[s,u]=b.useState(null);b.useEffect(()=>{nv().then(w=>u(w.mcpUrl)).catch(()=>u(null))},[l]);const d=lu(n,"claude_code"),f=lu(n,"cursor_local"),m=lu(n,"codex_local"),x=n.some(w=>w.runtime==="muse_code")?lu(n,"muse_code"):null,y=pS(n),v=n.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(Ei,{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(Ei,{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(Ei,{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(Ei,{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(Ei,{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)??(s?`MCP ${s}`:"Agent Deck optional"),children:[r.jsx(Ei,{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 ov(n){return n<10?"critical":n<30?"warning":"normal"}function cv(n){const l=n.unavailableDetail;if(!l)return null;const s=l.consecutiveFailures,u=new Date(l.firstFailureAt).toLocaleString();return`unavailable: ${l.message} (${s} consecutive failed refresh${s===1?"":"es"} since ${u})`}const nf={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},yS={critical:"font-bold text-red-400",warning:"text-yellow-400",normal:"font-medium"},vS=new Set(["claude_code","codex_local","muse_code"]),gS="billing_cycle",bS="1M",wS="5H",SS="1W";function Ox(n,l,s,u){if(n!==null)return dv(n,l,null);const d=s??"missing";return{key:u,label:l,kind:"unknown",reason:d,title:`${l}: N/A (${nf[d]})`}}function dv(n,l,s){if(n.unavailableReason===null&&n.remainingPercent!==null){const d=n.remainingPercent,f=n.resetAt?`, resets ${new Date(n.resetAt).toLocaleString()}`:"",m=s?`, ${s}`:"";return{key:n.windowKey,label:l,kind:"known",remaining:Math.round(d),rawRemaining:d,title:`${l}: ${Math.round(d)}% remaining${m}${f}`}}const u=n.unavailableReason??"missing";return{key:n.windowKey,label:l,kind:"unknown",reason:u,title:`${l}: N/A (${cv(n)??nf[u]})`}}function jS(n){if(n.runtime==="cursor_local"){const l=n.windows.find(s=>s.windowKey===gS)??null;return l===null?[]:[dv(l,bS,"current billing cycle")]}if(vS.has(n.runtime)){const l=n.windows.find(u=>u.criticalRole==="five_hour")??null,s=n.windows.find(u=>u.criticalRole==="weekly")??null;return[Ox(l,wS,n.unavailableReason,"missing-5H"),Ox(s,SS,n.unavailableReason,"missing-1W")]}return[]}function NS({row:n}){const l=n.kind==="known";return r.jsxs("span",{"data-testid":`capacity-window-${n.key}`,"data-reason":n.kind==="unknown"?n.reason:void 0,title:n.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:n.label}),n.kind==="known"?(()=>{const s=ov(n.rawRemaining);return r.jsxs("span",{"data-severity":s,className:yS[s],children:[n.remaining,"%"]})})():r.jsx("span",{children:"N/A"})]})}function _S({data:n}){return n.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"}),n.runtimes.map(l=>{const s=jS(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:Aa(l.runtime)}),s.length===0?r.jsx("span",{"data-testid":`capacity-entry-${l.runtime}-na`,"data-reason":l.unavailableReason??"missing",title:`N/A (${nf[l.unavailableReason??"missing"]})`,className:"whitespace-nowrap text-white/35",children:"N/A"}):s.map(u=>r.jsx(NS,{row:u},u.key))]},l.runtime)})]})}function kS({refreshTick:n}){const[l,s]=b.useState(null);return b.useEffect(()=>{let u=!1;return av().then(d=>{u||s(d)}).catch(()=>{u||s(null)}),()=>{u=!0}},[n]),l?r.jsx(_S,{data:l}):null}const AS="agent-dealer:host-power-sleep-notice-dismissed:";function fv(n){return`${AS}${n}`}function Lx(n){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(fv(n))==="1"}catch{return!1}}function ES(n){if(!(typeof localStorage>"u"))try{localStorage.setItem(fv(n),"1")}catch{}}function CS({status:n}){const[l,s]=b.useState(()=>Lx(n.serverInstanceId));b.useEffect(()=>{s(Lx(n.serverInstanceId))},[n.serverInstanceId]);const u=n.sleepTimerNotice,d=!!u&&!l,f=()=>{ES(n.serverInstanceId),s(!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:n.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 RS({status:n,pollMs:l=5e3}){const[s,u]=b.useState(n??null);return b.useEffect(()=>{if(n!==void 0){u(n);return}let d=!1;const f=()=>{G2().then(x=>{d||u(x)}).catch(()=>{d||u(null)})};f();const m=setInterval(f,l);return()=>{d=!0,clearInterval(m)}},[n,l]),s?r.jsx(CS,{status:s}):null}const TS="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",OS="/assets/codex-YZSpL-SB.png",LS="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",MS="/assets/muse-CtdcC6ve.svg";function Hu({src:n,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:n,alt:"",className:"h-[70%] w-[70%] object-contain",draggable:!1})})}function DS({className:n="h-8 w-8"}){return r.jsx(Hu,{src:TS,className:n})}function US({className:n="h-8 w-8"}){return r.jsx(Hu,{src:LS,className:n})}function zS({className:n="h-8 w-8"}){return r.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,"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 BS({className:n="h-8 w-8"}){return r.jsx(Hu,{src:OS,className:n})}function qS({className:n="h-8 w-8"}){return r.jsx(Hu,{src:MS,className:n})}function hv({runtime:n,className:l="h-8 w-8 shrink-0"}){return n==="claude_code"?r.jsx(DS,{className:l}):n==="cursor_local"?r.jsx(US,{className:l}):n==="codex_local"?r.jsx(BS,{className:l}):n==="muse_code"?r.jsx(qS,{className:l}):r.jsx(zS,{className:l})}const iu=()=>({runtime:"claude_code",deckId:"",purpose:"",defaultModel:"",defaultEffort:"",defaultBudget:hS(),allowWorktreeWrite:!0});function HS({agents:n,agentDeckOnline:l,onRefresh:s}){const[u,d]=b.useState(!1),[f,m]=b.useState(""),[x,y]=b.useState(iu()),[v,w]=b.useState(!1),[j,D]=b.useState(null),[X,E]=b.useState(""),[$,L]=b.useState(iu()),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:Tx(x.defaultBudget),purpose:x.purpose.trim()||null,permissionPolicy:Cx(x)};await $2(ye),m(""),y(iu()),d(!1),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},F=I=>{D(I.id),E(I.name),L({runtime:I.runtime,deckId:I.deckId??"",purpose:I.purpose??"",defaultModel:Nx(I)??"",defaultEffort:I.defaultEffort??"",defaultBudget:mS(uw(I)),...fS(I.permissionPolicyJson)})},P=()=>{D(null),L(iu())},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:Tx($.defaultBudget),purpose:$.purpose.trim()||null,permissionPolicy:Cx($)};await Y2(I.id,ye),P(),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},V=async I=>{if(confirm(`Delete agent "${I.name}"?`)){w(!0);try{await V2(I.id),s()}catch(ye){alert(String(ye))}finally{w(!1)}}},Ne=n.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:[n.length," agent",n.length===1?"":"s",Ne>0&&r.jsxs("span",{className:"text-red-400 ml-2",children:["· ",Ne," need",Ne===1?"s":""," attention"]})]})]}),r.jsx(xS,{agents:n,agentDeckOnline:l})]}),r.jsxs("div",{className:"mb-4 overflow-x-auto space-y-2",children:[r.jsx(kS,{}),r.jsx(RS,{})]}),r.jsx("div",{className:"space-y-3 mb-6",children:n.map(I=>{const ye=Nx(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(hv,{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(Ts,{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(Ts,{className:"bg-white/5 text-white/55 border-white/15 normal-case",children:Aa(I.runtime)}),I.deckName?r.jsxs(Ts,{className:"bg-[#92E4DD]/10 text-[#92E4DD] border-[#92E4DD]/25 normal-case",children:["◆ ",I.deckName]}):r.jsx(Ts,{className:"bg-white/5 text-white/40 border-white/10 normal-case",children:"No deck"}),ye&&r.jsx(Ts,{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:Me=>E(Me.target.value)})]}),r.jsx(Rx,{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((Me,bt)=>r.jsxs("li",{children:["· ",Me.message]},bt))})]})]}),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(Rx,{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 $S(n){try{return Wd(n).identity}catch{return null}}function YS(n,l){return n!=="linear"||!l?null:l.repoResolution??Ly(l.labels)}function VS(n,l){if(!l)return n;const s=l.repoResolution??Ly(l.labels);return s.status==="resolved"&&s.repository?s.repository:n}function ZS(n,l){var u;const s=YS(n,l);if(!s)return null;if(s.status==="conflict")return`Conflicting repo: labels (${(s.labels??[]).join(", ")}) — kept the current repository. Fix the labels in Linear or type a repository below.`;if(s.status==="invalid"){const d=((u=s.labels)==null?void 0:u[0])??"repo:",f=s.error?` — ${s.error}`:"";return`Invalid repository label ${d}${f}. Kept the current repository — fix the label in Linear or type a repository below.`}return null}function Mx(n){return n.title.trim().length>0&&$S(n.repo)!=null&&n.developerAgentId.length>0&&n.reviewerAgentId.length>0}function GS(n,l,s){const u=s?n.find(d=>d.id===s):void 0;return u&&!l.some(d=>d.id===u.id)?[u,...l]:[...l]}function QS(n,l){return{candidates:[l,...n.filter(s=>s.id!==l.id)],selectedId:l.id}}const fd=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"],XS={q:"",status:"",repo:"",needsAttention:!1};function lf(n){return n.startsWith("?")?n.slice(1):n}function Dx(n){var s,u,d;const l=new URLSearchParams(lf(n));return{q:((s=l.get("q"))==null?void 0:s.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 IS(n){const l=new URLSearchParams(lf(n)),s=y=>{var w;const v=(w=l.get(y))==null?void 0:w.trim();return v||void 0},u={},d=s("q");d!==void 0&&(u.q=d);const f=s("status");f!==void 0&&(u.status=f);const m=s("repo");m!==void 0&&(u.repo=m),(l.get("needsAttention")==="1"||l.get("needsAttention")==="true")&&(u.needsAttention=!0);const x=Number(l.get("page"));return Number.isInteger(x)&&x>=1&&(u.page=x),u}function KS(n){var s,u,d;const l=new URLSearchParams;return(s=n.q)!=null&&s.trim()&&l.set("q",n.q.trim()),(u=n.status)!=null&&u.trim()&&l.set("status",n.status.trim()),(d=n.repo)!=null&&d.trim()&&l.set("repo",n.repo.trim()),n.needsAttention&&l.set("needsAttention","1"),n.page!==void 0&&Number.isInteger(n.page)&&n.page>1&&l.set("page",String(n.page)),l.sort(),l.toString()}function JS(n){const l={};return n.q.trim()&&(l.q=n.q.trim()),n.status.trim()&&(l.status=n.status.trim()),n.repo.trim()&&(l.repo=n.repo.trim()),n.needsAttention&&(l.needsAttention=!0),l}function FS(n,l){const s=new URLSearchParams(lf(n));return l<=1?s.delete("page"):s.set("page",String(Math.floor(l))),s.sort(),s.toString()}function Ux(n){if(n.total===0)return"No issues match these filters";const l=(n.page-1)*n.limit+1,s=Math.min(n.total,n.page*n.limit);return`Showing ${l}–${s} of ${n.total} issues`}function zx(n){return n.totalPages<=1?"":`Page ${n.page} of ${n.totalPages}`}function Bx(n){return!!(n.q||n.status||n.repo||n.needsAttention)}const WS={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"},PS={ready:"Ready",developing:"Developing",reviewing:"Reviewing",repairing:"Repairing",final_review:"Final review",needs_human:"Needs human",done:"Done",closed:"Closed"};function mv({status:n}){return r.jsx("span",{className:`text-xs leading-none px-2 py-1 rounded border tabular-nums ${WS[n]}`,children:PS[n]})}const pv="agent-dealer:first-issue-dismissed:v1";function ej(n){return n.healthy}function tj(n){return n.healthy&&n.runtime!=="muse_code"}function aj(n){const l=n.some(ej),s=n.some(tj);return l&&s?"new-issue":"agents"}function nj(n){return n.historyTotal===0&&!n.filtersActive&&!n.dismissed}function xv(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function lj(n=xv()){try{return(n==null?void 0:n.getItem(pv))==="1"}catch{return!1}}function ij(n=xv()){try{n==null||n.setItem(pv,"1")}catch{}}function sj({agents:n,onStartIssue:l,onDismiss:s}){const u=aj(n);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:s,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 yv({value:n,onChange:l,recentRepos:s=[],id:u}){return r.jsxs("div",{className:"space-y-1",children:[s.length>0&&r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:s.includes(n)?n:"",onChange:d=>{d.target.value&&l(d.target.value)},"aria-label":"Recent repositories",children:[r.jsx("option",{value:"",children:"Recent repositories…"}),s.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:n,onChange:d=>l(d.target.value)})]})}function rj(){return{label:"",repository:""}}function uj(n){const l=new Set;for(const s of n){const u=s.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),!s.repository.trim())return`Repository for "${u}" must not be empty`}return n.length>100?"At most 100 mappings are allowed":null}function oj({recentRepos:n=[],initialMappings:l,loadMappings:s=B2,saveMappings:u=q2,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,E]=b.useState(!1);b.useEffect(()=>{if(l!==void 0)return;let H=!0;return s().then(F=>{H&&(m(F),y(!0))}).catch(F=>{H&&(w(String(F)),y(!0))}),()=>{H=!1}},[l,s]);const $=(H,F)=>{m(P=>P.map((ne,V)=>V===H?{...ne,...F}:ne))},L=async()=>{w(null),D(null);const H=uj(f);if(H){w(H);return}E(!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{E(!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(yv,{value:H.repository,onChange:P=>$(F,{repository:P}),recentRepos:n})}),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,rj()]),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 cj=["Backlog","Todo","In Progress","In Review"];function hd(n,l){const s=l?n.filter(f=>f.teamId===l):n,u=new Set,d=[];for(const f of s){const m=f.name.toLowerCase();u.has(m)||(u.add(m),d.push(f.name))}return d}function qx(n,l){return l.length===0?[...n]:n.filter(s=>l.some(u=>u.toLowerCase()===s.toLowerCase()))}function dj(n,l){return n!==null&&!l}function fj({initialConfig:n,initialMetadata:l,loadConfig:s=D2,loadMetadata:u=z2,saveConfig:d=U2,onSaved:f,onClose:m}){var se;const[x,y]=b.useState(n===void 0?null:n),[v,w]=b.useState(l===void 0?null:l),[j,D]=b.useState((n==null?void 0:n.persisted.teamId)??""),[X,E]=b.useState((n==null?void 0:n.persisted.assigneeMe)??!1),[$,L]=b.useState((n==null?void 0:n.persisted.stateFilter)??[...cj]),[H,F]=b.useState(n!==void 0),[P,ne]=b.useState(l!==void 0),[V,Ne]=b.useState(n===null?"Could not load saved Linear intake filters":null),[I,ye]=b.useState(l===null?"Could not load Linear teams and statuses":null),[Me,bt]=b.useState(null),[At,rt]=b.useState(!1),[yt,lt]=b.useState(null);b.useEffect(()=>{if(n!==void 0)return;let B=!0;return s().then(ce=>{B&&(y(ce),D(ce.persisted.teamId??""),E(ce.persisted.assigneeMe),L(ce.persisted.stateFilter),Ne(null),F(!0))}).catch(ce=>{B&&(y(null),Ne(String(ce)),F(!0))}),()=>{B=!1}},[n,s]),b.useEffect(()=>{if(l!==void 0)return;let B=!0;return u().then(ce=>{B&&(w(ce),ye(null),ne(!0))}).catch(ce=>{B&&(w(null),ye(String(ce)),ne(!0))}),()=>{B=!1}},[l,u]),b.useEffect(()=>{if(!v)return;const B=hd(v.workflowStates,j||null);L(ce=>qx(ce,B))},[v,j]);const Qe=b.useMemo(()=>hd((v==null?void 0:v.workflowStates)??[],j||null),[v,j]),U=Qe.length>0?Qe:$,J=!!(x!=null&&x.envOverrides.teamId),re=!!(x!=null&&x.envOverrides.stateFilter),Ae=J||re,Le=H&&P,N=dj(x,At),Y=B=>{L(ce=>ce.some(De=>De.toLowerCase()===B.toLowerCase())?ce.filter(De=>De.toLowerCase()!==B.toLowerCase()):[...ce,B])},W=async()=>{if(lt(null),bt(null),!x){lt("Saved filters are unavailable — reload before saving");return}if($.length===0){lt("Select at least one workflow status");return}rt(!0);try{const B=hd((v==null?void 0:v.workflowStates)??[],j.trim()||null),ce=qx($,B);if(ce.length===0){lt("Select at least one workflow status"),rt(!1);return}const Xe=await d({stateFilter:ce,teamId:j.trim()||null,assigneeMe:X});y(Xe),D(Xe.persisted.teamId??""),E(Xe.persisted.assigneeMe),L(Xe.persisted.stateFilter),bt(Xe.envOverrides.stateFilter||Xe.envOverrides.teamId?"Saved locally — env still overrides the disabled controls":"Saved"),f==null||f()}catch(B){lt(String(B))}finally{rt(!1)}},te=V||I||yt;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"})]}),Le?r.jsxs(r.Fragment,{children:[Ae&&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&&re?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:B=>D(B.target.value),children:[r.jsx("option",{value:"",children:"All teams"}),((v==null?void 0:v.teams)??[]).map(B=>r.jsxs("option",{value:B.id,children:[B.name,B.key?` (${B.key})`:""]},B.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:()=>E(!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:()=>E(!0),className:"accent-[#C4B643]"}),"Assigned to me",(se=v==null?void 0:v.viewer)!=null&&se.name?r.jsxs("span",{className:"text-xs text-white/40",children:["(",v.viewer.name,")"]}):null]})]}),r.jsxs("fieldset",{className:"space-y-1",disabled:re||!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(B=>{const ce=$.some(Xe=>Xe.toLowerCase()===B.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:ce,disabled:re||!x,onChange:()=>Y(B),className:"accent-[#C4B643]","aria-label":`Status ${B}`}),B]},B)})})]}),te&&r.jsx("p",{className:"text-xs text-red-300","data-testid":"linear-filters-error",children:te}),Me&&r.jsx("p",{className:"text-xs text-teal-200/80","data-testid":"linear-filters-notice",children:Me}),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 vv(n){return n.issues.some(l=>l.code==="usage_capped")}function gv(n){return[...n].sort((l,s)=>Number(s.healthy)-Number(l.healthy))}function rl(n){var u;const l=`${n.name} · ${Aa(n.runtime)}`,s=[];if(!n.healthy){const d=((u=n.issues[0])==null?void 0:u.message)??"unhealthy";s.push(`NEEDS FIX: ${d}`)}return vv(n)&&s.push("USAGE CAPPED"),s.length>0?`${l} — ${s.join(" · ")}`:l}function Nu(n){var l;return n?n.healthy?vv(n)?"Usage capped — admission will refuse until the cap lifts":null:((l=n.issues[0])==null?void 0:l.message)??"Agent is unhealthy":null}function bv({agents:n,initialDeveloperId:l,initialReviewerId:s,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(s??""),D=gv(n),X=n.find(V=>V.id===y),E=n.find(V=>V.id===w),$=Nu(X),L=Nu(E),H=y===(l??"")&&w===(s??""),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} · ${Aa(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:rl(V),children:(V.healthy?"● ":"○ ")+rl(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:E?`${E.name} · ${Aa(E.runtime)}${E.healthy?" · healthy":` · ${((ne=E.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} · ${Aa(V.runtime)} — reviewer not supported`},V.id):r.jsx("option",{value:V.id,title:rl(V),children:(V.healthy?"● ":"○ ")+rl(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(s??""),f==null||f();return}f==null||f()},children:"Cancel"})]}),x&&r.jsx("p",{className:"text-xs text-emerald-200/90",children:x})]})}function _u({className:n="w-3.5 h-3.5"}){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:n,"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 hj={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 mj(n){return hj[n]??n}function pj(n){if(!n)return null;try{return JSON.parse(n)}catch{return null}}function xj(n){const l=pj(n.responseOptionsJson);return Array.isArray(l)?l.filter(s=>typeof(s==null?void 0:s.choice)=="string"&&typeof(s==null?void 0:s.label)=="string"):[]}function yj(n){return n==="close"||n==="reject"||n==="abort"}function vj({options:n,disabled:l,onChoose:s}){return n.length===0?null:r.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(u=>r.jsx("button",{type:"button",className:`${yj(u.choice)?"btn-ghost-danger":"btn-gold"} px-3 py-1 text-xs disabled:opacity-50`,disabled:l,onClick:()=>s(u.choice),children:u.label},u.choice))})}function zs({action:n,linkTo:l,onChoose:s,disabled:u,children:d,hideChoicesHint:f}){const m=Zy(n),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:mj(n.actionType)}),r.jsx("span",{className:"text-xs text-white/35 shrink-0",children:new Date(n.requestedAt).toLocaleString()})]}),r.jsx("div",{children:x}),m.context&&r.jsx("p",{className:"text-xs text-white/55",children:m.context}),s?m.displayOptions.length>0?r.jsx(vj,{options:m.displayOptions,disabled:u,onChoose:s}):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 gj({actions:n,busyActionId:l,onResolve:s}){const[u,d]=b.useState({});return n.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(_u,{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:[n.length," ",n.length===1?"item needs":"items need"," your attention"]})]}),r.jsx("div",{className:"divide-y divide-white/5",children:n.map(f=>{if(f.issueId)return r.jsx("div",{className:"px-4 py-3 hover:bg-white/5 transition-colors",children:r.jsx(zs,{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(zs,{action:f,disabled:l===f.id||m&&!x.trim(),onChoose:y=>s(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 bj="web";function wj(n){if(typeof n!="object"||n===null)return null;const l=n.deletedNotice;return typeof l=="string"&&l.length>0?l:null}function Sj(n){const l=Date.now()-new Date(n).getTime(),s=Math.floor(l/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const u=Math.floor(s/60);return u<24?`${u}h ago`:`${Math.floor(u/24)}d ago`}function jj({agents:n,humanActions:l,onHumanActionsChanged:s}){const[u,d]=b.useState(null),[f,m]=b.useState(null),[x,y]=Ny(),v=x.toString(),w=IS(v),j=b.useRef(w);j.current=w;const[D,X]=b.useState(()=>Dx(v)),[E,$]=b.useState(!1),L=Bx(w),[H,F]=b.useState(!1),[P,ne]=b.useState(!1),[V,Ne]=b.useState(!1),[I,ye]=b.useState("manual"),[Me,bt]=b.useState([]),[At,rt]=b.useState(!1),[yt,lt]=b.useState(""),Qe=b.useRef(yt);Qe.current=yt;const[U,J]=b.useState(""),[re,Ae]=b.useState(!1),[Le,N]=b.useState([]),[Y,W]=b.useState(""),[te,se]=b.useState(""),[B,ce]=b.useState("main"),[Xe,De]=b.useState(""),[Bt,Ta]=b.useState(""),[ua,Va]=b.useState(""),[qe,Za]=b.useState(""),[dt,wt]=b.useState(!0),[Rn,Ye]=b.useState(null),Ga=Ca(),oa=wj(Ga.state),[tn,ol]=b.useState(!1),[ut,ca]=b.useState([]),[Ue,cl]=b.useState(null),[qt,$l]=b.useState(!1),[dl,Yl]=b.useState(null),[fl,Oa]=b.useState(()=>lj()),[tt,Ut]=b.useState(null),[ft,Ft]=b.useState(null),at=Me.find(C=>C.id===yt)??null,Vl=I==="linear"&&at!=null,an=ZS(I,at),nn=Mx({title:Y,repo:te,developerAgentId:ua,reviewerAgentId:qe}),Qa=C=>{X2(C).then(d).catch(de=>Ye(String(de)))},La=()=>{Ex([...fd]).then(Yl).catch(()=>{})},Tn=()=>{ij(),Oa(!0)},ln=nj({historyTotal:dl,filtersActive:L,dismissed:fl}),Tt=()=>{Qa(j.current),dd().then(ca).catch(()=>{}),iS().then(cl).catch(()=>{}),La()},hl=async C=>{$l(!0),Ye(null);try{const de=await sS(C);cl(de),Tt()}catch(de){Ye(String(de))}finally{$l(!1)}},ml=async C=>{Ft(C),Ye(null);try{const de=await lv(C);Ut({issueId:C,developerAgentId:de.issue.developerAgentId,reviewerAgentId:de.issue.reviewerAgentId})}catch(de){Ye(String(de))}finally{Ft(null)}},sn=async(C,de)=>{if(tt){Ft(tt.issueId);try{await fu(tt.issueId,{developerAgentId:C,reviewerAgentId:de}),Ut(null),Tt()}catch(nt){Ut(null),Ye(String(nt)),Tt()}finally{Ft(null)}}},Bi=async C=>{Ft(C),Ye(null);try{await iv(C),Tt()}catch(de){Ye(String(de))}finally{Ft(null)}},Zl=async C=>{Ft(C),Ye(null);try{await sv(C),Tt()}catch(de){Ye(String(de)),Tt()}finally{Ft(null)}},On=C=>{const de=KS(JS(C));y(de?Object.fromEntries(new URLSearchParams(de)):{})},pl=()=>{X(XS),y({})},Ln=C=>{const de=FS(v,C);y(de?Object.fromEntries(new URLSearchParams(de)):{})},Ma=C=>X(de=>({...de,...C})),G=async(C,de,nt)=>{m(C),Ye(null);try{await uv(C,bj,de,nt),s(),Tt()}catch(da){Ye(String(da))}finally{m(null)}};b.useEffect(()=>{X(Dx(v))},[v]),b.useEffect(()=>{Qa(j.current),dd().then(ca).catch(()=>{}),Ex([...fd]).then(Yl).catch(()=>{});const C=setInterval(()=>{Qa(j.current),dd().then(ca).catch(()=>{})},5e3);return()=>clearInterval(C)},[v]);const je=()=>{L2().then(C=>{rt(C.hasMore),bt(de=>GS(de,C.candidates,Qe.current))}).catch(C=>Ye(`Linear inbox: ${String(C)}`))};b.useEffect(()=>{H&&(I2().then(N).catch(()=>N([])),I==="linear"&&je())},[H,I]),b.useEffect(()=>{at&&(W(`${at.identifier}: ${at.title}`),De(at.description??""),Ta(""),se(C=>VS(C,at)))},[at]);const ze=()=>{W(""),se(""),De(""),Ta(""),lt(""),J(""),wt(!0),ce("main")},Ve=C=>{bt(de=>QS(de,C).candidates),lt(C.id),J(C.identifier)},ht=async()=>{const C=U.trim();if(!C){Ye("Paste a Linear id (e.g. NOT-103) or issue URL");return}Ae(!0),Ye(null);try{const de=await M2(C);Ve(de)}catch(de){Ye(`Linear lookup: ${String(de)}`)}finally{Ae(!1)}},mt=async()=>{if(!Mx({title:Y,repo:te,developerAgentId:ua,reviewerAgentId:qe})){Ye("Title, GitHub repository, developer, and reviewer are required");return}try{await W2({title:Y.trim(),repo:te.trim(),baseBranch:B.trim()||"main",description:Xe.trim()||void 0,acceptanceCriteria:Bt.trim()||void 0,developerAgentId:ua,reviewerAgentId:qe,maxReviewRounds:3,maxInfraAttempts:3,autoMerge:dt,source:I==="linear"&&at?"linear":"manual",externalId:at==null?void 0:at.id,externalLabel:at==null?void 0:at.identifier,externalUrl:at==null?void 0:at.url,linearAttachments:at==null?void 0:at.attachments}),F(!1),ze(),Tt()}catch(C){Ye(String(C))}};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(C=>!C),children:"New issue"})]}),Rn&&r.jsx("p",{className:"text-sm text-red-300 mb-3",children:Rn}),oa&&!tn&&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:oa}),r.jsx("button",{type:"button",className:"font-ui-display shrink-0 text-xs text-white/50 hover:text-white",onClick:()=>ol(!0),children:"Dismiss"})]}),ln&&r.jsx(sj,{agents:n,onStartIssue:()=>F(!0),onDismiss:Tn}),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 → ",dt?"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"),lt("")},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:C=>J(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),ht())}}),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:re||!U.trim(),onClick:()=>void ht(),children:re?"…":"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:()=>Ne(C=>!C),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:yt,onChange:C=>{const de=C.target.value;lt(de);const nt=Me.find(da=>da.id===de);nt&&J(nt.identifier)},children:[r.jsx("option",{value:"",children:"Select an issue…"}),Me.map(C=>r.jsxs("option",{value:C.id,children:[C.identifier,": ",C.title]},C.id))]}),V&&r.jsx(fj,{onClose:()=>Ne(!1),onSaved:je}),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:Vl,onChange:C=>W(C.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:Xe,disabled:Vl,onChange:C=>De(C.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:C=>Ta(C.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(C=>!C),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(yv,{value:te,onChange:se,recentRepos:Le}),P&&r.jsx(oj,{recentRepos:Le,onClose:()=>ne(!1)}),an&&r.jsx("p",{className:"text-xs text-amber-200/80","data-testid":"repo-label-warning",children:an})]}),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:B,onChange:C=>ce(C.target.value)})]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:ua,onChange:C=>Va(C.target.value),children:[r.jsx("option",{value:"",children:"Developer agent…"}),n.map(C=>r.jsx("option",{value:C.id,children:C.name},C.id))]}),r.jsxs("select",{className:"w-full bg-black/30 border border-white/10 rounded px-3 py-2 text-sm",value:qe,onChange:C=>Za(C.target.value),children:[r.jsx("option",{value:"",children:"Reviewer agent…"}),n.map(C=>r.jsx("option",{value:C.id,children:C.name},C.id))]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/70 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:dt,onChange:C=>wt(C.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:!nn,title:nn?void 0:"Title, GitHub repository, developer, and reviewer are required",onClick:mt,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),ze()},children:"Cancel"})]})]}),ut.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:Ue?r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:[Ue.active," active · ",Ue.waiting," waiting · limit"," ",Ue.limit,Ue.overCap?" · over capacity":""]}),Ue.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:Ue.options.includes(Ue.maxActiveIssues)?Ue.maxActiveIssues:Ue.limit,disabled:qt,title:Ue.ceiling<2?`Capped by the worker/spawn ceiling (${Ue.ceiling})`:"How many issues may execute in parallel (same-repository issues may run together)",onChange:C=>void hl(Number(C.target.value)),children:Ue.options.map(C=>r.jsx("option",{value:C,children:C},C))})]}):r.jsxs("span",{title:`Capped by the worker/spawn ceiling (${Ue.ceiling})`,children:["max ",Ue.ceiling]})]}):r.jsxs("span",{children:[ut.length," waiting · sequential"]})})]}),r.jsx("div",{className:"divide-y divide-white/5",children:ut.map((C,de)=>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:C.position}),r.jsxs(sa,{to:`/issues/${C.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:C.title??C.issueId.slice(0,8)}),C.waitReason?r.jsx("span",{className:"text-xs text-amber-200/80 block mt-0.5",children:C.waitReason}):r.jsxs("span",{className:"text-xs text-white/35 block mt-0.5",children:[C.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:ft===C.issueId,title:"Change the developer/reviewer agents — keeps queue position and rechecks the wait reason",onClick:()=>void ml(C.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:ft===C.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 Bi(C.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:ft===C.issueId,title:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:()=>void Zl(C.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:de===0,title:"Move to top",onClick:()=>{nu(C.issueId,"top").then(Tt).catch(nt=>Ye(String(nt)))},children:"Top"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:de===0,title:"Move up",onClick:()=>{const nt=ut[de-1];nt&&nu(C.issueId,{before:nt.issueId}).then(Tt).catch(da=>Ye(String(da)))},children:"↑"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:de===ut.length-1,title:"Move down",onClick:()=>{const nt=ut[de+1];nt&&nu(C.issueId,{after:nt.issueId}).then(Tt).catch(da=>Ye(String(da)))},children:"↓"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-cyber-teal disabled:opacity-30",disabled:de===ut.length-1,title:"Move to bottom",onClick:()=>{nu(C.issueId,"bottom").then(Tt).catch(nt=>Ye(String(nt)))},children:"Bottom"}),r.jsx("button",{type:"button",className:"font-ui-display text-xs text-white/40 hover:text-white",onClick:()=>{rv(C.issueId).then(Tt).catch(nt=>Ye(String(nt)))},children:"Remove"})]})]}),(tt==null?void 0:tt.issueId)===C.issueId&&r.jsx("div",{className:"px-4 pb-3 pl-12",children:r.jsx(bv,{agents:n,initialDeveloperId:tt.developerAgentId,initialReviewerId:tt.reviewerAgentId,busy:ft===C.issueId,onSave:(nt,da)=>void sn(nt,da),onCancel:()=>Ut(null)})})]},C.id))})]}):Ue?r.jsxs("p",{"data-testid":"admission-idle-status",className:"mb-4 text-xs text-white/35 tabular-nums",children:["Admission: ",Ue.active," active · ",Ue.waiting," waiting · limit"," ",Ue.limit,Ue.overCap?" · over capacity":"",Ue.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:Ue.options.includes(Ue.maxActiveIssues)?Ue.maxActiveIssues:Ue.limit,disabled:qt,title:Ue.ceiling<2?`Capped by the worker/spawn ceiling (${Ue.ceiling})`:"How many issues may execute in parallel (same-repository issues may run together)",onChange:C=>void hl(Number(C.target.value)),children:Ue.options.map(C=>r.jsx("option",{value:C,children:C},C))})]})]}):null,r.jsx(gj,{actions:l,busyActionId:f,onResolve:(C,de,nt)=>void G(C,de,nt)}),r.jsxs("div",{className:"mb-4 rounded border border-white/10 bg-panel-elevated/60",children:[r.jsxs("button",{type:"button","aria-expanded":E,"aria-controls":"issues-filter-form",onClick:()=>$(C=>!C),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:E?"▾":"▸"}),r.jsx("span",{className:"font-ui-display",children:E?"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"})]}),E&&r.jsx("form",{id:"issues-filter-form","aria-label":"Issues filters",className:"px-4 pb-4",onSubmit:C=>{C.preventDefault(),On(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:C=>Ma({q:C.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:C=>Ma({status:C.target.value}),children:[r.jsx("option",{value:"",children:"All statuses"}),fd.map(C=>r.jsx("option",{value:C,children:C},C))]})]}),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:C=>Ma({repo:C.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:C=>Ma({needsAttention:C.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&&!Bx(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:Ux(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.jsx("div",{className:"flex justify-end mb-2",children:r.jsxs("p",{className:"text-xs text-white/40 tabular-nums",children:[Ux(u),zx(u)?` · ${zx(u)}`:""]})}),r.jsx("div",{className:"space-y-2",children:u.issues.map(C=>{const de=ut.find(nt=>nt.issueId===C.id);return r.jsxs(sa,{to:`/issues/${C.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:[C.hasOpenHumanAction&&r.jsx(_u,{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:C.title}),de!=null&&de.waitReason?r.jsx("p",{className:"text-xs text-amber-200/80 truncate",title:de.waitReason,children:de.waitReason}):C.currentIntent&&r.jsx("p",{className:"text-xs text-white/50 truncate",children:C.currentIntent})]}),r.jsx("span",{className:"text-xs text-white/40 capitalize shrink-0",children:C.currentOwner}),de&&r.jsxs("span",{className:"text-xs px-2 py-0.5 rounded border border-cyber-teal/40 text-cyber-teal shrink-0",title:de.waitReason??"Next up for admission",children:["Queued #",de.position]}),r.jsx(mv,{status:C.status}),r.jsx("span",{className:"text-xs text-white/35 shrink-0 w-16 text-right",children:Sj(C.updatedAt)})]},C.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:()=>Ln(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:()=>Ln(u.page+1),children:"Next"})]})]})]})}const Nj=["developer","reviewer","legacy"],Hx=["claude_code","cursor_local","codex_local"],_j=["ready","developing","reviewing","repairing","final_review","needs_human","done","closed"];function Ri(n,l){return n.n===0||n.p50===null&&n.p95===null?{available:!1,p50Text:null,p95Text:null,sampleText:"n=0",sampleTitle:"No observations in this cohort",sparse:!0}:{available:!0,p50Text:n.p50===null?null:l(n.p50),p95Text:n.p95===null?null:l(n.p95),sampleText:Wy(n.n),sampleTitle:`Sample size ${n.n}${Md(n.n)?" — fewer than 5 observations, compare with care":""}`,sparse:Md(n.n)}}function ja(n,l,s){if(n.sum===null||n.known===0)return{available:!1,valueText:"N/A",exactText:null,noteText:null,noteTitle:null,incomplete:n.known<n.total};const u=l(n.sum),d=s!=null&&s.compact?g2(n.sum):u,f=n.known<n.total;return{available:!0,valueText:d,exactText:s!=null&&s.compact?u:null,noteText:f?`${Je(n.known)}/${Je(n.total)} known`:null,noteTitle:f?"Partial sample — missing provider metadata is excluded, never zero":null,incomplete:f}}function Hs(n,l,s){return n===null||l===0?{available:!1,valueText:"N/A",evidenceCounts:null,evidenceNoun:null,title:`No ${s} in this cohort`}:{available:!0,valueText:Bu(n),evidenceCounts:`${Je(Math.round(n*l))}/${Je(l)}`,evidenceNoun:s,title:`Exact share over ${l} ${s}`}}function $x(n,l,s){const u=Hs(n,l,s);return u.available?{text:`${u.valueText} (${u.evidenceCounts} ${u.evidenceNoun})`,title:u.title}:{text:u.valueText,title:u.title}}function md(n){const l=$x(n.issueSuccess,n.issueSuccessDenominator,"closed"),s=$x(n.attemptSuccess,n.attemptSuccessDenominator,"terminal attempts");return{key:n.key,issuesText:Je(n.issues),attemptsText:Je(n.attempts),issueSuccessText:l.text,issueSuccessTitle:l.title,attemptSuccessText:s.text,attemptSuccessTitle:s.title,issueSuccessDisplay:Hs(n.issueSuccess,n.issueSuccessDenominator,"closed"),attemptSuccessDisplay:Hs(n.attemptSuccess,n.attemptSuccessDenominator,"terminal attempts"),wallText:Ax(n.sessionWallMs,Kt),envelopeText:Ax(n.spawnEnvelopeMs,Kt),retryText:n.retryRate===null?"N/A":Bu(n.retryRate),retryTitle:"Extra attempts after a terminal attempt in the same issue/role/round ÷ attempts",tokensInText:ll(n.tokensIn,Je),tokensOutText:ll(n.tokensOut,Je),costText:ll(n.costUsd,Ls),costIncomplete:n.costUsd.known<n.costUsd.total,durationText:ll(n.durationMs,Kt),failedCostText:ll(n.failedCostUsd,Ls),failedTokensText:`${ll(n.failedTokensIn,Je)} in · ${ll(n.failedTokensOut,Je)} out`,failedDurationText:ll(n.failedDurationMs,Kt),wall:Ri(n.sessionWallMs,Kt),envelope:Ri(n.spawnEnvelopeMs,Kt),tokensIn:ja(n.tokensIn,Je,{compact:!0}),tokensOut:ja(n.tokensOut,Je,{compact:!0}),cost:ja(n.costUsd,Ls),duration:ja(n.durationMs,Kt),failedCost:ja(n.failedCostUsd,Ls),failedTokensIn:ja(n.failedTokensIn,Je,{compact:!0}),failedTokensOut:ja(n.failedTokensOut,Je,{compact:!0}),failedDuration:ja(n.failedDurationMs,Kt),failedIncomplete:n.failedCostUsd.known<n.failedCostUsd.total||n.failedTokensIn.known<n.failedTokensIn.total||n.failedTokensOut.known<n.failedTokensOut.total||n.failedDurationMs.known<n.failedDurationMs.total,sparse:n.attempts>0&&Md(n.attempts)}}function kj(n,l){const s=n.code==="unknown";return{code:n.code,domain:n.domain,countText:Je(n.count),shareText:n.share===null?"N/A":Bu(n.share),shareTitle:l>0?`${Je(n.count)} of ${Je(l)} issues with a failed attempt`:"No issues with a failed attempt in scope",isUnknown:s,blurb:s?"Ambiguous evidence — not promoted to a specific cause.":`Primary cause · ${n.domain} domain`,displayCode:s?"Cause not recorded":n.code,displayNote:s?"Needs more evidence":`Primary cause · ${n.domain} domain`,issueIds:n.issueIds,hiddenIssueCount:Math.max(0,n.issueTotal-n.issueIds.length)}}function Aj(n){const l=n.reduce((s,u)=>s+u.count,0);return n.map(s=>kj(s,l))}function Ej(n){return`/issues/${n}`}function Yx(n,l){if(n!=null&&n.trim()&&/^\d{4}-\d{2}-\d{2}$/.test(n.trim()))return l?`${n.trim()}T23:59:59.999Z`:`${n.trim()}T00:00:00.000Z`}function Vx(n){if(!n)return"";const l=n.match(/^(\d{4}-\d{2}-\d{2})/);return l?l[1]:""}function Zx(n){const l=new URLSearchParams(n.startsWith("?")?n.slice(1):n),s=u=>{var d;return((d=l.get(u))==null?void 0:d.trim())??""};return{fromDate:Vx(s("from")),toDate:Vx(s("to")),repo:s("repo"),role:s("role"),runtime:s("runtime"),model:s("model"),status:s("status")}}function Cj(n){const l=new URLSearchParams(n.startsWith("?")?n.slice(1):n),s=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=s(d);f!==void 0&&(u[d]=f)}return u}function Rj(n,l,s){const u=new URLSearchParams(n.startsWith("?")?n.slice(1):n);u.set(l,s),u.delete("page"),u.delete("limit"),u.sort();const d=u.toString();return`/reports/execution${d?`?${d}`:""}`}function Tj(n){return{from:Yx(n.fromDate,!1),to:Yx(n.toDate,!0),repo:n.repo.trim()||void 0,role:n.role||void 0,runtime:n.runtime.trim()||void 0,model:n.model.trim()||void 0,status:n.status.trim()||void 0}}function pd(n){return n===null?"N/A":Bu(n)}function Ba({label:n,value:l,valueTitle:s,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:n}),r.jsx("div",{className:"mt-1 font-mono text-lg font-semibold text-white/90 tabular-nums",title:s,children:l}),u&&r.jsx("div",{className:"mt-0.5 font-ui-display text-xs text-white/40",children:u})]})}function ku({display:n,compact:l}){if(!n.available)return r.jsx("span",{className:"font-mono text-white/45",title:n.title,children:"N/A"});const s=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:n.title,children:[r.jsx("span",{className:s,"aria-label":n.title,children:n.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:n.evidenceCounts})," ",n.evidenceNoun,")"]})]})}function Ms({display:n,compact:l}){if(!n.available)return r.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const s=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:s,children:"P50"}),r.jsx("span",{className:u,children:n.p50Text??"N/A"})]}),r.jsxs("span",{className:"inline-flex items-baseline gap-x-1.5",children:[r.jsx("span",{className:s,children:"P95"}),r.jsx("span",{className:u,children:n.p95Text??"N/A"})]}),r.jsx("span",{className:"font-ui-display text-xs text-white/40",title:n.sampleTitle,children:n.sampleText})]})}function Na({display:n,compact:l}){if(!n.available)return r.jsx("span",{className:"font-mono text-white/45",children:"N/A"});const s=n.exactText??n.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:s,"aria-label":s,children:n.valueText}),n.noteText&&r.jsx("span",{className:"font-ui-display text-xs text-white/40",title:n.noteTitle??void 0,children:n.noteText})]})}function xd({caption:n,dimension:l,rows:s,cohortLink:u}){return s.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:n}),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:[n," — 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:n}),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:s.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(ku,{display:d.issueSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",title:d.attemptSuccessTitle,children:r.jsx(ku,{display:d.attemptSuccessDisplay,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Ms,{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(Na,{display:d.tokensIn,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Na,{display:d.tokensOut,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Na,{display:d.cost,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Na,{display:d.duration,compact:!0})}),r.jsx("td",{className:"px-3 py-2 text-white/75",children:r.jsx(Na,{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(Na,{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(Na,{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(Na,{display:d.failedDuration,compact:!0})})]},d.key))})]})})}const Oj={fromDate:"",toDate:"",repo:"",role:"",runtime:"",model:"",status:""};function Lj({loading:n,error:l,report:s,onRetry:u,cohortLink:d}){const f=(s==null?void 0:s.summary)??null,m=b.useMemo(()=>s?Aj(s.failures):[],[s]),x=b.useMemo(()=>s?s.failures.reduce((y,v)=>y+v.count,0):0,[s]);return r.jsxs("div",{"aria-live":"polite",children:[n&&r.jsx("p",{role:"status",className:"text-sm text-white/50",children:"Loading execution report…"}),!n&&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"})]}),!n&&!l&&s&&f&&r.jsxs("div",{className:"space-y-6",children:[s.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:s.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(Ba,{label:"Issue success",value:r.jsx(ku,{display:Hs(f.issueSuccess,f.closedIssues,"closed")}),valueTitle:`done / (done + closed), denominator ${f.closedIssues}`,note:`${Je(f.issues)} issues · ${Je(f.closedIssues)} closed`}),r.jsx(Ba,{label:"Attempt success",value:r.jsx(ku,{display:Hs(f.attemptSuccess,f.terminalAttempts,"terminal")}),valueTitle:`done sessions / terminal sessions, denominator ${f.terminalAttempts}`,note:`${Je(f.attempts)} attempts · ${Je(f.terminalAttempts)} terminal`}),r.jsx(Ba,{label:"Retry rate",value:pd(f.retryRate),valueTitle:`${f.retryExtraAttempts} extra attempts after a terminal attempt in the same issue/role/round ÷ ${f.attempts} attempts`,note:`Reuse rate ${pd(f.reuseRate)} over ${Je(f.reuseDenominator)} reviewer sessions with input SHA`}),r.jsx(Ba,{label:"Human wait",value:Kt(f.humanWaitMs),note:`${Je(f.interventions)} interventions`}),r.jsx(Ba,{label:"Session wall P50/P95",value:r.jsx(Ms,{display:Ri(f.sessionWallMs,Kt)}),note:"Session bookkeeping proxy — never CLI runtime"}),r.jsx(Ba,{label:"Spawn envelope P50/P95",value:r.jsx(Ms,{display:Ri(f.spawnEnvelopeMs,Kt)}),note:"Coordinator-measured; includes slot wait + post-exit work"}),r.jsx(Ba,{label:"Checkpoint latency P50/P95",value:r.jsx(Ms,{display:Ri(f.checkpointMs,Kt)}),note:"Session start → first heartbeat"}),r.jsx(Ba,{label:"Reviewer rounds (avg)",value:f.avgReviewerRounds===null?"N/A":f.avgReviewerRounds.toFixed(1),note:`Change-request rate ${pd(f.changeRequestRate)} over ${Je(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(Ba,{label:"Failed cost",value:r.jsx(Na,{display:ja(f.failedCostUsd,Ls)})}),r.jsx(Ba,{label:"Failed tokens",value:r.jsxs("span",{className:"inline-flex flex-wrap items-baseline gap-x-2",children:[r.jsx(Na,{display:ja(f.failedTokensIn,Je,{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(Na,{display:ja(f.failedTokensOut,Je,{compact:!0})}),r.jsx("span",{className:"font-ui-display text-xs font-normal text-white/40",children:"out"})]})}),r.jsx(Ba,{label:"Failed runtime",value:r.jsx(Na,{display:ja(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(Ms,{display:Ri(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(xd,{caption:"By role",dimension:"role",rows:s.byRole.map(md),cohortLink:d}),r.jsx(xd,{caption:"By runtime",dimension:"runtime",rows:s.byRuntime.map(md),cohortLink:d}),r.jsx(xd,{caption:"By model",dimension:"model",rows:s.byModel.map(md),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"," ",Je(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:Ej(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 Mj(){const[n,l]=Ny(),s=n.toString(),u=b.useMemo(()=>Cj(s),[s]),[d,f]=b.useState(()=>Zx(s)),[m,x]=b.useState(null),[y,v]=b.useState(!0),[w,j]=b.useState(null),[D,X]=b.useState(0);b.useEffect(()=>{f(Zx(s))},[s]),b.useEffect(()=>{let L=!1;return v(!0),j(null),uS(u).then(H=>{L||(x(H),v(!1))}).catch(H=>{L||(j(H instanceof Error?H.message:String(H)),v(!1))}),()=>{L=!0}},[s,D]);const E=L=>{const H=Fy(Tj(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(),E(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"}),Nj.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"}),Hx.map(L=>r.jsx("option",{value:L,children:L},L)),r.jsx("option",{value:"unknown",children:"unknown (missing metadata)"}),d.runtime&&!Hx.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"}),_j.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(Oj),l({})},children:"Reset"})]})]})}),r.jsx(Lj,{loading:y,error:w,report:m,onRetry:()=>X(L=>L+1),cohortLink:(L,H)=>Rj(s,L,H)})]})}function Gx(n,l){var d;if(!n)return"Not assigned";const s=l.find(f=>f.id===n);if(!s)return"Unavailable — profile removed";const u=`${s.name} · ${Aa(s.runtime)}`;return s.healthy?u:`${u} (unhealthy: ${((d=s.issues[0])==null?void 0:d.message)??"needs attention"})`}function Qx(n,l){var u;if(!n)return;const s=l.find(d=>d.id===n);return s?`${s.name} · ${Aa(s.runtime)}${s.healthy?" · healthy":` · ${((u=s.issues[0])==null?void 0:u.message)??"unhealthy"}`}`:`Configured profile ${n} is not on record (deleted?)`}function Dj({agents:n,initialRepo:l,initialDeveloperId:s,initialReviewerId:u,busy:d,onSave:f,onCancel:m}){var P,ne;const[x,y]=b.useState(l),[v,w]=b.useState(s??""),[j,D]=b.useState(u??""),X=gv(n),E=n.find(V=>V.id===v),$=n.find(V=>V.id===j),L=Nu(E),H=Nu($),F=x.trim()===l&&v===(s??"")&&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:E?`${E.name} · ${Aa(E.runtime)}${E.healthy?" · healthy":` · ${((P=E.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:rl(V),children:(V.healthy?"● ":"○ ")+rl(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} · ${Aa($.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} · ${Aa(V.runtime)} — reviewer not supported`},V.id):r.jsx("option",{value:V.id,title:rl(V),children:(V.healthy?"● ":"○ ")+rl(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 Uj({issue:n,agents:l,canEdit:s,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: ${n.repo}`,children:[r.jsx("span",{className:"text-white/45",children:"Repository "}),n.repo]}),r.jsxs("p",{className:"text-sm text-white/85",title:Qx(n.developerAgentId,l),children:[r.jsx("span",{className:"text-white/45",children:"Developer "}),Gx(n.developerAgentId,l)]}),r.jsxs("p",{className:"text-sm text-white/85",title:Qx(n.reviewerAgentId,l),children:[r.jsx("span",{className:"text-white/45",children:"Reviewer "}),Gx(n.reviewerAgentId,l)]}),s&&!u&&r.jsx("button",{type:"button",className:"text-xs text-cyber-teal hover:underline disabled:opacity-50",disabled:d,onClick:f,children:"Edit configuration"}),s&&u&&r.jsx(Dj,{agents:l,initialRepo:n.repo,initialDeveloperId:n.developerAgentId,initialReviewerId:n.reviewerAgentId,busy:d,onSave:m,onCancel:x})]})}function zj({contract:n}){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:n.version}),r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded border border-white/15 text-white/70",children:n.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: "}),n.exitPredicate]}),r.jsxs("p",{children:[r.jsx("span",{className:"text-white/45",children:"One-PR stopping point: "}),n.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:n.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:n.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 Bj(n){return n===void 0?"unknown size":`${n.toLocaleString("en-US")} bytes`}function qj({attachments:n}){if(!(n!=null&&n.length))return null;const l=n.filter(u=>u.kind==="file"),s=n.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:[" ","· ",Bj(u.sizeBytes),u.sha256?` · sha256:${u.sha256.slice(0,16)}…`:"",u.contentType?` · ${u.contentType}`:""]})]},u.linearAttachmentId)),s.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 su(n){return n==="developer"?"Developer":n==="reviewer"?"Reviewer":"Worker"}const yd={"issue.created":()=>"Issue created","issue.reassigned":()=>"Configuration updated","issue.source_reloaded":()=>"Task text reloaded from Linear","workflow.started":()=>"Workflow started","worker.started":n=>`${su(n.actorType)} started${n.round?` (round ${n.round})`:""}`,"worker.completed":n=>`${su(n.actorType)} finished${n.round?` (round ${n.round})`:""}`,"worker.failed":n=>`${su(n.actorType)} failed${n.round?` (round ${n.round})`:""}`,"worker.deferred":n=>{var l;return((l=Ti(n.payloadJson))==null?void 0:l.outcome)==="deck_unavailable"?`Waiting for Agent Deck${n.round?` (round ${n.round})`:""}`:`${su(n.actorType)} deferred${n.round?` (round ${n.round})`:""}`},"worktree.ready":()=>"Worktree ready","worktree.deps_ready":()=>"Dependencies ready","deck.connected":()=>"Deck connected","brief.resolved":()=>"Brief resolved","base.probe":n=>{var s;const l=(s=Ti(n.payloadJson))==null?void 0:s.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":n=>`Repair round ${n.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 Ti(n){if(!n)return null;try{return JSON.parse(n)}catch{return null}}const Hj={approved:"text-cyber-teal",changes_requested:"text-amber-300",escalated:"text-red-300"};function $j({e:n}){var l;if(n.type==="pull_request.opened"||n.type==="pull_request.updated"){const s=Ti(n.payloadJson);return n.artifactRef?r.jsxs("a",{href:n.artifactRef,target:"_blank",rel:"noreferrer",className:"text-sm text-cyber-teal hover:underline",children:["PR ",s!=null&&s.prNumber?`#${s.prNumber}`:""," ",s!=null&&s.branch?`(${s.branch})`:""]}):null}if(n.type==="review.submitted"){const s=Ti(n.payloadJson);return s?r.jsxs("span",{className:"text-sm",children:[r.jsx("span",{className:Hj[s.verdict]??"text-white/70",children:s.verdict.replace("_"," ")}),(l=s.findings)!=null&&l.length?` · ${s.findings.length} finding(s)`:""]}):null}if(n.type==="guidance.added"){const s=Ti(n.payloadJson);return s!=null&&s.markdown?r.jsxs("span",{className:"text-sm text-white/55 italic",children:["— ",s.markdown]}):null}if(n.type==="worker.started"||n.type==="worker.completed"||n.type==="worker.failed"||n.type==="worker.deferred"||n.type==="worktree.ready"||n.type==="deck.connected"||n.type==="brief.resolved"||n.type==="branch.pushed"||n.type==="checks.started"||n.type==="checks.completed"){const s=Ti(n.payloadJson);if(!s)return null;const u=[];return s.runtime&&u.push(s.runtime),s.model&&u.push(s.model),s.sessionId&&u.push(s.sessionId.slice(0,8)),s.worktreePath&&u.push(s.worktreePath),s.resolution&&u.push(s.resolution),s.branch&&u.push(s.branch),s.commitsAhead!=null&&u.push(`${s.commitsAhead} ahead`),s.snapshot&&u.push(s.snapshot),(n.type==="worker.deferred"||n.type==="worker.failed")&&(s.reason&&u.push(s.reason),n.type==="worker.deferred"&&s.until&&u.push(`until ${new Date(s.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 Yj(n){var l;return((l=yd[n.type])==null?void 0:l.call(yd,n))??n.type}const Xx={human:"You",system:"System",developer:"Developer",reviewer:"Reviewer"},Vj={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 Zj(n){return n.actorRef?`${Xx[n.actorType]} · ${n.actorRef}`:Xx[n.actorType]}function Gj({events:n}){return n.length===0?r.jsx("p",{className:"text-white/40 text-sm",children:"No activity yet."}):r.jsx("div",{className:"space-y-1",children:n.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 ${Vj[l.actorType]}`,children:Zj(l)}),r.jsx("span",{className:"text-sm text-white/80",children:Yj(l)}),r.jsx($j,{e:l})]},l.id))})}function qa(n){if(n==null||!Number.isFinite(n))return null;if(n<1e3)return"<1s";const l=Math.round(n/1e3);if(l<60)return`${l}s`;const s=Math.floor(l/60);if(s<60){const f=l%60;return f===0?`${s}m`:`${s}m ${f}s`}const u=Math.floor(s/60),d=s%60;return d===0?`${u}h`:`${u}h ${d}m`}function Ix(n){return n==null||!Number.isFinite(n)?null:`${Math.round(n).toLocaleString("en-US")} tokens`}function Qj(n){return n==null||!Number.isFinite(n)?null:`$${n.toFixed(2)}`}const Xj={queue_wait:"Queue / admission wait",coordinator_setup:"Setup",agent_process:"Agent process",coordinator_validation_publish:"Validation / publish",coordinator_work:"Coordinator work"},Kx={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"},zd={worktree:"worktree",commit:"commit",verification_receipt:"verification receipt",publish_only:"publish-only result"},Ij=new Set(["failed","timed_out","error"]);function sf(n){return n.replace(/_/g," ")}function $s(n,l){const s=`Evidence quality: ${n}`;return l.length>0?`${s} — ${l.join(", ")}`:s}function _a({quality:n,reasons:l}){return r.jsxs("span",{className:`text-[11px] tabular-nums ${n==="exact"?"text-white/60":n==="inferred"?"text-amber-300/90":"text-white/60 italic"}`,title:$s(n,l),children:["· ",n,l.length>0&&r.jsxs("span",{className:"sr-only",children:[" (",l.join(", "),")"]})]})}function sl({reasons:n}){const l=n.length>0?n.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 ru({covered:n,format:l,unit:s}){if(n.value==null)return r.jsx(sl,{reasons:n.reasons});const u=n.known<n.total;return r.jsxs("span",{title:`${$s(n.quality,n.reasons)} · known ${n.known} of ${n.total} ${s}`,children:[l(n.value),r.jsx(_a,{quality:n.quality,reasons:n.reasons}),u&&r.jsxs("span",{className:"text-[11px] text-white/60",title:`Known for ${n.known} of ${n.total} ${s}`,children:[" ","(known ",n.known," of ",n.total,")"]})]})}function Jx({cause:n,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: ",sf(n.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:n.rawReason}),r.jsxs("p",{className:"text-[11px] text-white/60",title:$s(n.quality==="exact"?"exact":"inferred",[`evidence: ${n.evidenceSource}`,`confidence: ${n.confidence}`]),children:[n.domain," · ",n.confidence," confidence · via ",n.evidenceSource.replace(/_/g," ")," · ",n.quality,n.occurredAt?` · ${new Date(n.occurredAt).toLocaleString()}`:""]})]})}function Kj({interval:n}){const l=Kx[n.category??"unknown"]??Kx.unknown,s=qa(n.durationMs),u=n.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:s??r.jsx(sl,{reasons:n.reasons})}),r.jsx(_a,{quality:n.quality,reasons:n.reasons})]})}function Jj({attempt:n}){const l=n.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(s=>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 ${zd[s]??s} instead of starting cold.`,children:["reused ",zd[s]??s]},s))})}function Fj({attempt:n,isRetry:l}){const s=qa(n.setup.durationMs),u=qa(n.agentProcess.durationMs),d=qa(n.validationPublish.durationMs),f=l&&n.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:n.role}),r.jsxs("span",{className:"text-white/45",children:[n.runtime?` · ${n.runtime}`:"",n.model?` · ${n.model}`:"",` · round ${n.round} · ${n.status}`]}),n.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&&!n.publishOnly&&r.jsx(Jj,{attempt:n})]}),r.jsxs("p",{className:"text-xs text-white/50 tabular-nums",children:[r.jsxs("span",{title:s?void 0:`Setup unavailable — ${n.setup.reasons.join(", ")||"no reason recorded"}`,children:["Setup ",s??r.jsxs("span",{className:"italic",children:["Unavailable — ",n.setup.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(_a,{quality:n.setup.quality,reasons:n.setup.reasons})," · ",r.jsxs("span",{title:u?void 0:`Agent process unavailable — ${n.agentProcess.reasons.join(", ")||"no reason recorded"}`,children:["Agent ",u??r.jsxs("span",{className:"italic",children:["Unavailable — ",n.agentProcess.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(_a,{quality:n.agentProcess.quality,reasons:n.agentProcess.reasons})," · ",r.jsxs("span",{title:d?void 0:`Validation/publish unavailable — ${n.validationPublish.reasons.join(", ")||"no reason recorded"}`,children:["Validation/publish ",d??r.jsxs("span",{className:"italic",children:["Unavailable — ",n.validationPublish.reasons.join(", ")||"no reason recorded"]})]}),r.jsx(_a,{quality:n.validationPublish.quality,reasons:n.validationPublish.reasons})]}),n.failureCauses.length>0&&r.jsxs("p",{className:"text-[11px] text-white/60",children:["Failures: ",n.failureCauses.map(m=>sf(m.code)).join(", ")]})]})}function Wj({analysis:n}){const l=qa(n.elapsed.durationMs),s=qa(n.exclusiveTotalMs),u=qa(n.firstCheckpoint.msSinceWorkflowStart),d=n.nested.filter(E=>E.kind!=="unexplained_silence"),f=n.attempts.flatMap(E=>E.silence),m=n.attempts.length>0&&n.attempts.every(E=>E.silence.length===0&&E.silenceQuality==="unavailable"),x=n.attempts.filter(E=>E.silence.length===0&&E.silenceQuality==="unavailable"),y=n.waste.failedAttempts>0||n.waste.publishOnlyAttempts>0||n.attempts.some(E=>E.failureCauses.length>0||Ij.has(E.status)),v=qa(n.humanWaitMs),w=n.retry.reuseRate==null?null:`${Math.round(n.retry.reuseRate*100)}% reused`,D=(n.retry.preservedKinds??[]).map(E=>zd[E]??E),X=n.waste.failedAttempts>0||n.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(sl,{reasons:n.elapsed.reasons}),r.jsx(_a,{quality:n.elapsed.quality,reasons:n.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 ",s??r.jsx(sl,{reasons:n.exclusiveTotalReasons}),r.jsx(_a,{quality:n.exclusiveTotalQuality,reasons:n.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:n.unionedDurations.map(E=>{const $=qa(E.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:Xj[E.phase]??E.phase}),r.jsx("span",{className:"text-white/85 tabular-nums",children:$??r.jsx(sl,{reasons:E.reasons})}),r.jsx(_a,{quality:E.quality,reasons:E.reasons}),E.known<E.total&&r.jsxs("span",{className:"text-[11px] text-white/60",children:["(known ",E.known," of ",E.total,")"]})]},E.phase)})}),r.jsxs("p",{className:"text-xs text-white/45 tabular-nums mt-1",children:["Human wait ",v??r.jsx(sl,{reasons:n.humanWaitReasons}),r.jsx(_a,{quality:n.humanWaitQuality,reasons:n.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((E,$)=>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:["↳ ",E.kind==="human_wait"?"Human wait":E.category??E.kind]})," ",qa(E.durationMs)??r.jsx(sl,{reasons:E.reasons}),r.jsx(_a,{quality:E.quality,reasons:E.reasons})]},$))})]}),r.jsxs("div",{children:[r.jsxs("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:["Attempts (",n.attempts.length,")"]}),n.attempts.length===0?r.jsx("p",{className:"text-xs text-white/45 italic",children:"No attempts recorded yet."}):r.jsx("ul",{children:n.attempts.map((E,$)=>r.jsx(Fj,{attempt:E,isRetry:$>0},E.sessionId))})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs text-white/45 uppercase tracking-wide mb-1",children:"Failure"}),n.primaryFailure?r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Jx,{cause:n.primaryFailure,primary:!0}),n.consequenceCauses.length>0&&r.jsx("div",{className:"space-y-1 opacity-80",children:n.consequenceCauses.map((E,$)=>r.jsx(Jx,{cause:E,primary:!1},`${E.code}-${$}`))})]}):y?r.jsxs("p",{className:"text-sm text-white/60 italic",title:$s("unavailable",n.primaryFailureReasons),children:["Unknown — ",n.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 (",n.waste.failedAttempts," failed attempt",n.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(ru,{covered:n.waste.runtimeMs,format:E=>qa(Math.round(E))??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt input tokens over known values only",children:["In ",r.jsx(ru,{covered:n.waste.tokensIn,format:E=>Ix(E)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt output tokens over known values only",children:["Out ",r.jsx(ru,{covered:n.waste.tokensOut,format:E=>Ix(E)??"?",unit:"attempts"})]}),r.jsxs("span",{title:"Failed-attempt known cost over known values only",children:["Cost ",r.jsx(ru,{covered:n.waste.costUsd,format:E=>Qj(E)??"?",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"}),n.firstCheckpoint.msSinceWorkflowStart==null&&n.firstCheckpoint.kind==null?r.jsxs("p",{className:"text-sm text-white/60 italic",title:$s(n.firstCheckpoint.quality,n.firstCheckpoint.reasons),children:["Unavailable — ",n.firstCheckpoint.reasons.join(", ")||"no checkpoint recorded"]}):r.jsxs("p",{className:"text-sm text-white/85 tabular-nums",children:[n.firstCheckpoint.kind?sf(n.firstCheckpoint.kind):"Checkpoint",n.firstCheckpoint.observedSha?` · ${n.firstCheckpoint.observedSha.slice(0,12)}`:"",u?` · ${u} after workflow start`:"",r.jsx(_a,{quality:n.firstCheckpoint.quality,reasons:n.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 ",n.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 ",n.retry.cold]}),n.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 ${n.retry.unknown} retr${n.retry.unknown===1?"y":"ies"} — ${n.retry.reasons.join(", ")||"no reuse evidence"}.`,children:["Unknown ",n.retry.unknown]}),n.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 ",n.retry.publishOnly]}),r.jsxs("span",{className:"text-[11px] text-white/60 tabular-nums self-center",children:[n.retry.retries===0?"No retries":w??r.jsx(sl,{reasons:n.retry.reasons}),r.jsx(_a,{quality:n.retry.quality,reasons:n.retry.reasons})]})]}),r.jsx("p",{className:"text-[11px] text-white/60 mt-0.5",children:n.retry.retries===0?"No retries — nothing to preserve.":D.length>0?`Preserved: ${D.join(", ")}.`:n.retry.unknown>0?`Preservation unknown for ${n.retry.unknown} retr${n.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((E,$)=>r.jsx(Kj,{interval:E},$))}),x.length>0&&r.jsx("ul",{"aria-label":"Attempts with unknown silence",className:"mt-1",children:x.map(E=>r.jsxs("li",{className:"text-[11px] text-white/60 italic py-0.5",children:["Silence unknown for attempt ",E.sessionId.length>12?`${E.sessionId.slice(0,8)}…`:E.sessionId," —"," ",E.silenceReasons.join(", ")||"no silence evidence recorded"]},E.sessionId))})]})]})]})}function Pj({issueId:n}){const[l,s]=b.useState(null),[u,d]=b.useState(null),[f,m]=b.useState(!0);return b.useEffect(()=>{s(null),d(null),m(!0);let x=!1;return K2(n).then(y=>{x||(s(y),m(!1))}).catch(y=>{x||(/not found/i.test(String(y))?(s(null),d(null)):d(String(y).replace(/^Error:\s*/i,"")),m(!1))}),()=>{x=!0}},[n]),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(Wj,{analysis:l})]})}const eN="web";function tN(n){try{const l=JSON.parse(n);return typeof l.text=="string"?l.text:JSON.stringify(l,null,2)}catch{return n}}function vd(n){const l=Math.floor(n/6e4);return l<60?`${l}m`:`${Math.floor(l/60)}h ${l%60}m`}function aN(n){if(!n)return"no heartbeat yet";const l=Math.max(0,Math.floor((Date.now()-new Date(n).getTime())/1e3));return l<5?"just now":l<60?`${l}s ago`:`${Math.floor(l/60)}m ago`}function Ds(n){if(!n)return null;const l=n.split(/[/\\]/).filter(Boolean);return l.length<=2?n:l.slice(-2).join("/")}function gd(n){var l;return[n.branch,n.tipLabel,(l=n.worktree)!=null&&l.path?Ds(n.worktree.path):null].filter(Boolean).join(" · ")}function bd(n){var l;return[n.restartRisk?"restart risk":null,(l=n.worktree)!=null&&l.preserved?"dirty worktree preserved":null].filter(Boolean).map(s=>` · ${s}`).join("")}function wd(n){var l;return!!(n.restartRisk||(l=n.worktree)!=null&&l.preserved)}function nN(n,l){return!n||!l?!1:n===l?!0:n.includes(l)}function lN({busy:n,onConfirm:l,onCancel:s}){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:n,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:s,children:"Keep issue"})]})]})}function iN(n){return n.externalLabel??n.id}function sN(n,l){return n===l}function rN({expectedToken:n,externalLabel:l,busy:s,onConfirm:u,onCancel:d}){const[f,m]=b.useState(""),x=sN(f,n);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:n})," 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:n,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:s||!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 uN(n){const l=n.externalLabel??n.issueId,s=n.residualPaths.length>0?` ${n.residualPaths.length} Dealer-owned file(s) could not be removed: ${n.residualPaths.join(", ")}`:"";return n.externalLabel?`Issue ${l} deleted from Dealer. The Linear ticket was not deleted.${s}`:`Issue ${l} permanently deleted from Dealer.${s}`}async function oN(n,l,s){try{const u=await s.removeIssue(n),d=uN({issueId:n,externalLabel:l.externalLabel,residualPaths:u.residualPaths});return s.closeConfirmation(),s.onHumanActionsChanged(),s.navigateToIssues(d),"deleted"}catch(u){return s.closeConfirmation(),s.reportError(u),s.refresh(),"refused"}}const cN="Agents updated. Resume to continue with the new agents.";function dN(n,l,s,u){const d={};return s!==(n??"")&&(d.developerAgentId=s),u!==(l??"")&&(d.reviewerAgentId=u),d}function fN(n){const l=n.humanActions.find(s=>s.status==="open");if(l)return Zy(l).title;switch(n.issue.currentOwner){case"developer":return"Waiting on the developer";case"reviewer":return"Waiting on the reviewer";case"human":return"Waiting on you";default:return n.issue.status==="done"||n.issue.status==="closed"?"Complete":"Idle"}}function hN({issueId:n,detail:l,agents:s,onHumanActionsChanged:u,refresh:d,onError:f}){var Ma;const[m,x]=b.useState(null),[y,v]=b.useState({}),[w,j]=b.useState(""),[D,X]=b.useState(!1),[E,$]=b.useState(""),[L,H]=b.useState(""),[F,P]=b.useState(""),[ne,V]=b.useState(!1),[Ne,I]=b.useState(null),[ye,Me]=b.useState(!1),[bt,At]=b.useState(null),[rt,yt]=b.useState(!1),[lt,Qe]=b.useState(!1),U=Ru(),[J,re]=b.useState(!1),[Ae,Le]=b.useState(null),[N,Y]=b.useState({}),[W,te]=b.useState({}),se=G=>f(String(G)),{issue:B,timeline:ce,humanActions:Xe,usageSummary:De,readiness:Bt,humanWaitMs:Ta,interventionCount:ua,latestWorkflowInstance:Va,activeWorkerSession:qe,liveProgress:Za,latestSessionFailure:dt,branchTipStatus:wt,queued:Rn,queueEntry:Ye,capWait:Ga}=l,oa=s.find(G=>G.id===B.developerAgentId),tn=oa&&!oa.healthy,ol=((Ma=oa==null?void 0:oa.issues[0])==null?void 0:Ma.message)??"Developer agent is unhealthy",ut=Va?new Date(Va.completedAt??Date.now()).getTime()-new Date(Va.startedAt).getTime():0,ca=Xe.filter(G=>G.status==="open"),Ue=B.status==="needs_human"&&ca.some(G=>G.actionType==="attempts_exhausted"||G.actionType==="policy_escalation"),cl=Bt.ok===!1||ca.some(G=>G.actionType==="product_scope_decision"),qt=Va!=null&&Va.completedAt===null,$l=B.status==="ready"&&!qt,dl=cl||$l,Yl=(qe==null?void 0:qe.status)==="running",fl=B.source==="linear"&&B.status==="ready"&&!qt&&!Yl,Oa=B.status==="ready"&&!qt,tt=(B.status==="ready"||B.status==="done"||B.status==="closed")&&!qt,Ut=B.status==="ready"&&!qt,ft=qe&&qe.status==="running"&&(B.status==="developing"||B.status==="reviewing"||B.status==="repairing"),Ft=!!dt&&!ft,at=async()=>{w.trim()&&(await rS(n,w),j(""),d())},Vl=()=>{$(B.title),H(B.description??""),P(B.acceptanceCriteria??""),X(!0)},an=async()=>{V(!0),f(null);try{await fu(n,{title:E.trim()||void 0,description:L.trim()||null,acceptanceCriteria:F.trim()||null}),X(!1),d()}catch(G){se(G)}finally{V(!1)}},nn=async()=>{V(!0),f(null);try{await P2(n),re(!1),d()}catch(G){re(!1),se(G),d()}finally{V(!1)}},Qa=async()=>{V(!0),f(null);try{const G=await iv(n);I(G.state==="admitted"?null:`Queued at position ${G.position}${G.waitReason?` — ${G.waitReason}`:""}`),d()}catch(G){se(G)}finally{V(!1)}},La=async()=>{V(!0),f(null);try{await lS(n),d()}catch(G){se(G)}finally{V(!1)}},Tn=async()=>{V(!0),f(null);try{await sv(n),I(null),Me(!1),d()}catch(G){se(G),d()}finally{V(!1)}},ln=async(G,je,ze)=>{V(!0),f(null);try{await fu(n,{repo:G,developerAgentId:je,reviewerAgentId:ze}),Me(!1),d()}catch(Ve){Me(!1),se(Ve),d()}finally{V(!1)}},Tt=async(G,je)=>{V(!0),f(null);try{await fu(n,dN(B.developerAgentId,B.reviewerAgentId,G,je)),At(cN),d()}catch(ze){se(ze),d()}finally{V(!1)}},hl=async()=>{V(!0),f(null);try{await tS(n),u(),d()}catch(G){se(G)}finally{V(!1)}},ml=async()=>{V(!0),f(null);try{await rv(n),d()}catch(G){se(G)}finally{V(!1)}},sn=async()=>{V(!0),f(null);try{await aS(n),yt(!1),Le("Issue closed — it will not execute. History is retained and can be found as closed work."),d()}catch(G){se(G)}finally{V(!1)}},Bi=async()=>{V(!0),f(null);try{await oN(n,{externalLabel:B.externalLabel},{removeIssue:nS,navigateToIssues:G=>U("/issues",{state:{deletedNotice:G}}),onHumanActionsChanged:u,closeConfirmation:()=>Qe(!1),reportError:G=>se(G),refresh:d})}finally{V(!1)}},Zl=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 eS(n),d()}catch(G){se(G)}finally{V(!1)}}},On=async(G,je,ze)=>{V(!0),f(null);try{await uv(G,eN,je,ze),u(),d()}catch(Ve){se(Ve)}finally{V(!1)}},pl=()=>{m||J2(n).then(x).catch(G=>se(G))},Ln=G=>{y[G]||(v(je=>({...je,[G]:{content:"",loading:!0}})),F2(n,G).then(je=>v(ze=>({...ze,[G]:{content:je.content,loading:!1}}))).catch(je=>v(ze=>({...ze,[G]:{content:"",loading:!1,error:String(je)}}))))};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:B.title}),r.jsxs("p",{className:"text-xs text-white/45 mt-1",children:["Owner: ",r.jsx("span",{className:"capitalize",children:B.currentOwner}),B.currentIntent?` · ${B.currentIntent}`:""]}),r.jsxs("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-white/40",children:[B.prUrl&&r.jsxs("a",{href:B.prUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:["PR #",B.prNumber]}),B.externalUrl&&r.jsx("a",{href:B.externalUrl,target:"_blank",rel:"noreferrer",className:"text-cyber-teal hover:underline",children:B.externalLabel??"External link"}),r.jsxs("span",{children:["Round ",B.currentRound,"/",B.maxReviewRounds]}),r.jsxs("span",{children:["Infra attempts ",B.infraAttempts,"/",B.maxInfraAttempts]}),r.jsxs("span",{title:"Wall-clock time from workflow start to completion (or now)",children:[vd(ut)," elapsed"]}),r.jsxs("span",{title:`${De.totalTokensIn} in / ${De.totalTokensOut} out tokens`,children:["$",De.totalCostUsd.toFixed(2)]}),Ta>0&&r.jsxs("span",{title:"Time spent waiting on a human, excluding autonomous processing",children:[vd(Ta)," human wait"]}),ua>0&&r.jsxs("span",{children:[ua," intervention",ua===1?"":"s"]})]})]}),r.jsx(mv,{status:B.status})]}),Ae&&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:Ae})}),r.jsx(Uj,{issue:B,agents:s,canEdit:Ut,editing:ye,busy:ne,onBeginEdit:()=>Me(!0),onSave:(G,je,ze)=>void ln(G,je,ze),onCancel:()=>Me(!1)}),B.executionContract&&r.jsx(zj,{contract:B.executionContract}),r.jsx(qj,{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:fN(l)})]}),qt&&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:Zl,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"})]}),Ga&&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:Ga.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:Ga.reason}),r.jsxs("p",{className:"text-xs text-white/45 mt-0.5",children:["Wait until ",new Date(Ga.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:hl,children:"Park for human"})]}),ft&&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:Za??B.currentIntent??"session started",children:["Last progress: ",Za??B.currentIntent??"session started"]}),wt&&r.jsxs("p",{className:`text-xs ${wd(wt)?"text-amber-300":"text-white/55"}`,title:gd(wt),children:["Branch tip: ",wt.tipLabel,bd(wt)]}),Za&&B.currentIntent&&!/session running/i.test(B.currentIntent)&&!nN(B.currentIntent,Za)&&r.jsx("p",{className:"text-xs text-white/45 truncate",title:B.currentIntent,children:B.currentIntent}),r.jsxs("p",{className:"text-xs text-white/45",children:["Heartbeat ",aN(qe.heartbeatAt),Ds(qe.worktreePath)?` · ${Ds(qe.worktreePath)}`:""]}),qe.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:qe.logPath,children:["Log: ",Ds(qe.logPath)??qe.logPath]})]}),Ft&&dt&&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:dt.reason}),r.jsxs("p",{className:"text-xs text-white/45",children:[dt.role?r.jsx("span",{className:"capitalize",children:dt.role}):"Worker",dt.outcome?` · ${dt.outcome}`:"",` · ${new Date(dt.when).toLocaleString()}`,` · infra ${dt.infraAttempts}/${dt.maxInfraAttempts}`]}),wt&&r.jsxs("p",{className:`text-xs ${wd(wt)?"text-amber-300":"text-white/55"}`,title:gd(wt),children:["Branch tip: ",wt.tipLabel,bd(wt)]}),dt.logPath&&r.jsxs("p",{className:"text-xs text-white/40 font-mono break-all",title:dt.logPath,children:["Log: ",Ds(dt.logPath)??dt.logPath]})]}),wt&&!ft&&!Ft&&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 ${wd(wt)?"text-amber-300":"text-white/80"}`,title:gd(wt),children:[wt.tipLabel,bd(wt)]})]}),!Bt.ok&&!ca.some(G=>G.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(", ")]})}),ca.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"}),ca.map(G=>{const je=G.actionType==="product_scope_decision";if(G.actionType==="operator_verification"){const ze=xj(G),Ve=W[G.id]??"",ht=Ve.trim().length>0;return r.jsx(zs,{action:G,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:Ve,disabled:ne,onChange:mt=>te(C=>({...C,[G.id]:mt.target.value}))}),r.jsx("div",{className:"flex flex-wrap gap-2",children:ze.map(mt=>r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs disabled:opacity-50",disabled:ne||!ht,title:ht?void 0:"Enter the result note first — the server requires it",onClick:()=>On(G.id,mt.choice,Ve),children:mt.label},mt.choice))})]})},G.id)}return je?r.jsx(zs,{action:G,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[G.id]??"",disabled:ne,onChange:ze=>Y(Ve=>({...Ve,[G.id]:ze.target.value}))}),r.jsx("button",{type:"button",className:"btn-gold px-3 py-1 text-xs",disabled:ne,onClick:()=>On(G.id,"resume",N[G.id]),children:"Resume"})]})},G.id):r.jsx(zs,{action:G,disabled:ne,onChoose:ze=>On(G.id,ze)},G.id)})]}),Ue&&r.jsx("div",{className:"mb-4",children:r.jsx(bv,{variant:"parked",agents:s,initialDeveloperId:B.developerAgentId,initialReviewerId:B.reviewerAgentId,busy:ne,notice:bt,onSave:(G,je)=>void Tt(G,je)},`${B.developerAgentId??""}:${B.reviewerAgentId??""}`)}),(dl||fl)&&!D&&!J&&r.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-1",children:[dl&&r.jsx("button",{type:"button",className:"font-ui-display text-xs text-cyber-teal hover:underline",onClick:Vl,children:"Edit title / description / acceptance criteria"}),fl&&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:()=>re(!0),children:"Reload from Linear"})]}),fl&&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",B.externalLabel?` ${B.externalLabel}`:"","?"]}),r.jsx("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. 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:nn,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:()=>re(!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:E,onChange:G=>$(G.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:G=>H(G.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:G=>P(G.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:an,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"})]})]}),(B.status==="ready"||B.status==="needs_human"&&ca.length===0)&&r.jsxs("div",{className:"mb-4 space-y-2",children:[tn&&r.jsxs("p",{className:"text-sm text-amber-200/90",children:["Fix before Start: ",ol]}),Ne&&r.jsx("p",{className:"text-sm text-amber-200/90",children:Ne}),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||!!tn,title:tn?ol:"Run next — move to the front of the admission queue; runs now if a slot is free, otherwise waits first with a reason",onClick:Qa,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||!!tn,title:tn?ol:"Execute now — start immediately, skipping queue order; refuses (changing nothing) when capacity, readiness, blockers, or agent health prevents it",onClick:Tn,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:ml,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||qt,title:"Add to queue — append to the end of the admission queue; does not start anything now",onClick:La,children:"Add to queue"})]}),Rn&&Ut&&!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(Pj,{issueId:n}),r.jsx("div",{className:"border-t border-white/10 pt-3",children:r.jsx(Gj,{events:ce})}),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:G=>j(G.target.value),onKeyDown:G=>G.key==="Enter"&&at()}),r.jsx("button",{type:"button",className:"btn-gold px-4",onClick:at,children:"Send"})]}),(Oa||tt)&&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:[Oa?"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.",tt?" Delete from Dealer permanently removes the local issue, its history, and its files.":""]}),Oa&&(rt?r.jsx(lN,{busy:ne,onConfirm:()=>void sn(),onCancel:()=>yt(!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:()=>yt(!0),children:"Close issue"})),tt&&(lt?r.jsx(rN,{expectedToken:iN(B),externalLabel:B.externalLabel,busy:ne,onConfirm:()=>void Bi(),onCancel:()=>Qe(!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:()=>Qe(!0),children:"Delete from Dealer"}))]})]}),r.jsxs("details",{className:"mt-6",onToggle:G=>G.currentTarget.open&&pl(),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(G=>{const je=m.usageEvents.filter(mt=>mt.workerSessionId===G.id),ze=je.reduce((mt,C)=>mt+(C.costUsd??0),0),Ve=je.reduce((mt,C)=>mt+(C.tokensIn??0),0),ht=je.reduce((mt,C)=>mt+(C.tokensOut??0),0);return r.jsxs("p",{children:[G.role," round ",G.round," · ",G.status,G.startedAt&&G.completedAt?` · ${vd(new Date(G.completedAt).getTime()-new Date(G.startedAt).getTime())}`:"",je.length>0?` · $${ze.toFixed(3)} · ${Ve}→${ht} tok`:""]},G.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(G=>{const je=y[G.id];return r.jsxs("details",{className:"mb-1.5",onToggle:ze=>ze.currentTarget.open&&G.blobPath&&Ln(G.id),children:[r.jsxs("summary",{className:"cursor-pointer hover:text-white/80",children:[G.kind," · ",new Date(G.createdAt).toLocaleString()]}),r.jsxs("div",{className:"mt-1 pl-3 border-l border-white/10 space-y-1",children:[G.contentJson&&r.jsx("pre",{className:"whitespace-pre-wrap break-words text-white/55",children:tN(G.contentJson)}),G.blobPath&&r.jsxs("div",{children:[r.jsxs("p",{className:"text-white/40",children:["Raw trace: ",G.blobPath]}),(je==null?void 0:je.loading)&&r.jsx("p",{className:"text-white/35",children:"Loading trace…"}),(je==null?void 0:je.error)&&r.jsx("p",{className:"text-red-300/80",children:je.error}),je&&!je.loading&&!je.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:je.content||"(empty)"})]}),!G.contentJson&&!G.blobPath&&r.jsx("p",{className:"text-white/35",children:"No content recorded."})]})]},G.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 mN({issueId:n,agents:l,onHumanActionsChanged:s}){const[u,d]=b.useState(null),[f,m]=b.useState(null),[x,y]=b.useState(!1),v=()=>lv(n).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)},[n]),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(hN,{issueId:n,detail:u,agents:l,onHumanActionsChanged:s,refresh:v,onError:w=>m(w)},n):r.jsx("div",{className:"p-6 text-white/50 text-sm",children:"Loading…"})}function pN(){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 xN(){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 yN({className:n="w-5 h-5"}){return r.jsxs("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:n,"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 vN="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 gN({className:n="",size:l=36}){return r.jsx("img",{src:vN,alt:"",width:l,height:l,className:`shrink-0 object-contain ${n}`,"aria-hidden":!0,draggable:!1})}const Au={unsupported:"not reported by provider",missing:"no data yet",expired:"expired",unparsable:"provider data unparsable",stale:"stale"},Fx="5H",Wx="1W",bN=new Set(["claude_code","codex_local","muse_code"]),wN="billing_cycle",SN="1M",jN=new Set(Yt.options),NN={critical:"font-medium text-red-300",warning:"font-medium text-yellow-300",normal:"font-medium text-white/75"};function _N(n){return{fiveHour:n.find(l=>l.criticalRole==="five_hour")??null,weekly:n.find(l=>l.criticalRole==="weekly")??null}}function wv(n,l,s){if(n.unavailableReason!==null)return n.unavailableReason;if(n.remainingPercent===null||n.source==="unavailable")return s??"missing";if(n.resetAt!==null){const u=Date.parse(n.resetAt);if(!Number.isFinite(u)||u<=l)return"expired"}if(n.freshUntil!==null){const u=Date.parse(n.freshUntil);if(!Number.isFinite(u)||u<=l)return"stale"}if(n.expiresAt!==null){const u=Date.parse(n.expiresAt);if(!Number.isFinite(u)||u<=l)return"expired"}if(n.observedAt){const u=Date.parse(n.observedAt);if(!Number.isFinite(u)||u>l+6e4)return"stale"}return s??"missing"}function Px(n,l,s,u,d=null){if(Gy(n,l)){const m=Math.round(n.remainingPercent??0),x=n.resetAt?`, resets ${new Date(n.resetAt).toLocaleString()}`:"",y=d?`, ${d}`:"";return`${u}: ${m}% available (${100-m}% used${y}${x})`}const f=cv(n);return f!==null?`${u}: N/A (${f})`:`${u}: N/A (${Au[wv(n,l,s)]})`}function Bd(n,l,s,u,d,f=null){if(Gy(n,s)){const x=n.remainingPercent??0;return{key:n.windowKey,label:d,kind:"known",remaining:Math.round(x),rawRemaining:x,detail:Px(n,s,l.unavailableReason,d,f),isCritical:u}}const m=wv(n,s,l.unavailableReason);return{key:n.windowKey,label:d,kind:"unknown",reason:m,detail:Px(n,s,l.unavailableReason,d,f),isCritical:u}}function ey(n,l){const s=l.unavailableReason??"missing";return{key:`missing:${n}`,label:n,kind:"unknown",reason:s,detail:`${n}: N/A (${Au[s]})`,isCritical:!0}}function kN(n,l,s){return Bd(n,l,s,!0,SN,"current billing cycle")}function AN(n,l=Date.now()){return n.runtimes.map(s=>{const u=Aa(s.runtime),d=s.runtime;if(s.runtime==="cursor_local"){const f=s.windows.find(x=>x.windowKey===wN)??null;if(f===null)return{runtime:u,runtimeKey:d,windows:[],exhausted:!1,detail:`N/A (${Au[s.unavailableReason??"missing"]})`};const m=kN(f,s,l);return{runtime:u,runtimeKey:d,windows:[m],exhausted:m.kind==="known"&&m.rawRemaining===0,detail:m.detail}}if(bN.has(s.runtime)){const{fiveHour:f,weekly:m}=_N(s.windows),x=f!==null?Bd(f,s,l,!0,Fx):ey(Fx,s),y=m!==null?Bd(m,s,l,!0,Wx):ey(Wx,s),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 (${Au[s.unavailableReason??"missing"]})`}})}function ty(n){return n.exhausted?`${n.runtime} exhausted — a capacity window is at 0%: ${n.detail}`:`${n.runtime}: ${n.detail}`}function EN({state:n,nowMs:l}){if(n.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(n.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 s=AN(n.data,l),u=s.length===0||s.every(d=>!d.windows.some(f=>f.kind==="known"));return r.jsxs("span",{"data-testid":"topbar-capacity","data-status":u?"unknown":"ready",title:s.length===0?"Agent capacity: no runtime accounts reported":s.map(ty).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"}),s.length===0?r.jsx("span",{className:"whitespace-nowrap text-white/35",children:"N/A"}):s.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:ty(d),role:"group","aria-label":`${jN.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(hv,{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=ov(m.rawRemaining);return r.jsxs("span",{"data-severity":x,className:NN[x],children:[m.remaining,"%"]})})():r.jsx("span",{className:"text-white/35",children:"N/A"})]},m.key))})]},d.runtime)})]})}const ay=5e3;function Sd({isActive:n}){return`font-ui-display px-3 py-2 text-base rounded ${n?"bg-cyber-teal/20 text-cyber-teal":"text-white/60 hover:text-white"}`}function CN({agents:n,onHumanActionsChanged:l}){const{issueId:s}=kb();return s?r.jsx(mN,{issueId:s,agents:n,onHumanActionsChanged:l},s):r.jsx(wy,{to:"/issues",replace:!0})}function RN({openHumanActionCount:n,agentCount:l,agentIssueCount:s,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(gN,{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(cu,{to:"/issues",className:Sd,children:["Issues",n>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:`${n} open human action${n===1?"":"s"}`,children:[r.jsx(_u,{className:"w-3 h-3 shrink-0"}),n]})]}),r.jsx(cu,{to:"/reports/execution",className:Sd,children:"Reports"})]})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 min-w-0",children:[r.jsx(EN,{state:u}),r.jsxs(cu,{to:"/agents",className:({isActive:d})=>`${Sd({isActive:d})} inline-flex items-center gap-1.5 transition-colors`,"aria-label":"Agents",title:"Agents",children:[r.jsx(yN,{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}),s>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:`${s} need${s===1?"s":""} attention`,children:[r.jsx(_u,{className:"w-3 h-3 shrink-0"}),s]})]})]})]})}function TN(){const[n,l]=b.useState([]),[s,u]=b.useState(0),[d,f]=b.useState(!1),[m,x]=b.useState([]),[y,v]=b.useState({status:"loading"}),w=b.useCallback(()=>{H2().then(({agents:E,issueCount:$})=>{l(E),u($)}).catch(console.error),nv().then(E=>f(E.connected)).catch(()=>f(!1)),av().then(E=>v({status:"ready",data:E})).catch(()=>v({status:"unavailable"}))},[]),j=b.useCallback(()=>oS().then(x).catch(()=>{}),[]);b.useEffect(()=>{w();const E=setInterval(w,ay);return()=>clearInterval(E)},[w]),b.useEffect(()=>{j();const E=setInterval(()=>void j(),ay);return()=>clearInterval(E)},[j]);const D=m.length,X=n.length;return r.jsxs(r.Fragment,{children:[r.jsx(xN,{}),r.jsxs("div",{className:"relative z-10 min-h-screen flex flex-col",children:[r.jsx(RN,{openHumanActionCount:D,agentCount:X,agentIssueCount:s,capacity:y}),r.jsx("main",{className:"flex-1 flex overflow-hidden",children:r.jsxs($b,{children:[r.jsx(Ll,{path:"/",element:r.jsx(wy,{to:"/issues",replace:!0})}),r.jsx(Ll,{path:"/issues",element:r.jsx(jj,{agents:n,humanActions:m,onHumanActionsChanged:j})}),r.jsx(Ll,{path:"/issues/:issueId",element:r.jsx(CN,{agents:n,onHumanActionsChanged:j})}),r.jsx(Ll,{path:"/agents",element:r.jsx(HS,{agents:n,agentDeckOnline:d,onRefresh:w})}),r.jsx(Ll,{path:"/reports/execution",element:r.jsx(Mj,{})}),r.jsx(Ll,{path:"*",element:r.jsx(pN,{})})]})})]})]})}function ON(){return typeof document>"u"?Promise.resolve():document.fonts.load('13px "Monaco"').then(()=>{}).catch(()=>{})}ON();H0.createRoot(document.getElementById("root")).render(r.jsx(b.StrictMode,{children:r.jsx(f1,{children:r.jsx(TN,{})})}));