@taico/taico 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/agent-avatar.library.d.ts +15 -0
- package/dist/agents/agent-avatar.library.js +128 -0
- package/dist/agents/agent-avatar.library.js.map +1 -0
- package/dist/agents/agent-template.catalog.js +5 -3
- package/dist/agents/agent-template.catalog.js.map +1 -1
- package/dist/agents/agents.service.d.ts +1 -0
- package/dist/agents/agents.service.js +14 -3
- package/dist/agents/agents.service.js.map +1 -1
- package/dist/agents/dto/agent-response.dto.js +1 -1
- package/dist/agents/dto/agent-response.dto.js.map +1 -1
- package/dist/agents/dto/agent-template-catalog-response.dto.d.ts +7 -0
- package/dist/agents/dto/agent-template-catalog-response.dto.js +41 -1
- package/dist/agents/dto/agent-template-catalog-response.dto.js.map +1 -1
- package/dist/agents/dto/create-agent.dto.js +1 -1
- package/dist/agents/dto/create-agent.dto.js.map +1 -1
- package/dist/agents/dto/patch-agent.dto.js +1 -1
- package/dist/agents/dto/patch-agent.dto.js.map +1 -1
- package/dist/agents/enums/agent-type.enum.d.ts +0 -1
- package/dist/agents/enums/agent-type.enum.js +1 -9
- package/dist/agents/enums/agent-type.enum.js.map +1 -1
- package/dist/agents/errors/agents.errors.d.ts +3 -0
- package/dist/agents/errors/agents.errors.js +7 -1
- package/dist/agents/errors/agents.errors.js.map +1 -1
- package/dist/app-init/agent/code-reviewer.agent.js +2 -1
- package/dist/app-init/agent/code-reviewer.agent.js.map +1 -1
- package/dist/app-init/agent/codex-dev.agent.js +2 -1
- package/dist/app-init/agent/codex-dev.agent.js.map +1 -1
- package/dist/app-init/agent/gemini-assistant.agent.js +2 -1
- package/dist/app-init/agent/gemini-assistant.agent.js.map +1 -1
- package/dist/app-init/agent/taico.agent.js +2 -1
- package/dist/app-init/agent/taico.agent.js.map +1 -1
- package/dist/app.module.js +2 -0
- package/dist/app.module.js.map +1 -1
- package/dist/context/context.mcp.gateway.js +1 -1
- package/dist/context/context.mcp.gateway.js.map +1 -1
- package/dist/executions/active/active-task-execution.controller.d.ts +1 -0
- package/dist/executions/active/active-task-execution.controller.js +26 -0
- package/dist/executions/active/active-task-execution.controller.js.map +1 -1
- package/dist/executions/active/active-task-execution.service.d.ts +7 -1
- package/dist/executions/active/active-task-execution.service.js +26 -2
- package/dist/executions/active/active-task-execution.service.js.map +1 -1
- package/dist/executions/events/execution-interrupt.event.d.ts +15 -0
- package/dist/executions/events/execution-interrupt.event.js +15 -0
- package/dist/executions/events/execution-interrupt.event.js.map +1 -0
- package/dist/executions/executions-worker.gateway.d.ts +3 -0
- package/dist/executions/executions-worker.gateway.js +41 -0
- package/dist/executions/executions-worker.gateway.js.map +1 -1
- package/dist/executions/history/task-execution-history-error-code.enum.d.ts +1 -0
- package/dist/executions/history/task-execution-history-error-code.enum.js +1 -0
- package/dist/executions/history/task-execution-history-error-code.enum.js.map +1 -1
- package/dist/llm/openai-responses.service.js +1 -1
- package/dist/migrations/1742500000000-AllowInterruptedExecutionErrorCode.d.ts +7 -0
- package/dist/migrations/1742500000000-AllowInterruptedExecutionErrorCode.js +116 -0
- package/dist/migrations/1742500000000-AllowInterruptedExecutionErrorCode.js.map +1 -0
- package/dist/public/assets/index-BFiHpO7T.js +73 -0
- package/dist/public/assets/{index-Cl8y_6g0.css → index-N2Ursvu5.css} +1 -1
- package/dist/public/avatar/angus.png +0 -0
- package/dist/public/avatar/bruce.png +0 -0
- package/dist/public/avatar/claude.webp +0 -0
- package/dist/public/avatar/cockatoo.png +0 -0
- package/dist/public/avatar/gemini.png +0 -0
- package/dist/public/avatar/grace.png +0 -0
- package/dist/public/avatar/gustav.png +0 -0
- package/dist/public/avatar/openai.svg +15 -0
- package/dist/public/avatar/opencode.svg +1 -0
- package/dist/public/avatar/qwen.png +0 -0
- package/dist/public/avatar/stacy.png +0 -0
- package/dist/public/avatar/taico.png +0 -0
- package/dist/public/beta/assets/{index-g8TuopEh.js → index-Bnn4h6Il.js} +1 -1
- package/dist/public/beta/index.html +1 -1
- package/dist/public/index.html +2 -2
- package/dist/threads/backends/openai.backend.js +3 -3
- package/dist/threads/backends/openai.backend.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/public/assets/index-DaHPYsvL.js +0 -73
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function r(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=r(c);fetch(c.href,d)}})();function Xy(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ju={exports:{}},Tr={};var mm;function LS(){if(mm)return Tr;mm=1;var s=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(o,c,d){var f=null;if(d!==void 0&&(f=""+d),c.key!==void 0&&(f=""+c.key),"key"in c){d={};for(var y in c)y!=="key"&&(d[y]=c[y])}else d=c;return c=d.ref,{$$typeof:s,type:o,key:f,ref:c!==void 0?c:null,props:d}}return Tr.Fragment=n,Tr.jsx=r,Tr.jsxs=r,Tr}var ym;function qS(){return ym||(ym=1,Ju.exports=LS()),Ju.exports}var a=qS(),Wu={exports:{}},Ne={};var xm;function MS(){if(xm)return Ne;xm=1;var s=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),v=Symbol.iterator;function T(R){return R===null||typeof R!="object"?null:(R=v&&R[v]||R["@@iterator"],typeof R=="function"?R:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,k={};function w(R,K,re){this.props=R,this.context=K,this.refs=k,this.updater=re||E}w.prototype.isReactComponent={},w.prototype.setState=function(R,K){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,K,"setState")},w.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function N(){}N.prototype=w.prototype;function O(R,K,re){this.props=R,this.context=K,this.refs=k,this.updater=re||E}var G=O.prototype=new N;G.constructor=O,j(G,w.prototype),G.isPureReactComponent=!0;var q=Array.isArray;function A(){}var D={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function H(R,K,re){var $=re.ref;return{$$typeof:s,type:R,key:K,ref:$!==void 0?$:null,props:re}}function P(R,K){return H(R.type,K,R.props)}function B(R){return typeof R=="object"&&R!==null&&R.$$typeof===s}function J(R){var K={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(re){return K[re]})}var X=/\/+/g;function ee(R,K){return typeof R=="object"&&R!==null&&R.key!=null?J(""+R.key):K.toString(36)}function ue(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(A,A):(R.status="pending",R.then(function(K){R.status==="pending"&&(R.status="fulfilled",R.value=K)},function(K){R.status==="pending"&&(R.status="rejected",R.reason=K)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function M(R,K,re,$,ae){var de=typeof R;(de==="undefined"||de==="boolean")&&(R=null);var le=!1;if(R===null)le=!0;else switch(de){case"bigint":case"string":case"number":le=!0;break;case"object":switch(R.$$typeof){case s:case n:le=!0;break;case x:return le=R._init,M(le(R._payload),K,re,$,ae)}}if(le)return ae=ae(R),le=$===""?"."+ee(R,0):$,q(ae)?(re="",le!=null&&(re=le.replace(X,"$&/")+"/"),M(ae,K,re,"",function(ot){return ot})):ae!=null&&(B(ae)&&(ae=P(ae,re+(ae.key==null||R&&R.key===ae.key?"":(""+ae.key).replace(X,"$&/")+"/")+le)),K.push(ae)),1;le=0;var be=$===""?".":$+":";if(q(R))for(var De=0;De<R.length;De++)$=R[De],de=be+ee($,De),le+=M($,K,re,de,ae);else if(De=T(R),typeof De=="function")for(R=De.call(R),De=0;!($=R.next()).done;)$=$.value,de=be+ee($,De++),le+=M($,K,re,de,ae);else if(de==="object"){if(typeof R.then=="function")return M(ue(R),K,re,$,ae);throw K=String(R),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return le}function ne(R,K,re){if(R==null)return R;var $=[],ae=0;return M(R,$,"","",function(de){return K.call(re,de,ae++)}),$}function fe(R){if(R._status===-1){var K=R._result;K=K(),K.then(function(re){(R._status===0||R._status===-1)&&(R._status=1,R._result=re)},function(re){(R._status===0||R._status===-1)&&(R._status=2,R._result=re)}),R._status===-1&&(R._status=0,R._result=K)}if(R._status===1)return R._result.default;throw R._result}var ke=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},Te={map:ne,forEach:function(R,K,re){ne(R,function(){K.apply(this,arguments)},re)},count:function(R){var K=0;return ne(R,function(){K++}),K},toArray:function(R){return ne(R,function(K){return K})||[]},only:function(R){if(!B(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Ne.Activity=_,Ne.Children=Te,Ne.Component=w,Ne.Fragment=r,Ne.Profiler=c,Ne.PureComponent=O,Ne.StrictMode=o,Ne.Suspense=g,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(R){return D.H.useMemoCache(R)}},Ne.cache=function(R){return function(){return R.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(R,K,re){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var $=j({},R.props),ae=R.key;if(K!=null)for(de in K.key!==void 0&&(ae=""+K.key),K)!U.call(K,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&K.ref===void 0||($[de]=K[de]);var de=arguments.length-2;if(de===1)$.children=re;else if(1<de){for(var le=Array(de),be=0;be<de;be++)le[be]=arguments[be+2];$.children=le}return H(R.type,ae,$)},Ne.createContext=function(R){return R={$$typeof:f,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:d,_context:R},R},Ne.createElement=function(R,K,re){var $,ae={},de=null;if(K!=null)for($ in K.key!==void 0&&(de=""+K.key),K)U.call(K,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(ae[$]=K[$]);var le=arguments.length-2;if(le===1)ae.children=re;else if(1<le){for(var be=Array(le),De=0;De<le;De++)be[De]=arguments[De+2];ae.children=be}if(R&&R.defaultProps)for($ in le=R.defaultProps,le)ae[$]===void 0&&(ae[$]=le[$]);return H(R,de,ae)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(R){return{$$typeof:y,render:R}},Ne.isValidElement=B,Ne.lazy=function(R){return{$$typeof:x,_payload:{_status:-1,_result:R},_init:fe}},Ne.memo=function(R,K){return{$$typeof:m,type:R,compare:K===void 0?null:K}},Ne.startTransition=function(R){var K=D.T,re={};D.T=re;try{var $=R(),ae=D.S;ae!==null&&ae(re,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(A,ke)}catch(de){ke(de)}finally{K!==null&&re.types!==null&&(K.types=re.types),D.T=K}},Ne.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ne.use=function(R){return D.H.use(R)},Ne.useActionState=function(R,K,re){return D.H.useActionState(R,K,re)},Ne.useCallback=function(R,K){return D.H.useCallback(R,K)},Ne.useContext=function(R){return D.H.useContext(R)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(R,K){return D.H.useDeferredValue(R,K)},Ne.useEffect=function(R,K){return D.H.useEffect(R,K)},Ne.useEffectEvent=function(R){return D.H.useEffectEvent(R)},Ne.useId=function(){return D.H.useId()},Ne.useImperativeHandle=function(R,K,re){return D.H.useImperativeHandle(R,K,re)},Ne.useInsertionEffect=function(R,K){return D.H.useInsertionEffect(R,K)},Ne.useLayoutEffect=function(R,K){return D.H.useLayoutEffect(R,K)},Ne.useMemo=function(R,K){return D.H.useMemo(R,K)},Ne.useOptimistic=function(R,K){return D.H.useOptimistic(R,K)},Ne.useReducer=function(R,K,re){return D.H.useReducer(R,K,re)},Ne.useRef=function(R){return D.H.useRef(R)},Ne.useState=function(R){return D.H.useState(R)},Ne.useSyncExternalStore=function(R,K,re){return D.H.useSyncExternalStore(R,K,re)},Ne.useTransition=function(){return D.H.useTransition()},Ne.version="19.2.5",Ne}var vm;function $d(){return vm||(vm=1,Wu.exports=MS()),Wu.exports}var p=$d();const BS=Xy(p);var ed={exports:{}},jr={},td={exports:{}},nd={};var bm;function US(){return bm||(bm=1,(function(s){function n(M,ne){var fe=M.length;M.push(ne);e:for(;0<fe;){var ke=fe-1>>>1,Te=M[ke];if(0<c(Te,ne))M[ke]=ne,M[fe]=Te,fe=ke;else break e}}function r(M){return M.length===0?null:M[0]}function o(M){if(M.length===0)return null;var ne=M[0],fe=M.pop();if(fe!==ne){M[0]=fe;e:for(var ke=0,Te=M.length,R=Te>>>1;ke<R;){var K=2*(ke+1)-1,re=M[K],$=K+1,ae=M[$];if(0>c(re,fe))$<Te&&0>c(ae,re)?(M[ke]=ae,M[$]=fe,ke=$):(M[ke]=re,M[K]=fe,ke=K);else if($<Te&&0>c(ae,fe))M[ke]=ae,M[$]=fe,ke=$;else break e}}return ne}function c(M,ne){var fe=M.sortIndex-ne.sortIndex;return fe!==0?fe:M.id-ne.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var f=Date,y=f.now();s.unstable_now=function(){return f.now()-y}}var g=[],m=[],x=1,_=null,v=3,T=!1,E=!1,j=!1,k=!1,w=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function G(M){for(var ne=r(m);ne!==null;){if(ne.callback===null)o(m);else if(ne.startTime<=M)o(m),ne.sortIndex=ne.expirationTime,n(g,ne);else break;ne=r(m)}}function q(M){if(j=!1,G(M),!E)if(r(g)!==null)E=!0,A||(A=!0,J());else{var ne=r(m);ne!==null&&ue(q,ne.startTime-M)}}var A=!1,D=-1,U=5,H=-1;function P(){return k?!0:!(s.unstable_now()-H<U)}function B(){if(k=!1,A){var M=s.unstable_now();H=M;var ne=!0;try{e:{E=!1,j&&(j=!1,N(D),D=-1),T=!0;var fe=v;try{t:{for(G(M),_=r(g);_!==null&&!(_.expirationTime>M&&P());){var ke=_.callback;if(typeof ke=="function"){_.callback=null,v=_.priorityLevel;var Te=ke(_.expirationTime<=M);if(M=s.unstable_now(),typeof Te=="function"){_.callback=Te,G(M),ne=!0;break t}_===r(g)&&o(g),G(M)}else o(g);_=r(g)}if(_!==null)ne=!0;else{var R=r(m);R!==null&&ue(q,R.startTime-M),ne=!1}}break e}finally{_=null,v=fe,T=!1}ne=void 0}}finally{ne?J():A=!1}}}var J;if(typeof O=="function")J=function(){O(B)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,ee=X.port2;X.port1.onmessage=B,J=function(){ee.postMessage(null)}}else J=function(){w(B,0)};function ue(M,ne){D=w(function(){M(s.unstable_now())},ne)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(M){M.callback=null},s.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<M?Math.floor(1e3/M):5},s.unstable_getCurrentPriorityLevel=function(){return v},s.unstable_next=function(M){switch(v){case 1:case 2:case 3:var ne=3;break;default:ne=v}var fe=v;v=ne;try{return M()}finally{v=fe}},s.unstable_requestPaint=function(){k=!0},s.unstable_runWithPriority=function(M,ne){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var fe=v;v=M;try{return ne()}finally{v=fe}},s.unstable_scheduleCallback=function(M,ne,fe){var ke=s.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?ke+fe:ke):fe=ke,M){case 1:var Te=-1;break;case 2:Te=250;break;case 5:Te=1073741823;break;case 4:Te=1e4;break;default:Te=5e3}return Te=fe+Te,M={id:x++,callback:ne,priorityLevel:M,startTime:fe,expirationTime:Te,sortIndex:-1},fe>ke?(M.sortIndex=fe,n(m,M),r(g)===null&&M===r(m)&&(j?(N(D),D=-1):j=!0,ue(q,fe-ke))):(M.sortIndex=Te,n(g,M),E||T||(E=!0,A||(A=!0,J()))),M},s.unstable_shouldYield=P,s.unstable_wrapCallback=function(M){var ne=v;return function(){var fe=v;v=ne;try{return M.apply(this,arguments)}finally{v=fe}}}})(nd)),nd}var Sm;function IS(){return Sm||(Sm=1,td.exports=US()),td.exports}var sd={exports:{}},It={};var _m;function HS(){if(_m)return It;_m=1;var s=$d();function n(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)m+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},c=Symbol.for("react.portal");function d(g,m,x){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:_==null?null:""+_,children:g,containerInfo:m,implementation:x}}var f=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return It.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,It.createPortal=function(g,m){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(n(299));return d(g,m,null,x)},It.flushSync=function(g){var m=f.T,x=o.p;try{if(f.T=null,o.p=2,g)return g()}finally{f.T=m,o.p=x,o.d.f()}},It.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,o.d.C(g,m))},It.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},It.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var x=m.as,_=y(x,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,T=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;x==="style"?o.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:_,integrity:v,fetchPriority:T}):x==="script"&&o.d.X(g,{crossOrigin:_,integrity:v,fetchPriority:T,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},It.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var x=y(m.as,m.crossOrigin);o.d.M(g,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&o.d.M(g)},It.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var x=m.as,_=y(x,m.crossOrigin);o.d.L(g,x,{crossOrigin:_,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},It.preloadModule=function(g,m){if(typeof g=="string")if(m){var x=y(m.as,m.crossOrigin);o.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else o.d.m(g)},It.requestFormReset=function(g){o.d.r(g)},It.unstable_batchedUpdates=function(g,m){return g(m)},It.useFormState=function(g,m,x){return f.H.useFormState(g,m,x)},It.useFormStatus=function(){return f.H.useHostTransitionStatus()},It.version="19.2.5",It}var Tm;function $S(){if(Tm)return sd.exports;Tm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),sd.exports=HS(),sd.exports}var jm;function GS(){if(jm)return jr;jm=1;var s=IS(),n=$d(),r=$S();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function f(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 y(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(o(188))}function m(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,i=t;;){var u=l.return;if(u===null)break;var h=u.alternate;if(h===null){if(i=u.return,i!==null){l=i;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===l)return g(u),e;if(h===i)return g(u),t;h=h.sibling}throw Error(o(188))}if(l.return!==i.return)l=u,i=h;else{for(var b=!1,C=u.child;C;){if(C===l){b=!0,l=u,i=h;break}if(C===i){b=!0,i=u,l=h;break}C=C.sibling}if(!b){for(C=h.child;C;){if(C===l){b=!0,l=h,i=u;break}if(C===i){b=!0,i=h,l=u;break}C=C.sibling}if(!b)throw Error(o(189))}}if(l.alternate!==i)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var _=Object.assign,v=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),O=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=B&&e[B]||e["@@iterator"],typeof e=="function"?e:null)}var X=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case w:return"Profiler";case k:return"StrictMode";case q:return"Suspense";case A:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case O:return e.displayName||"Context";case N:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var ue=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},ke=[],Te=-1;function R(e){return{current:e}}function K(e){0>Te||(e.current=ke[Te],ke[Te]=null,Te--)}function re(e,t){Te++,ke[Te]=e.current,e.current=t}var $=R(null),ae=R(null),de=R(null),le=R(null);function be(e,t){switch(re(de,t),re(ae,e),re($,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ug(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ug(t),e=Ig(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}K($),re($,e)}function De(){K($),K(ae),K(de)}function ot(e){e.memoizedState!==null&&re(le,e);var t=$.current,l=Ig(t,e.type);t!==l&&(re(ae,e),re($,l))}function Gt(e){ae.current===e&&(K($),K(ae)),le.current===e&&(K(le),vr._currentValue=fe)}var Pt,Pn;function jt(e){if(Pt===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Pt=t&&t[1]||"",Pn=-1<l.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Pt+e+Pn}var Se=!1;function Ce(e,t){if(!e||Se)return"";Se=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(Q){var F=Q}Reflect.construct(e,[],te)}else{try{te.call()}catch(Q){F=Q}e.call(te.prototype)}}else{try{throw Error()}catch(Q){F=Q}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(Q){if(Q&&F&&typeof Q.stack=="string")return[Q.stack,F.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=i.DetermineComponentFrameRoot(),b=h[0],C=h[1];if(b&&C){var z=b.split(`
|
|
4
|
-
`),Y=C.split(`
|
|
5
|
-
`);for(u=i=0;i<z.length&&!z[i].includes("DetermineComponentFrameRoot");)i++;for(;u<Y.length&&!Y[u].includes("DetermineComponentFrameRoot");)u++;if(i===z.length||u===Y.length)for(i=z.length-1,u=Y.length-1;1<=i&&0<=u&&z[i]!==Y[u];)u--;for(;1<=i&&0<=u;i--,u--)if(z[i]!==Y[u]){if(i!==1||u!==1)do if(i--,u--,0>u||z[i]!==Y[u]){var Z=`
|
|
6
|
-
`+z[i].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=i&&0<=u);break}}}finally{Se=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?jt(l):""}function St(e,t){switch(e.tag){case 26:case 27:case 5:return jt(e.type);case 16:return jt("Lazy");case 13:return e.child!==t&&t!==null?jt("Suspense Fallback"):jt("Suspense");case 19:return jt("SuspenseList");case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return jt("Activity");default:return""}}function Mt(e){try{var t="",l=null;do t+=St(e,l),l=e,e=e.return;while(e);return t}catch(i){return`
|
|
7
|
-
Error generating stack: `+i.message+`
|
|
8
|
-
`+i.stack}}var en=Object.prototype.hasOwnProperty,On=s.unstable_scheduleCallback,ss=s.unstable_cancelCallback,as=s.unstable_shouldYield,ks=s.unstable_requestPaint,_t=s.unstable_now,Cs=s.unstable_getCurrentPriorityLevel,Ns=s.unstable_ImmediatePriority,Oa=s.unstable_UserBlockingPriority,As=s.unstable_NormalPriority,Rl=s.unstable_LowPriority,hn=s.unstable_IdlePriority,Rs=s.log,zl=s.unstable_setDisableYieldValue,oe=null,he=null;function we(e){if(typeof Rs=="function"&&zl(e),he&&typeof he.setStrictMode=="function")try{he.setStrictMode(oe,e)}catch{}}var He=Math.clz32?Math.clz32:qe,Bt=Math.log,fn=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Bt(e)/fn|0)|0}var Ut=256,Vn=262144,tn=4194304;function pn(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 zs(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var u=0,h=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var C=i&134217727;return C!==0?(i=C&~h,i!==0?u=pn(i):(b&=C,b!==0?u=pn(b):l||(l=C&~e,l!==0&&(u=pn(l))))):(C=i&~h,C!==0?u=pn(C):b!==0?u=pn(b):l||(l=i&~e,l!==0&&(u=pn(l)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,l=t&-t,h>=l||h===32&&(l&4194048)!==0)?t:u}function ls(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ie(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 Ee(){var e=tn;return tn<<=1,(tn&62914560)===0&&(tn=4194304),e}function Vt(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Dl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Tv(e,t,l,i,u,h){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var C=e.entanglements,z=e.expirationTimes,Y=e.hiddenUpdates;for(l=b&~l;0<l;){var Z=31-He(l),te=1<<Z;C[Z]=0,z[Z]=-1;var F=Y[Z];if(F!==null)for(Y[Z]=null,Z=0;Z<F.length;Z++){var Q=F[Z];Q!==null&&(Q.lane&=-536870913)}l&=~te}i!==0&&bh(e,i,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(b&~t))}function bh(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-He(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|l&261930}function Sh(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var i=31-He(l),u=1<<i;u&t|e[i]&t&&(e[i]|=t),l&=~u}}function _h(e,t){var l=t&-t;return l=(l&42)!==0?1:Ho(l),(l&(e.suspendedLanes|t))!==0?0:l}function Ho(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 $o(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Th(){var e=ne.p;return e!==0?e:(e=window.event,e===void 0?32:cm(e.type))}function jh(e,t){var l=ne.p;try{return ne.p=e,t()}finally{ne.p=l}}var Ds=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Ds,Yt="__reactProps$"+Ds,La="__reactContainer$"+Ds,Go="__reactEvents$"+Ds,jv="__reactListeners$"+Ds,wv="__reactHandles$"+Ds,wh="__reactResources$"+Ds,Ol="__reactMarker$"+Ds;function Po(e){delete e[Nt],delete e[Yt],delete e[Go],delete e[jv],delete e[wv]}function qa(e){var t=e[Nt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[La]||l[Nt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Fg(e);e!==null;){if(l=e[Nt])return l;e=Fg(e)}return t}e=l,l=e.parentNode}return null}function Ma(e){if(e=e[Nt]||e[La]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ll(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ba(e){var t=e[wh];return t||(t=e[wh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function wt(e){e[Ol]=!0}var Eh=new Set,kh={};function ia(e,t){Ua(e,t),Ua(e+"Capture",t)}function Ua(e,t){for(kh[e]=t,e=0;e<t.length;e++)Eh.add(t[e])}var Ev=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ch={},Nh={};function kv(e){return en.call(Nh,e)?!0:en.call(Ch,e)?!1:Ev.test(e)?Nh[e]=!0:(Ch[e]=!0,!1)}function Kr(e,t,l){if(kv(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){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,""+l)}}function Xr(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function rs(e,t,l,i){if(i===null)e.removeAttribute(l);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+i)}}function gn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ah(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cv(e,t,l){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,h=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(b){l=""+b,h.call(this,b)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vo(e){if(!e._valueTracker){var t=Ah(e)?"checked":"value";e._valueTracker=Cv(e,t,""+e[t])}}function Rh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),i="";return e&&(i=Ah(e)?e.checked?"true":"false":e.value),e=i,e!==l?(t.setValue(e),!0):!1}function Zr(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 Nv=/[\n"\\]/g;function mn(e){return e.replace(Nv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Yo(e,t,l,i,u,h,b,C){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+gn(t)):e.value!==""+gn(t)&&(e.value=""+gn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?Fo(e,b,gn(t)):l!=null?Fo(e,b,gn(l)):i!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.name=""+gn(C):e.removeAttribute("name")}function zh(e,t,l,i,u,h,b,C){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Vo(e);return}l=l!=null?""+gn(l):"",t=t!=null?""+gn(t):l,C||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=C?e.checked:!!i,e.defaultChecked=!!i,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Vo(e)}function Fo(e,t,l){t==="number"&&Zr(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ia(e,t,l,i){if(e=e.options,t){t={};for(var u=0;u<l.length;u++)t["$"+l[u]]=!0;for(l=0;l<e.length;l++)u=t.hasOwnProperty("$"+e[l].value),e[l].selected!==u&&(e[l].selected=u),u&&i&&(e[l].defaultSelected=!0)}else{for(l=""+gn(l),t=null,u=0;u<e.length;u++){if(e[u].value===l){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Dh(e,t,l){if(t!=null&&(t=""+gn(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+gn(l):""}function Oh(e,t,l,i){if(t==null){if(i!=null){if(l!=null)throw Error(o(92));if(ue(i)){if(1<i.length)throw Error(o(93));i=i[0]}l=i}l==null&&(l=""),t=l}l=gn(t),e.defaultValue=l,i=e.textContent,i===l&&i!==""&&i!==null&&(e.value=i),Vo(e)}function Ha(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Av=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 Lh(e,t,l){var i=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,l):typeof l!="number"||l===0||Av.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function qh(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&l[u]!==i&&Lh(e,u,i)}else for(var h in t)t.hasOwnProperty(h)&&Lh(e,h,t[h])}function Qo(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 Rv=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"]]),zv=/^[\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 Jr(e){return zv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function is(){}var Ko=null;function Xo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $a=null,Ga=null;function Mh(e){var t=Ma(e);if(t&&(e=t.stateNode)){var l=e[Yt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Yo(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+mn(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var i=l[t];if(i!==e&&i.form===e.form){var u=i[Yt]||null;if(!u)throw Error(o(90));Yo(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<l.length;t++)i=l[t],i.form===e.form&&Rh(i)}break e;case"textarea":Dh(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Ia(e,!!l.multiple,t,!1)}}}var Zo=!1;function Bh(e,t,l){if(Zo)return e(t,l);Zo=!0;try{var i=e(t);return i}finally{if(Zo=!1,($a!==null||Ga!==null)&&(Ui(),$a&&(t=$a,e=Ga,Ga=$a=null,Mh(t),e)))for(t=0;t<e.length;t++)Mh(e[t])}}function ql(e,t){var l=e.stateNode;if(l===null)return null;var i=l[Yt]||null;if(i===null)return null;l=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(l&&typeof l!="function")throw Error(o(231,t,typeof l));return l}var os=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jo=!1;if(os)try{var Ml={};Object.defineProperty(Ml,"passive",{get:function(){Jo=!0}}),window.addEventListener("test",Ml,Ml),window.removeEventListener("test",Ml,Ml)}catch{Jo=!1}var Os=null,Wo=null,Wr=null;function Uh(){if(Wr)return Wr;var e,t=Wo,l=t.length,i,u="value"in Os?Os.value:Os.textContent,h=u.length;for(e=0;e<l&&t[e]===u[e];e++);var b=l-e;for(i=1;i<=b&&t[l-i]===u[h-i];i++);return Wr=u.slice(e,1<i?1-i:void 0)}function ei(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 ti(){return!0}function Ih(){return!1}function Ft(e){function t(l,i,u,h,b){this._reactName=l,this._targetInst=u,this.type=i,this.nativeEvent=h,this.target=b,this.currentTarget=null;for(var C in e)e.hasOwnProperty(C)&&(l=e[C],this[C]=l?l(h):h[C]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?ti:Ih,this.isPropagationStopped=Ih,this}return _(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ti)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ti)},persist:function(){},isPersistent:ti}),t}var oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ni=Ft(oa),Bl=_({},oa,{view:0,detail:0}),Dv=Ft(Bl),ec,tc,Ul,si=_({},Bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sc,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!==Ul&&(Ul&&e.type==="mousemove"?(ec=e.screenX-Ul.screenX,tc=e.screenY-Ul.screenY):tc=ec=0,Ul=e),ec)},movementY:function(e){return"movementY"in e?e.movementY:tc}}),Hh=Ft(si),Ov=_({},si,{dataTransfer:0}),Lv=Ft(Ov),qv=_({},Bl,{relatedTarget:0}),nc=Ft(qv),Mv=_({},oa,{animationName:0,elapsedTime:0,pseudoElement:0}),Bv=Ft(Mv),Uv=_({},oa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Iv=Ft(Uv),Hv=_({},oa,{data:0}),$h=Ft(Hv),$v={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gv={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Pv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Pv[e])?!!t[e]:!1}function sc(){return Vv}var Yv=_({},Bl,{key:function(e){if(e.key){var t=$v[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ei(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sc,charCode:function(e){return e.type==="keypress"?ei(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ei(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fv=Ft(Yv),Qv=_({},si,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gh=Ft(Qv),Kv=_({},Bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sc}),Xv=Ft(Kv),Zv=_({},oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jv=Ft(Zv),Wv=_({},si,{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}),eb=Ft(Wv),tb=_({},oa,{newState:0,oldState:0}),nb=Ft(tb),sb=[9,13,27,32],ac=os&&"CompositionEvent"in window,Il=null;os&&"documentMode"in document&&(Il=document.documentMode);var ab=os&&"TextEvent"in window&&!Il,Ph=os&&(!ac||Il&&8<Il&&11>=Il),Vh=" ",Yh=!1;function Fh(e,t){switch(e){case"keyup":return sb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pa=!1;function lb(e,t){switch(e){case"compositionend":return Qh(t);case"keypress":return t.which!==32?null:(Yh=!0,Vh);case"textInput":return e=t.data,e===Vh&&Yh?null:e;default:return null}}function rb(e,t){if(Pa)return e==="compositionend"||!ac&&Fh(e,t)?(e=Uh(),Wr=Wo=Os=null,Pa=!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 Ph&&t.locale!=="ko"?null:t.data;default:return null}}var ib={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 Kh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ib[e.type]:t==="textarea"}function Xh(e,t,l,i){$a?Ga?Ga.push(i):Ga=[i]:$a=i,t=Yi(t,"onChange"),0<t.length&&(l=new ni("onChange","change",null,l,i),e.push({event:l,listeners:t}))}var Hl=null,$l=null;function ob(e){Dg(e,0)}function ai(e){var t=Ll(e);if(Rh(t))return e}function Zh(e,t){if(e==="change")return t}var Jh=!1;if(os){var lc;if(os){var rc="oninput"in document;if(!rc){var Wh=document.createElement("div");Wh.setAttribute("oninput","return;"),rc=typeof Wh.oninput=="function"}lc=rc}else lc=!1;Jh=lc&&(!document.documentMode||9<document.documentMode)}function ef(){Hl&&(Hl.detachEvent("onpropertychange",tf),$l=Hl=null)}function tf(e){if(e.propertyName==="value"&&ai($l)){var t=[];Xh(t,$l,e,Xo(e)),Bh(ob,t)}}function cb(e,t,l){e==="focusin"?(ef(),Hl=t,$l=l,Hl.attachEvent("onpropertychange",tf)):e==="focusout"&&ef()}function ub(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ai($l)}function db(e,t){if(e==="click")return ai(t)}function hb(e,t){if(e==="input"||e==="change")return ai(t)}function fb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nn=typeof Object.is=="function"?Object.is:fb;function Gl(e,t){if(nn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),i=Object.keys(t);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var u=l[i];if(!en.call(t,u)||!nn(e[u],t[u]))return!1}return!0}function nf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sf(e,t){var l=nf(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=nf(l)}}function af(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?af(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zr(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Zr(e.document)}return t}function ic(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 pb=os&&"documentMode"in document&&11>=document.documentMode,Va=null,oc=null,Pl=null,cc=!1;function rf(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;cc||Va==null||Va!==Zr(i)||(i=Va,"selectionStart"in i&&ic(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}),Pl&&Gl(Pl,i)||(Pl=i,i=Yi(oc,"onSelect"),0<i.length&&(t=new ni("onSelect","select",null,t,l),e.push({event:t,listeners:i}),t.target=Va)))}function ca(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Ya={animationend:ca("Animation","AnimationEnd"),animationiteration:ca("Animation","AnimationIteration"),animationstart:ca("Animation","AnimationStart"),transitionrun:ca("Transition","TransitionRun"),transitionstart:ca("Transition","TransitionStart"),transitioncancel:ca("Transition","TransitionCancel"),transitionend:ca("Transition","TransitionEnd")},uc={},of={};os&&(of=document.createElement("div").style,"AnimationEvent"in window||(delete Ya.animationend.animation,delete Ya.animationiteration.animation,delete Ya.animationstart.animation),"TransitionEvent"in window||delete Ya.transitionend.transition);function ua(e){if(uc[e])return uc[e];if(!Ya[e])return e;var t=Ya[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in of)return uc[e]=t[l];return e}var cf=ua("animationend"),uf=ua("animationiteration"),df=ua("animationstart"),gb=ua("transitionrun"),mb=ua("transitionstart"),yb=ua("transitioncancel"),hf=ua("transitionend"),ff=new Map,dc="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(" ");dc.push("scrollEnd");function Ln(e,t){ff.set(e,t),ia(t,[e])}var li=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)},yn=[],Fa=0,hc=0;function ri(){for(var e=Fa,t=hc=Fa=0;t<e;){var l=yn[t];yn[t++]=null;var i=yn[t];yn[t++]=null;var u=yn[t];yn[t++]=null;var h=yn[t];if(yn[t++]=null,i!==null&&u!==null){var b=i.pending;b===null?u.next=u:(u.next=b.next,b.next=u),i.pending=u}h!==0&&pf(l,u,h)}}function ii(e,t,l,i){yn[Fa++]=e,yn[Fa++]=t,yn[Fa++]=l,yn[Fa++]=i,hc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function fc(e,t,l,i){return ii(e,t,l,i),oi(e)}function da(e,t){return ii(e,null,null,t),oi(e)}function pf(e,t,l){e.lanes|=l;var i=e.alternate;i!==null&&(i.lanes|=l);for(var u=!1,h=e.return;h!==null;)h.childLanes|=l,i=h.alternate,i!==null&&(i.childLanes|=l),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-He(l),e=h.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=l|536870912),h):null}function oi(e){if(50<hr)throw hr=0,_u=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qa={};function xb(e,t,l,i){this.tag=e,this.key=l,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 sn(e,t,l,i){return new xb(e,t,l,i)}function pc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cs(e,t){var l=e.alternate;return l===null?(l=sn(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function gf(e,t){e.flags&=65011714;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ci(e,t,l,i,u,h){var b=0;if(i=e,typeof e=="function")pc(e)&&(b=1);else if(typeof e=="string")b=TS(e,l,$.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=sn(31,l,t,u),e.elementType=H,e.lanes=h,e;case j:return ha(l.children,u,h,t);case k:b=8,u|=24;break;case w:return e=sn(12,l,t,u|2),e.elementType=w,e.lanes=h,e;case q:return e=sn(13,l,t,u),e.elementType=q,e.lanes=h,e;case A:return e=sn(19,l,t,u),e.elementType=A,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O:b=10;break e;case N:b=9;break e;case G:b=11;break e;case D:b=14;break e;case U:b=16,i=null;break e}b=29,l=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=sn(b,l,t,u),t.elementType=e,t.type=i,t.lanes=h,t}function ha(e,t,l,i){return e=sn(7,e,i,t),e.lanes=l,e}function gc(e,t,l){return e=sn(6,e,null,t),e.lanes=l,e}function mf(e){var t=sn(18,null,null,0);return t.stateNode=e,t}function mc(e,t,l){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yf=new WeakMap;function xn(e,t){if(typeof e=="object"&&e!==null){var l=yf.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Mt(t)},yf.set(e,t),t)}return{value:e,source:t,stack:Mt(t)}}var Ka=[],Xa=0,ui=null,Vl=0,vn=[],bn=0,Ls=null,Yn=1,Fn="";function us(e,t){Ka[Xa++]=Vl,Ka[Xa++]=ui,ui=e,Vl=t}function xf(e,t,l){vn[bn++]=Yn,vn[bn++]=Fn,vn[bn++]=Ls,Ls=e;var i=Yn;e=Fn;var u=32-He(i)-1;i&=~(1<<u),l+=1;var h=32-He(t)+u;if(30<h){var b=u-u%5;h=(i&(1<<b)-1).toString(32),i>>=b,u-=b,Yn=1<<32-He(t)+u|l<<u|i,Fn=h+e}else Yn=1<<h|l<<u|i,Fn=e}function yc(e){e.return!==null&&(us(e,1),xf(e,1,0))}function xc(e){for(;e===ui;)ui=Ka[--Xa],Ka[Xa]=null,Vl=Ka[--Xa],Ka[Xa]=null;for(;e===Ls;)Ls=vn[--bn],vn[bn]=null,Fn=vn[--bn],vn[bn]=null,Yn=vn[--bn],vn[bn]=null}function vf(e,t){vn[bn++]=Yn,vn[bn++]=Fn,vn[bn++]=Ls,Yn=t.id,Fn=t.overflow,Ls=e}var At=null,st=null,Ue=!1,qs=null,Sn=!1,vc=Error(o(519));function Ms(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yl(xn(t,e)),vc}function bf(e){var t=e.stateNode,l=e.type,i=e.memoizedProps;switch(t[Nt]=e,t[Yt]=i,l){case"dialog":Le("cancel",t),Le("close",t);break;case"iframe":case"object":case"embed":Le("load",t);break;case"video":case"audio":for(l=0;l<pr.length;l++)Le(pr[l],t);break;case"source":Le("error",t);break;case"img":case"image":case"link":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"input":Le("invalid",t),zh(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),Oh(t,i.value,i.defaultValue,i.children)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||i.suppressHydrationWarning===!0||Mg(t.textContent,l)?(i.popover!=null&&(Le("beforetoggle",t),Le("toggle",t)),i.onScroll!=null&&Le("scroll",t),i.onScrollEnd!=null&&Le("scrollend",t),i.onClick!=null&&(t.onclick=is),t=!0):t=!1,t||Ms(e,!0)}function Sf(e){for(At=e.return;At;)switch(At.tag){case 5:case 31:case 13:Sn=!1;return;case 27:case 3:Sn=!0;return;default:At=At.return}}function Za(e){if(e!==At)return!1;if(!Ue)return Sf(e),Ue=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Mu(e.type,e.memoizedProps)),l=!l),l&&st&&Ms(e),Sf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));st=Yg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));st=Yg(e)}else t===27?(t=st,Zs(e.type)?(e=$u,$u=null,st=e):st=t):st=At?Tn(e.stateNode.nextSibling):null;return!0}function fa(){st=At=null,Ue=!1}function bc(){var e=qs;return e!==null&&(Zt===null?Zt=e:Zt.push.apply(Zt,e),qs=null),e}function Yl(e){qs===null?qs=[e]:qs.push(e)}var Sc=R(null),pa=null,ds=null;function Bs(e,t,l){re(Sc,t._currentValue),t._currentValue=l}function hs(e){e._currentValue=Sc.current,K(Sc)}function _c(e,t,l){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===l)break;e=e.return}}function Tc(e,t,l,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var b=u.child;h=h.firstContext;e:for(;h!==null;){var C=h;h=u;for(var z=0;z<t.length;z++)if(C.context===t[z]){h.lanes|=l,C=h.alternate,C!==null&&(C.lanes|=l),_c(h.return,l,e),i||(b=null);break e}h=C.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(o(341));b.lanes|=l,h=b.alternate,h!==null&&(h.lanes|=l),_c(b,l,e),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===e){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function Ja(e,t,l,i){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(o(387));if(b=b.memoizedProps,b!==null){var C=u.type;nn(u.pendingProps.value,b.value)||(e!==null?e.push(C):e=[C])}}else if(u===le.current){if(b=u.alternate,b===null)throw Error(o(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(vr):e=[vr])}u=u.return}e!==null&&Tc(t,e,l,i),t.flags|=262144}function di(e){for(e=e.firstContext;e!==null;){if(!nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ga(e){pa=e,ds=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rt(e){return _f(pa,e)}function hi(e,t){return pa===null&&ga(e),_f(e,t)}function _f(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},ds===null){if(e===null)throw Error(o(308));ds=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ds=ds.next=t;return l}var vb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},bb=s.unstable_scheduleCallback,Sb=s.unstable_NormalPriority,pt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jc(){return{controller:new vb,data:new Map,refCount:0}}function Fl(e){e.refCount--,e.refCount===0&&bb(Sb,function(){e.controller.abort()})}var Ql=null,wc=0,Wa=0,el=null;function _b(e,t){if(Ql===null){var l=Ql=[];wc=0,Wa=Cu(),el={status:"pending",value:void 0,then:function(i){l.push(i)}}}return wc++,t.then(Tf,Tf),t}function Tf(){if(--wc===0&&Ql!==null){el!==null&&(el.status="fulfilled");var e=Ql;Ql=null,Wa=0,el=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Tb(e,t){var l=[],i={status:"pending",value:null,reason:null,then:function(u){l.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<l.length;u++)(0,l[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<l.length;u++)(0,l[u])(void 0)}),i}var jf=M.S;M.S=function(e,t){ig=_t(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_b(e,t),jf!==null&&jf(e,t)};var ma=R(null);function Ec(){var e=ma.current;return e!==null?e:nt.pooledCache}function fi(e,t){t===null?re(ma,ma.current):re(ma,t.pool)}function wf(){var e=Ec();return e===null?null:{parent:pt._currentValue,pool:e}}var tl=Error(o(460)),kc=Error(o(474)),pi=Error(o(542)),gi={then:function(){}};function Ef(e){return e=e.status,e==="fulfilled"||e==="rejected"}function kf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(is,is),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Nf(e),e;default:if(typeof t.status=="string")t.then(is,is);else{if(e=nt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Nf(e),e}throw xa=t,tl}}function ya(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(xa=l,tl):l}}var xa=null;function Cf(){if(xa===null)throw Error(o(459));var e=xa;return xa=null,e}function Nf(e){if(e===tl||e===pi)throw Error(o(483))}var nl=null,Kl=0;function mi(e){var t=Kl;return Kl+=1,nl===null&&(nl=[]),kf(nl,e,t)}function Xl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function yi(e,t){throw t.$$typeof===v?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Af(e){function t(I,L){if(e){var V=I.deletions;V===null?(I.deletions=[L],I.flags|=16):V.push(L)}}function l(I,L){if(!e)return null;for(;L!==null;)t(I,L),L=L.sibling;return null}function i(I){for(var L=new Map;I!==null;)I.key!==null?L.set(I.key,I):L.set(I.index,I),I=I.sibling;return L}function u(I,L){return I=cs(I,L),I.index=0,I.sibling=null,I}function h(I,L,V){return I.index=V,e?(V=I.alternate,V!==null?(V=V.index,V<L?(I.flags|=67108866,L):V):(I.flags|=67108866,L)):(I.flags|=1048576,L)}function b(I){return e&&I.alternate===null&&(I.flags|=67108866),I}function C(I,L,V,W){return L===null||L.tag!==6?(L=gc(V,I.mode,W),L.return=I,L):(L=u(L,V),L.return=I,L)}function z(I,L,V,W){var _e=V.type;return _e===j?Z(I,L,V.props.children,W,V.key):L!==null&&(L.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===U&&ya(_e)===L.type)?(L=u(L,V.props),Xl(L,V),L.return=I,L):(L=ci(V.type,V.key,V.props,null,I.mode,W),Xl(L,V),L.return=I,L)}function Y(I,L,V,W){return L===null||L.tag!==4||L.stateNode.containerInfo!==V.containerInfo||L.stateNode.implementation!==V.implementation?(L=mc(V,I.mode,W),L.return=I,L):(L=u(L,V.children||[]),L.return=I,L)}function Z(I,L,V,W,_e){return L===null||L.tag!==7?(L=ha(V,I.mode,W,_e),L.return=I,L):(L=u(L,V),L.return=I,L)}function te(I,L,V){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=gc(""+L,I.mode,V),L.return=I,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case T:return V=ci(L.type,L.key,L.props,null,I.mode,V),Xl(V,L),V.return=I,V;case E:return L=mc(L,I.mode,V),L.return=I,L;case U:return L=ya(L),te(I,L,V)}if(ue(L)||J(L))return L=ha(L,I.mode,V,null),L.return=I,L;if(typeof L.then=="function")return te(I,mi(L),V);if(L.$$typeof===O)return te(I,hi(I,L),V);yi(I,L)}return null}function F(I,L,V,W){var _e=L!==null?L.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return _e!==null?null:C(I,L,""+V,W);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case T:return V.key===_e?z(I,L,V,W):null;case E:return V.key===_e?Y(I,L,V,W):null;case U:return V=ya(V),F(I,L,V,W)}if(ue(V)||J(V))return _e!==null?null:Z(I,L,V,W,null);if(typeof V.then=="function")return F(I,L,mi(V),W);if(V.$$typeof===O)return F(I,L,hi(I,V),W);yi(I,V)}return null}function Q(I,L,V,W,_e){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return I=I.get(V)||null,C(L,I,""+W,_e);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case T:return I=I.get(W.key===null?V:W.key)||null,z(L,I,W,_e);case E:return I=I.get(W.key===null?V:W.key)||null,Y(L,I,W,_e);case U:return W=ya(W),Q(I,L,V,W,_e)}if(ue(W)||J(W))return I=I.get(V)||null,Z(L,I,W,_e,null);if(typeof W.then=="function")return Q(I,L,V,mi(W),_e);if(W.$$typeof===O)return Q(I,L,V,hi(L,W),_e);yi(L,W)}return null}function ye(I,L,V,W){for(var _e=null,Ve=null,ve=L,Re=L=0,Be=null;ve!==null&&Re<V.length;Re++){ve.index>Re?(Be=ve,ve=null):Be=ve.sibling;var Ye=F(I,ve,V[Re],W);if(Ye===null){ve===null&&(ve=Be);break}e&&ve&&Ye.alternate===null&&t(I,ve),L=h(Ye,L,Re),Ve===null?_e=Ye:Ve.sibling=Ye,Ve=Ye,ve=Be}if(Re===V.length)return l(I,ve),Ue&&us(I,Re),_e;if(ve===null){for(;Re<V.length;Re++)ve=te(I,V[Re],W),ve!==null&&(L=h(ve,L,Re),Ve===null?_e=ve:Ve.sibling=ve,Ve=ve);return Ue&&us(I,Re),_e}for(ve=i(ve);Re<V.length;Re++)Be=Q(ve,I,Re,V[Re],W),Be!==null&&(e&&Be.alternate!==null&&ve.delete(Be.key===null?Re:Be.key),L=h(Be,L,Re),Ve===null?_e=Be:Ve.sibling=Be,Ve=Be);return e&&ve.forEach(function(na){return t(I,na)}),Ue&&us(I,Re),_e}function je(I,L,V,W){if(V==null)throw Error(o(151));for(var _e=null,Ve=null,ve=L,Re=L=0,Be=null,Ye=V.next();ve!==null&&!Ye.done;Re++,Ye=V.next()){ve.index>Re?(Be=ve,ve=null):Be=ve.sibling;var na=F(I,ve,Ye.value,W);if(na===null){ve===null&&(ve=Be);break}e&&ve&&na.alternate===null&&t(I,ve),L=h(na,L,Re),Ve===null?_e=na:Ve.sibling=na,Ve=na,ve=Be}if(Ye.done)return l(I,ve),Ue&&us(I,Re),_e;if(ve===null){for(;!Ye.done;Re++,Ye=V.next())Ye=te(I,Ye.value,W),Ye!==null&&(L=h(Ye,L,Re),Ve===null?_e=Ye:Ve.sibling=Ye,Ve=Ye);return Ue&&us(I,Re),_e}for(ve=i(ve);!Ye.done;Re++,Ye=V.next())Ye=Q(ve,I,Re,Ye.value,W),Ye!==null&&(e&&Ye.alternate!==null&&ve.delete(Ye.key===null?Re:Ye.key),L=h(Ye,L,Re),Ve===null?_e=Ye:Ve.sibling=Ye,Ve=Ye);return e&&ve.forEach(function(OS){return t(I,OS)}),Ue&&us(I,Re),_e}function We(I,L,V,W){if(typeof V=="object"&&V!==null&&V.type===j&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case T:e:{for(var _e=V.key;L!==null;){if(L.key===_e){if(_e=V.type,_e===j){if(L.tag===7){l(I,L.sibling),W=u(L,V.props.children),W.return=I,I=W;break e}}else if(L.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===U&&ya(_e)===L.type){l(I,L.sibling),W=u(L,V.props),Xl(W,V),W.return=I,I=W;break e}l(I,L);break}else t(I,L);L=L.sibling}V.type===j?(W=ha(V.props.children,I.mode,W,V.key),W.return=I,I=W):(W=ci(V.type,V.key,V.props,null,I.mode,W),Xl(W,V),W.return=I,I=W)}return b(I);case E:e:{for(_e=V.key;L!==null;){if(L.key===_e)if(L.tag===4&&L.stateNode.containerInfo===V.containerInfo&&L.stateNode.implementation===V.implementation){l(I,L.sibling),W=u(L,V.children||[]),W.return=I,I=W;break e}else{l(I,L);break}else t(I,L);L=L.sibling}W=mc(V,I.mode,W),W.return=I,I=W}return b(I);case U:return V=ya(V),We(I,L,V,W)}if(ue(V))return ye(I,L,V,W);if(J(V)){if(_e=J(V),typeof _e!="function")throw Error(o(150));return V=_e.call(V),je(I,L,V,W)}if(typeof V.then=="function")return We(I,L,mi(V),W);if(V.$$typeof===O)return We(I,L,hi(I,V),W);yi(I,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,L!==null&&L.tag===6?(l(I,L.sibling),W=u(L,V),W.return=I,I=W):(l(I,L),W=gc(V,I.mode,W),W.return=I,I=W),b(I)):l(I,L)}return function(I,L,V,W){try{Kl=0;var _e=We(I,L,V,W);return nl=null,_e}catch(ve){if(ve===tl||ve===pi)throw ve;var Ve=sn(29,ve,null,I.mode);return Ve.lanes=W,Ve.return=I,Ve}finally{}}}var va=Af(!0),Rf=Af(!1),Us=!1;function Cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nc(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 Is(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Hs(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Fe&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=oi(e),pf(e,null,l),t}return ii(e,i,t,l),oi(e)}function Zl(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Sh(e,l)}}function Ac(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var u=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};h===null?u=h=b:h=h.next=b,l=l.next}while(l!==null);h===null?u=h=t:h=h.next=t}else u=h=t;l={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Rc=!1;function Jl(){if(Rc){var e=el;if(e!==null)throw e}}function Wl(e,t,l,i){Rc=!1;var u=e.updateQueue;Us=!1;var h=u.firstBaseUpdate,b=u.lastBaseUpdate,C=u.shared.pending;if(C!==null){u.shared.pending=null;var z=C,Y=z.next;z.next=null,b===null?h=Y:b.next=Y,b=z;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,C=Z.lastBaseUpdate,C!==b&&(C===null?Z.firstBaseUpdate=Y:C.next=Y,Z.lastBaseUpdate=z))}if(h!==null){var te=u.baseState;b=0,Z=Y=z=null,C=h;do{var F=C.lane&-536870913,Q=F!==C.lane;if(Q?(Me&F)===F:(i&F)===F){F!==0&&F===Wa&&(Rc=!0),Z!==null&&(Z=Z.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var ye=e,je=C;F=t;var We=l;switch(je.tag){case 1:if(ye=je.payload,typeof ye=="function"){te=ye.call(We,te,F);break e}te=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=je.payload,F=typeof ye=="function"?ye.call(We,te,F):ye,F==null)break e;te=_({},te,F);break e;case 2:Us=!0}}F=C.callback,F!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=u.callbacks,Q===null?u.callbacks=[F]:Q.push(F))}else Q={lane:F,tag:C.tag,payload:C.payload,callback:C.callback,next:null},Z===null?(Y=Z=Q,z=te):Z=Z.next=Q,b|=F;if(C=C.next,C===null){if(C=u.shared.pending,C===null)break;Q=C,C=Q.next,Q.next=null,u.lastBaseUpdate=Q,u.shared.pending=null}}while(!0);Z===null&&(z=te),u.baseState=z,u.firstBaseUpdate=Y,u.lastBaseUpdate=Z,h===null&&(u.shared.lanes=0),Ys|=b,e.lanes=b,e.memoizedState=te}}function zf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Df(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)zf(l[e],t)}var sl=R(null),xi=R(0);function Of(e,t){e=Ss,re(xi,e),re(sl,t),Ss=e|t.baseLanes}function zc(){re(xi,Ss),re(sl,sl.current)}function Dc(){Ss=xi.current,K(sl),K(xi)}var an=R(null),_n=null;function $s(e){var t=e.alternate;re(ht,ht.current&1),re(an,e),_n===null&&(t===null||sl.current!==null||t.memoizedState!==null)&&(_n=e)}function Oc(e){re(ht,ht.current),re(an,e),_n===null&&(_n=e)}function Lf(e){e.tag===22?(re(ht,ht.current),re(an,e),_n===null&&(_n=e)):Gs()}function Gs(){re(ht,ht.current),re(an,an.current)}function ln(e){K(an),_n===e&&(_n=null),K(ht)}var ht=R(0);function vi(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Iu(l)||Hu(l)))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 fs=0,Ae=null,Ze=null,gt=null,bi=!1,al=!1,ba=!1,Si=0,er=0,ll=null,jb=0;function ct(){throw Error(o(321))}function Lc(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!nn(e[l],t[l]))return!1;return!0}function qc(e,t,l,i,u,h){return fs=h,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?xp:Zc,ba=!1,h=l(i,u),ba=!1,al&&(h=Mf(t,l,i,u)),qf(e),h}function qf(e){M.H=sr;var t=Ze!==null&&Ze.next!==null;if(fs=0,gt=Ze=Ae=null,bi=!1,er=0,ll=null,t)throw Error(o(300));e===null||mt||(e=e.dependencies,e!==null&&di(e)&&(mt=!0))}function Mf(e,t,l,i){Ae=e;var u=0;do{if(al&&(ll=null),er=0,al=!1,25<=u)throw Error(o(301));if(u+=1,gt=Ze=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}M.H=vp,h=t(l,i)}while(al);return h}function wb(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?tr(t):t,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(Ae.flags|=1024),t}function Mc(){var e=Si!==0;return Si=0,e}function Bc(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Uc(e){if(bi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bi=!1}fs=0,gt=Ze=Ae=null,al=!1,er=Si=0,ll=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Ae.memoizedState=gt=e:gt=gt.next=e,gt}function ft(){if(Ze===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=gt===null?Ae.memoizedState:gt.next;if(t!==null)gt=t,Ze=e;else{if(e===null)throw Ae.alternate===null?Error(o(467)):Error(o(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},gt===null?Ae.memoizedState=gt=e:gt=gt.next=e}return gt}function _i(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tr(e){var t=er;return er+=1,ll===null&&(ll=[]),e=kf(ll,e,t),t=Ae,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?xp:Zc),e}function Ti(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return tr(e);if(e.$$typeof===O)return Rt(e)}throw Error(o(438,String(e)))}function Ic(e){var t=null,l=Ae.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var i=Ae.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=_i(),Ae.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),i=0;i<e;i++)l[i]=P;return t.index++,l}function ps(e,t){return typeof t=="function"?t(e):t}function ji(e){var t=ft();return Hc(t,Ze,e)}function Hc(e,t,l){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=l;var u=e.baseQueue,h=i.pending;if(h!==null){if(u!==null){var b=u.next;u.next=h.next,h.next=b}t.baseQueue=u=h,i.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var C=b=null,z=null,Y=t,Z=!1;do{var te=Y.lane&-536870913;if(te!==Y.lane?(Me&te)===te:(fs&te)===te){var F=Y.revertLane;if(F===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),te===Wa&&(Z=!0);else if((fs&F)===F){Y=Y.next,F===Wa&&(Z=!0);continue}else te={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(C=z=te,b=h):z=z.next=te,Ae.lanes|=F,Ys|=F;te=Y.action,ba&&l(h,te),h=Y.hasEagerState?Y.eagerState:l(h,te)}else F={lane:te,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(C=z=F,b=h):z=z.next=F,Ae.lanes|=te,Ys|=te;Y=Y.next}while(Y!==null&&Y!==t);if(z===null?b=h:z.next=C,!nn(h,e.memoizedState)&&(mt=!0,Z&&(l=el,l!==null)))throw l;e.memoizedState=h,e.baseState=b,e.baseQueue=z,i.lastRenderedState=h}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function $c(e){var t=ft(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var i=l.dispatch,u=l.pending,h=t.memoizedState;if(u!==null){l.pending=null;var b=u=u.next;do h=e(h,b.action),b=b.next;while(b!==u);nn(h,t.memoizedState)||(mt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),l.lastRenderedState=h}return[h,i]}function Bf(e,t,l){var i=Ae,u=ft(),h=Ue;if(h){if(l===void 0)throw Error(o(407));l=l()}else l=t();var b=!nn((Ze||u).memoizedState,l);if(b&&(u.memoizedState=l,mt=!0),u=u.queue,Vc(Hf.bind(null,i,u,e),[e]),u.getSnapshot!==t||b||gt!==null&>.memoizedState.tag&1){if(i.flags|=2048,rl(9,{destroy:void 0},If.bind(null,i,u,l,t),null),nt===null)throw Error(o(349));h||(fs&127)!==0||Uf(i,t,l)}return l}function Uf(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=Ae.updateQueue,t===null?(t=_i(),Ae.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function If(e,t,l,i){t.value=l,t.getSnapshot=i,$f(t)&&Gf(e)}function Hf(e,t,l){return l(function(){$f(t)&&Gf(e)})}function $f(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!nn(e,l)}catch{return!0}}function Gf(e){var t=da(e,2);t!==null&&Jt(t,e,2)}function Gc(e){var t=Ht();if(typeof e=="function"){var l=e;if(e=l(),ba){we(!0);try{l()}finally{we(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function Pf(e,t,l,i){return e.baseState=l,Hc(e,Ze,typeof i=="function"?i:ps)}function Eb(e,t,l,i,u){if(ki(e))throw Error(o(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){h.listeners.push(b)}};M.T!==null?l(!0):h.isTransition=!1,i(h),l=t.pending,l===null?(h.next=t.pending=h,Vf(t,h)):(h.next=l.next,t.pending=l.next=h)}}function Vf(e,t){var l=t.action,i=t.payload,u=e.state;if(t.isTransition){var h=M.T,b={};M.T=b;try{var C=l(u,i),z=M.S;z!==null&&z(b,C),Yf(e,t,C)}catch(Y){Pc(e,t,Y)}finally{h!==null&&b.types!==null&&(h.types=b.types),M.T=h}}else try{h=l(u,i),Yf(e,t,h)}catch(Y){Pc(e,t,Y)}}function Yf(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){Ff(e,t,i)},function(i){return Pc(e,t,i)}):Ff(e,t,l)}function Ff(e,t,l){t.status="fulfilled",t.value=l,Qf(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Vf(e,l)))}function Pc(e,t,l){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=l,Qf(t),t=t.next;while(t!==i)}e.action=null}function Qf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Kf(e,t){return t}function Xf(e,t){if(Ue){var l=nt.formState;if(l!==null){e:{var i=Ae;if(Ue){if(st){t:{for(var u=st,h=Sn;u.nodeType!==8;){if(!h){u=null;break t}if(u=Tn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){st=Tn(u.nextSibling),i=u.data==="F!";break e}}Ms(i)}i=!1}i&&(t=l[0])}}return l=Ht(),l.memoizedState=l.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kf,lastRenderedState:t},l.queue=i,l=gp.bind(null,Ae,i),i.dispatch=l,i=Gc(!1),h=Xc.bind(null,Ae,!1,i.queue),i=Ht(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,l=Eb.bind(null,Ae,u,h,l),u.dispatch=l,i.memoizedState=e,[t,l,!1]}function Zf(e){var t=ft();return Jf(t,Ze,e)}function Jf(e,t,l){if(t=Hc(e,t,Kf)[0],e=ji(ps)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=tr(t)}catch(b){throw b===tl?pi:b}else i=t;t=ft();var u=t.queue,h=u.dispatch;return l!==t.memoizedState&&(Ae.flags|=2048,rl(9,{destroy:void 0},kb.bind(null,u,l),null)),[i,h,e]}function kb(e,t){e.action=t}function Wf(e){var t=ft(),l=Ze;if(l!==null)return Jf(t,l,e);ft(),t=t.memoizedState,l=ft();var i=l.queue.dispatch;return l.memoizedState=e,[t,i,!1]}function rl(e,t,l,i){return e={tag:e,create:l,deps:i,inst:t,next:null},t=Ae.updateQueue,t===null&&(t=_i(),Ae.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(i=l.next,l.next=e,e.next=i,t.lastEffect=e),e}function ep(){return ft().memoizedState}function wi(e,t,l,i){var u=Ht();Ae.flags|=e,u.memoizedState=rl(1|t,{destroy:void 0},l,i===void 0?null:i)}function Ei(e,t,l,i){var u=ft();i=i===void 0?null:i;var h=u.memoizedState.inst;Ze!==null&&i!==null&&Lc(i,Ze.memoizedState.deps)?u.memoizedState=rl(t,h,l,i):(Ae.flags|=e,u.memoizedState=rl(1|t,h,l,i))}function tp(e,t){wi(8390656,8,e,t)}function Vc(e,t){Ei(2048,8,e,t)}function Cb(e){Ae.flags|=4;var t=Ae.updateQueue;if(t===null)t=_i(),Ae.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function np(e){var t=ft().memoizedState;return Cb({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function sp(e,t){return Ei(4,2,e,t)}function ap(e,t){return Ei(4,4,e,t)}function lp(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function rp(e,t,l){l=l!=null?l.concat([e]):null,Ei(4,4,lp.bind(null,t,e),l)}function Yc(){}function ip(e,t){var l=ft();t=t===void 0?null:t;var i=l.memoizedState;return t!==null&&Lc(t,i[1])?i[0]:(l.memoizedState=[e,t],e)}function op(e,t){var l=ft();t=t===void 0?null:t;var i=l.memoizedState;if(t!==null&&Lc(t,i[1]))return i[0];if(i=e(),ba){we(!0);try{e()}finally{we(!1)}}return l.memoizedState=[i,t],i}function Fc(e,t,l){return l===void 0||(fs&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=cg(),Ae.lanes|=e,Ys|=e,l)}function cp(e,t,l,i){return nn(l,t)?l:sl.current!==null?(e=Fc(e,l,i),nn(e,t)||(mt=!0),e):(fs&42)===0||(fs&1073741824)!==0&&(Me&261930)===0?(mt=!0,e.memoizedState=l):(e=cg(),Ae.lanes|=e,Ys|=e,t)}function up(e,t,l,i,u){var h=ne.p;ne.p=h!==0&&8>h?h:8;var b=M.T,C={};M.T=C,Xc(e,!1,t,l);try{var z=u(),Y=M.S;if(Y!==null&&Y(C,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var Z=Tb(z,i);nr(e,t,Z,cn(e))}else nr(e,t,i,cn(e))}catch(te){nr(e,t,{then:function(){},status:"rejected",reason:te},cn())}finally{ne.p=h,b!==null&&C.types!==null&&(b.types=C.types),M.T=b}}function Nb(){}function Qc(e,t,l,i){if(e.tag!==5)throw Error(o(476));var u=dp(e).queue;up(e,u,t,fe,l===null?Nb:function(){return hp(e),l(i)})}function dp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:fe},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function hp(e){var t=dp(e);t.next===null&&(t=e.alternate.memoizedState),nr(e,t.next.queue,{},cn())}function Kc(){return Rt(vr)}function fp(){return ft().memoizedState}function pp(){return ft().memoizedState}function Ab(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=cn();e=Is(l);var i=Hs(t,e,l);i!==null&&(Jt(i,t,l),Zl(i,t,l)),t={cache:jc()},e.payload=t;return}t=t.return}}function Rb(e,t,l){var i=cn();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ki(e)?mp(t,l):(l=fc(e,t,l,i),l!==null&&(Jt(l,e,i),yp(l,t,i)))}function gp(e,t,l){var i=cn();nr(e,t,l,i)}function nr(e,t,l,i){var u={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ki(e))mp(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var b=t.lastRenderedState,C=h(b,l);if(u.hasEagerState=!0,u.eagerState=C,nn(C,b))return ii(e,t,u,0),nt===null&&ri(),!1}catch{}finally{}if(l=fc(e,t,u,i),l!==null)return Jt(l,e,i),yp(l,t,i),!0}return!1}function Xc(e,t,l,i){if(i={lane:2,revertLane:Cu(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ki(e)){if(t)throw Error(o(479))}else t=fc(e,l,i,2),t!==null&&Jt(t,e,2)}function ki(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function mp(e,t){al=bi=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function yp(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Sh(e,l)}}var sr={readContext:Rt,use:Ti,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};sr.useEffectEvent=ct;var xp={readContext:Rt,use:Ti,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:tp,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,wi(4194308,4,lp.bind(null,t,e),l)},useLayoutEffect:function(e,t){return wi(4194308,4,e,t)},useInsertionEffect:function(e,t){wi(4,2,e,t)},useMemo:function(e,t){var l=Ht();t=t===void 0?null:t;var i=e();if(ba){we(!0);try{e()}finally{we(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=Ht();if(l!==void 0){var u=l(t);if(ba){we(!0);try{l(t)}finally{we(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=Rb.bind(null,Ae,e),[i.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=Gc(e);var t=e.queue,l=gp.bind(null,Ae,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Yc,useDeferredValue:function(e,t){var l=Ht();return Fc(l,e,t)},useTransition:function(){var e=Gc(!1);return e=up.bind(null,Ae,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ae,u=Ht();if(Ue){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),nt===null)throw Error(o(349));(Me&127)!==0||Uf(i,t,l)}u.memoizedState=l;var h={value:l,getSnapshot:t};return u.queue=h,tp(Hf.bind(null,i,h,e),[e]),i.flags|=2048,rl(9,{destroy:void 0},If.bind(null,i,h,l,t),null),l},useId:function(){var e=Ht(),t=nt.identifierPrefix;if(Ue){var l=Fn,i=Yn;l=(i&~(1<<32-He(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Si++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=jb++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Kc,useFormState:Xf,useActionState:Xf,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Xc.bind(null,Ae,!0,l),l.dispatch=t,[e,t]},useMemoCache:Ic,useCacheRefresh:function(){return Ht().memoizedState=Ab.bind(null,Ae)},useEffectEvent:function(e){var t=Ht(),l={impl:e};return t.memoizedState=l,function(){if((Fe&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},Zc={readContext:Rt,use:Ti,useCallback:ip,useContext:Rt,useEffect:Vc,useImperativeHandle:rp,useInsertionEffect:sp,useLayoutEffect:ap,useMemo:op,useReducer:ji,useRef:ep,useState:function(){return ji(ps)},useDebugValue:Yc,useDeferredValue:function(e,t){var l=ft();return cp(l,Ze.memoizedState,e,t)},useTransition:function(){var e=ji(ps)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:tr(e),t]},useSyncExternalStore:Bf,useId:fp,useHostTransitionStatus:Kc,useFormState:Zf,useActionState:Zf,useOptimistic:function(e,t){var l=ft();return Pf(l,Ze,e,t)},useMemoCache:Ic,useCacheRefresh:pp};Zc.useEffectEvent=np;var vp={readContext:Rt,use:Ti,useCallback:ip,useContext:Rt,useEffect:Vc,useImperativeHandle:rp,useInsertionEffect:sp,useLayoutEffect:ap,useMemo:op,useReducer:$c,useRef:ep,useState:function(){return $c(ps)},useDebugValue:Yc,useDeferredValue:function(e,t){var l=ft();return Ze===null?Fc(l,e,t):cp(l,Ze.memoizedState,e,t)},useTransition:function(){var e=$c(ps)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:tr(e),t]},useSyncExternalStore:Bf,useId:fp,useHostTransitionStatus:Kc,useFormState:Wf,useActionState:Wf,useOptimistic:function(e,t){var l=ft();return Ze!==null?Pf(l,Ze,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Ic,useCacheRefresh:pp};vp.useEffectEvent=np;function Jc(e,t,l,i){t=e.memoizedState,l=l(i,t),l=l==null?t:_({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Wc={enqueueSetState:function(e,t,l){e=e._reactInternals;var i=cn(),u=Is(i);u.payload=t,l!=null&&(u.callback=l),t=Hs(e,u,i),t!==null&&(Jt(t,e,i),Zl(t,e,i))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var i=cn(),u=Is(i);u.tag=1,u.payload=t,l!=null&&(u.callback=l),t=Hs(e,u,i),t!==null&&(Jt(t,e,i),Zl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=cn(),i=Is(l);i.tag=2,t!=null&&(i.callback=t),t=Hs(e,i,l),t!==null&&(Jt(t,e,l),Zl(t,e,l))}};function bp(e,t,l,i,u,h,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,b):t.prototype&&t.prototype.isPureReactComponent?!Gl(l,i)||!Gl(u,h):!0}function Sp(e,t,l,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,i),t.state!==e&&Wc.enqueueReplaceState(t,t.state,null)}function Sa(e,t){var l=t;if("ref"in t){l={};for(var i in t)i!=="ref"&&(l[i]=t[i])}if(e=e.defaultProps){l===t&&(l=_({},l));for(var u in e)l[u]===void 0&&(l[u]=e[u])}return l}function _p(e){li(e)}function Tp(e){console.error(e)}function jp(e){li(e)}function Ci(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function wp(e,t,l){try{var i=e.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function eu(e,t,l){return l=Is(l),l.tag=3,l.payload={element:null},l.callback=function(){Ci(e,t)},l}function Ep(e){return e=Is(e),e.tag=3,e}function kp(e,t,l,i){var u=l.type.getDerivedStateFromError;if(typeof u=="function"){var h=i.value;e.payload=function(){return u(h)},e.callback=function(){wp(t,l,i)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){wp(t,l,i),typeof u!="function"&&(Fs===null?Fs=new Set([this]):Fs.add(this));var C=i.stack;this.componentDidCatch(i.value,{componentStack:C!==null?C:""})})}function zb(e,t,l,i,u){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=l.alternate,t!==null&&Ja(t,l,u,!0),l=an.current,l!==null){switch(l.tag){case 31:case 13:return _n===null?Ii():l.alternate===null&&ut===0&&(ut=3),l.flags&=-257,l.flags|=65536,l.lanes=u,i===gi?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([i]):t.add(i),wu(e,i,u)),!1;case 22:return l.flags|=65536,i===gi?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([i]):l.add(i)),wu(e,i,u)),!1}throw Error(o(435,l.tag))}return wu(e,i,u),Ii(),!1}if(Ue)return t=an.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==vc&&(e=Error(o(422),{cause:i}),Yl(xn(e,l)))):(i!==vc&&(t=Error(o(423),{cause:i}),Yl(xn(t,l))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=xn(i,l),u=eu(e.stateNode,i,u),Ac(e,u),ut!==4&&(ut=2)),!1;var h=Error(o(520),{cause:i});if(h=xn(h,l),dr===null?dr=[h]:dr.push(h),ut!==4&&(ut=2),t===null)return!0;i=xn(i,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=u&-u,l.lanes|=e,e=eu(l.stateNode,i,e),Ac(l,e),!1;case 1:if(t=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Fs===null||!Fs.has(h))))return l.flags|=65536,u&=-u,l.lanes|=u,u=Ep(u),kp(u,e,l,i),Ac(l,u),!1}l=l.return}while(l!==null);return!1}var tu=Error(o(461)),mt=!1;function zt(e,t,l,i){t.child=e===null?Rf(t,null,l,i):va(t,e.child,l,i)}function Cp(e,t,l,i,u){l=l.render;var h=t.ref;if("ref"in i){var b={};for(var C in i)C!=="ref"&&(b[C]=i[C])}else b=i;return ga(t),i=qc(e,t,l,b,h,u),C=Mc(),e!==null&&!mt?(Bc(e,t,u),gs(e,t,u)):(Ue&&C&&yc(t),t.flags|=1,zt(e,t,i,u),t.child)}function Np(e,t,l,i,u){if(e===null){var h=l.type;return typeof h=="function"&&!pc(h)&&h.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=h,Ap(e,t,h,i,u)):(e=ci(l.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!cu(e,u)){var b=h.memoizedProps;if(l=l.compare,l=l!==null?l:Gl,l(b,i)&&e.ref===t.ref)return gs(e,t,u)}return t.flags|=1,e=cs(h,i),e.ref=t.ref,e.return=t,t.child=e}function Ap(e,t,l,i,u){if(e!==null){var h=e.memoizedProps;if(Gl(h,i)&&e.ref===t.ref)if(mt=!1,t.pendingProps=i=h,cu(e,u))(e.flags&131072)!==0&&(mt=!0);else return t.lanes=e.lanes,gs(e,t,u)}return nu(e,t,l,i,u)}function Rp(e,t,l,i){var u=i.children,h=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(h=h!==null?h.baseLanes|l:l,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~h}else i=0,t.child=null;return zp(e,t,h,l,i)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fi(t,h!==null?h.cachePool:null),h!==null?Of(t,h):zc(),Lf(t);else return i=t.lanes=536870912,zp(e,t,h!==null?h.baseLanes|l:l,l,i)}else h!==null?(fi(t,h.cachePool),Of(t,h),Gs(),t.memoizedState=null):(e!==null&&fi(t,null),zc(),Gs());return zt(e,t,u,l),t.child}function ar(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zp(e,t,l,i,u){var h=Ec();return h=h===null?null:{parent:pt._currentValue,pool:h},t.memoizedState={baseLanes:l,cachePool:h},e!==null&&fi(t,null),zc(),Lf(t),e!==null&&Ja(e,t,i,!0),t.childLanes=u,null}function Ni(e,t){return t=Ri({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Dp(e,t,l){return va(t,e.child,null,l),e=Ni(t,t.pendingProps),e.flags|=2,ln(t),t.memoizedState=null,e}function Db(e,t,l){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(i.mode==="hidden")return e=Ni(t,i),t.lanes=536870912,ar(null,e);if(Oc(t),(e=st)?(e=Vg(e,Sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ls!==null?{id:Yn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},l=mf(e),l.return=t,t.child=l,At=t,st=null)):e=null,e===null)throw Ms(t);return t.lanes=536870912,null}return Ni(t,i)}var h=e.memoizedState;if(h!==null){var b=h.dehydrated;if(Oc(t),u)if(t.flags&256)t.flags&=-257,t=Dp(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(mt||Ja(e,t,l,!1),u=(l&e.childLanes)!==0,mt||u){if(i=nt,i!==null&&(b=_h(i,l),b!==0&&b!==h.retryLane))throw h.retryLane=b,da(e,b),Jt(i,e,b),tu;Ii(),t=Dp(e,t,l)}else e=h.treeContext,st=Tn(b.nextSibling),At=t,Ue=!0,qs=null,Sn=!1,e!==null&&vf(t,e),t=Ni(t,i),t.flags|=4096;return t}return e=cs(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ai(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function nu(e,t,l,i,u){return ga(t),l=qc(e,t,l,i,void 0,u),i=Mc(),e!==null&&!mt?(Bc(e,t,u),gs(e,t,u)):(Ue&&i&&yc(t),t.flags|=1,zt(e,t,l,u),t.child)}function Op(e,t,l,i,u,h){return ga(t),t.updateQueue=null,l=Mf(t,i,l,u),qf(e),i=Mc(),e!==null&&!mt?(Bc(e,t,h),gs(e,t,h)):(Ue&&i&&yc(t),t.flags|=1,zt(e,t,l,h),t.child)}function Lp(e,t,l,i,u){if(ga(t),t.stateNode===null){var h=Qa,b=l.contextType;typeof b=="object"&&b!==null&&(h=Rt(b)),h=new l(i,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Wc,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=i,h.state=t.memoizedState,h.refs={},Cc(t),b=l.contextType,h.context=typeof b=="object"&&b!==null?Rt(b):Qa,h.state=t.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Jc(t,l,b,i),h.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(b=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),b!==h.state&&Wc.enqueueReplaceState(h,h.state,null),Wl(t,i,h,u),Jl(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){h=t.stateNode;var C=t.memoizedProps,z=Sa(l,C);h.props=z;var Y=h.context,Z=l.contextType;b=Qa,typeof Z=="object"&&Z!==null&&(b=Rt(Z));var te=l.getDerivedStateFromProps;Z=typeof te=="function"||typeof h.getSnapshotBeforeUpdate=="function",C=t.pendingProps!==C,Z||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(C||Y!==b)&&Sp(t,h,i,b),Us=!1;var F=t.memoizedState;h.state=F,Wl(t,i,h,u),Jl(),Y=t.memoizedState,C||F!==Y||Us?(typeof te=="function"&&(Jc(t,l,te,i),Y=t.memoizedState),(z=Us||bp(t,l,z,i,F,Y,b))?(Z||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=Y),h.props=i,h.state=Y,h.context=b,i=z):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{h=t.stateNode,Nc(e,t),b=t.memoizedProps,Z=Sa(l,b),h.props=Z,te=t.pendingProps,F=h.context,Y=l.contextType,z=Qa,typeof Y=="object"&&Y!==null&&(z=Rt(Y)),C=l.getDerivedStateFromProps,(Y=typeof C=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==te||F!==z)&&Sp(t,h,i,z),Us=!1,F=t.memoizedState,h.state=F,Wl(t,i,h,u),Jl();var Q=t.memoizedState;b!==te||F!==Q||Us||e!==null&&e.dependencies!==null&&di(e.dependencies)?(typeof C=="function"&&(Jc(t,l,C,i),Q=t.memoizedState),(Z=Us||bp(t,l,Z,i,F,Q,z)||e!==null&&e.dependencies!==null&&di(e.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,Q,z),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,Q,z)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=Q),h.props=i,h.state=Q,h.context=z,i=Z):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),i=!1)}return h=i,Ai(e,t),i=(t.flags&128)!==0,h||i?(h=t.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&i?(t.child=va(t,e.child,null,u),t.child=va(t,null,l,u)):zt(e,t,l,u),t.memoizedState=h.state,e=t.child):e=gs(e,t,u),e}function qp(e,t,l,i){return fa(),t.flags|=256,zt(e,t,l,i),t.child}var su={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function au(e){return{baseLanes:e,cachePool:wf()}}function lu(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=on),e}function Mp(e,t,l){var i=t.pendingProps,u=!1,h=(t.flags&128)!==0,b;if((b=h)||(b=e!==null&&e.memoizedState===null?!1:(ht.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(u?$s(t):Gs(),(e=st)?(e=Vg(e,Sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ls!==null?{id:Yn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},l=mf(e),l.return=t,t.child=l,At=t,st=null)):e=null,e===null)throw Ms(t);return Hu(e)?t.lanes=32:t.lanes=536870912,null}var C=i.children;return i=i.fallback,u?(Gs(),u=t.mode,C=Ri({mode:"hidden",children:C},u),i=ha(i,u,l,null),C.return=t,i.return=t,C.sibling=i,t.child=C,i=t.child,i.memoizedState=au(l),i.childLanes=lu(e,b,l),t.memoizedState=su,ar(null,i)):($s(t),ru(t,C))}var z=e.memoizedState;if(z!==null&&(C=z.dehydrated,C!==null)){if(h)t.flags&256?($s(t),t.flags&=-257,t=iu(e,t,l)):t.memoizedState!==null?(Gs(),t.child=e.child,t.flags|=128,t=null):(Gs(),C=i.fallback,u=t.mode,i=Ri({mode:"visible",children:i.children},u),C=ha(C,u,l,null),C.flags|=2,i.return=t,C.return=t,i.sibling=C,t.child=i,va(t,e.child,null,l),i=t.child,i.memoizedState=au(l),i.childLanes=lu(e,b,l),t.memoizedState=su,t=ar(null,i));else if($s(t),Hu(C)){if(b=C.nextSibling&&C.nextSibling.dataset,b)var Y=b.dgst;b=Y,i=Error(o(419)),i.stack="",i.digest=b,Yl({value:i,source:null,stack:null}),t=iu(e,t,l)}else if(mt||Ja(e,t,l,!1),b=(l&e.childLanes)!==0,mt||b){if(b=nt,b!==null&&(i=_h(b,l),i!==0&&i!==z.retryLane))throw z.retryLane=i,da(e,i),Jt(b,e,i),tu;Iu(C)||Ii(),t=iu(e,t,l)}else Iu(C)?(t.flags|=192,t.child=e.child,t=null):(e=z.treeContext,st=Tn(C.nextSibling),At=t,Ue=!0,qs=null,Sn=!1,e!==null&&vf(t,e),t=ru(t,i.children),t.flags|=4096);return t}return u?(Gs(),C=i.fallback,u=t.mode,z=e.child,Y=z.sibling,i=cs(z,{mode:"hidden",children:i.children}),i.subtreeFlags=z.subtreeFlags&65011712,Y!==null?C=cs(Y,C):(C=ha(C,u,l,null),C.flags|=2),C.return=t,i.return=t,i.sibling=C,t.child=i,ar(null,i),i=t.child,C=e.child.memoizedState,C===null?C=au(l):(u=C.cachePool,u!==null?(z=pt._currentValue,u=u.parent!==z?{parent:z,pool:z}:u):u=wf(),C={baseLanes:C.baseLanes|l,cachePool:u}),i.memoizedState=C,i.childLanes=lu(e,b,l),t.memoizedState=su,ar(e.child,i)):($s(t),l=e.child,e=l.sibling,l=cs(l,{mode:"visible",children:i.children}),l.return=t,l.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=l,t.memoizedState=null,l)}function ru(e,t){return t=Ri({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ri(e,t){return e=sn(22,e,null,t),e.lanes=0,e}function iu(e,t,l){return va(t,e.child,null,l),e=ru(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bp(e,t,l){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),_c(e.return,t,l)}function ou(e,t,l,i,u,h){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:u,treeForkCount:h}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=i,b.tail=l,b.tailMode=u,b.treeForkCount=h)}function Up(e,t,l){var i=t.pendingProps,u=i.revealOrder,h=i.tail;i=i.children;var b=ht.current,C=(b&2)!==0;if(C?(b=b&1|2,t.flags|=128):b&=1,re(ht,b),zt(e,t,i,l),i=Ue?Vl:0,!C&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bp(e,l,t);else if(e.tag===19)Bp(e,l,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(u){case"forwards":for(l=t.child,u=null;l!==null;)e=l.alternate,e!==null&&vi(e)===null&&(u=l),l=l.sibling;l=u,l===null?(u=t.child,t.child=null):(u=l.sibling,l.sibling=null),ou(t,!1,u,l,h,i);break;case"backwards":case"unstable_legacy-backwards":for(l=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&vi(e)===null){t.child=u;break}e=u.sibling,u.sibling=l,l=u,u=e}ou(t,!0,l,null,h,i);break;case"together":ou(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function gs(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Ys|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Ja(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=cs(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=cs(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function cu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&di(e)))}function Ob(e,t,l){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),Bs(t,pt,e.memoizedState.cache),fa();break;case 27:case 5:ot(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:Bs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Oc(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?($s(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Mp(e,t,l):($s(t),e=gs(e,t,l),e!==null?e.sibling:null);$s(t);break;case 19:var u=(e.flags&128)!==0;if(i=(l&t.childLanes)!==0,i||(Ja(e,t,l,!1),i=(l&t.childLanes)!==0),u){if(i)return Up(e,t,l);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),re(ht,ht.current),i)break;return null;case 22:return t.lanes=0,Rp(e,t,l,t.pendingProps);case 24:Bs(t,pt,e.memoizedState.cache)}return gs(e,t,l)}function Ip(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)mt=!0;else{if(!cu(e,l)&&(t.flags&128)===0)return mt=!1,Ob(e,t,l);mt=(e.flags&131072)!==0}else mt=!1,Ue&&(t.flags&1048576)!==0&&xf(t,Vl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=ya(t.elementType),t.type=e,typeof e=="function")pc(e)?(i=Sa(e,i),t.tag=1,t=Lp(null,t,e,i,l)):(t.tag=0,t=nu(null,t,e,i,l));else{if(e!=null){var u=e.$$typeof;if(u===G){t.tag=11,t=Cp(null,t,e,i,l);break e}else if(u===D){t.tag=14,t=Np(null,t,e,i,l);break e}}throw t=ee(e)||e,Error(o(306,t,""))}}return t;case 0:return nu(e,t,t.type,t.pendingProps,l);case 1:return i=t.type,u=Sa(i,t.pendingProps),Lp(e,t,i,u,l);case 3:e:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var h=t.memoizedState;u=h.element,Nc(e,t),Wl(t,i,null,l);var b=t.memoizedState;if(i=b.cache,Bs(t,pt,i),i!==h.cache&&Tc(t,[pt],l,!0),Jl(),i=b.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=qp(e,t,i,l);break e}else if(i!==u){u=xn(Error(o(424)),t),Yl(u),t=qp(e,t,i,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(st=Tn(e.firstChild),At=t,Ue=!0,qs=null,Sn=!0,l=Rf(t,null,i,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(fa(),i===u){t=gs(e,t,l);break e}zt(e,t,i,l)}t=t.child}return t;case 26:return Ai(e,t),e===null?(l=Zg(t.type,null,t.pendingProps,null))?t.memoizedState=l:Ue||(l=t.type,e=t.pendingProps,i=Fi(de.current).createElement(l),i[Nt]=t,i[Yt]=e,Dt(i,l,e),wt(i),t.stateNode=i):t.memoizedState=Zg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ot(t),e===null&&Ue&&(i=t.stateNode=Qg(t.type,t.pendingProps,de.current),At=t,Sn=!0,u=st,Zs(t.type)?($u=u,st=Tn(i.firstChild)):st=u),zt(e,t,t.pendingProps.children,l),Ai(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((u=i=st)&&(i=uS(i,t.type,t.pendingProps,Sn),i!==null?(t.stateNode=i,At=t,st=Tn(i.firstChild),Sn=!1,u=!0):u=!1),u||Ms(t)),ot(t),u=t.type,h=t.pendingProps,b=e!==null?e.memoizedProps:null,i=h.children,Mu(u,h)?i=null:b!==null&&Mu(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=qc(e,t,wb,null,null,l),vr._currentValue=u),Ai(e,t),zt(e,t,i,l),t.child;case 6:return e===null&&Ue&&((e=l=st)&&(l=dS(l,t.pendingProps,Sn),l!==null?(t.stateNode=l,At=t,st=null,e=!0):e=!1),e||Ms(t)),null;case 13:return Mp(e,t,l);case 4:return be(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=va(t,null,i,l):zt(e,t,i,l),t.child;case 11:return Cp(e,t,t.type,t.pendingProps,l);case 7:return zt(e,t,t.pendingProps,l),t.child;case 8:return zt(e,t,t.pendingProps.children,l),t.child;case 12:return zt(e,t,t.pendingProps.children,l),t.child;case 10:return i=t.pendingProps,Bs(t,t.type,i.value),zt(e,t,i.children,l),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,ga(t),u=Rt(u),i=i(u),t.flags|=1,zt(e,t,i,l),t.child;case 14:return Np(e,t,t.type,t.pendingProps,l);case 15:return Ap(e,t,t.type,t.pendingProps,l);case 19:return Up(e,t,l);case 31:return Db(e,t,l);case 22:return Rp(e,t,l,t.pendingProps);case 24:return ga(t),i=Rt(pt),e===null?(u=Ec(),u===null&&(u=nt,h=jc(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=l),u=h),t.memoizedState={parent:i,cache:u},Cc(t),Bs(t,pt,u)):((e.lanes&l)!==0&&(Nc(e,t),Wl(t,null,null,l),Jl()),u=e.memoizedState,h=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Bs(t,pt,i)):(i=h.cache,Bs(t,pt,i),i!==u.cache&&Tc(t,[pt],l,!0))),zt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ms(e){e.flags|=4}function uu(e,t,l,i,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(fg())e.flags|=8192;else throw xa=gi,kc}else e.flags&=-16777217}function Hp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!nm(t))if(fg())e.flags|=8192;else throw xa=gi,kc}function zi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ee():536870912,e.lanes|=t,ul|=t)}function lr(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function at(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,i=0;if(t)for(var u=e.child;u!==null;)l|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)l|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=l,t}function Lb(e,t,l){var i=t.pendingProps;switch(xc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(t),null;case 1:return at(t),null;case 3:return l=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),hs(pt),De(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Za(t)?ms(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,bc())),at(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(ms(t),h!==null?(at(t),Hp(t,h)):(at(t),uu(t,u,null,i,l))):h?h!==e.memoizedState?(ms(t),at(t),Hp(t,h)):(at(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&ms(t),at(t),uu(t,u,e,i,l)),null;case 27:if(Gt(t),l=de.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ms(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return at(t),null}e=$.current,Za(t)?bf(t):(e=Qg(u,i,l),t.stateNode=e,ms(t))}return at(t),null;case 5:if(Gt(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ms(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return at(t),null}if(h=$.current,Za(t))bf(t);else{var b=Fi(de.current);switch(h){case 1:h=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=b.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?h.multiple=!0:i.size&&(h.size=i.size);break;default:h=typeof i.is=="string"?b.createElement(u,{is:i.is}):b.createElement(u)}}h[Nt]=t,h[Yt]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)h.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=h;e:switch(Dt(h,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ms(t)}}return at(t),uu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&ms(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=de.current,Za(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,u=At,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||Mg(e.nodeValue,l)),e||Ms(t,!0)}else e=Fi(e).createTextNode(i),e[Nt]=t,t.stateNode=e}return at(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=Za(t),l!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Nt]=t}else fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),e=!1}else l=bc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(ln(t),t):(ln(t),null);if((t.flags&128)!==0)throw Error(o(558))}return at(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Za(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Nt]=t}else fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),u=!1}else u=bc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(ln(t),t):(ln(t),null)}return ln(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==u&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),zi(t,t.updateQueue),at(t),null);case 4:return De(),e===null&&zu(t.stateNode.containerInfo),at(t),null;case 10:return hs(t.type),at(t),null;case 19:if(K(ht),i=t.memoizedState,i===null)return at(t),null;if(u=(t.flags&128)!==0,h=i.rendering,h===null)if(u)lr(i,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=vi(e),h!==null){for(t.flags|=128,lr(i,!1),e=h.updateQueue,t.updateQueue=e,zi(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)gf(l,e),l=l.sibling;return re(ht,ht.current&1|2),Ue&&us(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&_t()>Mi&&(t.flags|=128,u=!0,lr(i,!1),t.lanes=4194304)}else{if(!u)if(e=vi(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,zi(t,e),lr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!h.alternate&&!Ue)return at(t),null}else 2*_t()-i.renderingStartTime>Mi&&l!==536870912&&(t.flags|=128,u=!0,lr(i,!1),t.lanes=4194304);i.isBackwards?(h.sibling=t.child,t.child=h):(e=i.last,e!==null?e.sibling=h:t.child=h,i.last=h)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=_t(),e.sibling=null,l=ht.current,re(ht,u?l&1|2:l&1),Ue&&us(t,i.treeForkCount),e):(at(t),null);case 22:case 23:return ln(t),Dc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),l=t.updateQueue,l!==null&&zi(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&K(ma),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),hs(pt),at(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function qb(e,t){switch(xc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hs(pt),De(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Gt(t),null;case 31:if(t.memoizedState!==null){if(ln(t),t.alternate===null)throw Error(o(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ln(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(ht),null;case 4:return De(),null;case 10:return hs(t.type),null;case 22:case 23:return ln(t),Dc(),e!==null&&K(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return hs(pt),null;case 25:return null;default:return null}}function $p(e,t){switch(xc(t),t.tag){case 3:hs(pt),De();break;case 26:case 27:case 5:Gt(t);break;case 4:De();break;case 31:t.memoizedState!==null&&ln(t);break;case 13:ln(t);break;case 19:K(ht);break;case 10:hs(t.type);break;case 22:case 23:ln(t),Dc(),e!==null&&K(ma);break;case 24:hs(pt)}}function rr(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var u=i.next;l=u;do{if((l.tag&e)===e){i=void 0;var h=l.create,b=l.inst;i=h(),b.destroy=i}l=l.next}while(l!==u)}}catch(C){Xe(t,t.return,C)}}function Ps(e,t,l){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var h=u.next;i=h;do{if((i.tag&e)===e){var b=i.inst,C=b.destroy;if(C!==void 0){b.destroy=void 0,u=t;var z=l,Y=C;try{Y()}catch(Z){Xe(u,z,Z)}}}i=i.next}while(i!==h)}}catch(Z){Xe(t,t.return,Z)}}function Gp(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Df(t,l)}catch(i){Xe(e,e.return,i)}}}function Pp(e,t,l){l.props=Sa(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){Xe(e,t,i)}}function ir(e,t){try{var l=e.ref;if(l!==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 l=="function"?e.refCleanup=l(i):l.current=i}}catch(u){Xe(e,t,u)}}function Qn(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(u){Xe(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(u){Xe(e,t,u)}else l.current=null}function Vp(e){var t=e.type,l=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(u){Xe(e,e.return,u)}}function du(e,t,l){try{var i=e.stateNode;aS(i,e.type,l,t),i[Yt]=t}catch(u){Xe(e,e.return,u)}}function Yp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zs(e.type)||e.tag===4}function hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yp(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&&Zs(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 fu(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=is));else if(i!==4&&(i===27&&Zs(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(fu(e,t,l),e=e.sibling;e!==null;)fu(e,t,l),e=e.sibling}function Di(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(i!==4&&(i===27&&Zs(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Di(e,t,l),e=e.sibling;e!==null;)Di(e,t,l),e=e.sibling}function Fp(e){var t=e.stateNode,l=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Dt(t,i,l),t[Nt]=e,t[Yt]=l}catch(h){Xe(e,e.return,h)}}var ys=!1,yt=!1,pu=!1,Qp=typeof WeakSet=="function"?WeakSet:Set,Et=null;function Mb(e,t){if(e=e.containerInfo,Lu=eo,e=lf(e),ic(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var u=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{l.nodeType,h.nodeType}catch{l=null;break e}var b=0,C=-1,z=-1,Y=0,Z=0,te=e,F=null;t:for(;;){for(var Q;te!==l||u!==0&&te.nodeType!==3||(C=b+u),te!==h||i!==0&&te.nodeType!==3||(z=b+i),te.nodeType===3&&(b+=te.nodeValue.length),(Q=te.firstChild)!==null;)F=te,te=Q;for(;;){if(te===e)break t;if(F===l&&++Y===u&&(C=b),F===h&&++Z===i&&(z=b),(Q=te.nextSibling)!==null)break;te=F,F=te.parentNode}te=Q}l=C===-1||z===-1?null:{start:C,end:z}}else l=null}l=l||{start:0,end:0}}else l=null;for(qu={focusedElem:e,selectionRange:l},eo=!1,Et=t;Et!==null;)if(t=Et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Et=e;else for(;Et!==null;){switch(t=Et,h=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(l=0;l<e.length;l++)u=e[l],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,l=t,u=h.memoizedProps,h=h.memoizedState,i=l.stateNode;try{var ye=Sa(l.type,u);e=i.getSnapshotBeforeUpdate(ye,h),i.__reactInternalSnapshotBeforeUpdate=e}catch(je){Xe(l,l.return,je)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Uu(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Uu(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Et=e;break}Et=t.return}}function Kp(e,t,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:vs(e,l),i&4&&rr(5,l);break;case 1:if(vs(e,l),i&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(b){Xe(l,l.return,b)}else{var u=Sa(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Xe(l,l.return,b)}}i&64&&Gp(l),i&512&&ir(l,l.return);break;case 3:if(vs(e,l),i&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Df(e,t)}catch(b){Xe(l,l.return,b)}}break;case 27:t===null&&i&4&&Fp(l);case 26:case 5:vs(e,l),t===null&&i&4&&Vp(l),i&512&&ir(l,l.return);break;case 12:vs(e,l);break;case 31:vs(e,l),i&4&&Jp(e,l);break;case 13:vs(e,l),i&4&&Wp(e,l),i&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Yb.bind(null,l),hS(e,l))));break;case 22:if(i=l.memoizedState!==null||ys,!i){t=t!==null&&t.memoizedState!==null||yt,u=ys;var h=yt;ys=i,(yt=t)&&!h?bs(e,l,(l.subtreeFlags&8772)!==0):vs(e,l),ys=u,yt=h}break;case 30:break;default:vs(e,l)}}function Xp(e){var t=e.alternate;t!==null&&(e.alternate=null,Xp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Po(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 rt=null,Qt=!1;function xs(e,t,l){for(l=l.child;l!==null;)Zp(e,t,l),l=l.sibling}function Zp(e,t,l){if(he&&typeof he.onCommitFiberUnmount=="function")try{he.onCommitFiberUnmount(oe,l)}catch{}switch(l.tag){case 26:yt||Qn(l,t),xs(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:yt||Qn(l,t);var i=rt,u=Qt;Zs(l.type)&&(rt=l.stateNode,Qt=!1),xs(e,t,l),mr(l.stateNode),rt=i,Qt=u;break;case 5:yt||Qn(l,t);case 6:if(i=rt,u=Qt,rt=null,xs(e,t,l),rt=i,Qt=u,rt!==null)if(Qt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(l.stateNode)}catch(h){Xe(l,t,h)}else try{rt.removeChild(l.stateNode)}catch(h){Xe(l,t,h)}break;case 18:rt!==null&&(Qt?(e=rt,Gg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),xl(e)):Gg(rt,l.stateNode));break;case 4:i=rt,u=Qt,rt=l.stateNode.containerInfo,Qt=!0,xs(e,t,l),rt=i,Qt=u;break;case 0:case 11:case 14:case 15:Ps(2,l,t),yt||Ps(4,l,t),xs(e,t,l);break;case 1:yt||(Qn(l,t),i=l.stateNode,typeof i.componentWillUnmount=="function"&&Pp(l,t,i)),xs(e,t,l);break;case 21:xs(e,t,l);break;case 22:yt=(i=yt)||l.memoizedState!==null,xs(e,t,l),yt=i;break;default:xs(e,t,l)}}function Jp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{xl(e)}catch(l){Xe(t,t.return,l)}}}function Wp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{xl(e)}catch(l){Xe(t,t.return,l)}}function Bb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qp),t;default:throw Error(o(435,e.tag))}}function Oi(e,t){var l=Bb(e);t.forEach(function(i){if(!l.has(i)){l.add(i);var u=Fb.bind(null,e,i);i.then(u,u)}})}function Kt(e,t){var l=t.deletions;if(l!==null)for(var i=0;i<l.length;i++){var u=l[i],h=e,b=t,C=b;e:for(;C!==null;){switch(C.tag){case 27:if(Zs(C.type)){rt=C.stateNode,Qt=!1;break e}break;case 5:rt=C.stateNode,Qt=!1;break e;case 3:case 4:rt=C.stateNode.containerInfo,Qt=!0;break e}C=C.return}if(rt===null)throw Error(o(160));Zp(h,b,u),rt=null,Qt=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)eg(t,e),t=t.sibling}var qn=null;function eg(e,t){var l=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Kt(t,e),Xt(e),i&4&&(Ps(3,e,e.return),rr(3,e),Ps(5,e,e.return));break;case 1:Kt(t,e),Xt(e),i&512&&(yt||l===null||Qn(l,l.return)),i&64&&ys&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?i:l.concat(i))));break;case 26:var u=qn;if(Kt(t,e),Xt(e),i&512&&(yt||l===null||Qn(l,l.return)),i&4){var h=l!==null?l.memoizedState:null;if(i=e.memoizedState,l===null)if(i===null)if(e.stateNode===null){e:{i=e.type,l=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":h=u.getElementsByTagName("title")[0],(!h||h[Ol]||h[Nt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(i),u.head.insertBefore(h,u.querySelector("head > title"))),Dt(h,i,l),h[Nt]=e,wt(h),i=h;break e;case"link":var b=em("link","href",u).get(i+(l.href||""));if(b){for(var C=0;C<b.length;C++)if(h=b[C],h.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&h.getAttribute("rel")===(l.rel==null?null:l.rel)&&h.getAttribute("title")===(l.title==null?null:l.title)&&h.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(C,1);break t}}h=u.createElement(i),Dt(h,i,l),u.head.appendChild(h);break;case"meta":if(b=em("meta","content",u).get(i+(l.content||""))){for(C=0;C<b.length;C++)if(h=b[C],h.getAttribute("content")===(l.content==null?null:""+l.content)&&h.getAttribute("name")===(l.name==null?null:l.name)&&h.getAttribute("property")===(l.property==null?null:l.property)&&h.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&h.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(C,1);break t}}h=u.createElement(i),Dt(h,i,l),u.head.appendChild(h);break;default:throw Error(o(468,i))}h[Nt]=e,wt(h),i=h}e.stateNode=i}else tm(u,e.type,e.stateNode);else e.stateNode=Wg(u,i,e.memoizedProps);else h!==i?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,i===null?tm(u,e.type,e.stateNode):Wg(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&du(e,e.memoizedProps,l.memoizedProps)}break;case 27:Kt(t,e),Xt(e),i&512&&(yt||l===null||Qn(l,l.return)),l!==null&&i&4&&du(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Kt(t,e),Xt(e),i&512&&(yt||l===null||Qn(l,l.return)),e.flags&32){u=e.stateNode;try{Ha(u,"")}catch(ye){Xe(e,e.return,ye)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,du(e,u,l!==null?l.memoizedProps:u)),i&1024&&(pu=!0);break;case 6:if(Kt(t,e),Xt(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,l=e.stateNode;try{l.nodeValue=i}catch(ye){Xe(e,e.return,ye)}}break;case 3:if(Xi=null,u=qn,qn=Qi(t.containerInfo),Kt(t,e),qn=u,Xt(e),i&4&&l!==null&&l.memoizedState.isDehydrated)try{xl(t.containerInfo)}catch(ye){Xe(e,e.return,ye)}pu&&(pu=!1,tg(e));break;case 4:i=qn,qn=Qi(e.stateNode.containerInfo),Kt(t,e),Xt(e),qn=i;break;case 12:Kt(t,e),Xt(e);break;case 31:Kt(t,e),Xt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Oi(e,i)));break;case 13:Kt(t,e),Xt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(qi=_t()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Oi(e,i)));break;case 22:u=e.memoizedState!==null;var z=l!==null&&l.memoizedState!==null,Y=ys,Z=yt;if(ys=Y||u,yt=Z||z,Kt(t,e),yt=Z,ys=Y,Xt(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(l===null||z||ys||yt||_a(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){z=l=t;try{if(h=z.stateNode,u)b=h.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{C=z.stateNode;var te=z.memoizedProps.style,F=te!=null&&te.hasOwnProperty("display")?te.display:null;C.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ye){Xe(z,z.return,ye)}}}else if(t.tag===6){if(l===null){z=t;try{z.stateNode.nodeValue=u?"":z.memoizedProps}catch(ye){Xe(z,z.return,ye)}}}else if(t.tag===18){if(l===null){z=t;try{var Q=z.stateNode;u?Pg(Q,!0):Pg(z.stateNode,!1)}catch(ye){Xe(z,z.return,ye)}}}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;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,Oi(e,l))));break;case 19:Kt(t,e),Xt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Oi(e,i)));break;case 30:break;case 21:break;default:Kt(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{for(var l,i=e.return;i!==null;){if(Yp(i)){l=i;break}i=i.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var u=l.stateNode,h=hu(e);Di(e,h,u);break;case 5:var b=l.stateNode;l.flags&32&&(Ha(b,""),l.flags&=-33);var C=hu(e);Di(e,C,b);break;case 3:case 4:var z=l.stateNode.containerInfo,Y=hu(e);fu(e,Y,z);break;default:throw Error(o(161))}}catch(Z){Xe(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;tg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vs(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Kp(e,t.alternate,t),t=t.sibling}function _a(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ps(4,t,t.return),_a(t);break;case 1:Qn(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Pp(t,t.return,l),_a(t);break;case 27:mr(t.stateNode);case 26:case 5:Qn(t,t.return),_a(t);break;case 22:t.memoizedState===null&&_a(t);break;case 30:_a(t);break;default:_a(t)}e=e.sibling}}function bs(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,h=t,b=h.flags;switch(h.tag){case 0:case 11:case 15:bs(u,h,l),rr(4,h);break;case 1:if(bs(u,h,l),i=h,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(Y){Xe(i,i.return,Y)}if(i=h,u=i.updateQueue,u!==null){var C=i.stateNode;try{var z=u.shared.hiddenCallbacks;if(z!==null)for(u.shared.hiddenCallbacks=null,u=0;u<z.length;u++)zf(z[u],C)}catch(Y){Xe(i,i.return,Y)}}l&&b&64&&Gp(h),ir(h,h.return);break;case 27:Fp(h);case 26:case 5:bs(u,h,l),l&&i===null&&b&4&&Vp(h),ir(h,h.return);break;case 12:bs(u,h,l);break;case 31:bs(u,h,l),l&&b&4&&Jp(u,h);break;case 13:bs(u,h,l),l&&b&4&&Wp(u,h);break;case 22:h.memoizedState===null&&bs(u,h,l),ir(h,h.return);break;case 30:break;default:bs(u,h,l)}t=t.sibling}}function gu(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Fl(l))}function mu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fl(e))}function Mn(e,t,l,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ng(e,t,l,i),t=t.sibling}function ng(e,t,l,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Mn(e,t,l,i),u&2048&&rr(9,t);break;case 1:Mn(e,t,l,i);break;case 3:Mn(e,t,l,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fl(e)));break;case 12:if(u&2048){Mn(e,t,l,i),e=t.stateNode;try{var h=t.memoizedProps,b=h.id,C=h.onPostCommit;typeof C=="function"&&C(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Xe(t,t.return,z)}}else Mn(e,t,l,i);break;case 31:Mn(e,t,l,i);break;case 13:Mn(e,t,l,i);break;case 23:break;case 22:h=t.stateNode,b=t.alternate,t.memoizedState!==null?h._visibility&2?Mn(e,t,l,i):or(e,t):h._visibility&2?Mn(e,t,l,i):(h._visibility|=2,il(e,t,l,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&gu(b,t);break;case 24:Mn(e,t,l,i),u&2048&&mu(t.alternate,t);break;default:Mn(e,t,l,i)}}function il(e,t,l,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,b=t,C=l,z=i,Y=b.flags;switch(b.tag){case 0:case 11:case 15:il(h,b,C,z,u),rr(8,b);break;case 23:break;case 22:var Z=b.stateNode;b.memoizedState!==null?Z._visibility&2?il(h,b,C,z,u):or(h,b):(Z._visibility|=2,il(h,b,C,z,u)),u&&Y&2048&&gu(b.alternate,b);break;case 24:il(h,b,C,z,u),u&&Y&2048&&mu(b.alternate,b);break;default:il(h,b,C,z,u)}t=t.sibling}}function or(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,i=t,u=i.flags;switch(i.tag){case 22:or(l,i),u&2048&&gu(i.alternate,i);break;case 24:or(l,i),u&2048&&mu(i.alternate,i);break;default:or(l,i)}t=t.sibling}}var cr=8192;function ol(e,t,l){if(e.subtreeFlags&cr)for(e=e.child;e!==null;)sg(e,t,l),e=e.sibling}function sg(e,t,l){switch(e.tag){case 26:ol(e,t,l),e.flags&cr&&e.memoizedState!==null&&jS(l,qn,e.memoizedState,e.memoizedProps);break;case 5:ol(e,t,l);break;case 3:case 4:var i=qn;qn=Qi(e.stateNode.containerInfo),ol(e,t,l),qn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=cr,cr=16777216,ol(e,t,l),cr=i):ol(e,t,l));break;default:ol(e,t,l)}}function ag(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 ur(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];Et=i,rg(i,e)}ag(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)lg(e),e=e.sibling}function lg(e){switch(e.tag){case 0:case 11:case 15:ur(e),e.flags&2048&&Ps(9,e,e.return);break;case 3:ur(e);break;case 12:ur(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Li(e)):ur(e);break;default:ur(e)}}function Li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];Et=i,rg(i,e)}ag(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ps(8,t,t.return),Li(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Li(t));break;default:Li(t)}e=e.sibling}}function rg(e,t){for(;Et!==null;){var l=Et;switch(l.tag){case 0:case 11:case 15:Ps(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var i=l.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Fl(l.memoizedState.cache)}if(i=l.child,i!==null)i.return=l,Et=i;else e:for(l=e;Et!==null;){i=Et;var u=i.sibling,h=i.return;if(Xp(i),i===l){Et=null;break e}if(u!==null){u.return=h,Et=u;break e}Et=h}}}var Ub={getCacheForType:function(e){var t=Rt(pt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Rt(pt).controller.signal}},Ib=typeof WeakMap=="function"?WeakMap:Map,Fe=0,nt=null,Oe=null,Me=0,Ke=0,rn=null,Vs=!1,cl=!1,yu=!1,Ss=0,ut=0,Ys=0,Ta=0,xu=0,on=0,ul=0,dr=null,Zt=null,vu=!1,qi=0,ig=0,Mi=1/0,Bi=null,Fs=null,Tt=0,Qs=null,dl=null,_s=0,bu=0,Su=null,og=null,hr=0,_u=null;function cn(){return(Fe&2)!==0&&Me!==0?Me&-Me:M.T!==null?Cu():Th()}function cg(){if(on===0)if((Me&536870912)===0||Ue){var e=Vn;Vn<<=1,(Vn&3932160)===0&&(Vn=262144),on=e}else on=536870912;return e=an.current,e!==null&&(e.flags|=32),on}function Jt(e,t,l){(e===nt&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(hl(e,0),Ks(e,Me,on,!1)),Dl(e,l),((Fe&2)===0||e!==nt)&&(e===nt&&((Fe&2)===0&&(Ta|=l),ut===4&&Ks(e,Me,on,!1)),Kn(e))}function ug(e,t,l){if((Fe&6)!==0)throw Error(o(327));var i=!l&&(t&127)===0&&(t&e.expiredLanes)===0||ls(e,t),u=i?Gb(e,t):ju(e,t,!0),h=i;do{if(u===0){cl&&!i&&Ks(e,t,0,!1);break}else{if(l=e.current.alternate,h&&!Hb(l)){u=ju(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var C=e;u=dr;var z=C.current.memoizedState.isDehydrated;if(z&&(hl(C,b).flags|=256),b=ju(C,b,!1),b!==2){if(yu&&!z){C.errorRecoveryDisabledLanes|=h,Ta|=h,u=4;break e}h=Zt,Zt=u,h!==null&&(Zt===null?Zt=h:Zt.push.apply(Zt,h))}u=b}if(h=!1,u!==2)continue}}if(u===1){hl(e,0),Ks(e,t,0,!0);break}e:{switch(i=e,h=u,h){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Ks(i,t,on,!Vs);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(u=qi+300-_t(),10<u)){if(Ks(i,t,on,!Vs),zs(i,0,!0)!==0)break e;_s=t,i.timeoutHandle=Hg(dg.bind(null,i,l,Zt,Bi,vu,t,on,Ta,ul,Vs,h,"Throttled",-0,0),u);break e}dg(i,l,Zt,Bi,vu,t,on,Ta,ul,Vs,h,null,-0,0)}}break}while(!0);Kn(e)}function dg(e,t,l,i,u,h,b,C,z,Y,Z,te,F,Q){if(e.timeoutHandle=-1,te=t.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},sg(t,h,te);var ye=(h&62914560)===h?qi-_t():(h&4194048)===h?ig-_t():0;if(ye=wS(te,ye),ye!==null){_s=h,e.cancelPendingCommit=ye(vg.bind(null,e,t,h,l,i,u,b,C,z,Z,te,null,F,Q)),Ks(e,h,b,!Y);return}}vg(e,t,h,l,i,u,b,C,z)}function Hb(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var u=l[i],h=u.getSnapshot;u=u.value;try{if(!nn(h(),u))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 Ks(e,t,l,i){t&=~xu,t&=~Ta,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var h=31-He(u),b=1<<h;i[h]=-1,u&=~b}l!==0&&bh(e,l,t)}function Ui(){return(Fe&6)===0?(fr(0),!1):!0}function Tu(){if(Oe!==null){if(Ke===0)var e=Oe.return;else e=Oe,ds=pa=null,Uc(e),nl=null,Kl=0,e=Oe;for(;e!==null;)$p(e.alternate,e),e=e.return;Oe=null}}function hl(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,iS(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),_s=0,Tu(),nt=e,Oe=l=cs(e.current,null),Me=t,Ke=0,rn=null,Vs=!1,cl=ls(e,t),yu=!1,ul=on=xu=Ta=Ys=ut=0,Zt=dr=null,vu=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-He(i),h=1<<u;t|=e[u],i&=~h}return Ss=t,ri(),l}function hg(e,t){Ae=null,M.H=sr,t===tl||t===pi?(t=Cf(),Ke=3):t===kc?(t=Cf(),Ke=4):Ke=t===tu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,rn=t,Oe===null&&(ut=1,Ci(e,xn(t,e.current)))}function fg(){var e=an.current;return e===null?!0:(Me&4194048)===Me?_n===null:(Me&62914560)===Me||(Me&536870912)!==0?e===_n:!1}function pg(){var e=M.H;return M.H=sr,e===null?sr:e}function gg(){var e=M.A;return M.A=Ub,e}function Ii(){ut=4,Vs||(Me&4194048)!==Me&&an.current!==null||(cl=!0),(Ys&134217727)===0&&(Ta&134217727)===0||nt===null||Ks(nt,Me,on,!1)}function ju(e,t,l){var i=Fe;Fe|=2;var u=pg(),h=gg();(nt!==e||Me!==t)&&(Bi=null,hl(e,t)),t=!1;var b=ut;e:do try{if(Ke!==0&&Oe!==null){var C=Oe,z=rn;switch(Ke){case 8:Tu(),b=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(t=!0);var Y=Ke;if(Ke=0,rn=null,fl(e,C,z,Y),l&&cl){b=0;break e}break;default:Y=Ke,Ke=0,rn=null,fl(e,C,z,Y)}}$b(),b=ut;break}catch(Z){hg(e,Z)}while(!0);return t&&e.shellSuspendCounter++,ds=pa=null,Fe=i,M.H=u,M.A=h,Oe===null&&(nt=null,Me=0,ri()),b}function $b(){for(;Oe!==null;)mg(Oe)}function Gb(e,t){var l=Fe;Fe|=2;var i=pg(),u=gg();nt!==e||Me!==t?(Bi=null,Mi=_t()+500,hl(e,t)):cl=ls(e,t);e:do try{if(Ke!==0&&Oe!==null){t=Oe;var h=rn;t:switch(Ke){case 1:Ke=0,rn=null,fl(e,t,h,1);break;case 2:case 9:if(Ef(h)){Ke=0,rn=null,yg(t);break}t=function(){Ke!==2&&Ke!==9||nt!==e||(Ke=7),Kn(e)},h.then(t,t);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:Ef(h)?(Ke=0,rn=null,yg(t)):(Ke=0,rn=null,fl(e,t,h,7));break;case 5:var b=null;switch(Oe.tag){case 26:b=Oe.memoizedState;case 5:case 27:var C=Oe;if(b?nm(b):C.stateNode.complete){Ke=0,rn=null;var z=C.sibling;if(z!==null)Oe=z;else{var Y=C.return;Y!==null?(Oe=Y,Hi(Y)):Oe=null}break t}}Ke=0,rn=null,fl(e,t,h,5);break;case 6:Ke=0,rn=null,fl(e,t,h,6);break;case 8:Tu(),ut=6;break e;default:throw Error(o(462))}}Pb();break}catch(Z){hg(e,Z)}while(!0);return ds=pa=null,M.H=i,M.A=u,Fe=l,Oe!==null?0:(nt=null,Me=0,ri(),ut)}function Pb(){for(;Oe!==null&&!as();)mg(Oe)}function mg(e){var t=Ip(e.alternate,e,Ss);e.memoizedProps=e.pendingProps,t===null?Hi(e):Oe=t}function yg(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Op(l,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=Op(l,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:Uc(t);default:$p(l,t),t=Oe=gf(t,Ss),t=Ip(l,t,Ss)}e.memoizedProps=e.pendingProps,t===null?Hi(e):Oe=t}function fl(e,t,l,i){ds=pa=null,Uc(t),nl=null,Kl=0;var u=t.return;try{if(zb(e,u,t,l,Me)){ut=1,Ci(e,xn(l,e.current)),Oe=null;return}}catch(h){if(u!==null)throw Oe=u,h;ut=1,Ci(e,xn(l,e.current)),Oe=null;return}t.flags&32768?(Ue||i===1?e=!0:cl||(Me&536870912)!==0?e=!1:(Vs=e=!0,(i===2||i===9||i===3||i===6)&&(i=an.current,i!==null&&i.tag===13&&(i.flags|=16384))),xg(t,e)):Hi(t)}function Hi(e){var t=e;do{if((t.flags&32768)!==0){xg(t,Vs);return}e=t.return;var l=Lb(t.alternate,t,Ss);if(l!==null){Oe=l;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);ut===0&&(ut=5)}function xg(e,t){do{var l=qb(e.alternate,e);if(l!==null){l.flags&=32767,Oe=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=l}while(e!==null);ut=6,Oe=null}function vg(e,t,l,i,u,h,b,C,z){e.cancelPendingCommit=null;do $i();while(Tt!==0);if((Fe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(h=t.lanes|t.childLanes,h|=hc,Tv(e,l,h,b,C,z),e===nt&&(Oe=nt=null,Me=0),dl=t,Qs=e,_s=l,bu=h,Su=u,og=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Qb(As,function(){return jg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=M.T,M.T=null,u=ne.p,ne.p=2,b=Fe,Fe|=4;try{Mb(e,t,l)}finally{Fe=b,ne.p=u,M.T=i}}Tt=1,bg(),Sg(),_g()}}function bg(){if(Tt===1){Tt=0;var e=Qs,t=dl,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null;var i=ne.p;ne.p=2;var u=Fe;Fe|=4;try{eg(t,e);var h=qu,b=lf(e.containerInfo),C=h.focusedElem,z=h.selectionRange;if(b!==C&&C&&C.ownerDocument&&af(C.ownerDocument.documentElement,C)){if(z!==null&&ic(C)){var Y=z.start,Z=z.end;if(Z===void 0&&(Z=Y),"selectionStart"in C)C.selectionStart=Y,C.selectionEnd=Math.min(Z,C.value.length);else{var te=C.ownerDocument||document,F=te&&te.defaultView||window;if(F.getSelection){var Q=F.getSelection(),ye=C.textContent.length,je=Math.min(z.start,ye),We=z.end===void 0?je:Math.min(z.end,ye);!Q.extend&&je>We&&(b=We,We=je,je=b);var I=sf(C,je),L=sf(C,We);if(I&&L&&(Q.rangeCount!==1||Q.anchorNode!==I.node||Q.anchorOffset!==I.offset||Q.focusNode!==L.node||Q.focusOffset!==L.offset)){var V=te.createRange();V.setStart(I.node,I.offset),Q.removeAllRanges(),je>We?(Q.addRange(V),Q.extend(L.node,L.offset)):(V.setEnd(L.node,L.offset),Q.addRange(V))}}}}for(te=[],Q=C;Q=Q.parentNode;)Q.nodeType===1&&te.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<te.length;C++){var W=te[C];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}eo=!!Lu,qu=Lu=null}finally{Fe=u,ne.p=i,M.T=l}}e.current=t,Tt=2}}function Sg(){if(Tt===2){Tt=0;var e=Qs,t=dl,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=M.T,M.T=null;var i=ne.p;ne.p=2;var u=Fe;Fe|=4;try{Kp(e,t.alternate,t)}finally{Fe=u,ne.p=i,M.T=l}}Tt=3}}function _g(){if(Tt===4||Tt===3){Tt=0,ks();var e=Qs,t=dl,l=_s,i=og;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tt=5:(Tt=0,dl=Qs=null,Tg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Fs=null),$o(l),t=t.stateNode,he&&typeof he.onCommitFiberRoot=="function")try{he.onCommitFiberRoot(oe,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=M.T,u=ne.p,ne.p=2,M.T=null;try{for(var h=e.onRecoverableError,b=0;b<i.length;b++){var C=i[b];h(C.value,{componentStack:C.stack})}}finally{M.T=t,ne.p=u}}(_s&3)!==0&&$i(),Kn(e),u=e.pendingLanes,(l&261930)!==0&&(u&42)!==0?e===_u?hr++:(hr=0,_u=e):hr=0,fr(0)}}function Tg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fl(t)))}function $i(){return bg(),Sg(),_g(),jg()}function jg(){if(Tt!==5)return!1;var e=Qs,t=bu;bu=0;var l=$o(_s),i=M.T,u=ne.p;try{ne.p=32>l?32:l,M.T=null,l=Su,Su=null;var h=Qs,b=_s;if(Tt=0,dl=Qs=null,_s=0,(Fe&6)!==0)throw Error(o(331));var C=Fe;if(Fe|=4,lg(h.current),ng(h,h.current,b,l),Fe=C,fr(0,!1),he&&typeof he.onPostCommitFiberRoot=="function")try{he.onPostCommitFiberRoot(oe,h)}catch{}return!0}finally{ne.p=u,M.T=i,Tg(e,t)}}function wg(e,t,l){t=xn(l,t),t=eu(e.stateNode,t,2),e=Hs(e,t,2),e!==null&&(Dl(e,2),Kn(e))}function Xe(e,t,l){if(e.tag===3)wg(e,e,l);else for(;t!==null;){if(t.tag===3){wg(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Fs===null||!Fs.has(i))){e=xn(l,e),l=Ep(2),i=Hs(t,l,2),i!==null&&(kp(l,i,t,e),Dl(i,2),Kn(i));break}}t=t.return}}function wu(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new Ib;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(l)||(yu=!0,u.add(l),e=Vb.bind(null,e,t,l),t.then(e,e))}function Vb(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,nt===e&&(Me&l)===l&&(ut===4||ut===3&&(Me&62914560)===Me&&300>_t()-qi?(Fe&2)===0&&hl(e,0):xu|=l,ul===Me&&(ul=0)),Kn(e)}function Eg(e,t){t===0&&(t=Ee()),e=da(e,t),e!==null&&(Dl(e,t),Kn(e))}function Yb(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Eg(e,l)}function Fb(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(l=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),Eg(e,l)}function Qb(e,t){return On(e,t)}var Gi=null,pl=null,Eu=!1,Pi=!1,ku=!1,Xs=0;function Kn(e){e!==pl&&e.next===null&&(pl===null?Gi=pl=e:pl=pl.next=e),Pi=!0,Eu||(Eu=!0,Xb())}function fr(e,t){if(!ku&&Pi){ku=!0;do for(var l=!1,i=Gi;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var h=0;else{var b=i.suspendedLanes,C=i.pingedLanes;h=(1<<31-He(42|e)+1)-1,h&=u&~(b&~C),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,Ag(i,h))}else h=Me,h=zs(i,i===nt?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(h&3)===0||ls(i,h)||(l=!0,Ag(i,h));i=i.next}while(l);ku=!1}}function Kb(){kg()}function kg(){Pi=Eu=!1;var e=0;Xs!==0&&rS()&&(e=Xs);for(var t=_t(),l=null,i=Gi;i!==null;){var u=i.next,h=Cg(i,t);h===0?(i.next=null,l===null?Gi=u:l.next=u,u===null&&(pl=l)):(l=i,(e!==0||(h&3)!==0)&&(Pi=!0)),i=u}Tt!==0&&Tt!==5||fr(e),Xs!==0&&(Xs=0)}function Cg(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var b=31-He(h),C=1<<b,z=u[b];z===-1?((C&l)===0||(C&i)!==0)&&(u[b]=ie(C,t)):z<=t&&(e.expiredLanes|=C),h&=~C}if(t=nt,l=Me,l=zs(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,l===0||e===t&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&ss(i),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||ls(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(i!==null&&ss(i),$o(l)){case 2:case 8:l=Oa;break;case 32:l=As;break;case 268435456:l=hn;break;default:l=As}return i=Ng.bind(null,e),l=On(l,i),e.callbackPriority=t,e.callbackNode=l,t}return i!==null&&i!==null&&ss(i),e.callbackPriority=2,e.callbackNode=null,2}function Ng(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if($i()&&e.callbackNode!==l)return null;var i=Me;return i=zs(e,e===nt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(ug(e,i,t),Cg(e,_t()),e.callbackNode!=null&&e.callbackNode===l?Ng.bind(null,e):null)}function Ag(e,t){if($i())return null;ug(e,t,!0)}function Xb(){oS(function(){(Fe&6)!==0?On(Ns,Kb):kg()})}function Cu(){if(Xs===0){var e=Wa;e===0&&(e=Ut,Ut<<=1,(Ut&261888)===0&&(Ut=256)),Xs=e}return Xs}function Rg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jr(""+e)}function zg(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Zb(e,t,l,i,u){if(t==="submit"&&l&&l.stateNode===u){var h=Rg((u[Yt]||null).action),b=i.submitter;b&&(t=(t=b[Yt]||null)?Rg(t.formAction):b.getAttribute("formAction"),t!==null&&(h=t,b=null));var C=new ni("action","action",null,i,u);e.push({event:C,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Xs!==0){var z=b?zg(u,b):new FormData(u);Qc(l,{pending:!0,data:z,method:u.method,action:h},null,z)}}else typeof h=="function"&&(C.preventDefault(),z=b?zg(u,b):new FormData(u),Qc(l,{pending:!0,data:z,method:u.method,action:h},h,z))},currentTarget:u}]})}}for(var Nu=0;Nu<dc.length;Nu++){var Au=dc[Nu],Jb=Au.toLowerCase(),Wb=Au[0].toUpperCase()+Au.slice(1);Ln(Jb,"on"+Wb)}Ln(cf,"onAnimationEnd"),Ln(uf,"onAnimationIteration"),Ln(df,"onAnimationStart"),Ln("dblclick","onDoubleClick"),Ln("focusin","onFocus"),Ln("focusout","onBlur"),Ln(gb,"onTransitionRun"),Ln(mb,"onTransitionStart"),Ln(yb,"onTransitionCancel"),Ln(hf,"onTransitionEnd"),Ua("onMouseEnter",["mouseout","mouseover"]),Ua("onMouseLeave",["mouseout","mouseover"]),Ua("onPointerEnter",["pointerout","pointerover"]),Ua("onPointerLeave",["pointerout","pointerover"]),ia("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ia("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ia("onBeforeInput",["compositionend","keypress","textInput","paste"]),ia("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ia("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ia("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pr="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(" "),eS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pr));function Dg(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var i=e[l],u=i.event;i=i.listeners;e:{var h=void 0;if(t)for(var b=i.length-1;0<=b;b--){var C=i[b],z=C.instance,Y=C.currentTarget;if(C=C.listener,z!==h&&u.isPropagationStopped())break e;h=C,u.currentTarget=Y;try{h(u)}catch(Z){li(Z)}u.currentTarget=null,h=z}else for(b=0;b<i.length;b++){if(C=i[b],z=C.instance,Y=C.currentTarget,C=C.listener,z!==h&&u.isPropagationStopped())break e;h=C,u.currentTarget=Y;try{h(u)}catch(Z){li(Z)}u.currentTarget=null,h=z}}}}function Le(e,t){var l=t[Go];l===void 0&&(l=t[Go]=new Set);var i=e+"__bubble";l.has(i)||(Og(t,e,2,!1),l.add(i))}function Ru(e,t,l){var i=0;t&&(i|=4),Og(l,e,i,t)}var Vi="_reactListening"+Math.random().toString(36).slice(2);function zu(e){if(!e[Vi]){e[Vi]=!0,Eh.forEach(function(l){l!=="selectionchange"&&(eS.has(l)||Ru(l,!1,e),Ru(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vi]||(t[Vi]=!0,Ru("selectionchange",!1,t))}}function Og(e,t,l,i){switch(cm(t)){case 2:var u=CS;break;case 8:u=NS;break;default:u=Fu}l=u.bind(null,t,l,e),u=void 0,!Jo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,l,{capture:!0,passive:u}):e.addEventListener(t,l,!0):u!==void 0?e.addEventListener(t,l,{passive:u}):e.addEventListener(t,l,!1)}function Du(e,t,l,i,u){var h=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var b=i.tag;if(b===3||b===4){var C=i.stateNode.containerInfo;if(C===u)break;if(b===4)for(b=i.return;b!==null;){var z=b.tag;if((z===3||z===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;C!==null;){if(b=qa(C),b===null)return;if(z=b.tag,z===5||z===6||z===26||z===27){i=h=b;continue e}C=C.parentNode}}i=i.return}Bh(function(){var Y=h,Z=Xo(l),te=[];e:{var F=ff.get(e);if(F!==void 0){var Q=ni,ye=e;switch(e){case"keypress":if(ei(l)===0)break e;case"keydown":case"keyup":Q=Fv;break;case"focusin":ye="focus",Q=nc;break;case"focusout":ye="blur",Q=nc;break;case"beforeblur":case"afterblur":Q=nc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Hh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=Lv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Xv;break;case cf:case uf:case df:Q=Bv;break;case hf:Q=Jv;break;case"scroll":case"scrollend":Q=Dv;break;case"wheel":Q=eb;break;case"copy":case"cut":case"paste":Q=Iv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Gh;break;case"toggle":case"beforetoggle":Q=nb}var je=(t&4)!==0,We=!je&&(e==="scroll"||e==="scrollend"),I=je?F!==null?F+"Capture":null:F;je=[];for(var L=Y,V;L!==null;){var W=L;if(V=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||V===null||I===null||(W=ql(L,I),W!=null&&je.push(gr(L,W,V))),We)break;L=L.return}0<je.length&&(F=new Q(F,ye,null,l,Z),te.push({event:F,listeners:je}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",F&&l!==Ko&&(ye=l.relatedTarget||l.fromElement)&&(qa(ye)||ye[La]))break e;if((Q||F)&&(F=Z.window===Z?Z:(F=Z.ownerDocument)?F.defaultView||F.parentWindow:window,Q?(ye=l.relatedTarget||l.toElement,Q=Y,ye=ye?qa(ye):null,ye!==null&&(We=d(ye),je=ye.tag,ye!==We||je!==5&&je!==27&&je!==6)&&(ye=null)):(Q=null,ye=Y),Q!==ye)){if(je=Hh,W="onMouseLeave",I="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(je=Gh,W="onPointerLeave",I="onPointerEnter",L="pointer"),We=Q==null?F:Ll(Q),V=ye==null?F:Ll(ye),F=new je(W,L+"leave",Q,l,Z),F.target=We,F.relatedTarget=V,W=null,qa(Z)===Y&&(je=new je(I,L+"enter",ye,l,Z),je.target=V,je.relatedTarget=We,W=je),We=W,Q&&ye)t:{for(je=tS,I=Q,L=ye,V=0,W=I;W;W=je(W))V++;W=0;for(var _e=L;_e;_e=je(_e))W++;for(;0<V-W;)I=je(I),V--;for(;0<W-V;)L=je(L),W--;for(;V--;){if(I===L||L!==null&&I===L.alternate){je=I;break t}I=je(I),L=je(L)}je=null}else je=null;Q!==null&&Lg(te,F,Q,je,!1),ye!==null&&We!==null&&Lg(te,We,ye,je,!0)}}e:{if(F=Y?Ll(Y):window,Q=F.nodeName&&F.nodeName.toLowerCase(),Q==="select"||Q==="input"&&F.type==="file")var Ve=Zh;else if(Kh(F))if(Jh)Ve=hb;else{Ve=ub;var ve=cb}else Q=F.nodeName,!Q||Q.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?Y&&Qo(Y.elementType)&&(Ve=Zh):Ve=db;if(Ve&&(Ve=Ve(e,Y))){Xh(te,Ve,l,Z);break e}ve&&ve(e,F,Y),e==="focusout"&&Y&&F.type==="number"&&Y.memoizedProps.value!=null&&Fo(F,"number",F.value)}switch(ve=Y?Ll(Y):window,e){case"focusin":(Kh(ve)||ve.contentEditable==="true")&&(Va=ve,oc=Y,Pl=null);break;case"focusout":Pl=oc=Va=null;break;case"mousedown":cc=!0;break;case"contextmenu":case"mouseup":case"dragend":cc=!1,rf(te,l,Z);break;case"selectionchange":if(pb)break;case"keydown":case"keyup":rf(te,l,Z)}var Re;if(ac)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Pa?Fh(e,l)&&(Be="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Be="onCompositionStart");Be&&(Ph&&l.locale!=="ko"&&(Pa||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Pa&&(Re=Uh()):(Os=Z,Wo="value"in Os?Os.value:Os.textContent,Pa=!0)),ve=Yi(Y,Be),0<ve.length&&(Be=new $h(Be,e,null,l,Z),te.push({event:Be,listeners:ve}),Re?Be.data=Re:(Re=Qh(l),Re!==null&&(Be.data=Re)))),(Re=ab?lb(e,l):rb(e,l))&&(Be=Yi(Y,"onBeforeInput"),0<Be.length&&(ve=new $h("onBeforeInput","beforeinput",null,l,Z),te.push({event:ve,listeners:Be}),ve.data=Re)),Zb(te,e,Y,l,Z)}Dg(te,t)})}function gr(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Yi(e,t){for(var l=t+"Capture",i=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=ql(e,l),u!=null&&i.unshift(gr(e,u,h)),u=ql(e,t),u!=null&&i.push(gr(e,u,h))),e.tag===3)return i;e=e.return}return[]}function tS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Lg(e,t,l,i,u){for(var h=t._reactName,b=[];l!==null&&l!==i;){var C=l,z=C.alternate,Y=C.stateNode;if(C=C.tag,z!==null&&z===i)break;C!==5&&C!==26&&C!==27||Y===null||(z=Y,u?(Y=ql(l,h),Y!=null&&b.unshift(gr(l,Y,z))):u||(Y=ql(l,h),Y!=null&&b.push(gr(l,Y,z)))),l=l.return}b.length!==0&&e.push({event:t,listeners:b})}var nS=/\r\n?/g,sS=/\u0000|\uFFFD/g;function qg(e){return(typeof e=="string"?e:""+e).replace(nS,`
|
|
9
|
-
`).replace(sS,"")}function Mg(e,t){return t=qg(t),qg(e)===t}function Je(e,t,l,i,u,h){switch(l){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ha(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ha(e,""+i);break;case"className":Xr(e,"class",i);break;case"tabIndex":Xr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Xr(e,l,i);break;case"style":qh(e,i,h);break;case"data":if(t!=="object"){Xr(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=Jr(""+i),e.setAttribute(l,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(l,"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 h=="function"&&(l==="formAction"?(t!=="input"&&Je(e,t,"name",u.name,u,null),Je(e,t,"formEncType",u.formEncType,u,null),Je(e,t,"formMethod",u.formMethod,u,null),Je(e,t,"formTarget",u.formTarget,u,null)):(Je(e,t,"encType",u.encType,u,null),Je(e,t,"method",u.method,u,null),Je(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=Jr(""+i),e.setAttribute(l,i);break;case"onClick":i!=null&&(e.onclick=is);break;case"onScroll":i!=null&&Le("scroll",e);break;case"onScrollEnd":i!=null&&Le("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(l=i.__html,l!=null){if(u.children!=null)throw Error(o(60));e.innerHTML=l}}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}l=Jr(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);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(l,""+i):e.removeAttribute(l);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(l,""):e.removeAttribute(l);break;case"capture":case"download":i===!0?e.setAttribute(l,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,i):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(l,i):e.removeAttribute(l);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(l):e.setAttribute(l,i);break;case"popover":Le("beforetoggle",e),Le("toggle",e),Kr(e,"popover",i);break;case"xlinkActuate":rs(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":rs(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":rs(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":rs(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":rs(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":rs(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":rs(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":rs(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":rs(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Kr(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Rv.get(l)||l,Kr(e,l,i))}}function Ou(e,t,l,i,u,h){switch(l){case"style":qh(e,i,h);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(l=i.__html,l!=null){if(u.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof i=="string"?Ha(e,i):(typeof i=="number"||typeof i=="bigint")&&Ha(e,""+i);break;case"onScroll":i!=null&&Le("scroll",e);break;case"onScrollEnd":i!=null&&Le("scrollend",e);break;case"onClick":i!=null&&(e.onclick=is);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kh.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(u=l.endsWith("Capture"),t=l.slice(2,u?l.length-7:void 0),h=e[Yt]||null,h=h!=null?h[l]:null,typeof h=="function"&&e.removeEventListener(t,h,u),typeof i=="function")){typeof h!="function"&&h!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,i,u);break e}l in e?e[l]=i:i===!0?e.setAttribute(l,""):Kr(e,l,i)}}}function Dt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var i=!1,u=!1,h;for(h in l)if(l.hasOwnProperty(h)){var b=l[h];if(b!=null)switch(h){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,h,b,l,null)}}u&&Je(e,t,"srcSet",l.srcSet,l,null),i&&Je(e,t,"src",l.src,l,null);return;case"input":Le("invalid",e);var C=h=b=u=null,z=null,Y=null;for(i in l)if(l.hasOwnProperty(i)){var Z=l[i];if(Z!=null)switch(i){case"name":u=Z;break;case"type":b=Z;break;case"checked":z=Z;break;case"defaultChecked":Y=Z;break;case"value":h=Z;break;case"defaultValue":C=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(o(137,t));break;default:Je(e,t,i,Z,l,null)}}zh(e,h,C,z,Y,b,u,!1);return;case"select":Le("invalid",e),i=b=h=null;for(u in l)if(l.hasOwnProperty(u)&&(C=l[u],C!=null))switch(u){case"value":h=C;break;case"defaultValue":b=C;break;case"multiple":i=C;default:Je(e,t,u,C,l,null)}t=h,l=b,e.multiple=!!i,t!=null?Ia(e,!!i,t,!1):l!=null&&Ia(e,!!i,l,!0);return;case"textarea":Le("invalid",e),h=u=i=null;for(b in l)if(l.hasOwnProperty(b)&&(C=l[b],C!=null))switch(b){case"value":i=C;break;case"defaultValue":u=C;break;case"children":h=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(o(91));break;default:Je(e,t,b,C,l,null)}Oh(e,i,u,h);return;case"option":for(z in l)if(l.hasOwnProperty(z)&&(i=l[z],i!=null))switch(z){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Je(e,t,z,i,l,null)}return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(i=0;i<pr.length;i++)Le(pr[i],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("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(Y in l)if(l.hasOwnProperty(Y)&&(i=l[Y],i!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,Y,i,l,null)}return;default:if(Qo(t)){for(Z in l)l.hasOwnProperty(Z)&&(i=l[Z],i!==void 0&&Ou(e,t,Z,i,l,void 0));return}}for(C in l)l.hasOwnProperty(C)&&(i=l[C],i!=null&&Je(e,t,C,i,l,null))}function aS(e,t,l,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,b=null,C=null,z=null,Y=null,Z=null;for(Q in l){var te=l[Q];if(l.hasOwnProperty(Q)&&te!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":z=te;default:i.hasOwnProperty(Q)||Je(e,t,Q,null,i,te)}}for(var F in i){var Q=i[F];if(te=l[F],i.hasOwnProperty(F)&&(Q!=null||te!=null))switch(F){case"type":h=Q;break;case"name":u=Q;break;case"checked":Y=Q;break;case"defaultChecked":Z=Q;break;case"value":b=Q;break;case"defaultValue":C=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(o(137,t));break;default:Q!==te&&Je(e,t,F,Q,i,te)}}Yo(e,b,C,z,Y,Z,h,u);return;case"select":Q=b=C=F=null;for(h in l)if(z=l[h],l.hasOwnProperty(h)&&z!=null)switch(h){case"value":break;case"multiple":Q=z;default:i.hasOwnProperty(h)||Je(e,t,h,null,i,z)}for(u in i)if(h=i[u],z=l[u],i.hasOwnProperty(u)&&(h!=null||z!=null))switch(u){case"value":F=h;break;case"defaultValue":C=h;break;case"multiple":b=h;default:h!==z&&Je(e,t,u,h,i,z)}t=C,l=b,i=Q,F!=null?Ia(e,!!l,F,!1):!!i!=!!l&&(t!=null?Ia(e,!!l,t,!0):Ia(e,!!l,l?[]:"",!1));return;case"textarea":Q=F=null;for(C in l)if(u=l[C],l.hasOwnProperty(C)&&u!=null&&!i.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Je(e,t,C,null,i,u)}for(b in i)if(u=i[b],h=l[b],i.hasOwnProperty(b)&&(u!=null||h!=null))switch(b){case"value":F=u;break;case"defaultValue":Q=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(o(91));break;default:u!==h&&Je(e,t,b,u,i,h)}Dh(e,F,Q);return;case"option":for(var ye in l)if(F=l[ye],l.hasOwnProperty(ye)&&F!=null&&!i.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:Je(e,t,ye,null,i,F)}for(z in i)if(F=i[z],Q=l[z],i.hasOwnProperty(z)&&F!==Q&&(F!=null||Q!=null))switch(z){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Je(e,t,z,F,i,Q)}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 je in l)F=l[je],l.hasOwnProperty(je)&&F!=null&&!i.hasOwnProperty(je)&&Je(e,t,je,null,i,F);for(Y in i)if(F=i[Y],Q=l[Y],i.hasOwnProperty(Y)&&F!==Q&&(F!=null||Q!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(o(137,t));break;default:Je(e,t,Y,F,i,Q)}return;default:if(Qo(t)){for(var We in l)F=l[We],l.hasOwnProperty(We)&&F!==void 0&&!i.hasOwnProperty(We)&&Ou(e,t,We,void 0,i,F);for(Z in i)F=i[Z],Q=l[Z],!i.hasOwnProperty(Z)||F===Q||F===void 0&&Q===void 0||Ou(e,t,Z,F,i,Q);return}}for(var I in l)F=l[I],l.hasOwnProperty(I)&&F!=null&&!i.hasOwnProperty(I)&&Je(e,t,I,null,i,F);for(te in i)F=i[te],Q=l[te],!i.hasOwnProperty(te)||F===Q||F==null&&Q==null||Je(e,t,te,F,i,Q)}function Bg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),i=0;i<l.length;i++){var u=l[i],h=u.transferSize,b=u.initiatorType,C=u.duration;if(h&&C&&Bg(b)){for(b=0,C=u.responseEnd,i+=1;i<l.length;i++){var z=l[i],Y=z.startTime;if(Y>C)break;var Z=z.transferSize,te=z.initiatorType;Z&&Bg(te)&&(z=z.responseEnd,b+=Z*(z<C?1:(C-Y)/(z-Y)))}if(--i,t+=8*(h+b)/(u.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 Lu=null,qu=null;function Fi(e){return e.nodeType===9?e:e.ownerDocument}function Ug(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 Ig(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 Mu(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 Bu=null;function rS(){var e=window.event;return e&&e.type==="popstate"?e===Bu?!1:(Bu=e,!0):(Bu=null,!1)}var Hg=typeof setTimeout=="function"?setTimeout:void 0,iS=typeof clearTimeout=="function"?clearTimeout:void 0,$g=typeof Promise=="function"?Promise:void 0,oS=typeof queueMicrotask=="function"?queueMicrotask:typeof $g<"u"?function(e){return $g.resolve(null).then(e).catch(cS)}:Hg;function cS(e){setTimeout(function(){throw e})}function Zs(e){return e==="head"}function Gg(e,t){var l=t,i=0;do{var u=l.nextSibling;if(e.removeChild(l),u&&u.nodeType===8)if(l=u.data,l==="/$"||l==="/&"){if(i===0){e.removeChild(u),xl(t);return}i--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")i++;else if(l==="html")mr(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,mr(l);for(var h=l.firstChild;h;){var b=h.nextSibling,C=h.nodeName;h[Ol]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=b}}else l==="body"&&mr(e.ownerDocument.body);l=u}while(l);xl(t)}function Pg(e,t){var l=e;e=0;do{var i=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),i&&i.nodeType===8)if(l=i.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=i}while(l)}function Uu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Uu(l),Po(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function uS(e,t,l,i){for(;e.nodeType===1;){var u=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Ol])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Tn(e.nextSibling),e===null)break}return null}function dS(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Tn(e.nextSibling),e===null))return null;return e}function Vg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Tn(e.nextSibling),e===null))return null;return e}function Iu(e){return e.data==="$?"||e.data==="$~"}function Hu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function hS(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var i=function(){t(),l.removeEventListener("DOMContentLoaded",i)};l.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Tn(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 $u=null;function Yg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Tn(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Fg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Qg(e,t,l){switch(t=Fi(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function mr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Po(e)}var jn=new Map,Kg=new Set;function Qi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ts=ne.d;ne.d={f:fS,r:pS,D:gS,C:mS,L:yS,m:xS,X:bS,S:vS,M:SS};function fS(){var e=Ts.f(),t=Ui();return e||t}function pS(e){var t=Ma(e);t!==null&&t.tag===5&&t.type==="form"?hp(t):Ts.r(e)}var gl=typeof document>"u"?null:document;function Xg(e,t,l){var i=gl;if(i&&typeof t=="string"&&t){var u=mn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof l=="string"&&(u+='[crossorigin="'+l+'"]'),Kg.has(u)||(Kg.add(u),e={rel:e,crossOrigin:l,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),Dt(t,"link",e),wt(t),i.head.appendChild(t)))}}function gS(e){Ts.D(e),Xg("dns-prefetch",e,null)}function mS(e,t){Ts.C(e,t),Xg("preconnect",e,t)}function yS(e,t,l){Ts.L(e,t,l);var i=gl;if(i&&e&&t){var u='link[rel="preload"][as="'+mn(t)+'"]';t==="image"&&l&&l.imageSrcSet?(u+='[imagesrcset="'+mn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(u+='[imagesizes="'+mn(l.imageSizes)+'"]')):u+='[href="'+mn(e)+'"]';var h=u;switch(t){case"style":h=ml(e);break;case"script":h=yl(e)}jn.has(h)||(e=_({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),jn.set(h,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(yr(h))||t==="script"&&i.querySelector(xr(h))||(t=i.createElement("link"),Dt(t,"link",e),wt(t),i.head.appendChild(t)))}}function xS(e,t){Ts.m(e,t);var l=gl;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+mn(i)+'"][href="'+mn(e)+'"]',h=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=yl(e)}if(!jn.has(h)&&(e=_({rel:"modulepreload",href:e},t),jn.set(h,e),l.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(xr(h)))return}i=l.createElement("link"),Dt(i,"link",e),wt(i),l.head.appendChild(i)}}}function vS(e,t,l){Ts.S(e,t,l);var i=gl;if(i&&e){var u=Ba(i).hoistableStyles,h=ml(e);t=t||"default";var b=u.get(h);if(!b){var C={loading:0,preload:null};if(b=i.querySelector(yr(h)))C.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":t},l),(l=jn.get(h))&&Gu(e,l);var z=b=i.createElement("link");wt(z),Dt(z,"link",e),z._p=new Promise(function(Y,Z){z.onload=Y,z.onerror=Z}),z.addEventListener("load",function(){C.loading|=1}),z.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Ki(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:C},u.set(h,b)}}}function bS(e,t){Ts.X(e,t);var l=gl;if(l&&e){var i=Ba(l).hoistableScripts,u=yl(e),h=i.get(u);h||(h=l.querySelector(xr(u)),h||(e=_({src:e,async:!0},t),(t=jn.get(u))&&Pu(e,t),h=l.createElement("script"),wt(h),Dt(h,"link",e),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(u,h))}}function SS(e,t){Ts.M(e,t);var l=gl;if(l&&e){var i=Ba(l).hoistableScripts,u=yl(e),h=i.get(u);h||(h=l.querySelector(xr(u)),h||(e=_({src:e,async:!0,type:"module"},t),(t=jn.get(u))&&Pu(e,t),h=l.createElement("script"),wt(h),Dt(h,"link",e),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(u,h))}}function Zg(e,t,l,i){var u=(u=de.current)?Qi(u):null;if(!u)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=ml(l.href),l=Ba(u).hoistableStyles,i=l.get(t),i||(i={type:"style",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=ml(l.href);var h=Ba(u).hoistableStyles,b=h.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,b),(h=u.querySelector(yr(e)))&&!h._p&&(b.instance=h,b.state.loading=5),jn.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},jn.set(e,l),h||_S(u,e,l,b.state))),t&&i===null)throw Error(o(528,""));return b}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=yl(l),l=Ba(u).hoistableScripts,i=l.get(t),i||(i={type:"script",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ml(e){return'href="'+mn(e)+'"'}function yr(e){return'link[rel="stylesheet"]['+e+"]"}function Jg(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function _S(e,t,l,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",l),wt(t),e.head.appendChild(t))}function yl(e){return'[src="'+mn(e)+'"]'}function xr(e){return"script[async]"+e}function Wg(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+mn(l.href)+'"]');if(i)return t.instance=i,wt(i),i;var u=_({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),wt(i),Dt(i,"style",u),Ki(i,l.precedence,e),t.instance=i;case"stylesheet":u=ml(l.href);var h=e.querySelector(yr(u));if(h)return t.state.loading|=4,t.instance=h,wt(h),h;i=Jg(l),(u=jn.get(u))&&Gu(i,u),h=(e.ownerDocument||e).createElement("link"),wt(h);var b=h;return b._p=new Promise(function(C,z){b.onload=C,b.onerror=z}),Dt(h,"link",i),t.state.loading|=4,Ki(h,l.precedence,e),t.instance=h;case"script":return h=yl(l.src),(u=e.querySelector(xr(h)))?(t.instance=u,wt(u),u):(i=l,(u=jn.get(h))&&(i=_({},l),Pu(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),wt(u),Dt(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Ki(i,l.precedence,e));return t.instance}function Ki(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,h=u,b=0;b<i.length;b++){var C=i[b];if(C.dataset.precedence===t)h=C;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Gu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Pu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xi=null;function em(e,t,l){if(Xi===null){var i=new Map,u=Xi=new Map;u.set(l,i)}else u=Xi,i=u.get(l),i||(i=new Map,u.set(l,i));if(i.has(e))return i;for(i.set(e,null),l=l.getElementsByTagName(e),u=0;u<l.length;u++){var h=l[u];if(!(h[Ol]||h[Nt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var b=h.getAttribute(t)||"";b=e+b;var C=i.get(b);C?C.push(h):i.set(b,[h])}}return i}function tm(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function TS(e,t,l){if(l===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 nm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function jS(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var u=ml(i.href),h=t.querySelector(yr(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Zi.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=h,wt(h);return}h=t.ownerDocument||t,i=Jg(i),(u=jn.get(u))&&Gu(i,u),h=h.createElement("link"),wt(h);var b=h;b._p=new Promise(function(C,z){b.onload=C,b.onerror=z}),Dt(h,"link",i),l.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Zi.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Vu=0;function wS(e,t){return e.stylesheets&&e.count===0&&Wi(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var i=setTimeout(function(){if(e.stylesheets&&Wi(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Vu===0&&(Vu=62500*lS());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Wi(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Vu?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Zi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ji=null;function Wi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ji=new Map,t.forEach(ES,e),Ji=null,Zi.call(e))}function ES(e,t){if(!(t.state.loading&4)){var l=Ji.get(e);if(l)var i=l.get(null);else{l=new Map,Ji.set(e,l);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var b=u[h];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),i=b)}i&&l.set(null,i)}u=t.instance,b=u.getAttribute("data-precedence"),h=l.get(b)||i,h===i&&l.set(null,u),l.set(b,u),this.count++,i=Zi.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var vr={$$typeof:O,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function kS(e,t,l,i,u,h,b,C,z){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=Vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.hiddenUpdates=Vt(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function sm(e,t,l,i,u,h,b,C,z,Y,Z,te){return e=new kS(e,t,l,b,z,Y,Z,te,C),t=1,h===!0&&(t|=24),h=sn(3,null,null,t),e.current=h,h.stateNode=e,t=jc(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:i,isDehydrated:l,cache:t},Cc(h),e}function am(e){return e?(e=Qa,e):Qa}function lm(e,t,l,i,u,h){u=am(u),i.context===null?i.context=u:i.pendingContext=u,i=Is(t),i.payload={element:l},h=h===void 0?null:h,h!==null&&(i.callback=h),l=Hs(e,i,t),l!==null&&(Jt(l,e,t),Zl(l,e,t))}function rm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Yu(e,t){rm(e,t),(e=e.alternate)&&rm(e,t)}function im(e){if(e.tag===13||e.tag===31){var t=da(e,67108864);t!==null&&Jt(t,e,67108864),Yu(e,67108864)}}function om(e){if(e.tag===13||e.tag===31){var t=cn();t=Ho(t);var l=da(e,t);l!==null&&Jt(l,e,t),Yu(e,t)}}var eo=!0;function CS(e,t,l,i){var u=M.T;M.T=null;var h=ne.p;try{ne.p=2,Fu(e,t,l,i)}finally{ne.p=h,M.T=u}}function NS(e,t,l,i){var u=M.T;M.T=null;var h=ne.p;try{ne.p=8,Fu(e,t,l,i)}finally{ne.p=h,M.T=u}}function Fu(e,t,l,i){if(eo){var u=Qu(i);if(u===null)Du(e,t,i,to,l),um(e,i);else if(RS(u,e,t,l,i))i.stopPropagation();else if(um(e,i),t&4&&-1<AS.indexOf(e)){for(;u!==null;){var h=Ma(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var b=pn(h.pendingLanes);if(b!==0){var C=h;for(C.pendingLanes|=2,C.entangledLanes|=2;b;){var z=1<<31-He(b);C.entanglements[1]|=z,b&=~z}Kn(h),(Fe&6)===0&&(Mi=_t()+500,fr(0))}}break;case 31:case 13:C=da(h,2),C!==null&&Jt(C,h,2),Ui(),Yu(h,2)}if(h=Qu(i),h===null&&Du(e,t,i,to,l),h===u)break;u=h}u!==null&&i.stopPropagation()}else Du(e,t,i,null,l)}}function Qu(e){return e=Xo(e),Ku(e)}var to=null;function Ku(e){if(to=null,e=qa(e),e!==null){var t=d(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=f(t),e!==null)return e;e=null}else if(l===31){if(e=y(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return to=e,null}function cm(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(Cs()){case Ns:return 2;case Oa:return 8;case As:case Rl:return 32;case hn:return 268435456;default:return 32}default:return 32}}var Xu=!1,Js=null,Ws=null,ea=null,br=new Map,Sr=new Map,ta=[],AS="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 um(e,t){switch(e){case"focusin":case"focusout":Js=null;break;case"dragenter":case"dragleave":Ws=null;break;case"mouseover":case"mouseout":ea=null;break;case"pointerover":case"pointerout":br.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sr.delete(t.pointerId)}}function _r(e,t,l,i,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:l,eventSystemFlags:i,nativeEvent:h,targetContainers:[u]},t!==null&&(t=Ma(t),t!==null&&im(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function RS(e,t,l,i,u){switch(t){case"focusin":return Js=_r(Js,e,t,l,i,u),!0;case"dragenter":return Ws=_r(Ws,e,t,l,i,u),!0;case"mouseover":return ea=_r(ea,e,t,l,i,u),!0;case"pointerover":var h=u.pointerId;return br.set(h,_r(br.get(h)||null,e,t,l,i,u)),!0;case"gotpointercapture":return h=u.pointerId,Sr.set(h,_r(Sr.get(h)||null,e,t,l,i,u)),!0}return!1}function dm(e){var t=qa(e.target);if(t!==null){var l=d(t);if(l!==null){if(t=l.tag,t===13){if(t=f(l),t!==null){e.blockedOn=t,jh(e.priority,function(){om(l)});return}}else if(t===31){if(t=y(l),t!==null){e.blockedOn=t,jh(e.priority,function(){om(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function no(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Qu(e.nativeEvent);if(l===null){l=e.nativeEvent;var i=new l.constructor(l.type,l);Ko=i,l.target.dispatchEvent(i),Ko=null}else return t=Ma(l),t!==null&&im(t),e.blockedOn=l,!1;t.shift()}return!0}function hm(e,t,l){no(e)&&l.delete(t)}function zS(){Xu=!1,Js!==null&&no(Js)&&(Js=null),Ws!==null&&no(Ws)&&(Ws=null),ea!==null&&no(ea)&&(ea=null),br.forEach(hm),Sr.forEach(hm)}function so(e,t){e.blockedOn===t&&(e.blockedOn=null,Xu||(Xu=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,zS)))}var ao=null;function fm(e){ao!==e&&(ao=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){ao===e&&(ao=null);for(var t=0;t<e.length;t+=3){var l=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(Ku(i||l)===null)continue;break}var h=Ma(l);h!==null&&(e.splice(t,3),t-=3,Qc(h,{pending:!0,data:u,method:l.method,action:i},i,u))}}))}function xl(e){function t(z){return so(z,e)}Js!==null&&so(Js,e),Ws!==null&&so(Ws,e),ea!==null&&so(ea,e),br.forEach(t),Sr.forEach(t);for(var l=0;l<ta.length;l++){var i=ta[l];i.blockedOn===e&&(i.blockedOn=null)}for(;0<ta.length&&(l=ta[0],l.blockedOn===null);)dm(l),l.blockedOn===null&&ta.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var u=l[i],h=l[i+1],b=u[Yt]||null;if(typeof h=="function")b||fm(l);else if(b){var C=null;if(h&&h.hasAttribute("formAction")){if(u=h,b=h[Yt]||null)C=b.formAction;else if(Ku(u)!==null)continue}else C=b.action;typeof C=="function"?l[i+1]=C:(l.splice(i,3),i-=3),fm(l)}}}function pm(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(l,20)}function l(){if(!i&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Zu(e){this._internalRoot=e}lo.prototype.render=Zu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,i=cn();lm(l,i,e,t,null,null)},lo.prototype.unmount=Zu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lm(e.current,2,null,e,null,null),Ui(),t[La]=null}};function lo(e){this._internalRoot=e}lo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Th();e={blockedOn:null,target:e,priority:t};for(var l=0;l<ta.length&&t!==0&&t<ta[l].priority;l++);ta.splice(l,0,e),l===0&&dm(e)}};var gm=n.version;if(gm!=="19.2.5")throw Error(o(527,gm,"19.2.5"));ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=m(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var DS={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ro=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ro.isDisabled&&ro.supportsFiber)try{oe=ro.inject(DS),he=ro}catch{}}return jr.createRoot=function(e,t){if(!c(e))throw Error(o(299));var l=!1,i="",u=_p,h=Tp,b=jp;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=sm(e,1,!1,null,null,l,i,null,u,h,b,pm),e[La]=t.current,zu(e),new Zu(t)},jr.hydrateRoot=function(e,t,l){if(!c(e))throw Error(o(299));var i=!1,u="",h=_p,b=Tp,C=jp,z=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(u=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(C=l.onRecoverableError),l.formState!==void 0&&(z=l.formState)),t=sm(e,1,!0,t,l??null,i,u,z,h,b,C,pm),t.context=am(null),l=t.current,i=cn(),i=Ho(i),u=Is(i),u.callback=null,Hs(l,u,i),l=i,t.current.lanes=l,Dl(t,l),Kn(t),e[La]=t.current,zu(e),new lo(t)},jr.version="19.2.5",jr}var wm;function PS(){if(wm)return ed.exports;wm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),ed.exports=GS(),ed.exports}var VS=PS();const YS=Xy(VS);var Em="popstate";function km(s){return typeof s=="object"&&s!=null&&"pathname"in s&&"search"in s&&"hash"in s&&"state"in s&&"key"in s}function FS(s={}){function n(o,c){let d=c.state?.masked,{pathname:f,search:y,hash:g}=d||o.location;return kd("",{pathname:f,search:y,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function r(o,c){return typeof c=="string"?c:Ir(c)}return KS(n,r,null,s)}function it(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function Nn(s,n){if(!s){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function QS(){return Math.random().toString(36).substring(2,10)}function Cm(s,n){return{usr:s.state,key:s.key,idx:n,masked:s.unstable_mask?{pathname:s.pathname,search:s.search,hash:s.hash}:void 0}}function kd(s,n,r=null,o,c){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof n=="string"?wl(n):n,state:r,key:n&&n.key||o||QS(),unstable_mask:c}}function Ir({pathname:s="/",search:n="",hash:r=""}){return n&&n!=="?"&&(s+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(s+=r.charAt(0)==="#"?r:"#"+r),s}function wl(s){let n={};if(s){let r=s.indexOf("#");r>=0&&(n.hash=s.substring(r),s=s.substring(0,r));let o=s.indexOf("?");o>=0&&(n.search=s.substring(o),s=s.substring(0,o)),s&&(n.pathname=s)}return n}function KS(s,n,r,o={}){let{window:c=document.defaultView,v5Compat:d=!1}=o,f=c.history,y="POP",g=null,m=x();m==null&&(m=0,f.replaceState({...f.state,idx:m},""));function x(){return(f.state||{idx:null}).idx}function _(){y="POP";let k=x(),w=k==null?null:k-m;m=k,g&&g({action:y,location:j.location,delta:w})}function v(k,w){y="PUSH";let N=km(k)?k:kd(j.location,k,w);m=x()+1;let O=Cm(N,m),G=j.createHref(N.unstable_mask||N);try{f.pushState(O,"",G)}catch(q){if(q instanceof DOMException&&q.name==="DataCloneError")throw q;c.location.assign(G)}d&&g&&g({action:y,location:j.location,delta:1})}function T(k,w){y="REPLACE";let N=km(k)?k:kd(j.location,k,w);m=x();let O=Cm(N,m),G=j.createHref(N.unstable_mask||N);f.replaceState(O,"",G),d&&g&&g({action:y,location:j.location,delta:0})}function E(k){return XS(k)}let j={get action(){return y},get location(){return s(c,f)},listen(k){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Em,_),g=k,()=>{c.removeEventListener(Em,_),g=null}},createHref(k){return n(c,k)},createURL:E,encodeLocation(k){let w=E(k);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:v,replace:T,go(k){return f.go(k)}};return j}function XS(s,n=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),it(r,"No window.location.(origin|href) available to create URL");let o=typeof s=="string"?s:Ir(s);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=r+o),new URL(o,r)}function Zy(s,n,r="/"){return ZS(s,n,r,!1)}function ZS(s,n,r,o){let c=typeof n=="string"?wl(n):n,d=Es(c.pathname||"/",r);if(d==null)return null;let f=Jy(s);JS(f);let y=null;for(let g=0;y==null&&g<f.length;++g){let m=c_(d);y=i_(f[g],m,o)}return y}function Jy(s,n=[],r=[],o="",c=!1){let d=(f,y,g=c,m)=>{let x={relativePath:m===void 0?f.path||"":m,caseSensitive:f.caseSensitive===!0,childrenIndex:y,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(o)&&g)return;it(x.relativePath.startsWith(o),`Absolute route path "${x.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(o.length)}let _=Jn([o,x.relativePath]),v=r.concat(x);f.children&&f.children.length>0&&(it(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${_}".`),Jy(f.children,n,v,_,g)),!(f.path==null&&!f.index)&&n.push({path:_,score:l_(_,f.index),routesMeta:v})};return s.forEach((f,y)=>{if(f.path===""||!f.path?.includes("?"))d(f,y);else for(let g of Wy(f.path))d(f,y,!0,g)}),n}function Wy(s){let n=s.split("/");if(n.length===0)return[];let[r,...o]=n,c=r.endsWith("?"),d=r.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let f=Wy(o.join("/")),y=[];return y.push(...f.map(g=>g===""?d:[d,g].join("/"))),c&&y.push(...f),y.map(g=>s.startsWith("/")&&g===""?"/":g)}function JS(s){s.sort((n,r)=>n.score!==r.score?r.score-n.score:r_(n.routesMeta.map(o=>o.childrenIndex),r.routesMeta.map(o=>o.childrenIndex)))}var WS=/^:[\w-]+$/,e_=3,t_=2,n_=1,s_=10,a_=-2,Nm=s=>s==="*";function l_(s,n){let r=s.split("/"),o=r.length;return r.some(Nm)&&(o+=a_),n&&(o+=t_),r.filter(c=>!Nm(c)).reduce((c,d)=>c+(WS.test(d)?e_:d===""?n_:s_),o)}function r_(s,n){return s.length===n.length&&s.slice(0,-1).every((o,c)=>o===n[c])?s[s.length-1]-n[n.length-1]:0}function i_(s,n,r=!1){let{routesMeta:o}=s,c={},d="/",f=[];for(let y=0;y<o.length;++y){let g=o[y],m=y===o.length-1,x=d==="/"?n:n.slice(d.length)||"/",_=wo({path:g.relativePath,caseSensitive:g.caseSensitive,end:m},x),v=g.route;if(!_&&m&&r&&!o[o.length-1].route.index&&(_=wo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!_)return null;Object.assign(c,_.params),f.push({params:c,pathname:Jn([d,_.pathname]),pathnameBase:f_(Jn([d,_.pathnameBase])),route:v}),_.pathnameBase!=="/"&&(d=Jn([d,_.pathnameBase]))}return f}function wo(s,n){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[r,o]=o_(s.path,s.caseSensitive,s.end),c=n.match(r);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),y=c.slice(1);return{params:o.reduce((m,{paramName:x,isOptional:_},v)=>{if(x==="*"){let E=y[v]||"";f=d.slice(0,d.length-E.length).replace(/(.)\/+$/,"$1")}const T=y[v];return _&&!T?m[x]=void 0:m[x]=(T||"").replace(/%2F/g,"/"),m},{}),pathname:d,pathnameBase:f,pattern:s}}function o_(s,n=!1,r=!0){Nn(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let o=[],c="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,y,g,m,x)=>{if(o.push({paramName:y,isOptional:g!=null}),g){let _=x.charAt(m+f.length);return _&&_!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(o.push({paramName:"*"}),c+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?c+="\\/*$":s!==""&&s!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,n?void 0:"i"),o]}function c_(s){try{return s.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Nn(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),s}}function Es(s,n){if(n==="/")return s;if(!s.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,o=s.charAt(r);return o&&o!=="/"?null:s.slice(r)||"/"}var u_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function d_(s,n="/"){let{pathname:r,search:o="",hash:c=""}=typeof s=="string"?wl(s):s,d;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?d=Am(r.substring(1),"/"):d=Am(r,n)):d=n,{pathname:d,search:p_(o),hash:g_(c)}}function Am(s,n){let r=n.replace(/\/+$/,"").split("/");return s.split("/").forEach(c=>{c===".."?r.length>1&&r.pop():c!=="."&&r.push(c)}),r.length>1?r.join("/"):"/"}function ad(s,n,r,o){return`Cannot include a '${s}' character in a manually specified \`to.${n}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function h_(s){return s.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Gd(s){let n=h_(s);return n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase)}function Do(s,n,r,o=!1){let c;typeof s=="string"?c=wl(s):(c={...s},it(!c.pathname||!c.pathname.includes("?"),ad("?","pathname","search",c)),it(!c.pathname||!c.pathname.includes("#"),ad("#","pathname","hash",c)),it(!c.search||!c.search.includes("#"),ad("#","search","hash",c)));let d=s===""||c.pathname==="",f=d?"/":c.pathname,y;if(f==null)y=r;else{let _=n.length-1;if(!o&&f.startsWith("..")){let v=f.split("/");for(;v[0]==="..";)v.shift(),_-=1;c.pathname=v.join("/")}y=_>=0?n[_]:"/"}let g=d_(c,y),m=f&&f!=="/"&&f.endsWith("/"),x=(d||f===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(m||x)&&(g.pathname+="/"),g}var Jn=s=>s.join("/").replace(/\/\/+/g,"/"),f_=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),p_=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,g_=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,m_=class{constructor(s,n,r,o=!1){this.status=s,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function y_(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function x_(s){return s.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ex=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function tx(s,n){let r=s;if(typeof r!="string"||!u_.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let o=r,c=!1;if(ex)try{let d=new URL(window.location.href),f=r.startsWith("//")?new URL(d.protocol+r):new URL(r),y=Es(f.pathname,n);f.origin===d.origin&&y!=null?r=y+f.search+f.hash:c=!0}catch{Nn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var nx=["POST","PUT","PATCH","DELETE"];new Set(nx);var v_=["GET",...nx];new Set(v_);var El=p.createContext(null);El.displayName="DataRouter";var Oo=p.createContext(null);Oo.displayName="DataRouterState";var sx=p.createContext(!1);function b_(){return p.useContext(sx)}var ax=p.createContext({isTransitioning:!1});ax.displayName="ViewTransition";var S_=p.createContext(new Map);S_.displayName="Fetchers";var __=p.createContext(null);__.displayName="Await";var dn=p.createContext(null);dn.displayName="Navigation";var Hr=p.createContext(null);Hr.displayName="Location";var Rn=p.createContext({outlet:null,matches:[],isDataRoute:!1});Rn.displayName="Route";var Pd=p.createContext(null);Pd.displayName="RouteError";var lx="REACT_ROUTER_ERROR",T_="REDIRECT",j_="ROUTE_ERROR_RESPONSE";function w_(s){if(s.startsWith(`${lx}:${T_}:{`))try{let n=JSON.parse(s.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function E_(s){if(s.startsWith(`${lx}:${j_}:{`))try{let n=JSON.parse(s.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new m_(n.status,n.statusText,n.data)}catch{}}function k_(s,{relative:n}={}){it(kl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=p.useContext(dn),{hash:c,pathname:d,search:f}=$r(s,{relative:n}),y=d;return r!=="/"&&(y=d==="/"?r:Jn([r,d])),o.createHref({pathname:y,search:f,hash:c})}function kl(){return p.useContext(Hr)!=null}function Lt(){return it(kl(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Hr).location}var rx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ix(s){p.useContext(dn).static||p.useLayoutEffect(s)}function ze(){let{isDataRoute:s}=p.useContext(Rn);return s?$_():C_()}function C_(){it(kl(),"useNavigate() may be used only in the context of a <Router> component.");let s=p.useContext(El),{basename:n,navigator:r}=p.useContext(dn),{matches:o}=p.useContext(Rn),{pathname:c}=Lt(),d=JSON.stringify(Gd(o)),f=p.useRef(!1);return ix(()=>{f.current=!0}),p.useCallback((g,m={})=>{if(Nn(f.current,rx),!f.current)return;if(typeof g=="number"){r.go(g);return}let x=Do(g,JSON.parse(d),c,m.relative==="path");s==null&&n!=="/"&&(x.pathname=x.pathname==="/"?n:Jn([n,x.pathname])),(m.replace?r.replace:r.push)(x,m.state,m)},[n,r,d,c,s])}var N_=p.createContext(null);function A_(s){let n=p.useContext(Rn).outlet;return p.useMemo(()=>n&&p.createElement(N_.Provider,{value:s},n),[n,s])}function Wt(){let{matches:s}=p.useContext(Rn),n=s[s.length-1];return n?n.params:{}}function $r(s,{relative:n}={}){let{matches:r}=p.useContext(Rn),{pathname:o}=Lt(),c=JSON.stringify(Gd(r));return p.useMemo(()=>Do(s,JSON.parse(c),o,n==="path"),[s,c,o,n])}function R_(s,n){return ox(s,n)}function ox(s,n,r){it(kl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=p.useContext(dn),{matches:c}=p.useContext(Rn),d=c[c.length-1],f=d?d.params:{},y=d?d.pathname:"/",g=d?d.pathnameBase:"/",m=d&&d.route;{let k=m&&m.path||"";ux(y,!m||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${y}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
-
|
|
11
|
-
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let x=Lt(),_;if(n){let k=typeof n=="string"?wl(n):n;it(g==="/"||k.pathname?.startsWith(g),`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 "${g}" but pathname "${k.pathname}" was given in the \`location\` prop.`),_=k}else _=x;let v=_.pathname||"/",T=v;if(g!=="/"){let k=g.replace(/^\//,"").split("/");T="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let E=Zy(s,{pathname:T});Nn(m||E!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),Nn(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 "${_.pathname}${_.search}${_.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 j=q_(E&&E.map(k=>Object.assign({},k,{params:Object.assign({},f,k.params),pathname:Jn([g,o.encodeLocation?o.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?g:Jn([g,o.encodeLocation?o.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,r);return n&&j?p.createElement(Hr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,..._},navigationType:"POP"}},j):j}function z_(){let s=H_(),n=y_(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),r=s instanceof Error?s.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},d={padding:"2px 4px",backgroundColor:o},f=null;return console.error("Error handled by React Router default ErrorBoundary:",s),f=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:d},"ErrorBoundary")," or"," ",p.createElement("code",{style:d},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},n),r?p.createElement("pre",{style:c},r):null,f)}var D_=p.createElement(z_,null),cx=class extends p.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,n){return n.location!==s.location||n.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:n.error,location:n.location,revalidation:s.revalidation||n.revalidation}}componentDidCatch(s,n){this.props.onError?this.props.onError(s,n):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const r=E_(s.digest);r&&(s=r)}let n=s!==void 0?p.createElement(Rn.Provider,{value:this.props.routeContext},p.createElement(Pd.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?p.createElement(O_,{error:s},n):n}};cx.contextType=sx;var ld=new WeakMap;function O_({children:s,error:n}){let{basename:r}=p.useContext(dn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=w_(n.digest);if(o){let c=ld.get(n);if(c)throw c;let d=tx(o.location,r);if(ex&&!ld.get(n))if(d.isExternal||o.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:o.replace}));throw ld.set(n,f),f}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return s}function L_({routeContext:s,match:n,children:r}){let o=p.useContext(El);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Rn.Provider,{value:s},r)}function q_(s,n=[],r){let o=r?.state;if(s==null){if(!o)return null;if(o.errors)s=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)s=o.matches;else return null}let c=s,d=o?.errors;if(d!=null){let x=c.findIndex(_=>_.route.id&&d?.[_.route.id]!==void 0);it(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let f=!1,y=-1;if(r&&o){f=o.renderFallback;for(let x=0;x<c.length;x++){let _=c[x];if((_.route.HydrateFallback||_.route.hydrateFallbackElement)&&(y=x),_.route.id){let{loaderData:v,errors:T}=o,E=_.route.loader&&!v.hasOwnProperty(_.route.id)&&(!T||T[_.route.id]===void 0);if(_.route.lazy||E){r.isStatic&&(f=!0),y>=0?c=c.slice(0,y+1):c=[c[0]];break}}}}let g=r?.onError,m=o&&g?(x,_)=>{g(x,{location:o.location,params:o.matches?.[0]?.params??{},unstable_pattern:x_(o.matches),errorInfo:_})}:void 0;return c.reduceRight((x,_,v)=>{let T,E=!1,j=null,k=null;o&&(T=d&&_.route.id?d[_.route.id]:void 0,j=_.route.errorElement||D_,f&&(y<0&&v===0?(ux("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,k=null):y===v&&(E=!0,k=_.route.hydrateFallbackElement||null)));let w=n.concat(c.slice(0,v+1)),N=()=>{let O;return T?O=j:E?O=k:_.route.Component?O=p.createElement(_.route.Component,null):_.route.element?O=_.route.element:O=x,p.createElement(L_,{match:_,routeContext:{outlet:x,matches:w,isDataRoute:o!=null},children:O})};return o&&(_.route.ErrorBoundary||_.route.errorElement||v===0)?p.createElement(cx,{location:o.location,revalidation:o.revalidation,component:j,error:T,children:N(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:m}):N()},null)}function Vd(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function M_(s){let n=p.useContext(El);return it(n,Vd(s)),n}function B_(s){let n=p.useContext(Oo);return it(n,Vd(s)),n}function U_(s){let n=p.useContext(Rn);return it(n,Vd(s)),n}function Yd(s){let n=U_(s),r=n.matches[n.matches.length-1];return it(r.route.id,`${s} can only be used on routes that contain a unique "id"`),r.route.id}function I_(){return Yd("useRouteId")}function H_(){let s=p.useContext(Pd),n=B_("useRouteError"),r=Yd("useRouteError");return s!==void 0?s:n.errors?.[r]}function $_(){let{router:s}=M_("useNavigate"),n=Yd("useNavigate"),r=p.useRef(!1);return ix(()=>{r.current=!0}),p.useCallback(async(c,d={})=>{Nn(r.current,rx),r.current&&(typeof c=="number"?await s.navigate(c):await s.navigate(c,{fromRouteId:n,...d}))},[s,n])}var Rm={};function ux(s,n,r){!n&&!Rm[s]&&(Rm[s]=!0,Nn(!1,r))}p.memo(G_);function G_({routes:s,future:n,state:r,isStatic:o,onError:c}){return ox(s,void 0,{state:r,isStatic:o,onError:c})}function Ca({to:s,replace:n,state:r,relative:o}){it(kl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=p.useContext(dn);Nn(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=p.useContext(Rn),{pathname:f}=Lt(),y=ze(),g=Do(s,Gd(d),f,o==="path"),m=JSON.stringify(g);return p.useEffect(()=>{y(JSON.parse(m),{replace:n,state:r,relative:o})},[y,m,o,n,r]),null}function Ot(s){return A_(s.context)}function xe(s){it(!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 P_({basename:s="/",children:n=null,location:r,navigationType:o="POP",navigator:c,static:d=!1,unstable_useTransitions:f}){it(!kl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let y=s.replace(/^\/*/,"/"),g=p.useMemo(()=>({basename:y,navigator:c,static:d,unstable_useTransitions:f,future:{}}),[y,c,d,f]);typeof r=="string"&&(r=wl(r));let{pathname:m="/",search:x="",hash:_="",state:v=null,key:T="default",unstable_mask:E}=r,j=p.useMemo(()=>{let k=Es(m,y);return k==null?null:{location:{pathname:k,search:x,hash:_,state:v,key:T,unstable_mask:E},navigationType:o}},[y,m,x,_,v,T,o,E]);return Nn(j!=null,`<Router basename="${y}"> is not able to match the URL "${m}${x}${_}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:p.createElement(dn.Provider,{value:g},p.createElement(Hr.Provider,{children:n,value:j}))}function ts({children:s,location:n}){return R_(Cd(s),n)}function Cd(s,n=[]){let r=[];return p.Children.forEach(s,(o,c)=>{if(!p.isValidElement(o))return;let d=[...n,c];if(o.type===p.Fragment){r.push.apply(r,Cd(o.props.children,d));return}it(o.type===xe,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),it(!o.props.index||!o.props.children,"An index route cannot have child routes.");let f={id:o.props.id||d.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=Cd(o.props.children,d)),r.push(f)}),r}var xo="get",vo="application/x-www-form-urlencoded";function Lo(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function V_(s){return Lo(s)&&s.tagName.toLowerCase()==="button"}function Y_(s){return Lo(s)&&s.tagName.toLowerCase()==="form"}function F_(s){return Lo(s)&&s.tagName.toLowerCase()==="input"}function Q_(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function K_(s,n){return s.button===0&&(!n||n==="_self")&&!Q_(s)}function Nd(s=""){return new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((n,r)=>{let o=s[r];return n.concat(Array.isArray(o)?o.map(c=>[r,c]):[[r,o]])},[]))}function X_(s,n){let r=Nd(s);return n&&n.forEach((o,c)=>{r.has(c)||n.getAll(c).forEach(d=>{r.append(c,d)})}),r}var io=null;function Z_(){if(io===null)try{new FormData(document.createElement("form"),0),io=!1}catch{io=!0}return io}var J_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rd(s){return s!=null&&!J_.has(s)?(Nn(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vo}"`),null):s}function W_(s,n){let r,o,c,d,f;if(Y_(s)){let y=s.getAttribute("action");o=y?Es(y,n):null,r=s.getAttribute("method")||xo,c=rd(s.getAttribute("enctype"))||vo,d=new FormData(s)}else if(V_(s)||F_(s)&&(s.type==="submit"||s.type==="image")){let y=s.form;if(y==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=s.getAttribute("formaction")||y.getAttribute("action");if(o=g?Es(g,n):null,r=s.getAttribute("formmethod")||y.getAttribute("method")||xo,c=rd(s.getAttribute("formenctype"))||rd(y.getAttribute("enctype"))||vo,d=new FormData(y,s),!Z_()){let{name:m,type:x,value:_}=s;if(x==="image"){let v=m?`${m}.`:"";d.append(`${v}x`,"0"),d.append(`${v}y`,"0")}else m&&d.append(m,_)}}else{if(Lo(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=xo,o=null,c=vo,f=s}return d&&c==="text/plain"&&(f=d,d=void 0),{action:o,method:r.toLowerCase(),encType:c,formData:d,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Fd(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function dx(s,n,r,o){let c=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:n&&Es(c.pathname,n)==="/"?c.pathname=`${n.replace(/\/$/,"")}/_root.${o}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${o}`,c}async function eT(s,n){if(s.id in n)return n[s.id];try{let r=await import(s.module);return n[s.id]=r,r}catch(r){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tT(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function nT(s,n,r){let o=await Promise.all(s.map(async c=>{let d=n.routes[c.route.id];if(d){let f=await eT(d,r);return f.links?f.links():[]}return[]}));return rT(o.flat(1).filter(tT).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function zm(s,n,r,o,c,d){let f=(g,m)=>r[m]?g.route.id!==r[m].route.id:!0,y=(g,m)=>r[m].pathname!==g.pathname||r[m].route.path?.endsWith("*")&&r[m].params["*"]!==g.params["*"];return d==="assets"?n.filter((g,m)=>f(g,m)||y(g,m)):d==="data"?n.filter((g,m)=>{let x=o.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(f(g,m)||y(g,m))return!0;if(g.route.shouldRevalidate){let _=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(s,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function sT(s,n,{includeHydrateFallback:r}={}){return aT(s.map(o=>{let c=n.routes[o.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function aT(s){return[...new Set(s)]}function lT(s){let n={},r=Object.keys(s).sort();for(let o of r)n[o]=s[o];return n}function rT(s,n){let r=new Set;return new Set(n),s.reduce((o,c)=>{let d=JSON.stringify(lT(c));return r.has(d)||(r.add(d),o.push({key:d,link:c})),o},[])}function Qd(){let s=p.useContext(El);return Fd(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function iT(){let s=p.useContext(Oo);return Fd(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var Kd=p.createContext(void 0);Kd.displayName="FrameworkContext";function Xd(){let s=p.useContext(Kd);return Fd(s,"You must render this element inside a <HydratedRouter> element"),s}function oT(s,n){let r=p.useContext(Kd),[o,c]=p.useState(!1),[d,f]=p.useState(!1),{onFocus:y,onBlur:g,onMouseEnter:m,onMouseLeave:x,onTouchStart:_}=n,v=p.useRef(null);p.useEffect(()=>{if(s==="render"&&f(!0),s==="viewport"){let j=w=>{w.forEach(N=>{f(N.isIntersecting)})},k=new IntersectionObserver(j,{threshold:.5});return v.current&&k.observe(v.current),()=>{k.disconnect()}}},[s]),p.useEffect(()=>{if(o){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[o]);let T=()=>{c(!0)},E=()=>{c(!1),f(!1)};return r?s!=="intent"?[d,v,{}]:[d,v,{onFocus:wr(y,T),onBlur:wr(g,E),onMouseEnter:wr(m,T),onMouseLeave:wr(x,E),onTouchStart:wr(_,T)}]:[!1,v,{}]}function wr(s,n){return r=>{s&&s(r),r.defaultPrevented||n(r)}}function cT({page:s,...n}){let r=b_(),{router:o}=Qd(),c=p.useMemo(()=>Zy(o.routes,s,o.basename),[o.routes,s,o.basename]);return c?r?p.createElement(dT,{page:s,matches:c,...n}):p.createElement(hT,{page:s,matches:c,...n}):null}function uT(s){let{manifest:n,routeModules:r}=Xd(),[o,c]=p.useState([]);return p.useEffect(()=>{let d=!1;return nT(s,n,r).then(f=>{d||c(f)}),()=>{d=!0}},[s,n,r]),o}function dT({page:s,matches:n,...r}){let o=Lt(),{future:c}=Xd(),{basename:d}=Qd(),f=p.useMemo(()=>{if(s===o.pathname+o.search+o.hash)return[];let y=dx(s,d,c.unstable_trailingSlashAwareDataRequests,"rsc"),g=!1,m=[];for(let x of n)typeof x.route.shouldRevalidate=="function"?g=!0:m.push(x.route.id);return g&&m.length>0&&y.searchParams.set("_routes",m.join(",")),[y.pathname+y.search]},[d,c.unstable_trailingSlashAwareDataRequests,s,o,n]);return p.createElement(p.Fragment,null,f.map(y=>p.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})))}function hT({page:s,matches:n,...r}){let o=Lt(),{future:c,manifest:d,routeModules:f}=Xd(),{basename:y}=Qd(),{loaderData:g,matches:m}=iT(),x=p.useMemo(()=>zm(s,n,m,d,o,"data"),[s,n,m,d,o]),_=p.useMemo(()=>zm(s,n,m,d,o,"assets"),[s,n,m,d,o]),v=p.useMemo(()=>{if(s===o.pathname+o.search+o.hash)return[];let j=new Set,k=!1;if(n.forEach(N=>{let O=d.routes[N.route.id];!O||!O.hasLoader||(!x.some(G=>G.route.id===N.route.id)&&N.route.id in g&&f[N.route.id]?.shouldRevalidate||O.hasClientLoader?k=!0:j.add(N.route.id))}),j.size===0)return[];let w=dx(s,y,c.unstable_trailingSlashAwareDataRequests,"data");return k&&j.size>0&&w.searchParams.set("_routes",n.filter(N=>j.has(N.route.id)).map(N=>N.route.id).join(",")),[w.pathname+w.search]},[y,c.unstable_trailingSlashAwareDataRequests,g,o,d,x,n,s,f]),T=p.useMemo(()=>sT(_,d),[_,d]),E=uT(_);return p.createElement(p.Fragment,null,v.map(j=>p.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...r})),T.map(j=>p.createElement("link",{key:j,rel:"modulepreload",href:j,...r})),E.map(({key:j,link:k})=>p.createElement("link",{key:j,nonce:r.nonce,...k,crossOrigin:k.crossOrigin??r.crossOrigin})))}function fT(...s){return n=>{s.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var pT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{pT&&(window.__reactRouterVersion="7.14.0")}catch{}function gT({basename:s,children:n,unstable_useTransitions:r,window:o}){let c=p.useRef();c.current==null&&(c.current=FS({window:o,v5Compat:!0}));let d=c.current,[f,y]=p.useState({action:d.action,location:d.location}),g=p.useCallback(m=>{r===!1?y(m):p.startTransition(()=>y(m))},[r]);return p.useLayoutEffect(()=>d.listen(g),[d,g]),p.createElement(P_,{basename:s,children:n,location:f.location,navigationType:f.action,navigator:d,unstable_useTransitions:r})}var hx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,aa=p.forwardRef(function({onClick:n,discover:r="render",prefetch:o="none",relative:c,reloadDocument:d,replace:f,unstable_mask:y,state:g,target:m,to:x,preventScrollReset:_,viewTransition:v,unstable_defaultShouldRevalidate:T,...E},j){let{basename:k,navigator:w,unstable_useTransitions:N}=p.useContext(dn),O=typeof x=="string"&&hx.test(x),G=tx(x,k);x=G.to;let q=k_(x,{relative:c}),A=Lt(),D=null;if(y){let ue=Do(y,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);k!=="/"&&(ue.pathname=ue.pathname==="/"?k:Jn([k,ue.pathname])),D=w.createHref(ue)}let[U,H,P]=oT(o,E),B=vT(x,{replace:f,unstable_mask:y,state:g,target:m,preventScrollReset:_,relative:c,viewTransition:v,unstable_defaultShouldRevalidate:T,unstable_useTransitions:N});function J(ue){n&&n(ue),ue.defaultPrevented||B(ue)}let X=!(G.isExternal||d),ee=p.createElement("a",{...E,...P,href:(X?D:void 0)||G.absoluteURL||q,onClick:X?J:n,ref:fT(j,H),target:m,"data-discover":!O&&r==="render"?"true":void 0});return U&&!O?p.createElement(p.Fragment,null,ee,p.createElement(cT,{page:q})):ee});aa.displayName="Link";var mT=p.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:o="",end:c=!1,style:d,to:f,viewTransition:y,children:g,...m},x){let _=$r(f,{relative:m.relative}),v=Lt(),T=p.useContext(Oo),{navigator:E,basename:j}=p.useContext(dn),k=T!=null&&jT(_)&&y===!0,w=E.encodeLocation?E.encodeLocation(_).pathname:_.pathname,N=v.pathname,O=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;r||(N=N.toLowerCase(),O=O?O.toLowerCase():null,w=w.toLowerCase()),O&&j&&(O=Es(O,j)||O);const G=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let q=N===w||!c&&N.startsWith(w)&&N.charAt(G)==="/",A=O!=null&&(O===w||!c&&O.startsWith(w)&&O.charAt(w.length)==="/"),D={isActive:q,isPending:A,isTransitioning:k},U=q?n:void 0,H;typeof o=="function"?H=o(D):H=[o,q?"active":null,A?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let P=typeof d=="function"?d(D):d;return p.createElement(aa,{...m,"aria-current":U,className:H,ref:x,style:P,to:f,viewTransition:y},typeof g=="function"?g(D):g)});mT.displayName="NavLink";var yT=p.forwardRef(({discover:s="render",fetcherKey:n,navigate:r,reloadDocument:o,replace:c,state:d,method:f=xo,action:y,onSubmit:g,relative:m,preventScrollReset:x,viewTransition:_,unstable_defaultShouldRevalidate:v,...T},E)=>{let{unstable_useTransitions:j}=p.useContext(dn),k=_T(),w=TT(y,{relative:m}),N=f.toLowerCase()==="get"?"get":"post",O=typeof y=="string"&&hx.test(y),G=q=>{if(g&&g(q),q.defaultPrevented)return;q.preventDefault();let A=q.nativeEvent.submitter,D=A?.getAttribute("formmethod")||f,U=()=>k(A||q.currentTarget,{fetcherKey:n,method:D,navigate:r,replace:c,state:d,relative:m,preventScrollReset:x,viewTransition:_,unstable_defaultShouldRevalidate:v});j&&r!==!1?p.startTransition(()=>U()):U()};return p.createElement("form",{ref:E,method:N,action:w,onSubmit:o?g:G,...T,"data-discover":!O&&s==="render"?"true":void 0})});yT.displayName="Form";function xT(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fx(s){let n=p.useContext(El);return it(n,xT(s)),n}function vT(s,{target:n,replace:r,unstable_mask:o,state:c,preventScrollReset:d,relative:f,viewTransition:y,unstable_defaultShouldRevalidate:g,unstable_useTransitions:m}={}){let x=ze(),_=Lt(),v=$r(s,{relative:f});return p.useCallback(T=>{if(K_(T,n)){T.preventDefault();let E=r!==void 0?r:Ir(_)===Ir(v),j=()=>x(s,{replace:E,unstable_mask:o,state:c,preventScrollReset:d,relative:f,viewTransition:y,unstable_defaultShouldRevalidate:g});m?p.startTransition(()=>j()):j()}},[_,x,v,r,o,c,n,s,d,f,y,g,m])}function Zd(s){Nn(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 n=p.useRef(Nd(s)),r=p.useRef(!1),o=Lt(),c=p.useMemo(()=>X_(o.search,r.current?null:n.current),[o.search]),d=ze(),f=p.useCallback((y,g)=>{const m=Nd(typeof y=="function"?y(new URLSearchParams(c)):y);r.current=!0,d("?"+m,g)},[d,c]);return[c,f]}var bT=0,ST=()=>`__${String(++bT)}__`;function _T(){let{router:s}=fx("useSubmit"),{basename:n}=p.useContext(dn),r=I_(),o=s.fetch,c=s.navigate;return p.useCallback(async(d,f={})=>{let{action:y,method:g,encType:m,formData:x,body:_}=W_(d,n);if(f.navigate===!1){let v=f.fetcherKey||ST();await o(v,r,f.action||y,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:_,formMethod:f.method||g,formEncType:f.encType||m,flushSync:f.flushSync})}else await c(f.action||y,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:_,formMethod:f.method||g,formEncType:f.encType||m,replace:f.replace,state:f.state,fromRouteId:r,flushSync:f.flushSync,viewTransition:f.viewTransition})},[o,c,n,r])}function TT(s,{relative:n}={}){let{basename:r}=p.useContext(dn),o=p.useContext(Rn);it(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),d={...$r(s||".",{relative:n})},f=Lt();if(s==null){d.search=f.search;let y=new URLSearchParams(d.search),g=y.getAll("index");if(g.some(x=>x==="")){y.delete("index"),g.filter(_=>_).forEach(_=>y.append("index",_));let x=y.toString();d.search=x?`?${x}`:""}}return(!s||s===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(d.pathname=d.pathname==="/"?r:Jn([r,d.pathname])),Ir(d)}function jT(s,{relative:n}={}){let r=p.useContext(ax);it(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=fx("useViewTransitionState"),c=$r(s,{relative:n});if(!r.isTransitioning)return!1;let d=Es(r.currentLocation.pathname,o)||r.currentLocation.pathname,f=Es(r.nextLocation.pathname,o)||r.nextLocation.pathname;return wo(c.pathname,f)!=null||wo(c.pathname,d)!=null}const px=p.createContext(void 0);function wT({children:s}){const[n,r]=p.useState(()=>localStorage.getItem("theme")||"light");p.useEffect(()=>{document.documentElement.setAttribute("data-theme",n),localStorage.setItem("theme",n)},[n]);const o=c=>{r(c)};return a.jsx(px.Provider,{value:{theme:n,setTheme:o},children:s})}function ET(){const s=p.useContext(px);if(!s)throw new Error("useTheme must be used within ThemeProvider");return s}let Dm=class extends Error{url;status;statusText;body;request;constructor(n,r,o){super(o),this.name="ApiError",this.url=r.url,this.status=r.status,this.statusText=r.statusText,this.body=r.body,this.request=n}};class kT extends Error{constructor(n){super(n),this.name="CancelError"}get isCancelled(){return!0}}class CT{#t;#e;#n;#s;#l;#r;#a;constructor(n){this.#t=!1,this.#e=!1,this.#n=!1,this.#s=[],this.#l=new Promise((r,o)=>{this.#r=r,this.#a=o;const c=y=>{this.#t||this.#e||this.#n||(this.#t=!0,this.#r&&this.#r(y))},d=y=>{this.#t||this.#e||this.#n||(this.#e=!0,this.#a&&this.#a(y))},f=y=>{this.#t||this.#e||this.#n||this.#s.push(y)};return Object.defineProperty(f,"isResolved",{get:()=>this.#t}),Object.defineProperty(f,"isRejected",{get:()=>this.#e}),Object.defineProperty(f,"isCancelled",{get:()=>this.#n}),n(c,d,f)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(n,r){return this.#l.then(n,r)}catch(n){return this.#l.catch(n)}finally(n){return this.#l.finally(n)}cancel(){if(!(this.#t||this.#e||this.#n)){if(this.#n=!0,this.#s.length)try{for(const n of this.#s)n()}catch(n){console.warn("Cancellation threw an error",n);return}this.#s.length=0,this.#a&&this.#a(new kT("Request aborted"))}}get isCancelled(){return this.#n}}const Pe={BASE:"",VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};var Om;(function(s){(function(n){n.NOT_STARTED="NOT_STARTED",n.IN_PROGRESS="IN_PROGRESS",n.FOR_REVIEW="FOR_REVIEW",n.DONE="DONE"})(s.taskStatus||(s.taskStatus={})),(function(n){n.NOT_STARTED="NOT_STARTED",n.IN_PROGRESS="IN_PROGRESS",n.FOR_REVIEW="FOR_REVIEW",n.DONE="DONE"})(s.taskStatusBeforeClaim||(s.taskStatusBeforeClaim={}))})(Om||(Om={}));var Lm;(function(s){(function(n){n.HUMAN="human",n.AGENT="agent"})(s.type||(s.type={}))})(Lm||(Lm={}));var qm;(function(s){(function(n){n.CLAUDE="claude",n.CODEX="codex",n.OPENCODE="opencode",n.ADK="adk",n.GITHUBCOPILOT="githubcopilot",n.OTHER="other"})(s.type||(s.type={}))})(qm||(qm={}));var Mm;(function(s){(function(n){n.CLAUDE="claude",n.CODEX="codex",n.OPENCODE="opencode",n.ADK="adk",n.GITHUBCOPILOT="githubcopilot",n.OTHER="other"})(s.type||(s.type={}))})(Mm||(Mm={}));var Bm;(function(s){(function(n){n.CLAUDE="claude",n.CODEX="codex",n.OPENCODE="opencode",n.ADK="adk",n.GITHUBCOPILOT="githubcopilot",n.OTHER="other"})(s.type||(s.type={}))})(Bm||(Bm={}));var Um;(function(s){(function(n){n.HTTP="http",n.STDIO="stdio"})(s.type||(s.type={}))})(Um||(Um={}));var Im;(function(s){(function(n){n.NOT_STARTED="not_started",n.USER_CONSENT_REJECTED="USER_CONSENT_REJECTED",n.MCP_AUTH_FLOW_STARTED="mcp_auth_flow_started",n.MCP_AUTH_FLOW_COMPLETED="mcp_auth_flow_completed",n.CONNECTIONS_FLOW_STARTED="connections_flow_started",n.CONNECTIONS_FLOW_COMPLETED="connections_flow_completed",n.AUTHORIZATION_CODE_ISSUED="authorization_code_issued",n.AUTHORIZATION_CODE_EXCHANGED="authorization_code_exchanged"})(s.status||(s.status={}))})(Im||(Im={}));var Hm;(function(s){(function(n){n.NOT_STARTED="NOT_STARTED",n.IN_PROGRESS="IN_PROGRESS",n.FOR_REVIEW="FOR_REVIEW",n.DONE="DONE"})(s.status||(s.status={}))})(Hm||(Hm={}));var $m;(function(s){(function(n){n.OPENAI="openai",n.ADK="adk"})(s.type||(s.type={}))})($m||($m={}));var Gm;(function(s){(function(n){n.NONE="none",n.CLIENT_SECRET_BASIC="client_secret_basic"})(s.token_endpoint_auth_method||(s.token_endpoint_auth_method={}))})(Gm||(Gm={}));var Pm;(function(s){(function(n){n.PENDING="pending",n.AUTHORIZED="authorized",n.FAILED="failed"})(s.status||(s.status={}))})(Pm||(Pm={}));var Vm;(function(s){(function(n){n.CLAUDE="claude",n.CODEX="codex",n.OPENCODE="opencode",n.ADK="adk",n.GITHUBCOPILOT="githubcopilot",n.OTHER="other"})(s.type||(s.type={}))})(Vm||(Vm={}));var Ym;(function(s){(function(n){n.OPENAI="openai",n.ADK="adk"})(s.type||(s.type={}))})(Ym||(Ym={}));var Fm;(function(s){(function(n){n.HTTP="http",n.STDIO="stdio"})(s.type||(s.type={}))})(Fm||(Fm={}));var Qm;(function(s){(function(n){n.CLIENT_NOT_REGISTERED="CLIENT_NOT_REGISTERED",n.CLIENT_REGISTERED="CLIENT_REGISTERED",n.AUTHORIZATION_REQUEST_STARTED="AUTHORIZATION_REQUEST_STARTED",n.USER_CONSENT_OK="USER_CONSENT_OK",n.USER_CONSENT_REJECTED="USER_CONSENT_REJECTED",n.WAITING_ON_DOWNSTREAM_AUTH="WAITING_ON_DOWNSTREAM_AUTH",n.AUTHORIZATION_CODE_ISSUED="AUTHORIZATION_CODE_ISSUED",n.AUTHORIZATION_CODE_EXCHANGED="AUTHORIZATION_CODE_EXCHANGED"})(s.status||(s.status={}))})(Qm||(Qm={}));var Km;(function(s){(function(n){n.TASK="task",n.CONTEXT_BLOCK="context_block",n.AGENT="agent",n.PROJECT="project",n.TAG="tag",n.TOOL="tool"})(s.type||(s.type={}))})(Km||(Km={}));var Xm;(function(s){(function(n){n.ACCESS_TOKEN="access_token",n.REFRESH_TOKEN="refresh_token"})(s.token_type_hint||(s.token_type_hint={}))})(Xm||(Xm={}));var Zm;(function(s){(function(n){n.BEARER="Bearer"})(s.token_type||(s.token_type={}))})(Zm||(Zm={}));var Jm;(function(s){(function(n){n.CLIENT_NOT_REGISTERED="CLIENT_NOT_REGISTERED",n.CLIENT_REGISTERED="CLIENT_REGISTERED",n.AUTHORIZATION_REQUEST_STARTED="AUTHORIZATION_REQUEST_STARTED",n.USER_CONSENT_OK="USER_CONSENT_OK",n.USER_CONSENT_REJECTED="USER_CONSENT_REJECTED",n.WAITING_ON_DOWNSTREAM_AUTH="WAITING_ON_DOWNSTREAM_AUTH",n.AUTHORIZATION_CODE_ISSUED="AUTHORIZATION_CODE_ISSUED",n.AUTHORIZATION_CODE_EXCHANGED="AUTHORIZATION_CODE_EXCHANGED"})(s.status||(s.status={}))})(Jm||(Jm={}));var Wm;(function(s){(function(n){n.CLAUDE="claude",n.CODEX="codex",n.OPENCODE="opencode",n.ADK="adk",n.GITHUBCOPILOT="githubcopilot",n.OTHER="other"})(s.type||(s.type={}))})(Wm||(Wm={}));var ey;(function(s){(function(n){n.NONE="none",n.CLIENT_SECRET_BASIC="client_secret_basic"})(s.token_endpoint_auth_method||(s.token_endpoint_auth_method={}))})(ey||(ey={}));var ty;(function(s){(function(n){n.HTTP="http",n.STDIO="stdio"})(s.type||(s.type={}))})(ty||(ty={}));var ny;(function(s){(function(n){n.SUCCEEDED="SUCCEEDED",n.FAILED="FAILED",n.STALE="STALE",n.CANCELLED="CANCELLED"})(s.status||(s.status={})),(function(n){n.OUT_OF_QUOTA="OUT_OF_QUOTA",n.UNKNOWN="UNKNOWN"})(s.errorCode||(s.errorCode={}))})(ny||(ny={}));var sy;(function(s){(function(n){n.NOT_STARTED="NOT_STARTED",n.IN_PROGRESS="IN_PROGRESS",n.FOR_REVIEW="FOR_REVIEW",n.DONE="DONE"})(s.taskStatus||(s.taskStatus={})),(function(n){n.SUCCEEDED="SUCCEEDED",n.FAILED="FAILED",n.STALE="STALE",n.CANCELLED="CANCELLED"})(s.status||(s.status={})),(function(n){n.OUT_OF_QUOTA="OUT_OF_QUOTA",n.UNKNOWN="UNKNOWN"})(s.errorCode||(s.errorCode={}))})(sy||(sy={}));var ay;(function(s){(function(n){n.NOT_STARTED="NOT_STARTED",n.IN_PROGRESS="IN_PROGRESS",n.FOR_REVIEW="FOR_REVIEW",n.DONE="DONE"})(s.taskStatus||(s.taskStatus={}))})(ay||(ay={}));var ly;(function(s){(function(n){n.NOT_STARTED="NOT_STARTED",n.IN_PROGRESS="IN_PROGRESS",n.FOR_REVIEW="FOR_REVIEW",n.DONE="DONE"})(s.status||(s.status={}))})(ly||(ly={}));var ry;(function(s){(function(n){n.NOT_STARTED="NOT_STARTED",n.IN_PROGRESS="IN_PROGRESS",n.FOR_REVIEW="FOR_REVIEW",n.DONE="DONE"})(s.status||(s.status={}))})(ry||(ry={}));var iy;(function(s){(function(n){n.URN_IETF_PARAMS_OAUTH_GRANT_TYPE_TOKEN_EXCHANGE="urn:ietf:params:oauth:grant-type:token-exchange"})(s.grant_type||(s.grant_type={})),(function(n){n.URN_IETF_PARAMS_OAUTH_TOKEN_TYPE_ACCESS_TOKEN="urn:ietf:params:oauth:token-type:access_token"})(s.subject_token_type||(s.subject_token_type={}))})(iy||(iy={}));var oy;(function(s){(function(n){n.AUTHORIZATION_CODE="authorization_code",n.REFRESH_TOKEN="refresh_token"})(s.grant_type||(s.grant_type={}))})(oy||(oy={}));var cy;(function(s){(function(n){n.BEARER="Bearer"})(s.token_type||(s.token_type={}))})(cy||(cy={}));var uy;(function(s){(function(n){n.HTTP="http",n.STDIO="stdio"})(s.type||(s.type={}))})(uy||(uy={}));var dy;(function(s){(function(n){n.ADMIN="admin",n.STANDARD="standard"})(s.role||(s.role={})),(function(n){n.FULL_PAGE="FULL_PAGE",n.BANNER="BANNER",n.OFF="OFF"})(s.onboardingDisplayMode||(s.onboardingDisplayMode={}))})(dy||(dy={}));var hy;(function(s){(function(n){n.FULL_PAGE="FULL_PAGE",n.BANNER="BANNER",n.OFF="OFF"})(s.onboardingDisplayMode||(s.onboardingDisplayMode={}))})(hy||(hy={}));const Jd=s=>s!=null,Gr=s=>typeof s=="string",id=s=>Gr(s)&&s!=="",Wd=s=>typeof s=="object"&&typeof s.type=="string"&&typeof s.stream=="function"&&typeof s.arrayBuffer=="function"&&typeof s.constructor=="function"&&typeof s.constructor.name=="string"&&/^(Blob|File)$/.test(s.constructor.name)&&/^(Blob|File)$/.test(s[Symbol.toStringTag]),gx=s=>s instanceof FormData,NT=s=>{try{return btoa(s)}catch{return Buffer.from(s).toString("base64")}},AT=s=>{const n=[],r=(c,d)=>{n.push(`${encodeURIComponent(c)}=${encodeURIComponent(String(d))}`)},o=(c,d)=>{Jd(d)&&(Array.isArray(d)?d.forEach(f=>{o(c,f)}):typeof d=="object"?Object.entries(d).forEach(([f,y])=>{o(`${c}[${f}]`,y)}):r(c,d))};return Object.entries(s).forEach(([c,d])=>{o(c,d)}),n.length>0?`?${n.join("&")}`:""},RT=(s,n)=>{const r=s.ENCODE_PATH||encodeURI,o=n.url.replace("{api-version}",s.VERSION).replace(/{(.*?)}/g,(d,f)=>n.path?.hasOwnProperty(f)?r(String(n.path[f])):d),c=`${s.BASE}${o}`;return n.query?`${c}${AT(n.query)}`:c},zT=s=>{if(s.formData){const n=new FormData,r=(o,c)=>{Gr(c)||Wd(c)?n.append(o,c):n.append(o,JSON.stringify(c))};return Object.entries(s.formData).filter(([o,c])=>Jd(c)).forEach(([o,c])=>{Array.isArray(c)?c.forEach(d=>r(o,d)):r(o,c)}),n}},oo=async(s,n)=>typeof n=="function"?n(s):n,DT=async(s,n)=>{const[r,o,c,d]=await Promise.all([oo(n,s.TOKEN),oo(n,s.USERNAME),oo(n,s.PASSWORD),oo(n,s.HEADERS)]),f=Object.entries({Accept:"application/json",...d,...n.headers}).filter(([y,g])=>Jd(g)).reduce((y,[g,m])=>({...y,[g]:String(m)}),{});if(id(r)&&(f.Authorization=`Bearer ${r}`),id(o)&&id(c)){const y=NT(`${o}:${c}`);f.Authorization=`Basic ${y}`}return n.body!==void 0&&(n.mediaType?f["Content-Type"]=n.mediaType:Wd(n.body)?f["Content-Type"]=n.body.type||"application/octet-stream":Gr(n.body)?f["Content-Type"]="text/plain":gx(n.body)||(f["Content-Type"]="application/json")),new Headers(f)},OT=s=>{if(s.body!==void 0)return s.mediaType?.includes("/json")?JSON.stringify(s.body):Gr(s.body)||Wd(s.body)||gx(s.body)?s.body:JSON.stringify(s.body)},LT=async(s,n,r,o,c,d,f)=>{const y=new AbortController,g={headers:d,body:o??c,method:n.method,signal:y.signal};return s.WITH_CREDENTIALS&&(g.credentials=s.CREDENTIALS),f(()=>y.abort()),await fetch(r,g)},qT=(s,n)=>{if(n){const r=s.headers.get(n);if(Gr(r))return r}},MT=async s=>{if(s.status!==204)try{const n=s.headers.get("Content-Type");if(n)return["application/json","application/problem+json"].some(c=>n.toLowerCase().startsWith(c))?await s.json():await s.text()}catch(n){console.error(n)}},BT=(s,n)=>{const o={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...s.errors}[n.status];if(o)throw new Dm(s,n,o);if(!n.ok){const c=n.status??"unknown",d=n.statusText??"unknown",f=(()=>{try{return JSON.stringify(n.body,null,2)}catch{return}})();throw new Dm(s,n,`Generic Error: status: ${c}; status text: ${d}; body: ${f}`)}},et=(s,n)=>new CT(async(r,o,c)=>{try{const d=RT(s,n),f=zT(n),y=OT(n),g=await DT(s,n);if(!c.isCancelled){const m=await LT(s,n,d,y,f,g,c),x=await MT(m),_=qT(m,n.responseHeader),v={url:d,ok:m.ok,status:m.status,statusText:m.statusText,body:_??x};BT(n,v),r(v.body)}}catch(d){o(d)}});class mx{static actorControllerListActors(n=Pe){return et(n,{method:"GET",url:"/api/v1/actors"})}static actorControllerSearchActors(n,r=10,o=.3,c=Pe){return et(c,{method:"GET",url:"/api/v1/actors/search",query:{query:n,limit:r,threshold:o}})}}class Rr{static chatProvidersControllerCreateChatProvider(n,r=Pe){return et(r,{method:"POST",url:"/api/v1/chat-providers",body:n,mediaType:"application/json"})}static chatProvidersControllerListChatProviders(n=Pe){return et(n,{method:"GET",url:"/api/v1/chat-providers"})}static chatProvidersControllerGetChatProvider(n,r=Pe){return et(r,{method:"GET",url:"/api/v1/chat-providers/{id}",path:{id:n},errors:{404:"Chat provider not found"}})}static chatProvidersControllerUpdateChatProvider(n,r,o=Pe){return et(o,{method:"PATCH",url:"/api/v1/chat-providers/{id}",path:{id:n},body:r,mediaType:"application/json",errors:{404:"Chat provider not found"}})}static chatProvidersControllerDeleteChatProvider(n,r=Pe){return et(r,{method:"DELETE",url:"/api/v1/chat-providers/{id}",path:{id:n},errors:{404:"Chat provider not found"}})}static chatProvidersControllerSetActiveChatProvider(n,r=Pe){return et(r,{method:"POST",url:"/api/v1/chat-providers/set-active",body:n,mediaType:"application/json",errors:{404:"Chat provider not found"}})}static chatProvidersControllerDeactivateActiveChatProvider(n=Pe){return et(n,{method:"POST",url:"/api/v1/chat-providers/deactivate"})}}let UT=class{static metaControllerCreateTag(n,r=Pe){return et(r,{method:"POST",url:"/api/v1/meta/tags",body:n,mediaType:"application/json",errors:{400:"Invalid input data"}})}static metaControllerGetAllTags(n=Pe){return et(n,{method:"GET",url:"/api/v1/meta/tags"})}static metaControllerGetTagColors(n=Pe){return et(n,{method:"GET",url:"/api/v1/meta/tags/colors"})}static metaControllerDeleteTag(n,r=Pe){return et(r,{method:"DELETE",url:"/api/v1/meta/tags/{tagId}",path:{tagId:n},errors:{404:"Tag not found"}})}};class fy{static projectsControllerCreateProject(n,r=Pe){return et(r,{method:"POST",url:"/api/v1/meta/projects",body:n,mediaType:"application/json",errors:{400:"Invalid input data"}})}static projectsControllerGetAllProjects(n=Pe){return et(n,{method:"GET",url:"/api/v1/meta/projects"})}static projectsControllerSearchProjects(n,r,o,c=Pe){return et(c,{method:"GET",url:"/api/v1/meta/projects/search",query:{q:n,limit:r,threshold:o}})}static projectsControllerGetProjectBySlug(n,r=Pe){return et(r,{method:"GET",url:"/api/v1/meta/projects/by-slug/{slug}",path:{slug:n},errors:{404:"Project not found"}})}static projectsControllerGetProject(n,r=Pe){return et(r,{method:"GET",url:"/api/v1/meta/projects/{projectId}",path:{projectId:n},errors:{404:"Project not found"}})}static projectsControllerUpdateProject(n,r,o=Pe){return et(o,{method:"PATCH",url:"/api/v1/meta/projects/{projectId}",path:{projectId:n},body:r,mediaType:"application/json",errors:{400:"Invalid input data",404:"Project not found"}})}static projectsControllerDeleteProject(n,r=Pe){return et(r,{method:"DELETE",url:"/api/v1/meta/projects/{projectId}",path:{projectId:n},errors:{404:"Project not found"}})}}class js{static webAuthControllerLogin(n,r=Pe){return et(r,{method:"POST",url:"/api/v1/auth/login",body:n,mediaType:"application/json",errors:{401:"Invalid credentials"}})}static webAuthControllerRefresh(n=Pe){return et(n,{method:"POST",url:"/api/v1/auth/refresh",errors:{401:"Invalid or expired refresh token"}})}static webAuthControllerLogout(n=Pe){return et(n,{method:"POST",url:"/api/v1/auth/logout"})}static webAuthControllerMe(n=Pe){return et(n,{method:"GET",url:"/api/v1/auth/me",errors:{401:"Not authenticated"}})}static webAuthControllerChangePassword(n,r=Pe){return et(r,{method:"POST",url:"/api/v1/auth/change-password",body:n,mediaType:"application/json",errors:{401:"Not authenticated or current password is incorrect"}})}static webAuthControllerGetOnboardingStatus(n=Pe){return et(n,{method:"GET",url:"/api/v1/auth/onboarding-status"})}static webAuthControllerOnboard(n,r=Pe){return et(r,{method:"POST",url:"/api/v1/auth/onboard",body:n,mediaType:"application/json",errors:{409:"Admin users already exist, onboarding not allowed"}})}static webAuthControllerMarkWalkthroughSeen(n=Pe){return et(n,{method:"POST",url:"/api/v1/auth/mark-walkthrough-seen",errors:{401:"Not authenticated"}})}}const IT=()=>"",la=s=>s,Na=IT();Pe.BASE=Na;Pe.CREDENTIALS="include";Pe.BASE=Na;const yx=p.createContext(void 0);function HT({children:s}){const[n,r]=p.useState(null),[o,c]=p.useState(!0);p.useEffect(()=>{js.webAuthControllerMe().then(m=>{r(m)}).catch(()=>{r(null)}).finally(()=>{c(!1)})},[]),p.useEffect(()=>{if(!n)return;const m=setInterval(async()=>{try{const x=await js.webAuthControllerRefresh();r(x.user)}catch(x){console.error("Token refresh failed:",x),r(null)}},480*1e3);return()=>clearInterval(m)},[n]);const g={user:n,isAuthenticated:!!n,isLoading:o,login:async(m,x)=>{const _=await js.webAuthControllerLogin({email:m,password:x});r(_.user)},logout:async()=>{try{await js.webAuthControllerLogout()}finally{r(null)}},refreshAuth:async()=>{const m=await js.webAuthControllerRefresh();r(m.user)}};return a.jsx(yx.Provider,{value:g,children:s})}function zn(){const s=p.useContext(yx);if(s===void 0)throw new Error("useAuth must be used within an AuthProvider");return s}function xx({children:s}){return a.jsx("div",{className:"login-page",children:a.jsx("div",{className:"login-container",children:a.jsx("div",{className:"login-card",children:s})})})}const od=["a1","a2","a3","a4","a5","a6"];function $T(s){let n=5381;for(let r=0;r<s.length;r++)n=n*33^s.charCodeAt(r);return n>>>0}function GT(s){if(!s)return od[0];const n=$T(s.trim().toLowerCase())%od.length;return od[n]}function PT(s){if(!s)return"?";const n=s.trim();if(!n)return"?";const r=n.split(/\s+/).filter(Boolean),o=r[0]?.[0]??"?",c=r.length>1?r[r.length-1]?.[0]:"";return(o+c).toUpperCase()}function VT(s){return typeof s=="number"?null:`avatar--${s}`}function YT(s){if(typeof s=="number")return{width:s,height:s,fontSize:Math.max(10,Math.round(s*.42))}}function $e({name:s,src:n,alt:r,size:o="md",className:c=""}){const d=PT(s),f=GT(s),y=VT(o),g=YT(o);return n?a.jsx("img",{className:`avatar ${y??""} ${c}`,style:g,src:n,alt:r??s,loading:"lazy"}):a.jsx("div",{className:`avatar avatar--fallback avatar--${f} ${y??""} ${c}`,style:g,"aria-label":r??s,role:"img",title:s,children:d})}function ws(s){return a.jsx("span",{className:`chip chip--${s.color??"gray"}`,children:s.children})}function se({children:s,spacing:n="4",align:r="stretch",className:o=""}){return a.jsx("div",{className:`stack stack--spacing-${n} stack--align-${r} ${o}`,"data-component":"stack",children:s})}function xt({children:s,spacing:n="4",align:r="center",justify:o="start",className:c=""}){return a.jsx("div",{className:`row row--spacing-${n} row--align-${r} row--justify-${o} ${c}`,"data-component":"row",children:s})}function S({children:s,size:n="2",weight:r="normal",tone:o="default",style:c="sans",as:d="p",className:f="",wrap:y=!1}){return a.jsx(d,{className:`text text--size-${n} text--weight-${r} text--tone-${o} text--style-${c} ${y&&"text--wrap"} ${f}`,"data-component":"text",children:s})}function An(s){const{children:n}=s;return a.jsx("div",{className:"error--container",children:a.jsx(S,{size:s.size,weight:s.weight,tone:s.tone,as:s.as,wrap:s.wrap,className:"error--text",children:n})})}function ce({children:s,variant:n="primary",size:r="md",fullWidth:o=!1,className:c="",...d}){return a.jsx("button",{className:`btn btn--${n} btn--${r} ${o?"btn--full-width":""} ${c}`,"data-component":"button",...d,children:s})}function Qe({children:s,padding:n="4",className:r=""}){return a.jsx("div",{className:`card card--padding-${n} ${r}`,"data-component":"card",children:s})}function vx({leading:s,children:n,tags:r=[],topRight:o,footer:c,trailing:d,animation:f,onClick:y,className:g="",pulseKey:m,highlight:x}){const[_,v]=p.useState(!1);p.useEffect(()=>{if(m==null)return;v(!0);const w=setTimeout(()=>v(!1),600);return()=>clearTimeout(w)},[m]);const T=f?`board-card--${f}`:"",E=_?"board-card--eventPulse":"",j=x?"board-card--highlight":"",k=w=>{y?.(w)};return a.jsx("div",{className:`board-card__wrapper ${T}`,onClick:k,children:a.jsxs("div",{className:`board-card ${j} ${E} ${g}`,"data-component":"board-card",children:[a.jsxs("div",{className:"board-card__header",children:[a.jsx("div",{className:"board-card__headerLeft",children:s?a.jsx("div",{className:"board-card__leading",children:s}):null}),a.jsxs("div",{className:"board-card__headerRight",children:[o?a.jsx("div",{className:"board-card__meta",children:o}):null,d?a.jsx("div",{className:"board-card__trailing",children:d}):null]})]}),a.jsx("div",{className:"board-card__main",children:n}),r.length?a.jsx("div",{className:"board-card__tags","aria-label":"tags",children:r.map(w=>a.jsx("span",{className:`chip chip--${w.color??"gray"}`,children:w.label},w.label))}):null,c?a.jsx("div",{className:"board-card__footer",children:c}):null]})})}function ge({leading:s,children:n,tags:r=[],topRight:o,trailing:c,animation:d,onClick:f,highlight:y,className:g=""}){const m=d?`data-row--${d}`:"",x=y?"data-row--highlight":"",_=f?"data-row--clickable":"",v=T=>{f?.(T)};return a.jsx("div",{className:`data-row__wrapper ${m}`,onClick:v,children:a.jsxs("div",{className:`data-row ${x} ${_} ${g}`,"data-component":"data-row",children:[s?a.jsx("div",{className:"data-row__leading",children:s}):null,a.jsxs("div",{className:"data-row__content",children:[a.jsxs("div",{className:"data-row__top",children:[a.jsx("div",{className:`data-row__main ${g}`,children:n}),o?a.jsx("div",{className:"data-row__meta",children:o}):null]}),r.length?a.jsx("div",{className:"data-row__tags","aria-label":"tags",children:r.map((T,E)=>{const j=`chip chip--${T.color??"gray"}${T.onClick?" chip--clickable":""}`;return T.onClick?a.jsx("button",{type:"button",className:j,"aria-label":T.clickLabel??T.label,onClick:k=>{k.stopPropagation(),T.onClick?.()},children:T.label},`${T.label}-${T.color??"gray"}-${E}`):a.jsxs("span",{className:j,children:[T.label,T.onRemove?a.jsx("button",{type:"button",className:"chip__remove","aria-label":T.removeLabel??`Remove ${T.label}`,onClick:k=>{k.stopPropagation(),T.onRemove?.()},children:"×"}):null]},`${T.label}-${T.color??"gray"}-${E}`)})}):null]}),c?a.jsx("div",{className:"data-row__trailing",children:c}):null]})})}function pe({children:s,title:n,className:r,action:o}){return a.jsxs("div",{className:`data-row__container ${r}`,children:[(n||o)&&a.jsxs("div",{className:"data-row__container-header",children:[n&&a.jsx(S,{size:"4",weight:"bold",children:n}),o&&a.jsx("div",{className:"data-row__container-action",children:o})]}),s]})}function FT({children:s,onClick:n,interactive:r=!1,className:o=""}){const c=r||!!n;return a.jsx("div",{className:`list-row ${c?"list-row--interactive":""} ${o}`,onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,"data-component":"list-row",children:s})}function QT(){const[s,n]=p.useState(""),[r,o]=p.useState(""),[c,d]=p.useState(""),[f,y]=p.useState(!1),{login:g,isLoading:m,isAuthenticated:x}=zn(),_=ze(),T=Lt().state?.from,E=T?.pathname||"/",j=T?.search||"",k=E==="/logout"?"/":`${E}${j}`;p.useEffect(()=>{!m&&x&&(console.log("you're in mate"),_(k))},[m,x,k]);const w=async N=>{N.preventDefault(),y(!0),d("");try{await g(s,r),_(k,{replace:!0})}catch{d("Invalid email or password")}finally{y(!1)}};return a.jsx("form",{onSubmit:w,children:a.jsxs(se,{spacing:"6",children:[a.jsxs(se,{spacing:"2",align:"center",children:[a.jsx(S,{size:"6",weight:"bold",className:"login__copy",children:"Taico"}),a.jsx(S,{tone:"muted",className:"login__copy",children:"Where people and agents collaborate in threads, using shared context to get work done."})]}),a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:"email",className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"Email"})}),a.jsx("input",{id:"email",type:"email",value:s,onChange:N=>n(N.target.value),className:"login-input",placeholder:"name@work.com",required:!0,disabled:f,autoComplete:"email"})]}),a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:"password",className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"Password"})}),a.jsx("input",{id:"password",type:"password",value:r,onChange:N=>o(N.target.value),className:"login-input",placeholder:"••••••••",required:!0,disabled:f,autoComplete:"current-password"})]}),c&&a.jsx(An,{size:"2",weight:"medium",className:"",children:c}),a.jsx(ce,{type:"submit",variant:"primary",size:"lg",disabled:f,className:"login-button",children:f?"Signing in...":"Sign In"})]})]})})}function KT(){return a.jsx(xx,{children:a.jsx(QT,{})})}function XT(){const[s,n]=p.useState(""),[r,o]=p.useState(""),[c,d]=p.useState(""),[f,y]=p.useState(""),[g,m]=p.useState(""),[x,_]=p.useState(!1),{refreshAuth:v}=zn(),T=ze(),E=async j=>{j.preventDefault(),_(!0),m("");try{await js.webAuthControllerOnboard({email:s,displayName:r,slug:c,password:f}),await v(),T("/",{replace:!0})}catch(k){let w="Failed to create admin user";k.body?.context?.fields&&Array.isArray(k.body.context.fields)?w=k.body.context.fields.join(", "):k.body?.detail?w=k.body.detail:k.body?.title?w=k.body.title:k.message&&(w=k.message),m(w)}finally{_(!1)}};return a.jsx("form",{onSubmit:E,children:a.jsxs(se,{spacing:"6",children:[a.jsxs(se,{spacing:"2",align:"center",children:[a.jsx(S,{size:"6",weight:"bold",className:"login__copy",children:"Welcome to Taico"}),a.jsx(S,{tone:"muted",className:"login__copy",children:"Let's set up your first admin account to get started."})]}),a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:"displayName",className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"Display Name"})}),a.jsx("input",{id:"displayName",type:"text",value:r,onChange:j=>o(j.target.value),className:"login-input",placeholder:"Admin User",required:!0,disabled:x,autoComplete:"name"})]}),a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:"slug",className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"Username"})}),a.jsx("input",{id:"slug",type:"text",value:c,onChange:j=>d(j.target.value),className:"login-input",placeholder:"admin",required:!0,disabled:x,autoComplete:"username"})]}),a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:"email",className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"Email"})}),a.jsx("input",{id:"email",type:"email",value:s,onChange:j=>n(j.target.value),className:"login-input",placeholder:"admin@example.com",required:!0,disabled:x,autoComplete:"email"}),a.jsx(S,{size:"1",tone:"muted",children:"Email is not verified and cannot be changed later. Make sure it's correct."})]}),a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:"password",className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"Password"})}),a.jsx("input",{id:"password",type:"password",value:f,onChange:j=>y(j.target.value),className:"login-input",placeholder:"••••••••",required:!0,disabled:x,autoComplete:"new-password"}),a.jsx(S,{size:"1",tone:"muted",children:"Remember this password - you won't receive a confirmation email."})]}),g&&a.jsx(An,{size:"2",weight:"medium",className:"",children:g}),a.jsx(ce,{type:"submit",variant:"primary",size:"lg",disabled:x,className:"login-button",children:x?"Creating account...":"Create Admin Account"})]})]})})}function ZT(){return a.jsx(xx,{children:a.jsx(XT,{})})}function JT({children:s}){const{isAuthenticated:n,isLoading:r}=zn(),o=Lt();return r?null:n?a.jsx(a.Fragment,{children:s}):a.jsx(Ca,{to:"/login",state:{from:o},replace:!0})}const WT=4;function ej({children:s}){const[n,r]=p.useState(null),[o,c]=p.useState(!0),[d,f]=p.useState(null),[y,g]=p.useState(0);return p.useEffect(()=>{let m=!0,x;const _=()=>{x&&clearTimeout(x)},v=async()=>{try{const T=await js.webAuthControllerGetOnboardingStatus();if(!m)return;_(),r(T.needsOnboarding),f(null)}catch(T){if(!m)return;console.error("Failed to check onboarding status:",T),f(T instanceof Error?T:new Error("Failed to check onboarding status")),r(null),g(E=>E+1),x=setTimeout(()=>{_(),m&&v()},WT*1e3)}finally{m&&c(!1)}};return v(),()=>{m=!1,_()}},[]),o?null:d?a.jsx("div",{className:"onboarding-checker-shell",children:a.jsxs(se,{spacing:"4",align:"center",className:"onboarding-checker-card",children:[a.jsxs("span",{className:"onboarding-checker-signal","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]}),a.jsx(S,{size:"5",weight:"semibold",as:"div",children:"Reconnecting to Taico..."}),a.jsx(S,{size:"3",tone:"muted",as:"div",className:"onboarding-checker-copy",children:"The backend is not responding yet. We will keep retrying until it is back."}),a.jsxs(S,{size:"1",tone:"muted",as:"div",className:"onboarding-checker-feedback",children:["Retry attempt ",y]})]})}):n?a.jsx(Ca,{to:"/onboarding",replace:!0}):a.jsx(a.Fragment,{children:s})}function tj(s){return p.useSyncExternalStore(n=>{const r=window.matchMedia(s);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},()=>window.matchMedia(s).matches,()=>!1)}function bt(){return tj("(min-width: 768px)")}const Or=[{path:"/home",label:"Home",icon:"🏠"},{path:"/tasks",label:"Tasks",icon:"🧩"},{path:"/tasks/schedule",label:"Schedules",icon:"🗓"},{path:"/context",label:"Context",icon:"🧱"},{path:"/agents",label:"Agents",icon:"🦄"},{path:"/threads",label:"Threads",icon:"🧵"},{path:"/tools",label:"Tools",icon:"🧰"},{path:"/runs",label:"Runs",icon:"⚡"},{path:"/settings",label:"Settings",icon:"⚙️"},{path:"/logout",label:"Logout",icon:"🔓"}];function qt(s){const n=Lt();Wt(),p.useEffect(()=>{const r=n.pathname;let o="taico";if(r.startsWith("/home"))o="🏠 taico";else if(r.match(/\/tasks\/task\/.+/)&&s?.task?.name){const c=s.task.name;o=`🧩 ${c.length>50?c.substring(0,50)+"...":c}`}else r.startsWith("/tasks")?o="🧩 tasks":r.startsWith("/context")?o="🧱 context":r.startsWith("/settings")?o="⚙️ settings":r.match(/\/agents\/agent\/.+/)&&s?.agent?.name?o=`🦄 ${s.agent.name}`:r.startsWith("/agents")?o="🦄 agents":r.match(/\/tools\/tool\/.+/)&&s?.tool?.name?o=`🧰 ${s.tool.name}`:r.startsWith("/tools")?o="🧰 tools":r.startsWith("/threads")?o="🧵 threads":r.startsWith("/runs")||r.startsWith("/executions")?o="⚡ runs":r.startsWith("/walkthrough")&&(o="🐣 walkthrough");document.title=o},[n.pathname,s])}function nj({children:s}){console.log("Beta shell");const{user:n}=zn(),r=Lt();qt();const o=p.useMemo(()=>{if(!(n?.onboardingDisplayMode==="FULL_PAGE"||n?.onboardingDisplayMode==="BANNER"))return Or;const m=Or.findIndex(_=>_.path==="/settings"),x=[...Or];return x.splice(m,0,{path:"/walkthrough",label:"Walkthrough",icon:"🐣"}),x},[n?.onboardingDisplayMode]),c=bt(),[d,f]=p.useState(()=>localStorage.getItem("sidebar-collapsed")==="true");p.useEffect(()=>{localStorage.setItem("sidebar-collapsed",String(d))},[d]);const y=()=>{f(!d)};return a.jsxs("div",{className:`${c?"beta-shell__desktop":"beta-shell__mobile"}`,"data-shell":`${c?"desktop":"mobile"}`,children:[c&&a.jsxs("aside",{className:`beta-shell__desktop__sidebar ${d?"beta-shell__desktop__sidebar--collapsed":""}`,children:[a.jsx("nav",{className:"beta-shell__desktop__nav",children:a.jsx("div",{className:"beta-shell__desktop__navInner",children:a.jsx(se,{spacing:"1",children:o.map(g=>{const m=r.pathname.startsWith(g.path);return a.jsxs(aa,{to:g.path,title:d?g.label:void 0,className:`beta-shell__desktop__nav-item ${m?"beta-shell__desktop__nav-item--active":""}`,children:[a.jsx("span",{className:"beta-shell__desktop__nav-icon",children:g.icon}),!d&&a.jsx("span",{className:"beta-shell__desktop__nav-label",children:g.label})]},g.path)})})})}),a.jsx("button",{className:"beta-shell__desktop__sidebar--toggle",onClick:y,"aria-label":d?"Expand sidebar":"Collapse sidebar",children:d?"→":"←"})]}),a.jsx("div",{className:`${c?"beta-shell__desktop__main":""}`,children:s})]})}function sj(s){return typeof s=="object"&&s!==null}function aj(s){if(!sj(s))return;const n=s.detail;if(typeof n=="string"&&n.length>0)return n;const r=s.message;if(typeof r=="string"&&r.length>0)return r;const o=s.title;if(typeof o=="string"&&o.length>0)return o;const c=s.error_description;if(typeof c=="string"&&c.length>0)return c}class py extends Error{status;statusText;body;constructor(n,r){const o=aj(r)??`HTTP ${n.status}: ${n.statusText}`;super(o),this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.body=r}}class lt{config;constructor(n){this.config=n}async parseResponseBody(n,r="auto"){if(r==="void"||n.status===204||n.headers.get("content-length")==="0")return;if(r==="json")try{return await n.json()}catch{return}if(r==="text"){const d=await n.text();return d.length>0?d:void 0}if(r==="arrayBuffer"){const d=await n.arrayBuffer();return d.byteLength>0?d:void 0}if(n.headers.get("content-type")?.includes("application/json"))try{return await n.json()}catch{return}const c=await n.text();return c.length>0?c:void 0}hasHeader(n,r){const o=r.toLowerCase();return Object.keys(n).some(c=>c.toLowerCase()===o)}removeHeader(n,r){const o=r.toLowerCase();for(const c of Object.keys(n))c.toLowerCase()===o&&delete n[c]}async buildAuthHeaders(){const n={};if(this.config.getAccessToken){const r=await this.config.getAccessToken();n.Authorization=`Bearer ${r}`}return this.config.getCookies&&(n.Cookie=await this.config.getCookies()),n}async request(n,r,o){const c=new URL(r,this.config.baseUrl);if(o?.params)for(const[g,m]of Object.entries(o.params))m!=null&&c.searchParams.append(g,String(m));const d={};if(this.config.headers)for(const[g,m]of Object.entries(this.config.headers))m!=null&&(d[g]=String(m));if(o?.headers)for(const[g,m]of Object.entries(o.headers))m!=null&&(d[g]=String(m));Object.assign(d,await this.buildAuthHeaders());let f;if(o?.body!==void 0){const g=o.bodyType??"json";g==="form-data"?(f=o.body,this.removeHeader(d,"Content-Type")):g==="raw"?f=o.body:(this.hasHeader(d,"Content-Type")||(d["Content-Type"]="application/json"),f=JSON.stringify(o.body))}const y=await fetch(c.toString(),{method:n,headers:d,body:f,signal:o?.signal,credentials:this.config.credentials});if(!y.ok){const g=await this.parseResponseBody(y,"auto");throw new py(y,g)}return await this.parseResponseBody(y,o?.responseType??"auto")}async*streamEvents(n,r){const o=new URL(n,this.config.baseUrl);if(r?.params)for(const[m,x]of Object.entries(r.params))x!=null&&o.searchParams.append(m,String(x));const c={Accept:"text/event-stream"};if(this.config.headers)for(const[m,x]of Object.entries(this.config.headers))x!=null&&(c[m]=String(x));if(r?.headers)for(const[m,x]of Object.entries(r.headers))x!=null&&(c[m]=String(x));Object.assign(c,await this.buildAuthHeaders());const d=await fetch(o.toString(),{method:"GET",headers:c,signal:r?.signal,credentials:this.config.credentials});if(!d.ok){const m=await this.parseResponseBody(d);throw new py(d,m)}if(!d.body)throw new Error("Response body is null");const f=d.body.getReader(),y=new TextDecoder;let g="";try{for(;;){const{done:m,value:x}=await f.read();if(m)break;g+=y.decode(x,{stream:!0});const _=g.split(`
|
|
12
|
-
`);g=_.pop()||"";for(const v of _)if(v.startsWith("data: ")){const T=v.slice(6);try{yield JSON.parse(T)}catch{yield T}}}}finally{f.releaseLock()}}}class lj extends lt{constructor(n){super(n)}async AppController_getHello(n){return this.request("GET","/api/v1",{signal:n?.signal})}}class rj extends lt{constructor(n){super(n)}async MetaController_createTag(n){return this.request("POST","/api/v1/meta/tags",{body:n.body,signal:n?.signal})}async MetaController_getAllTags(n){return this.request("GET","/api/v1/meta/tags",{signal:n?.signal})}async MetaController_getTagColors(n){return this.request("GET","/api/v1/meta/tags/colors",{signal:n?.signal})}async MetaController_deleteTag(n){return this.request("DELETE",`/api/v1/meta/tags/${n.tagId}`,{responseType:"void",signal:n?.signal})}}class ij extends lt{constructor(n){super(n)}async ProjectsController_createProject(n){return this.request("POST","/api/v1/meta/projects",{body:n.body,signal:n?.signal})}async ProjectsController_getAllProjects(n){return this.request("GET","/api/v1/meta/projects",{signal:n?.signal})}async ProjectsController_searchProjects(n){return this.request("GET","/api/v1/meta/projects/search",{params:{q:n.q,limit:n.limit,threshold:n.threshold},signal:n?.signal})}async ProjectsController_getProjectBySlug(n){return this.request("GET",`/api/v1/meta/projects/by-slug/${n.slug}`,{signal:n?.signal})}async ProjectsController_getProject(n){return this.request("GET",`/api/v1/meta/projects/${n.projectId}`,{signal:n?.signal})}async ProjectsController_updateProject(n){return this.request("PATCH",`/api/v1/meta/projects/${n.projectId}`,{body:n.body,signal:n?.signal})}async ProjectsController_deleteProject(n){return this.request("DELETE",`/api/v1/meta/projects/${n.projectId}`,{responseType:"void",signal:n?.signal})}}class oj extends lt{constructor(n){super(n)}async ClientRegistrationController_registerClient(n){return this.request("POST",`/api/v1/auth/clients/register/mcp/${n.serverId}/${n.version}`,{body:n.body,signal:n?.signal})}async ClientRegistrationController_getClient(n){return this.request("GET",`/api/v1/auth/clients/${n.clientId}`,{signal:n?.signal})}async ClientRegistrationController_listClients(n){return this.request("GET","/api/v1/auth/clients",{signal:n?.signal})}async AuthorizationController_authorize(n){return this.request("GET",`/api/v1/auth/authorize/mcp/${n.serverIdentifier}/${n.version}`,{params:{response_type:n.response_type,scope:n.scope,client_id:n.client_id,code_challenge:n.code_challenge,code_challenge_method:n.code_challenge_method,redirect_uri:n.redirect_uri,state:n.state,resource:n.resource},responseType:"void",signal:n?.signal})}async AuthorizationController_authorizeConsent(n){return this.request("POST",`/api/v1/auth/authorize/mcp/${n.serverIdentifier}/${n.version}`,{body:n.body,responseType:"void",signal:n?.signal})}async AuthorizationController_getConsentMetadata(n){return this.request("GET",`/api/v1/auth/consent/${n.flowId}`,{signal:n?.signal})}async AuthorizationController_token(n){return this.request("POST",`/api/v1/auth/token/mcp/${n.serverIdentifier}/${n.version}`,{body:n.body,signal:n?.signal})}async AuthorizationController_introspect(n){return this.request("POST",`/api/v1/auth/introspect/mcp/${n.serverIdentifier}/${n.version}`,{body:n.body,signal:n?.signal})}async AuthorizationController_tokenExchange(n){return this.request("POST",`/api/v1/auth/token-exchange/mcp/${n.serverIdentifier}/${n.version}`,{body:n.body,signal:n?.signal})}async AuthorizationController_callback(n){return this.request("GET","/api/v1/auth/callback",{params:{code:n.code,state:n.state,error:n.error,scope:n.scope,error_description:n.error_description},responseType:"void",signal:n?.signal})}async AuthorizationController_getScopes(n){return this.request("GET","/api/v1/auth/scopes",{signal:n?.signal})}}class cj extends lt{constructor(n){super(n)}async WebAuthController_login(n){return this.request("POST","/api/v1/auth/login",{body:n.body,signal:n?.signal})}async WebAuthController_refresh(n){return this.request("POST","/api/v1/auth/refresh",{signal:n?.signal})}async WebAuthController_logout(n){return this.request("POST","/api/v1/auth/logout",{signal:n?.signal})}async WebAuthController_me(n){return this.request("GET","/api/v1/auth/me",{signal:n?.signal})}async WebAuthController_changePassword(n){return this.request("POST","/api/v1/auth/change-password",{body:n.body,signal:n?.signal})}async WebAuthController_getOnboardingStatus(n){return this.request("GET","/api/v1/auth/onboarding-status",{signal:n?.signal})}async WebAuthController_onboard(n){return this.request("POST","/api/v1/auth/onboard",{body:n.body,signal:n?.signal})}async WebAuthController_markWalkthroughSeen(n){return this.request("POST","/api/v1/auth/mark-walkthrough-seen",{signal:n?.signal})}}class uj extends lt{constructor(n){super(n)}async AuthJourneysController_getAuthJourneys(n){return this.request("GET",`/api/v1/auth-journeys/servers/${n.serverId}`,{signal:n?.signal})}}class dj extends lt{constructor(n){super(n)}async McpRegistryController_createServer(n){return this.request("POST","/api/v1/mcp/servers",{body:n.body,signal:n?.signal})}async McpRegistryController_listServers(n){return this.request("GET","/api/v1/mcp/servers",{params:{page:n?.page,limit:n?.limit},signal:n?.signal})}async McpRegistryController_getServer(n){return this.request("GET",`/api/v1/mcp/servers/${n.serverId}`,{signal:n?.signal})}async McpRegistryController_updateServer(n){return this.request("PATCH",`/api/v1/mcp/servers/${n.serverId}`,{body:n.body,signal:n?.signal})}async McpRegistryController_deleteServer(n){return this.request("DELETE",`/api/v1/mcp/servers/${n.serverId}`,{signal:n?.signal})}async McpRegistryController_createScopes(n){return this.request("POST",`/api/v1/mcp/servers/${n.serverId}/scopes`,{body:n.body,signal:n?.signal})}async McpRegistryController_listScopes(n){return this.request("GET",`/api/v1/mcp/servers/${n.serverId}/scopes`,{signal:n?.signal})}async McpRegistryController_getScope(n){return this.request("GET",`/api/v1/mcp/servers/${n.serverId}/scopes/${n.scopeId}`,{signal:n?.signal})}async McpRegistryController_deleteScope(n){return this.request("DELETE",`/api/v1/mcp/servers/${n.serverId}/scopes/${n.scopeId}`,{signal:n?.signal})}async McpRegistryController_createConnection(n){return this.request("POST",`/api/v1/mcp/servers/${n.serverId}/connections`,{body:n.body,signal:n?.signal})}async McpRegistryController_listConnections(n){return this.request("GET",`/api/v1/mcp/servers/${n.serverId}/connections`,{signal:n?.signal})}async McpRegistryController_getConnection(n){return this.request("GET",`/api/v1/mcp/connections/${n.connectionId}`,{signal:n?.signal})}async McpRegistryController_updateConnection(n){return this.request("PATCH",`/api/v1/mcp/connections/${n.connectionId}`,{body:n.body,signal:n?.signal})}async McpRegistryController_deleteConnection(n){return this.request("DELETE",`/api/v1/mcp/connections/${n.connectionId}`,{signal:n?.signal})}async McpRegistryController_createMapping(n){return this.request("POST",`/api/v1/mcp/servers/${n.serverId}/mappings`,{body:n.body,signal:n?.signal})}async McpRegistryController_listMappings(n){return this.request("GET",`/api/v1/mcp/servers/${n.serverId}/scopes/${n.scopeId}/mappings`,{signal:n?.signal})}async McpRegistryController_deleteMapping(n){return this.request("DELETE",`/api/v1/mcp/mappings/${n.mappingId}`,{signal:n?.signal})}}class hj extends lt{constructor(n){super(n)}async JwksController_getJwks(n){return this.request("GET","/.well-known/jwks.json",{signal:n?.signal})}}class fj extends lt{constructor(n){super(n)}async ActorController_listActors(n){return this.request("GET","/api/v1/actors",{signal:n?.signal})}async ActorController_searchActors(n){return this.request("GET","/api/v1/actors/search",{params:{query:n.query,limit:n.limit,threshold:n.threshold},signal:n?.signal})}}class pj extends lt{constructor(n){super(n)}async TasksController_createTask(n){return this.request("POST","/api/v1/tasks/tasks",{body:n.body,signal:n?.signal})}async TasksController_listTasks(n){return this.request("GET","/api/v1/tasks/tasks",{params:{assignee:n?.assignee,sessionId:n?.sessionId,tag:n?.tag,page:n?.page,limit:n?.limit},signal:n?.signal})}async TasksController_updateTask(n){return this.request("PATCH",`/api/v1/tasks/tasks/${n.id}`,{body:n.body,signal:n?.signal})}async TasksController_deleteTask(n){return this.request("DELETE",`/api/v1/tasks/tasks/${n.id}`,{responseType:"void",signal:n?.signal})}async TasksController_getTask(n){return this.request("GET",`/api/v1/tasks/tasks/${n.id}`,{signal:n?.signal})}async TasksController_assignTask(n){return this.request("PATCH",`/api/v1/tasks/tasks/${n.id}/assign`,{body:n.body,signal:n?.signal})}async TasksController_assignTaskToMe(n){return this.request("PATCH",`/api/v1/tasks/tasks/${n.id}/assign-to-me`,{signal:n?.signal})}async TasksController_searchTasks(n){return this.request("GET","/api/v1/tasks/tasks/search/query",{params:{query:n.query,limit:n.limit,threshold:n.threshold},signal:n?.signal})}async TasksController_addComment(n){return this.request("POST",`/api/v1/tasks/tasks/${n.id}/comments`,{body:n.body,signal:n?.signal})}async TasksController_addArtefact(n){return this.request("POST",`/api/v1/tasks/tasks/${n.id}/artefacts`,{body:n.body,signal:n?.signal})}async TasksController_changeStatus(n){return this.request("PATCH",`/api/v1/tasks/tasks/${n.id}/status`,{body:n.body,signal:n?.signal})}async TasksController_addTagToTask(n){return this.request("POST",`/api/v1/tasks/tasks/${n.id}/tags`,{body:n.body,signal:n?.signal})}async TasksController_removeTagFromTask(n){return this.request("DELETE",`/api/v1/tasks/tasks/${n.id}/tags/${n.tagId}`,{signal:n?.signal})}async TasksController_createInputRequest(n){return this.request("POST",`/api/v1/tasks/tasks/${n.id}/input-requests`,{body:n.body,signal:n?.signal})}async TasksController_answerInputRequest(n){return this.request("POST",`/api/v1/tasks/tasks/${n.id}/input-requests/${n.inputRequestId}/answer`,{body:n.body,signal:n?.signal})}async TasksController_handleMcp_get(n){return this.request("GET","/api/v1/tasks/tasks/mcp",{responseType:"void",signal:n?.signal})}async TasksController_handleMcp_post(n){return this.request("POST","/api/v1/tasks/tasks/mcp",{responseType:"void",signal:n?.signal})}async TasksController_handleMcp_put(n){return this.request("PUT","/api/v1/tasks/tasks/mcp",{responseType:"void",signal:n?.signal})}async TasksController_handleMcp_delete(n){return this.request("DELETE","/api/v1/tasks/tasks/mcp",{responseType:"void",signal:n?.signal})}async TasksController_handleMcp_patch(n){return this.request("PATCH","/api/v1/tasks/tasks/mcp",{responseType:"void",signal:n?.signal})}async TasksController_handleMcp_options(n){return this.request("OPTIONS","/api/v1/tasks/tasks/mcp",{responseType:"void",signal:n?.signal})}async TasksController_handleMcp_head(n){return this.request("HEAD","/api/v1/tasks/tasks/mcp",{responseType:"void",signal:n?.signal})}}class gj extends lt{constructor(n){super(n)}async AgentRunsController_createAgentRun(n){return this.request("POST","/api/v1/agent-runs",{body:n.body,signal:n?.signal})}async AgentRunsController_listAgentRuns(n){return this.request("GET","/api/v1/agent-runs",{params:{actorId:n?.actorId,parentTaskId:n?.parentTaskId,page:n?.page,limit:n?.limit},signal:n?.signal})}async AgentRunsController_getAgentRunById(n){return this.request("GET",`/api/v1/agent-runs/${n.runId}`,{signal:n?.signal})}async AgentRunsController_updateAgentRun(n){return this.request("PATCH",`/api/v1/agent-runs/${n.runId}`,{body:n.body,signal:n?.signal})}}class mj extends lt{constructor(n){super(n)}async ThreadsController_createThread(n){return this.request("POST","/api/v1/threads",{body:n.body,signal:n?.signal})}async ThreadsController_listThreads(n){return this.request("GET","/api/v1/threads",{params:{page:n?.page,limit:n?.limit},signal:n?.signal})}async ThreadsController_updateThread(n){return this.request("PATCH",`/api/v1/threads/${n.id}`,{body:n.body,signal:n?.signal})}async ThreadsController_getThread(n){return this.request("GET",`/api/v1/threads/${n.id}`,{signal:n?.signal})}async ThreadsController_deleteThread(n){return this.request("DELETE",`/api/v1/threads/${n.id}`,{responseType:"void",signal:n?.signal})}async ThreadsController_getThreadByTaskId(n){return this.request("GET",`/api/v1/threads/by-task/${n.taskId}`,{signal:n?.signal})}async ThreadsController_getThreadsByStateBlockId(n){return this.request("GET",`/api/v1/threads/by-state-block/${n.stateBlockId}`,{signal:n?.signal})}async ThreadsController_attachTask(n){return this.request("POST",`/api/v1/threads/${n.id}/tasks`,{body:n.body,signal:n?.signal})}async ThreadsController_referenceContextBlock(n){return this.request("POST",`/api/v1/threads/${n.id}/context-blocks`,{body:n.body,signal:n?.signal})}async ThreadsController_addTagToThread(n){return this.request("POST",`/api/v1/threads/${n.id}/tags`,{body:n.body,signal:n?.signal})}async ThreadsController_removeTagFromThread(n){return this.request("DELETE",`/api/v1/threads/${n.id}/tags/${n.tagId}`,{signal:n?.signal})}async ThreadsController_addParticipant(n){return this.request("POST",`/api/v1/threads/${n.id}/participants`,{body:n.body,signal:n?.signal})}async ThreadsController_getThreadState(n){return this.request("GET",`/api/v1/threads/${n.id}/state`,{signal:n?.signal})}async ThreadsController_updateThreadState(n){return this.request("PATCH",`/api/v1/threads/${n.id}/state`,{body:n.body,signal:n?.signal})}async ThreadsController_appendThreadState(n){return this.request("POST",`/api/v1/threads/${n.id}/state/append`,{body:n.body,signal:n?.signal})}async ThreadsController_createMessage(n){return this.request("POST",`/api/v1/threads/${n.id}/messages`,{body:n.body,signal:n?.signal})}async ThreadsController_listMessages(n){return this.request("GET",`/api/v1/threads/${n.id}/messages`,{params:{page:n.page,limit:n.limit},signal:n?.signal})}}class yj extends lt{constructor(n){super(n)}async AgentsController_createAgent(n){return this.request("POST","/api/v1/agents",{body:n.body,signal:n?.signal})}async AgentsController_listAgents(n){return this.request("GET","/api/v1/agents",{params:{isActive:n?.isActive,page:n?.page,limit:n?.limit},signal:n?.signal})}async AgentsController_listAgentTemplates(n){return this.request("GET","/api/v1/agents/templates",{signal:n?.signal})}async AgentsController_getAgentBySlug(n){return this.request("GET",`/api/v1/agents/${n.slug}`,{signal:n?.signal})}async AgentsController_patchAgent(n){return this.request("PATCH",`/api/v1/agents/${n.actorId}`,{body:n.body,signal:n?.signal})}async AgentsController_deleteAgent(n){return this.request("DELETE",`/api/v1/agents/${n.actorId}`,{responseType:"void",signal:n?.signal})}async AgentToolPermissionsController_listAgentToolPermissions(n){return this.request("GET",`/api/v1/agents/${n.actorId}/tool-permissions`,{signal:n?.signal})}async AgentToolPermissionsController_upsertAgentToolPermission(n){return this.request("PUT",`/api/v1/agents/${n.actorId}/tool-permissions/${n.serverId}`,{body:n.body,signal:n?.signal})}async AgentToolPermissionsController_deleteAgentToolPermission(n){return this.request("DELETE",`/api/v1/agents/${n.actorId}/tool-permissions/${n.serverId}`,{responseType:"void",signal:n?.signal})}}class xj extends lt{constructor(n){super(n)}async AgentTokensController_issueToken(n){return this.request("POST",`/api/v1/agents/${n.slug}/tokens`,{body:n.body,signal:n?.signal})}async AgentTokensController_listTokens(n){return this.request("GET",`/api/v1/agents/${n.slug}/tokens`,{signal:n?.signal})}async AgentTokensController_revokeToken(n){return this.request("DELETE",`/api/v1/agents/${n.slug}/tokens/${n.tokenId}`,{signal:n?.signal})}}class vj extends lt{constructor(n){super(n)}async AgentExecutionTokensController_requestExecutionToken(n){return this.request("POST",`/api/v1/agents/${n.slug}/execution-token`,{body:n.body,signal:n?.signal})}}class bj extends lt{constructor(n){super(n)}async ContextController_createBlock(n){return this.request("POST","/api/v1/context/blocks",{body:n.body,signal:n?.signal})}async ContextController_listBlocks(n){return this.request("GET","/api/v1/context/blocks",{params:{tag:n?.tag},signal:n?.signal})}async ContextController_searchBlocks(n){return this.request("GET","/api/v1/context/blocks/search/query",{params:{query:n.query,limit:n.limit,threshold:n.threshold},signal:n?.signal})}async ContextController_getBlockTree(n){return this.request("GET","/api/v1/context/blocks/tree",{signal:n?.signal})}async ContextController_exportBlocks(n){return this.request("GET","/api/v1/context/blocks/export",{responseType:"arrayBuffer",signal:n?.signal})}async ContextController_importBlocks(n){return this.request("POST","/api/v1/context/blocks/import",{body:n.body,bodyType:"form-data",signal:n?.signal})}async ContextController_getBlock(n){return this.request("GET",`/api/v1/context/blocks/${n.id}`,{signal:n?.signal})}async ContextController_updateBlock(n){return this.request("PATCH",`/api/v1/context/blocks/${n.id}`,{body:n.body,signal:n?.signal})}async ContextController_deleteBlock(n){return this.request("DELETE",`/api/v1/context/blocks/${n.id}`,{responseType:"void",signal:n?.signal})}async ContextController_appendToBlock(n){return this.request("POST",`/api/v1/context/blocks/${n.id}/append`,{body:n.body,signal:n?.signal})}async ContextController_reorderBlock(n){return this.request("PATCH",`/api/v1/context/blocks/${n.id}/reorder`,{body:n.body,signal:n?.signal})}async ContextController_moveBlock(n){return this.request("PATCH",`/api/v1/context/blocks/${n.id}/move`,{body:n.body,signal:n?.signal})}async ContextController_addTagToBlock(n){return this.request("POST",`/api/v1/context/blocks/${n.id}/tags`,{body:n.body,signal:n?.signal})}async ContextController_removeTagFromBlock(n){return this.request("DELETE",`/api/v1/context/blocks/${n.id}/tags/${n.tagId}`,{signal:n?.signal})}async ContextController_handleMcp_get(n){return this.request("GET","/api/v1/context/blocks/mcp",{responseType:"void",signal:n?.signal})}async ContextController_handleMcp_post(n){return this.request("POST","/api/v1/context/blocks/mcp",{responseType:"void",signal:n?.signal})}async ContextController_handleMcp_put(n){return this.request("PUT","/api/v1/context/blocks/mcp",{responseType:"void",signal:n?.signal})}async ContextController_handleMcp_delete(n){return this.request("DELETE","/api/v1/context/blocks/mcp",{responseType:"void",signal:n?.signal})}async ContextController_handleMcp_patch(n){return this.request("PATCH","/api/v1/context/blocks/mcp",{responseType:"void",signal:n?.signal})}async ContextController_handleMcp_options(n){return this.request("OPTIONS","/api/v1/context/blocks/mcp",{responseType:"void",signal:n?.signal})}async ContextController_handleMcp_head(n){return this.request("HEAD","/api/v1/context/blocks/mcp",{responseType:"void",signal:n?.signal})}}class Sj extends lt{constructor(n){super(n)}async ChatProvidersController_createChatProvider(n){return this.request("POST","/api/v1/chat-providers",{body:n.body,signal:n?.signal})}async ChatProvidersController_listChatProviders(n){return this.request("GET","/api/v1/chat-providers",{signal:n?.signal})}async ChatProvidersController_getChatProvider(n){return this.request("GET",`/api/v1/chat-providers/${n.id}`,{signal:n?.signal})}async ChatProvidersController_updateChatProvider(n){return this.request("PATCH",`/api/v1/chat-providers/${n.id}`,{body:n.body,signal:n?.signal})}async ChatProvidersController_deleteChatProvider(n){return this.request("DELETE",`/api/v1/chat-providers/${n.id}`,{responseType:"void",signal:n?.signal})}async ChatProvidersController_setActiveChatProvider(n){return this.request("POST","/api/v1/chat-providers/set-active",{body:n.body,signal:n?.signal})}async ChatProvidersController_deactivateActiveChatProvider(n){return this.request("POST","/api/v1/chat-providers/deactivate",{responseType:"void",signal:n?.signal})}}class _j extends lt{constructor(n){super(n)}async SecretsController_createSecret(n){return this.request("POST","/api/v1/secrets",{body:n.body,signal:n?.signal})}async SecretsController_listSecrets(n){return this.request("GET","/api/v1/secrets",{signal:n?.signal})}async SecretsController_getSecret(n){return this.request("GET",`/api/v1/secrets/${n.id}`,{signal:n?.signal})}async SecretsController_updateSecret(n){return this.request("PATCH",`/api/v1/secrets/${n.id}`,{body:n.body,signal:n?.signal})}async SecretsController_deleteSecret(n){return this.request("DELETE",`/api/v1/secrets/${n.id}`,{responseType:"void",signal:n?.signal})}async SecretsController_getSecretValue(n){return this.request("GET",`/api/v1/secrets/${n.id}/value`,{signal:n?.signal})}}class Tj extends lt{constructor(n){super(n)}async TaskExecutionQueueController_listQueue(n){return this.request("GET","/api/v1/executions/queue",{signal:n?.signal})}async TaskExecutionQueueController_claimTask(n){return this.request("POST",`/api/v1/executions/queue/${n.taskId}/claim`,{signal:n?.signal})}async ActiveTaskExecutionController_listActiveExecutions(n){return this.request("GET","/api/v1/executions/active",{signal:n?.signal})}async ActiveTaskExecutionController_stopTaskExecution(n){return this.request("POST",`/api/v1/executions/active/${n.executionId}/stop`,{body:n.body,signal:n?.signal})}async ActiveTaskExecutionController_updateRunnerSessionId(n){return this.request("PATCH",`/api/v1/executions/active/${n.executionId}/session`,{body:n.body,responseType:"void",signal:n?.signal})}async ActiveTaskExecutionController_incrementToolCallCount(n){return this.request("PATCH",`/api/v1/executions/active/${n.executionId}/tool-calls/increment`,{responseType:"void",signal:n?.signal})}async TaskExecutionHistoryController_listHistory(n){return this.request("GET","/api/v1/executions/history",{signal:n?.signal})}}class jj extends lt{constructor(n){super(n)}async WorkersController_listWorkers(n){return this.request("GET","/api/v1/workers",{signal:n?.signal})}}class wj extends lt{constructor(n){super(n)}async TaskBlueprintsController_createTaskBlueprint(n){return this.request("POST","/api/v1/task-blueprints",{body:n.body,signal:n?.signal})}async TaskBlueprintsController_listTaskBlueprints(n){return this.request("GET","/api/v1/task-blueprints",{params:{page:n?.page,limit:n?.limit},signal:n?.signal})}async TaskBlueprintsController_getTaskBlueprint(n){return this.request("GET",`/api/v1/task-blueprints/${n.id}`,{signal:n?.signal})}async TaskBlueprintsController_updateTaskBlueprint(n){return this.request("PATCH",`/api/v1/task-blueprints/${n.id}`,{body:n.body,signal:n?.signal})}async TaskBlueprintsController_deleteTaskBlueprint(n){return this.request("DELETE",`/api/v1/task-blueprints/${n.id}`,{responseType:"void",signal:n?.signal})}async TaskBlueprintsController_createTaskFromBlueprint(n){return this.request("POST",`/api/v1/task-blueprints/${n.id}/create-task`,{signal:n?.signal})}}class Ej extends lt{constructor(n){super(n)}async ScheduledTasksController_createScheduledTask(n){return this.request("POST","/api/v1/scheduled-tasks",{body:n.body,signal:n?.signal})}async ScheduledTasksController_listScheduledTasks(n){return this.request("GET","/api/v1/scheduled-tasks",{params:{page:n?.page,limit:n?.limit,enabled:n?.enabled},signal:n?.signal})}async ScheduledTasksController_getScheduledTask(n){return this.request("GET",`/api/v1/scheduled-tasks/${n.id}`,{signal:n?.signal})}async ScheduledTasksController_updateScheduledTask(n){return this.request("PATCH",`/api/v1/scheduled-tasks/${n.id}`,{body:n.body,signal:n?.signal})}async ScheduledTasksController_deleteScheduledTask(n){return this.request("DELETE",`/api/v1/scheduled-tasks/${n.id}`,{responseType:"void",signal:n?.signal})}}class kj extends lt{constructor(n){super(n)}async DiscoveryController_getIssuer(n){return this.request("GET","/.well-known/oauth-authorization-server/mcp/issuer",{signal:n?.signal})}async DiscoveryController_getAuthorizationServerMetadata(n){return this.request("GET",`/.well-known/oauth-authorization-server/mcp/${n.mcpServerId}/${n.version}`,{signal:n?.signal})}async DiscoveryController_all(n){return this.request("GET",`/.well-known/oauth-protected-resource/${n.path}`,{signal:n?.signal})}}class Cj extends lt{constructor(n){super(n)}async GlobalSearchController_search(n){return this.request("GET","/api/v1/search/query",{params:{query:n.query,limit:n.limit,threshold:n.threshold},signal:n?.signal})}}class Nj extends lt{constructor(n){super(n)}async WalkthroughController_acknowledge(n){return this.request("POST","/api/v1/walkthrough/acknowledge",{responseType:"void",signal:n?.signal})}async WalkthroughController_getStatus(n){return this.request("GET","/api/v1/walkthrough/status",{signal:n?.signal})}}class Gn{app;meta;metaProjects;authorizationServer;webAuthentication;authorizationJourneys;tools;jwks;actors;task;agentrun;threads;agent;agentTokens;agentExecutionTokens;context;chatProviders;secrets;executions;workers;taskBlueprints;scheduledTasks;discovery;search;walkthrough;constructor(n){this.app=new lj(n),this.meta=new rj(n),this.metaProjects=new ij(n),this.authorizationServer=new oj(n),this.webAuthentication=new cj(n),this.authorizationJourneys=new uj(n),this.tools=new dj(n),this.jwks=new hj(n),this.actors=new fj(n),this.task=new pj(n),this.agentrun=new gj(n),this.threads=new mj(n),this.agent=new yj(n),this.agentTokens=new xj(n),this.agentExecutionTokens=new vj(n),this.context=new bj(n),this.chatProviders=new Sj(n),this.secrets=new _j(n),this.executions=new Tj(n),this.workers=new jj(n),this.taskBlueprints=new wj(n),this.scheduledTasks=new Ej(n),this.discovery=new kj(n),this.search=new Cj(n),this.walkthrough=new Nj(n)}}const Aj=window.location.origin,Rj=new Gn({baseUrl:Aj,credentials:"include"}),eh=Rj.walkthrough,zj=()=>{console.log("useHome mounting");const[s,n]=p.useState(null);return p.useEffect(()=>{console.log("useHome setting message"),n("Message coming from useHome")},[]),{message:s,setMessage:n}},bx=p.createContext(null);function Dj({children:s}){const{message:n}=zj(),[r,o]=p.useState(""),c=p.useMemo(()=>({message:n,sectionTitle:r,setSectionTitle:o}),[n,r,o]);return a.jsx(bx.Provider,{value:c,children:s})}function ns(){const s=p.useContext(bx);if(!s)throw new Error("useHomeCtx must be used within <HomeProvider>");return s}const Oj=window.location.origin,Sx=new Gn({baseUrl:Oj,credentials:"include"}),Lj=Sx.search;Sx.search;function _x(){const[s,n]=p.useState(null),[r,o]=p.useState(!0),[c,d]=p.useState(null);return p.useEffect(()=>{eh.WalkthroughController_getStatus().then(f=>{const y=[{id:"worker",label:"Configure a worker",description:"A worker is a process that runs on your machine and executes agent tasks. Launch the Taico worker binary, then authenticate it with your account — it will appear here once connected.",href:"/settings/workers",completed:f.workerConfigured},{id:"agent",label:"Create an agent",description:"Agents are AI assistants that work on tasks. Create one by picking a runner (e.g. Claude Code, OpenCode), choosing a template, and selecting which tools it can use.",href:"/agents",completed:f.agentCreated},{id:"task",label:"Create a task",description:"Tasks are the core unit of work in Taico. Create your first task, write a clear description, and assign it to an agent to get it working.",href:"/tasks",completed:f.taskCreated},{id:"project-create",label:"Create a project",description:"Projects are created automatically when you add a tag in the format project:<name> to any task. Go to Tasks, open or create a task, and add a tag like project:my-app. Taico will create the project entry for you.",href:"/tasks",completed:f.projectCreated},{id:"project-configure",label:"Configure a project",description:"Link your project to a code repository. Go to Settings → Projects, find your project, and add a repository URL. Taico will automatically clone that repo for any task tagged with this project — no need to specify it per-task.",href:"/settings/projects",completed:f.projectConfigured},{id:"task-with-project",label:"Assign a task to an agent with a project",description:"Tag a task with a project tag and assign it to an agent. Taico will clone the linked repository and make it available in the agent's working directory automatically.",href:"/tasks",completed:f.taskWithProjectCreated},{id:"context",label:"Create a context block",description:"Context blocks are reusable pieces of text — instructions, reference docs, coding standards — that you can attach to tasks and threads. Agents will read them as part of their prompt.",href:"/context",completed:f.contextBlockCreated},{id:"thread",label:"Configure threads",description:"Threads coordinate parallel work when a task branches into sub-tasks. They are created automatically when a task spawns children. Explore the Threads section to see how work is organized.",href:"/settings/chat",completed:f.threadConfigured}],g=y.filter(m=>m.completed).length;n({steps:y,completedCount:g,totalCount:y.length,displayMode:f.onboardingDisplayMode})}).catch(f=>{console.error("Failed to fetch walkthrough status:",f),d(f instanceof Error?f.message:"Failed to load walkthrough")}).finally(()=>{o(!1)})},[]),{status:s,isLoading:r,error:c}}function qj(){const{user:s,refreshAuth:n}=zn(),{status:r}=_x(),o=ze(),[c,d]=p.useState(!1),[f,y]=p.useState(!1);if(s?.onboardingDisplayMode!=="BANNER"||c)return null;const g=r?.completedCount??0,m=r?.totalCount??7,x=m-g,_=()=>o("/walkthrough"),v=E=>{E.stopPropagation(),d(!0)},T=async E=>{E.stopPropagation();try{y(!0),await js.webAuthControllerMarkWalkthroughSeen(),await n()}catch(j){console.error("Failed to hide walkthrough:",j),y(!1)}};return a.jsx("div",{className:"home-walkthrough-wrap",children:a.jsxs("div",{className:"home-walkthrough-card",onClick:_,role:"button",tabIndex:0,onKeyDown:E=>E.key==="Enter"&&_(),children:[a.jsx("div",{className:"home-walkthrough-dots","aria-hidden":"true",children:Array.from({length:m}).map((E,j)=>a.jsx("span",{className:`home-walkthrough-dot${j<g?" home-walkthrough-dot--done":""}`},j))}),a.jsxs("div",{className:"home-walkthrough-body",children:[a.jsx(S,{size:"2",weight:"semibold",children:x===0?"Setup complete!":`${x} step${x===1?"":"s"} to go`}),a.jsxs(S,{size:"1",tone:"muted",children:[g," of ",m," setup steps completed · Click to continue"]})]}),a.jsxs("div",{className:"home-walkthrough-actions",children:[a.jsx("button",{className:"home-walkthrough-not-now",onClick:v,children:"Not now"}),a.jsx("button",{className:"home-walkthrough-all-set",onClick:T,disabled:f,children:f?"…":"I'm all set"})]})]})})}function Mj(){const s=ze(),{setSectionTitle:n}=ns(),[r,o]=p.useState(""),[c,d]=p.useState([]),[f,y]=p.useState(!1),[g,m]=p.useState(-1),x=p.useRef(null),_=p.useRef([]);qt(),p.useEffect(()=>{n(""),x.current?.focus()},[n]);const v=p.useCallback(async w=>{if(!w.trim()){d([]),m(-1);return}y(!0);try{const N=await Lj.GlobalSearchController_search({query:w,limit:20});d(N),m(-1),_.current=[]}catch(N){console.error("Search failed:",N),d([])}finally{y(!1)}},[]);p.useEffect(()=>{const w=setTimeout(()=>{v(r)},300);return()=>clearTimeout(w)},[r,v]);const T=w=>{w.key==="ArrowDown"?(w.preventDefault(),m(N=>{const O=N<c.length-1?N+1:N;return setTimeout(()=>{_.current[O]?.scrollIntoView({behavior:"smooth",block:"nearest"})},0),O})):w.key==="ArrowUp"?(w.preventDefault(),m(N=>{const O=N>0?N-1:0;return setTimeout(()=>{_.current[O]?.scrollIntoView({behavior:"smooth",block:"nearest"})},0),O})):w.key==="Enter"&&g>=0&&c[g]&&(w.preventDefault(),s(c[g].url))},E=w=>{s(w)},j=w=>{switch(w){case"task":return"blue";case"context_block":return"purple";case"agent":return"green";case"project":return"orange";case"tag":return"yellow";case"tool":return"red";default:return"gray"}},k=w=>{switch(w){case"task":return"Task";case"context_block":return"Context";case"agent":return"Agent";case"project":return"Project";case"tag":return"Tag";case"tool":return"Tool";default:return w}};return a.jsxs("div",{className:"home-page",children:[a.jsx(qj,{}),a.jsx("div",{className:"home-page-search",children:a.jsx("div",{className:"home-search-container",children:a.jsxs(se,{spacing:"6",align:"center",children:[a.jsxs(se,{spacing:"3",align:"center",children:[a.jsx(S,{size:"6",weight:"bold",className:"home-search-title",children:"Find anything"}),a.jsx(S,{size:"3",tone:"muted",className:"home-search-subtitle",children:"Search across tasks, context, agents, tools, and more"})]}),a.jsx("div",{className:"home-search-box",children:a.jsx("input",{ref:x,type:"text",className:"home-search-input",placeholder:"Search...",value:r,onChange:w=>o(w.target.value),onKeyDown:T,autoFocus:!0})}),r&&a.jsx(Qe,{className:"home-search-results",children:a.jsxs(se,{spacing:"2",children:[f&&a.jsx(S,{tone:"muted",size:"2",children:"Searching..."}),!f&&c.length===0&&a.jsx(S,{tone:"muted",size:"2",children:"No results found"}),!f&&c.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs(S,{size:"1",tone:"muted",children:[c.length," ",c.length===1?"result":"results"]}),a.jsx("div",{className:"home-search-results-list",children:c.map((w,N)=>a.jsx("div",{ref:O=>{_.current[N]=O},children:a.jsxs(FT,{interactive:!0,onClick:()=>E(w.url),className:`home-search-result-row ${N===g?"home-search-result-row--selected":""}`,children:[a.jsx("div",{className:"home-search-result-main",children:a.jsx(S,{weight:"medium",size:"3",children:w.title})}),a.jsxs("div",{className:"home-search-result-meta",children:[a.jsx(ws,{color:j(w.type),children:k(w.type)}),a.jsxs(S,{size:"1",tone:"muted",children:[Math.round(w.score*100),"% match"]})]})]})},w.id))})]})]})}),a.jsxs(xt,{spacing:"2",className:"home-quick-links",children:[a.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>s("/tasks"),children:"Tasks"}),a.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>s("/threads"),children:"Threads"}),a.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>s("/agents"),children:"Agents"}),a.jsx(ce,{variant:"ghost",size:"sm",onClick:()=>s("/context"),children:"Context"})]})]})})})]})}function Ra({sectionTitle:s,headerActions:n,children:r}){return a.jsxs("div",{className:"desktop-shell",children:[s&&a.jsxs("div",{className:"desktop-shell__header",children:[a.jsx("h1",{className:"desktop-shell__title",children:s}),n?a.jsx("div",{className:"desktop-shell__actions",children:n}):null]}),a.jsx("div",{className:"desktop-shell__content",children:r})]})}function Bj({navItems:s,activePath:n,onActiveItemClick:r}){return console.log("Rendering BottomNavContent with navItems:",s),s.length===0?a.jsx(a.Fragment,{}):a.jsx(xt,{spacing:"1",justify:"space-between",children:s.map((o,c)=>{const d=n===o.path;return a.jsxs(aa,{to:o.path,className:`ios-shell__bottom-nav__item ${d?"ios-shell__bottom-nav__item--active":""}`,onClick:()=>{d&&r()},children:[a.jsx("span",{className:"ios-shell__bottom-nav__icon",children:o.icon}),a.jsx(S,{size:"1",className:"ios-shell__bottom-nav-label",children:o.label})]},o.label)})})}function za(s){const n=Lt();console.log("Mounting iOS shell");const[r,o]=p.useState(!1),c=()=>{o(!1)},[d,f]=p.useState(!0),[y,g]=p.useState(!0),[m,x]=p.useState(!0),_=p.useRef(null),v=B=>{_.current=B,U(),D(),H()},T=p.useRef(null),E=B=>{T.current=B,U()},j=p.useRef(null),k=p.useRef(null),w=B=>{k.current=B,D()},N=p.useRef(null),O=p.useRef(null),G=B=>{O.current=B,H()},q=p.useRef(null),A=(B,J,X)=>{const ee=J.current,ue=_.current;!ee||!ue||(B.current?.disconnect(),B.current=new IntersectionObserver(([M])=>{X(M.isIntersecting)},{root:ue,threshold:[0,1]}),B.current.observe(ee))},D=()=>{A(N,k,B=>{console.log(`title visibility detector: ${B}`),f(B)})},U=()=>{A(j,T,B=>{console.log(`content behind header detector: ${B}`),g(!B)})},H=()=>{A(q,O,B=>{console.log(`bottom detector: ${B}`),x(!B)})},P=()=>{_.current?.scrollTo({top:0,behavior:"smooth"})};return p.useEffect(()=>()=>{N.current?.disconnect(),j.current?.disconnect(),q.current?.disconnect()},[]),a.jsxs("div",{className:"ios-shell",children:[a.jsxs("aside",{className:`ios-shell__drawer ${r?"ios-shell__drawer--open":""}`,children:[a.jsxs("div",{className:"ios-shell__drawer-header",children:[a.jsx(S,{size:"4",weight:"bold",children:"taico"}),a.jsx("button",{className:"ios-shell__drawer-close",onClick:c,"aria-label":"Close menu",children:"✕"})]}),a.jsx("nav",{className:"ios-shell__drawer-nav",children:Or.map(B=>{const J=n.pathname===B.path||n.pathname.startsWith(B.path+"/");return a.jsxs(aa,{to:B.path,className:`ios-shell__drawer-item ${J?"ios-shell__drawer-item--active":""}`,onClick:c,children:[a.jsx("span",{className:"ios-shell__drawer-icon",children:B.icon}),a.jsx("span",{className:"ios-shell__drawer-label",children:B.label})]},B.path)})})]}),a.jsx("header",{className:`ios-shell__header ${y?"elevated":""}`,children:a.jsxs(xt,{spacing:"5",align:"center",children:[a.jsx("button",{className:"ios-shell__hamburger",onClick:()=>o(!0),"aria-label":"Open menu",children:"☰"}),a.jsx(S,{size:"3",weight:"normal",as:"div",children:s.appTitle}),a.jsx("div",{className:`ios-shell__header__section-title ${d?"is-hidden":"is-visible"}`,children:s.sectionTitle})]})}),a.jsxs("main",{ref:v,className:"ios-shell__main",children:[a.jsx("div",{className:"ios-shell__main__top-padding"}),a.jsx("div",{ref:E,className:"ios-shell__main__section-title-top-sentinel"}),a.jsx("div",{className:`ios-shell__main__section-title ${d?"is-visible":"is-hidden"}`,children:s.sectionTitle}),a.jsx("div",{ref:w,className:"ios-shell__main__section-title-bottom-sentinel"}),a.jsx("div",{className:"ios-shell__main__top-sentinel"}),s.children,a.jsx("div",{ref:G,className:"ios-shell__main__bottom-sentinel"}),a.jsx("div",{className:"ios-shell__main__bottom-padding"})]}),a.jsx("nav",{className:`ios-shell__bottom-nav ${m?"elevated":""}`,children:a.jsx(Bj,{navItems:s.navItems,activePath:n.pathname,onActiveItemClick:P})})]})}const Uj=[{path:"/home",label:"Home",icon:"🏠"},{path:"/tasks",label:"Tasks",icon:"🧩"},{path:"/context",label:"Context",icon:"🧱"},{path:"/agents",label:"Agents",icon:"🦄"},{path:"/settings",label:"Settings",icon:"⚙️"}];function Ij(){const s=bt(),{sectionTitle:n}=ns();return a.jsx(a.Fragment,{children:s?a.jsx(Ra,{sectionTitle:n,children:a.jsx(Ot,{})}):a.jsx(za,{appTitle:"Home",sectionTitle:n,navItems:Uj,children:a.jsx(Ot,{})})})}const Tx=p.createContext(null);function Pr(){const s=p.useContext(Tx);if(!s)throw new Error("useCommandPalette must be used within a CommandPaletteProvider");return s}function Hj({children:s}){const n=ze(),[r,o]=p.useState(new Map),[c,d]=p.useState(new Map),f=p.useRef(0),y=p.useMemo(()=>[{id:"nav-home",label:"Home",description:"Go to homepage",aliases:["home","search"],onSelect:()=>n("/home")},{id:"nav-tasks",label:"Tasks",description:"Go to tasks",aliases:["task"],onSelect:()=>n("/tasks")},{id:"nav-context",label:"Context",description:"Go to context blocks",aliases:["blocks","block"],onSelect:()=>n("/context")},{id:"nav-agents",label:"Agents",description:"Go to agents",aliases:["agent"],onSelect:()=>n("/agents")},{id:"nav-threads",label:"Threads",description:"Go to threads",aliases:["thread"],onSelect:()=>n("/threads")},{id:"nav-tools",label:"Tools",description:"Go to tools",aliases:["mcp","tool"],onSelect:()=>n("/tools")},{id:"nav-runs",label:"Runs",description:"Go to runs",aliases:["executions","execution","work queue"],onSelect:()=>n("/runs")},{id:"nav-schedule",label:"Schedule",description:"Go to schedule",aliases:["cron","schedules"],onSelect:()=>n("/tasks/schedule")},{id:"nav-settings",label:"Settings",description:"Go to settings",aliases:["setting","config"],onSelect:()=>n("/settings")}],[n]),g=p.useCallback(T=>{const E=String(++f.current);return o(j=>{const k=new Map(j);return k.set(E,T),k}),()=>{o(j=>{const k=new Map(j);return k.delete(E),k})}},[]),m=p.useCallback(T=>{const E=String(++f.current);return d(j=>{const k=new Map(j);return k.set(E,T),k}),()=>{d(j=>{const k=new Map(j);return k.delete(E),k})}},[]),x=p.useMemo(()=>[...Array.from(r.values()).flat(),...y],[y,r]),_=p.useMemo(()=>{const T=Array.from(c.values());return T[T.length-1]},[c]),v=p.useMemo(()=>({commands:x,registerCommands:g,searchTasks:_,registerTaskSearch:m}),[x,g,_,m]);return a.jsxs(Tx.Provider,{value:v,children:[s,a.jsx($j,{})]})}function $j(){const{commands:s,searchTasks:n}=Pr(),r=ze(),[o,c]=p.useState(!1),[d,f]=p.useState(""),[y,g]=p.useState(0),[m,x]=p.useState(!1),[_,v]=p.useState([]),[T,E]=p.useState(!1),j=p.useRef(null),k=p.useRef(null),w=p.useRef(null),N=p.useRef(0);function O(B,J){const X=B.label.toLowerCase(),ee=B.description?.toLowerCase()||"",ue=X.indexOf(J);if(ue!==-1)return X===J?1e3:ue===0?500:300;if(B.aliases)for(const M of B.aliases){const ne=M.toLowerCase(),fe=ne.indexOf(J);if(fe!==-1)return ne===J?800:fe===0?400:200}return ee.includes(J)?100:0}const G=d.toLowerCase().trim(),A=[...s.map(B=>({command:B,score:G?O(B,G):0})).filter(B=>B.score>0).sort((B,J)=>J.score!==B.score?J.score-B.score:0).map(B=>B.command).map(B=>({type:"command",command:B})),..._.map(B=>({type:"task",task:B}))];function D(B){if(!G)return B;const J=B.toLowerCase().indexOf(G);return J===-1?B:a.jsxs(a.Fragment,{children:[B.slice(0,J),a.jsx("mark",{children:B.slice(J,J+G.length)}),B.slice(J+G.length)]})}p.useEffect(()=>{if(w.current&&clearTimeout(w.current),!n){N.current+=1,v([]),E(!1);return}if(!G){N.current+=1,v([]),E(!1);return}N.current+=1;const B=N.current;return w.current=window.setTimeout(async()=>{E(!0);try{const J=await n(G);N.current===B&&v(J)}catch(J){console.error("Failed to search tasks:",J),N.current===B&&v([])}finally{N.current===B&&E(!1)}},200),()=>{w.current&&clearTimeout(w.current)}},[G,n]),p.useEffect(()=>{g(0)},[d]),p.useEffect(()=>{const B=J=>{(J.metaKey||J.ctrlKey)&&J.key==="/"&&(J.preventDefault(),c(!0))};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[]),p.useEffect(()=>{o&&j.current&&j.current.focus()},[o]),p.useEffect(()=>{const B=J=>{k.current&&!k.current.contains(J.target)&&o&&U()};if(o)return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[o]);function U(){c(!1),f(""),g(0),v([]),E(!1),w.current&&clearTimeout(w.current),N.current+=1}function H(B){B.type==="command"?B.command.onSelect():r(`/tasks/task/${B.task.id}`),U()}function P(B){if(B.key==="Escape"){B.preventDefault(),U();return}if(B.key==="ArrowDown"){B.preventDefault(),g(J=>J<A.length-1?J+1:J);return}if(B.key==="ArrowUp"){B.preventDefault(),g(J=>J>0?J-1:0);return}if(B.key==="Enter"){if(B.preventDefault(),A.length===0){x(!0),setTimeout(()=>x(!1),500);return}const J=A[y];J&&H(J);return}}return o?a.jsx("div",{className:"command-palette-backdrop",children:a.jsxs("div",{className:`command-palette-container ${m?"command-palette-container--shake":""}`,ref:k,children:[a.jsx("input",{ref:j,type:"text",className:"command-palette-input",placeholder:"Type a command...",value:d,onChange:B=>f(B.target.value),onKeyDown:P,autoComplete:"off",spellCheck:!1}),A.length>0&&a.jsx("div",{className:"command-palette-results",children:A.map((B,J)=>{if(B.type==="command"){const X=B.command;return a.jsxs("div",{className:`command-palette-item ${J===y?"command-palette-item--selected":""}`,onClick:()=>H(B),onMouseEnter:()=>g(J),children:[a.jsx("span",{className:"command-palette-item-label",children:D(X.label)}),X.description&&a.jsx("span",{className:"command-palette-item-description",children:X.description})]},`cmd-${X.id}`)}else{const X=B.task;return a.jsxs("div",{className:`command-palette-item command-palette-item--task ${J===y?"command-palette-item--selected":""}`,onClick:()=>H(B),onMouseEnter:()=>g(J),children:[a.jsx("span",{className:"command-palette-item-label",children:D(X.name)}),a.jsx("span",{className:"command-palette-item-description",children:"Task"})]},`task-${X.id}`)}})}),d&&A.length===0&&!T&&a.jsx("div",{className:"command-palette-no-results",children:"No results found"}),T&&a.jsx("div",{className:"command-palette-searching",children:"Searching tasks..."})]})}):null}function Cl({onDelete:s,deleteLabel:n="Delete",confirmLabel:r="Confirm Delete",cancelLabel:o="Cancel",className:c,size:d="lg"}){const[f,y]=p.useState(!1),g=async()=>{await s(),y(!1)};return a.jsx(pe,{className:c,children:f?a.jsxs(a.Fragment,{children:[a.jsx(ce,{size:d,variant:"secondary",onClick:()=>y(!1),children:o}),a.jsx(ce,{size:d,variant:"danger",onClick:g,children:r})]}):a.jsx(ce,{size:d,variant:"danger",onClick:()=>y(!0),children:n})})}const jx=p.createContext(void 0);function Dn(){const s=p.useContext(jx);if(!s)throw new Error("useToast must be used within ToastProvider");return s}function Gj(s){if(s&&typeof s=="object"){const n=s;if(n.body?.detail)return n.body.detail;if(n.detail)return n.detail;if(n.message)return n.message}return typeof s=="string"?s:"An unexpected error occurred"}function Pj({children:s}){const[n,r]=p.useState([]),o=p.useCallback((f,y="info",g=5e3)=>{const m=crypto.randomUUID(),x={id:m,message:f,type:y,duration:g};r(_=>[..._,x]),g>0&&setTimeout(()=>{d(m)},g)},[]),c=p.useCallback(f=>{const y=Gj(f);o(y,"error",6e3)},[o]),d=p.useCallback(f=>{r(y=>y.filter(g=>g.id!==f))},[]);return a.jsx(jx.Provider,{value:{toasts:n,showToast:o,showError:c,dismissToast:d},children:s})}function Vj(){const{toasts:s,dismissToast:n}=Dn();return s.length===0?null:a.jsx("div",{className:"toast-container",children:s.map(r=>a.jsxs("div",{className:`toast toast--${r.type}`,role:"alert","aria-live":"assertive",children:[a.jsx("div",{className:"toast__content",children:a.jsx(S,{size:"2",className:"toast__message",children:r.message})}),a.jsx("button",{className:"toast__close",onClick:()=>n(r.id),"aria-label":"Dismiss notification",children:"×"})]},r.id))})}function Yj(){const{setSectionTitle:s}=ns(),n=bt(),r=ze(),{registerCommands:o}=Pr();return qt(),p.useEffect(()=>{s("Settings")},[]),p.useEffect(()=>o([{id:"settings-account",label:"Account Settings",description:"Manage your account security",aliases:["password","account","security"],onSelect:()=>r("/settings/account")},{id:"settings-appearance",label:"Appearance Settings",description:"Choose your preferred color theme",aliases:["theme","appearance","dark mode","light mode"],onSelect:()=>r("/settings/appearance")},{id:"settings-projects",label:"Projects Settings",description:"Manage your projects",aliases:["projects","manage projects"],onSelect:()=>r("/settings/projects")},{id:"settings-chat",label:"Chat Settings",description:"Configure chat providers for conversations",aliases:["chat","openai","providers","chat providers"],onSelect:()=>r("/settings/chat")},{id:"settings-workers",label:"Workers Settings",description:"Configure and manage background workers",aliases:["workers","background","execution"],onSelect:()=>r("/settings/workers")},{id:"settings-data",label:"Import / Export",description:"Import and export workspace data",aliases:["data","export","import","backup","restore"],onSelect:()=>r("/settings/data")}]),[o,r]),a.jsxs(se,{spacing:"6",children:[n?a.jsx(S,{tone:"muted",children:"Customize your experience"}):"",a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"3",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Account"}),a.jsx(S,{tone:"muted",children:"Manage your account security"})]}),a.jsxs(xt,{justify:"space-between",align:"center",children:[a.jsx(S,{size:"2",tone:"muted",children:"Update your password"}),a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>r("/settings/account"),children:"Change Password"})]})]})}),a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"3",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Appearance"}),a.jsx(S,{tone:"muted",children:"Choose your preferred color theme"})]}),a.jsxs(xt,{justify:"space-between",align:"center",children:[a.jsx(S,{size:"2",tone:"muted",children:"Pick a theme for the app"}),a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>r("/settings/appearance"),children:"Choose Theme"})]})]})}),a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"3",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Projects"}),a.jsx(S,{tone:"muted",children:"Manage your projects"})]}),a.jsxs(xt,{justify:"space-between",align:"center",children:[a.jsx(S,{size:"2",tone:"muted",children:"View and edit project details"}),a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>r("/settings/projects"),children:"Manage Projects"})]})]})}),a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"3",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Chat"}),a.jsx(S,{tone:"muted",children:"Configure chat providers for conversations"})]}),a.jsxs(xt,{justify:"space-between",align:"center",children:[a.jsx(S,{size:"2",tone:"muted",children:"Manage OpenAI and other providers"}),a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>r("/settings/chat"),children:"Configure Chat"})]})]})}),a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"3",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Workers"}),a.jsx(S,{tone:"muted",children:"Configure and manage background workers"})]}),a.jsxs(xt,{justify:"space-between",align:"center",children:[a.jsx(S,{size:"2",tone:"muted",children:"Set up workers for task execution"}),a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>r("/settings/workers"),children:"Manage Workers"})]})]})}),a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"3",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Import / Export"}),a.jsx(S,{tone:"muted",children:"Back up and restore workspace data"})]}),a.jsxs(xt,{justify:"space-between",align:"center",children:[a.jsx(S,{size:"2",tone:"muted",children:"Export blocks and import archive files"}),a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>r("/settings/data"),children:"Manage Data"})]})]})}),a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"3",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Setup walkthrough"}),a.jsx(S,{tone:"muted",children:"Step-by-step guide to configuring Taico"})]}),a.jsxs(xt,{justify:"space-between",align:"center",children:[a.jsx(S,{size:"2",tone:"muted",children:"Review setup steps and track your progress"}),a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>r("/walkthrough"),children:"Open walkthrough"})]})]})})]})}function Fj(){const{setSectionTitle:s}=ns(),{logout:n}=zn(),r=ze(),[o,c]=p.useState(""),[d,f]=p.useState(""),[y,g]=p.useState(""),[m,x]=p.useState(""),[_,v]=p.useState(!1);p.useEffect(()=>{s("Account")},[]);const T=async E=>{E.preventDefault(),g(""),x(""),v(!0);try{await js.webAuthControllerChangePassword({currentPassword:o,newPassword:d}),x("Password changed successfully! You will be logged out."),c(""),f(""),setTimeout(async()=>{await n(),r("/login")},2e3)}catch(j){g(j?.body?.detail||"Failed to change password. Please check your current password.")}finally{v(!1)}};return a.jsx(se,{spacing:"6",children:a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"2",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Change Password"}),a.jsx(S,{tone:"muted",children:"Update your account password"})]}),a.jsx("form",{onSubmit:T,children:a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:"current-password",className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"Current Password"})}),a.jsx("input",{id:"current-password",type:"password",value:o,onChange:E=>c(E.target.value),className:"login-input",placeholder:"••••••••",required:!0,disabled:_,autoComplete:"current-password"})]}),a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:"new-password",className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"New Password"})}),a.jsx("input",{id:"new-password",type:"password",value:d,onChange:E=>f(E.target.value),className:"login-input",placeholder:"••••••••",required:!0,disabled:_,autoComplete:"new-password"})]}),y&&a.jsx(An,{size:"2",weight:"medium",children:y}),m&&a.jsx("div",{style:{color:"var(--accent)"},children:a.jsx(S,{size:"2",weight:"medium",children:m})}),a.jsx(ce,{type:"submit",variant:"primary",size:"md",disabled:_||!o||!d,children:_?"Changing Password...":"Change Password"})]})})]})})})}const Qj=[{value:"light",label:"Light",description:"Clean light theme"},{value:"dark",label:"Dark",description:"Easy on the eyes"},{value:"github",label:"GitHub",description:"GitHub-inspired green accent"},{value:"forest",label:"Forest",description:"Nature-inspired dark green"},{value:"terminal",label:"Terminal",description:"Classic terminal green on black"},{value:"ai-vibes",label:"AI Vibes",description:"Deep purples with neon accents"},{value:"halo",label:"Halo",description:"Light background with deeper surfaces"},{value:"mono",label:"Mono",description:"Black and white minimalism"},{value:"terminal-amber",label:"Terminal Amber",description:"Terminal tones without the green"},{value:"oceanic",label:"Oceanic",description:"Cool blues and teals"},{value:"party",label:"Party",description:"Playful warm palette"},{value:"tribute",label:"Tribute",description:"Inspired by the old UI's dark sidebar"}];function Kj(){const{theme:s,setTheme:n}=ET(),{setSectionTitle:r}=ns();return p.useEffect(()=>{r("Appearance")},[]),a.jsx(se,{spacing:"6",children:a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"2",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Appearance"}),a.jsx(S,{tone:"muted",children:"Choose your preferred color theme"})]}),a.jsx(se,{spacing:"3",children:Qj.map(o=>{const c=s===o.value;return a.jsx(Qe,{padding:"4",className:c?"settings-theme-card--active":"",children:a.jsxs(xt,{justify:"space-between",align:"center",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{weight:"semibold",children:o.label}),a.jsx(S,{size:"1",tone:"muted",children:o.description})]}),a.jsx(ce,{variant:c?"primary":"secondary",size:"sm",onClick:()=>n(o.value),children:c?"Active":"Select"})]})},o.value)})})]})})})}Pe.BASE=Na;function Xj(){const{setSectionTitle:s}=ns(),[n,r]=p.useState([]),[o,c]=p.useState(!0),[d,f]=p.useState(""),[y,g]=p.useState(null),[m,x]=p.useState(""),[_,v]=p.useState(""),[T,E]=p.useState(""),[j,k]=p.useState("");p.useEffect(()=>{s("Projects"),w()},[]);const w=async()=>{c(!0),f("");try{const q=await fy.projectsControllerGetAllProjects();r(q)}catch(q){f(q?.body?.detail||"Failed to load projects")}finally{c(!1)}},N=q=>{g(q.id),x(q.description||""),v(q.repoUrl||""),E(""),k("")},O=()=>{g(null),x(""),v(""),E(""),k("")},G=async q=>{E(""),k("");try{await fy.projectsControllerUpdateProject(q,{description:m,repoUrl:_}),k("Project updated successfully!"),g(null),await w(),setTimeout(()=>{k("")},3e3)}catch(A){E(A?.body?.detail||"Failed to update project")}};return o?a.jsx(se,{spacing:"6",children:a.jsx(S,{tone:"muted",children:"Loading projects..."})}):d?a.jsxs(se,{spacing:"6",children:[a.jsx(An,{children:d}),a.jsx(ce,{variant:"secondary",onClick:w,children:"Retry"})]}):a.jsxs(se,{spacing:"6",children:[a.jsx(S,{tone:"muted",children:"Manage your projects"}),n.length===0?a.jsx(Qe,{padding:"5",children:a.jsx(S,{tone:"muted",children:"No projects found"})}):n.map(q=>a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"2",children:[a.jsx(S,{size:"4",weight:"semibold",children:q.slug}),a.jsxs(S,{size:"2",tone:"muted",children:["Tag: ",q.tagName]})]}),y===q.id?a.jsx("form",{onSubmit:A=>{A.preventDefault(),G(q.id)},children:a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:`description-${q.id}`,className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"Description"})}),a.jsx("textarea",{id:`description-${q.id}`,value:m,onChange:A=>x(A.target.value),className:"login-input",placeholder:"Project description",rows:3,style:{resize:"vertical",fontFamily:"inherit"}})]}),a.jsxs(se,{spacing:"2",children:[a.jsx("label",{htmlFor:`repo-url-${q.id}`,className:"login-label",children:a.jsx(S,{size:"2",weight:"medium",children:"Repository URL"})}),a.jsx("input",{id:`repo-url-${q.id}`,type:"url",value:_,onChange:A=>v(A.target.value),className:"login-input",placeholder:"https://github.com/username/repo"})]}),T&&a.jsx(An,{size:"2",weight:"medium",children:T}),j&&a.jsx("div",{style:{color:"var(--accent)"},children:a.jsx(S,{size:"2",weight:"medium",children:j})}),a.jsxs(xt,{spacing:"3",children:[a.jsx(ce,{type:"submit",variant:"primary",size:"md",children:"Save Changes"}),a.jsx(ce,{type:"button",variant:"secondary",size:"md",onClick:O,children:"Cancel"})]})]})}):a.jsxs(a.Fragment,{children:[a.jsxs(se,{spacing:"2",children:[a.jsx(S,{size:"2",weight:"medium",children:"Description"}),a.jsx(S,{size:"2",tone:"muted",children:q.description||"No description"})]}),a.jsxs(se,{spacing:"2",children:[a.jsx(S,{size:"2",weight:"medium",children:"Repository URL"}),a.jsx(S,{size:"2",tone:"muted",children:q.repoUrl||"No repository URL"})]}),a.jsx(xt,{justify:"end",children:a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>N(q),children:"Edit Project"})})]})]})},q.id))]})}function Zj(){const{setSectionTitle:s}=ns(),[n,r]=p.useState([]),[o,c]=p.useState(""),[d,f]=p.useState(!0),[y,g]=p.useState(""),[m,x]=p.useState(null),[_,v]=p.useState(null);p.useEffect(()=>{if(!_)return;const w=window.setTimeout(()=>{v(N=>N?.providerId===_.providerId?null:N)},2400);return()=>window.clearTimeout(w)},[_]),p.useEffect(()=>{s("Chat Settings"),T()},[]);const T=async()=>{f(!0);try{const w=await Rr.chatProvidersControllerListChatProviders();r(w)}catch(w){c(w?.body?.detail||"Failed to load chat settings")}finally{f(!1)}},E=async w=>{if(!y.trim()){c("Please enter an API key");return}c(""),v(null);try{await Rr.chatProvidersControllerUpdateChatProvider(w,{apiKey:y}),v({providerId:w,action:"configure",message:"Config updated"}),x(null),g(""),await T()}catch(N){c(N?.body?.detail||"Failed to configure provider")}},j=async w=>{if(!n.find(O=>O.id===w)?.isConfigured){c("Please configure the provider first");return}c(""),v(null);try{await Rr.chatProvidersControllerSetActiveChatProvider({providerId:w}),v({providerId:w,action:"activate",message:"Now active"}),await T()}catch(O){c(O?.body?.detail||"Failed to set active provider")}},k=async w=>{c(""),v(null);try{await Rr.chatProvidersControllerDeactivateActiveChatProvider(),v({providerId:w,action:"deactivate",message:"Deactivated"}),await T()}catch(N){c(N?.body?.detail||"Failed to deactivate provider")}};return d?a.jsx(se,{spacing:"6",children:a.jsx(S,{children:"Loading..."})}):a.jsxs(se,{spacing:"6",children:[a.jsx(S,{tone:"muted",children:"Configure chat providers for thread conversations"}),o&&a.jsx(An,{size:"2",weight:"medium",children:o}),n.length===0?a.jsx(Qe,{padding:"5",children:a.jsx(S,{tone:"muted",children:"No chat providers available. OpenAI provider should be created automatically."})}):n.map(w=>a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"4",children:[a.jsx(xt,{justify:"space-between",align:"center",children:a.jsxs(se,{spacing:"1",className:"settings-chat__header-copy",children:[a.jsxs("div",{className:"settings-chat__title-row",children:[a.jsx(S,{size:"4",weight:"semibold",children:w.name}),w.isActive?a.jsx("span",{className:"settings-chat__active-indicator",children:"Active"}):null]}),w.type==="openai"?a.jsxs(S,{size:"1",tone:"muted",children:["You can get an API key from"," ",a.jsx("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"settings-chat__helper-link",children:"platform.openai.com/api-keys"})]}):w.type==="adk"?a.jsx(S,{size:"1",tone:"muted",children:"Uses Google AI environment variables (GOOGLE_API_KEY or Vertex AI config). No key stored here."}):null]})}),m===w.id&&w.type!=="adk"?a.jsxs(se,{spacing:"3",children:[a.jsxs(se,{spacing:"2",children:[a.jsx(S,{size:"2",weight:"medium",children:"Enter API Key"}),a.jsx("input",{type:"password",value:y,onChange:N=>g(N.target.value),className:"login-input",placeholder:"sk-...",autoFocus:!0}),a.jsx(S,{size:"1",tone:"muted",children:"Your API key will be stored securely"})]}),a.jsxs(xt,{spacing:"2",children:[a.jsx(ce,{variant:"primary",size:"sm",onClick:()=>E(w.id),disabled:!y.trim(),children:"Save"}),a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>{x(null),g("")},children:"Cancel"})]})]}):a.jsx(xt,{spacing:"2",children:(()=>{const N=_?.providerId===w.id&&_.action==="configure"?_.message:null,O=_?.providerId===w.id&&_.action==="activate"?_.message:null,G=_?.providerId===w.id&&_.action==="deactivate"?_.message:null,q=O||G,A=!w.isActive&&!w.isConfigured,D=q?"primary":w.isActive?"danger":"primary",U=q||(w.isActive?"Deactivate":"Set Active"),H=w.isActive?()=>k(w.id):()=>j(w.id),P=A?"Configure the provider first to set it as active":"";return a.jsxs(a.Fragment,{children:[w.type!=="adk"&&a.jsx(ce,{variant:N?"primary":"secondary",size:"sm",onClick:()=>x(w.id),children:N||(w.isConfigured?"Update Config":"Configure")}),a.jsx("span",{className:"settings-chat__action-wrapper",title:P,children:a.jsx(ce,{variant:D,size:"sm",onClick:H,disabled:A,className:"settings-chat__action-button","data-feedback":O?"active":G?"deactivated":null,children:U})})]})})()})]})},w.id))]})}function Jj(){const{setSectionTitle:s}=ns(),[n,r]=p.useState(!1),[o,c]=p.useState(!1),[d,f]=p.useState(null),[y,g]=p.useState(""),[m,x]=p.useState("");p.useEffect(()=>{s("Import / Export")},[s]);const _=p.useMemo(()=>`${Na}/api/v1/context/blocks/export`,[]),v=p.useMemo(()=>`${Na}/api/v1/context/blocks/import`,[]),T=async()=>{r(!0),g(""),x("");try{const j=await fetch(_,{method:"GET",credentials:"include"});if(!j.ok)throw new Error("Failed to export blocks");const k=await j.blob(),N=j.headers.get("content-disposition")?.match(/filename="?([^";]+)"?/)?.[1]||"context-blocks.zip",O=window.URL.createObjectURL(k),G=document.createElement("a");G.href=O,G.download=N,document.body.appendChild(G),G.click(),G.remove(),window.URL.revokeObjectURL(O),x("Blocks export downloaded successfully.")}catch{g("Failed to export blocks. Please try again.")}finally{r(!1)}},E=async()=>{if(!d){g("Please choose a .zip file first."),x("");return}c(!0),g(""),x("");try{const j=new FormData;j.append("file",d);const k=await fetch(v,{method:"POST",credentials:"include",body:j}),w=await k.json().catch(()=>({}));if(!k.ok)throw new Error("Failed to import blocks");const N=w.importedCount??0;x(`Import complete. ${N} block${N===1?"":"s"} created.`),f(null)}catch{g("Failed to import blocks. Verify the archive format and try again.")}finally{c(!1)}};return a.jsxs(se,{spacing:"6",children:[a.jsx(S,{tone:"muted",children:"Import and export workspace data. Blocks are available now; task support can be added in this section later."}),y?a.jsx(An,{size:"2",weight:"medium",children:y}):null,m?a.jsx(S,{size:"2",className:"settings-data__success",children:m}):null,a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Export Blocks"}),a.jsx(S,{tone:"muted",children:"Download all context blocks as a nested markdown zip archive."})]}),a.jsx(xt,{justify:"end",children:a.jsx(ce,{variant:"primary",size:"sm",onClick:T,disabled:n,children:n?"Exporting...":"Export Blocks"})})]})}),a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Import Blocks"}),a.jsx(S,{tone:"muted",children:"Upload a blocks archive to create context blocks in this workspace."})]}),a.jsx("label",{htmlFor:"blocks-import-file",className:"settings-data__file-label",children:"Select archive (.zip)"}),a.jsx("input",{id:"blocks-import-file",type:"file",accept:".zip,application/zip",onChange:j=>f(j.target.files?.[0]??null),className:"settings-data__file-input"}),a.jsx(S,{size:"1",tone:"muted",children:d?`Selected: ${d.name}`:"No file selected"}),a.jsx(xt,{justify:"end",children:a.jsx(ce,{variant:"secondary",size:"sm",onClick:E,disabled:o,children:o?"Importing...":"Import Blocks"})})]})})]})}const es=Object.create(null);es.open="0";es.close="1";es.ping="2";es.pong="3";es.message="4";es.upgrade="5";es.noop="6";const bo=Object.create(null);Object.keys(es).forEach(s=>{bo[es[s]]=s});const Ad={type:"error",data:"parser error"},wx=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ex=typeof ArrayBuffer=="function",kx=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,th=({type:s,data:n},r,o)=>wx&&n instanceof Blob?r?o(n):gy(n,o):Ex&&(n instanceof ArrayBuffer||kx(n))?r?o(n):gy(new Blob([n]),o):o(es[s]+(n||"")),gy=(s,n)=>{const r=new FileReader;return r.onload=function(){const o=r.result.split(",")[1];n("b"+(o||""))},r.readAsDataURL(s)};function my(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let cd;function Wj(s,n){if(wx&&s.data instanceof Blob)return s.data.arrayBuffer().then(my).then(n);if(Ex&&(s.data instanceof ArrayBuffer||kx(s.data)))return n(my(s.data));th(s,!1,r=>{cd||(cd=new TextEncoder),n(cd.encode(r))})}const yy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<yy.length;s++)zr[yy.charCodeAt(s)]=s;const ew=s=>{let n=s.length*.75,r=s.length,o,c=0,d,f,y,g;s[s.length-1]==="="&&(n--,s[s.length-2]==="="&&n--);const m=new ArrayBuffer(n),x=new Uint8Array(m);for(o=0;o<r;o+=4)d=zr[s.charCodeAt(o)],f=zr[s.charCodeAt(o+1)],y=zr[s.charCodeAt(o+2)],g=zr[s.charCodeAt(o+3)],x[c++]=d<<2|f>>4,x[c++]=(f&15)<<4|y>>2,x[c++]=(y&3)<<6|g&63;return m},tw=typeof ArrayBuffer=="function",nh=(s,n)=>{if(typeof s!="string")return{type:"message",data:Cx(s,n)};const r=s.charAt(0);return r==="b"?{type:"message",data:nw(s.substring(1),n)}:bo[r]?s.length>1?{type:bo[r],data:s.substring(1)}:{type:bo[r]}:Ad},nw=(s,n)=>{if(tw){const r=ew(s);return Cx(r,n)}else return{base64:!0,data:s}},Cx=(s,n)=>{switch(n){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},Nx="",sw=(s,n)=>{const r=s.length,o=new Array(r);let c=0;s.forEach((d,f)=>{th(d,!1,y=>{o[f]=y,++c===r&&n(o.join(Nx))})})},aw=(s,n)=>{const r=s.split(Nx),o=[];for(let c=0;c<r.length;c++){const d=nh(r[c],n);if(o.push(d),d.type==="error")break}return o};function lw(){return new TransformStream({transform(s,n){Wj(s,r=>{const o=r.length;let c;if(o<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,o);else if(o<65536){c=new Uint8Array(3);const d=new DataView(c.buffer);d.setUint8(0,126),d.setUint16(1,o)}else{c=new Uint8Array(9);const d=new DataView(c.buffer);d.setUint8(0,127),d.setBigUint64(1,BigInt(o))}s.data&&typeof s.data!="string"&&(c[0]|=128),n.enqueue(c),n.enqueue(r)})}})}let ud;function co(s){return s.reduce((n,r)=>n+r.length,0)}function uo(s,n){if(s[0].length===n)return s.shift();const r=new Uint8Array(n);let o=0;for(let c=0;c<n;c++)r[c]=s[0][o++],o===s[0].length&&(s.shift(),o=0);return s.length&&o<s[0].length&&(s[0]=s[0].slice(o)),r}function rw(s,n){ud||(ud=new TextDecoder);const r=[];let o=0,c=-1,d=!1;return new TransformStream({transform(f,y){for(r.push(f);;){if(o===0){if(co(r)<1)break;const g=uo(r,1);d=(g[0]&128)===128,c=g[0]&127,c<126?o=3:c===126?o=1:o=2}else if(o===1){if(co(r)<2)break;const g=uo(r,2);c=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),o=3}else if(o===2){if(co(r)<8)break;const g=uo(r,8),m=new DataView(g.buffer,g.byteOffset,g.length),x=m.getUint32(0);if(x>Math.pow(2,21)-1){y.enqueue(Ad);break}c=x*Math.pow(2,32)+m.getUint32(4),o=3}else{if(co(r)<c)break;const g=uo(r,c);y.enqueue(nh(d?g:ud.decode(g),n)),o=0}if(c===0||c>s){y.enqueue(Ad);break}}}})}const Ax=4;function vt(s){if(s)return iw(s)}function iw(s){for(var n in vt.prototype)s[n]=vt.prototype[n];return s}vt.prototype.on=vt.prototype.addEventListener=function(s,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(n),this};vt.prototype.once=function(s,n){function r(){this.off(s,r),n.apply(this,arguments)}return r.fn=n,this.on(s,r),this};vt.prototype.off=vt.prototype.removeListener=vt.prototype.removeAllListeners=vt.prototype.removeEventListener=function(s,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+s];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var o,c=0;c<r.length;c++)if(o=r[c],o===n||o.fn===n){r.splice(c,1);break}return r.length===0&&delete this._callbacks["$"+s],this};vt.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),r=this._callbacks["$"+s],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(r){r=r.slice(0);for(var o=0,c=r.length;o<c;++o)r[o].apply(this,n)}return this};vt.prototype.emitReserved=vt.prototype.emit;vt.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};vt.prototype.hasListeners=function(s){return!!this.listeners(s).length};const qo=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,r)=>r(n,0),wn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ow="arraybuffer";function Rx(s,...n){return n.reduce((r,o)=>(s.hasOwnProperty(o)&&(r[o]=s[o]),r),{})}const cw=wn.setTimeout,uw=wn.clearTimeout;function Mo(s,n){n.useNativeTimers?(s.setTimeoutFn=cw.bind(wn),s.clearTimeoutFn=uw.bind(wn)):(s.setTimeoutFn=wn.setTimeout.bind(wn),s.clearTimeoutFn=wn.clearTimeout.bind(wn))}const dw=1.33;function hw(s){return typeof s=="string"?fw(s):Math.ceil((s.byteLength||s.size)*dw)}function fw(s){let n=0,r=0;for(let o=0,c=s.length;o<c;o++)n=s.charCodeAt(o),n<128?r+=1:n<2048?r+=2:n<55296||n>=57344?r+=3:(o++,r+=4);return r}function zx(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function pw(s){let n="";for(let r in s)s.hasOwnProperty(r)&&(n.length&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(s[r]));return n}function gw(s){let n={},r=s.split("&");for(let o=0,c=r.length;o<c;o++){let d=r[o].split("=");n[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return n}class mw extends Error{constructor(n,r,o){super(n),this.description=r,this.context=o,this.type="TransportError"}}class sh extends vt{constructor(n){super(),this.writable=!1,Mo(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,r,o){return super.emitReserved("error",new mw(n,r,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const r=nh(n,this.socket.binaryType);this.onPacket(r)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,r={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const r=pw(n);return r.length?"?"+r:""}}class yw extends sh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const r=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||r()})),this.writable||(o++,this.once("drain",function(){--o||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const r=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};aw(n,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,sw(n,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=zx()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(n,r)}}let Dx=!1;try{Dx=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const xw=Dx;function vw(){}class bw extends yw{constructor(n){if(super(n),typeof location<"u"){const r=location.protocol==="https:";let o=location.port;o||(o=r?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||o!==n.port}}doWrite(n,r){const o=this.request({method:"POST",data:n});o.on("success",r),o.on("error",(c,d)=>{this.onError("xhr post error",c,d)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(r,o)=>{this.onError("xhr poll error",r,o)}),this.pollXhr=n}}class Wn extends vt{constructor(n,r,o){super(),this.createRequest=n,Mo(this,o),this._opts=o,this._method=o.method||"GET",this._uri=r,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var n;const r=Rx(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(r);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&o.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var c;o.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=Wn.requestsCount++,Wn.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=vw,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wn.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Wn.requestsCount=0;Wn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",xy);else if(typeof addEventListener=="function"){const s="onpagehide"in wn?"pagehide":"unload";addEventListener(s,xy,!1)}}function xy(){for(let s in Wn.requests)Wn.requests.hasOwnProperty(s)&&Wn.requests[s].abort()}const Sw=(function(){const s=Ox({xdomain:!1});return s&&s.responseType!==null})();class _w extends bw{constructor(n){super(n);const r=n&&n.forceBase64;this.supportsBinary=Sw&&!r}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new Wn(Ox,this.uri(),n)}}function Ox(s){const n=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||xw))return new XMLHttpRequest}catch{}if(!n)try{return new wn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Lx=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Tw extends sh{get name(){return"websocket"}doOpen(){const n=this.uri(),r=this.opts.protocols,o=Lx?{}:Rx(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,r,o)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let r=0;r<n.length;r++){const o=n[r],c=r===n.length-1;th(o,this.supportsBinary,d=>{try{this.doWrite(o,d)}catch{}c&&qo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=zx()),this.supportsBinary||(r.b64=1),this.createUri(n,r)}}const dd=wn.WebSocket||wn.MozWebSocket;class jw extends Tw{createSocket(n,r,o){return Lx?new dd(n,r,o):r?new dd(n,r):new dd(n)}doWrite(n,r){this.ws.send(r)}}class ww extends sh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const r=rw(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=n.readable.pipeThrough(r).getReader(),c=lw();c.readable.pipeTo(n.writable),this._writer=c.writable.getWriter();const d=()=>{o.read().then(({done:y,value:g})=>{y||(this.onPacket(g),d())}).catch(y=>{})};d();const f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this._writer.write(f).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let r=0;r<n.length;r++){const o=n[r],c=r===n.length-1;this._writer.write(o).then(()=>{c&&qo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const Ew={websocket:jw,webtransport:ww,polling:_w},kw=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Cw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Rd(s){if(s.length>8e3)throw"URI too long";const n=s,r=s.indexOf("["),o=s.indexOf("]");r!=-1&&o!=-1&&(s=s.substring(0,r)+s.substring(r,o).replace(/:/g,";")+s.substring(o,s.length));let c=kw.exec(s||""),d={},f=14;for(;f--;)d[Cw[f]]=c[f]||"";return r!=-1&&o!=-1&&(d.source=n,d.host=d.host.substring(1,d.host.length-1).replace(/;/g,":"),d.authority=d.authority.replace("[","").replace("]","").replace(/;/g,":"),d.ipv6uri=!0),d.pathNames=Nw(d,d.path),d.queryKey=Aw(d,d.query),d}function Nw(s,n){const r=/\/{2,9}/g,o=n.replace(r,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&o.splice(0,1),n.slice(-1)=="/"&&o.splice(o.length-1,1),o}function Aw(s,n){const r={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,c,d){c&&(r[c]=d)}),r}const zd=typeof addEventListener=="function"&&typeof removeEventListener=="function",So=[];zd&&addEventListener("offline",()=>{So.forEach(s=>s())},!1);class sa extends vt{constructor(n,r){if(super(),this.binaryType=ow,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(r=n,n=null),n){const o=Rd(n);r.hostname=o.host,r.secure=o.protocol==="https"||o.protocol==="wss",r.port=o.port,o.query&&(r.query=o.query)}else r.host&&(r.hostname=Rd(r.host).host);Mo(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(o=>{const c=o.prototype.name;this.transports.push(c),this._transportsByName[c]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=gw(this.opts.query)),zd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},So.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const r=Object.assign({},this.opts.query);r.EIO=Ax,r.transport=n,this.id&&(r.sid=this.id);const o=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&sa.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(n);r.open(),this.setTransport(r)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",sa.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=n.data,this._onError(r);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let o=0;o<this.writeBuffer.length;o++){const c=this.writeBuffer[o].data;if(c&&(r+=hw(c)),o>0&&r>this._maxPayload)return this.writeBuffer.slice(0,o);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,qo(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,r,o){return this._sendPacket("message",n,r,o),this}send(n,r,o){return this._sendPacket("message",n,r,o),this}_sendPacket(n,r,o,c){if(typeof r=="function"&&(c=r,r=void 0),typeof o=="function"&&(c=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const d={type:n,data:r,options:o};this.emitReserved("packetCreate",d),this.writeBuffer.push(d),c&&this.once("flush",c),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),n()},o=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():n()}):this.upgrading?o():n()),this}_onError(n){if(sa.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),zd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=So.indexOf(this._offlineEventListener);o!==-1&&So.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,r),this.writeBuffer=[],this._prevBufferLen=0}}}sa.protocol=Ax;class Rw extends sa{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let r=this.createTransport(n),o=!1;sa.priorWebsocketSuccess=!1;const c=()=>{o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",_=>{if(!o)if(_.type==="pong"&&_.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;sa.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(x(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=r.name,this.emitReserved("upgradeError",v)}}))};function d(){o||(o=!0,x(),r.close(),r=null)}const f=_=>{const v=new Error("probe error: "+_);v.transport=r.name,d(),this.emitReserved("upgradeError",v)};function y(){f("transport closed")}function g(){f("socket closed")}function m(_){r&&_.name!==r.name&&d()}const x=()=>{r.removeListener("open",c),r.removeListener("error",f),r.removeListener("close",y),this.off("close",g),this.off("upgrading",m)};r.once("open",c),r.once("error",f),r.once("close",y),this.once("close",g),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{o||r.open()},200):r.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const r=[];for(let o=0;o<n.length;o++)~this.transports.indexOf(n[o])&&r.push(n[o]);return r}}let zw=class extends Rw{constructor(n,r={}){const o=typeof n=="object"?n:r;(!o.transports||o.transports&&typeof o.transports[0]=="string")&&(o.transports=(o.transports||["polling","websocket","webtransport"]).map(c=>Ew[c]).filter(c=>!!c)),super(n,o)}};function Dw(s,n="",r){let o=s;r=r||typeof location<"u"&&location,s==null&&(s=r.protocol+"//"+r.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=r.protocol+s:s=r.host+s),/^(https?|wss?):\/\//.test(s)||(typeof r<"u"?s=r.protocol+"//"+s:s="https://"+s),o=Rd(s)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const d=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+d+":"+o.port+n,o.href=o.protocol+"://"+d+(r&&r.port===o.port?"":":"+o.port),o}const Ow=typeof ArrayBuffer=="function",Lw=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,qx=Object.prototype.toString,qw=typeof Blob=="function"||typeof Blob<"u"&&qx.call(Blob)==="[object BlobConstructor]",Mw=typeof File=="function"||typeof File<"u"&&qx.call(File)==="[object FileConstructor]";function ah(s){return Ow&&(s instanceof ArrayBuffer||Lw(s))||qw&&s instanceof Blob||Mw&&s instanceof File}function _o(s,n){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let r=0,o=s.length;r<o;r++)if(_o(s[r]))return!0;return!1}if(ah(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return _o(s.toJSON(),!0);for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)&&_o(s[r]))return!0;return!1}function Bw(s){const n=[],r=s.data,o=s;return o.data=Dd(r,n),o.attachments=n.length,{packet:o,buffers:n}}function Dd(s,n){if(!s)return s;if(ah(s)){const r={_placeholder:!0,num:n.length};return n.push(s),r}else if(Array.isArray(s)){const r=new Array(s.length);for(let o=0;o<s.length;o++)r[o]=Dd(s[o],n);return r}else if(typeof s=="object"&&!(s instanceof Date)){const r={};for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&(r[o]=Dd(s[o],n));return r}return s}function Uw(s,n){return s.data=Od(s.data,n),delete s.attachments,s}function Od(s,n){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<n.length)return n[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let r=0;r<s.length;r++)s[r]=Od(s[r],n);else if(typeof s=="object")for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(s[r]=Od(s[r],n));return s}const Iw=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ie;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(Ie||(Ie={}));class Hw{constructor(n){this.replacer=n}encode(n){return(n.type===Ie.EVENT||n.type===Ie.ACK)&&_o(n)?this.encodeAsBinary({type:n.type===Ie.EVENT?Ie.BINARY_EVENT:Ie.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let r=""+n.type;return(n.type===Ie.BINARY_EVENT||n.type===Ie.BINARY_ACK)&&(r+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(r+=n.nsp+","),n.id!=null&&(r+=n.id),n.data!=null&&(r+=JSON.stringify(n.data,this.replacer)),r}encodeAsBinary(n){const r=Bw(n),o=this.encodeAsString(r.packet),c=r.buffers;return c.unshift(o),c}}class lh extends vt{constructor(n){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof n=="function"?{reviver:n}:n)}add(n){let r;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(n);const o=r.type===Ie.BINARY_EVENT;o||r.type===Ie.BINARY_ACK?(r.type=o?Ie.EVENT:Ie.ACK,this.reconstructor=new $w(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(ah(n)||n.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(n),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+n)}decodeString(n){let r=0;const o={type:Number(n.charAt(0))};if(Ie[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===Ie.BINARY_EVENT||o.type===Ie.BINARY_ACK){const d=r+1;for(;n.charAt(++r)!=="-"&&r!=n.length;);const f=n.substring(d,r);if(f!=Number(f)||n.charAt(r)!=="-")throw new Error("Illegal attachments");const y=Number(f);if(!Gw(y)||y<0)throw new Error("Illegal attachments");if(y>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=y}if(n.charAt(r+1)==="/"){const d=r+1;for(;++r&&!(n.charAt(r)===","||r===n.length););o.nsp=n.substring(d,r)}else o.nsp="/";const c=n.charAt(r+1);if(c!==""&&Number(c)==c){const d=r+1;for(;++r;){const f=n.charAt(r);if(f==null||Number(f)!=f){--r;break}if(r===n.length)break}o.id=Number(n.substring(d,r+1))}if(n.charAt(++r)){const d=this.tryParse(n.substr(r));if(lh.isPayloadValid(o.type,d))o.data=d;else throw new Error("invalid payload")}return o}tryParse(n){try{return JSON.parse(n,this.opts.reviver)}catch{return!1}}static isPayloadValid(n,r){switch(n){case Ie.CONNECT:return vy(r);case Ie.DISCONNECT:return r===void 0;case Ie.CONNECT_ERROR:return typeof r=="string"||vy(r);case Ie.EVENT:case Ie.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&Iw.indexOf(r[0])===-1);case Ie.ACK:case Ie.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class $w{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const r=Uw(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Gw=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s};function vy(s){return Object.prototype.toString.call(s)==="[object Object]"}const Pw=Object.freeze(Object.defineProperty({__proto__:null,Decoder:lh,Encoder:Hw,get PacketType(){return Ie}},Symbol.toStringTag,{value:"Module"}));function Bn(s,n,r){return s.on(n,r),function(){s.off(n,r)}}const Vw=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Mx extends vt{constructor(n,r,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=r,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[Bn(n,"open",this.onopen.bind(this)),Bn(n,"packet",this.onpacket.bind(this)),Bn(n,"error",this.onerror.bind(this)),Bn(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...r){var o,c,d;if(Vw.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(r.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const f={type:Ie.EVENT,data:r};if(f.options={},f.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const x=this.ids++,_=r.pop();this._registerAckCallback(x,_),f.id=x}const y=(c=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||c===void 0?void 0:c.writable,g=this.connected&&!(!((d=this.io.engine)===null||d===void 0)&&d._hasPingExpired());return this.flags.volatile&&!y||(g?(this.notifyOutgoingListeners(f),this.packet(f)):this.sendBuffer.push(f)),this.flags={},this}_registerAckCallback(n,r){var o;const c=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(c===void 0){this.acks[n]=r;return}const d=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let y=0;y<this.sendBuffer.length;y++)this.sendBuffer[y].id===n&&this.sendBuffer.splice(y,1);r.call(this,new Error("operation has timed out"))},c),f=(...y)=>{this.io.clearTimeoutFn(d),r.apply(this,y)};f.withError=!0,this.acks[n]=f}emitWithAck(n,...r){return new Promise((o,c)=>{const d=(f,y)=>f?c(f):o(y);d.withError=!0,r.push(d),this.emit(n,...r)})}_addToQueue(n){let r;typeof n[n.length-1]=="function"&&(r=n.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((c,...d)=>(this._queue[0],c!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(c)):(this._queue.shift(),r&&r(null,...d)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!n||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:Ie.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(o=>String(o.id)===n)){const o=this.acks[n];delete this.acks[n],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case Ie.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ie.EVENT:case Ie.BINARY_EVENT:this.onevent(n);break;case Ie.ACK:case Ie.BINARY_ACK:this.onack(n);break;case Ie.DISCONNECT:this.ondisconnect();break;case Ie.CONNECT_ERROR:this.destroy();const o=new Error(n.data.message);o.data=n.data.data,this.emitReserved("connect_error",o);break}}onevent(n){const r=n.data||[];n.id!=null&&r.push(this.ack(n.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const o of r)o.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const r=this;let o=!1;return function(...c){o||(o=!0,r.packet({type:Ie.ACK,id:n,data:c}))}}onack(n){const r=this.acks[n.id];typeof r=="function"&&(delete this.acks[n.id],r.withError&&n.data.unshift(null),r.apply(this,n.data))}onconnect(n,r){this.id=n,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ie.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const r=this._anyListeners;for(let o=0;o<r.length;o++)if(n===r[o])return r.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const r=this._anyOutgoingListeners;for(let o=0;o<r.length;o++)if(n===r[o])return r.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const o of r)o.apply(this,n.data)}}}function Nl(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}Nl.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),r=Math.floor(n*this.jitter*s);s=(Math.floor(n*10)&1)==0?s-r:s+r}return Math.min(s,this.max)|0};Nl.prototype.reset=function(){this.attempts=0};Nl.prototype.setMin=function(s){this.ms=s};Nl.prototype.setMax=function(s){this.max=s};Nl.prototype.setJitter=function(s){this.jitter=s};class Ld extends vt{constructor(n,r){var o;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(r=n,n=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,Mo(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((o=r.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new Nl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=n;const c=r.parser||Pw;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var r;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(r=this.backoff)===null||r===void 0||r.setMin(n),this)}randomizationFactor(n){var r;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(r=this.backoff)===null||r===void 0||r.setJitter(n),this)}reconnectionDelayMax(n){var r;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(r=this.backoff)===null||r===void 0||r.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new zw(this.uri,this.opts);const r=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const c=Bn(r,"open",function(){o.onopen(),n&&n()}),d=y=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",y),n?n(y):this.maybeReconnectOnOpen()},f=Bn(r,"error",d);if(this._timeout!==!1){const y=this._timeout,g=this.setTimeoutFn(()=>{c(),d(new Error("timeout")),r.close()},y);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(c),this.subs.push(f),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(Bn(n,"ping",this.onping.bind(this)),Bn(n,"data",this.ondata.bind(this)),Bn(n,"error",this.onerror.bind(this)),Bn(n,"close",this.onclose.bind(this)),Bn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(r){this.onclose("parse error",r)}}ondecoded(n){qo(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,r){let o=this.nsps[n];return o?this._autoConnect&&!o.active&&o.connect():(o=new Mx(this,n,r),this.nsps[n]=o),o}_destroy(n){const r=Object.keys(this.nsps);for(const o of r)if(this.nsps[o].active)return;this._close()}_packet(n){const r=this.encoder.encode(n);for(let o=0;o<r.length;o++)this.engine.write(r[o],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,r){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(c=>{c?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",c)):n.onreconnect()}))},r);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const Er={};function Cn(s,n){typeof s=="object"&&(n=s,s=void 0),n=n||{};const r=Dw(s,n.path||"/socket.io"),o=r.source,c=r.id,d=r.path,f=Er[c]&&d in Er[c].nsps,y=n.forceNew||n["force new connection"]||n.multiplex===!1||f;let g;return y?g=new Ld(o,n):(Er[c]||(Er[c]=new Ld(o,n)),g=Er[c]),r.query&&!n.query&&(n.query=r.queryKey),g.socket(r.path,n)}Object.assign(Cn,{Manager:Ld,Socket:Mx,io:Cn,connect:Cn});const un={TASK_CREATED:"task.created",TASK_UPDATED:"task.updated",TASK_DELETED:"task.deleted",TASK_ASSIGNED:"task.assigned",TASK_STATUS_CHANGED:"task.status_changed",TASK_COMMENTED:"task.commented",INPUT_REQUEST_ANSWERED:"input.request.answered",TASK_ACTIVITY:"task.activity"},_l={THREAD_UPDATED:"thread.updated",THREAD_TITLE_UPDATED:"thread.title.updated",MESSAGE_CREATED:"thread.message.created",AGENT_ACTIVITY:"thread.agent.activity",AGENT_RESPONSE_DELTA:"thread.agent.response.delta"};var Eo;(function(s){s.HUMAN="human",s.AGENT="agent"})(Eo||(Eo={}));const Yw={WORKER_SEEN:"worker.seen"},Fw=window.location.origin,Bx=new Gn({baseUrl:Fw,credentials:"include"}),Qw=Bx.workers;Bx.workers;const Kw=la("/workers");function Xw(){const[s,n]=p.useState([]),[r,o]=p.useState(!0),[c,d]=p.useState(null),[f,y]=p.useState(!1),g=x=>[...x].sort((_,v)=>{const T=new Date(_.lastSeenAt).getTime();return new Date(v.lastSeenAt).getTime()-T}),m=async()=>{try{o(!0),d(null);const x=await Qw.WorkersController_listWorkers();n(g(x))}catch(x){console.error("Error fetching workers:",x),d(x instanceof Error?x.message:"Failed to load workers")}finally{o(!1)}};return p.useEffect(()=>{const x=Cn(Kw,{withCredentials:!0,transports:["websocket","polling"]});return m(),x.on("connect",()=>{x.emit("workers.subscribe",{},_=>{if(_.ok){y(!0);return}y(!1)}),m()}),x.on("disconnect",()=>{y(!1)}),x.on("connect_error",_=>{console.error("Workers WebSocket connection error:",_)}),x.on(Yw.WORKER_SEEN,_=>{n(v=>{const T=v.findIndex(E=>E.id===_.worker.id);if(T>=0){const E=[...v];return E[T]=_.worker,g(E)}return g([...v,_.worker])})}),()=>{x.emit("workers.unsubscribe",{}),x.disconnect()}},[]),{workers:s,isLoading:r,error:c,isConnected:f}}function Zw(){const{setSectionTitle:s}=ns(),{workers:n,isLoading:r,error:o}=Xw(),[c,d]=p.useState(null);p.useEffect(()=>{s("Workers Settings")},[]);const y=`npx -y @taico/worker --serverurl ${`${window.location.protocol}//${window.location.host}`}`,g=x=>{const _=new Date(x),T=new Date().getTime()-_.getTime(),E=120*1e3;return T<=E},m=async()=>{try{await navigator.clipboard.writeText(y),d("Copied"),window.setTimeout(()=>d(null),1800)}catch{d("Copy failed"),window.setTimeout(()=>d(null),1800)}};return r?a.jsx(se,{spacing:"6",children:a.jsx(S,{children:"Loading..."})}):a.jsxs(se,{spacing:"6",children:[a.jsx(S,{tone:"muted",children:"Workers execute tasks in the background. Configure workers to enable automated task execution."}),o?a.jsx(An,{size:"2",weight:"medium",children:o}):null,a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"4",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:"Configure a New Worker"}),a.jsx(S,{tone:"muted",children:"Run this command in your terminal to start a new worker:"})]}),a.jsxs("div",{className:"settings-workers__command-container",children:[a.jsx("code",{className:"settings-workers__command",children:y}),a.jsx(ce,{className:"settings-workers__copy-button",variant:"secondary",size:"sm",onClick:m,children:c??"Copy"})]}),a.jsx(S,{size:"1",tone:"muted",children:"The worker will automatically register and appear in the list below when it connects."})]})}),a.jsxs(se,{spacing:"3",children:[a.jsxs(S,{size:"4",weight:"semibold",children:["Registered Workers (",n.length,")"]}),n.length===0?a.jsx(Qe,{padding:"5",children:a.jsx(S,{tone:"muted",children:"No workers registered yet. Run the command above to start your first worker."})}):n.map(x=>{const _=g(x.lastSeenAt),T=new Date(x.lastSeenAt).toLocaleString();return a.jsx(Qe,{padding:"5",children:a.jsxs(se,{spacing:"3",children:[a.jsx(xt,{justify:"space-between",align:"center",children:a.jsxs(se,{spacing:"1",children:[a.jsxs("div",{className:"settings-workers__title-row",children:[a.jsx(S,{size:"3",weight:"semibold",children:"Worker"}),a.jsx("span",{className:`settings-workers__status-indicator ${_?"settings-workers__status-indicator--connected":"settings-workers__status-indicator--disconnected"}`,children:_?"Connected":"Disconnected"})]}),a.jsxs(S,{size:"1",tone:"muted",children:["ID: ",x.id]}),a.jsxs(S,{size:"1",tone:"muted",children:["Last seen: ",T]})]})}),x.harnesses&&x.harnesses.length>0&&a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"2",weight:"medium",children:"Harnesses:"}),a.jsx("div",{className:"settings-workers__harnesses",children:x.harnesses.map(E=>a.jsx("span",{className:"settings-workers__harness-badge",children:E},E))})]})]})},x.id)})]})]})}function Jw({step:s,isCompleted:n,isCurrent:r,isLast:o,isExpanded:c,onToggle:d}){return a.jsxs("div",{className:"walkthrough-step",children:[a.jsxs("div",{className:"walkthrough-step-rail",children:[a.jsx("div",{className:["walkthrough-step-dot",n?"walkthrough-step-dot--completed":"",r?"walkthrough-step-dot--current":""].filter(Boolean).join(" "),children:n&&a.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),!o&&a.jsx("div",{className:["walkthrough-step-connector",n?"walkthrough-step-connector--completed":""].filter(Boolean).join(" ")})]}),a.jsxs("div",{className:"walkthrough-step-body",children:[a.jsx("button",{className:"walkthrough-step-header",onClick:d,"aria-expanded":c,children:a.jsx(S,{size:"2",weight:r?"semibold":"medium",className:n?"walkthrough-label-done":"",children:s.label})}),c&&a.jsxs("div",{className:"walkthrough-step-detail",children:[a.jsx(S,{size:"2",tone:"muted",as:"p",className:"walkthrough-step-description",children:s.description}),a.jsx(aa,{to:s.href,className:"walkthrough-step-cta",children:"Go →"})]})]})]})}function Ww(){const{setSectionTitle:s}=ns(),{user:n,refreshAuth:r}=zn(),{status:o,isLoading:c}=_x(),[d,f]=p.useState(new Set),y=p.useRef(!1),g=p.useRef(!1);qt(),p.useEffect(()=>{s("Setup walkthrough")},[s]),p.useEffect(()=>{g.current||!n||!o||n.onboardingDisplayMode==="OFF"&&o.completedCount<o.totalCount&&(g.current=!0,eh.WalkthroughController_acknowledge().then(()=>r()).catch(console.error))},[n,o,r]),p.useEffect(()=>{if(!o||y.current)return;y.current=!0;const T=o.steps.find(E=>!E.completed);T&&f(new Set([T.id]))},[o]);const m=T=>{f(E=>{const j=new Set(E);return j.has(T)?j.delete(T):j.add(T),j})},x=o?.completedCount??0,_=o?.totalCount??8,v=o?.steps.findIndex(T=>!T.completed)??-1;return a.jsx("div",{className:"walkthrough-page",children:a.jsxs(se,{spacing:"5",className:"walkthrough-page-inner",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"2",tone:"muted",as:"p",children:"Complete these steps to get the most out of Taico."}),a.jsxs(S,{size:"2",weight:"semibold",children:[x," / ",_," completed"]})]}),c?a.jsx(S,{size:"2",tone:"muted",children:"Loading..."}):a.jsx("div",{className:"walkthrough-track",children:o?.steps.map((T,E)=>a.jsx(Jw,{step:T,isCompleted:T.completed,isCurrent:E===v,isLast:E===o.steps.length-1,isExpanded:d.has(T.id),onToggle:()=>m(T.id)},T.id))})]})})}function eE(){return a.jsx(Dj,{children:a.jsx(ts,{children:a.jsxs(xe,{element:a.jsx(Ij,{}),children:[a.jsx(xe,{path:"/home",element:a.jsx(Mj,{})}),a.jsx(xe,{path:"/settings",element:a.jsx(Yj,{})}),a.jsx(xe,{path:"/settings/account",element:a.jsx(Fj,{})}),a.jsx(xe,{path:"/settings/appearance",element:a.jsx(Kj,{})}),a.jsx(xe,{path:"/settings/projects",element:a.jsx(Xj,{})}),a.jsx(xe,{path:"/settings/chat",element:a.jsx(Zj,{})}),a.jsx(xe,{path:"/settings/workers",element:a.jsx(Zw,{})}),a.jsx(xe,{path:"/settings/data",element:a.jsx(Jj,{})}),a.jsx(xe,{path:"/walkthrough",element:a.jsx(Ww,{})})]})})})}const tE="/",nE=window.location.origin,ko=new Gn({baseUrl:nE,credentials:"include"}),kt=ko.task;ko.actors;ko.task,ko.actors;const sE=la("/tasks"),aE=100,lE=()=>{const[s,n]=p.useState(!0),[r,o]=p.useState(!1),[c,d]=p.useState(null),[f,y]=p.useState([]),[g,m]=p.useState(null),[x,_]=p.useState(!1),[v,T]=p.useState({}),E=H=>{if(!H.message){console.warn("Received task activity event without message, skipping",H);return}T(P=>({...P,[H.taskId]:H}))};p.useEffect(()=>(A(),U()),[]);const j=H=>[...H].sort((P,B)=>{const J=new Date(P.updatedAt).getTime();return new Date(B.updatedAt).getTime()-J}),k=async H=>await kt.TasksController_createTask({body:H}),w=async({taskId:H})=>await kt.TasksController_deleteTask({id:H}),N=async({taskId:H,comment:P})=>await kt.TasksController_addComment({id:H,body:{content:P}}),O=async({taskId:H,assigneeActorId:P})=>{const B={assigneeActorId:P};return await kt.TasksController_assignTask({id:H,body:B})},G=async({taskId:H})=>await kt.TasksController_assignTaskToMe({id:H}),q=async({taskId:H,inputRequestId:P,answer:B})=>await kt.TasksController_answerInputRequest({id:H,inputRequestId:P,body:{answer:B}}),A=async()=>{n(!0),d(null);try{const H=await kt.TasksController_listTasks({page:1,limit:aE});y(j(H.items))}catch(H){d(H instanceof Error?H.message:"Failed to load tasks")}finally{o(!0),n(!1)}},D=p.useCallback(async H=>{try{const P=await kt.TasksController_getTask({id:H});return y(B=>B.some(J=>J.id===P.id)?j(B.map(J=>J.id===P.id?P:J)):j([P,...B])),P}catch(P){return console.error("Failed to fetch task by ID",P),null}},[]),U=()=>{const H=Cn(sE,{transports:["websocket","polling"],withCredentials:!0});return H.on("connect",()=>{console.log("Connected to websocket"),H.emit("tasks.subscribe",{},P=>{P.ok?(console.log(P),console.log("Subscribed to room:",P.room),_(!0)):(console.error("Failed to subscribe to room"),_(!1))}),A()}),H.on("disconnect",()=>{console.log("WebSocket disconnected"),_(!1)}),H.on(un.TASK_CREATED,P=>{console.log("task.created",P),y(B=>B.some(J=>J.id===P.payload.id)?B:j([P.payload,...B]))}),H.on(un.TASK_UPDATED,P=>{console.log("task.updated",P),y(B=>j(B.map(J=>J.id===P.payload.id?P.payload:J)))}),H.on(un.TASK_DELETED,P=>{console.log("task.deleted",P),y(B=>B.filter(J=>J.id!==P.payload.taskId))}),H.on(un.TASK_ASSIGNED,P=>{console.log("task.assigned",P),y(B=>j(B.map(J=>J.id===P.payload.id?P.payload:J)))}),H.on(un.TASK_COMMENTED,async P=>{console.log("task.commented",P);try{const B=await kt.TasksController_getTask({id:P.payload.taskId});y(J=>J.findIndex(ee=>ee.id===B.id)===-1?j([B,...J]):j(J.map(ee=>ee.id===B.id?B:ee)))}catch(B){console.error("Failed to refresh task after comment",B)}}),H.on(un.INPUT_REQUEST_ANSWERED,async P=>{console.log("input.request.answered",P);try{const B=await kt.TasksController_getTask({id:P.payload.taskId});y(J=>J.findIndex(ee=>ee.id===B.id)===-1?j([B,...J]):j(J.map(ee=>ee.id===B.id?B:ee)))}catch(B){console.error("Failed to refresh task after input request answer",B)}}),H.on(un.TASK_STATUS_CHANGED,P=>{console.log("task.status_changed",P),y(B=>j(B.map(J=>J.id===P.payload.id?P.payload:J)))}),H.on(un.TASK_ACTIVITY,P=>{console.log("task.activity",P),E(P)}),m(H),()=>{H.close()}};return{isLoading:s,hasLoadedOnce:r,error:c,activityByTaskId:v,tasks:f,getTaskById:D,createTask:k,deleteTask:w,addComment:N,assignTask:O,assignTaskToMe:G,answerInputRequest:q,isConnected:x}},me={NOT_STARTED:"NOT_STARTED",IN_PROGRESS:"IN_PROGRESS",FOR_REVIEW:"FOR_REVIEW",DONE:"DONE"},kn={[me.NOT_STARTED]:{path:"/tasks/not-started",label:"Queued",icon:"📋"},[me.IN_PROGRESS]:{path:"/tasks/in-progress",label:"Building",icon:"👨🏻💻"},[me.FOR_REVIEW]:{path:"/tasks/in-review",label:"Review",icon:"👀"},[me.DONE]:{path:"/tasks/done",label:"Shipped",icon:"🚀"}},rE=[kn[me.NOT_STARTED],kn[me.IN_PROGRESS],kn[me.FOR_REVIEW],kn[me.DONE]],iE=()=>({[me.NOT_STARTED]:{enteringIds:new Set,exitingTasks:[]},[me.IN_PROGRESS]:{enteringIds:new Set,exitingTasks:[]},[me.FOR_REVIEW]:{enteringIds:new Set,exitingTasks:[]},[me.DONE]:{enteringIds:new Set,exitingTasks:[]}}),Ux=p.createContext(null),oE=500,cE=4e3;function uE({children:s}){const{tasks:n,getTaskById:r,isLoading:o,hasLoadedOnce:c,error:d,isConnected:f,createTask:y,deleteTask:g,addComment:m,assignTask:x,assignTaskToMe:_,answerInputRequest:v,activityByTaskId:T}=lE(),[E,j]=p.useState(""),[k,w]=p.useState(0),N=p.useRef(new Map),O=p.useRef([]),G=p.useRef(new Map),q=p.useRef(0),[A,D]=p.useState(0),{animationByStatus:U,globalEnteringIds:H,globalExitingTasks:P}=p.useMemo(()=>{const J=Date.now(),X=new Map(n.map(Te=>[Te.id,Te])),ee=N.current,ue=new Set(ee.keys()),M=new Set(X.keys());if(O.current=O.current.filter(Te=>Te.expiresAt>J),ue.size>0){const Te={[me.NOT_STARTED]:new Set,[me.IN_PROGRESS]:new Set,[me.FOR_REVIEW]:new Set,[me.DONE]:new Set},R={[me.NOT_STARTED]:[],[me.IN_PROGRESS]:[],[me.FOR_REVIEW]:[],[me.DONE]:[]},K=new Set,re=[];for(const[ae,de]of X){const le=ee.get(ae);le?le.status!==de.status&&(R[le.status].push(le),Te[de.status].add(ae)):(Te[de.status].add(ae),K.add(ae))}for(const[ae,de]of ee)M.has(ae)||(R[de.status].push(de),re.push(de));(Object.values(Te).some(ae=>ae.size>0)||Object.values(R).some(ae=>ae.length>0))&&O.current.push({enteringByStatus:Te,exitingByStatus:R,globalEntering:K,globalExiting:re,expiresAt:J+oE})}N.current=X;const ne=iE();let fe=new Set,ke=[];for(const Te of O.current){for(const R of Object.values(me))Te.enteringByStatus[R].forEach(K=>ne[R].enteringIds.add(K)),ne[R].exitingTasks.push(...Te.exitingByStatus[R]);Te.globalEntering.forEach(R=>fe.add(R)),ke.push(...Te.globalExiting)}return{animationByStatus:ne,globalEnteringIds:fe,globalExitingTasks:ke}},[n,A]);p.useEffect(()=>{if(O.current.length===0)return;const X=Math.min(...O.current.map(ue=>ue.expiresAt))-Date.now();if(X<=0){D(ue=>ue+1);return}const ee=setTimeout(()=>{D(ue=>ue+1)},X);return()=>clearTimeout(ee)},[U,H,P]),p.useEffect(()=>{const J=G.current,X=new Map(n.map(ue=>[ue.id,ue]));if(J.size===0){G.current=X;return}let ee=!1;for(const[ue,M]of X){const ne=J.get(ue);if(ne&&ne.status!==me.DONE&&M.status===me.DONE){ee=!0;break}}if(ee){const ue=Date.now();ue-q.current>=cE&&(q.current=ue,w(M=>M+1))}G.current=X},[n]);const B=p.useMemo(()=>({tasks:n,getTaskById:r,createTask:y,deleteTask:g,addComment:m,assignTask:x,assignTaskToMe:_,answerInputRequest:v,isLoading:o,hasLoadedOnce:c,error:d,isConnected:f,sectionTitle:E,setSectionTitle:j,animationByStatus:U,globalEnteringIds:H,globalExitingTasks:P,activityByTaskId:T,shippedCelebrationTrigger:k}),[n,r,y,g,m,x,_,v,o,c,d,f,E,j,U,H,P,T,k]);return a.jsx(Ux.Provider,{value:B,children:s})}function ra(){const s=p.useContext(Ux);if(!s)throw new Error("useTasksCtx must be used within <TasksProvider>");return s}function dt({title:s,onCancel:n,onSave:r,children:o,headerLeft:c,headerRight:d,closeMs:f=220}){const[y,g]=p.useState(!1),[m,x]=p.useState(!1);p.useEffect(()=>{requestAnimationFrame(()=>g(!0))},[]);function _(){g(!1),setTimeout(()=>n?.(),f)}async function v(){if(!(!r||m))try{x(!0),await r()&&_()}catch{}finally{x(!1)}}function T(E){if(!E.nativeEvent.isComposing){if(E.key==="Escape"){E.preventDefault(),_();return}E.key==="Enter"&&(!E.metaKey&&!E.ctrlKey||(E.preventDefault(),v()))}}return a.jsxs("div",{className:`pop-shell__overlay ${y?"pop-shell__overlay--open":""}`,children:[a.jsx("div",{className:"pop-shell__space",onClick:_}),a.jsxs("div",{className:`pop-shell__main-panel ${y?"pop-shell__main-panel--open":""}`,onKeyDown:T,children:[a.jsxs("div",{className:"pop-shell__main-title",children:[c??a.jsx("div",{onClick:_,children:a.jsx(S,{size:"4",weight:"normal",className:"pop-shell__main-title-button",children:"cancel"})}),a.jsx(S,{size:"4",weight:"medium",children:s}),d??a.jsx("div",{onClick:v,style:{opacity:m?.6:1,pointerEvents:m?"none":"auto"},children:a.jsx(S,{size:"4",weight:"normal",className:"pop-shell__main-title-button",children:m?"saving":"save"})})]}),a.jsx("div",{className:"pop-shell__main-content",children:o})]})]})}function by(s,n){try{const r=localStorage.getItem(s);if(r)return JSON.parse(r)}catch(r){console.error("Error loading draft from localStorage:",r)}return n}function Vr({key:s,defaultValue:n,debounceMs:r=500}){const o=p.useRef(n);p.useEffect(()=>{o.current=n},[n]);const[c,d]=p.useState(()=>by(s,n)),f=p.useRef(void 0);return p.useEffect(()=>{d(by(s,o.current))},[s]),p.useEffect(()=>(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{try{localStorage.setItem(s,JSON.stringify(c))}catch(g){console.error("Error saving draft to localStorage:",g)}},r),()=>{f.current&&clearTimeout(f.current)}),[c,s,r]),[c,d,()=>{try{localStorage.removeItem(s),d(o.current)}catch(g){console.error("Error clearing draft from localStorage:",g)}}]}const dE={title:"",description:""},Sy=s=>{s&&(s.style.height="auto",s.style.height=`${s.scrollHeight}px`)};function qd({onCancel:s,onSave:n}){const[r,o,c]=Vr({key:"new-task-draft",defaultValue:dE}),{title:d,description:f}=r,y=p.useRef(null),g=p.useRef(null),m=(v,T)=>{o({...r,[v]:T})};p.useEffect(()=>{y.current?.focus()},[]),p.useEffect(()=>{Sy(g.current)},[f]);function x(v){m("description",v.target.value),Sy(v.target)}async function _(){const v=await n({title:d,description:f});return v&&c(),v}return a.jsx(dt,{title:"Create a Task",onCancel:s,onSave:_,children:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"new-task-pop__input-title",children:a.jsx("input",{className:"new-task-pop__input-title",ref:y,placeholder:"Title",value:d,onChange:v=>m("title",v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),g.current?.focus())}})}),a.jsx("div",{className:"new-task-pop__input-description",children:a.jsx("textarea",{className:"new-task-pop__input-description",ref:g,placeholder:"Enter a description (optional)",value:f,onChange:x})})]})})}const Ct=s=>{const n=new Date(s),o=Math.round((new Date().getTime()-n.getTime())/(1e3*60));if(o<60)return`${Math.max(o,1)}m ago`;const c=Math.round(o/60);return c<24?`${c}h ago`:n.toLocaleDateString("en-US",{month:"short",day:"numeric"})};function Lr({task:s,animation:n,onClick:r,pulseKey:o,additionalTags:c}){const[d,f]=p.useState(!1),y=s.assigneeActor??s.createdByActor;p.useEffect(()=>{if(o==null)return;f(!0);const x=setTimeout(()=>f(!1),1e3);return()=>clearTimeout(x)},[o]);const g=s.tags.map(x=>({label:x.name}));s.comments.length&&g.push({label:`💬 ${s.comments.length}`}),s.artefacts.length&&g.push({label:`🔗 ${s.artefacts.length}`});const m=s.inputRequests.filter(x=>!x.resolvedAt).length;return m&&g.push({label:`✋ ${m}`}),c&&g.push(...c),a.jsxs(ge,{leading:a.jsx($e,{name:y.displayName,size:"lg",src:y.avatarUrl||void 0}),topRight:Ct(s.updatedAt),tags:g,animation:n,highlight:s.inputRequests.filter(x=>!x.resolvedAt)?.length>0,onClick:r,children:[a.jsxs(S,{className:"pre",children:["#",s.id.slice(0,6)]}),a.jsx("div",{style:{minWidth:0,overflow:"hidden"},children:a.jsx(S,{weight:"bold",size:"3",tone:"default",children:a.jsxs("span",{className:"task-row__title",children:[a.jsx("span",{className:"task-row__titleText",children:s.name}),d?a.jsx("span",{className:"task-row__pulseDot","aria-hidden":!0}):null]})})}),a.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.description}),a.jsxs("div",{style:{fontSize:12},className:"text--tone-muted",children:[s.assignee?`Assigned: @${s.assignee}`:"unassigned"," · ",`Created by @${s.createdByActor.slug}`]})]})}function Ix(s){const n=new Map,r=new Date;r.setHours(0,0,0,0);for(const o of s){const c=new Date(o.updatedAt);c.setHours(0,0,0,0);const d=c.toISOString().split("T")[0],f=c.getTime()===r.getTime();n.has(d)||n.set(d,{date:c,dateKey:d,tasks:[],isToday:f}),n.get(d).tasks.push(o)}return Array.from(n.values()).sort((o,c)=>c.date.getTime()-o.date.getTime())}function Hx(s){const n=new Date;n.setHours(0,0,0,0);const r=new Date(n);r.setDate(r.getDate()-1);const o=new Date(s);if(o.setHours(0,0,0,0),o.getTime()===n.getTime())return"Today";if(o.getTime()===r.getTime())return"Yesterday";const c=n.getFullYear(),d=o.getFullYear(),y=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],g=o.getDate();return d===c?`${y} ${g}`:`${y} ${g}, ${d}`}function hE({date:s,taskCount:n,isExpanded:r,onClick:o}){const c=Hx(s),d=r?"▼":"▶";return a.jsx(ge,{onClick:o,className:"day-summary-row",children:a.jsxs("div",{className:"day-summary-row__content",children:[a.jsx("span",{className:"day-summary-row__chevron",children:d}),a.jsx(S,{weight:"bold",size:"3",children:c}),a.jsxs(S,{size:"2",tone:"muted",className:"day-summary-row__count",children:["· ",n," ",n===1?"task":"tasks"," shipped"]})]})})}function fE({tasks:s,enteringIds:n,exitingTasks:r,groupByDay:o=!1}){const c=ze(),{activityByTaskId:d}=ra(),[f,y]=p.useState(new Set),g=new Set(r.map(v=>v.id)),m=[...s,...r].sort((v,T)=>new Date(T.updatedAt).getTime()-new Date(v.updatedAt).getTime());if(!o)return a.jsx(pe,{children:m.map(v=>{const T=g.has(v.id),E=n.has(v.id);let j;T?j="exiting":E&&(j="entering");const k=d[v.id];return a.jsx(Lr,{task:v,animation:j,pulseKey:k?.ts,onClick:()=>c(`/tasks/task/${v.id}`)},T?`exiting-${v.id}`:v.id)})});const x=Ix(m),_=v=>{y(T=>{const E=new Set(T);return E.has(v)?E.delete(v):E.add(v),E})};return a.jsx(pe,{children:x.map(v=>{if(v.isToday)return v.tasks.map(E=>{const j=g.has(E.id),k=n.has(E.id);let w;j?w="exiting":k&&(w="entering");const N=d[E.id];return a.jsx(Lr,{task:E,animation:w,pulseKey:N?.ts,onClick:()=>c(`/tasks/task/${E.id}`)},j?`exiting-${E.id}`:E.id)});const T=f.has(v.dateKey);return a.jsxs("div",{children:[a.jsx(hE,{date:v.date,taskCount:v.tasks.length,isExpanded:T,onClick:()=>_(v.dateKey)}),T&&v.tasks.map(E=>{const j=g.has(E.id),k=n.has(E.id);let w;j?w="exiting":k&&(w="entering");const N=d[E.id];return a.jsx(Lr,{task:E,animation:w,pulseKey:N?.ts,onClick:()=>c(`/tasks/task/${E.id}`)},j?`exiting-${E.id}`:E.id)})]},v.dateKey)})})}function To({task:s,animation:n,onClick:r,pulseKey:o}){const c=s.assigneeActor??s.createdByActor,d=s.tags.map(y=>({label:y.name}));s.comments.length&&d.push({label:`💬 ${s.comments.length}`});const f=s.inputRequests.filter(y=>!y.resolvedAt).length;return f&&d.push({label:`✋ ${f}`}),s.artefacts.length&&d.push({label:`🔗 ${s.artefacts.length}`}),a.jsxs(vx,{leading:a.jsx($e,{name:c.displayName,size:"md",src:c.avatarUrl||void 0}),topRight:Ct(s.updatedAt),tags:d,animation:n,onClick:r,pulseKey:o,highlight:s.inputRequests.filter(y=>!y.resolvedAt)?.length>0,footer:a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"row-detail truncate",children:["#",s.id.slice(0,6)]}),a.jsx("span",{className:"row-detail truncate",children:s.assigneeActor?`Assigned: @${s.assigneeActor.slug}`:"unassigned"})]}),children:[a.jsx("div",{className:"row-title truncate",children:s.name}),a.jsx("div",{className:"row-subtitle truncate",children:s.description})]})}function pE({date:s,taskCount:n,isExpanded:r,onClick:o}){const c=Hx(s),d=r?"▼":"▶";return a.jsxs("div",{className:"day-summary-card__content",onClick:o,children:[a.jsx("span",{className:"day-summary-card__chevron",children:d}),a.jsxs("span",{className:"day-summary-card__text",children:[a.jsx("strong",{children:c})," · ",n," ",n===1?"task":"tasks"]})]})}function gE({tasks:s,enteringIds:n,exitingTasks:r,groupByDay:o=!1}){const c=ze(),{activityByTaskId:d}=ra(),[f,y]=p.useState(new Set),g=new Set(r.map(T=>T.id)),m=[...s,...r].sort((T,E)=>new Date(E.updatedAt).getTime()-new Date(T.updatedAt).getTime());if(!o)return a.jsx(a.Fragment,{children:m.map(T=>{const E=g.has(T.id),j=n.has(T.id),k=d[T.id];let w;return E?w="exiting":j&&(w="entering"),a.jsx(To,{task:T,animation:w,onClick:()=>c(`/tasks/task/${T.id}`),pulseKey:k?.ts},E?`exiting-${T.id}`:T.id)})});const x=[],_=Ix(m),v=T=>{y(E=>{const j=new Set(E);return j.has(T)?j.delete(T):j.add(T),j})};return _.forEach(T=>{if(T.isToday){T.tasks.forEach(j=>{const k=g.has(j.id),w=n.has(j.id),N=d[j.id];let O;k?O="exiting":w&&(O="entering");const G=a.jsx(To,{task:j,animation:O,onClick:()=>c(`/tasks/task/${j.id}`),pulseKey:N?.ts},k?`exiting-${j.id}`:j.id);x.push(G)});return}const E=f.has(T.dateKey);x.push(a.jsx(pE,{date:T.date,taskCount:T.tasks.length,isExpanded:E,onClick:()=>v(T.dateKey)},`date-group-${T.date}`)),E&&T.tasks.forEach(j=>{const k=g.has(j.id),w=n.has(j.id),N=d[j.id];let O;k?O="exiting":w&&(O="entering");const G=a.jsx(To,{task:j,animation:O,onClick:()=>c(`/tasks/task/${j.id}`),pulseKey:N?.ts},k?`exiting-${j.id}`:j.id);x.push(G)})}),a.jsx(a.Fragment,{children:x})}function ho({status:s}){const n=bt(),r=n?void 0:s,{tasks:o,createTask:c,setSectionTitle:d,animationByStatus:f,globalEnteringIds:y,globalExitingTasks:g,activityByTaskId:m}=ra(),{showError:x}=Dn(),{registerCommands:_,registerTaskSearch:v}=Pr(),T=ze();qt(),p.useEffect(()=>{if(!r){d("All Tasks");return}d(kn[r].label)},[r,d]),p.useEffect(()=>_([{id:"new-task",label:"New Task",description:"Create a new task",aliases:["create","add task"],onSelect:()=>q(!0)}]),[_]),p.useEffect(()=>v(U=>kt.TasksController_searchTasks({query:U,limit:5,threshold:.1})),[v]);const E=p.useMemo(()=>r?o.filter(U=>U.status===r):o,[o,r]),j=p.useMemo(()=>r?{enteringIds:f[r].enteringIds,exitingTasks:f[r].exitingTasks}:{enteringIds:y,exitingTasks:g},[r,f,y,g]),[k,w]=Zd(),[N,O]=p.useState(null),[G,q]=p.useState(!1);p.useEffect(()=>{k.get("new")==="1"&&(q(!0),w({},{replace:!0}))},[k,w]);const A=()=>{console.log("cancel"),q(!1)},D=async({title:U,description:H})=>{console.log(`save title: ${U} - description: ${H}`),O({name:U,description:H});try{const P=await c({name:U,description:H});return P?(O(P),T(`/tasks/task/${P.id}`),!0):!1}catch(P){return console.error("Error saving task"),console.error(P),x(P),!1}};return a.jsx("div",{className:`${n?"full-height":""}`,children:n?a.jsxs("div",{className:"tasks-page",children:[a.jsx(mE,{tasks:o,animationByStatus:f}),a.jsxs("button",{className:"tasks-fab tasks-fab--desktop",type:"button",onClick:()=>q(!0),children:[a.jsx("span",{className:"tasks-fab__plus",children:"+"}),a.jsx("span",{className:"tasks-fab__label",children:"New task"})]}),G?a.jsx(qd,{onCancel:A,onSave:D}):null]}):a.jsxs(a.Fragment,{children:[a.jsx(fE,{tasks:E,enteringIds:j.enteringIds,exitingTasks:j.exitingTasks,groupByDay:r===me.DONE}),a.jsx("button",{className:"tasks-fab",type:"button",onClick:()=>q(!0),"aria-label":"Create new task",children:"+"}),G?a.jsx(qd,{onCancel:A,onSave:D}):null]})})}function fo({tasks:s,status:n,animationState:r}){const o=p.useMemo(()=>s.filter(d=>d.status===n),[s,n]),c=kn[n].label;return a.jsxs("div",{className:"tasks-board-column",children:[a.jsxs("div",{className:"tasks-board-column__header",children:[a.jsx(S,{size:"3",weight:"bold",children:c}),a.jsx(S,{size:"1",tone:"muted",children:o.length})]}),a.jsx("div",{className:"tasks-board-column__body",children:a.jsx(gE,{tasks:o,enteringIds:r.enteringIds,exitingTasks:r.exitingTasks,groupByDay:n===me.DONE})})]})}function mE({tasks:s,animationByStatus:n}){return a.jsxs("div",{className:"tasks-board-view",children:[a.jsx(fo,{status:me.NOT_STARTED,tasks:s,animationState:n[me.NOT_STARTED]}),a.jsx(fo,{status:me.IN_PROGRESS,tasks:s,animationState:n[me.IN_PROGRESS]}),a.jsx(fo,{status:me.FOR_REVIEW,tasks:s,animationState:n[me.FOR_REVIEW]}),a.jsx(fo,{status:me.DONE,tasks:s,animationState:n[me.DONE]})]})}const yE=2200;function xE({trigger:s,durationMs:n=yE}){const[r,o]=p.useState(!1);return p.useEffect(()=>{if(s<=0)return;o(!0);const c=window.setTimeout(()=>o(!1),n);return()=>window.clearTimeout(c)},[s,n]),r?a.jsxs("div",{className:"shipped-celebration",style:{"--celebration-duration":`${n}ms`},"aria-hidden":"true",children:[a.jsx("div",{className:"shipped-celebration__veil"}),a.jsx("div",{className:"shipped-celebration__rocket",role:"presentation",children:"🚀"}),a.jsx("div",{className:"shipped-celebration__spark shipped-celebration__spark--one"}),a.jsx("div",{className:"shipped-celebration__spark shipped-celebration__spark--two"}),a.jsx("div",{className:"shipped-celebration__spark shipped-celebration__spark--three"})]}):null}const vE=window.location.origin,$x=new Gn({baseUrl:vE,credentials:"include"}),kr=$x.taskBlueprints,vl=$x.scheduledTasks;function bE(){const s=bt(),{sectionTitle:n,shippedCelebrationTrigger:r}=ra(),o=ze(),[c,d]=p.useState(null);return p.useEffect(()=>{let f=!0;return(async()=>{try{const g=await vl.ScheduledTasksController_listScheduledTasks({page:1,limit:50});if(!f)return;const m=g.items.filter(x=>x.enabled).length;d(m)}catch{f&&d(null)}})(),()=>{f=!1}},[]),a.jsxs("div",{style:{minHeight:0},children:[a.jsx(xE,{trigger:r}),s?a.jsx(Ra,{sectionTitle:n,headerActions:a.jsxs(ce,{size:"sm",variant:"ghost",className:"tasks-layout__schedule-button",onClick:()=>o("/tasks/schedule"),children:[a.jsx("span",{className:"tasks-layout__schedule-icon",children:"🗓"}),"Schedule",c&&c>0?a.jsx("span",{className:"tasks-layout__schedule-badge",children:c}):null]}),children:a.jsx(Ot,{})}):a.jsx(za,{appTitle:"Tasks",sectionTitle:n,navItems:rE,children:a.jsx(Ot,{})})]})}const SE={content:""},_y=s=>{s&&(s.style.height="auto",s.style.height=`${s.scrollHeight}px`)};function _E({onCancel:s,onSave:n,taskId:r}){const[o,c,d]=Vr({key:`new-comment-draft-${r}`,defaultValue:SE}),{content:f}=o,y=p.useRef(null);p.useEffect(()=>{y.current?.focus()},[]),p.useEffect(()=>{_y(y.current)},[f]);function g(x){c({...o,content:x.target.value}),_y(x.target)}async function m(){const x=await n({content:f});return x&&d(),x}return a.jsx(dt,{title:"Add Comment",onCancel:s,onSave:m,children:a.jsx(a.Fragment,{children:a.jsx("div",{className:"new-comment-pop__input-content",children:a.jsx("textarea",{className:"new-comment-pop__input-content",ref:y,placeholder:"Leave a comment...",value:f,onChange:g})})})})}const TE={answer:""},hd=s=>{s&&(s.style.height="auto",s.style.height=`${s.scrollHeight}px`)};function jE({onCancel:s,onSave:n,taskId:r,inputRequestId:o,question:c}){const[d,f,y]=Vr({key:`answer-input-request-draft-${o}`,defaultValue:TE}),{answer:g}=d,m=p.useRef(null),x=p.useRef(null);p.useEffect(()=>{x.current?.focus()},[]),p.useEffect(()=>{hd(m.current)},[c]),p.useEffect(()=>{hd(x.current)},[g]);function _(T){f({...d,answer:T.target.value}),hd(T.target)}async function v(){const T=await n({answer:g});return T&&y(),T}return a.jsx(dt,{title:"Answer Input Request",onCancel:s,onSave:v,children:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"new-comment-pop__input-content",children:a.jsx("textarea",{className:"new-comment-pop__input-content",ref:m,value:c,readOnly:!0,style:{opacity:.7,cursor:"default"}})}),a.jsx("div",{className:"new-comment-pop__input-content",children:a.jsx("textarea",{className:"new-comment-pop__input-content",ref:x,placeholder:"Your answer...",value:g,onChange:_})})]})})}function wE({onCancel:s,onSave:n,existingTags:r}){const[o,c]=p.useState([]),[d,f]=p.useState(!0),[y,g]=p.useState(""),[m,x]=p.useState(0),[_,v]=p.useState(!1),T=p.useRef(null),E=p.useRef(null);p.useEffect(()=>{(async()=>{try{const q=await UT.metaControllerGetAllTags();c(q)}catch(q){console.error("Failed to load tags:",q)}finally{f(!1)}})()},[]),p.useEffect(()=>{T.current?.focus()},[]);const j=p.useMemo(()=>{const G=new Set(r.map(U=>U.id)),q=o.filter(U=>!G.has(U.id));if(!y.trim())return q;const A=y.toLowerCase().trim();return q.map(U=>{let H=0;return U.name.toLowerCase().startsWith(A)?H+=100:U.name.toLowerCase().includes(A)&&(H+=50),{tag:U,score:H}}).filter(U=>U.score>0).sort((U,H)=>H.score-U.score).map(U=>U.tag)},[o,r,y]),k=p.useMemo(()=>{if(!y.trim())return!1;const G=y.toLowerCase().trim();return!o.some(q=>q.name.toLowerCase()===G)},[y,o]);p.useEffect(()=>{x(0)},[j.length,y,k]),p.useEffect(()=>{if(E.current){const G=j.length+(k?1:0);if(m<G){const q=E.current.children[m];q&&q.scrollIntoView({block:"nearest"})}}},[m,j.length,k]);const w=p.useCallback(async G=>{if(_)return!1;v(!0);try{const q=await n(G);return q&&s?.(),q}finally{v(!1)}},[_,s,n]),N=p.useCallback(G=>{if(G.nativeEvent.isComposing)return;const q=j.length+(k?1:0);switch(G.key){case"ArrowDown":if(q===0)return;G.preventDefault(),x(A=>A<q-1?A+1:A);break;case"ArrowUp":if(q===0)return;G.preventDefault(),x(A=>A>0?A-1:0);break;case"Enter":G.preventDefault(),m<j.length?w(j[m]):k&&m===j.length&&w(fd(y));break;case"Escape":G.preventDefault(),s?.();break}},[k,j,m,s,y,w]);async function O(){if(j.length+(k?1:0)===0)return!1;if(m<j.length){const q=j[m];return q?w(q):!1}return k&&m===j.length?w(fd(y)):!1}return a.jsx(dt,{title:"Add Tag",onCancel:s,onSave:O,children:a.jsxs("div",{className:"tag-search-pop",children:[a.jsx("input",{ref:T,type:"text",className:"tag-search-pop__input",placeholder:"Search or create tag...",value:y,onChange:G=>g(G.target.value),onKeyDown:N}),a.jsx("div",{className:"tag-search-pop__list",ref:E,role:"listbox","aria-label":"Available tags",children:d?a.jsx("div",{className:"tag-search-pop__empty",children:a.jsx(S,{tone:"muted",children:"Loading tags..."})}):j.length===0&&!k?a.jsx("div",{className:"tag-search-pop__empty",children:a.jsx(S,{tone:"muted",children:"No tags found"})}):a.jsxs(a.Fragment,{children:[j.map((G,q)=>a.jsx("button",{type:"button",role:"option","aria-selected":q===m,className:`tag-search-pop__item ${q===m?"tag-search-pop__item--highlighted":""}`,onClick:()=>void w(G),onMouseEnter:()=>x(q),disabled:_,children:a.jsx("div",{className:"tag-search-pop__tag-badge",style:{backgroundColor:G.color||"#999"},children:G.name})},G.id)),k&&a.jsxs("button",{type:"button",role:"option","aria-selected":m===j.length,className:`tag-search-pop__item tag-search-pop__item--create ${m===j.length?"tag-search-pop__item--highlighted":""}`,onClick:()=>void w(fd(y)),onMouseEnter:()=>x(j.length),disabled:_,children:[a.jsx(S,{size:"2",tone:"muted",children:"Create new tag:"}),a.jsx("div",{className:"tag-search-pop__tag-badge",style:{backgroundColor:"#999"},children:y.trim()})]})]})})]})})}function fd(s){return{id:"",name:s.trim(),color:void 0,createdAt:"",updatedAt:""}}function EE({onCancel:s,onSave:n,excludeTaskIds:r}){const[o,c]=p.useState(""),[d,f]=p.useState(0),[y,g]=p.useState([]),[m,x]=p.useState(!1),[_,v]=p.useState(null),[T,E]=p.useState(!1),j=p.useRef(null),k=p.useRef(null),w=p.useRef(0);p.useEffect(()=>{j.current?.focus()},[]),p.useEffect(()=>{const D=o.trim();if(!D){w.current=w.current+1,g([]),v(null),x(!1);return}const U=w.current+1;w.current=U,x(!0),v(null);const H=window.setTimeout(async()=>{try{const P=await kt.TasksController_searchTasks({query:D,limit:20});if(w.current!==U)return;g(P??[])}catch(P){if(w.current!==U)return;v(P instanceof Error?P.message:"Failed to search tasks"),g([])}finally{w.current===U&&x(!1)}},200);return()=>{window.clearTimeout(H)}},[o]);const N=p.useMemo(()=>{const D=new Set(r);return y.filter(U=>!D.has(U.id))},[y,r]);p.useEffect(()=>{f(0)},[N.length,o]),p.useEffect(()=>{if(k.current){const D=k.current.children[d];D&&D.scrollIntoView({block:"nearest"})}},[d]);const O=p.useCallback(async D=>{if(T)return!1;E(!0);try{const U=await kt.TasksController_getTask({id:D.id}),H=await n(U);return H&&s?.(),H}catch(U){return console.error("Failed to fetch task details:",U),!1}finally{E(!1)}},[T,s,n]),G=p.useCallback(()=>{if(N.length===0)return;const D=N[d];D&&O(D)},[N,d,O]),q=p.useCallback(D=>{if(!D.nativeEvent.isComposing)switch(D.key){case"ArrowDown":if(N.length===0)return;D.preventDefault(),f(U=>U<N.length-1?U+1:U);break;case"ArrowUp":if(N.length===0)return;D.preventDefault(),f(U=>U>0?U-1:0);break;case"Enter":D.preventDefault(),G();break;case"Escape":D.preventDefault(),s?.();break}},[N,G,s]);async function A(){if(N.length===0)return!1;const D=N[d];return D?O(D):!1}return a.jsx(dt,{title:"Add Dependency",onCancel:s,onSave:A,children:a.jsxs("div",{className:"task-search-pop",children:[a.jsx("input",{ref:j,type:"text",className:"task-search-pop__input",placeholder:"Search tasks...",value:o,onChange:D=>c(D.target.value),onKeyDown:q}),a.jsx("div",{className:"task-search-pop__list",ref:k,role:"listbox","aria-label":"Tasks",children:N.length===0?a.jsx("div",{className:"task-search-pop__empty",children:a.jsx(S,{tone:"muted",children:o.trim()?m?"Searching tasks...":_||"No tasks found":"Type to search for tasks"})}):N.map((D,U)=>a.jsx("button",{type:"button",role:"option","aria-selected":U===d,className:`task-search-pop__item ${U===d?"task-search-pop__item--highlighted":""}`,onClick:()=>void O(D),onMouseEnter:()=>f(U),disabled:T,children:a.jsxs("div",{className:"task-search-pop__item-info",children:[a.jsx(S,{weight:"medium",size:"2",children:D.name}),a.jsxs(S,{tone:"muted",size:"1",style:"mono",children:["#",D.id.slice(0,6)]})]})},D.id))})]})})}Pe.BASE=Na;const Gx=p.createContext(null);function kE({children:s}){const[n,r]=p.useState([]),[o,c]=p.useState(!1),[d,f]=p.useState(null),y=p.useCallback(async()=>{c(!0),f(null);try{const x=await mx.actorControllerListActors();r(x||[])}catch(x){f(x instanceof Error?x.message:"Failed to load actors")}finally{c(!1)}},[]);p.useEffect(()=>{y()},[y]);const g=p.useCallback(async()=>{await y()},[y]),m=p.useMemo(()=>({actors:n,isLoading:o,error:d,refreshActors:g}),[n,o,d,g]);return a.jsx(Gx.Provider,{value:m,children:s})}function rh(){const s=p.useContext(Gx);if(!s)throw new Error("useActorsCtx must be used within <ActorsProvider>");return s}function CE({onCancel:s,onSave:n}){const{actors:r,isLoading:o,error:c,refreshActors:d}=rh(),[f,y]=p.useState(""),[g,m]=p.useState(0),[x,_]=p.useState(null),[v,T]=p.useState(!1),[E,j]=p.useState(null),[k,w]=p.useState(!1),N=p.useRef(null),O=p.useRef(null),G=p.useRef(0);p.useEffect(()=>{N.current?.focus()},[]),p.useEffect(()=>{d().catch(()=>{})},[d]),p.useEffect(()=>{const P=f.trim();if(!P){_(null),j(null),T(!1);return}const B=G.current+1;G.current=B,T(!0),j(null);const J=window.setTimeout(async()=>{try{const X=await mx.actorControllerSearchActors(P,20);if(G.current!==B)return;_(X??[])}catch(X){if(G.current!==B)return;j(X instanceof Error?X.message:"Failed to search actors"),_([])}finally{G.current===B&&T(!1)}},200);return()=>{window.clearTimeout(J)}},[f]);const q=p.useMemo(()=>f.trim()?x??[]:r,[r,f,x]);p.useEffect(()=>{m(0)},[q.length,f]),p.useEffect(()=>{if(O.current){const P=O.current.children[g];P&&P.scrollIntoView({block:"nearest"})}},[g]);const A=p.useCallback(async P=>{if(k)return!1;w(!0);try{const B=await n(P);return B&&s?.(),B}finally{w(!1)}},[k,s,n]),D=p.useCallback(()=>{if(q.length===0)return;const P=q[g];P&&A(P)},[q,g,A]),U=p.useCallback(P=>{if(!P.nativeEvent.isComposing)switch(P.key){case"ArrowDown":if(q.length===0)return;P.preventDefault(),m(B=>B<q.length-1?B+1:B);break;case"ArrowUp":if(q.length===0)return;P.preventDefault(),m(B=>B>0?B-1:0);break;case"Enter":P.preventDefault(),D();break}},[q,D]);async function H(){if(q.length===0)return!1;const P=q[g];return P?A(P):!1}return a.jsx(dt,{title:"Assign Task",onCancel:s,onSave:H,children:a.jsxs("div",{className:"actor-search-pop",children:[a.jsx("input",{ref:N,type:"text",className:"actor-search-pop__input",placeholder:"Search by name or @slug...",value:f,onChange:P=>y(P.target.value),onKeyDown:U}),a.jsx("div",{className:"actor-search-pop__list",ref:O,role:"listbox","aria-label":"Assignees",children:q.length===0?a.jsx("div",{className:"actor-search-pop__empty",children:a.jsx(S,{tone:"muted",children:f.trim()?v?"Searching actors...":E||"No actors found":o?"Loading actors...":c||"No actors found"})}):q.map((P,B)=>a.jsxs("button",{type:"button",role:"option","aria-selected":B===g,className:`actor-search-pop__item ${B===g?"actor-search-pop__item--highlighted":""}`,onClick:()=>void A(P),onMouseEnter:()=>m(B),disabled:k,children:[a.jsx($e,{name:P.displayName,size:"sm",src:P.avatarUrl||void 0}),a.jsxs("div",{className:"actor-search-pop__item-info",children:[a.jsx(S,{weight:"medium",size:"2",children:P.displayName}),a.jsxs(S,{tone:"muted",size:"1",children:["@",P.slug," · ",P.type]})]})]},P.id))})]})})}const NE=window.location.origin,AE=new Gn({baseUrl:NE,credentials:"include"}),$n=AE.threads,RE=window.location.origin,zE=new Gn({baseUrl:RE,credentials:"include"}),qr=zE.executions,DE=s=>s.some(o=>o.isActive&&o.isConfigured)?{isReady:!0,title:"Thread chat is ready",description:"Your conversation tools are online.",ctaLabel:"Open chat settings"}:s.length===0?{isReady:!1,title:"Thread chat is waiting at the gate",description:"Connect your first chat provider in settings to unlock new threads and live conversation.",ctaLabel:"Set up chat"}:s.some(o=>o.isConfigured)?{isReady:!1,title:"Your next level is one switch away",description:"A provider is configured, but none is active yet. Pick one in chat settings to open the thread portal.",ctaLabel:"Choose active provider"}:{isReady:!1,title:"Thread chat needs one more step",description:"A provider exists, but it still needs credentials before threads can talk back.",ctaLabel:"Finish chat setup"};function ih(){const[s,n]=p.useState(null),[r,o]=p.useState(!0),c=p.useCallback(async()=>{o(!0);try{const d=await Rr.chatProvidersControllerListChatProviders();n(DE(d))}catch{n(null)}finally{o(!1)}},[]);return p.useEffect(()=>{c()},[c]),{readiness:s,isLoading:r,isReady:s?.isReady??!0,refresh:c}}function oh({title:s,description:n,ctaLabel:r,onOpenSettings:o,className:c}){return a.jsxs("div",{className:`chat-setup-callout ${c??""}`.trim(),children:[a.jsx("div",{className:"chat-setup-callout__badge",children:"Thread Chat"}),a.jsxs(se,{spacing:"3",children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"4",weight:"semibold",children:s}),a.jsx(S,{tone:"muted",children:n}),a.jsx(S,{size:"1",tone:"muted",children:"Visit `/settings/chat` to wire it up."})]}),a.jsx("div",{className:"chat-setup-callout__actions",children:a.jsx(ce,{variant:"primary",onClick:o,children:r})})]})]})}function Px({task:s,backPath:n,setSectionTitle:r,isLoadingTask:o=!1,activityByTaskId:c={},handlers:d,allTasks:f}){const y=ze(),{actors:g}=rh(),{user:m}=zn(),{showError:x,showToast:_}=Dn(),{registerCommands:v}=Pr(),{readiness:T,isReady:E,isLoading:j}=ih(),[k,w]=p.useState(null),[N,O]=p.useState("idle"),G=p.useRef(null),q=p.useRef(null),A=3500,D=220;qt({task:{name:s?.name}});const U=p.useCallback(async oe=>{if(s)try{await d.changeStatus({taskId:s.id,status:oe})}catch(he){x(he)}},[s,d,x]),[H,P]=p.useState(null),[B,J]=p.useState(!1),X=p.useCallback(async()=>{if(s){if(!E){_("Thread chat unlocks in Chat Settings.","info"),y("/settings/chat");return}J(!0);try{if(H){y(`/threads/${H}`);return}const oe=await $n.ThreadsController_createThread({body:{title:s.name,parentTaskId:s.id}});P(oe.id),y(`/threads/${oe.id}`)}catch(oe){x(oe)}finally{J(!1)}}},[s,H,E,y,x,_]);p.useEffect(()=>{if(!s){P(null);return}let oe=!1;return J(!0),$n.ThreadsController_getThreadByTaskId({taskId:s.id}).then(he=>{oe||P(he?.id??null)}).catch(he=>{oe||(x(he),P(null))}).finally(()=>{oe||J(!1)}),()=>{oe=!0}},[s,x]);const ee=p.useMemo(()=>!s||!s.dependsOnIds||s.dependsOnIds.length===0?[]:s.dependsOnIds.map(oe=>f.find(he=>he.id===oe)).filter(oe=>oe!==void 0),[s,f]);p.useEffect(()=>{if(!s)return;const oe={[me.NOT_STARTED]:["not started","to do","todo","queued"],[me.IN_PROGRESS]:["in progress","doing","building"],[me.FOR_REVIEW]:["for review","review","in review"],[me.DONE]:["done","shipped","release","complete"]},he=Object.entries(kn).map(([He,Bt])=>({id:`task-status-${He}`,label:Bt.label,description:`Mark task as ${Bt.label.toLowerCase()}`,aliases:oe[He],onSelect:()=>U(He)})),we=[{id:"task-add-comment",label:"Comment",description:"Add a comment to this task",aliases:["add comment","note"],onSelect:()=>be(!0)},{id:"task-assign",label:"Assign",description:"Assign this task to someone",aliases:["reassign","assignee"],onSelect:()=>ot(!0)},{id:"task-assign-to-me",label:"Assign to Me",description:"Assign this task to yourself",aliases:["claim","take"],onSelect:()=>{d.assignTaskToMe({taskId:s.id}).catch(x)}},{id:"task-add-tag",label:"Tag",description:"Add a tag to this task",aliases:["add tag","label"],onSelect:()=>Pt(!0)},{id:"task-thread-action",label:H?"Go to thread":"Create thread",description:H?"Open this task thread":"Create a thread from this task",aliases:["thread","open thread","create thread","chat"],onSelect:()=>{X()}}];return v([...he,...we])},[s,v,U,d,x,H,X]),p.useEffect(()=>{if(o){r("Loading task...");return}if(!s){r("Task");return}r(s.name)},[s,o,r]),p.useEffect(()=>()=>{G.current&&window.clearTimeout(G.current),q.current&&window.clearTimeout(q.current)},[]);const[ue,M]=p.useState(null),[ne,fe]=p.useState(!1),[ke,Te]=p.useState([]),[R,K]=p.useState(!1),[re,$]=p.useState(null),[ae,de]=p.useState(new Set),[le,be]=p.useState(!1),[De,ot]=p.useState(!1),[Gt,Pt]=p.useState(!1),[Pn,jt]=p.useState(!1),[Se,Ce]=p.useState(null),St=p.useCallback(oe=>{de(he=>{const we=new Set(he);return we.has(oe)?we.delete(oe):we.add(oe),we})},[]);p.useEffect(()=>{const oe=he=>{if(!s||he.defaultPrevented||he.metaKey||he.ctrlKey||he.altKey||le||De||Gt||Pn||Se||BE(he.target))return;const we=he.key.toLowerCase();we==="a"?(he.preventDefault(),ot(!0)):we==="c"?(he.preventDefault(),be(!0)):we==="t"&&(he.preventDefault(),Pt(!0))};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[s,le,De,Gt,Pn,Se]);const Mt=async({content:oe})=>{if(!s)return!1;try{return await d.addComment({taskId:s.id,comment:oe}),!0}catch(he){return x(he),!1}},en=()=>{be(!1)},On=async oe=>{if(!s)return!1;try{return await d.assignTask({taskId:s.id,assigneeActorId:oe.id}),!0}catch(he){return x(he),!1}},ss=()=>{ot(!1)},as=async({answer:oe})=>{if(!s||!Se)return!1;try{return await d.answerInputRequest({taskId:s.id,inputRequestId:Se.id,answer:oe}),!0}catch(he){return x(he),!1}},ks=()=>{Ce(null)},_t=async oe=>{if(!s)return!1;try{return await d.addTag({taskId:s.id,tag:oe}),!0}catch(he){return x(he),!1}},Cs=()=>{Pt(!1)},Ns=async oe=>{if(s)try{await d.removeTag({taskId:s.id,tagId:oe})}catch(he){x(he)}},Oa=async oe=>{if(!s)return!1;try{return await d.addDependency({taskId:s.id,dependencyTaskId:oe.id}),!0}catch(he){return x(he),!1}},As=()=>{jt(!1)},Rl=async oe=>{if(s)try{await d.removeDependency({taskId:s.id,dependencyTaskId:oe})}catch(he){x(he)}},hn=s?c[s.id]:null,Rs=p.useCallback(async oe=>{K(!0);try{const[he,we]=await Promise.all([qr.ActiveTaskExecutionController_listActiveExecutions(),qr.TaskExecutionHistoryController_listHistory()]),He=he.filter(qe=>qe.taskId===oe).map(qe=>({id:`active-${qe.id}`,executionId:qe.id,agentActorId:qe.agentActorId,status:"ACTIVE",source:"active",timestamp:qe.claimedAt,runnerSessionId:qe.runnerSessionId,toolCallCount:qe.toolCallCount,errorCode:null,errorMessage:null})),Bt=we.filter(qe=>qe.taskId===oe).map(qe=>({id:`history-${qe.id}`,executionId:qe.id,agentActorId:qe.agentActorId,status:qe.status,source:"history",timestamp:qe.transitionedAt,runnerSessionId:qe.runnerSessionId,toolCallCount:qe.toolCallCount,errorCode:qe.errorCode,errorMessage:qe.errorMessage})),fn=[...He,...Bt].sort((qe,Ut)=>new Date(Ut.timestamp).getTime()-new Date(qe.timestamp).getTime());Te(fn),$(null)}catch(he){const we=he instanceof Error?he.message:"Failed to load runs for this task";$(we)}finally{K(!1)}},[]);if(p.useEffect(()=>{if(!s){Te([]),$(null),de(new Set);return}de(new Set),Rs(s.id)},[s,Rs]),p.useEffect(()=>{!s||!hn||hn.kind.startsWith("execution.")&&Rs(s.id)},[hn,s,Rs]),p.useEffect(()=>{!s||!hn||!hn.message||(G.current&&window.clearTimeout(G.current),q.current&&window.clearTimeout(q.current),w(hn),O("enter"),G.current=window.setTimeout(()=>{O("exit"),q.current=window.setTimeout(()=>{w(null),O("idle")},D)},A))},[hn,s,D,A]),!s&&o)return a.jsx(LE,{backPath:n});if(!s)return a.jsx("div",{className:"task-detail-page",children:a.jsxs(se,{spacing:"4",align:"center",children:[a.jsx(S,{size:"3",tone:"muted",children:"Task not found"}),a.jsx(ce,{variant:"secondary",onClick:()=>y(n),children:"Back to tasks"})]})});const zl=async oe=>{fe(!0);try{await d.changeStatus({taskId:s.id,status:oe}),M(null)}catch(he){x(he)}finally{fe(!1)}};return a.jsxs("div",{className:"task-detail-page",children:[ue&&a.jsxs(An,{children:[a.jsx("button",{onClick:()=>M(null),className:"task-detail-page__error-close",children:"×"}),ue]}),a.jsxs(pe,{className:"task-detail-page__section",children:[a.jsxs(ge,{leading:a.jsx($e,{size:"sm",name:s.createdByActor.displayName,src:s.createdByActor.avatarUrl||void 0}),tags:[qE({status:s.status}),...s.tags.map(oe=>({label:oe.name,onRemove:()=>Ns(oe.id)})),{label:"+ add tag",color:"gray",onClick:()=>Pt(!0),clickLabel:"Add tag"}],topRight:a.jsx(S,{size:"1",tone:"muted",children:Ct(s.updatedAt)}),children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:s.createdByActor.displayName}),a.jsx(S,{as:"span",weight:"normal",tone:"muted",size:"3",children:` @${s.createdByActor.slug} created `}),a.jsxs(S,{as:"span",tone:"muted",style:"mono",children:["#",s.id.slice(0,6)]}),s.assigneeActor?null:a.jsx(S,{tone:"muted",children:"unassigned"})]}),s.assigneeActor?a.jsxs(ge,{leading:a.jsx($e,{size:"sm",name:s.assigneeActor.displayName,src:s.assigneeActor.avatarUrl||void 0}),onClick:()=>ot(!0),children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:s.assigneeActor.displayName}),a.jsx(S,{as:"span",weight:"normal",tone:"muted",size:"3",children:` @${s.assigneeActor.slug} assigned`}),a.jsx(S,{size:"1",tone:"muted",children:"tap to reassign"})]}):null]}),s.artefacts&&s.artefacts.length>0&&a.jsx(pe,{className:"task-detail-page__section",children:s.artefacts.map(oe=>a.jsxs(ge,{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:`${oe.name}: `}),a.jsx(S,{as:"span",children:a.jsx("a",{href:oe.link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",textDecoration:"underline"},children:oe.link})})]},oe.id))}),(ee.length>0||s)&&a.jsxs(pe,{title:"Depends on",className:"task-detail-page__section",children:[ee.map(oe=>a.jsx(Lr,{task:oe,onClick:()=>y(`/tasks/task/${oe.id}`),additionalTags:[{label:"× remove",color:"red",onClick:()=>Rl(oe.id),clickLabel:"Remove dependency"}]},oe.id)),a.jsx(ge,{tags:[{label:"+ add dependency",color:"gray",onClick:()=>jt(!0),clickLabel:"Add dependency"}],children:a.jsx(S,{tone:"muted",size:"2",children:ee.length===0?"No dependencies yet":"Add another dependency"})})]}),a.jsx(pe,{className:"task-detail-page__section",children:a.jsxs(ge,{leading:a.jsx($e,{size:"sm",name:s.createdByActor.displayName,src:s.createdByActor.avatarUrl||void 0}),tags:[],topRight:a.jsx(S,{size:"1",tone:"muted",children:Ct(s.createdAt)}),children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:s.createdByActor.displayName}),a.jsx(S,{as:"span",weight:"normal",tone:"muted",size:"3",children:` @${s.createdByActor.slug}`}),a.jsx(S,{children:s.description?s.description:"no description"})]})}),a.jsx(pe,{className:"task-detail-page__section",children:[...s.comments.map(he=>({type:"comment",data:he,timestamp:new Date(he.createdAt).getTime()})),...s.inputRequests.map(he=>({type:"inputRequest",data:he,timestamp:new Date(he.createdAt).getTime()}))].sort((he,we)=>he.timestamp-we.timestamp).map(he=>{if(he.type==="comment"){const we=he.data,He=we.commenterActor?.displayName||"unknown",Bt=we.commenterActor?.slug||"unknown";return a.jsxs(ge,{leading:a.jsx($e,{size:"sm",name:He,src:we.commenterActor?.avatarUrl||void 0}),topRight:a.jsx(S,{size:"1",tone:"muted",children:Ct(we.createdAt)}),children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:He}),a.jsx(S,{as:"span",weight:"normal",tone:"muted",size:"3",children:` @${Bt}`}),a.jsx(S,{children:we.content})]},`comment-${we.id}`)}else if(he.type==="inputRequest"){const we=he.data,He=g.find(ie=>ie.id===we.askedByActorId),Bt=g.find(ie=>ie.id===we.assignedToActorId),fn=He?.displayName||"Unknown",qe=He?.slug||"unknown",Ut=Bt?.displayName||"Unknown",Vn=Bt?.slug||"unknown",tn=!!we.resolvedAt,pn=m&&we.assignedToActorId===m.actorId,zs=typeof we.answer=="string"?we.answer:JSON.stringify(we.answer),ls=tn?[{label:"resolved question",color:"gray"},{label:"answer",color:"green"}]:[{label:"question",color:"orange"}];return a.jsx(ge,{leading:tn?a.jsxs("div",{className:"task-detail-page__input-request-avatars",children:[a.jsx($e,{size:"sm",name:fn,src:He?.avatarUrl||void 0}),a.jsx($e,{size:"sm",name:Ut,src:Bt?.avatarUrl||void 0})]}):a.jsx($e,{size:"sm",name:fn,src:He?.avatarUrl||void 0}),tags:ls,topRight:a.jsx(S,{size:"1",tone:"muted",children:Ct(we.createdAt)}),children:a.jsxs(se,{spacing:"2",children:[a.jsxs("div",{className:"task-detail-page__input-request",children:[a.jsxs("div",{className:"task-detail-page__input-request-question",children:[a.jsxs("div",{className:"task-detail-page__input-request-header",children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:fn}),a.jsx(S,{as:"span",weight:"normal",tone:"muted",size:"3",children:` @${qe}`})]}),a.jsxs(S,{children:[a.jsx(S,{as:"span",tone:"muted",children:"Asked:"})," ",we.question]})]}),tn?a.jsxs("div",{className:"task-detail-page__input-request-answer",children:[a.jsxs("div",{className:"task-detail-page__input-request-header",children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:Ut}),a.jsx(S,{as:"span",weight:"normal",tone:"muted",size:"3",children:` @${Vn}`})]}),a.jsxs(S,{children:[a.jsx(S,{as:"span",tone:"muted",children:"Answered:"})," ",zs]})]}):null]}),!tn&&pn&&a.jsx(ce,{size:"sm",variant:"primary",onClick:()=>Ce(we),children:"Respond"})]})},`input-request-${we.id}`)}})}),a.jsx(pe,{className:"task-detail-page__section",children:a.jsx("div",{className:"task-detail-page__activity",children:a.jsxs("div",{className:`task-detail-page__activity-slot ${k?"task-detail-page__activity-slot--active":""}`,children:[a.jsx("div",{className:"task-detail-page__activity-placeholder",children:a.jsx(S,{size:"2",tone:"muted",children:"Live activity will show here"})}),k?a.jsx("div",{className:`task-detail-page__activity-card ${N==="enter"?"is-entering":""} ${N==="exit"?"is-exiting":""}`,children:a.jsx(S,{size:"2",className:"task-detail-page__activity-message",children:k.message?.replace(/\s+/g," ").trim()||"Activity in progress..."})}):null]})})}),a.jsxs(pe,{title:"Runs",className:"task-detail-page__section",children:[R&&ke.length===0?a.jsx(S,{className:"task-detail-page__executions-state",tone:"muted",children:"Loading runs..."}):null,re?a.jsxs(S,{className:"task-detail-page__executions-state",tone:"muted",children:["Failed to load runs: ",re]}):null,!R&&!re&&ke.length===0?a.jsx(S,{className:"task-detail-page__executions-state",tone:"muted",children:"No runs yet for this task."}):null,ke.map(oe=>{const he=g.find(Vn=>Vn.id===oe.agentActorId),we=he?.displayName??pd(oe.agentActorId),He=he?.slug,Bt=ME(oe.status),fn=oe.status==="FAILED"&&!!(oe.errorCode||oe.errorMessage),qe=ae.has(oe.id),Ut={label:oe.source==="active"?"active":"history",color:"gray"};return a.jsx(ge,{leading:a.jsx($e,{size:"sm",name:we,src:he?.avatarUrl||void 0}),tags:[Bt,Ut],topRight:a.jsx(S,{size:"1",tone:"muted",children:Ct(oe.timestamp)}),children:a.jsxs(se,{spacing:"1",children:[a.jsxs("div",{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:we}),a.jsx(S,{as:"span",weight:"normal",tone:"muted",size:"3",children:He?` @${He}`:""})]}),a.jsx(S,{as:"span",tone:"muted",size:"2",children:a.jsxs("span",{className:"task-detail-page__execution-meta",children:["run #",pd(oe.executionId),fn?a.jsx("button",{type:"button",className:"task-detail-page__execution-error-toggle",onClick:()=>St(oe.id),"aria-label":qe?"Hide failure details":"Show failure details","aria-expanded":qe,title:qe?"Hide failure details":"Show failure details",children:"i"}):null]})}),a.jsx(S,{as:"span",size:"1",tone:"muted",children:a.jsxs("span",{className:"task-detail-page__execution-stats",children:["tools: ",oe.toolCallCount,a.jsx("span",{className:"task-detail-page__execution-stats-separator",children:"|"}),"session: ",oe.runnerSessionId?pd(oe.runnerSessionId):"pending"]})}),fn&&qe?a.jsxs("div",{className:"task-detail-page__execution-error-detail",children:[oe.errorCode?a.jsx(S,{as:"span",size:"1",style:"mono",className:"task-detail-page__execution-error-code",children:oe.errorCode}):null,oe.errorMessage?a.jsx(S,{as:"span",size:"2",wrap:!0,children:oe.errorMessage}):null]}):null]})},oe.id)})]}),a.jsx(pe,{className:"task-detail-page__status-buttons",children:Object.entries(kn).map(([oe,he])=>a.jsx(ce,{size:"sm",variant:oe===s.status?"primary":"secondary",onClick:()=>zl(oe),disabled:ne,children:a.jsxs(se,{spacing:"0",children:[a.jsx("div",{children:he.icon}),a.jsx("div",{children:he.label})]})},oe))}),a.jsx(ce,{className:"task-detail-fab",onClick:()=>be(!0),variant:"primary",size:"lg",children:"Add Comment"}),!s.assigneeActor&&a.jsxs(pe,{className:"task-detail-page__comment-buttons",children:[a.jsx(ce,{size:"lg",onClick:()=>ot(!0),children:"Assign"}),a.jsx(ce,{size:"lg",variant:"primary",onClick:async()=>{await d.assignTaskToMe({taskId:s.id})},children:"Assign to Me"})]}),a.jsx(Cl,{className:"task-detail-page__comment-buttons",onDelete:async()=>{try{await d.deleteTask({taskId:s.id}),y(n)}catch(oe){x(oe)}}}),a.jsxs(pe,{className:"task-detail-page__actions",children:[!j&&T&&!T.isReady?a.jsx(oh,{title:T.title,description:T.description,ctaLabel:T.ctaLabel,onOpenSettings:()=>y("/settings/chat")}):null,a.jsx(ce,{size:"lg",variant:H?"primary":"secondary",onClick:()=>{X()},disabled:B||!E||j,children:H?"Go to thread":"Create thread"}),a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>y(n),children:"Back to Tasks"})]}),le?a.jsx(_E,{onCancel:en,onSave:Mt,taskId:s.id}):null,De?a.jsx(CE,{onCancel:ss,onSave:On}):null,Gt?a.jsx(wE,{onCancel:Cs,onSave:_t,existingTags:s.tags}):null,Pn?a.jsx(EE,{onCancel:As,onSave:Oa,excludeTaskIds:[s.id,...s.dependsOnIds||[]]}):null,Se?a.jsx(jE,{onCancel:ks,onSave:as,taskId:s.id,inputRequestId:Se.id,question:Se.question}):null]})}function OE(){const{d:s}=Wt(),{tasks:n,getTaskById:r,isLoading:o,hasLoadedOnce:c,setSectionTitle:d,addComment:f,deleteTask:y,assignTask:g,assignTaskToMe:m,answerInputRequest:x,activityByTaskId:_}=ra(),[v,T]=p.useState(!1),E=s?n.find(w=>w.id===s):void 0;p.useEffect(()=>{if(!s)return;let w=!1;return T(!0),r(s).catch(N=>console.error("Failed to fetch task",N)).finally(()=>{w||T(!1)}),()=>{w=!0}},[s,r]),p.useEffect(()=>{if(!E||!E.dependsOnIds||E.dependsOnIds.length===0)return;const w=E.dependsOnIds.filter(N=>!n.some(O=>O.id===N));w.length!==0&&Promise.all(w.map(N=>r(N).catch(O=>(console.error(`Failed to hydrate dependency ${N}`,O),null))))},[E,n,r]);const j=!E&&(!c||o||v),k={addComment:({taskId:w,comment:N})=>f({taskId:w,comment:N}),deleteTask:({taskId:w})=>y({taskId:w}),assignTask:({taskId:w,assigneeActorId:N})=>g({taskId:w,assigneeActorId:N}),assignTaskToMe:({taskId:w})=>m({taskId:w}),answerInputRequest:({taskId:w,inputRequestId:N,answer:O})=>x({taskId:w,inputRequestId:N,answer:O}),changeStatus:({taskId:w,status:N})=>kt.TasksController_changeStatus({id:w,body:{status:N}}),addTag:({taskId:w,tag:N})=>kt.TasksController_addTagToTask({id:w,body:{name:N.name}}),removeTag:({taskId:w,tagId:N})=>kt.TasksController_removeTagFromTask({id:w,tagId:N}),addDependency:async({taskId:w,dependencyTaskId:N})=>{const O=n.find(q=>q.id===w);if(!O)return;const G=[...O.dependsOnIds||[],N];await kt.TasksController_updateTask({id:w,body:{dependsOnIds:G}});try{await r(N)}catch(q){console.error(`Failed to hydrate dependency ${N} after adding`,q)}},removeDependency:async({taskId:w,dependencyTaskId:N})=>{const O=n.find(q=>q.id===w);if(!O)return;const G=(O.dependsOnIds||[]).filter(q=>q!==N);await kt.TasksController_updateTask({id:w,body:{dependsOnIds:G}})}};return a.jsx(Px,{task:E,backPath:"/tasks",setSectionTitle:d,isLoadingTask:j,activityByTaskId:_,handlers:k,allTasks:n})}function LE({backPath:s}){const n=ze();return a.jsxs("div",{className:"task-detail-page",children:[a.jsxs(pe,{className:"task-detail-page__section task-detail-page__shell-container",children:[a.jsx("div",{className:"task-detail-page__shell-line task-detail-page__shell-line--wide"}),a.jsx("div",{className:"task-detail-page__shell-line task-detail-page__shell-line--mid"})]}),a.jsxs(pe,{className:"task-detail-page__section task-detail-page__shell-container",children:[a.jsx("div",{className:"task-detail-page__shell-line task-detail-page__shell-line--full"}),a.jsx("div",{className:"task-detail-page__shell-line task-detail-page__shell-line--short"}),a.jsx("div",{className:"task-detail-page__shell-line task-detail-page__shell-line--mid"})]}),a.jsxs(pe,{className:"task-detail-page__section task-detail-page__shell-container",children:[a.jsx("div",{className:"task-detail-page__shell-line task-detail-page__shell-line--full"}),a.jsx("div",{className:"task-detail-page__shell-line task-detail-page__shell-line--full"})]}),a.jsx("div",{className:"task-detail-page__actions",children:a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>n(s),children:"Back to Tasks"})})]})}function qE({status:s}){let n="gray",r="unknown";return s===me.DONE?(r="done",n="purple"):s===me.IN_PROGRESS?(r="in progress",n="green"):s===me.NOT_STARTED?(r="not started",n="blue"):s===me.FOR_REVIEW&&(r="in review",n="orange"),{label:r,color:n}}function ME(s){return s==="ACTIVE"?{label:"active",color:"blue"}:s==="SUCCEEDED"?{label:"succeeded",color:"green"}:s==="FAILED"?{label:"failed",color:"red"}:s==="STALE"?{label:"stale",color:"orange"}:{label:"cancelled",color:"gray"}}function pd(s){return s.length<=12?s:`${s.slice(0,8)}…${s.slice(-4)}`}function BE(s){if(!(s instanceof HTMLElement))return!1;if(s.isContentEditable)return!0;const n=s.tagName.toLowerCase();return n==="input"||n==="textarea"||n==="select"?!0:!!s.closest('[contenteditable="true"], input, textarea, select')}const Ty=100,UE=()=>{const[s,n]=p.useState([]),[r,o]=p.useState({}),[c,d]=p.useState([]),[f,y]=p.useState(!1),[g,m]=p.useState(null),x=p.useCallback(A=>{o(D=>({...D,[A.id]:A})),d(D=>D.some(H=>H.id===A.id)?D.map(H=>H.id===A.id?A:H):[A,...D])},[]),_=p.useCallback(A=>{n(D=>D.find(H=>H.id===A.id)?D.map(H=>H.id===A.id?A:H):[A,...D])},[]),v=p.useCallback(async()=>{y(!0),m(null);try{const A=await vl.ScheduledTasksController_listScheduledTasks({page:1,limit:Ty});n(A.items),A.items.forEach(D=>{D.taskBlueprint&&x(D.taskBlueprint)})}catch(A){m(A instanceof Error?A.message:"Failed to load scheduled tasks")}finally{y(!1)}},[x]),T=p.useCallback(async A=>{const D=await vl.ScheduledTasksController_getScheduledTask({id:A});return _(D),D.taskBlueprint&&x(D.taskBlueprint),D},[_,x]),E=p.useCallback(async A=>{const D=await kr.TaskBlueprintsController_getTaskBlueprint({id:A});return x(D),D},[x]),j=p.useCallback(async()=>{m(null);try{const A=await kr.TaskBlueprintsController_listTaskBlueprints({page:1,limit:Ty});d(A.items),A.items.forEach(D=>x(D))}catch(A){m(A instanceof Error?A.message:"Failed to load task blueprints")}},[x]),k=p.useCallback(async A=>{const D=await kr.TaskBlueprintsController_createTaskBlueprint({body:A});return x(D),D},[x]),w=p.useCallback(async(A,D)=>{const U=await kr.TaskBlueprintsController_updateTaskBlueprint({id:A,body:D});return x(U),U},[x]),N=p.useCallback(async A=>{const D=await vl.ScheduledTasksController_createScheduledTask({body:A});return _(D),D.taskBlueprint&&x(D.taskBlueprint),D},[_,x]),O=p.useCallback(async(A,D)=>{const U=await vl.ScheduledTasksController_updateScheduledTask({id:A,body:D});return _(U),U.taskBlueprint&&x(U.taskBlueprint),U},[_,x]),G=p.useCallback(async A=>{await vl.ScheduledTasksController_deleteScheduledTask({id:A}),n(D=>D.filter(U=>U.id!==A))},[]),q=p.useCallback(async A=>{await kr.TaskBlueprintsController_deleteTaskBlueprint({id:A}),d(D=>D.filter(U=>U.id!==A)),o(D=>{const U={...D};return delete U[A],U})},[]);return p.useEffect(()=>{v()},[v]),{scheduledTasks:s,blueprintsById:r,blueprints:c,isLoading:f,error:g,loadScheduledTasks:v,loadScheduledTask:T,loadBlueprint:E,loadBlueprints:j,createBlueprint:k,updateBlueprint:w,createScheduledTask:N,updateScheduledTask:O,deleteScheduledTask:G,deleteBlueprint:q}},Vx=p.createContext(null);function IE({children:s}){const{scheduledTasks:n,blueprints:r,blueprintsById:o,isLoading:c,error:d,loadScheduledTasks:f,loadScheduledTask:y,loadBlueprint:g,loadBlueprints:m,createBlueprint:x,updateBlueprint:_,createScheduledTask:v,updateScheduledTask:T,deleteScheduledTask:E,deleteBlueprint:j}=UE(),[k,w]=p.useState(""),N=p.useMemo(()=>({scheduledTasks:n,blueprints:r,blueprintsById:o,isLoading:c,error:d,sectionTitle:k,setSectionTitle:w,loadScheduledTasks:f,loadScheduledTask:y,loadBlueprint:g,loadBlueprints:m,createBlueprint:x,updateBlueprint:_,createScheduledTask:v,updateScheduledTask:T,deleteScheduledTask:E,deleteBlueprint:j}),[n,r,o,c,d,k,f,y,g,m,x,_,v,T,E,j]);return a.jsx(Vx.Provider,{value:N,children:s})}function ch(){const s=p.useContext(Vx);if(!s)throw new Error("useScheduledTasksCtx must be used within <ScheduledTasksProvider>");return s}const Co=s=>String(s).padStart(2,"0"),HE=s=>{const[n="0",r="0"]=s.split(":"),o=Number(n),c=Number(r);return{hour:Number.isFinite(o)?o:0,minute:Number.isFinite(c)?c:0}},$E=(s,n,r)=>{if(!s||s==="*")return[];const o=s.split(","),c=[];for(const d of o){const f=d.trim();if(f)if(f.includes("-")){const[y,g]=f.split("-"),m=Number(y),x=Number(g);if(!Number.isFinite(m)||!Number.isFinite(x))continue;const _=Math.max(n,Math.min(m,x)),v=Math.min(r,Math.max(m,x));for(let T=_;T<=v;T+=1)c.push(T)}else{const y=Number(f);Number.isFinite(y)&&y>=n&&y<=r&&c.push(y)}}return Array.from(new Set(c)).sort((d,f)=>d-f)},GE=s=>{if(s.preset==="custom")return s.cronExpression.trim();const{hour:n,minute:r}=HE(s.time),o=Co(r),c=Co(n);if(s.preset==="daily")return`${o} ${c} * * *`;if(s.preset==="weekly"){const f=s.days.length?s.days.join(","):"1";return`${o} ${c} * * ${f}`}const d=Math.min(Math.max(s.dayOfMonth,1),28);return`${o} ${c} ${d} * *`},Yx=s=>{const n=s.trim(),r=n.split(/\s+/);if(r.length<5)return{preset:"custom",time:"09:00",days:[],dayOfMonth:1,cronExpression:n};const[o,c,d,f,y]=r,g=`${Co(Number(c))}:${Co(Number(o))}`;if(d==="*"&&f==="*"&&y==="*")return{preset:"daily",time:g,days:[],dayOfMonth:1,cronExpression:n};if(d==="*"&&f==="*"&&y!=="*"){const m=$E(y,0,7).map(x=>x===7?0:x);return m.length?{preset:"weekly",time:g,days:m,dayOfMonth:1,cronExpression:n}:{preset:"custom",time:g,days:[],dayOfMonth:1,cronExpression:n}}if(d!=="*"&&f==="*"&&y==="*"){const m=Number(d);return{preset:"monthly",time:g,days:[],dayOfMonth:Number.isFinite(m)?m:1,cronExpression:n}}return{preset:"custom",time:"09:00",days:[],dayOfMonth:1,cronExpression:n}},Fx=s=>{if(s.preset==="custom")return`Cron: ${s.cronExpression}`;if(s.preset==="daily")return`Daily at ${s.time}`;if(s.preset==="weekly"){const n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return`Weekly on ${(s.days.length?s.days:[1]).map(c=>n[c]??"").join(", ")} at ${s.time}`}return`Monthly on day ${s.dayOfMonth} at ${s.time}`},PE=/^[\d*/,\-]+$/,VE=s=>{const n=s.trim().split(/\s+/);return n.length!==5?"Cron must have 5 fields: minute hour day-of-month month day-of-week.":n.some(r=>!r||!PE.test(r))?"Cron can only include digits, *, /, -, and commas.":null};function YE({blueprints:s,onCancel:n,onSave:r,onRequestNewBlueprint:o}){const[c,d]=p.useState(""),[f,y]=p.useState(null),[g,m]=p.useState(0),x=p.useMemo(()=>{const v=c.trim().toLowerCase();return v?s.filter(T=>[T.name,T.description||"",T.assigneeActor?.displayName||"",T.assigneeActor?.slug||""].join(" ").toLowerCase().includes(v)):s},[s,c]),_=async()=>f?r(f):!1;return a.jsx(dt,{title:"Create Schedule",onCancel:n,onSave:_,children:a.jsxs("div",{className:"new-schedule-pop",children:[f?a.jsxs("div",{className:"new-schedule-pop__selected",onClick:()=>y(null),children:[a.jsx($e,{size:"md",name:f.name,src:f.assigneeActor?.avatarUrl||void 0}),a.jsxs("div",{className:"new-schedule-pop__selected-meta",children:[a.jsx(S,{weight:"medium",size:"3",children:f.name}),a.jsx(S,{tone:"muted",size:"2",children:f.description||"No description"})]}),a.jsx(S,{size:"2",tone:"muted",children:"tap to change"})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{className:"new-schedule-pop__input",placeholder:"Search blueprint by name...",value:c,onChange:v=>d(v.target.value),onKeyDown:v=>{v.key==="ArrowDown"&&(v.preventDefault(),m(T=>Math.min(T+1,x.length-1))),v.key==="ArrowUp"&&(v.preventDefault(),m(T=>Math.max(T-1,0))),v.key==="Enter"&&x[g]&&(v.preventDefault(),y(x[g]))}}),a.jsx("div",{className:"new-schedule-pop__list",children:x.length===0?a.jsx("div",{className:"new-schedule-pop__empty",children:a.jsx(S,{tone:"muted",size:"2",children:"No blueprints found"})}):x.map((v,T)=>a.jsxs("div",{className:`new-schedule-pop__item ${T===g?"new-schedule-pop__item--highlighted":""}`,onMouseEnter:()=>m(T),onClick:()=>y(v),children:[a.jsx($e,{size:"sm",name:v.name,src:v.assigneeActor?.avatarUrl||void 0}),a.jsxs("div",{className:"new-schedule-pop__item-meta",children:[a.jsx(S,{size:"2",weight:"medium",children:v.name}),a.jsx(S,{size:"1",tone:"muted",children:v.assigneeActor?`@${v.assigneeActor.slug}`:"Unassigned"})]})]},v.id))})]}),a.jsx(ce,{size:"sm",variant:"secondary",onClick:o,children:"+ New blueprint"})]})})}function FE(){const s=ze(),{scheduledTasks:n,blueprints:r,isLoading:o,error:c,createBlueprint:d,createScheduledTask:f,deleteScheduledTask:y,loadBlueprints:g}=ch(),{setSectionTitle:m}=ra(),{showError:x}=Dn(),_=bt(),[v,T]=p.useState(!1),[E,j]=p.useState(!1),k=p.useRef(!1);qt(),p.useEffect(()=>{m("Schedule")},[m]),p.useEffect(()=>{g().catch(x)},[g,x]);const w=p.useMemo(()=>n.filter(A=>A.enabled).length,[n]),N=async A=>{try{const D=await d({name:A.title,description:A.description});return T(!1),s(`/tasks/blueprints/${D.id}`),!0}catch(D){return x(D),!1}},O=async A=>{if(k.current)return!1;k.current=!0;try{const D=await f({taskBlueprintId:A.id,cronExpression:"0 9 * * *",enabled:!1});return j(!1),s(`/tasks/schedule/${D.id}`),!0}catch(D){return x(D),!1}finally{k.current=!1}},G=p.useMemo(()=>r.map(A=>({id:A.id,name:A.name,description:A.description,status:me.NOT_STARTED,assignee:null,assigneeActor:A.assigneeActor??void 0,sessionId:null,comments:[],artefacts:[],inputRequests:[],tags:A.tags,createdByActor:A.createdByActor,dependsOnIds:A.dependsOnIds,createdAt:A.createdAt,updatedAt:A.updatedAt})),[r]),q=async A=>{if(window.confirm("Delete this schedule?"))try{await y(A.id)}catch(D){x(D)}};return a.jsxs("div",{className:"scheduled-tasks-page",children:[c?a.jsx(S,{tone:"muted",children:c}):null,a.jsx("section",{className:"scheduled-tasks-page__section",children:o?a.jsx(S,{tone:"muted",children:"Loading scheduled tasks..."}):a.jsx(pe,{title:"Schedules",action:a.jsxs("div",{className:"scheduled-tasks-page__header-actions",children:[a.jsxs(S,{size:"2",tone:"muted",children:[w," active schedules"]}),a.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>j(!0),children:"+ Add schedule"})]}),children:n.length===0?a.jsxs(Qe,{className:"scheduled-tasks-page__empty",children:[a.jsx(S,{weight:"medium",children:"No schedules yet"}),a.jsx(S,{tone:"muted",children:"Create a schedule from a blueprint."})]}):n.map(A=>{const D=A.taskBlueprint,U=Fx(Yx(A.cronExpression));return a.jsxs(ge,{onClick:()=>s(`/tasks/schedule/${A.id}`),tags:[{label:A.enabled?"enabled":"paused",color:A.enabled?"green":"gray"}],topRight:a.jsxs(S,{size:"1",tone:"muted",children:["Next: ",new Date(A.nextRunAt).toLocaleString()]}),trailing:a.jsx(ce,{size:"sm",variant:"danger",onClick:H=>{H.stopPropagation(),q(A)},children:"Delete"}),children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:D?.name||"Untitled blueprint"}),a.jsx(S,{as:"span",size:"2",tone:"muted",children:` ${U}`})]},A.id)})})}),a.jsx("section",{className:"scheduled-tasks-page__section",children:G.length===0?a.jsxs(Qe,{className:"scheduled-tasks-page__empty",children:[a.jsx(S,{weight:"medium",children:"No blueprints yet"}),a.jsx(S,{tone:"muted",children:"Create a blueprint to reuse task definitions."})]}):_?a.jsx(pe,{title:"Blueprints",action:a.jsxs("div",{className:"scheduled-tasks-page__header-actions",children:[a.jsxs(S,{size:"2",tone:"muted",children:[r.length," blueprints"]}),a.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>T(!0),children:"+ New blueprint"})]}),children:a.jsx("div",{className:"scheduled-tasks-page__blueprints-board",children:G.map(A=>a.jsx(To,{task:A,onClick:()=>s(`/tasks/blueprints/${A.id}`)},A.id))})}):a.jsx(pe,{title:"Blueprints",action:a.jsxs("div",{className:"scheduled-tasks-page__header-actions",children:[a.jsxs(S,{size:"2",tone:"muted",children:[r.length," blueprints"]}),a.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>T(!0),children:"+ New blueprint"})]}),children:G.map(A=>a.jsx(Lr,{task:A,onClick:()=>s(`/tasks/blueprints/${A.id}`)},A.id))})}),v?a.jsx(qd,{onCancel:()=>T(!1),onSave:N}):null,E?a.jsx(YE,{blueprints:r,onCancel:()=>j(!1),onSave:O,onRequestNewBlueprint:()=>{j(!1),T(!0)}}):null]})}const QE=[{value:0,label:"Sun"},{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"}];function KE(){const{scheduleId:s}=Wt(),n=ze(),{scheduledTasks:r,blueprintsById:o,loadScheduledTask:c,loadBlueprint:d,updateScheduledTask:f}=ch(),{setSectionTitle:y}=ra(),{showError:g,showToast:m}=Dn(),[x,_]=p.useState("daily"),[v,T]=p.useState("09:00"),[E,j]=p.useState([1]),[k,w]=p.useState(1),[N,O]=p.useState("0 9 * * *"),[G,q]=p.useState(!1),[A,D]=p.useState(!1),[U,H]=p.useState(null),P=r.find(M=>M.id===s),B=P?.taskBlueprint||(P?o[P.taskBlueprintId]:void 0);qt(),p.useEffect(()=>{s&&(P||c(s).catch(g))},[s,P,c,g]),p.useEffect(()=>{P&&!P.taskBlueprint&&d(P.taskBlueprintId).catch(g)},[P,d,g]),p.useEffect(()=>{B?.name?y(B.name):y("Schedule")},[B,y]),p.useEffect(()=>{if(!P)return;const M=Yx(P.cronExpression);_(M.preset),T(M.time),j(M.days.length?M.days:[1]),w(M.dayOfMonth||1),O(M.cronExpression||P.cronExpression),q(P.enabled)},[P]);const J=p.useMemo(()=>GE({preset:x,time:v,days:E,dayOfMonth:k,cronExpression:N}),[x,v,E,k,N]);if(!P)return a.jsxs("div",{className:"scheduled-task-detail-page",children:[a.jsx(S,{tone:"muted",children:"Scheduled task not found."}),a.jsx(ce,{variant:"secondary",onClick:()=>n("/tasks/schedule"),children:"Back to schedules"})]});const X=Fx({preset:x,time:v,days:E,dayOfMonth:k,cronExpression:J}),ee=M=>{j(ne=>{if(ne.includes(M)){const fe=ne.filter(ke=>ke!==M);return fe.length?fe:ne}return[...ne,M].sort((fe,ke)=>fe-ke)})},ue=async()=>{if(x==="custom"){const M=VE(J);if(M){H(M);return}}H(null),D(!0);try{await f(P.id,{cronExpression:J,enabled:G}),m("Schedule saved","success")}catch(M){g(M)}finally{D(!1)}};return a.jsxs("div",{className:"scheduled-task-detail-page",children:[a.jsx(pe,{title:"Task",className:"scheduled-task-detail-page__section",children:a.jsxs(ge,{onClick:()=>n(`/tasks/blueprints/${P.taskBlueprintId}`),tags:[{label:"blueprint",color:"blue"}],trailing:a.jsx(S,{size:"2",tone:"muted",children:"Open"}),children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:B?.name||"Untitled blueprint"}),a.jsx(S,{as:"span",tone:"muted",size:"2",children:` ${B?.description||"No description"}`})]})}),a.jsxs(pe,{title:"Schedule",className:"scheduled-task-detail-page__section",children:[a.jsxs("div",{className:"scheduled-task-detail-page__controls",children:[a.jsxs("label",{className:"scheduled-task-detail-page__label",children:[a.jsx(S,{size:"2",tone:"muted",children:"Frequency"}),a.jsxs("select",{className:"scheduled-task-detail-page__select",value:x,onChange:M=>_(M.target.value),children:[a.jsx("option",{value:"daily",children:"Daily"}),a.jsx("option",{value:"weekly",children:"Weekly"}),a.jsx("option",{value:"monthly",children:"Monthly"}),a.jsx("option",{value:"custom",children:"Custom (cron)"})]})]}),x!=="custom"?a.jsxs("label",{className:"scheduled-task-detail-page__label",children:[a.jsx(S,{size:"2",tone:"muted",children:"Time"}),a.jsx("input",{className:"scheduled-task-detail-page__input",type:"time",value:v,onChange:M=>T(M.target.value)})]}):null,x==="weekly"?a.jsxs("div",{className:"scheduled-task-detail-page__label",children:[a.jsx(S,{size:"2",tone:"muted",children:"Days"}),a.jsx("div",{className:"scheduled-task-detail-page__day-grid",children:QE.map(M=>a.jsx("button",{type:"button",className:`scheduled-task-detail-page__day ${E.includes(M.value)?"is-selected":""}`,onClick:()=>ee(M.value),children:M.label},M.value))})]}):null,x==="monthly"?a.jsxs("label",{className:"scheduled-task-detail-page__label",children:[a.jsx(S,{size:"2",tone:"muted",children:"Date"}),a.jsx("input",{className:"scheduled-task-detail-page__input",type:"date",value:`2026-01-${String(Math.min(Math.max(k,1),28)).padStart(2,"0")}`,onChange:M=>{const ne=new Date(`${M.target.value}T00:00:00`).getDate();Number.isFinite(ne)&&w(Math.min(Math.max(ne,1),28))}})]}):null,x==="custom"?a.jsxs("label",{className:"scheduled-task-detail-page__label",children:[a.jsx(S,{size:"2",tone:"muted",children:"Cron expression"}),a.jsx("input",{className:"scheduled-task-detail-page__input",value:N,onChange:M=>{O(M.target.value),U&&H(null)},placeholder:"0 9 * * 1-5"}),a.jsx(S,{size:"1",tone:"muted",children:"Use 5 fields: minute hour day-of-month month day-of-week."})]}):null,a.jsx(S,{size:"1",tone:"muted",children:"Schedules run using the server timezone."}),U?a.jsx(An,{size:"1",children:U}):null,a.jsxs("div",{className:"scheduled-task-detail-page__toggle-row",children:[a.jsx(S,{size:"2",tone:"muted",children:"Status"}),a.jsxs("div",{className:"scheduled-task-detail-page__toggle-buttons",children:[a.jsx(ce,{size:"sm",variant:G?"primary":"secondary",onClick:()=>q(!0),children:"On"}),a.jsx(ce,{size:"sm",variant:G?"secondary":"primary",onClick:()=>q(!1),children:"Off"})]})]})]}),a.jsx(ge,{topRight:a.jsxs(S,{size:"1",tone:"muted",children:["Next: ",new Date(P.nextRunAt).toLocaleString()]}),children:a.jsx(S,{as:"span",size:"2",children:X})}),a.jsx(ge,{children:a.jsx(S,{as:"span",size:"2",style:"mono",children:J})})]}),a.jsxs(pe,{className:"scheduled-task-detail-page__actions",children:[a.jsx(ce,{size:"lg",variant:"primary",onClick:ue,disabled:A,children:A?"Saving...":"Save schedule"}),a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>n("/tasks/schedule"),children:"Back to schedules"})]})]})}function XE(){const{taskBlueprintId:s}=Wt(),{user:n}=zn(),{showError:r}=Dn(),{blueprints:o,blueprintsById:c,loadBlueprint:d,updateBlueprint:f,deleteBlueprint:y}=ch(),{setSectionTitle:g,tasks:m}=ra(),x=p.useMemo(()=>{if(s)return c[s]||o.find(T=>T.id===s)},[o,c,s]);p.useEffect(()=>{!s||x||d(s).catch(r)},[s,x,d,r]);const _=p.useMemo(()=>{if(x)return{id:x.id,name:x.name,description:x.description,status:me.NOT_STARTED,assignee:null,assigneeActor:x.assigneeActor??void 0,sessionId:null,comments:[],artefacts:[],inputRequests:[],tags:x.tags,createdByActor:x.createdByActor,dependsOnIds:x.dependsOnIds,createdAt:x.createdAt,updatedAt:x.updatedAt}},[x]),v={addComment:async()=>{throw new Error("Blueprints do not support comments.")},deleteTask:async({taskId:T})=>{await y(T)},assignTask:async({taskId:T,assigneeActorId:E})=>{await f(T,{assigneeActorId:E})},assignTaskToMe:async({taskId:T})=>{if(!n?.actorId)throw new Error("No user session found.");await f(T,{assigneeActorId:n.actorId})},answerInputRequest:async()=>{throw new Error("Blueprints do not support input requests.")},changeStatus:async()=>{throw new Error("Blueprints do not have status updates.")},addTag:async({taskId:T,tag:E})=>{const j=x?.tags?.map(w=>w.name)??[],k=j.includes(E.name)?j:[...j,E.name];await f(T,{tagNames:k})},removeTag:async({taskId:T,tagId:E})=>{const k=(x?.tags??[]).filter(w=>w.id!==E).map(w=>w.name);await f(T,{tagNames:k})},addDependency:async({taskId:T,dependencyTaskId:E})=>{const k=[...x?.dependsOnIds??[],E];await f(T,{dependsOnIds:k})},removeDependency:async({taskId:T,dependencyTaskId:E})=>{const k=(x?.dependsOnIds??[]).filter(w=>w!==E);await f(T,{dependsOnIds:k})}};return a.jsx(Px,{task:_,backPath:"/tasks/schedule",setSectionTitle:g,handlers:v,allTasks:m})}function ZE(){return a.jsx(IE,{children:a.jsx(Ot,{})})}function JE(){return a.jsx(uE,{children:a.jsx(ts,{children:a.jsxs(xe,{element:a.jsx(bE,{}),children:[a.jsx(xe,{index:!0,element:a.jsx(Ca,{to:"/tasks/not-started",replace:!0})}),a.jsx(xe,{path:"not-started",element:a.jsx(ho,{status:me.NOT_STARTED})}),a.jsx(xe,{path:"in-progress",element:a.jsx(ho,{status:me.IN_PROGRESS})}),a.jsx(xe,{path:"in-review",element:a.jsx(ho,{status:me.FOR_REVIEW})}),a.jsx(xe,{path:"done",element:a.jsx(ho,{status:me.DONE})}),a.jsx(xe,{path:"task/:d",element:a.jsx(OE,{})}),a.jsxs(xe,{element:a.jsx(ZE,{}),children:[a.jsx(xe,{path:"schedule",element:a.jsx(FE,{})}),a.jsx(xe,{path:"schedule/:scheduleId",element:a.jsx(KE,{})}),a.jsx(xe,{path:"blueprints/:taskBlueprintId",element:a.jsx(XE,{})})]})]})})})}function WE(){const{logout:s}=zn(),n=ze();return p.useEffect(()=>{(async()=>{try{await s()}finally{n("/login",{replace:!0})}})()},[s,n]),null}const ek=window.location.origin,Qx=new Gn({baseUrl:ek,credentials:"include"}),ka=Qx.context;Qx.context;const Kx=la("/context"),Mr={CONTEXT_BLOCK_CREATED:"context.block.created",CONTEXT_BLOCK_UPDATED:"context.block.updated",CONTEXT_BLOCK_DELETED:"context.block.deleted"};function tk(){const[s,n]=p.useState([]),[r,o]=p.useState(!0),[c,d]=p.useState(null),[f,y]=p.useState(!1),g=v=>[...v].sort((T,E)=>{const j=new Date(T.updatedAt).getTime();return new Date(E.updatedAt).getTime()-j}),m=async()=>{try{o(!0),d(null);const v=await ka.ContextController_listBlocks();n(g(v.items))}catch(v){d(v instanceof Error?v.message:"Failed to fetch context blocks"),console.error("Error fetching context blocks:",v)}finally{o(!1)}},x=()=>{const v=Cn(Kx,{transports:["websocket","polling"],withCredentials:!0});return v.on("connect",()=>{console.log("Connected to context WebSocket"),v.emit("context.subscribe",{},T=>{T.ok?(console.log("Subscribed to context room:",T.room),y(!0)):(console.error("Failed to subscribe to context room"),y(!1))}),m()}),v.on("disconnect",()=>{console.log("Context WebSocket disconnected"),y(!1)}),v.on("connect_error",T=>{console.error("Context websocket connect_error",T.message)}),v.on(Mr.CONTEXT_BLOCK_CREATED,T=>{console.log("context.block.created",T),n(E=>E.some(j=>j.id===T.payload.id)?E:g([T.payload,...E]))}),v.on(Mr.CONTEXT_BLOCK_UPDATED,T=>{console.log("context.block.updated",T),n(E=>g(E.map(j=>j.id===T.payload.id?T.payload:j)))}),v.on(Mr.CONTEXT_BLOCK_DELETED,T=>{console.log("context.block.deleted",T),n(E=>E.filter(j=>j.id!==T.payload.blockId))}),()=>{v.emit("context.unsubscribe",{}),v.close()}},_=p.useCallback(async v=>{try{const T=await ka.ContextController_getBlock({id:v});return n(E=>E.some(j=>j.id===T.id)?E:g([T,...E])),T}catch(T){return console.error("Failed to fetch block by ID",T),null}},[]);return p.useEffect(()=>(m(),x()),[]),{blocks:s,getBlockById:_,isLoading:r,error:c,isConnected:f,reload:m}}function nk(s){const[n,r]=p.useState(null),[o,c]=p.useState(!0),[d,f]=p.useState(null),[y,g]=p.useState(!1),m=p.useCallback(async()=>{try{c(!0),f(null);const x=await ka.ContextController_getBlock({id:s});r(x),g(!1)}catch(x){f(x instanceof Error?x.message:"Failed to fetch context block"),console.error("Error fetching context block:",x)}finally{c(!1)}},[s]);return p.useEffect(()=>{s&&m()},[s,m]),p.useEffect(()=>{if(!s)return;const x=Cn(Kx,{transports:["websocket","polling"],withCredentials:!0});return x.on("connect",()=>{console.log("Connected to context WebSocket (detail page)"),x.emit("context.subscribe",{blockId:s},_=>{_.ok?(console.log("Subscribed to context room (detail page):",_.room),m()):console.error("Failed to subscribe to context room (detail page)",_.error)})}),x.on("connect_error",_=>{console.error("Context detail websocket connect_error",_.message)}),x.on("disconnect",()=>{console.log("Context WebSocket disconnected (detail page)")}),x.on(Mr.CONTEXT_BLOCK_UPDATED,_=>{_.payload.id===s&&(console.log("context.block.updated (detail page)",_),m().catch(v=>console.error("Error refreshing block after update:",v)))}),x.on(Mr.CONTEXT_BLOCK_DELETED,_=>{_.payload.blockId===s&&(console.log("context.block.deleted (detail page)",_),g(!0),r(null))}),()=>{x.emit("context.unsubscribe",{blockId:s}),x.close()}},[s,m]),{block:n,isLoading:o,error:d,isDeleted:y}}const Xx=p.createContext(null);function sk({children:s}){const{blocks:n,getBlockById:r,isLoading:o,error:c,isConnected:d,reload:f}=tk(),[y,g]=p.useState(""),m=p.useMemo(()=>({blocks:n,getBlockById:r,isLoading:o,error:c,isConnected:d,reload:f,sectionTitle:y,setSectionTitle:g}),[n,r,o,c,d,f,y,g]);return a.jsx(Xx.Provider,{value:m,children:s})}function Bo(){const s=p.useContext(Xx);if(!s)throw new Error("useContextCtx must be used within <ContextProvider>");return s}const ak=6;function Zx(s){return typeof s=="string"?s:s&&typeof s=="object"&&"id"in s&&typeof s.id=="string"?s.id:null}function jy(s,n){return s.order!==n.order?n.order-s.order:s.title.localeCompare(n.title)}function lk(s){const n=new Map;s.forEach(d=>{n.set(d.id,{block:d,children:[],latestUpdatedAt:new Date(d.updatedAt).getTime()})});const r=[];s.forEach(d=>{const f=n.get(d.id);if(!f)return;const y=Zx(d.parentId);if(!y){r.push(f);return}const g=n.get(y);if(!g){r.push(f);return}g.children.push(f)});const o=d=>{d.sort((f,y)=>jy(f.block,y.block)),d.forEach(f=>o(f.children))};o(r);const c=d=>{if(d.children.length===0)return d.latestUpdatedAt;let f=d.latestUpdatedAt;return d.children.forEach(y=>{const g=c(y);g>f&&(f=g)}),d.latestUpdatedAt=f,f};return r.forEach(d=>{c(d)}),r.sort((d,f)=>{const y=f.latestUpdatedAt-d.latestUpdatedAt;return y!==0?y:jy(d.block,f.block)}),r}function Jx({nodes:s,depth:n,onOpenBlock:r,onAddChild:o,collapsedIds:c,onToggleNode:d,selectedBlockId:f,compact:y=!1}){return a.jsx("ul",{className:"context-tree__branch",role:n===0?"tree":"group",children:s.map(g=>{const m=g.children.length>0,x=m?!c.has(g.block.id):!1,_=Math.min(n,ak),v=f===g.block.id;return a.jsxs("li",{className:"context-tree__item",role:"treeitem","aria-expanded":m?x:void 0,children:[a.jsxs("div",{className:`context-tree__row ${v?"context-tree__row--selected":""} ${y?"context-tree__row--compact":""}`,style:{"--tree-depth":_},children:[m?a.jsx("button",{type:"button",className:"context-tree__toggle","aria-expanded":x,"aria-label":x?`Collapse ${g.block.title}`:`Expand ${g.block.title}`,onClick:()=>d(g.block.id),children:a.jsx("span",{className:"context-tree__marker","aria-hidden":"true",children:x?"▼":"►"})}):a.jsx("span",{className:"context-tree__spacer","aria-hidden":"true"}),a.jsxs("button",{type:"button",className:"context-tree__open",onClick:()=>r(g.block.id),children:[a.jsxs("div",{className:"context-tree__main",children:[a.jsx(S,{weight:v?"bold":"medium",size:y?"2":"3",tone:"default",className:"context-tree__title",children:g.block.title}),y?null:a.jsxs("div",{className:"context-tree__meta",children:[a.jsxs("span",{className:"context-tree__id",children:["#",g.block.id.slice(0,6)]}),a.jsx("span",{children:g.block.createdBy||"unknown"})]})]}),!y&&g.block.tags.length>0?a.jsxs("div",{className:"context-tree__tags","aria-label":"Block tags",children:[g.block.tags.slice(0,2).map(T=>a.jsx("span",{className:"context-tree__tag",children:T.name},`${g.block.id}-${T.id}`)),g.block.tags.length>2?a.jsxs("span",{className:"context-tree__tag context-tree__tag--count",children:["+",g.block.tags.length-2]}):null]}):null]}),o?a.jsx("button",{type:"button",className:"context-tree__add-child","aria-label":`Add child block under ${g.block.title}`,onClick:T=>{T.stopPropagation(),o(g.block.id)},children:"+"}):null]}),m&&x?a.jsx(Jx,{nodes:g.children,depth:n+1,onOpenBlock:r,onAddChild:o,collapsedIds:c,onToggleNode:d,selectedBlockId:f,compact:y}):null]},g.block.id)})})}function wy(s){const n=new Set,r=o=>{for(const c of o)c.children.length>0&&(n.add(c.block.id),r(c.children))};return r(s),n}function Wx({blocks:s,onOpenBlock:n,onAddChild:r,selectedBlockId:o,compact:c=!1}){const d=p.useMemo(()=>lk(s),[s]),[f,y]=p.useState(()=>wy(d)),g=p.useRef(!1);p.useEffect(()=>{!g.current&&d.length>0&&(y(wy(d)),g.current=!0)},[d]),p.useEffect(()=>{if(!o)return;const x=new Map;s.forEach(T=>{x.set(T.id,Zx(T.parentId))});const _=new Set;let v=x.get(o)??null;for(;v;)_.add(v),v=x.get(v)??null;_.size!==0&&y(T=>{const E=new Set(T);return _.forEach(j=>E.delete(j)),E})},[s,o]);const m=x=>{y(_=>{const v=new Set(_);return v.has(x)?v.delete(x):v.add(x),v})};return a.jsx("section",{className:`context-tree ${c?"context-tree--compact":""}`,children:a.jsx(Jx,{nodes:d,depth:0,onOpenBlock:n,onAddChild:r,collapsedIds:f,onToggleNode:m,selectedBlockId:o,compact:c})})}function rk(){const s=bt(),{sectionTitle:n,blocks:r,isLoading:o,error:c}=Bo(),d=ze(),f=Lt(),{id:y}=Wt(),[g,m]=p.useState(!1),[x,_]=p.useState(!1);return p.useEffect(()=>{if(!s)return;const v=localStorage.getItem("context-sidebar-collapsed");m(v==="true")},[s]),p.useEffect(()=>{s&&localStorage.setItem("context-sidebar-collapsed",String(g))},[s,g]),p.useEffect(()=>{_(!1)},[f.pathname]),a.jsxs("div",{className:`context-layout ${s?"context-layout--desktop":"context-layout--mobile"}`,children:[!s&&a.jsxs(a.Fragment,{children:[x&&a.jsx("div",{className:"context-layout__drawer-overlay",onClick:()=>_(!1)}),a.jsxs("aside",{className:`context-layout__drawer ${x?"context-layout__drawer--open":""}`,children:[a.jsxs("div",{className:"context-layout__drawer-header",children:[a.jsx(S,{size:"4",weight:"bold",children:"taico"}),a.jsx("button",{className:"context-layout__drawer-close",onClick:()=>_(!1),"aria-label":"Close menu",children:"✕"})]}),a.jsx("nav",{className:"context-layout__drawer-nav",children:Or.map(v=>{const T=f.pathname===v.path||f.pathname.startsWith(v.path+"/");return a.jsxs(aa,{to:v.path,className:`context-layout__drawer-item ${T?"context-layout__drawer-item--active":""}`,children:[a.jsx("span",{className:"context-layout__drawer-icon",children:v.icon}),a.jsx("span",{children:v.label})]},v.path)})})]})]}),!s&&a.jsx("header",{className:"context-layout__mobile-header",children:a.jsxs(xt,{spacing:"5",align:"center",children:[a.jsx("button",{className:"context-layout__hamburger",onClick:()=>_(!0),"aria-label":"Open menu",children:"☰"}),a.jsx(S,{size:"3",weight:"normal",as:"div",children:"Context"}),a.jsx(S,{size:"3",weight:"semibold",as:"div",className:"context-layout__mobile-section-title",children:n})]})}),s&&a.jsxs("aside",{className:`context-desktop__sidebar ${g?"context-desktop__sidebar--collapsed":""}`,children:[a.jsx("div",{className:"context-desktop__sidebar-header",children:g?a.jsx(S,{as:"div",size:"1",tone:"muted",children:r.length}):a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"context-desktop__sidebar-title",onClick:()=>d("/context/home"),children:a.jsx(S,{as:"span",size:"2",weight:"semibold",children:"Context"})}),a.jsxs("div",{className:"context-desktop__sidebar-header-actions",children:[a.jsx(S,{as:"div",size:"1",tone:"muted",children:r.length}),a.jsx("button",{type:"button",className:"context-desktop__sidebar-new",onClick:()=>d("/context/new"),"aria-label":"New block",title:"New block",children:"+"})]})]})}),a.jsx("div",{className:"context-desktop__sidebar-body",children:g?null:o?a.jsx("div",{className:"context-home__loading",children:"Loading context blocks..."}):c?a.jsxs("div",{className:"context-home__error",children:["Error: ",c]}):r.length===0?a.jsx("div",{className:"context-home__empty",children:"No context blocks found"}):a.jsx(Wx,{blocks:r,onOpenBlock:v=>d(`/context/block/${v}`),onAddChild:v=>d(`/context/new?parentId=${v}`),selectedBlockId:y,compact:!0})}),a.jsx("button",{type:"button",className:"context-desktop__sidebar-toggle",onClick:()=>m(v=>!v),"aria-label":g?"Expand context sidebar":"Collapse context sidebar",children:g?"→":"←"})]}),a.jsx("main",{className:"context-layout__main",children:a.jsx(Ot,{})})]})}function ik(){const{setSectionTitle:s,blocks:n,isLoading:r,error:o}=Bo(),c=ze(),d=bt(),[f,y]=p.useState("");return qt(),p.useEffect(()=>{s("Context")},[s]),r?a.jsx("div",{className:"context-home__loading",children:"Loading context blocks..."}):o?a.jsxs("div",{className:"context-home__error",children:["Error: ",o]}):n.length===0?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"context-home__empty",children:a.jsx("div",{className:"context-home__empty-message",children:"No context blocks found"})}),a.jsx(gd,{onClick:()=>c("/context/new"),isDesktop:d})]}):d?a.jsxs(a.Fragment,{children:[a.jsx(ok,{blocks:n,searchQuery:f,onSearchQueryChange:y,onOpenBlock:g=>c(`/context/block/${g}`)}),a.jsx(gd,{onClick:()=>c("/context/new"),isDesktop:d})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"context-home",children:a.jsx(Wx,{blocks:n,onOpenBlock:g=>c(`/context/block/${g}`),onAddChild:g=>c(`/context/new?parentId=${g}`)})}),a.jsx(gd,{onClick:()=>c("/context/new"),isDesktop:d})]})}function gd({onClick:s,isDesktop:n}){return n?a.jsxs("button",{className:"context-fab context-fab--desktop",type:"button",onClick:s,children:[a.jsx("span",{className:"context-fab__plus",children:"+"}),a.jsx("span",{className:"context-fab__label",children:"New block"})]}):a.jsx("button",{className:"context-fab",type:"button",onClick:s,"aria-label":"Create new block",children:"+"})}function ok({blocks:s,searchQuery:n,onSearchQueryChange:r,onOpenBlock:o}){const c=n.trim().toLowerCase(),d=p.useMemo(()=>c?s.filter(f=>[f.title,f.createdBy||"",f.id,...f.tags.map(g=>g.name)].some(g=>g.toLowerCase().includes(c))):s.slice(0,18),[s,c]);return a.jsxs("div",{className:"context-home-desktop",children:[a.jsx("div",{className:"context-home-desktop__hero",children:a.jsx(S,{as:"div",size:"6",weight:"bold",className:"context-home-desktop__title",children:"Blocks"})}),a.jsx("div",{className:"context-home-desktop__search-box",children:a.jsx("input",{type:"search",className:"context-home-desktop__search-input",placeholder:"Search by title, tag, author, or block id",value:n,onChange:f=>r(f.target.value)})}),a.jsx("div",{className:"context-home-desktop__results",children:d.length===0?a.jsxs("div",{className:"context-home-desktop__empty",children:[a.jsx(S,{as:"div",size:"3",weight:"medium",children:"No matching blocks"}),a.jsx(S,{as:"div",size:"2",tone:"muted",children:"Try a different title, tag, author, or id fragment."})]}):d.map(f=>a.jsx(ge,{className:"context-home-desktop__result",onClick:()=>o(f.id),topRight:a.jsx(S,{as:"span",size:"2",tone:"muted",children:Ct(f.updatedAt)}),tags:f.tags.slice(0,3).map(y=>({label:y.name})),children:a.jsxs("div",{className:"context-home-desktop__result-main",children:[a.jsx("div",{className:"row-title",children:f.title}),a.jsxs("div",{className:"row-detail",children:["#",f.id.slice(0,6)," ",f.createdBy||"unknown"]})]})},f.id))})]})}function uh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Da=uh();function ev(s){Da=s}var Ea={exec:()=>null};function Ge(s,n=""){let r=typeof s=="string"?s:s.source,o={replace:(c,d)=>{let f=typeof d=="string"?d:d.source;return f=f.replace($t.caret,"$1"),r=r.replace(c,f),o},getRegex:()=>new RegExp(r,n)};return o}var ck=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$t={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}>`)},uk=/^(?:[ \t]*(?:\n|$))+/,dk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Yr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,dh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,tv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nv=Ge(tv).replace(/bull/g,dh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),pk=Ge(tv).replace(/bull/g,dh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),hh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,gk=/^[^\n]+/,fh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mk=Ge(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",fh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),yk=Ge(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,dh).getRegex(),Uo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ph=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,xk=Ge("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ph).replace("tag",Uo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sv=Ge(hh).replace("hr",Yr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uo).getRegex(),vk=Ge(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sv).getRegex(),gh={blockquote:vk,code:dk,def:mk,fences:hk,heading:fk,hr:Yr,html:xk,lheading:nv,list:yk,newline:uk,paragraph:sv,table:Ea,text:gk},Ey=Ge("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Yr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uo).getRegex(),bk={...gh,lheading:pk,table:Ey,paragraph:Ge(hh).replace("hr",Yr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ey).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uo).getRegex()},Sk={...gh,html:Ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ph).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ea,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ge(hh).replace("hr",Yr).replace("heading",` *#{1,6} *[^
|
|
13
|
-
]`).replace("lheading",nv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_k=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Tk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,av=/^( {2,}|\\)\n(?!\s*$)/,jk=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Al=/[\p{P}\p{S}]/u,Io=/[\s\p{P}\p{S}]/u,mh=/[^\s\p{P}\p{S}]/u,wk=Ge(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Io).getRegex(),lv=/(?!~)[\p{P}\p{S}]/u,Ek=/(?!~)[\s\p{P}\p{S}]/u,kk=/(?:[^\s\p{P}\p{S}]|~)/u,Ck=Ge(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ck?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),rv=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Nk=Ge(rv,"u").replace(/punct/g,Al).getRegex(),Ak=Ge(rv,"u").replace(/punct/g,lv).getRegex(),iv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Rk=Ge(iv,"gu").replace(/notPunctSpace/g,mh).replace(/punctSpace/g,Io).replace(/punct/g,Al).getRegex(),zk=Ge(iv,"gu").replace(/notPunctSpace/g,kk).replace(/punctSpace/g,Ek).replace(/punct/g,lv).getRegex(),Dk=Ge("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,mh).replace(/punctSpace/g,Io).replace(/punct/g,Al).getRegex(),Ok=Ge(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Al).getRegex(),Lk="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",qk=Ge(Lk,"gu").replace(/notPunctSpace/g,mh).replace(/punctSpace/g,Io).replace(/punct/g,Al).getRegex(),Mk=Ge(/\\(punct)/,"gu").replace(/punct/g,Al).getRegex(),Bk=Ge(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Uk=Ge(ph).replace("(?:-->|$)","-->").getRegex(),Ik=Ge("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Uk).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),No=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Hk=Ge(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",No).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ov=Ge(/^!?\[(label)\]\[(ref)\]/).replace("label",No).replace("ref",fh).getRegex(),cv=Ge(/^!?\[(ref)\](?:\[\])?/).replace("ref",fh).getRegex(),$k=Ge("reflink|nolink(?!\\()","g").replace("reflink",ov).replace("nolink",cv).getRegex(),ky=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,yh={_backpedal:Ea,anyPunctuation:Mk,autolink:Bk,blockSkip:Ck,br:av,code:Tk,del:Ea,delLDelim:Ea,delRDelim:Ea,emStrongLDelim:Nk,emStrongRDelimAst:Rk,emStrongRDelimUnd:Dk,escape:_k,link:Hk,nolink:cv,punctuation:wk,reflink:ov,reflinkSearch:$k,tag:Ik,text:jk,url:Ea},Gk={...yh,link:Ge(/^!?\[(label)\]\((.*?)\)/).replace("label",No).getRegex(),reflink:Ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",No).getRegex()},Md={...yh,emStrongRDelimAst:zk,emStrongLDelim:Ak,delLDelim:Ok,delRDelim:qk,url:Ge(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ky).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ge(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ky).getRegex()},Pk={...Md,br:Ge(av).replace("{2,}","*").getRegex(),text:Ge(Md.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},po={normal:gh,gfm:bk,pedantic:Sk},Cr={normal:yh,gfm:Md,breaks:Pk,pedantic:Gk},Vk={"&":"&","<":"<",">":">",'"':""","'":"'"},Cy=s=>Vk[s];function Xn(s,n){if(n){if($t.escapeTest.test(s))return s.replace($t.escapeReplace,Cy)}else if($t.escapeTestNoEncode.test(s))return s.replace($t.escapeReplaceNoEncode,Cy);return s}function Ny(s){try{s=encodeURI(s).replace($t.percentDecode,"%")}catch{return null}return s}function Ay(s,n){let r=s.replace($t.findPipe,(d,f,y)=>{let g=!1,m=f;for(;--m>=0&&y[m]==="\\";)g=!g;return g?"|":" |"}),o=r.split($t.splitPipe),c=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),n)if(o.length>n)o.splice(n);else for(;o.length<n;)o.push("");for(;c<o.length;c++)o[c]=o[c].trim().replace($t.slashPipe,"|");return o}function Nr(s,n,r){let o=s.length;if(o===0)return"";let c=0;for(;c<o&&s.charAt(o-c-1)===n;)c++;return s.slice(0,o-c)}function Yk(s,n){if(s.indexOf(n[1])===-1)return-1;let r=0;for(let o=0;o<s.length;o++)if(s[o]==="\\")o++;else if(s[o]===n[0])r++;else if(s[o]===n[1]&&(r--,r<0))return o;return r>0?-2:-1}function Fk(s,n=0){let r=n,o="";for(let c of s)if(c===" "){let d=4-r%4;o+=" ".repeat(d),r+=d}else o+=c,r++;return o}function Ry(s,n,r,o,c){let d=n.href,f=n.title||null,y=s[1].replace(c.other.outputLinkReplace,"$1");o.state.inLink=!0;let g={type:s[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:f,text:y,tokens:o.inlineTokens(y)};return o.state.inLink=!1,g}function Qk(s,n,r){let o=s.match(r.other.indentCodeCompensation);if(o===null)return n;let c=o[1];return n.split(`
|
|
14
|
-
`).map(d=>{let f=d.match(r.other.beginningSpace);if(f===null)return d;let[y]=f;return y.length>=c.length?d.slice(c.length):d}).join(`
|
|
15
|
-
`)}var Ao=class{options;rules;lexer;constructor(s){this.options=s||Da}space(s){let n=this.rules.block.newline.exec(s);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(s){let n=this.rules.block.code.exec(s);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Nr(r,`
|
|
16
|
-
`)}}}fences(s){let n=this.rules.block.fences.exec(s);if(n){let r=n[0],o=Qk(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:o}}}heading(s){let n=this.rules.block.heading.exec(s);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let o=Nr(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(s){let n=this.rules.block.hr.exec(s);if(n)return{type:"hr",raw:Nr(n[0],`
|
|
17
|
-
`)}}blockquote(s){let n=this.rules.block.blockquote.exec(s);if(n){let r=Nr(n[0],`
|
|
18
|
-
`).split(`
|
|
19
|
-
`),o="",c="",d=[];for(;r.length>0;){let f=!1,y=[],g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))y.push(r[g]),f=!0;else if(!f)y.push(r[g]);else break;r=r.slice(g);let m=y.join(`
|
|
20
|
-
`),x=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
21
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
22
|
-
${m}`:m,c=c?`${c}
|
|
23
|
-
${x}`:x;let _=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(x,d,!0),this.lexer.state.top=_,r.length===0)break;let v=d.at(-1);if(v?.type==="code")break;if(v?.type==="blockquote"){let T=v,E=T.raw+`
|
|
24
|
-
`+r.join(`
|
|
25
|
-
`),j=this.blockquote(E);d[d.length-1]=j,o=o.substring(0,o.length-T.raw.length)+j.raw,c=c.substring(0,c.length-T.text.length)+j.text;break}else if(v?.type==="list"){let T=v,E=T.raw+`
|
|
26
|
-
`+r.join(`
|
|
27
|
-
`),j=this.list(E);d[d.length-1]=j,o=o.substring(0,o.length-v.raw.length)+j.raw,c=c.substring(0,c.length-T.raw.length)+j.raw,r=E.substring(d.at(-1).raw.length).split(`
|
|
28
|
-
`);continue}}return{type:"blockquote",raw:o,tokens:d,text:c}}}list(s){let n=this.rules.block.list.exec(s);if(n){let r=n[1].trim(),o=r.length>1,c={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");let d=this.rules.other.listItemRegex(r),f=!1;for(;s;){let g=!1,m="",x="";if(!(n=d.exec(s))||this.rules.block.hr.test(s))break;m=n[0],s=s.substring(m.length);let _=Fk(n[2].split(`
|
|
29
|
-
`,1)[0],n[1].length),v=s.split(`
|
|
30
|
-
`,1)[0],T=!_.trim(),E=0;if(this.options.pedantic?(E=2,x=_.trimStart()):T?E=n[1].length+1:(E=_.search(this.rules.other.nonSpaceChar),E=E>4?1:E,x=_.slice(E),E+=n[1].length),T&&this.rules.other.blankLine.test(v)&&(m+=v+`
|
|
31
|
-
`,s=s.substring(v.length+1),g=!0),!g){let j=this.rules.other.nextBulletRegex(E),k=this.rules.other.hrRegex(E),w=this.rules.other.fencesBeginRegex(E),N=this.rules.other.headingBeginRegex(E),O=this.rules.other.htmlBeginRegex(E),G=this.rules.other.blockquoteBeginRegex(E);for(;s;){let q=s.split(`
|
|
32
|
-
`,1)[0],A;if(v=q,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),A=v):A=v.replace(this.rules.other.tabCharGlobal," "),w.test(v)||N.test(v)||O.test(v)||G.test(v)||j.test(v)||k.test(v))break;if(A.search(this.rules.other.nonSpaceChar)>=E||!v.trim())x+=`
|
|
33
|
-
`+A.slice(E);else{if(T||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(_)||N.test(_)||k.test(_))break;x+=`
|
|
34
|
-
`+v}T=!v.trim(),m+=q+`
|
|
35
|
-
`,s=s.substring(q.length+1),_=A.slice(E)}}c.loose||(f?c.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(f=!0)),c.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(x),loose:!1,text:x,tokens:[]}),c.raw+=m}let y=c.items.at(-1);if(y)y.raw=y.raw.trimEnd(),y.text=y.text.trimEnd();else return;c.raw=c.raw.trimEnd();for(let g of c.items){if(this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]),g.task){if(g.text=g.text.replace(this.rules.other.listReplaceTask,""),g.tokens[0]?.type==="text"||g.tokens[0]?.type==="paragraph"){g.tokens[0].raw=g.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),g.tokens[0].text=g.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}}let m=this.rules.other.listTaskCheckbox.exec(g.raw);if(m){let x={type:"checkbox",raw:m[0]+" ",checked:m[0]!=="[ ]"};g.checked=x.checked,c.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=x.raw+g.tokens[0].raw,g.tokens[0].text=x.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(x)):g.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):g.tokens.unshift(x)}}if(!c.loose){let m=g.tokens.filter(_=>_.type==="space"),x=m.length>0&&m.some(_=>this.rules.other.anyLine.test(_.raw));c.loose=x}}if(c.loose)for(let g of c.items){g.loose=!0;for(let m of g.tokens)m.type==="text"&&(m.type="paragraph")}return c}}html(s){let n=this.rules.block.html.exec(s);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(s){let n=this.rules.block.def.exec(s);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",c=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:c}}}table(s){let n=this.rules.block.table.exec(s);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=Ay(n[1]),o=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),c=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
36
|
-
`):[],d={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===o.length){for(let f of o)this.rules.other.tableAlignRight.test(f)?d.align.push("right"):this.rules.other.tableAlignCenter.test(f)?d.align.push("center"):this.rules.other.tableAlignLeft.test(f)?d.align.push("left"):d.align.push(null);for(let f=0;f<r.length;f++)d.header.push({text:r[f],tokens:this.lexer.inline(r[f]),header:!0,align:d.align[f]});for(let f of c)d.rows.push(Ay(f,d.header.length).map((y,g)=>({text:y,tokens:this.lexer.inline(y),header:!1,align:d.align[g]})));return d}}lheading(s){let n=this.rules.block.lheading.exec(s);if(n){let r=n[1].trim();return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(s){let n=this.rules.block.paragraph.exec(s);if(n){let r=n[1].charAt(n[1].length-1)===`
|
|
37
|
-
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(s){let n=this.rules.block.text.exec(s);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(s){let n=this.rules.inline.escape.exec(s);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(s){let n=this.rules.inline.tag.exec(s);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(s){let n=this.rules.inline.link.exec(s);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=Nr(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Yk(n[2],"()");if(d===-2)return;if(d>-1){let f=(n[0].indexOf("!")===0?5:4)+n[1].length+d;n[2]=n[2].substring(0,d),n[0]=n[0].substring(0,f).trim(),n[3]=""}}let o=n[2],c="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(o);d&&(o=d[1],c=d[3])}else c=n[3]?n[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),Ry(n,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:c&&c.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(s,n){let r;if((r=this.rules.inline.reflink.exec(s))||(r=this.rules.inline.nolink.exec(s))){let o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),c=n[o.toLowerCase()];if(!c){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return Ry(r,c,r[0],this.lexer,this.rules)}}emStrong(s,n,r=""){let o=this.rules.inline.emStrongLDelim.exec(s);if(!(!o||!o[1]&&!o[2]&&!o[3]&&!o[4]||o[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[3])||!r||this.rules.inline.punctuation.exec(r))){let c=[...o[0]].length-1,d,f,y=c,g=0,m=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,n=n.slice(-1*s.length+c);(o=m.exec(n))!==null;){if(d=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!d)continue;if(f=[...d].length,o[3]||o[4]){y+=f;continue}else if((o[5]||o[6])&&c%3&&!((c+f)%3)){g+=f;continue}if(y-=f,y>0)continue;f=Math.min(f,f+y+g);let x=[...o[0]][0].length,_=s.slice(0,c+o.index+x+f);if(Math.min(c,f)%2){let T=_.slice(1,-1);return{type:"em",raw:_,text:T,tokens:this.lexer.inlineTokens(T)}}let v=_.slice(2,-2);return{type:"strong",raw:_,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(s){let n=this.rules.inline.code.exec(s);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(r),c=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&c&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(s){let n=this.rules.inline.br.exec(s);if(n)return{type:"br",raw:n[0]}}del(s,n,r=""){let o=this.rules.inline.delLDelim.exec(s);if(o&&(!o[1]||!r||this.rules.inline.punctuation.exec(r))){let c=[...o[0]].length-1,d,f,y=c,g=this.rules.inline.delRDelim;for(g.lastIndex=0,n=n.slice(-1*s.length+c);(o=g.exec(n))!==null;){if(d=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!d||(f=[...d].length,f!==c))continue;if(o[3]||o[4]){y+=f;continue}if(y-=f,y>0)continue;f=Math.min(f,f+y);let m=[...o[0]][0].length,x=s.slice(0,c+o.index+m+f),_=x.slice(c,-c);return{type:"del",raw:x,text:_,tokens:this.lexer.inlineTokens(_)}}}}autolink(s){let n=this.rules.inline.autolink.exec(s);if(n){let r,o;return n[2]==="@"?(r=n[1],o="mailto:"+r):(r=n[1],o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(s){let n;if(n=this.rules.inline.url.exec(s)){let r,o;if(n[2]==="@")r=n[0],o="mailto:"+r;else{let c;do c=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(c!==n[0]);r=n[0],n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(s){let n=this.rules.inline.text.exec(s);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},Un=class Bd{tokens;options;state;inlineQueue;tokenizer;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||Da,this.options.tokenizer=this.options.tokenizer||new Ao,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:$t,block:po.normal,inline:Cr.normal};this.options.pedantic?(r.block=po.pedantic,r.inline=Cr.pedantic):this.options.gfm&&(r.block=po.gfm,this.options.breaks?r.inline=Cr.breaks:r.inline=Cr.gfm),this.tokenizer.rules=r}static get rules(){return{block:po,inline:Cr}}static lex(n,r){return new Bd(r).lex(n)}static lexInline(n,r){return new Bd(r).inlineTokens(n)}lex(n){n=n.replace($t.carriageReturn,`
|
|
38
|
-
`),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[],o=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(n=n.replace($t.tabCharGlobal," ").replace($t.spaceLine,""));n;){let c;if(this.options.extensions?.block?.some(f=>(c=f.call({lexer:this},n,r))?(n=n.substring(c.raw.length),r.push(c),!0):!1))continue;if(c=this.tokenizer.space(n)){n=n.substring(c.raw.length);let f=r.at(-1);c.raw.length===1&&f!==void 0?f.raw+=`
|
|
39
|
-
`:r.push(c);continue}if(c=this.tokenizer.code(n)){n=n.substring(c.raw.length);let f=r.at(-1);f?.type==="paragraph"||f?.type==="text"?(f.raw+=(f.raw.endsWith(`
|
|
40
|
-
`)?"":`
|
|
41
|
-
`)+c.raw,f.text+=`
|
|
42
|
-
`+c.text,this.inlineQueue.at(-1).src=f.text):r.push(c);continue}if(c=this.tokenizer.fences(n)){n=n.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.heading(n)){n=n.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.hr(n)){n=n.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.blockquote(n)){n=n.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.list(n)){n=n.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.html(n)){n=n.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.def(n)){n=n.substring(c.raw.length);let f=r.at(-1);f?.type==="paragraph"||f?.type==="text"?(f.raw+=(f.raw.endsWith(`
|
|
43
|
-
`)?"":`
|
|
44
|
-
`)+c.raw,f.text+=`
|
|
45
|
-
`+c.raw,this.inlineQueue.at(-1).src=f.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},r.push(c));continue}if(c=this.tokenizer.table(n)){n=n.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.lheading(n)){n=n.substring(c.raw.length),r.push(c);continue}let d=n;if(this.options.extensions?.startBlock){let f=1/0,y=n.slice(1),g;this.options.extensions.startBlock.forEach(m=>{g=m.call({lexer:this},y),typeof g=="number"&&g>=0&&(f=Math.min(f,g))}),f<1/0&&f>=0&&(d=n.substring(0,f+1))}if(this.state.top&&(c=this.tokenizer.paragraph(d))){let f=r.at(-1);o&&f?.type==="paragraph"?(f.raw+=(f.raw.endsWith(`
|
|
46
|
-
`)?"":`
|
|
47
|
-
`)+c.raw,f.text+=`
|
|
48
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=f.text):r.push(c),o=d.length!==n.length,n=n.substring(c.raw.length);continue}if(c=this.tokenizer.text(n)){n=n.substring(c.raw.length);let f=r.at(-1);f?.type==="text"?(f.raw+=(f.raw.endsWith(`
|
|
49
|
-
`)?"":`
|
|
50
|
-
`)+c.raw,f.text+=`
|
|
51
|
-
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=f.text):r.push(c);continue}if(n){let f="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){this.tokenizer.lexer=this;let o=n,c=null;if(this.tokens.links){let g=Object.keys(this.tokens.links);if(g.length>0)for(;(c=this.tokenizer.rules.inline.reflinkSearch.exec(o))!==null;)g.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(c=this.tokenizer.rules.inline.anyPunctuation.exec(o))!==null;)o=o.slice(0,c.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let d;for(;(c=this.tokenizer.rules.inline.blockSkip.exec(o))!==null;)d=c[2]?c[2].length:0,o=o.slice(0,c.index+d)+"["+"a".repeat(c[0].length-d-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let f=!1,y="";for(;n;){f||(y=""),f=!1;let g;if(this.options.extensions?.inline?.some(x=>(g=x.call({lexer:this},n,r))?(n=n.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.escape(n)){n=n.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.tag(n)){n=n.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.link(n)){n=n.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(g.raw.length);let x=r.at(-1);g.type==="text"&&x?.type==="text"?(x.raw+=g.raw,x.text+=g.text):r.push(g);continue}if(g=this.tokenizer.emStrong(n,o,y)){n=n.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.codespan(n)){n=n.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.br(n)){n=n.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.del(n,o,y)){n=n.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.autolink(n)){n=n.substring(g.raw.length),r.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(n))){n=n.substring(g.raw.length),r.push(g);continue}let m=n;if(this.options.extensions?.startInline){let x=1/0,_=n.slice(1),v;this.options.extensions.startInline.forEach(T=>{v=T.call({lexer:this},_),typeof v=="number"&&v>=0&&(x=Math.min(x,v))}),x<1/0&&x>=0&&(m=n.substring(0,x+1))}if(g=this.tokenizer.inlineText(m)){n=n.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(y=g.raw.slice(-1)),f=!0;let x=r.at(-1);x?.type==="text"?(x.raw+=g.raw,x.text+=g.text):r.push(g);continue}if(n){let x="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return r}},Ro=class{options;parser;constructor(s){this.options=s||Da}space(s){return""}code({text:s,lang:n,escaped:r}){let o=(n||"").match($t.notSpaceStart)?.[0],c=s.replace($t.endingNewline,"")+`
|
|
52
|
-
`;return o?'<pre><code class="language-'+Xn(o)+'">'+(r?c:Xn(c,!0))+`</code></pre>
|
|
53
|
-
`:"<pre><code>"+(r?c:Xn(c,!0))+`</code></pre>
|
|
54
|
-
`}blockquote({tokens:s}){return`<blockquote>
|
|
55
|
-
${this.parser.parse(s)}</blockquote>
|
|
56
|
-
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:n}){return`<h${n}>${this.parser.parseInline(s)}</h${n}>
|
|
57
|
-
`}hr(s){return`<hr>
|
|
58
|
-
`}list(s){let n=s.ordered,r=s.start,o="";for(let f=0;f<s.items.length;f++){let y=s.items[f];o+=this.listitem(y)}let c=n?"ol":"ul",d=n&&r!==1?' start="'+r+'"':"";return"<"+c+d+`>
|
|
59
|
-
`+o+"</"+c+`>
|
|
60
|
-
`}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
|
|
61
|
-
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
|
|
62
|
-
`}table(s){let n="",r="";for(let c=0;c<s.header.length;c++)r+=this.tablecell(s.header[c]);n+=this.tablerow({text:r});let o="";for(let c=0;c<s.rows.length;c++){let d=s.rows[c];r="";for(let f=0;f<d.length;f++)r+=this.tablecell(d[f]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
63
|
-
<thead>
|
|
64
|
-
`+n+`</thead>
|
|
65
|
-
`+o+`</table>
|
|
66
|
-
`}tablerow({text:s}){return`<tr>
|
|
67
|
-
${s}</tr>
|
|
68
|
-
`}tablecell(s){let n=this.parser.parseInline(s.tokens),r=s.header?"th":"td";return(s.align?`<${r} align="${s.align}">`:`<${r}>`)+n+`</${r}>
|
|
69
|
-
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${Xn(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:n,tokens:r}){let o=this.parser.parseInline(r),c=Ny(s);if(c===null)return o;s=c;let d='<a href="'+s+'"';return n&&(d+=' title="'+Xn(n)+'"'),d+=">"+o+"</a>",d}image({href:s,title:n,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));let c=Ny(s);if(c===null)return Xn(r);s=c;let d=`<img src="${s}" alt="${Xn(r)}"`;return n&&(d+=` title="${Xn(n)}"`),d+=">",d}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Xn(s.text)}},xh=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},In=class Ud{options;renderer;textRenderer;constructor(n){this.options=n||Da,this.options.renderer=this.options.renderer||new Ro,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xh}static parse(n,r){return new Ud(r).parse(n)}static parseInline(n,r){return new Ud(r).parseInline(n)}parse(n){this.renderer.parser=this;let r="";for(let o=0;o<n.length;o++){let c=n[o];if(this.options.extensions?.renderers?.[c.type]){let f=c,y=this.options.extensions.renderers[f.type].call({parser:this},f);if(y!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(f.type)){r+=y||"";continue}}let d=c;switch(d.type){case"space":{r+=this.renderer.space(d);break}case"hr":{r+=this.renderer.hr(d);break}case"heading":{r+=this.renderer.heading(d);break}case"code":{r+=this.renderer.code(d);break}case"table":{r+=this.renderer.table(d);break}case"blockquote":{r+=this.renderer.blockquote(d);break}case"list":{r+=this.renderer.list(d);break}case"checkbox":{r+=this.renderer.checkbox(d);break}case"html":{r+=this.renderer.html(d);break}case"def":{r+=this.renderer.def(d);break}case"paragraph":{r+=this.renderer.paragraph(d);break}case"text":{r+=this.renderer.text(d);break}default:{let f='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return r}parseInline(n,r=this.renderer){this.renderer.parser=this;let o="";for(let c=0;c<n.length;c++){let d=n[c];if(this.options.extensions?.renderers?.[d.type]){let y=this.options.extensions.renderers[d.type].call({parser:this},d);if(y!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(d.type)){o+=y||"";continue}}let f=d;switch(f.type){case"escape":{o+=r.text(f);break}case"html":{o+=r.html(f);break}case"link":{o+=r.link(f);break}case"image":{o+=r.image(f);break}case"checkbox":{o+=r.checkbox(f);break}case"strong":{o+=r.strong(f);break}case"em":{o+=r.em(f);break}case"codespan":{o+=r.codespan(f);break}case"br":{o+=r.br(f);break}case"del":{o+=r.del(f);break}case"text":{o+=r.text(f);break}default:{let y='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(y),"";throw new Error(y)}}}return o}},Dr=class{options;block;constructor(s){this.options=s||Da}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(s=this.block){return s?Un.lex:Un.lexInline}provideParser(s=this.block){return s?In.parse:In.parseInline}},uv=class{defaults=uh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=In;Renderer=Ro;TextRenderer=xh;Lexer=Un;Tokenizer=Ao;Hooks=Dr;constructor(...s){this.use(...s)}walkTokens(s,n){let r=[];for(let o of s)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let c=o;for(let d of c.header)r=r.concat(this.walkTokens(d.tokens,n));for(let d of c.rows)for(let f of d)r=r.concat(this.walkTokens(f.tokens,n));break}case"list":{let c=o;r=r.concat(this.walkTokens(c.items,n));break}default:{let c=o;this.defaults.extensions?.childTokens?.[c.type]?this.defaults.extensions.childTokens[c.type].forEach(d=>{let f=c[d].flat(1/0);r=r.concat(this.walkTokens(f,n))}):c.tokens&&(r=r.concat(this.walkTokens(c.tokens,n)))}}return r}use(...s){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(r=>{let o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(c=>{if(!c.name)throw new Error("extension name required");if("renderer"in c){let d=n.renderers[c.name];d?n.renderers[c.name]=function(...f){let y=c.renderer.apply(this,f);return y===!1&&(y=d.apply(this,f)),y}:n.renderers[c.name]=c.renderer}if("tokenizer"in c){if(!c.level||c.level!=="block"&&c.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=n[c.level];d?d.unshift(c.tokenizer):n[c.level]=[c.tokenizer],c.start&&(c.level==="block"?n.startBlock?n.startBlock.push(c.start):n.startBlock=[c.start]:c.level==="inline"&&(n.startInline?n.startInline.push(c.start):n.startInline=[c.start]))}"childTokens"in c&&c.childTokens&&(n.childTokens[c.name]=c.childTokens)}),o.extensions=n),r.renderer){let c=this.defaults.renderer||new Ro(this.defaults);for(let d in r.renderer){if(!(d in c))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let f=d,y=r.renderer[f],g=c[f];c[f]=(...m)=>{let x=y.apply(c,m);return x===!1&&(x=g.apply(c,m)),x||""}}o.renderer=c}if(r.tokenizer){let c=this.defaults.tokenizer||new Ao(this.defaults);for(let d in r.tokenizer){if(!(d in c))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let f=d,y=r.tokenizer[f],g=c[f];c[f]=(...m)=>{let x=y.apply(c,m);return x===!1&&(x=g.apply(c,m)),x}}o.tokenizer=c}if(r.hooks){let c=this.defaults.hooks||new Dr;for(let d in r.hooks){if(!(d in c))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let f=d,y=r.hooks[f],g=c[f];Dr.passThroughHooks.has(d)?c[f]=m=>{if(this.defaults.async&&Dr.passThroughHooksRespectAsync.has(d))return(async()=>{let _=await y.call(c,m);return g.call(c,_)})();let x=y.call(c,m);return g.call(c,x)}:c[f]=(...m)=>{if(this.defaults.async)return(async()=>{let _=await y.apply(c,m);return _===!1&&(_=await g.apply(c,m)),_})();let x=y.apply(c,m);return x===!1&&(x=g.apply(c,m)),x}}o.hooks=c}if(r.walkTokens){let c=this.defaults.walkTokens,d=r.walkTokens;o.walkTokens=function(f){let y=[];return y.push(d.call(this,f)),c&&(y=y.concat(c.call(this,f))),y}}this.defaults={...this.defaults,...o}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,n){return Un.lex(s,n??this.defaults)}parser(s,n){return In.parse(s,n??this.defaults)}parseMarkdown(s){return(n,r)=>{let o={...r},c={...this.defaults,...o},d=this.onError(!!c.silent,!!c.async);if(this.defaults.async===!0&&o.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(c.hooks&&(c.hooks.options=c,c.hooks.block=s),c.async)return(async()=>{let f=c.hooks?await c.hooks.preprocess(n):n,y=await(c.hooks?await c.hooks.provideLexer(s):s?Un.lex:Un.lexInline)(f,c),g=c.hooks?await c.hooks.processAllTokens(y):y;c.walkTokens&&await Promise.all(this.walkTokens(g,c.walkTokens));let m=await(c.hooks?await c.hooks.provideParser(s):s?In.parse:In.parseInline)(g,c);return c.hooks?await c.hooks.postprocess(m):m})().catch(d);try{c.hooks&&(n=c.hooks.preprocess(n));let f=(c.hooks?c.hooks.provideLexer(s):s?Un.lex:Un.lexInline)(n,c);c.hooks&&(f=c.hooks.processAllTokens(f)),c.walkTokens&&this.walkTokens(f,c.walkTokens);let y=(c.hooks?c.hooks.provideParser(s):s?In.parse:In.parseInline)(f,c);return c.hooks&&(y=c.hooks.postprocess(y)),y}catch(f){return d(f)}}}onError(s,n){return r=>{if(r.message+=`
|
|
70
|
-
Please report this to https://github.com/markedjs/marked.`,s){let o="<p>An error occurred:</p><pre>"+Xn(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}}},Aa=new uv;function tt(s,n){return Aa.parse(s,n)}tt.options=tt.setOptions=function(s){return Aa.setOptions(s),tt.defaults=Aa.defaults,ev(tt.defaults),tt};tt.getDefaults=uh;tt.defaults=Da;tt.use=function(...s){return Aa.use(...s),tt.defaults=Aa.defaults,ev(tt.defaults),tt};tt.walkTokens=function(s,n){return Aa.walkTokens(s,n)};tt.parseInline=Aa.parseInline;tt.Parser=In;tt.parser=In.parse;tt.Renderer=Ro;tt.TextRenderer=xh;tt.Lexer=Un;tt.lexer=Un.lex;tt.Tokenizer=Ao;tt.Hooks=Dr;tt.parse=tt;tt.options;tt.setOptions;tt.use;tt.walkTokens;tt.parseInline;In.parse;Un.lex;var Sl=function(){return Sl=Object.assign||function(s){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(s[c]=n[c])}return s},Sl.apply(this,arguments)},Kk="~",Xk="~~";function vh(s,n){for(var r={},o={},c=s.split(Xk),d=!1,f=0;c.length>f;f++){for(var y=c[f].split(Kk),g=0;g<y.length;g+=2){var m=y[g],x=y[g+1],_="&"+m+";";r[_]=x,d&&(r["&"+m]=x),o[x]=_}d=!0}return n?{entities:Sl(Sl({},r),n.entities),characters:Sl(Sl({},o),n.characters)}:{entities:r,characters:o}}var md={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},Tl={};Tl.xml=vh(`lt~<~gt~>~quot~"~apos~'~amp~&`);Tl.html4=vh(`apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~~zwj~~lrm~~rlm~~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~À~Aacute~Á~Acirc~Â~Atilde~Ã~Auml~Ä~Aring~Å~AElig~Æ~Ccedil~Ç~Egrave~È~Eacute~É~Ecirc~Ê~Euml~Ë~Igrave~Ì~Iacute~Í~Icirc~Î~Iuml~Ï~ETH~Ð~Ntilde~Ñ~Ograve~Ò~Oacute~Ó~Ocirc~Ô~Otilde~Õ~Ouml~Ö~times~×~Oslash~Ø~Ugrave~Ù~Uacute~Ú~Ucirc~Û~Uuml~Ü~Yacute~Ý~THORN~Þ~szlig~ß~agrave~à~aacute~á~acirc~â~atilde~ã~auml~ä~aring~å~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~ê~euml~ë~igrave~ì~iacute~í~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~"~amp~&~lt~<~gt~>`);Tl.html5=vh('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~~InvisibleTimes~~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~~NegativeThickSpace~~NegativeThinSpace~~NegativeVeryThinSpace~~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~ ~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~ ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®',Tl.html4);var Zk={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},Jk=String.fromCodePoint||function(s){return String.fromCharCode(Math.floor((s-65536)/1024)+55296,(s-65536)%1024+56320)},jl=function(){return jl=Object.assign||function(s){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(s[c]=n[c])}return s},jl.apply(this,arguments)},Wk=jl(jl({},Tl),{all:Tl.html5}),eC={scope:"body",level:"all"},yd=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,xd=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,zy={xml:{strict:yd,attribute:xd,body:md.xml},html4:{strict:yd,attribute:xd,body:md.html4},html5:{strict:yd,attribute:xd,body:md.html5}},tC=jl(jl({},zy),{all:zy.html5}),dv=String.fromCharCode,nC=dv(65533);function sC(s,n,r,o){var c=s,d=s[s.length-1];if(r&&d==="=")c=s;else if(o&&d!==";")c=s;else{var f=n[s];if(f)c=f;else if(s[0]==="&"&&s[1]==="#"){var y=s[2],g=y=="x"||y=="X"?parseInt(s.substr(3),16):parseInt(s.substr(2));c=g>=1114111?nC:g>65535?Jk(g):dv(Zk[g]||g)}}return c}function aC(s,n){var r=eC,o=r.level,c=o===void 0?"all":o,d=r.scope,f=d===void 0?c==="xml"?"strict":"body":d;if(!s)return"";var y=tC[c][f],g=Wk[c].entities,m=f==="attribute",x=f==="strict";return s.replace(y,function(_){return sC(_,g,m,x)})}const Dy=(s="")=>!s||!s.includes("&")?s:aC(s),Oy=(s,n)=>{if(!n)return s;try{return new URL(s,n).href}catch{return s}};var lC=class{constructor(s){this.renderer=s.renderer}parse(s){this.renderer.elIdList.push(0);const n=s.map(r=>{switch(r.type){case"space":return null;case"heading":{const o=r.depth;return this.renderer.heading(this.parseInline(r.tokens),o)}case"paragraph":return this.renderer.paragraph(this.parseInline(r.tokens));case"text":{const o=r;return o.tokens?this.parseInline(o.tokens):r.text}case"blockquote":{const o=r,c=this.parse(o.tokens);return this.renderer.blockquote(c)}case"list":{const o=r;this.renderer.elIdList.push(0);const c=o.items.map(d=>{const f=[];return d.task&&f.push(this.renderer.checkbox(d.checked??!1)),f.push(this.parse(d.tokens)),this.renderer.listItem(f)});return this.renderer.elIdList.pop(),this.renderer.list(c,r.ordered,r.ordered?r.start:void 0)}case"code":return this.renderer.code(r.text,r.lang);case"html":return this.renderer.html(r.text);case"table":{const o=r;this.renderer.elIdList.push(0);const c=o.header.map((m,x)=>this.renderer.tableCell(this.parseInline(m.tokens),{header:!0,align:r.align[x]}));this.renderer.elIdList.pop();const d=this.renderer.tableRow(c),f=this.renderer.tableHeader(d);this.renderer.elIdList.push(0);const y=o.rows.map(m=>{this.renderer.elIdList.push(0);const x=m.map((_,v)=>this.renderer.tableCell(this.parseInline(_.tokens),{header:!1,align:r.align[v]}));return this.renderer.elIdList.pop(),this.renderer.tableRow(x)});this.renderer.elIdList.pop();const g=this.renderer.tableBody(y);return this.renderer.table([f,g])}case"hr":return this.renderer.hr();default:return console.warn(`Token with "${r.type}" type was not found`),null}});return this.renderer.elIdList.pop(),n}parseInline(s=[]){this.renderer.elIdList.push(0);const n=s.map(r=>{switch(r.type){case"text":return this.renderer.text(Dy(r.text));case"strong":return this.renderer.strong(this.parseInline(r.tokens));case"em":return this.renderer.em(this.parseInline(r.tokens));case"del":return this.renderer.del(this.parseInline(r.tokens));case"codespan":return this.renderer.codespan(Dy(r.text));case"link":return this.renderer.link(r.href,this.parseInline(r.tokens));case"image":return this.renderer.image(r.href,r.text,r.title);case"html":return this.renderer.html(r.text);case"br":return this.renderer.br();case"escape":return this.renderer.text(r.text);default:return console.warn(`Token with "${r.type}" type was not found`),null}});return this.renderer.elIdList.pop(),n}},rC=class{#t;constructor(s={}){this.elIdList=[];const{renderer:n}=s;this.#t=s,n&&typeof n=="object"&&Object.entries(n).forEach(([r,o])=>{const c=r,d=o;!this[c]||c==="elementId"||c==="elIdList"||typeof d!="function"||Object.defineProperty(this,c,{value(...f){return this.#n(),d.apply(this,f)},writable:!0,enumerable:!0,configurable:!0})})}#e(s,n=null,r={}){const o={key:`marked-react-${this.elementId}`,suppressHydrationWarning:!0};return this.#n(),p.createElement(s,{...r,...o},n)}#n(){this.elIdList[this.elIdList.length-1]+=1}get elementId(){return this.elIdList.join("-")}heading(s,n){return this.#e(`h${n}`,s)}paragraph(s){return this.#e("p",s)}link(s,n){const r=Oy(s,this.#t.baseURL),o=this.#t.openLinksInNewTab?"_blank":null;return this.#e("a",n,{href:r,target:o})}image(s,n,r=null){const o=Oy(s,this.#t.baseURL);return this.#e("img",null,{src:o,alt:n,title:r})}codespan(s,n=null){const r=n?`${this.#t.langPrefix}${n}`:null;return this.#e("code",s,{className:r})}code(s,n){return this.#e("pre",this.codespan(s,n))}blockquote(s){return this.#e("blockquote",s)}list(s,n,r){return this.#e(n?"ol":"ul",s,n&&r!==1?{start:r}:{})}listItem(s){return this.#e("li",s)}checkbox(s){return this.#e("input",null,{type:"checkbox",disabled:!0,checked:s})}table(s){return this.#e("table",s)}tableHeader(s){return this.#e("thead",s)}tableBody(s){return this.#e("tbody",s)}tableRow(s){return this.#e("tr",s)}tableCell(s,n){const r=n.header?"th":"td";return this.#e(r,s,{align:n.align})}strong(s){return this.#e("strong",s)}em(s){return this.#e("em",s)}del(s){return this.#e("del",s)}text(s){return s}html(s){return s}hr(){return this.#e("hr")}br(){return this.#e("br")}};const iC=s=>{if(s.value&&typeof s.value!="string")throw new TypeError(`[marked-react]: Expected value to be of type string but got ${typeof s.value}`);if(s.children&&typeof s.children!="string")throw new TypeError(`[marked-react]: Expected children to be of type string but got ${typeof s.children}`)},oC={isInline:!1,breaks:!1,gfm:!0,baseURL:void 0,openLinksInNewTab:!0,langPrefix:"language-",renderer:void 0},cC=new uv,uC=s=>{iC(s);const n={...oC,...s},r=n.instance??cC,o={breaks:n.breaks,gfm:n.gfm,tokenizer:r.defaults.tokenizer},c=n.value??n.children??"",d=n.isInline?r.Lexer.lexInline(c,o):r.lexer(c,o),f=new lC({renderer:new rC({renderer:n.renderer,baseURL:n.baseURL,openLinksInNewTab:n.openLinksInNewTab,langPrefix:n.langPrefix})});return p.createElement(p.Fragment,null,n.isInline?f.parseInline(d):f.parse(d))};var dC=uC;function hC(s){return typeof s=="string"?s:s&&typeof s=="object"&&typeof s.id=="string"?s.id:null}function fC(){const{id:s}=Wt(),n=ze(),{setSectionTitle:r,blocks:o}=Bo(),{showError:c}=Dn(),d=bt(),{block:f,isLoading:y,error:g,isDeleted:m}=nk(s||""),[x,_]=p.useState(null),[v,T]=p.useState(!1);p.useEffect(()=>{f&&r(d?"Context":f.title)},[f,d,r]),p.useEffect(()=>{if(!f?.id){_(null);return}let k=!1;return T(!0),$n.ThreadsController_getThreadsByStateBlockId({stateBlockId:f.id}).then(w=>{k||_(w.length>0?w[0].id:null)}).catch(w=>{k||(console.error("Error checking for thread:",w),_(null))}).finally(()=>{k||T(!1)}),()=>{k=!0}},[f?.id]),p.useEffect(()=>{m&&n("/context/home")},[m,n]);const E=()=>{if(!f)return;const w=`${f.title.replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"context-block"}.md`,N=new Blob([f.content],{type:"text/markdown"}),O=URL.createObjectURL(N),G=document.createElement("a");G.href=O,G.download=w,document.body.appendChild(G),G.click(),document.body.removeChild(G),URL.revokeObjectURL(O)},j=p.useMemo(()=>{if(!f)return[];const k=new Map(o.map(O=>[O.id,O])),w=[];let N=f.id;for(;N;){const O=N===f.id?f:k.get(N);if(!O)break;w.unshift({id:O.id,title:O.title}),N=hC(O.parentId)}return w},[f,o]);return y?a.jsx("div",{className:"context-block-detail__loading",children:a.jsx(S,{children:"Loading..."})}):g?a.jsx("div",{className:"context-block-detail__error",children:a.jsxs(S,{className:"text--error",children:["Error: ",g]})}):f?a.jsxs("div",{className:"context-block-detail",children:[a.jsxs(se,{spacing:"3",className:"context-block-detail__header",children:[d?a.jsxs("div",{className:"context-block-detail__breadcrumbs","aria-label":"Breadcrumb",children:[a.jsx("button",{type:"button",className:"context-block-detail__breadcrumb",onClick:()=>n("/context/home"),children:"Home"}),j.map((k,w)=>a.jsxs("div",{className:"context-block-detail__breadcrumb-segment",children:[a.jsx("span",{className:"context-block-detail__breadcrumb-separator",children:"›"}),a.jsx("button",{type:"button",className:`context-block-detail__breadcrumb ${w===j.length-1?"context-block-detail__breadcrumb--current":""}`,onClick:()=>n(`/context/block/${k.id}`),disabled:w===j.length-1,children:k.title})]},k.id))]}):null,d?a.jsx("div",{className:"context-block-detail__title-wrap",children:a.jsx("h1",{className:"context-block-detail__title",children:f.title})}):null,f.tags.length>0&&a.jsx("div",{className:"context-block-detail__tags",children:f.tags.map(k=>a.jsx(ws,{children:k.name},k.id))}),a.jsxs("div",{className:"context-block-detail__meta",children:[a.jsxs(S,{size:"2",tone:"muted",children:["by @",f.createdBy||"unknown"]}),a.jsx(S,{size:"2",tone:"muted",children:"•"}),a.jsx(S,{size:"2",tone:"muted",children:new Date(f.createdAt).toDateString()}),a.jsx(S,{size:"2",tone:"muted",children:"•"}),a.jsxs(S,{size:"2",tone:"muted",children:["Last edited ",Ct(f.updatedAt)]})]})]}),a.jsx("div",{className:"context-block-detail__content",children:a.jsx(dC,{children:f.content})}),a.jsx(Cl,{className:"context-block-detail__actions",onDelete:async()=>{try{await ka.ContextController_deleteBlock({id:f.id}),n("/context")}catch(k){c(k)}},deleteLabel:"Delete",confirmLabel:"Confirm Delete"}),a.jsxs(pe,{className:"context-block-detail__actions",children:[a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>n(`/context/block/${f.id}/edit`),children:"Edit"}),a.jsx(ce,{size:"lg",variant:"secondary",onClick:E,children:"Download as Markdown"}),x&&a.jsx(ce,{size:"lg",variant:"primary",onClick:()=>n(`/threads/${x}`),disabled:v,children:"Go to thread"}),d?null:a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>n("/context"),children:"Back to blocks"})]})]}):a.jsx("div",{className:"context-block-detail__error",children:a.jsx(S,{className:"text--error",children:"Context block not found"})})}function Ly(){const{id:s}=Wt(),n=!!s,{setSectionTitle:r}=Bo(),o=ze(),[c]=Zd(),d=c.get("parentId")??void 0,{showError:f,showToast:y}=Dn(),g=bt(),m=p.useRef(null),[x,_]=p.useState(""),[v,T]=p.useState(""),[E]=p.useState([]),[j,k]=p.useState(!1),[w,N]=p.useState(n),[O,G]=p.useState(null);p.useEffect(()=>{s&&(N(!0),ka.ContextController_getBlock({id:s}).then(U=>{_(U.title),T(U.content)}).catch(U=>{f(U),o("/context/home")}).finally(()=>N(!1)))},[s]),p.useEffect(()=>{r(g?"Context":n?"Edit Block":"New Block")},[r,g,n]);const q=async U=>{const H=U.target.files?.[0];if(H){if(!H.name.endsWith(".md")){f(new Error("Please select a markdown (.md) file"));return}G(H.name);try{const P=await H.text();T(P);const B=P.match(/^#\s+(.+)$/m);_(B?B[1].trim():H.name.replace(/\.md$/,""))}catch(P){f(P),G(null)}}},A=async()=>{if(!x.trim()){f(new Error("Title is required"));return}if(!v.trim()){f(new Error("Content is required"));return}k(!0);try{if(n&&s)await ka.ContextController_updateBlock({id:s,body:{title:x.trim(),content:v.trim()}}),y("Context block updated","success"),o(`/context/block/${s}`);else{const U=await ka.ContextController_createBlock({body:{title:x.trim(),content:v.trim(),tagNames:E.length>0?E:void 0,parentId:d}});y("Context block created","success"),o(`/context/block/${U.id}`)}}catch(U){f(U)}finally{k(!1)}},D=n&&s?`/context/block/${s}`:"/context/home";return w?a.jsx("div",{className:"context-block-create",children:a.jsx(S,{tone:"muted",children:"Loading…"})}):a.jsxs("div",{className:"context-block-create",children:[g&&a.jsxs("div",{className:"context-block-create__breadcrumbs",children:[a.jsx("button",{type:"button",className:"context-block-create__breadcrumb",onClick:()=>o("/context/home"),children:"Home"}),a.jsx("span",{className:"context-block-create__breadcrumb-separator",children:"›"}),a.jsx("span",{className:"context-block-create__breadcrumb context-block-create__breadcrumb--current",children:n?"Edit Block":"New Block"})]}),a.jsxs("div",{className:"context-block-create__title-row",children:[a.jsx("input",{type:"text",value:x,onChange:U=>_(U.target.value),placeholder:"Untitled",className:"context-block-create__title-input",maxLength:255,"aria-label":"Block title",autoFocus:!0}),a.jsx(ce,{type:"button",size:"lg",variant:"secondary",onClick:()=>m.current?.click(),title:O?`File: ${O}`:"Upload markdown file",tabIndex:-1,children:O?`↑ ${O}`:"↑ Upload .md"}),a.jsx("input",{ref:m,type:"file",accept:".md",onChange:q,className:"context-block-create__file-input-hidden","aria-hidden":"true"})]}),a.jsx("textarea",{value:v,onChange:U=>T(U.target.value),placeholder:"Write markdown content here, or upload a .md file above…",className:"context-block-create__editor","aria-label":"Block content (Markdown)"}),a.jsx("div",{className:"context-block-create__bottom-bar",children:a.jsxs("div",{className:"context-block-create__actions",children:[a.jsx(ce,{type:"button",size:"lg",variant:"secondary",onClick:()=>o(D),disabled:j,children:"Cancel"}),a.jsx(ce,{type:"button",size:"lg",variant:"primary",onClick:A,disabled:j||!x.trim()||!v.trim(),children:j?n?"Saving…":"Creating…":n?"Save":"Create"})]})})]})}function pC(){return a.jsx(sk,{children:a.jsx(ts,{children:a.jsxs(xe,{element:a.jsx(rk,{}),children:[a.jsx(xe,{index:!0,element:a.jsx(Ca,{to:"home",replace:!0})}),a.jsx(xe,{path:"home",element:a.jsx(ik,{})}),a.jsx(xe,{path:"new",element:a.jsx(Ly,{})}),a.jsx(xe,{path:"block/:id",element:a.jsx(fC,{})}),a.jsx(xe,{path:"block/:id/edit",element:a.jsx(Ly,{})})]})})})}const gC=window.location.origin,En=new Gn({baseUrl:gC,credentials:"include"}),bl=En.agent,go=En.agentTokens,Br=En.agent,mC=En.authorizationServer,Id=En.meta,Ur=En.tools;En.agent,En.agentTokens,En.agent,En.authorizationServer,En.meta,En.tools;const yC=()=>{const[s,n]=p.useState(!1),[r,o]=p.useState(null),[c,d]=p.useState([]);p.useEffect(()=>{y()},[]);const f=v=>[...v].sort((T,E)=>{const j=new Date(T.updatedAt).getTime();return new Date(E.updatedAt).getTime()-j}),y=async()=>{n(!0),o(null);try{const v=await bl.AgentsController_listAgents({});d(f(v.items||[]))}catch(v){o(v instanceof Error?v.message:"Failed to load agents")}finally{n(!1)}};return{isLoading:s,error:r,agents:c,loadAgents:y,loadAgentDetails:async v=>{n(!0),o(null);try{return await bl.AgentsController_getAgentBySlug({slug:v})}catch(T){return o(T instanceof Error?T.message:"Failed to load agent details"),null}finally{n(!1)}},createAgent:async v=>{n(!0),o(null);try{const T=await bl.AgentsController_createAgent({body:{name:v.name,slug:v.slug,systemPrompt:v.systemPrompt,allowedTools:v.allowedTools??[],type:v.type,description:v.description,introduction:v.introduction,avatarUrl:v.avatarUrl,providerId:v.providerId,modelId:v.modelId,statusTriggers:v.statusTriggers,tagTriggers:v.tagTriggers,isActive:v.isActive,concurrencyLimit:v.concurrencyLimit}});return d(E=>f([...E,T])),T}catch(T){return o(T instanceof Error?T.message:"Failed to create agent"),null}finally{n(!1)}},updateAgent:async(v,T)=>{n(!0),o(null);try{const E=await bl.AgentsController_patchAgent({actorId:v,body:T});return d(j=>{const k=j.map(w=>w.actorId===v?E:w);return f(k)}),E}catch(E){return o(E instanceof Error?E.message:"Failed to update agent"),null}finally{n(!1)}},deleteAgent:async v=>{n(!0),o(null);try{return await bl.AgentsController_deleteAgent({actorId:v}),d(T=>T.filter(E=>E.actorId!==v)),!0}catch(T){return o(T instanceof Error?T.message:"Failed to delete agent"),!1}finally{n(!1)}}}},hv=p.createContext(null);function xC({children:s}){const{agents:n,isLoading:r,error:o,loadAgentDetails:c,createAgent:d,updateAgent:f,deleteAgent:y}=yC(),[g,m]=p.useState(""),x=p.useMemo(()=>({agents:n,isLoading:r,error:o,sectionTitle:g,setSectionTitle:m,loadAgentDetails:c,createAgent:d,updateAgent:f,deleteAgent:y}),[n,r,o,g,m,c,d,f,y]);return a.jsx(hv.Provider,{value:x,children:s})}function Fr(){const s=p.useContext(hv);if(!s)throw new Error("useAgentsCtx must be used within <AgentsProvider>");return s}function vC(){const{agents:s,setSectionTitle:n,isLoading:r,error:o}=Fr(),c=ze(),d=bt();return qt(),p.useEffect(()=>{n("All Agents 🦄")},[n]),r&&s.length===0?a.jsx(pe,{children:a.jsx(ge,{leading:a.jsx($e,{name:"...",size:"lg"}),children:a.jsx(S,{tone:"muted",children:"Loading agents..."})})}):o?a.jsx(pe,{children:a.jsx(ge,{leading:a.jsx($e,{name:"!",size:"lg"}),children:a.jsxs(S,{tone:"muted",children:["Error: ",o]})})}):s.length===0?a.jsxs(a.Fragment,{children:[a.jsx(pe,{children:a.jsx(ge,{leading:a.jsx($e,{name:"?",size:"lg"}),children:a.jsx(S,{tone:"muted",children:"No agents found"})})}),a.jsx(qy,{isDesktop:d,onClick:()=>c("/agents/new")})]}):a.jsxs(a.Fragment,{children:[a.jsx(pe,{children:s.map(f=>a.jsx(bC,{agent:f,onClick:()=>c(`/agents/agent/${f.slug}`)},f.actorId))}),a.jsx(qy,{isDesktop:d,onClick:()=>c("/agents/new")})]})}function qy({isDesktop:s,onClick:n}){return a.jsx("button",{className:`agents-fab ${s?"agents-fab--desktop":""}`,type:"button",onClick:n,"aria-label":"Create new agent",children:s?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"agents-fab__plus",children:"+"}),a.jsx("span",{className:"agents-fab__label",children:"New agent"})]}):"+"})}function bC({agent:s,onClick:n}){const r=[SC(s.type),_C(s.isActive)];return a.jsxs(ge,{leading:a.jsx($e,{name:s.name,size:"lg"}),topRight:Ct(s.updatedAt),tags:r,onClick:n,children:[a.jsxs(S,{className:"pre",style:"mono",tone:"muted",children:["@",s.slug]}),a.jsx(S,{weight:"bold",size:"3",tone:"default",children:s.name}),a.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.jsx(S,{tone:"muted",size:"2",children:s.description?String(s.description):"No description"})}),a.jsxs("div",{style:{fontSize:12},className:"text--tone-muted",children:[s.statusTriggers.length>0&&a.jsxs("span",{children:["Triggers: ",s.statusTriggers.join(", ")]}),s.statusTriggers.length>0&&s.allowedTools.length>0&&" · ",s.allowedTools.length>0&&a.jsxs("span",{children:["Tools: ",s.allowedTools.length]})]})]})}function SC(s){return{label:s,color:{claude:"purple",codex:"green",opencode:"blue",adk:"red",githubcopilot:"yellow",other:"gray"}[s]||"gray"}}function _C(s){return{label:s?"active":"inactive",color:s?"green":"gray"}}function TC(){const s=bt(),{sectionTitle:n}=Fr(),r=[];return a.jsx("div",{style:{minHeight:0},children:s?a.jsx(Ra,{sectionTitle:n,children:a.jsx(Ot,{})}):a.jsx(za,{appTitle:"Agents",sectionTitle:n,navItems:r,children:a.jsx(Ot,{})})})}const My=s=>{s&&(s.style.height="auto",s.style.height=`${s.scrollHeight}px`)};function jC({initialValue:s,onCancel:n,onSave:r}){const[o,c]=p.useState(s),d=p.useRef(null);p.useEffect(()=>{d.current?.focus()},[]),p.useEffect(()=>{My(d.current)},[o]);function f(g){c(g.target.value),My(g.target)}async function y(){return r({systemPrompt:o})}return a.jsx(dt,{title:"Edit System Prompt",onCancel:n,onSave:y,children:a.jsx(a.Fragment,{children:a.jsx("div",{className:"edit-system-prompt-pop__input-wrapper",children:a.jsx("textarea",{className:"edit-system-prompt-pop__input-content",ref:d,placeholder:"Enter system prompt...",value:o,onChange:f})})})})}function wC({initialValue:s,onCancel:n,onSave:r}){const[o,c]=p.useState(new Set(s)),d=g=>{c(m=>{const x=new Set(m);return x.has(g)?x.delete(g):x.add(g),x})};async function f(){return r({statusTriggers:Array.from(o)})}const y=[me.NOT_STARTED,me.IN_PROGRESS,me.FOR_REVIEW,me.DONE];return a.jsx(dt,{title:"Edit Status Triggers",onCancel:n,onSave:f,children:a.jsxs("div",{className:"edit-status-triggers-pop__content",children:[a.jsx(S,{size:"2",tone:"muted",className:"edit-status-triggers-pop__description",children:"Select which task statuses will trigger this agent to activate"}),a.jsx("div",{className:"edit-status-triggers-pop__checklist",children:y.map(g=>{const m=kn[g];return a.jsxs("label",{className:"edit-status-triggers-pop__checklist-item",children:[a.jsx("input",{type:"checkbox",checked:o.has(g),onChange:()=>d(g),className:"edit-status-triggers-pop__checkbox"}),a.jsxs("div",{className:"edit-status-triggers-pop__status-info",children:[a.jsx("span",{className:"edit-status-triggers-pop__status-icon",children:m.icon}),a.jsx(S,{size:"3",weight:"medium",children:m.label}),a.jsx(S,{size:"2",tone:"muted",children:g})]})]},g)})})]})})}function EC({initialValue:s,onCancel:n,onSave:r}){const[o,c]=p.useState([]),[d,f]=p.useState(!0),[y,g]=p.useState(new Set(s)),[m,x]=p.useState(""),[_,v]=p.useState(0),T=p.useRef(null),E=p.useRef(null);p.useEffect(()=>{(async()=>{try{const D=await Id.MetaController_getAllTags({});c(D)}catch(D){console.error("Failed to load tags:",D)}finally{f(!1)}})()},[]),p.useEffect(()=>{T.current?.focus()},[]);const j=p.useMemo(()=>{if(!m.trim())return o;const A=m.toLowerCase().trim();return o.map(U=>{let H=0;return U.name.toLowerCase().startsWith(A)?H+=100:U.name.toLowerCase().includes(A)&&(H+=50),{tag:U,score:H}}).filter(U=>U.score>0).sort((U,H)=>H.score-U.score).map(U=>U.tag)},[o,m]),k=p.useMemo(()=>{if(!m.trim())return!1;const A=m.toLowerCase().trim();return!o.some(D=>D.name.toLowerCase()===A)},[m,o]);p.useEffect(()=>{v(0)},[j.length,m,k]),p.useEffect(()=>{if(E.current){const A=j.length+(k?1:0);if(_<A){const D=E.current.children[_];D&&D.scrollIntoView({block:"nearest"})}}},[_,j.length,k]);const w=A=>{g(D=>{const U=new Set(D);return U.has(A)?U.delete(A):U.add(A),U})},N=async()=>{try{const A=await Id.MetaController_createTag({body:{name:m.trim()}});c(D=>[...D,A]),g(D=>new Set([...D,A.name])),x(""),T.current?.focus()}catch(A){console.error("Failed to create tag:",A)}},O=p.useCallback(A=>{const D=j.length+(k?1:0);if(D!==0)switch(A.key){case"ArrowDown":A.preventDefault(),v(U=>U<D-1?U+1:U);break;case"ArrowUp":A.preventDefault(),v(U=>U>0?U-1:0);break;case"Enter":A.preventDefault(),_<j.length?w(j[_].name):k&&_===j.length&&N();break;case"Escape":A.preventDefault(),m&&x("");break}},[j,_,k,m]);async function G(){return r({tagTriggers:Array.from(y)})}const q=p.useMemo(()=>Array.from(y).sort((A,D)=>A.localeCompare(D)),[y]);return a.jsx(dt,{title:"Edit Tag Triggers",onCancel:n,onSave:G,children:a.jsxs("div",{className:"edit-tag-triggers-pop__content",children:[a.jsxs(S,{size:"2",tone:"muted",className:"edit-tag-triggers-pop__description",children:["Select which tag names will trigger this agent to activate when added to a task (",y.size," selected)"]}),q.length>0&&a.jsxs(S,{size:"2",tone:"muted",className:"edit-tag-triggers-pop__description",children:["Selected: ",q.join(", ")]}),a.jsx("input",{ref:T,type:"text",className:"edit-tag-triggers-pop__input",placeholder:"Search or create tag...",value:m,onChange:A=>x(A.target.value),onKeyDown:O}),a.jsx("div",{className:"edit-tag-triggers-pop__list",ref:E,children:d?a.jsx("div",{className:"edit-tag-triggers-pop__empty",children:a.jsx(S,{tone:"muted",children:"Loading tags..."})}):j.length===0&&!k?a.jsx("div",{className:"edit-tag-triggers-pop__empty",children:a.jsx(S,{tone:"muted",children:"No tags found"})}):a.jsxs(a.Fragment,{children:[j.map((A,D)=>a.jsxs("label",{className:`edit-tag-triggers-pop__item ${D===_?"edit-tag-triggers-pop__item--highlighted":""}`,onMouseEnter:()=>v(D),children:[a.jsx("input",{type:"checkbox",checked:y.has(A.name),onChange:()=>w(A.name),className:"edit-tag-triggers-pop__checkbox"}),a.jsx("div",{className:"edit-tag-triggers-pop__tag-badge",style:{backgroundColor:A.color||"#999"},children:A.name})]},A.id)),k&&a.jsxs("div",{className:`edit-tag-triggers-pop__item edit-tag-triggers-pop__item--create ${_===j.length?"edit-tag-triggers-pop__item--highlighted":""}`,onClick:N,onMouseEnter:()=>v(j.length),children:[a.jsx(S,{size:"2",tone:"muted",children:"Create new tag:"}),a.jsx("div",{className:"edit-tag-triggers-pop__tag-badge",style:{backgroundColor:"#999"},children:m.trim()})]})]})})]})})}const By=s=>{s&&(s.style.height="auto",s.style.height=`${s.scrollHeight}px`)};function kC({initialValue:s,onCancel:n,onSave:r}){const[o,c]=p.useState(s),d=p.useRef(null);p.useEffect(()=>{d.current?.focus()},[]),p.useEffect(()=>{By(d.current)},[o]);function f(g){c(g.target.value),By(g.target)}async function y(){return r({introduction:o})}return a.jsx(dt,{title:"Edit Introduction",onCancel:n,onSave:y,children:a.jsx(a.Fragment,{children:a.jsx("div",{className:"edit-introduction-pop__input-wrapper",children:a.jsx("textarea",{className:"edit-introduction-pop__input-content",ref:d,placeholder:"Enter introduction...",value:o,onChange:f})})})})}const CC=[{value:"claude",label:"Claude",description:"Anthropic's Claude AI"},{value:"codex",label:"Codex",description:"OpenAI's Codex"},{value:"opencode",label:"OpenCode",description:"OpenCode agent"},{value:"adk",label:"ADK",description:"Agent Development Kit"},{value:"githubcopilot",label:"GitHub Copilot",description:"GitHub Copilot agent"},{value:"other",label:"Other",description:"Other agent type"}];function NC({initialValue:s,onCancel:n,onSave:r}){const[o,c]=p.useState(s);async function d(){return r({type:o})}return a.jsx(dt,{title:"Edit Agent Type",onCancel:n,onSave:d,children:a.jsxs("div",{className:"edit-agent-type-pop__content",children:[a.jsx(S,{size:"2",tone:"muted",className:"edit-agent-type-pop__description",children:"Select the type of agent (provider). An agent can only be of one type."}),a.jsx("div",{className:"edit-agent-type-pop__radio-list",children:CC.map(f=>a.jsxs("label",{className:"edit-agent-type-pop__radio-item",children:[a.jsx("input",{type:"radio",name:"agent-type",value:f.value,checked:o===f.value,onChange:()=>c(f.value),className:"edit-agent-type-pop__radio"}),a.jsxs("div",{className:"edit-agent-type-pop__type-info",children:[a.jsx(S,{size:"3",weight:"medium",children:f.label}),a.jsx(S,{size:"2",tone:"muted",children:f.description})]})]},f.value))})]})})}function AC({initialProviderId:s,initialModelId:n,onCancel:r,onSave:o}){const[c,d]=p.useState(s),[f,y]=p.useState(n),g=p.useRef(null),m=p.useRef(null);p.useEffect(()=>{g.current?.focus()},[]);async function x(){return o({providerId:c.trim(),modelId:f.trim()})}return a.jsx(dt,{title:"Edit Model",onCancel:r,onSave:x,children:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"edit-agent-model-pop__field",children:a.jsx("input",{className:"edit-agent-model-pop__input",ref:g,placeholder:"Provider ID (optional)",value:c,onChange:_=>d(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),m.current?.focus())}})}),a.jsx("div",{className:"edit-agent-model-pop__field",children:a.jsx("input",{className:"edit-agent-model-pop__input",ref:m,placeholder:"Model ID (optional)",value:f,onChange:_=>y(_.target.value)})})]})})}function RC({initialValue:s,onCancel:n,onSave:r}){const[o,c]=p.useState(s!==null?String(s):""),[d,f]=p.useState(null),y=p.useRef(null);p.useEffect(()=>{y.current?.focus()},[]);const g=async()=>{const m=o.trim();if(m.length===0)return r({concurrencyLimit:null});const x=Number(m);return!Number.isInteger(x)||x<1?(f("Use a whole number of 1 or higher, or leave empty for unlimited."),!1):(f(null),r({concurrencyLimit:x}))};return a.jsx(dt,{title:"Edit Concurrency",onCancel:n,onSave:g,children:a.jsxs("div",{className:"edit-concurrency-limit-pop__content",children:[a.jsx(S,{size:"2",tone:"muted",children:"Leave empty for unlimited parallel tasks."}),a.jsx("input",{ref:y,className:"edit-concurrency-limit-pop__input",type:"number",min:1,step:1,placeholder:"Unlimited",value:o,onChange:m=>{c(m.target.value),d&&f(null)}}),d&&a.jsx(S,{size:"1",className:"edit-concurrency-limit-pop__error",children:d})]})})}const vd=["meta:read","meta:write","tasks:read","tasks:write","context:read","context:write","agents:read","run:read","run:write","threads:read","threads:write","mcp-registry:read","mcp:use","secret:read"];function zC(){const{slug:s}=Wt(),n=ze(),{agents:r,setSectionTitle:o,loadAgentDetails:c,updateAgent:d,deleteAgent:f}=Fr(),{showError:y}=Dn(),g=r.find(ie=>ie.slug===s),[m,x]=p.useState(g||null),[_,v]=p.useState(!g),[T,E]=p.useState([]),[j,k]=p.useState(!1),[w,N]=p.useState(null),[O,G]=p.useState(!1),[q,A]=p.useState(!1),[D,U]=p.useState(""),[H,P]=p.useState(new Set(vd)),[B,J]=p.useState(30),[X,ee]=p.useState([]),[ue,M]=p.useState(!1),[ne,fe]=p.useState([]),[ke,Te]=p.useState(!1),[R,K]=p.useState([]),[re,$]=p.useState(!1),[ae,de]=p.useState(!1),[le,be]=p.useState(!1),[De,ot]=p.useState(!1),[Gt,Pt]=p.useState(!1),[Pn,jt]=p.useState(!1),[Se,Ce]=p.useState(!1),[St,Mt]=p.useState(!1),en=p.useCallback(async()=>{if(s){k(!0);try{const ie=await go.AgentTokensController_listTokens({slug:s});E(ie)}catch(ie){console.error("Failed to load tokens:",ie)}finally{k(!1)}}},[s]),On=p.useCallback(async()=>{M(!0);try{const ie=await mC.AuthorizationController_getScopes({});ee(ie.scopes)}catch(ie){console.error("Failed to load scopes:",ie)}finally{M(!1)}},[]),ss=p.useCallback(async()=>{Te(!0);try{const ie=await Id.MetaController_getAllTags({});fe(ie)}catch(ie){console.error("Failed to load tags:",ie)}finally{Te(!1)}},[]),as=p.useCallback(async()=>{if(m){$(!0);try{const ie=await Br.AgentToolPermissionsController_listAgentToolPermissions({actorId:m.actorId});K(ie)}catch(ie){console.error("Failed to load tool permissions:",ie)}finally{$(!1)}}},[m]);p.useEffect(()=>{!g&&s?(v(!0),console.log("AGENT DETAIL PAGE"),c(s).then(ie=>{x(ie),v(!1)}).catch(ie=>{x(null)})):g&&x(g)},[s,g,c]),p.useEffect(()=>{m&&(en(),ss(),as())},[m,en,ss,as]),p.useEffect(()=>{q&&X.length===0&&On(),q||P(new Set(vd))},[q,X.length,On]),qt({agent:{name:m?.name}}),p.useEffect(()=>{if(!m){o("Agent");return}o(m.name)},[m,o]);const ks=async()=>{if(!(!s||!D.trim()||H.size===0)){G(!0);try{const ie=Array.from(H),Ee=await go.AgentTokensController_issueToken({slug:s,body:{name:D.trim(),scopes:ie,expirationDays:B}});N(Ee.token),A(!1),U(""),P(new Set(vd)),await en()}catch(ie){console.error("Failed to create token:",ie),alert("Failed to create token")}finally{G(!1)}}},_t=ie=>{P(Ee=>{const Vt=new Set(Ee);return Vt.has(ie)?Vt.delete(ie):Vt.add(ie),Vt})},Cs=async({systemPrompt:ie})=>{if(!m)return!1;try{const Ee=await d(m.actorId,{systemPrompt:ie});return Ee?(x(Ee),de(!1),!0):!1}catch(Ee){return console.error("Failed to update system prompt:",Ee),y(Ee),!1}},Ns=async({statusTriggers:ie})=>{if(!m)return!1;try{const Ee=await d(m.actorId,{statusTriggers:ie});return Ee?(x(Ee),be(!1),!0):!1}catch(Ee){return console.error("Failed to update status triggers:",Ee),y(Ee),!1}},Oa=async({tagTriggers:ie})=>{if(!m)return!1;try{const Ee=await d(m.actorId,{tagTriggers:ie});return Ee?(x(Ee),ot(!1),!0):!1}catch(Ee){return console.error("Failed to update tag triggers:",Ee),y(Ee),!1}},As=async({introduction:ie})=>{if(!m)return!1;try{const Ee=await d(m.actorId,{introduction:ie});return Ee?(x(Ee),jt(!1),!0):!1}catch(Ee){return console.error("Failed to update introduction:",Ee),y(Ee),!1}},Rl=async({type:ie})=>{if(!m)return!1;try{const Ee=await d(m.actorId,{type:ie});return Ee?(x(Ee),Pt(!1),!0):!1}catch(Ee){return console.error("Failed to update agent type:",Ee),y(Ee),!1}},hn=async({providerId:ie,modelId:Ee})=>{if(!m)return!1;try{const Vt=await d(m.actorId,{providerId:ie,modelId:Ee});return Vt?(x(Vt),Ce(!1),!0):!1}catch(Vt){return console.error("Failed to update model config:",Vt),y(Vt),!1}},Rs=async({concurrencyLimit:ie})=>{if(!m)return!1;try{const Ee=await d(m.actorId,{concurrencyLimit:ie});return Ee?(x(Ee),Mt(!1),!0):!1}catch(Ee){return console.error("Failed to update concurrency limit:",Ee),y(Ee),!1}},zl=async ie=>{if(s&&confirm("Are you sure you want to revoke this token? This action cannot be undone."))try{await go.AgentTokensController_revokeToken({slug:s,tokenId:ie}),await en()}catch(Ee){console.error("Failed to revoke token:",Ee),alert("Failed to revoke token")}},oe=async ie=>{if(s){G(!0);try{const Ee=await go.AgentTokensController_issueToken({slug:s,body:{name:ie.name,scopes:ie.scopes,expirationDays:B}});N(Ee.token),await en()}catch(Ee){console.error("Failed to refresh token:",Ee),alert("Failed to refresh token")}finally{G(!1)}}},he=ie=>{navigator.clipboard.writeText(ie)};if(_)return a.jsx("div",{className:"agent-detail-page",children:a.jsx(se,{spacing:"4",align:"center",children:a.jsx(S,{size:"3",tone:"muted",children:"Loading agent..."})})});if(!m)return a.jsx("div",{className:"agent-detail-page",children:a.jsxs(se,{spacing:"4",align:"center",children:[a.jsx(S,{size:"3",tone:"muted",children:"Agent not found"}),a.jsx(ce,{variant:"secondary",onClick:()=>n("/agents"),children:"Back to agents"})]})});const we=m.introduction,He=typeof we=="string"?we:"",Bt=m.providerId&&m.providerId.trim().length>0?m.providerId:"Default provider",fn=m.modelId&&m.modelId.trim().length>0?m.modelId:"Default model",qe=m.concurrencyLimit,Ut=typeof qe=="number"&&Number.isFinite(qe)&&qe>0?Math.floor(qe):null,Vn=new Map(ne.map(ie=>[ie.name,ie.color])),tn=R.filter(ie=>ie.server.providedId==="tasks"||ie.server.providedId==="context").length,pn=R.length-tn,zs=re?"Loading tool permissions...":R.length===0?"No tools configured":`${R.length} ${R.length===1?"tool":"tools"} configured`,ls=re?"Checking assigned tools and scopes":R.length===0?"Tasks and Context can be configured from the dedicated tools page.":`${tn} system ${tn===1?"tool":"tools"}, ${pn} additional ${pn===1?"tool":"tools"}`;return a.jsxs("div",{className:"agent-detail-page",children:[a.jsx(pe,{className:"agent-detail-page__section",children:a.jsxs(ge,{leading:a.jsx($e,{size:"sm",name:m.name,src:m.avatarUrl||void 0}),tags:[DC(m.type),OC(m.isActive)],topRight:a.jsx(S,{size:"1",tone:"muted",children:Ct(m.updatedAt)}),children:[a.jsx(S,{as:"span",weight:"normal",tone:"muted",size:"3",children:` @${m.slug} `}),a.jsxs(S,{as:"span",tone:"muted",style:"mono",children:["#",m.actorId.slice(0,6)]}),a.jsx(S,{children:m.description?String(m.description):"No description"})]})}),a.jsx(pe,{title:"System Prompt",className:"agent-detail-page__section",children:a.jsxs(ge,{onClick:()=>de(!0),children:[a.jsx(S,{size:"2",style:"mono",className:"agent-detail-page__text-preview agent-detail-page__text-preview--system",children:m.systemPrompt||"No system prompt configured"}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),a.jsx(pe,{title:"Introduction",className:"agent-detail-page__section",children:a.jsxs(ge,{onClick:()=>jt(!0),children:[a.jsx(S,{size:"2",className:"agent-detail-page__text-preview",children:He.trim().length>0?He:"No introduction configured"}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),a.jsx(pe,{title:"Agent Type",className:"agent-detail-page__section",children:a.jsxs(ge,{onClick:()=>Pt(!0),children:[a.jsx(S,{size:"2",tone:"muted",children:m.type}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),a.jsx(pe,{title:"Model",className:"agent-detail-page__section",children:a.jsxs(ge,{onClick:()=>Ce(!0),children:[a.jsxs(se,{spacing:"1",children:[a.jsxs(S,{size:"2",tone:"muted",children:["Provider: ",Bt]}),a.jsxs(S,{size:"2",tone:"muted",children:["Model: ",fn]})]}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),a.jsx(pe,{title:"Concurrency",className:"agent-detail-page__section",children:a.jsxs(ge,{onClick:()=>Mt(!0),children:[a.jsx(S,{size:"2",tone:"muted",children:Ut===null?"Unlimited parallel tasks":`${Ut} parallel ${Ut===1?"task":"tasks"}`}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),a.jsx(pe,{title:"Status Triggers",className:"agent-detail-page__section",children:a.jsxs(ge,{onClick:()=>be(!0),children:[m.statusTriggers.length>0?m.statusTriggers.map(ie=>a.jsx(S,{tone:"muted",children:ie},ie)):a.jsx(S,{tone:"muted",children:"No status triggers configured"}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),a.jsx(pe,{title:"Tag Triggers",className:"agent-detail-page__section",children:a.jsxs(ge,{onClick:()=>ot(!0),children:[m.tagTriggers&&m.tagTriggers.length>0?a.jsx("div",{className:"agent-detail-page__tag-triggers",children:ke?a.jsx(S,{tone:"muted",children:"Loading tags..."}):m.tagTriggers.map(ie=>a.jsx(ws,{color:LC(Vn.get(ie)),children:ie},ie))}):a.jsx(S,{tone:"muted",children:"No tag triggers configured"}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),a.jsx(pe,{title:"Tools",className:"agent-detail-page__section",children:a.jsxs(ge,{onClick:()=>n(`/agents/agent/${m.slug}/tools`),children:[a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"2",weight:"medium",children:zs}),a.jsx(S,{size:"1",tone:"muted",children:ls})]}),a.jsx(S,{size:"1",tone:"muted",children:"tap to manage"})]})}),w&&a.jsx(pe,{title:"New Token Created",className:"agent-detail-page__section agent-detail-page__new-token",children:a.jsx(ge,{children:a.jsxs(se,{spacing:"2",children:[a.jsx(S,{weight:"medium",size:"2",className:"agent-detail-page__warning-text",children:"Copy this token now. It will not be shown again."}),a.jsx("div",{className:"agent-detail-page__token-display",children:a.jsx("code",{className:"agent-detail-page__token-code",children:w})}),a.jsxs("div",{className:"agent-detail-page__button-row",children:[a.jsx(ce,{size:"sm",onClick:()=>he(w),children:"Copy Token"}),a.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>N(null),children:"Dismiss"})]})]})})}),a.jsxs(pe,{title:"Access Tokens",className:"agent-detail-page__section",action:!q&&a.jsx(ce,{size:"sm",onClick:()=>A(!0),children:"New Token"}),children:[q&&a.jsx(ge,{children:a.jsxs(se,{spacing:"3",children:[a.jsx(S,{weight:"medium",size:"2",children:"Create New Token"}),a.jsxs("div",{className:"agent-detail-page__form-field",children:[a.jsx("label",{children:a.jsx(S,{size:"1",tone:"muted",children:"Token Name"})}),a.jsx("input",{type:"text",value:D,onChange:ie=>U(ie.target.value),placeholder:"e.g., CI/CD Pipeline",className:"agent-detail-page__input"})]}),a.jsxs("div",{className:"agent-detail-page__form-field",children:[a.jsx("label",{children:a.jsx(S,{size:"1",tone:"muted",children:"Scopes"})}),a.jsx(S,{size:"1",tone:"muted",className:"agent-detail-page__scope-note",children:"The preselected scopes are sufficient for the worker process running this agent."}),ue?a.jsx(S,{size:"2",tone:"muted",children:"Loading available scopes..."}):a.jsx("div",{className:"agent-detail-page__scopes-list",children:X.map(ie=>a.jsxs("label",{className:"agent-detail-page__scope-item",children:[a.jsx("input",{type:"checkbox",checked:H.has(ie.id),onChange:()=>_t(ie.id)}),a.jsxs("div",{className:"agent-detail-page__scope-info",children:[a.jsx(S,{size:"2",weight:"medium",children:ie.id}),a.jsx(S,{size:"1",tone:"muted",children:ie.description})]})]},ie.id))})]}),a.jsxs("div",{className:"agent-detail-page__form-field",children:[a.jsx("label",{children:a.jsx(S,{size:"1",tone:"muted",children:"Expires in (days)"})}),a.jsx("input",{type:"number",value:B,onChange:ie=>J(parseInt(ie.target.value)||30),min:1,max:365,className:"agent-detail-page__input"})]}),a.jsxs("div",{className:"agent-detail-page__button-row",children:[a.jsx(ce,{size:"sm",onClick:ks,disabled:O||!D.trim()||H.size===0,children:O?"Creating...":"Create Token"}),a.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>A(!1),children:"Cancel"})]})]})}),j?a.jsx(ge,{children:a.jsx(S,{tone:"muted",size:"2",children:"Loading tokens..."})}):T.length===0?a.jsx(ge,{children:a.jsx(S,{tone:"muted",size:"2",children:"No tokens issued for this agent yet."})}):T.map(ie=>a.jsxs(ge,{tags:[ie.isValid?{label:"active",color:"green"}:{label:ie.revokedAt?"revoked":"expired",color:"gray"}],topRight:ie.isValid?a.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>zl(ie.id),children:"Revoke"}):a.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>oe(ie),disabled:O,children:"Refresh"}),children:[a.jsx(S,{weight:"medium",size:"2",children:ie.name}),a.jsxs(se,{spacing:"1",children:[a.jsxs(S,{size:"1",tone:"muted",children:["Scopes: ",ie.scopes.join(", ")]}),a.jsxs(S,{size:"1",tone:"muted",children:["Created: ",new Date(ie.createdAt).toLocaleDateString()," by ",ie.issuedByDisplayName]}),a.jsxs(S,{size:"1",tone:"muted",children:["Expires: ",new Date(ie.expiresAt).toLocaleDateString()]}),ie.revokedAt&&a.jsxs(S,{size:"1",tone:"muted",className:"agent-detail-page__revoked-text",children:["Revoked: ",new Date(String(ie.revokedAt)).toLocaleDateString()]})]})]},ie.id))]}),a.jsx(Cl,{className:"agent-detail-page__actions",onDelete:async()=>{f(m.actorId),n("/agents")}}),a.jsx(pe,{className:"agent-detail-page__actions",children:a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>n("/agents"),children:"Back to Agents"})}),ae&&m&&a.jsx(jC,{initialValue:m.systemPrompt,onCancel:()=>de(!1),onSave:Cs}),le&&m&&a.jsx(wC,{initialValue:m.statusTriggers,onCancel:()=>be(!1),onSave:Ns}),De&&m&&a.jsx(EC,{initialValue:m.tagTriggers||[],onCancel:()=>ot(!1),onSave:Oa}),Gt&&m&&a.jsx(NC,{initialValue:m.type,onCancel:()=>Pt(!1),onSave:Rl}),Pn&&m&&a.jsx(kC,{initialValue:He,onCancel:()=>jt(!1),onSave:As}),Se&&m&&a.jsx(AC,{initialProviderId:m.providerId??"",initialModelId:m.modelId??"",onCancel:()=>Ce(!1),onSave:hn}),St&&m&&a.jsx(RC,{initialValue:Ut,onCancel:()=>Mt(!1),onSave:Rs})]})}function DC(s){return{label:s,color:{claude:"orange",codex:"green",opencode:"blue",adk:"red",githubcopilot:"yellow",other:"gray"}[s]||"gray"}}function OC(s){return{label:s?"active":"inactive",color:s?"green":"gray"}}function LC(s){if(!s)return"gray";const n={"#6B7280":"gray","#3B82F6":"blue","#10B981":"green","#52B788":"green","#F59E0B":"yellow","#F97316":"orange","#EF4444":"red","#8B5CF6":"purple","#A855F7":"purple","#98D8C8":"green"};if(n[s])return n[s];const r=parseInt(s.slice(1,3),16),o=parseInt(s.slice(3,5),16),c=parseInt(s.slice(5,7),16);return r>o&&r>c?o>100?"orange":"red":o>r&&o>c?"green":c>r&&c>o?r>100?"purple":"blue":r>150&&o>150&&c<100?"yellow":"gray"}function qC({currentPermissions:s,onCancel:n,onSaveUnscopedTool:r,onConfigureScopedTool:o}){const[c,d]=p.useState([]),[f,y]=p.useState(!0),[g,m]=p.useState(""),[x,_]=p.useState(0),[v,T]=p.useState(""),[E,j]=p.useState([]),[k,w]=p.useState(!1),[N,O]=p.useState(!1),G=p.useRef(null),q=p.useRef(null);p.useEffect(()=>{G.current?.focus()},[]),p.useEffect(()=>{(async()=>{y(!0);try{const ue=await Ur.McpRegistryController_listServers({});d(ue.items)}catch(ue){console.error("Failed to load tools:",ue)}finally{y(!1)}})()},[]);const A=new Set(s.map(ee=>ee.serverId)),D=p.useMemo(()=>c.filter(ee=>!A.has(ee.id)),[c,A]),U=p.useMemo(()=>{const ee=g.trim().toLowerCase();return ee?D.filter(ue=>ue.name.toLowerCase().includes(ee)||ue.type.toLowerCase().includes(ee)||ue.description.toLowerCase().includes(ee)||ue.providedId.toLowerCase().includes(ee)):D},[g,D]),H=U.find(ee=>ee.id===v)??D.find(ee=>ee.id===v)??null;p.useEffect(()=>{_(0)},[U.length,g]),p.useEffect(()=>{if(!q.current)return;q.current.children[x]?.scrollIntoView({block:"nearest"})},[x]),p.useEffect(()=>{if(!H||H.type!=="http"){j([]),w(!1);return}let ee=!1;return w(!0),Ur.McpRegistryController_listScopes({serverId:H.id}).then(ue=>{ee||j(ue)}).catch(ue=>{ee||(console.error("Failed to load scopes:",ue),j([]))}).finally(()=>{ee||w(!1)}),()=>{ee=!0}},[H]);const P=p.useCallback(ee=>{if(!(ee.nativeEvent.isComposing||U.length===0))switch(ee.key){case"ArrowDown":ee.preventDefault(),_(ue=>ue<U.length-1?ue+1:ue);break;case"ArrowUp":ee.preventDefault(),_(ue=>ue>0?ue-1:0);break;case"Enter":ee.preventDefault(),T(U[x]?.id??"");break}},[U,x]),B=p.useCallback(async()=>{if(!(!H||k||N)){if(H.type==="http"&&E.length>0){o(H,E),n?.();return}O(!0);try{await r(H),n?.()}finally{O(!1)}}},[N,k,n,o,r,H,E]),J=p.useCallback(async(ee,ue)=>{if(!N){if(T(ee.id),_(ue),ee.type!=="http"){O(!0);try{await r(ee),n?.()}finally{O(!1)}return}w(!0);try{const M=await Ur.McpRegistryController_listScopes({serverId:ee.id});if(M.length>0){o(ee,M),n?.();return}O(!0);try{await r(ee),n?.()}finally{O(!1)}}catch(M){console.error("Failed to load scopes:",M)}finally{w(!1)}}},[N,n,o,r]),X=H?.type==="http"&&E.length>0?"next":N?"saving":"save";return a.jsx(dt,{title:"Add Tool",onCancel:n,headerRight:a.jsx("div",{onClick:()=>{B()},style:{opacity:!H||k||N?.5:1,pointerEvents:!H||k||N?"none":"auto"},children:a.jsx(S,{size:"4",weight:"normal",className:"pop-shell__main-title-button",children:X})}),children:a.jsx("div",{className:"actor-search-pop",children:f?a.jsx("div",{className:"actor-search-pop__empty",children:a.jsx(S,{tone:"muted",children:"Loading tools..."})}):D.length===0?a.jsx("div",{className:"actor-search-pop__empty",children:a.jsx(S,{tone:"muted",children:"All available tools already assigned"})}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:G,type:"text",className:"actor-search-pop__input",placeholder:"Search tools...",value:g,onChange:ee=>m(ee.target.value),onKeyDown:P}),a.jsx("div",{className:"actor-search-pop__list",ref:q,role:"listbox","aria-label":"Tools",children:U.length===0?a.jsx("div",{className:"actor-search-pop__empty",children:a.jsx(S,{tone:"muted",children:"No tools found"})}):U.map((ee,ue)=>{const M=ue===x,ne=ee.id===v;return a.jsxs("button",{type:"button",role:"option","aria-selected":ne,className:`actor-search-pop__item ${M||ne?"actor-search-pop__item--highlighted":""}`,onClick:()=>{J(ee,ue)},onMouseEnter:()=>_(ue),disabled:N||k,children:[a.jsx($e,{name:ee.name,size:"sm"}),a.jsxs("div",{className:"actor-search-pop__item-info",children:[a.jsx(S,{weight:"medium",size:"2",children:ee.name}),a.jsxs(S,{tone:"muted",size:"1",children:["@",ee.providedId," · ",ee.type]})]})]},ee.id)})})]})})})}function Uy({agentActorId:s,currentPermissions:n,onCancel:r,onSave:o,editingPermission:c=null,onDelete:d,fixedTool:f=null,title:y,saveLabel:g}){const[m,x]=p.useState([]),[_,v]=p.useState(!0),[T,E]=p.useState(""),[j,k]=p.useState(0),[w,N]=p.useState(f?.serverId||c?.serverId||""),[O,G]=p.useState([]),[q,A]=p.useState(!1),[D,U]=p.useState(c?new Set(c.scopeIds):new Set),[H,P]=p.useState(c?.hasAllScopes||!1),[B,J]=p.useState(!1),X=!!c,ee=!!f,ue=p.useRef(null),M=p.useRef(null);p.useEffect(()=>{(async()=>{v(!0);try{const be=await Ur.McpRegistryController_listServers({});x(be.items)}catch(be){console.error("Failed to load tools:",be)}finally{v(!1)}})()},[]);const ne=m.find(le=>le.id===w),fe=ne?.type==="http",ke=!!(fe&&O.length>0),Te=new Set(n.map(le=>le.serverId)),R=m.filter(le=>!Te.has(le.id)||X&&c&&le.id===c.serverId),K=p.useMemo(()=>{if(X||ee)return R;const le=T.trim().toLowerCase();return le?R.filter(be=>be.name.toLowerCase().includes(le)||be.type.toLowerCase().includes(le)||be.description.toLowerCase().includes(le)):R},[X,ee,T,R]);p.useEffect(()=>{!X&&!ee&&ue.current?.focus()},[X,ee]),p.useEffect(()=>{k(0)},[K.length,T]),p.useEffect(()=>{if(!M.current||X||ee)return;M.current.children[j]?.scrollIntoView({block:"nearest"})},[j,X,ee]),p.useEffect(()=>{w&&fe?(A(!0),Ur.McpRegistryController_listScopes({serverId:w}).then(le=>{G(le),c&&c.serverId===w&&(U(new Set(c.scopeIds)),P(c.hasAllScopes))}).catch(le=>{console.error("Failed to load scopes:",le),G([])}).finally(()=>{A(!1)})):(G([]),!X&&!ee&&(U(new Set),P(!1)))},[w,fe,c,X,ee]);const re=()=>{const le=!H;P(le),U(le?new Set(O.map(be=>be.id)):new Set)},$=le=>{U(be=>{const De=new Set(be);De.has(le)?De.delete(le):De.add(le);const ot=O.length>0&&O.every(Gt=>De.has(Gt.id));return P(ot),De})},ae=p.useCallback(async()=>{if(!w)return!1;J(!0);try{return await Br.AgentToolPermissionsController_upsertAgentToolPermission({actorId:s,serverId:w,body:{scopeIds:Array.from(D)}}),!ee&&!X&&N(""),U(new Set),P(!1),await o(),!0}catch(le){return console.error("Failed to add permission:",le),alert("Failed to add tool permission"),!1}finally{J(!1)}},[s,X,ee,o,ke,D,w]),de=p.useCallback(le=>{if(!(le.nativeEvent.isComposing||K.length===0))switch(le.key){case"ArrowDown":le.preventDefault(),k(be=>be<K.length-1?be+1:be);break;case"ArrowUp":le.preventDefault(),k(be=>be>0?be-1:0);break;case"Enter":le.preventDefault(),N(K[j]?.id??"");break}},[K,j]);return a.jsx(dt,{title:y??(X?"Edit Tool Permission":"Select Scopes"),onCancel:r,onSave:ae,headerRight:g?a.jsx("div",{onClick:()=>{ae()},style:{opacity:B?.5:1,pointerEvents:B?"none":"auto"},children:a.jsx(S,{size:"4",weight:"normal",className:"pop-shell__main-title-button",children:B?"saving":g})}):void 0,children:a.jsx("div",{className:"actor-search-pop",children:a.jsx(se,{spacing:"2",children:_?a.jsx(S,{size:"2",tone:"muted",children:"Loading available tools..."}):R.length===0?a.jsx(S,{size:"2",tone:"muted",children:"All available tools already assigned"}):a.jsxs(a.Fragment,{children:[!X&&!ee?a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:ue,type:"text",className:"actor-search-pop__input",placeholder:"Search tools...",value:T,onChange:le=>E(le.target.value),onKeyDown:de}),a.jsx("div",{className:"actor-search-pop__list",ref:M,role:"listbox","aria-label":"Tools",children:K.length===0?a.jsx("div",{className:"actor-search-pop__empty",children:a.jsx(S,{tone:"muted",size:"2",children:"No tools found"})}):K.map((le,be)=>{const De=be===j,ot=le.id===w;return a.jsxs("button",{type:"button",role:"option","aria-selected":ot,className:`actor-search-pop__item ${De||ot?"actor-search-pop__item--highlighted":""}`,onClick:()=>{N(le.id),k(be)},onMouseEnter:()=>k(be),disabled:B,children:[a.jsx($e,{name:le.name,size:"sm"}),a.jsxs("div",{className:"actor-search-pop__item-info",children:[a.jsx(S,{weight:"medium",size:"2",children:le.name}),a.jsxs(S,{tone:"muted",size:"1",children:["@",le.providedId," · ",le.type]})]})]},le.id)})})]}):a.jsxs("div",{className:"edit-agent-tool-permissions-pop__selected-tool",children:[a.jsx(S,{size:"2",weight:"medium",children:ne?.name??f?.serverName??c?.serverName}),a.jsx(S,{size:"1",tone:"muted",children:ne?.description??"Update the scopes for this tool."})]}),w&&fe&&O.length>0&&a.jsxs("div",{className:"edit-agent-tool-permissions-pop__scopes",children:[a.jsx(S,{size:"2",weight:"medium",children:"Select Scopes"}),a.jsxs("label",{className:"edit-agent-tool-permissions-pop__scope-item",children:[a.jsx("input",{type:"checkbox",checked:H,onChange:re}),a.jsxs("div",{className:"edit-agent-tool-permissions-pop__scope-info",children:[a.jsx(S,{size:"2",weight:"medium",children:"All scopes"}),a.jsx(S,{size:"1",tone:"muted",children:"Grant all available scopes"})]})]}),O.map(le=>a.jsxs("label",{className:"edit-agent-tool-permissions-pop__scope-item",children:[a.jsx("input",{type:"checkbox",checked:D.has(le.id),onChange:()=>$(le.id)}),a.jsxs("div",{className:"edit-agent-tool-permissions-pop__scope-info",children:[a.jsx(S,{size:"2",weight:"medium",style:"mono",children:le.id}),a.jsx(S,{size:"1",tone:"muted",children:le.description})]})]},le.id))]}),w&&fe&&O.length===0&&!q&&a.jsx(S,{size:"2",tone:"muted",children:"This HTTP tool does not define scopes. Access will be granted without scope selection."}),w&&!fe&&a.jsx(S,{size:"2",tone:"muted",children:"This STDIO tool does not require scope configuration."}),w&&X&&d&&a.jsx(se,{spacing:"2",children:a.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>{d()},children:"Remove Tool"})})]})})})})}function Iy(s){return s.server.providedId==="tasks"||s.server.providedId==="context"}function Hy(s){return s.server.type==="stdio"?"No scopes required":s.hasAllScopes?"All scopes":`${s.grantedScopes.length} scope${s.grantedScopes.length===1?"":"s"} granted`}function MC(){const{slug:s}=Wt(),n=ze(),{agents:r,setSectionTitle:o,loadAgentDetails:c}=Fr(),{showError:d}=Dn(),f=r.find(X=>X.slug===s),[y,g]=p.useState(f||null),[m,x]=p.useState(!f),[_,v]=p.useState([]),[T,E]=p.useState(!1),[j,k]=p.useState(!1),[w,N]=p.useState(!1),[O,G]=p.useState(null),[q,A]=p.useState(null),D=p.useCallback(async X=>{E(!0);try{const ee=await Br.AgentToolPermissionsController_listAgentToolPermissions({actorId:X});v(ee)}catch(ee){console.error("Failed to load tool permissions:",ee),d(ee)}finally{E(!1)}},[d]);p.useEffect(()=>{!f&&s?(x(!0),c(s).then(X=>{g(X),x(!1)}).catch(()=>{g(null),x(!1)})):f&&(g(f),x(!1))},[s,f,c]),p.useEffect(()=>{y&&D(y.actorId)},[y,D]),p.useEffect(()=>{if(!y){o("Tools");return}o(`${y.name} Tools`)},[y,o]),qt({agent:{name:y?`${y.name} Tools`:void 0}});const U=()=>{k(!0)},H=X=>{G(X),N(!0)},P=async X=>{if(y&&confirm("Remove this tool permission?"))try{await Br.AgentToolPermissionsController_deleteAgentToolPermission({actorId:y.actorId,serverId:X}),N(!1),G(null),await D(y.actorId)}catch(ee){console.error("Failed to delete tool permission:",ee),d(ee)}};if(m)return a.jsx("div",{className:"agent-tools-page",children:a.jsx(se,{spacing:"4",align:"center",children:a.jsx(S,{size:"3",tone:"muted",children:"Loading tools..."})})});if(!y)return a.jsx("div",{className:"agent-tools-page",children:a.jsxs(se,{spacing:"4",align:"center",children:[a.jsx(S,{size:"3",tone:"muted",children:"Agent not found"}),a.jsx(ce,{variant:"secondary",onClick:()=>n("/agents"),children:"Back to agents"})]})});const B=_.filter(Iy),J=_.filter(X=>!Iy(X));return a.jsxs("div",{className:"agent-tools-page",children:[a.jsx(pe,{className:"agent-tools-page__section",children:a.jsx(ge,{children:a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"3",weight:"medium",children:"Tools"}),a.jsx(S,{size:"2",tone:"muted",children:"Tasks and Context stay available. Additional tools can be assigned per agent with scoped access."})]})})}),a.jsx(pe,{title:"System Tools",className:"agent-tools-page__section",children:B.map(X=>a.jsx(ge,{children:a.jsx("div",{className:"agent-tools-page__row",children:a.jsxs("div",{className:"agent-tools-page__row-main",children:[a.jsxs("div",{className:"agent-tools-page__row-title",children:[a.jsx(S,{size:"2",weight:"medium",children:X.server.name}),a.jsxs("div",{className:"agent-tools-page__chips",children:[a.jsx(ws,{color:"purple",children:"System Tool"}),a.jsx(ws,{color:X.server.type==="http"?"green":"orange",children:X.server.type})]})]}),a.jsx(S,{size:"1",tone:"muted",children:X.server.description}),a.jsx(S,{size:"1",tone:"muted",children:Hy(X)})]})})},X.server.id))}),a.jsx(pe,{title:"Additional Tools",className:"agent-tools-page__section",children:T?a.jsx(ge,{children:a.jsx(S,{size:"2",tone:"muted",children:"Loading tool permissions..."})}):J.length===0?a.jsx(ge,{children:a.jsxs(se,{spacing:"1",children:[a.jsx(S,{size:"2",tone:"muted",children:"No additional tools configured"}),a.jsx(S,{size:"1",tone:"muted",children:"Add a tool to grant this agent access beyond Tasks and Context."})]})}):J.map(X=>a.jsx(ge,{onClick:()=>H(X),trailing:a.jsx(S,{size:"2",tone:"muted",children:"Edit"}),children:a.jsx("div",{className:"agent-tools-page__row",children:a.jsxs("div",{className:"agent-tools-page__row-main",children:[a.jsxs("div",{className:"agent-tools-page__row-title",children:[a.jsx(S,{size:"2",weight:"medium",children:X.server.name}),a.jsx("div",{className:"agent-tools-page__chips",children:a.jsx(ws,{color:X.server.type==="http"?"green":"orange",children:X.server.type})})]}),a.jsx(S,{size:"1",tone:"muted",children:X.server.description}),a.jsx(S,{size:"1",tone:"muted",children:Hy(X)})]})})},X.server.id))}),a.jsxs(pe,{className:"agent-tools-page__actions",children:[a.jsx(ce,{size:"lg",onClick:U,children:"Add Tool"}),a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>n(`/agents/agent/${y.slug}`),children:"Back to agent details"})]}),j&&a.jsx(qC,{currentPermissions:_.map(X=>({serverId:X.server.id})),onCancel:()=>k(!1),onSaveUnscopedTool:async X=>{await Br.AgentToolPermissionsController_upsertAgentToolPermission({actorId:y.actorId,serverId:X.id,body:{scopeIds:[]}}),await D(y.actorId)},onConfigureScopedTool:(X,ee)=>{A({serverId:X.id,serverName:X.name,serverProvidedId:X.providedId,serverType:X.type})}}),w&&a.jsx(Uy,{agentActorId:y.actorId,currentPermissions:_.map(X=>({serverId:X.server.id,serverName:X.server.name,serverProvidedId:X.server.providedId,serverType:X.server.type,scopeIds:X.grantedScopes.map(ee=>ee.id),hasAllScopes:X.hasAllScopes})),editingPermission:O?{serverId:O.server.id,serverName:O.server.name,serverProvidedId:O.server.providedId,serverType:O.server.type,scopeIds:O.grantedScopes.map(X=>X.id),hasAllScopes:O.hasAllScopes}:null,onCancel:()=>{N(!1),G(null)},onSave:async()=>{await D(y.actorId),N(!1),G(null)},onDelete:O?async()=>{await P(O.server.id)}:void 0}),q&&a.jsx(Uy,{agentActorId:y.actorId,currentPermissions:_.map(X=>({serverId:X.server.id,serverName:X.server.name,serverProvidedId:X.server.providedId,serverType:X.server.type,scopeIds:X.grantedScopes.map(ee=>ee.id),hasAllScopes:X.hasAllScopes})),fixedTool:q,title:"Select Scopes",saveLabel:"save",onCancel:()=>A(null),onSave:async()=>{await D(y.actorId),A(null)}})]})}const $y=["template","harness","model","status","tags"],BC=[me.NOT_STARTED,me.IN_PROGRESS,me.FOR_REVIEW,me.DONE],UC={name:"",slug:"",type:"other",description:void 0,systemPrompt:"",providerId:void 0,modelId:void 0,statusTriggers:[],tagTriggers:[],allowedTools:[],isActive:!0,concurrencyLimit:1},IC={stepIndex:0,draft:UC,selectedModelOptionId:"default",customProviderId:"",customModelId:"",tagText:"",slugTouched:!1};function HC(){const s=ze(),{setSectionTitle:n,createAgent:r}=Fr(),[o,c]=p.useState(null),[d,f]=p.useState(null),[y,g]=p.useState(!0),[m,x,_]=Vr({key:"new-agent-wizard-draft",defaultValue:IC,debounceMs:0}),[v,T]=p.useState(!1),[E,j]=p.useState(null),{stepIndex:k,draft:w,selectedModelOptionId:N,customProviderId:O,customModelId:G,tagText:q,slugTouched:A}=m;qt(),p.useEffect(()=>{n("New Agent")},[n]),p.useEffect(()=>{let $=!0;async function ae(){try{const de=await bl.AgentsController_listAgentTemplates({});if(!$)return;c(de);const le=de.templates.find(be=>be.id==="custom")??de.templates[0];le&&!m.draft.templateId&&X(le)}catch(de){if(!$)return;f(de instanceof Error?de.message:"Failed to load agent templates")}finally{$&&g(!1)}}return ae(),()=>{$=!1}},[]);const D=p.useMemo(()=>w.templateId==="custom"?[...$y,"prompt","identity"]:[...$y,"identity"],[w.templateId]),U=Math.min(k,D.length-1),H=D[U],P=p.useMemo(()=>o?.harnesses.find($=>$.type===w.type)??null,[o,w.type]),B=Gy(H,w),J=U===D.length-1;function X($){x(ae=>({...ae,draft:{...ae.draft,templateId:$.id,type:$.type??ae.draft.type??"other",description:$.agentDescription||void 0,systemPrompt:$.systemPrompt,providerId:$.providerId||void 0,modelId:$.modelId||void 0,statusTriggers:$.statusTriggers,tagTriggers:$.tagTriggers,avatarUrl:$.avatarUrl,concurrencyLimit:$.concurrencyLimit,allowedTools:[],isActive:!0},tagText:$.tagTriggers.join(", "),selectedModelOptionId:$.providerId||$.modelId?`${$.providerId||"default-provider"}:${$.modelId}`:"default",customProviderId:"",customModelId:""}))}function ee($){x(ae=>({...ae,draft:{...ae.draft,type:$.type,providerId:void 0,modelId:void 0},selectedModelOptionId:"default",customProviderId:"",customModelId:""}))}function ue($){if($==="custom"){x(ae=>({...ae,selectedModelOptionId:"custom",draft:{...ae.draft,providerId:ae.customProviderId.trim()||void 0,modelId:ae.customModelId.trim()||void 0}}));return}x(ae=>({...ae,selectedModelOptionId:$.id,draft:{...ae.draft,providerId:$.providerId,modelId:$.modelId}}))}function M($,ae){x(de=>({...de,customProviderId:$,customModelId:ae,draft:{...de.draft,providerId:$.trim()||void 0,modelId:ae.trim()||void 0}}))}function ne($){x(ae=>{const de=new Set(ae.draft.statusTriggers??[]);return de.has($)?de.delete($):de.add($),{...ae,draft:{...ae.draft,statusTriggers:Array.from(de)}}})}function fe($){x(ae=>({...ae,tagText:$,draft:{...ae.draft,tagTriggers:$.split(",").map(de=>de.trim()).filter(Boolean)}}))}function ke($){x(ae=>({...ae,draft:{...ae.draft,name:$,slug:ae.slugTouched?ae.draft.slug:GC($)}}))}function Te($){x(ae=>({...ae,slugTouched:!0,draft:{...ae.draft,slug:PC($)}}))}function R(){B&&x($=>({...$,stepIndex:Math.min($.stepIndex+1,D.length-1)}))}function K(){x($=>({...$,stepIndex:Math.max($.stepIndex-1,0)}))}async function re(){if(!(!Gy("identity",w)||v)){T(!0),j(null);try{const $=await r({name:w.name.trim(),slug:w.slug.trim(),type:w.type,description:w.description,avatarUrl:w.avatarUrl,systemPrompt:w.systemPrompt,providerId:w.providerId,modelId:w.modelId,statusTriggers:w.statusTriggers??[],tagTriggers:w.tagTriggers??[],allowedTools:[],isActive:!0,concurrencyLimit:w.concurrencyLimit});$?(_(),s(`/agents/agent/${$.slug}`)):j("Agent creation failed")}finally{T(!1)}}}return y?a.jsx(pe,{children:a.jsx(ge,{children:a.jsx(S,{tone:"muted",children:"Loading agent templates..."})})}):d||!o?a.jsx(pe,{children:a.jsx(ge,{children:a.jsxs(se,{spacing:"3",children:[a.jsx(S,{tone:"muted",children:d??"Agent templates are unavailable"}),a.jsx(ce,{variant:"secondary",onClick:()=>s("/agents"),children:"Back to Agents"})]})})}):a.jsxs("div",{className:"new-agent-wizard",children:[a.jsxs("div",{className:"new-agent-wizard__header",children:[a.jsxs(S,{size:"1",tone:"muted",children:["Step ",U+1," of ",D.length]}),a.jsx("div",{className:"new-agent-wizard__progress","aria-hidden":"true",children:a.jsx("div",{className:"new-agent-wizard__progress-fill",style:{width:`${(U+1)/D.length*100}%`}})})]}),a.jsxs("div",{className:"new-agent-wizard__body",children:[H==="template"&&a.jsx(ja,{title:"What kind of agent are you making?",support:"Pick a starting point. You can adjust the agent from its page later.",children:a.jsx("div",{className:"new-agent-wizard__option-grid",children:o.templates.map($=>a.jsx(Ar,{title:$.label,description:$.description,selected:w.templateId===$.id,onClick:()=>X($)},$.id))})}),H==="harness"&&a.jsx(ja,{title:"What harness do you want to use?",support:"Choose the runtime that will execute this agent.",children:a.jsx("div",{className:"new-agent-wizard__option-grid",children:o.harnesses.map($=>a.jsx(Ar,{title:$.label,description:$.description,selected:w.type===$.type,onClick:()=>ee($)},$.type))})}),H==="model"&&a.jsxs(ja,{title:"Which model should it use?",support:"Default lets the harness choose. You can also pick a preset or enter a model.",children:[a.jsxs("div",{className:"new-agent-wizard__option-grid",children:[(P?.modelOptions??[]).map($=>a.jsx(Ar,{title:$.label,description:$.isDefault?"Use the harness default":Py($),selected:N===$.id,onClick:()=>ue($)},$.id)),a.jsx(Ar,{title:"Custom",description:"Use a provider and model ID",selected:N==="custom",onClick:()=>ue("custom")})]}),N==="custom"&&a.jsxs("div",{className:"new-agent-wizard__field-grid",children:[a.jsxs("label",{className:"new-agent-wizard__field",children:[a.jsx(S,{size:"1",tone:"muted",children:"Provider ID"}),a.jsx("input",{value:O,onChange:$=>M($.target.value,G),placeholder:"openai"})]}),a.jsxs("label",{className:"new-agent-wizard__field",children:[a.jsx(S,{size:"1",tone:"muted",children:"Model ID"}),a.jsx("input",{value:G,onChange:$=>M(O,$.target.value),placeholder:"gpt-5.3-codex"})]})]})]}),H==="status"&&a.jsx(ja,{title:"When should this agent react?",support:"These task statuses trigger the agent. Select none if it should only run manually.",children:a.jsx("div",{className:"new-agent-wizard__option-grid",children:BC.map($=>{const ae=kn[$];return a.jsx(Ar,{title:`${ae.icon} ${ae.label}`,description:$,selected:(w.statusTriggers??[]).includes($),onClick:()=>ne($)},$)})})}),H==="tags"&&a.jsx(ja,{title:"Should this only run for certain tags?",support:"Leave this blank to react to every task with the selected status.",children:a.jsxs("label",{className:"new-agent-wizard__field",children:[a.jsx(S,{size:"1",tone:"muted",children:"Tag names"}),a.jsx("input",{value:q,onChange:$=>fe($.target.value),placeholder:"code, review"})]})}),H==="prompt"&&a.jsx(ja,{title:"What should this agent do?",support:"Write the system prompt for this custom agent.",children:a.jsx("textarea",{className:"new-agent-wizard__prompt-editor",value:w.systemPrompt,onChange:$=>x(ae=>({...ae,draft:{...ae.draft,systemPrompt:$.target.value}})),placeholder:"You are an agent that...","aria-label":"System prompt"})}),H==="identity"&&a.jsxs(ja,{title:"Almost done. Name your agent.",support:"Tools can be added from the agent page after creation.",children:[a.jsxs("div",{className:"new-agent-wizard__identity-fields",children:[a.jsxs("label",{className:"new-agent-wizard__identity-field",children:[a.jsx(S,{size:"1",tone:"muted",children:"Display name"}),a.jsx("input",{className:"new-agent-wizard__name-input",value:w.name,onChange:$=>ke($.target.value),placeholder:"Code Reviewer",autoFocus:!0})]}),a.jsxs("label",{className:"new-agent-wizard__identity-field",children:[a.jsx(S,{size:"1",tone:"muted",children:"Slug"}),a.jsxs("div",{className:"new-agent-wizard__slug-row",children:[a.jsx(S,{as:"span",size:"4",tone:"muted",children:"@"}),a.jsx("input",{className:"new-agent-wizard__slug-input",value:w.slug,onChange:$=>Te($.target.value),placeholder:"code-reviewer"})]})]})]}),a.jsxs("div",{className:"new-agent-wizard__summary",children:[a.jsx(S,{size:"2",weight:"medium",children:"Summary"}),a.jsxs(S,{size:"2",tone:"muted",children:["Template: ",$C(o.templates,w.templateId)]}),a.jsxs(S,{size:"2",tone:"muted",children:["Harness: ",P?.label??w.type??"Other"]}),a.jsxs(S,{size:"2",tone:"muted",children:["Model: ",w.modelId?Py(w):"Default"]}),a.jsxs(S,{size:"2",tone:"muted",children:["Triggers: ",(w.statusTriggers??[]).length>0?w.statusTriggers?.join(", "):"Manual"]}),a.jsxs(S,{size:"2",tone:"muted",children:["Tags: ",(w.tagTriggers??[]).length>0?w.tagTriggers?.join(", "):"Any tag"]})]})]}),E&&a.jsx(S,{size:"2",className:"new-agent-wizard__error",children:E})]}),a.jsxs("div",{className:"new-agent-wizard__footer",children:[a.jsx(ce,{variant:"secondary",size:"lg",fullWidth:!0,onClick:U===0?()=>{_(),s("/agents")}:K,children:U===0?"Cancel":"Back"}),a.jsx(ce,{size:"lg",fullWidth:!0,onClick:J?re:R,disabled:!B||v,children:J?v?"Creating...":"Create agent":"Next"})]})]})}function ja({title:s,support:n,children:r}){return a.jsxs(se,{spacing:"4",className:"new-agent-wizard__section",children:[a.jsxs(se,{spacing:"2",children:[a.jsx(S,{size:"5",weight:"bold",children:s}),a.jsx(S,{size:"2",tone:"muted",children:n})]}),r]})}function Ar({title:s,description:n,selected:r,onClick:o}){return a.jsxs("button",{className:`new-agent-wizard__option ${r?"new-agent-wizard__option--selected":""}`,type:"button",onClick:o,children:[a.jsx(S,{size:"3",weight:"medium",children:s}),a.jsx(S,{size:"2",tone:"muted",children:n})]})}function Gy(s,n){return s==="template"?!!n.templateId:s==="harness"?!!n.type:s==="prompt"?!!n.systemPrompt.trim():s==="identity"?!!(n.name.trim()&&n.slug.trim()):!0}function $C(s,n){return s.find(r=>r.id===n)?.label??"Custom"}function Py(s){const n=[s.providerId,s.modelId].filter(Boolean);return n.length>0?n.join(" / "):"Default"}function GC(s){return s.toLowerCase().trim().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function PC(s){return s.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9_-]/g,"")}function VC(){return a.jsx(xC,{children:a.jsx(ts,{children:a.jsxs(xe,{element:a.jsx(TC,{}),children:[a.jsx(xe,{index:!0,element:a.jsx(vC,{})}),a.jsx(xe,{path:"/new",element:a.jsx(HC,{})}),a.jsx(xe,{path:"/agent/:slug",element:a.jsx(zC,{})}),a.jsx(xe,{path:"/agent/:slug/tools",element:a.jsx(MC,{})})]})})})}const YC=la("/threads"),FC=()=>{const[s,n]=p.useState(!1),[r,o]=p.useState(null),[c,d]=p.useState([]),[f,y]=p.useState(null),[g,m]=p.useState(!1);p.useEffect(()=>(x(),E()),[]);const x=async()=>{n(!0),o(null);try{const j=await $n.ThreadsController_listThreads({});d(j.items||[])}catch(j){o(j instanceof Error?j.message:"Failed to load threads")}finally{n(!1)}},_=p.useCallback(async j=>await $n.ThreadsController_getThread({id:j}),[]),v=p.useCallback(async j=>{const k=await $n.ThreadsController_createThread({body:{title:j}});return d(w=>[k,...w]),k},[]),T=p.useCallback(async j=>{await $n.ThreadsController_deleteThread({id:j}),d(k=>k.filter(w=>w.id!==j))},[]),E=p.useCallback(()=>{const j=Cn(YC,{transports:["websocket","polling"],withCredentials:!0});return j.on("connect",()=>{console.log("Connected to websocket"),j.emit("threads.subscribe",{},k=>{k.ok?(console.log(k),console.log("Subscribed to room:",k.room),m(!0)):(console.error("Failed to subscribe to room"),m(!1))})}),j.on(_l.THREAD_TITLE_UPDATED,k=>{d(w=>w.map(N=>N.id===k.payload.threadId?{...N,title:k.payload.title}:N))}),j.on("disconnect",()=>{console.log("WebSocket disconnected"),m(!1)}),y(j),()=>{j.emit("threads.unsubscribe",{}),j.close(),y(null),m(!1)}},[]);return{isLoading:s,error:r,threads:c,loadThreads:x,getThread:_,createThread:v,deleteThread:T}},fv=p.createContext(null);function QC({children:s}){const{threads:n,isLoading:r,error:o,getThread:c,createThread:d,deleteThread:f}=FC(),[y,g]=p.useState(""),[m,x]=p.useState([]),_=p.useMemo(()=>({threads:n,isLoading:r,error:o,sectionTitle:y,setSectionTitle:g,navItems:m,setNavItems:x,getThread:c,createThread:d,deleteThread:f}),[n,r,o,y,g,m,x,c,d,f]);return a.jsx(fv.Provider,{value:_,children:s})}function zo(){const s=p.useContext(fv);if(!s)throw new Error("useThreadsCtx must be used within <ThreadsProvider>");return s}function KC({thread:s,onClick:n}){return a.jsxs(ge,{onClick:n,children:[a.jsx("div",{style:{minWidth:0,overflow:"hidden"},children:a.jsx(S,{weight:"bold",size:"3",tone:"default",children:s.title})}),a.jsxs("div",{style:{fontSize:12},className:"text--tone-muted",children:["#",s.id.slice(0,6)]})]})}function XC(){const{threads:s,setSectionTitle:n,createThread:r}=zo(),o=ze(),c=bt(),{showError:d,showToast:f}=Dn(),{registerCommands:y}=Pr(),{readiness:g,isReady:m,isLoading:x}=ih();qt(),p.useEffect(()=>{n("Threads 🧵")},[n]);const _=T=>{o(`/threads/${T}`)},v=p.useCallback(async()=>{if(!m){f("Thread chat unlocks in Chat Settings.","info"),o("/settings/chat");return}try{const T=await r();T&&o(`/threads/${T.id}`)}catch(T){console.error("Error creating thread"),console.error(T),d(T)}},[r,m,o,d,f]);return p.useEffect(()=>y([{id:"new-thread",label:"New Thread",description:"Create a new thread",aliases:["create thread","add thread"],onSelect:v}]),[y,v]),a.jsxs(a.Fragment,{children:[!x&&g&&!g.isReady?a.jsx(oh,{title:g.title,description:g.description,ctaLabel:g.ctaLabel,onOpenSettings:()=>o("/settings/chat")}):null,a.jsx(pe,{children:s.map(T=>a.jsx(KC,{thread:T,onClick:()=>_(T.id)},T.id))}),a.jsx("button",{className:`threads-fab ${c?"threads-fab--desktop":""}`,type:"button",onClick:v,disabled:!m||x,"aria-label":"Create new thread",children:c?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"threads-fab__plus",children:"+"}),a.jsx("span",{className:"threads-fab__label",children:"New thread"})]}):"+"})]})}function ZC(){const s=bt(),{id:n}=Wt(),r=!!n,{sectionTitle:o,navItems:c}=zo();return a.jsx("div",{style:{minHeight:0},children:s?r?a.jsx(Ot,{}):a.jsx(Ra,{sectionTitle:o,children:a.jsx(Ot,{})}):a.jsx(za,{appTitle:"Threads",sectionTitle:o,navItems:c,children:a.jsx(Ot,{})})})}function pv({contextBlock:s,isStateMemory:n=!1}){const r=ze(),o=d=>{d.metaKey||d.ctrlKey?(d.stopPropagation(),window.open(`/context/block/${s.id}`,"_blank")):r(`/context/block/${s.id}`)},c=d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(`/context/block/${s.id}`))};return a.jsx(Qe,{className:"thread-context-card",children:a.jsxs("div",{className:"thread-context-card__content",role:"button",tabIndex:0,onClick:o,onKeyDown:c,children:[a.jsx(S,{size:"2",weight:"semibold",children:s.title}),a.jsxs("div",{className:"thread-context-card__meta",children:[a.jsxs(S,{size:"1",tone:"muted",children:["#",s.id.slice(0,6)]}),n&&a.jsx(ws,{color:"blue",children:"State"})]})]})})}function JC({task:s}){const n=ze(),r=s.tags.map(d=>({label:d.name}));s.commentCount>0&&r.push({label:`💬 ${s.commentCount}`});const o=s.inputRequests.filter(d=>!d.resolvedAt).length;o>0&&r.push({label:`✋ ${o}`});const c=d=>{d.metaKey||d.ctrlKey?(d.stopPropagation(),window.open(`/tasks/task/${s.id}`,"_blank")):n(`/tasks/task/${s.id}`)};return a.jsxs(vx,{leading:a.jsx($e,{name:s.createdByActor.displayName,size:"md",src:s.createdByActor.avatarUrl||void 0}),topRight:Ct(s.updatedAt),tags:r,onClick:c,highlight:o>0,footer:a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"row-detail truncate",children:["#",s.id.slice(0,6)]}),a.jsx("span",{className:"row-detail truncate",children:s.assigneeActor?`Assigned: @${s.assigneeActor.slug}`:"unassigned"})]}),children:[a.jsx("div",{className:"row-title truncate",children:s.name}),a.jsx("div",{className:"row-subtitle truncate",children:s.description})]})}function WC({task:s,onClick:n}){const r=s.assigneeActor??s.createdByActor,o=s.tags.map(d=>({label:d.name}));s.commentCount>0&&o.push({label:`comments ${s.commentCount}`});const c=s.inputRequests.filter(d=>!d.resolvedAt).length;return c>0&&o.push({label:`questions ${c}`}),a.jsxs(ge,{leading:a.jsx($e,{name:r.displayName,size:"lg",src:r.avatarUrl||void 0}),topRight:Ct(s.updatedAt),tags:o,highlight:c>0,onClick:n,children:[a.jsxs(S,{className:"pre",children:["#",s.id.slice(0,6)]}),a.jsx("div",{style:{minWidth:0,overflow:"hidden"},children:a.jsx(S,{weight:"bold",size:"3",tone:"default",children:a.jsx("span",{className:"task-row__title",children:a.jsx("span",{className:"task-row__titleText",children:s.name})})})}),a.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.description}),a.jsxs("div",{style:{fontSize:12},className:"text--tone-muted",children:[s.assigneeActor?`Assigned: @${s.assigneeActor.slug}`:"unassigned"," - ",`Created by @${s.createdByActor.slug}`]})]})}const e0=s=>[...s].sort((n,r)=>{const o=new Date(n.updatedAt).getTime(),c=new Date(r.updatedAt).getTime();return o-c}),t0=s=>{const[n,r]=p.useState(!1),[o,c]=p.useState(null),[d,f]=p.useState(!1),[y,g]=p.useState(null),[m,x]=p.useState(!1),[_,v]=p.useState(null),[T,E]=p.useState(null),[j,k]=p.useState([]),w=p.useCallback(async()=>{r(!0),c(null);try{const q=await $n.ThreadsController_getThread({id:s});E(q||null)}catch(q){c(q instanceof Error?q.message:"Failed to load thread")}finally{r(!1)}},[s]),N=p.useCallback(async()=>{f(!0),g(null);try{const q=await $n.ThreadsController_listMessages({id:s});k(e0(q.items))}catch(q){g(q instanceof Error?q.message:"Failed to load messages")}finally{f(!1)}},[s]),O=p.useCallback(async q=>{x(!0),v(null);let A=null;try{A=await $n.ThreadsController_createMessage({id:s,body:{content:q}})}catch(D){v(D instanceof Error?D.message:"Failed to send message")}finally{x(!1)}return A},[s]),G=p.useCallback(async q=>{await $n.ThreadsController_deleteThread({id:q}),E(null)},[]);return{thread:T,messages:j,isLoading:n,error:o,chatIsLoading:d,chatError:y,chatIsSending:m,chatSendError:_,loadThread:w,loadMessages:N,sendMessage:O,deleteThread:G,setMessages:k,setThread:E}},Vy={HUMAN:"human",AGENT:"agent"},n0=la("/threads"),s0=s=>{if(s){if(s.type===Eo.HUMAN)return{...s,type:Vy.HUMAN};if(s.type===Eo.AGENT)return{...s,type:Vy.AGENT}}},a0=s=>{const[n,r]=p.useState(null),[o,c]=p.useState(!1),[d,f]=p.useState(null),[y,g]=p.useState(null),m=p.useRef(null),x=p.useRef(null),_=p.useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{f(null),m.current=null},3e3)},[]),v=p.useCallback(T=>{x.current=T},[]);return p.useEffect(()=>{const T=Cn(n0,{transports:["websocket","polling"],withCredentials:!0});return T.on("connect",()=>{T.emit("threads.subscribe",{threadId:s},E=>{E.ok?c(!0):(console.error("Failed to subscribe to thread room",{threadId:s,ack:E}),c(!1))})}),T.on("connect_error",E=>{console.error("Thread websocket connect_error",{threadId:s,message:E.message})}),T.on("disconnect",()=>{c(!1),m.current&&(clearTimeout(m.current),m.current=null),f(null),g(null)}),T.on(_l.MESSAGE_CREATED,E=>{if(E.payload.threadId!==s)return;m.current&&(clearTimeout(m.current),m.current=null),f(null),g(w=>w&&(w.actorId===E.payload.createdByActorId?null:w));const j=s0(E.payload.createdByActor),k={...E.payload,createdByActor:j};x.current&&x.current(k)}),T.on(_l.AGENT_ACTIVITY,E=>{E.payload.threadId===s&&(f(E.payload.kind),_())}),T.on(_l.AGENT_RESPONSE_DELTA,E=>{E.payload.threadId===s&&g(j=>!j||j.streamId!==E.payload.streamId?{streamId:E.payload.streamId,actorId:E.actor.id,content:E.payload.delta}:{...j,content:`${j.content}${E.payload.delta}`})}),r(T),()=>{T.emit("threads.unsubscribe",{threadId:s}),m.current&&(clearTimeout(m.current),m.current=null),g(null),T.close()}},[s,_]),{socket:n,isConnected:o,agentActivity:d,agentResponseStream:y,onMessageCreated:v}},l0=s=>[...s].sort((n,r)=>{const o=new Date(n.updatedAt).getTime(),c=new Date(r.updatedAt).getTime();return o-c}),r0=s=>{const{messages:n,isLoading:r,error:o,chatIsLoading:c,chatError:d,chatIsSending:f,chatSendError:y,loadThread:g,loadMessages:m,sendMessage:x,setMessages:_}=t0(s),{agentActivity:v,agentResponseStream:T,onMessageCreated:E}=a0(s);return p.useEffect(()=>{g(),m()},[g,m]),p.useEffect(()=>{E(j=>{_(k=>l0([...k.filter(w=>w.id!==j.id),j]))})},[E,_]),{isLoading:r,error:o,chatIsLoading:c,chatError:d,chatIsSending:f,chatSendError:y,messages:n,agentActivity:v,agentResponseStream:T,sendMessage:x}};function gv({threadId:s}){const n=ze(),[r,o,c]=Vr({key:`thread-chat-draft-${s}`,defaultValue:{content:""}}),{content:d}=r,f=p.useRef(null),y=p.useRef(null),{user:g}=zn(),{readiness:m,isReady:x,isLoading:_}=ih(),{messages:v,agentActivity:T,agentResponseStream:E,sendMessage:j,chatIsSending:k,chatIsLoading:w,chatError:N,chatSendError:O}=r0(s);p.useEffect(()=>{f.current?.scrollIntoView({behavior:"smooth"})},[v,T,E?.content]),p.useEffect(()=>{w||y.current?.focus()},[w,s]);const G=async A=>{if(A.preventDefault(),!(!d.trim()||k))try{await j(d),c(),requestAnimationFrame(()=>{y.current?.focus()})}catch(D){console.error("Failed to send message:",D)}},q=A=>{const D=new Date(A);return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(D)};return w?a.jsx("div",{className:"thread-chat",children:a.jsx(S,{size:"2",tone:"muted",children:"Loading messages..."})}):a.jsxs("div",{className:"thread-chat",children:[a.jsxs("div",{className:"thread-chat__messages",children:[N&&a.jsx("div",{className:"thread-chat__status thread-chat__status--error",children:a.jsx(S,{size:"2",children:N})}),v.length===0?a.jsx("div",{className:"thread-chat__empty-state",children:a.jsx(S,{size:"2",tone:"muted",children:"No messages yet. Start the conversation."})}):v.map(A=>{const D=A.createdByActor,U=!!(g?.actorId&&g.actorId===A.createdByActorId),H=D?.displayName||"Anonymous",P=D?.slug;return a.jsxs("div",{className:`thread-chat__message ${U?"thread-chat__message--mine":""}`,children:[a.jsxs("div",{className:"thread-chat__message-header",children:[a.jsxs("div",{className:"thread-chat__author",children:[a.jsx($e,{name:H,src:D?.avatarUrl||void 0,size:"xs"}),a.jsx(S,{size:"1",weight:"semibold",children:H}),P&&a.jsxs(S,{size:"1",tone:"muted",children:["@",P]})]}),a.jsx(S,{size:"1",tone:"muted",children:q(A.createdAt)})]}),a.jsx(S,{size:"2",children:A.content})]},A.id)}),E&&a.jsxs("div",{className:"thread-chat__message thread-chat__message--streaming",role:"status","aria-live":"polite",children:[a.jsxs("div",{className:"thread-chat__message-header",children:[a.jsxs("div",{className:"thread-chat__author",children:[a.jsx($e,{name:"Assistant",size:"xs"}),a.jsx(S,{size:"1",weight:"semibold",children:"Assistant"})]}),a.jsx(S,{size:"1",tone:"muted",children:"typing..."})]}),a.jsx(S,{size:"2",children:E.content})]}),a.jsx("div",{ref:f})]}),x&&T&&a.jsx("div",{className:"thread-chat__activity",role:"status","aria-live":"polite",children:a.jsx(S,{size:"1",tone:"muted",children:T==="thinking"?"Assistant is thinking...":"Assistant is calling a tool..."})}),!_&&m&&!m.isReady?a.jsx("div",{className:"thread-chat__setup-callout",children:a.jsx(oh,{title:m.title,description:m.description,ctaLabel:m.ctaLabel,onOpenSettings:()=>n("/settings/chat")})}):a.jsxs("form",{className:"thread-chat__input-form",onSubmit:G,children:[a.jsxs("div",{className:"thread-chat__composer-row",children:[a.jsx("textarea",{ref:y,className:"thread-chat__input",value:d,onChange:A=>o({...r,content:A.target.value}),placeholder:"Write a message to this thread...",rows:3,disabled:k||_,onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),G(A))}}),a.jsx(ce,{type:"submit",variant:"secondary",className:"thread-chat__send-btn",disabled:!d.trim()||k||_,children:k?"sending...":"send"})]}),O&&a.jsx("div",{className:"thread-chat__status thread-chat__status--error",children:a.jsx(S,{size:"1",children:O})})]})]})}const i0=[{path:"/dashboard",label:"Dashboard",icon:"🏠"},{path:"/tasks",label:"Tasks",icon:"🧩"},{path:"/context",label:"Context",icon:"🧱"}];function o0(s){return i0.map(n=>({...n,path:`/threads/${s}${n.path}`}))}const c0=la("/threads"),u0=la("/tasks"),mv=[me.DONE,me.FOR_REVIEW,me.IN_PROGRESS,me.NOT_STARTED],yv=s=>{const n=s.parentTaskId,r=n&&typeof n=="string"?s.tasks.find(d=>d.id===n):null,o=[];r&&o.push({status:"parent",label:"Parent Task",tasks:[r]});const c={[me.DONE]:[],[me.FOR_REVIEW]:[],[me.IN_PROGRESS]:[],[me.NOT_STARTED]:[]};return s.tasks.forEach(d=>{if(n&&d.id===n)return;const f=d.status;c[f]&&c[f].push(d)}),mv.forEach(d=>{c[d].length>0&&o.push({status:d,label:kn[d].label,tasks:c[d]})}),o},xv=s=>{const n=[{id:s.stateContextBlockId,title:"Thread state memory",isStateMemory:!0}];return s.referencedContextBlocks.forEach(r=>{r.id!==s.stateContextBlockId&&n.push({id:r.id,title:r.title,isStateMemory:!1})}),n},d0=s=>{const n={[me.DONE]:0,[me.FOR_REVIEW]:0,[me.IN_PROGRESS]:0,[me.NOT_STARTED]:0};return s.tasks.forEach(r=>{const o=r.status;o in n&&(n[o]+=1)}),mv.map(r=>({status:r,label:kn[r].label,count:n[r]})).filter(r=>r.count>0)};function mo(){const{id:s}=Wt(),n=ze(),{setSectionTitle:r,getThread:o,deleteThread:c}=zo(),d=bt(),[f,y]=p.useState(null),[g,m]=p.useState(!0),[x,_]=p.useState(null),v=p.useRef(new Set),{setNavItems:T}=zo(),E=p.useCallback(async()=>{if(s)try{const k=await o(s);y(k),_(null)}catch(k){_(k instanceof Error?k.message:"Failed to load thread")}},[s,o]);if(p.useEffect(()=>{v.current=new Set(f?.tasks.map(k=>k.id)??[])},[f]),p.useEffect(()=>{if(!s)return;T(o0(s)),(async()=>{m(!0),await E(),m(!1)})()},[s,E,T]),p.useEffect(()=>{if(!s)return;const k=Cn(c0,{transports:["websocket","polling"],withCredentials:!0});k.on("connect",()=>{k.emit("threads.subscribe",{threadId:s}),E()}),k.on(_l.THREAD_UPDATED,O=>{O.payload.id===s&&E()}),k.on(_l.THREAD_TITLE_UPDATED,O=>{O.payload.threadId===s&&E()});const w=Cn(u0,{transports:["websocket","polling"],withCredentials:!0});w.on("connect",()=>{w.emit("tasks.subscribe",{}),E()});const N=O=>{v.current.has(O)&&E()};return w.on(un.TASK_UPDATED,O=>{N(O.payload.id)}),w.on(un.TASK_STATUS_CHANGED,O=>{N(O.payload.id)}),w.on(un.TASK_ASSIGNED,O=>{N(O.payload.id)}),w.on(un.TASK_DELETED,O=>{N(O.payload.taskId)}),()=>{k.emit("threads.unsubscribe",{threadId:s}),k.close(),w.emit("tasks.unsubscribe",{}),w.close()}},[s,E]),p.useEffect(()=>{if(!f){r("Thread");return}r(f.title)},[f,r]),g)return a.jsx("div",{className:"thread-detail-page",children:a.jsx(se,{spacing:"4",align:"center",children:a.jsx(S,{size:"3",tone:"muted",children:"Loading..."})})});if(x||!f)return a.jsx("div",{className:"thread-detail-page",children:a.jsxs(se,{spacing:"4",align:"center",children:[a.jsx(S,{size:"3",tone:"muted",children:x||"Thread not found"}),a.jsx(ce,{variant:"secondary",onClick:()=>n("/threads"),children:"Back to threads"})]})});const j=async()=>{await c(f.id),n("/threads")};return d?a.jsx(h0,{thread:f,onDelete:j}):a.jsx(f0,{thread:f,onDelete:j})}function h0({thread:s,onDelete:n}){const[r,o]=p.useState(!0),c=yv(s),d=xv(s);return a.jsxs("div",{className:"thread-detail-page thread-detail-page--desktop",children:[a.jsx("div",{className:"thread-detail-page__main",children:a.jsxs("div",{className:"thread-detail-page__content",children:[a.jsx("div",{className:"thread-detail-page__header",children:a.jsx("div",{className:"thread-detail-page__header-top",children:a.jsxs("div",{children:[a.jsx(S,{size:"5",weight:"bold",children:s.title}),a.jsxs("div",{className:"thread-detail-page__meta-row",children:[a.jsxs(ws,{color:"gray",children:["#",s.id.slice(0,6)]}),a.jsxs(S,{size:"1",tone:"muted",children:[s.participants.length," participants"]})]})]})})}),a.jsx("div",{className:"thread-detail-page__chat",children:a.jsx(gv,{threadId:s.id})})]})}),a.jsxs("div",{className:`thread-detail-page__sidebar ${r?"":"thread-detail-page__sidebar--collapsed"}`,children:[r&&a.jsxs("div",{className:"thread-detail-page__sidebar-scroll",children:[s.participants.length>0&&a.jsxs("div",{className:"thread-detail-page__sidebar-section",children:[a.jsxs(S,{size:"2",weight:"semibold",className:"thread-detail-page__sidebar-header",children:["Participants (",s.participants.length,")"]}),a.jsx("div",{className:"thread-detail-page__participants",children:s.participants.map(f=>a.jsxs("div",{className:"thread-detail-page__participant",children:[a.jsx($e,{name:f.displayName,size:"sm",src:f.avatarUrl||void 0}),a.jsxs("div",{className:"thread-detail-page__participant-text",children:[a.jsx(S,{size:"2",weight:"medium",children:f.displayName}),a.jsxs(S,{size:"1",tone:"muted",children:["@",f.slug]})]})]},f.id))})]}),c.map(f=>a.jsxs("div",{className:"thread-detail-page__sidebar-section",children:[a.jsxs(S,{size:"2",weight:"semibold",className:"thread-detail-page__sidebar-header",children:[f.label," (",f.tasks.length,")"]}),a.jsx("div",{className:"thread-detail-page__sidebar-content",children:f.tasks.map(y=>a.jsx(JC,{task:y},y.id))})]},f.status)),d.length>0&&a.jsxs("div",{className:"thread-detail-page__sidebar-section",children:[a.jsxs(S,{size:"2",weight:"semibold",className:"thread-detail-page__sidebar-header",children:["Context (",d.length,")"]}),a.jsx("div",{className:"thread-detail-page__sidebar-content",children:d.map(f=>a.jsx(pv,{contextBlock:f,isStateMemory:f.isStateMemory},`${f.id}-${f.isStateMemory?"state":"reference"}`))})]}),s.tasks.length===0&&d.length===0&&a.jsx("div",{className:"thread-detail-page__sidebar-empty",children:a.jsx(S,{size:"2",tone:"muted",children:"No context or tasks attached"})}),a.jsx("div",{className:"thread-detail-page__sidebar-section thread-detail-page__sidebar-delete",children:a.jsx("div",{className:"thread-detail-page__sidebar-content thread-detail-page__sidebar-content--centered",children:a.jsx(Cl,{className:"thread-detail-page__delete-actions",onDelete:n,size:"md",deleteLabel:"Delete thread",confirmLabel:"Delete forever"})})})]}),a.jsx("button",{className:"thread-detail-page__sidebar-toggle",onClick:()=>o(f=>!f),"aria-label":r?"Collapse details panel":"Expand details panel",children:r?"→":"←"})]})]})}function f0({thread:s,onDelete:n}){const r=ze(),o=yv(s),c=xv(s),d=d0(s),[f,y]=p.useState("chat");return a.jsx("div",{className:"thread-detail-page thread-detail-page--mobile",children:a.jsxs("div",{className:"thread-detail-page__mobile-content",children:[a.jsxs("div",{className:"thread-detail-page__mobile-topbar",children:[a.jsxs("div",{className:"thread-detail-page__mobile-thread-meta",children:[a.jsx(S,{size:"2",weight:"semibold",children:s.title}),a.jsxs(S,{size:"1",tone:"muted",children:["#",s.id.slice(0,6)," · ",s.participants.length," participants"]})]}),a.jsxs("div",{className:"thread-detail-page__mobile-view-toggle",role:"tablist","aria-label":"Thread mobile views",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":f==="chat",className:`thread-detail-page__mobile-tab ${f==="chat"?"thread-detail-page__mobile-tab--active":""}`,onClick:()=>y("chat"),children:"Chat"}),a.jsx("button",{type:"button",role:"tab","aria-selected":f==="details",className:`thread-detail-page__mobile-tab ${f==="details"?"thread-detail-page__mobile-tab--active":""}`,onClick:()=>y("details"),children:"Details"})]})]}),a.jsxs("div",{className:"thread-detail-page__mobile-insights",children:[a.jsxs("button",{type:"button",className:"thread-detail-page__mobile-insight-card",onClick:()=>y("details"),children:[a.jsx(S,{size:"1",tone:"muted",children:"Tasks"}),a.jsx(S,{size:"3",weight:"bold",children:s.tasks.length})]}),a.jsxs("button",{type:"button",className:"thread-detail-page__mobile-insight-card",onClick:()=>y("details"),children:[a.jsx(S,{size:"1",tone:"muted",children:"Context blocks"}),a.jsx(S,{size:"3",weight:"bold",children:c.length})]})]}),d.length>0&&a.jsx("div",{className:"thread-detail-page__mobile-status-strip",children:d.map(g=>a.jsxs("button",{type:"button",className:"thread-detail-page__mobile-status-chip",onClick:()=>y("details"),children:[a.jsx(S,{size:"1",children:g.label}),a.jsx(S,{size:"1",weight:"semibold",children:g.count})]},g.status))}),f==="chat"&&a.jsx("div",{className:"thread-detail-page__mobile-chat-shell",children:a.jsx(gv,{threadId:s.id})}),f==="details"&&a.jsxs(a.Fragment,{children:[o.map(g=>a.jsx("div",{className:"thread-detail-page__mobile-section",children:a.jsx(pe,{title:g.label,children:g.tasks.map(m=>a.jsx(WC,{task:m,onClick:()=>r(`/tasks/task/${m.id}`)},m.id))})},g.status)),c.length>0&&a.jsxs("div",{className:"thread-detail-page__mobile-section",children:[a.jsxs(S,{size:"2",weight:"semibold",children:["Context (",c.length,")"]}),a.jsx("div",{className:"thread-detail-page__mobile-list",children:c.map(g=>a.jsx(pv,{contextBlock:g,isStateMemory:g.isStateMemory},`${g.id}-${g.isStateMemory?"state":"reference"}`))})]}),s.participants.length>0&&a.jsxs("div",{className:"thread-detail-page__mobile-section",children:[a.jsxs(S,{size:"2",weight:"semibold",children:["Participants (",s.participants.length,")"]}),a.jsx("div",{className:"thread-detail-page__mobile-list",children:s.participants.map(g=>a.jsxs(S,{size:"2",children:[g.displayName," (@",g.slug,")"]},g.id))})]}),a.jsx(Cl,{className:"thread-detail-page__actions",onDelete:n,size:"sm",deleteLabel:"Delete thread",confirmLabel:"Delete forever"})]}),f==="chat"&&a.jsx("div",{className:"thread-detail-page__mobile-jump-row",children:a.jsx(ce,{variant:"secondary",onClick:()=>y("details"),children:"View tasks and context"})})]})})}function p0(){return a.jsx(QC,{children:a.jsx(ts,{children:a.jsxs(xe,{element:a.jsx(ZC,{}),children:[a.jsx(xe,{index:!0,element:a.jsx(XC,{})}),a.jsx(xe,{path:"/:id",element:a.jsx(mo,{})}),a.jsx(xe,{path:"/:id/dashboard",element:a.jsx(mo,{})}),a.jsx(xe,{path:"/:id/tasks",element:a.jsx(mo,{})}),a.jsx(xe,{path:"/:id/context",element:a.jsx(mo,{})})]})})})}const g0=window.location.origin,vv=new Gn({baseUrl:g0,credentials:"include"}),Zn=vv.tools,m0=vv.authorizationJourneys,y0="http://localhost:3000/mcp",x0="npx",v0=["-y","@modelcontextprotocol/server-memory"],b0=s=>s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"new-tool",S0=(s,n)=>{const r=new Set(n.map(d=>d.providedId));if(!r.has(s))return s;let o=2,c=`${s}-${o}`;for(;r.has(c);)o+=1,c=`${s}-${o}`;return c},_0=()=>{const[s,n]=p.useState(!1),[r,o]=p.useState(null),[c,d]=p.useState([]);p.useEffect(()=>{y()},[]);const f=k=>[...k].sort((w,N)=>{const O=new Date(w.updatedAt).getTime();return new Date(N.updatedAt).getTime()-O}),y=async()=>{n(!0),o(null);try{const k=await Zn.McpRegistryController_listServers({});d(f(k.items||[]))}catch(k){o(k instanceof Error?k.message:"Failed to load tools")}finally{n(!1)}},g=p.useCallback(async k=>{n(!0),o(null);try{return await Zn.McpRegistryController_getServer({serverId:k})}catch(w){return o(w instanceof Error?w.message:"Failed to load tool details"),null}finally{n(!1)}},[]),m=p.useCallback(async k=>{try{return await Zn.McpRegistryController_listScopes({serverId:k})}catch(w){return console.error("Failed to load scopes:",w),[]}},[]),x=p.useCallback(async k=>{console.log(`loading clients for server ${k}`);try{const w=await Zn.McpRegistryController_listConnections({serverId:k});return console.log(`clients: ${w}`),w}catch(w){return console.error("Failed to load clients:",w),[]}},[]),_=p.useCallback(async k=>{console.log(`loading authorizations for server ${k}`);try{const w=await m0.AuthJourneysController_getAuthJourneys({serverId:k});return console.log("authorizations:",w),w}catch(w){return console.error("Failed to load authorizations:",w),[]}},[]),v=p.useCallback(async k=>{n(!0),o(null);try{return await Zn.McpRegistryController_getConnection({connectionId:k})}catch(w){return o(w instanceof Error?w.message:"Failed to load client details"),null}finally{n(!1)}},[]),T=async k=>{n(!0),o(null);try{const w=b0(k.name),O={providedId:S0(w,c),name:k.name,description:`New ${k.type.toUpperCase()} MCP server`,type:k.type,...k.type==="http"?{url:y0}:{cmd:x0,args:[...v0]}},G=await Zn.McpRegistryController_createServer({body:O});return d(q=>f([...q,G])),G}catch(w){throw o(w instanceof Error?w.message:"Failed to create tool"),w}finally{n(!1)}},E=p.useCallback(async(k,w)=>{n(!0),o(null);try{const N=await Zn.McpRegistryController_updateServer({serverId:k,body:w});return d(O=>{const G=O.map(q=>q.id===k?N:q);return f(G)}),N}catch(N){return o(N instanceof Error?N.message:"Failed to update tool"),null}finally{n(!1)}},[]),j=p.useCallback(async k=>{n(!0),o(null);try{return await Zn.McpRegistryController_deleteServer({serverId:k}),d(w=>w.filter(N=>N.id!==k)),!0}catch(w){return o(w instanceof Error?w.message:"Failed to delete tool"),!1}finally{n(!1)}},[]);return{isLoading:s,error:r,tools:c,loadTools:y,loadToolDetails:g,loadToolScopes:m,loadToolClients:x,loadToolAuthorizations:_,loadClientDetails:v,createTool:T,updateTool:E,deleteTool:j}},bv=p.createContext(null);function T0({children:s}){const{tools:n,isLoading:r,error:o,loadToolDetails:c,loadToolScopes:d,loadToolClients:f,loadToolAuthorizations:y,loadClientDetails:g,createTool:m,updateTool:x,deleteTool:_}=_0(),[v,T]=p.useState(""),E=p.useMemo(()=>({tools:n,isLoading:r,error:o,sectionTitle:v,setSectionTitle:T,loadToolDetails:c,loadToolScopes:d,loadToolClients:f,loadToolAuthorizations:y,loadClientDetails:g,createTool:m,updateTool:x,deleteTool:_}),[n,r,o,v,T,c,d,f,y,g,m,x,_]);return a.jsx(bv.Provider,{value:E,children:s})}function Qr(){const s=p.useContext(bv);if(!s)throw new Error("useToolsCtx must be used within <ToolsProvider>");return s}function j0({onCancel:s,onSave:n,error:r}){const[o,c]=p.useState(""),[d,f]=p.useState("http"),y=p.useRef(null);p.useEffect(()=>{y.current?.focus()},[]);const g=p.useMemo(()=>o.trim().length>0,[o]),m=async()=>g?n({name:o.trim(),type:d}):!1;return a.jsxs(dt,{title:"Create a Tool",onCancel:s,onSave:m,children:[a.jsx("div",{className:"new-tool-pop__group",children:a.jsx("input",{className:"new-tool-pop__input",ref:y,placeholder:"Tool name",value:o,onChange:x=>c(x.target.value)})}),r?a.jsx("p",{className:"new-tool-pop__error",children:r}):null,a.jsxs("div",{className:"new-tool-pop__group",children:[a.jsx("label",{className:"new-tool-pop__label",htmlFor:"new-tool-transport-type",children:"Transport type"}),a.jsxs("select",{id:"new-tool-transport-type",className:"new-tool-pop__select",value:d,onChange:x=>f(x.target.value),children:[a.jsx("option",{value:"http",children:"HTTP"}),a.jsx("option",{value:"stdio",children:"STDIO"})]})]})]})}function w0(){const{tools:s,setSectionTitle:n,isLoading:r,error:o,createTool:c}=Qr(),d=ze(),f=bt(),[y,g]=p.useState(!1),[m,x]=p.useState(null);if(qt(),p.useEffect(()=>{n("All Tools")},[n]),r&&s.length===0)return a.jsx(pe,{children:a.jsx(ge,{leading:a.jsx($e,{name:"...",size:"lg"}),children:a.jsx(S,{tone:"muted",children:"Loading tools..."})})});if(o&&s.length===0)return a.jsx(pe,{children:a.jsx(ge,{leading:a.jsx($e,{name:"!",size:"lg"}),children:a.jsxs(S,{tone:"muted",children:["Error: ",o]})})});const _=()=>{g(!1),x(null)},v=async({name:T,type:E})=>{x(null);try{const j=await c({name:T,type:E});return j?(d(`/tools/tool/${j.id}`),!0):!1}catch(j){const k=j?.body?.detail??j?.message??"Failed to create tool";return x(k),!1}};return a.jsxs(a.Fragment,{children:[a.jsx(pe,{children:s.length===0?a.jsx(ge,{leading:a.jsx($e,{name:"?",size:"lg"}),children:a.jsx(S,{tone:"muted",children:"No tools found"})}):s.map(T=>a.jsx(E0,{tool:T,onClick:()=>d(`/tools/tool/${T.id}`)},T.id))}),a.jsx("button",{className:`tools-fab ${f?"tools-fab--desktop":""}`,type:"button",onClick:()=>g(!0),"aria-label":"Create new tool",children:f?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"tools-fab__plus",children:"+"}),a.jsx("span",{className:"tools-fab__label",children:"New tool"})]}):"+"}),y?a.jsx(j0,{onCancel:_,onSave:v,error:m}):null]})}function E0({tool:s,onClick:n}){const r=[{label:"MCP Server",color:"blue"}];return s.type==="http"?r.push({label:"remote",color:"green"}):r.push({label:"stdio",color:"orange"}),a.jsxs(ge,{leading:a.jsx($e,{name:s.name,size:"lg"}),topRight:Ct(s.updatedAt),tags:r,onClick:n,children:[a.jsx(S,{className:"pre",style:"mono",tone:"muted",children:s.providedId}),a.jsx(S,{weight:"bold",size:"3",tone:"default",children:s.name}),a.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.jsx(S,{tone:"muted",size:"2",children:s.description||"No description"})})]})}function k0(){const s=bt(),{sectionTitle:n}=Qr(),r=[];return a.jsx("div",{style:{minHeight:0},children:s?a.jsx(Ra,{sectionTitle:n,children:a.jsx(Ot,{})}):a.jsx(za,{appTitle:"Tools",sectionTitle:n,navItems:r,children:a.jsx(Ot,{})})})}function C0({initialValue:s,onCancel:n,onSave:r}){const[o,c]=p.useState(s),d=p.useRef(null);p.useEffect(()=>{d.current?.focus()},[]);async function f(){return o.trim()?r({name:o.trim()}):!1}return a.jsx(dt,{title:"Edit Tool Name",onCancel:n,onSave:f,children:a.jsx(a.Fragment,{children:a.jsx("div",{className:"edit-tool-name-pop__input-wrapper",children:a.jsx("input",{type:"text",className:"edit-tool-name-pop__input",ref:d,placeholder:"Enter tool name...",value:o,onChange:y=>c(y.target.value)})})})})}const Yy=s=>{s&&(s.style.height="auto",s.style.height=`${s.scrollHeight}px`)};function N0({initialValue:s,onCancel:n,onSave:r}){const[o,c]=p.useState(s),d=p.useRef(null);p.useEffect(()=>{d.current?.focus()},[]),p.useEffect(()=>{Yy(d.current)},[o]);function f(g){c(g.target.value),Yy(g.target)}async function y(){return r({description:o})}return a.jsx(dt,{title:"Edit Tool Description",onCancel:n,onSave:y,children:a.jsx(a.Fragment,{children:a.jsx("div",{className:"edit-tool-description-pop__input-wrapper",children:a.jsx("textarea",{className:"edit-tool-description-pop__input",ref:d,placeholder:"Enter description...",value:o,onChange:f})})})})}function A0({initialValue:s,onCancel:n,onSave:r}){const[o,c]=p.useState(s),d=p.useRef(null);p.useEffect(()=>{d.current?.focus()},[]);async function f(){return o.trim()?r({url:o.trim()}):!1}return a.jsx(dt,{title:"Edit Server URL",onCancel:n,onSave:f,children:a.jsx(a.Fragment,{children:a.jsx("div",{className:"edit-tool-url-pop__input-wrapper",children:a.jsx("input",{type:"url",className:"edit-tool-url-pop__input",ref:d,placeholder:"https://example.com/mcp",value:o,onChange:y=>c(y.target.value)})})})})}function R0({initialCmd:s,initialArgs:n,onCancel:r,onSave:o}){const[c,d]=p.useState(s),[f,y]=p.useState(n.join(`
|
|
71
|
-
`)),g=p.useRef(null);p.useEffect(()=>{g.current?.focus()},[]);async function m(){if(!c.trim())return!1;const x=f.split(`
|
|
72
|
-
`).map(_=>_.trim()).filter(_=>_.length>0);return o({cmd:c.trim(),args:x})}return a.jsx(dt,{title:"Edit Command",onCancel:r,onSave:m,children:a.jsx(a.Fragment,{children:a.jsx("div",{className:"edit-tool-command-pop__wrapper",children:a.jsxs(se,{spacing:"3",children:[a.jsxs("div",{children:[a.jsx(S,{size:"2",weight:"medium",children:"Command"}),a.jsx("input",{type:"text",className:"edit-tool-command-pop__input",ref:g,placeholder:"npx",value:c,onChange:x=>d(x.target.value)})]}),a.jsxs("div",{children:[a.jsx(S,{size:"2",weight:"medium",children:"Arguments (one per line)"}),a.jsx("textarea",{className:"edit-tool-command-pop__textarea",placeholder:`-y
|
|
73
|
-
@modelcontextprotocol/server-memory`,value:f,onChange:x=>y(x.target.value),rows:5})]})]})})})})}function z0({toolId:s,initialScopes:n,onCancel:r,onSave:o}){const[c,d]=p.useState(n),[f,y]=p.useState(""),[g,m]=p.useState(""),x=()=>{if(!f.trim()||!g.trim())return;const T={id:f.trim(),description:g.trim(),serverId:s,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};d([...c,T]),y(""),m("")},_=T=>{d(c.filter(E=>E.id!==T))};async function v(){const T=new Set(n.map(w=>w.id)),E=new Set(c.map(w=>w.id)),j=c.filter(w=>!T.has(w.id)).map(w=>({id:w.id,description:w.description})),k=n.filter(w=>!E.has(w.id)).map(w=>w.id);return o({scopesToCreate:j,scopesToDelete:k})}return a.jsx(dt,{title:"Edit Scopes",onCancel:r,onSave:v,children:a.jsx(a.Fragment,{children:a.jsx("div",{className:"edit-tool-scopes-pop__wrapper",children:a.jsxs(se,{spacing:"3",children:[a.jsxs("div",{children:[a.jsx(S,{size:"2",weight:"medium",children:"Current Scopes"}),c.length===0?a.jsx(S,{size:"2",tone:"muted",children:"No scopes configured"}):a.jsx("div",{className:"edit-tool-scopes-pop__scopes-list",children:c.map(T=>a.jsxs("div",{className:"edit-tool-scopes-pop__scope-item",children:[a.jsxs("div",{className:"edit-tool-scopes-pop__scope-info",children:[a.jsx(S,{size:"2",weight:"medium",style:"mono",children:T.id}),a.jsx(S,{size:"1",tone:"muted",children:T.description})]}),a.jsx(ce,{size:"sm",variant:"secondary",onClick:()=>_(T.id),children:"Remove"})]},T.id))})]}),a.jsxs("div",{children:[a.jsx(S,{size:"2",weight:"medium",children:"Add New Scope"}),a.jsxs("div",{className:"edit-tool-scopes-pop__new-scope",children:[a.jsx("input",{type:"text",className:"edit-tool-scopes-pop__input",placeholder:"Scope ID (e.g., tool:read)",value:f,onChange:T=>y(T.target.value)}),a.jsx("input",{type:"text",className:"edit-tool-scopes-pop__input",placeholder:"Description",value:g,onChange:T=>m(T.target.value)}),a.jsx(ce,{size:"sm",onClick:x,disabled:!f.trim()||!g.trim(),children:"Add Scope"})]})]})]})})})})}function D0(s){switch(s){case"AUTHORIZATION_CODE_EXCHANGED":return{color:"green",label:"Active"};case"USER_CONSENT_REJECTED":return{color:"red",label:"Rejected"};case"AUTHORIZATION_CODE_ISSUED":return{color:"blue",label:"Code Issued"};case"mcp_auth_flow_started":return{color:"yellow",label:"Flow Started"};case"mcp_auth_flow_completed":return{color:"blue",label:"MCP Auth Complete"};case"CONNECTIONS_FLOW_STARTED":return{color:"yellow",label:"Connecting"};case"CONNECTIONS_FLOW_COMPLETED":return{color:"blue",label:"Connected"};case"not_started":return{color:"gray",label:"Not Started"};default:return{color:"gray",label:s.replace(/_/g," ").toLowerCase()}}}function O0(){const{toolId:s}=Wt(),n=ze(),{tools:r,setSectionTitle:o,loadToolDetails:c,loadToolScopes:d,loadToolClients:f,loadToolAuthorizations:y,updateTool:g,deleteTool:m}=Qr(),{showError:x}=Dn(),_=r.find(Se=>Se.id===s),[v,T]=p.useState(_||null),[E,j]=p.useState([]),[k,w]=p.useState([]),[N,O]=p.useState([]),[G,q]=p.useState(!_),[A,D]=p.useState(!1),[U,H]=p.useState(null),[P,B]=p.useState(!1),[J,X]=p.useState(!1),[ee,ue]=p.useState(!1),[M,ne]=p.useState(!1),[fe,ke]=p.useState(!1),[Te,R]=p.useState(!1),K=v?.type==="http",re=v?.type==="stdio",$=Se=>{navigator.clipboard.writeText(Se),B(!0),setTimeout(()=>B(!1),1500)},ae=p.useRef(_?s??null:null);p.useEffect(()=>{if(!s)return;const Se=_;if(Se){T(Se),ae.current=s;return}ae.current!==s&&(ae.current=s,q(!0),c(s).then(Ce=>{T(Ce),q(!1)}))},[s,c]),p.useEffect(()=>{v&&s&&(v.type==="http"?(d(s).then(j),y(s).then(O)):(j([]),O([])),f(s).then(w))},[v,s,d,f,y]);const de=p.useMemo(()=>!v||v.type!=="stdio"?[]:[v.cmd,...v.args??[]].filter(Se=>!!Se),[v]),le=Se=>/^[a-zA-Z0-9._/@:=+-]+$/.test(Se)?Se:`"${Se.replace(/(["\\$`])/g,"\\$1")}"`,be=Se=>Se.map(Ce=>le(Ce)).join(" "),De=async({name:Se})=>{if(!v)return!1;try{const Ce=await g(v.id,{name:Se});return Ce?(T(Ce),X(!1),!0):!1}catch(Ce){return console.error("Failed to update name:",Ce),x(Ce),!1}},ot=async({description:Se})=>{if(!v)return!1;try{const Ce=await g(v.id,{description:Se});return Ce?(T(Ce),ue(!1),!0):!1}catch(Ce){return console.error("Failed to update description:",Ce),x(Ce),!1}},Gt=async({url:Se})=>{if(!v)return!1;try{const Ce=await g(v.id,{url:Se});return Ce?(T(Ce),ne(!1),!0):!1}catch(Ce){return console.error("Failed to update URL:",Ce),x(Ce),!1}},Pt=async({cmd:Se,args:Ce})=>{if(!v)return!1;try{const St=await g(v.id,{cmd:Se,args:Ce});return St?(T(St),ke(!1),!0):!1}catch(St){return console.error("Failed to update command:",St),x(St),!1}},Pn=async({scopesToCreate:Se,scopesToDelete:Ce})=>{if(!v)return!1;try{for(const Mt of Ce)await Zn.McpRegistryController_deleteScope({serverId:v.id,scopeId:Mt});Se.length>0&&await Zn.McpRegistryController_createScopes({serverId:v.id,body:Se});const St=await d(v.id);return j(St),R(!1),!0}catch(St){return console.error("Failed to update scopes:",St),x(St),!1}};if(p.useEffect(()=>{const Se=v?.url;if(!Se){H(null);return}const Ce=new AbortController;return(async()=>{try{const Mt=new URL(Se),en=new URL(`/.well-known/oauth-protected-resource${Mt.pathname}`,Mt.origin),On=await fetch(en.toString(),{signal:Ce.signal});if(!On.ok){H(null);return}const as=(await On.json()).authorization_servers?.[0];if(!as){H(null);return}const ks=new URL(as),_t=new URL(`${ks.origin}/.well-known/oauth-authorization-server${ks.pathname}`),Cs=await fetch(_t,{signal:Ce.signal});if(!Cs.ok){H(null);return}const Ns=await Cs.json();H(Ns)}catch(Mt){if(console.error(Mt),Mt.name==="AbortError")return;H(null)}})(),()=>{Ce.abort()}},[v?.url]),qt({tool:{name:v?.name}}),p.useEffect(()=>{if(!v){o("Tool");return}o(v.name)},[v,o]),G)return a.jsx("div",{className:"tool-detail-page",children:a.jsx(se,{spacing:"4",align:"center",children:a.jsx(S,{size:"3",tone:"muted",children:"Loading tool..."})})});if(!v)return a.jsx("div",{className:"tool-detail-page",children:a.jsxs(se,{spacing:"4",align:"center",children:[a.jsx(S,{size:"3",tone:"muted",children:"Tool not found"}),a.jsx(ce,{variant:"secondary",onClick:()=>n("/tools"),children:"Back to tools"})]})});const jt=[{label:"MCP Server",color:"blue"}];return v.type==="http"?jt.push({label:"remote",color:"green"}):jt.push({label:"stdio",color:"orange"}),a.jsxs("div",{className:"tool-detail-page",children:[a.jsx(pe,{className:"tool-detail-page__section",children:a.jsxs(ge,{leading:a.jsx($e,{name:v.name}),tags:jt,topRight:a.jsx(S,{size:"1",tone:"muted",children:Ct(v.updatedAt)}),children:[a.jsx(S,{as:"span",weight:"normal",tone:"muted",size:"3",children:`${v.providedId} `}),a.jsxs(S,{as:"span",tone:"muted",style:"mono",children:["#",v.id.slice(0,6)]}),a.jsx(S,{children:v.description}),U?a.jsxs(ge,{onClick:()=>D(!A),children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:"Auth Server Metadata"}),a.jsx(S,{size:"2",tone:"muted",children:A?"(tap to collapse)":"(tap to expand)"})]}),A&&a.jsx("div",{className:"tool-detail-page__metadata",children:a.jsx("pre",{children:JSON.stringify(U,null,2)})})]}):a.jsx(S,{tone:"muted",size:"2",children:"Authorization Server metadata not found"})]})}),a.jsx(pe,{title:"Name",className:"tool-detail-page__section",children:a.jsxs(ge,{onClick:()=>X(!0),children:[a.jsx(S,{size:"2",children:v.name}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),a.jsx(pe,{title:"Description",className:"tool-detail-page__section",children:a.jsxs(ge,{onClick:()=>ue(!0),children:[a.jsx(S,{size:"2",children:v.description}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),K&&v.url?a.jsx(pe,{title:"Server URL",className:"tool-detail-page__section",children:a.jsxs(ge,{onClick:()=>ne(!0),children:[a.jsx(S,{as:"div",size:"2",style:"mono",className:"tool-detail-page__url",children:v.url}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}):null,re&&a.jsx(pe,{title:"Command",className:"tool-detail-page__section",children:a.jsxs(ge,{onClick:()=>ke(!0),children:[a.jsx(S,{size:"2",style:"mono",children:v.cmd}),v.args&&v.args.length>0&&a.jsxs(S,{size:"2",tone:"muted",style:"mono",children:["Args: ",v.args.join(" ")]}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),K&&v.url&&a.jsxs(pe,{title:"Configure",className:"tool-detail-page__section",children:[a.jsxs(ge,{onClick:()=>$(`npx @modelcontextprotocol/inspector --transport http --server-url ${v.url}`),children:[a.jsx(S,{weight:"medium",size:"3",children:"Inspector Command"}),a.jsx(S,{size:"2",tone:"muted",children:"Run this command to start the MCP inspector:"}),a.jsxs(S,{as:"div",style:"mono",children:[`npx @modelcontextprotocol/inspector --transport http --server-url ${v.url}`,a.jsx(S,{size:"1",tone:"muted",children:"tap to copy"})]})]}),a.jsxs(ge,{onClick:()=>$(`codex mcp add ${v.providedId} --url ${v.url}`),children:[a.jsx(S,{weight:"medium",size:"3",children:"Codex"}),a.jsx(S,{size:"2",tone:"muted",children:"Run this command to add this MCP server to Codex:"}),a.jsxs(S,{as:"div",style:"mono",children:[`codex mcp add ${v.providedId} --url ${v.url}`,a.jsx(S,{size:"1",tone:"muted",children:"tap to copy"})]})]}),a.jsxs(ge,{onClick:()=>$(`claude mcp add ${v.providedId} --transport http ${v.url}`),children:[a.jsx(S,{weight:"medium",size:"3",children:"Claude Code"}),a.jsxs(S,{as:"div",style:"mono",children:[`claude mcp add ${v.providedId} --transport http ${v.url}`,a.jsx(S,{size:"1",tone:"muted",children:"tap to copy"})]})]})]}),re&&de.length>0&&a.jsxs(pe,{title:"Configure",className:"tool-detail-page__section",children:[a.jsxs(ge,{onClick:()=>$(be(["npx","@modelcontextprotocol/inspector","--transport","stdio",...de])),children:[a.jsx(S,{weight:"medium",size:"3",children:"Inspector Command"}),a.jsx(S,{size:"2",tone:"muted",children:"Run this command to start the MCP inspector:"}),a.jsxs(S,{style:"mono",children:[be(["npx","@modelcontextprotocol/inspector","--transport","stdio",...de]),a.jsx(S,{size:"1",tone:"muted",children:"tap to copy"})]})]}),a.jsxs(ge,{onClick:()=>$(be(["codex","mcp","add",v.providedId,...de])),children:[a.jsx(S,{weight:"medium",size:"3",children:"Codex"}),a.jsxs(S,{style:"mono",children:[be(["codex","mcp","add",v.providedId,...de]),a.jsx(S,{size:"1",tone:"muted",children:"tap to copy"})]})]}),a.jsxs(ge,{onClick:()=>$(be(["claude","mcp","add",v.providedId,"--",...de])),children:[a.jsx(S,{weight:"medium",size:"3",children:"Claude Code"}),a.jsxs(S,{style:"mono",children:[be(["claude","mcp","add",v.providedId,"--",...de]),a.jsx(S,{size:"1",tone:"muted",children:"tap to copy"})]})]})]}),K&&a.jsx(pe,{title:"Scopes",className:"tool-detail-page__section",children:a.jsxs(ge,{onClick:()=>R(!0),children:[E.length>0?a.jsx(se,{spacing:"1",children:E.map(Se=>a.jsxs("div",{children:[a.jsx(S,{size:"2",style:"mono",weight:"medium",children:Se.id}),a.jsx(S,{size:"2",tone:"muted",children:Se.description})]},Se.id))}):a.jsx(S,{tone:"muted",size:"2",children:"No scopes configured"}),a.jsx(S,{size:"1",tone:"muted",children:"tap to edit"})]})}),re&&a.jsx(S,{tone:"muted",size:"2",children:"STDIO servers do not expose OAuth scopes."}),K&&a.jsx(pe,{title:"Authorizations",className:"tool-detail-page__section",children:N.length===0?a.jsx(ge,{children:a.jsx(S,{tone:"muted",size:"2",children:"No active authorizations"})}):[...N].sort((Se,Ce)=>new Date(Ce.updatedAt).getTime()-new Date(Se.updatedAt).getTime()).map(Se=>{const Ce=D0(Se.status),St=Ct(Se.updatedAt);return a.jsxs(ge,{children:[a.jsx(S,{weight:"medium",size:"3",children:Se.mcpAuthorizationFlow.clientName||"Unknown Client"}),Se.actor&&a.jsxs(S,{size:"2",tone:"muted",children:["@",Se.actor.slug," updated ",St]}),a.jsx("div",{style:{marginTop:"4px"},children:a.jsx(ws,{color:Ce.color,children:Ce.label})})]},Se.id)})}),a.jsx(Cl,{className:"tool-detail-page__actions",onDelete:async()=>{await m(v.id)?n("/tools"):x("Failed to delete tool")}}),a.jsx(pe,{className:"tool-detail-page__actions",children:a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>n("/tools"),children:"Back to Tools"})}),a.jsx("div",{className:`tool-detail-page__toast ${P?"tool-detail-page__toast--visible":""}`,children:"Copied!"}),J&&v&&a.jsx(C0,{initialValue:v.name,onCancel:()=>X(!1),onSave:De}),ee&&v&&a.jsx(N0,{initialValue:v.description,onCancel:()=>ue(!1),onSave:ot}),M&&v&&K&&v.url&&a.jsx(A0,{initialValue:v.url,onCancel:()=>ne(!1),onSave:Gt}),fe&&v&&re&&a.jsx(R0,{initialCmd:v.cmd||"",initialArgs:v.args||[],onCancel:()=>ke(!1),onSave:Pt}),Te&&v&&K&&a.jsx(z0,{toolId:v.id,initialScopes:E,onCancel:()=>R(!1),onSave:Pn})]})}function L0(){const{toolId:s}=Wt(),n=ze(),{tools:r,setSectionTitle:o,loadToolDetails:c,loadToolClients:d}=Qr(),f=r.find(T=>T.id===s),[y,g]=p.useState(f||null),[m,x]=p.useState([]),[_,v]=p.useState(!0);return p.useEffect(()=>{!f&&s?c(s).then(g):f&&g(f)},[s,f,c]),p.useEffect(()=>{s&&(v(!0),d(s).then(T=>{const E=[...T].sort((j,k)=>new Date(k.updatedAt).getTime()-new Date(j.updatedAt).getTime());x(E),v(!1)}))},[s,d]),p.useEffect(()=>{o(y?`${y.name} Clients`:"Clients")},[y,o]),_?a.jsx(pe,{children:a.jsx(ge,{leading:a.jsx($e,{name:"...",size:"lg"}),children:a.jsx(S,{tone:"muted",children:"Loading clients..."})})}):m.length===0?a.jsxs("div",{className:"clients-page",children:[a.jsx(pe,{children:a.jsx(ge,{leading:a.jsx($e,{name:"?",size:"lg"}),children:a.jsx(S,{tone:"muted",children:"No clients found for this tool"})})}),a.jsx(pe,{className:"clients-page__actions",children:a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>n(`/tools/tool/${s}`),children:"Back to Tool"})})]}):a.jsxs("div",{className:"clients-page",children:[a.jsx(pe,{children:m.map(T=>a.jsx(q0,{client:T,onClick:()=>n(`/tools/tool/${s}/clients/${T.id}`)},T.id))}),a.jsx(pe,{className:"clients-page__actions",children:a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>n(`/tools/tool/${s}`),children:"Back to Tool"})})]})}function q0({client:s,onClick:n}){const r=M0(s);return a.jsxs(ge,{leading:a.jsx($e,{name:s.friendlyName,size:"lg"}),topRight:Ct(s.updatedAt),tags:r,onClick:n,children:[a.jsx(S,{className:"pre",style:"mono",tone:"muted",children:s.clientId}),a.jsx(S,{weight:"bold",size:"3",tone:"default",children:s.friendlyName}),a.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.jsx(S,{tone:"muted",size:"2",children:s.authorizeUrl})})]})}function M0(s){const n=[];return s.authorizeUrl&&s.tokenUrl?n.push({label:"OAuth Ready",color:"green"}):n.push({label:"Incomplete",color:"orange"}),s.clientSecret&&n.push({label:"Secret Set",color:"blue"}),n}function B0(){const{toolId:s,clientId:n}=Wt(),r=ze(),{tools:o,setSectionTitle:c,loadToolDetails:d,loadClientDetails:f}=Qr(),y=o.find(j=>j.id===s),[g,m]=p.useState(y||null),[x,_]=p.useState(null),[v,T]=p.useState(!0);if(p.useEffect(()=>{!y&&s?d(s).then(m):y&&m(y)},[s,y,d]),p.useEffect(()=>{n&&(T(!0),f(n).then(j=>{_(j),T(!1)}))},[n,f]),p.useEffect(()=>{if(!x){c("Client");return}c(x.friendlyName)},[x,c]),v)return a.jsx("div",{className:"client-detail-page",children:a.jsx(se,{spacing:"4",align:"center",children:a.jsx(S,{size:"3",tone:"muted",children:"Loading client..."})})});if(!x)return a.jsx("div",{className:"client-detail-page",children:a.jsxs(se,{spacing:"4",align:"center",children:[a.jsx(S,{size:"3",tone:"muted",children:"Client not found"}),a.jsx(ce,{variant:"secondary",onClick:()=>r(`/tools/tool/${s}/clients`),children:"Back to clients"})]})});const E=U0(x);return a.jsxs("div",{className:"client-detail-page",children:[a.jsx(pe,{className:"client-detail-page__section",children:a.jsxs(ge,{leading:a.jsx($e,{size:"sm",name:x.friendlyName}),tags:E,topRight:a.jsx(S,{size:"1",tone:"muted",children:Ct(x.updatedAt)}),children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:x.friendlyName}),a.jsx(S,{as:"span",tone:"muted",style:"mono",children:` #${x.id.slice(0,6)}`})]})}),a.jsx(pe,{className:"client-detail-page__section",children:a.jsxs(ge,{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:"Client ID"}),a.jsx(S,{size:"2",style:"mono",className:"client-detail-page__value",children:x.clientId})]})}),a.jsx(pe,{className:"client-detail-page__section",children:a.jsxs(ge,{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:"Connection ID"}),a.jsx(S,{size:"2",style:"mono",className:"client-detail-page__value",children:x.id})]})}),a.jsx(pe,{className:"client-detail-page__section",children:a.jsxs(ge,{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:"Server ID"}),a.jsx(S,{size:"2",style:"mono",className:"client-detail-page__value",children:x.serverId})]})}),a.jsx(pe,{className:"client-detail-page__section",children:a.jsxs(ge,{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:"Authorization URL"}),a.jsx(S,{size:"2",style:"mono",className:"client-detail-page__value",children:x.authorizeUrl})]})}),a.jsx(pe,{className:"client-detail-page__section",children:a.jsxs(ge,{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:"Token URL"}),a.jsx(S,{size:"2",style:"mono",className:"client-detail-page__value",children:x.tokenUrl})]})}),a.jsx(pe,{className:"client-detail-page__section",children:a.jsxs(ge,{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:"Client Secret"}),a.jsx(S,{size:"2",tone:"muted",children:x.clientSecret?"Configured (hidden)":"Not configured"})]})}),a.jsx(pe,{className:"client-detail-page__section",children:a.jsxs(ge,{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:"Registration Date"}),a.jsx(S,{size:"2",tone:"muted",children:new Date(x.createdAt).toLocaleString()})]})}),a.jsx(pe,{className:"client-detail-page__section",children:a.jsxs(ge,{children:[a.jsx(S,{as:"span",weight:"medium",size:"3",children:"Last Updated"}),a.jsx(S,{size:"2",tone:"muted",children:new Date(x.updatedAt).toLocaleString()})]})}),a.jsxs(pe,{className:"client-detail-page__actions",children:[a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>r(`/tools/tool/${s}/clients`),children:"Back to Clients"}),a.jsx(ce,{size:"lg",variant:"secondary",onClick:()=>r(`/tools/tool/${s}`),children:"Back to Tool"})]})]})}function U0(s){const n=[];return s.authorizeUrl&&s.tokenUrl?n.push({label:"OAuth Ready",color:"green"}):n.push({label:"Incomplete",color:"orange"}),s.clientSecret&&n.push({label:"Secret Set",color:"blue"}),n}function I0(){return a.jsx(T0,{children:a.jsx(ts,{children:a.jsxs(xe,{element:a.jsx(k0,{}),children:[a.jsx(xe,{index:!0,element:a.jsx(w0,{})}),a.jsx(xe,{path:"/tool/:toolId",element:a.jsx(O0,{})}),a.jsx(xe,{path:"/tool/:toolId/clients",element:a.jsx(L0,{})}),a.jsx(xe,{path:"/tool/:toolId/clients/:clientId",element:a.jsx(B0,{})})]})})})}const H0=window.location.origin,$0=new Gn({baseUrl:H0,credentials:"include"}),G0=$0.authorizationServer,P0=()=>{console.log("useConsent mounting");const[s,n]=p.useState(null),[r,o]=p.useState(null),[c,d]=p.useState(!0),[f,y]=p.useState(null),[g,m]=p.useState(!1);return p.useEffect(()=>{console.log("useConsent setting message"),n("Message coming from useConsent")},[]),{message:s,setMessage:n,loadConsentMetadata:async v=>{if(v){d(!0),y(null);try{const T=await G0.AuthorizationController_getConsentMetadata({flowId:v});o(T)}catch(T){y(T instanceof Error?T.message:"Failed to load authorization details")}finally{d(!1)}}},consentMetadata:r,submitConsent:async(v,T,E)=>{m(!0),y(null);try{const j={flow_id:v,approved:E},k=Na||window.location.origin,w=document.createElement("form");w.method="POST",w.action=`${k}/api/v1/auth/authorize/mcp/${T}/0.0.0`,Object.entries(j).forEach(([N,O])=>{const G=document.createElement("input");G.type="hidden",G.name=N,G.value=String(O),w.appendChild(G)}),document.body.appendChild(w),w.submit()}catch(j){y(j instanceof Error?j.message:"Failed to submit consent decision"),m(!1)}},error:f,isApproving:g,isLoading:c}},Sv=p.createContext(null);function V0({children:s}){const{message:n,error:r,isLoading:o,isApproving:c,loadConsentMetadata:d,consentMetadata:f,submitConsent:y}=P0(),[g,m]=p.useState(""),x=p.useMemo(()=>({message:n,sectionTitle:g,setSectionTitle:m,loadConsentMetadata:d,consentMetadata:f,submitConsent:y,error:r,isLoading:o,isApproving:c}),[n,g,m,d,f,y,r,o,c]);return a.jsx(Sv.Provider,{value:x,children:s})}function _v(){const s=p.useContext(Sv);if(!s)throw new Error("useConsentCtx must be used within <ConsentProvider>");return s}function Y0(){const s=bt();console.log("Consent page mounting");const{setSectionTitle:n,loadConsentMetadata:r,submitConsent:o,consentMetadata:c,isLoading:d,isApproving:f,error:y}=_v(),[g]=Zd(),m=g.get("flow");if(!m)return a.jsx("div",{children:"whoops! missing flow id 👀"});p.useEffect(()=>{r(m)},[m]),p.useEffect(()=>{console.log("Consent page useEffect hook triggered"),console.log("setting section title"),n("🔐 Authorization request")},[]),p.useMemo(()=>!d&&!y&&c,[d,y,c]);const x=()=>{c&&o(m,j.providedId,!0)},_=()=>{c&&o(m,j.providedId,!1)};if(d)return a.jsxs("div",{children:[a.jsx("div",{className:"spinner"}),a.jsx("p",{children:"Loading authorization details..."})]});if(y||!c)return a.jsxs("div",{children:[a.jsx("h2",{children:"Authorization Error"}),a.jsx(An,{children:y||"Invalid authorization request"})]});const{client:v,scopes:T,redirectUri:E,server:j,resource:k,createdAt:w}=c;return a.jsxs("div",{className:"consent-page",children:[a.jsxs("div",{className:"consent-container",children:[s?a.jsxs("div",{className:"consent-header",children:[a.jsx("div",{className:"oauth-icon",children:"🔐"}),a.jsx("h1",{children:"Authorization Request"}),a.jsx("p",{className:"subtitle",children:"Review the following authorization request carefully"})]}):null,a.jsxs("div",{className:"consent-details",children:[a.jsxs(Qe,{className:"detail-section",children:[a.jsx("h2",{children:"WHO is requesting access"}),a.jsxs("div",{className:"client-info",children:[a.jsxs("div",{className:"info-row",children:[a.jsx("span",{className:"label",children:"Client Name:"}),a.jsx("span",{className:"value",children:v.clientName})]}),a.jsxs("div",{className:"info-row",children:[a.jsx("span",{className:"label",children:"Client ID:"}),a.jsx("span",{className:"value",children:a.jsx("code",{children:v.clientId})})]}),a.jsxs("div",{className:"info-row",children:[a.jsx("span",{className:"label",children:"Registered:"}),a.jsx("span",{className:"value",children:a.jsx("code",{children:new Date(w).toLocaleString()})})]})]})]}),a.jsxs(Qe,{className:"detail-section",children:[a.jsx("h2",{children:"WHAT access is requested"}),T&&T.length>0?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"scopes-list",children:T.map(N=>a.jsx(F0,{children:N},N))}),a.jsx("p",{style:{marginTop:"12px",fontSize:"13px",color:"#7f8c8d",marginBottom:0},children:"These permissions determine what the client can do on your behalf."})]}):a.jsx("p",{style:{fontSize:"13px",color:"#7f8c8d",marginBottom:0},children:"No specific permissions requested."})]}),a.jsxs(Qe,{className:"detail-section",children:[a.jsx("h2",{children:"WHERE access is granted"}),a.jsxs("div",{className:"server-info",children:[a.jsx("div",{className:"server-name",children:j.name}),a.jsxs("div",{className:"server-id",children:["Server ID: ",j.providedId]})]}),a.jsxs("div",{className:"resource-info",style:{marginTop:"16px"},children:[a.jsx("div",{style:{fontSize:"13px",color:"#7f8c8d",marginBottom:"8px"},children:"Resource:"}),a.jsx("code",{children:k})]})]}),a.jsxs(Qe,{className:"detail-section",children:[a.jsx("h2",{children:"Redirect Information"}),a.jsx("div",{className:"client-info",children:a.jsxs("div",{className:"info-row",children:[a.jsx("span",{className:"label",children:"Redirect URI:"}),a.jsx("span",{className:"value",children:a.jsx("code",{children:E})})]})}),a.jsx("p",{style:{marginTop:"12px",fontSize:"13px",color:"#7f8c8d",marginBottom:0},children:"After authorization, you will be redirected to this URL."})]})]})]}),y&&a.jsx(An,{children:y}),a.jsxs("div",{className:"consent-actions",children:[a.jsx(ce,{variant:"danger",onClick:_,disabled:f,children:"Deny"}),a.jsx(ce,{variant:"primary",onClick:x,disabled:f,children:f?"Approving...":"Approve"})]}),a.jsxs("div",{className:"consent-footer",children:[a.jsxs("p",{children:["By approving, you authorize ",a.jsx("strong",{children:c.client.clientName})," to access the specified resources with the requested permissions."]}),a.jsx(aa,{to:"/",children:"Home"})]})]})}function F0({children:s}){return a.jsx("span",{className:"scope-badge",children:s})}function Q0(){const s=bt(),{sectionTitle:n}=_v();return a.jsx(a.Fragment,{children:s?a.jsx(Ra,{sectionTitle:n,children:a.jsx(Ot,{})}):a.jsx(za,{appTitle:"Consent",sectionTitle:n,navItems:[],children:a.jsx(Ot,{})})})}function K0(){return a.jsx(V0,{children:a.jsx(ts,{children:a.jsx(xe,{element:a.jsx(Q0,{}),children:a.jsx(xe,{path:"/",element:a.jsx(Y0,{})})})})})}const X0=5e3,Z0=la("/tasks"),J0=()=>{const[s,n]=p.useState(!0),[r,o]=p.useState(!1),[c,d]=p.useState(null),[f,y]=p.useState(!1),[g,m]=p.useState([]),[x,_]=p.useState([]),[v,T]=p.useState([]),[E,j]=p.useState(null),k=p.useRef(!1),w=p.useCallback(async N=>{if(k.current)return;k.current=!0;const O=!r,G=N?.silent??!1;O?n(!0):G||y(!0);try{const[q,A,D]=await Promise.all([qr.TaskExecutionQueueController_listQueue(),qr.ActiveTaskExecutionController_listActiveExecutions(),qr.TaskExecutionHistoryController_listHistory()]);m(q),_(A.sort((U,H)=>H.claimedAt.localeCompare(U.claimedAt))),T(D.sort((U,H)=>H.transitionedAt.localeCompare(U.transitionedAt))),j(new Date().toISOString()),d(null)}catch(q){d(q instanceof Error?q.message:"Failed to load executions")}finally{k.current=!1,o(!0),n(!1),y(!1)}},[r]);return p.useEffect(()=>{w();const N=window.setInterval(()=>{w({silent:!0})},X0);return()=>window.clearInterval(N)},[w]),p.useEffect(()=>{const N=Cn(Z0,{transports:["websocket","polling"],withCredentials:!0});return N.on("connect",()=>{N.emit("tasks.subscribe",{},()=>{})}),N.on(un.TASK_ACTIVITY,O=>{O.kind.startsWith("execution.")&&w({silent:!0})}),()=>{N.close()}},[w]),{isLoading:s,isRefreshing:f,hasLoadedOnce:r,error:c,queue:g,active:x,history:v,loadExecutions:w,lastUpdatedAt:E}};function W0(){const s=ze(),{actors:n}=rh(),{queue:r,active:o,history:c,isLoading:d,isRefreshing:f,hasLoadedOnce:y,error:g,loadExecutions:m}=J0();qt();const x=p.useMemo(()=>c.filter(j=>j.status==="SUCCEEDED").length,[c]),_=c.length-x,[v,T]=p.useState(()=>new Set),E=j=>{T(k=>{const w=new Set(k);return w.has(j)?w.delete(j):w.add(j),w})};return a.jsxs("div",{className:"executions-page",children:[a.jsxs("div",{className:"executions-hero",children:[a.jsxs("div",{className:"executions-hero__copy",children:[a.jsx(S,{as:"div",size:"6",weight:"bold",children:"Runs"}),a.jsx(S,{as:"div",size:"3",tone:"muted",wrap:!0,children:"Queue, active work, and recent history in one place. The view refreshes automatically every 5 seconds."})]}),a.jsxs("div",{className:"executions-hero__actions",children:[a.jsx("span",{className:`executions-pill ${g?"executions-pill--danger":"executions-pill--success"}`,children:g?"Fetch failed":f?"Refreshing":"Polling"}),a.jsx(ce,{variant:"secondary",onClick:()=>void m(),disabled:f,children:"Refresh now"})]})]}),a.jsxs("div",{className:"executions-summary-grid",children:[a.jsx(yo,{label:"Queued",value:r.length,tone:"accent"}),a.jsx(yo,{label:"Active",value:o.length,tone:"warning"}),a.jsx(yo,{label:"Succeeded",value:x,tone:"success"}),a.jsx(yo,{label:"Failed",value:_,tone:"danger"})]}),d&&!y?a.jsx(Qe,{className:"executions-empty-card",children:a.jsx(S,{as:"div",size:"3",weight:"medium",children:"Loading executions…"})}):null,g?a.jsxs(Qe,{className:"executions-empty-card",children:[a.jsx(S,{as:"div",size:"3",weight:"medium",children:"Could not load executions"}),a.jsx(S,{as:"div",tone:"muted",wrap:!0,children:g})]}):null,y&&!g?a.jsxs("div",{className:"executions-sections",children:[a.jsx(bd,{title:"Queue",subtitle:"",count:r.length,emptyMessage:"Nothing is waiting in the queue.",table:a.jsx(Sd,{columns:["State","Task","Task status","Task ID"],rows:r.map(j=>({key:j.taskId,cells:[a.jsx(wa,{tone:"accent",children:"Queued"},"state"),a.jsx(_d,{taskId:j.taskId,taskName:j.taskName,onClick:()=>s(`/tasks/task/${j.taskId}`)},"task"),a.jsx(wa,{tone:Ed(j.taskStatus),children:j.taskStatus??"Unknown"},"status"),a.jsx(Td,{value:j.taskId},"id")],mobile:a.jsx(wd,{tone:"accent",title:j.taskName??"Untitled task",badge:"Queued",lines:[{label:"Task status",value:j.taskStatus??"Unknown"},{label:"Task ID",value:Hn(j.taskId),mono:!0}],onClick:()=>s(`/tasks/task/${j.taskId}`)},`queue-mobile-${j.taskId}`)}))})}),a.jsx(bd,{title:"Active",subtitle:"",count:o.length,emptyMessage:"No active executions right now.",table:a.jsx(Sd,{columns:["State","Task","Worker","Agent","Session","Tools","Claimed","Latest heartbeat","Before claim"],rows:o.map(j=>{const k=n.find(w=>w.id===j.agentActorId);return{key:j.id,cells:[a.jsx(wa,{tone:"warning",children:"Active"},"state"),a.jsx(_d,{taskId:j.taskId,taskName:j.taskName,onClick:()=>s(`/tasks/task/${j.taskId}`)},"task"),a.jsx(Td,{value:j.workerClientId},"worker"),a.jsx(Fy,{actorId:j.agentActorId,actorName:k?.displayName,actorSlug:k?.slug},"agent"),a.jsx(Qy,{value:j.runnerSessionId},"session"),a.jsx(Ky,{value:j.toolCallCount},"tool-count"),a.jsx(jd,{value:j.claimedAt},"claimed"),a.jsx(jd,{value:j.lastHeartbeatAt},"heartbeat"),a.jsx(wa,{tone:Ed(j.taskStatusBeforeClaim),children:j.taskStatusBeforeClaim},"before")],mobile:a.jsx(wd,{tone:"warning",title:j.taskName??"Untitled task",badge:"Active",lines:[{label:"Claimed",value:jo(j.claimedAt)},{label:"Latest heartbeat",value:jo(j.lastHeartbeatAt)},{label:"Worker",value:Hn(j.workerClientId),mono:!0},{label:"Agent",value:k?.slug?`@${k.slug}`:Hn(j.agentActorId),mono:!0},{label:"Session",value:Hd(j.runnerSessionId),mono:!0},{label:"Tool calls",value:String(j.toolCallCount)},{label:"Before claim",value:j.taskStatusBeforeClaim}],onClick:()=>s(`/tasks/task/${j.taskId}`)},`active-mobile-${j.id}`)}})})}),a.jsx(bd,{title:"History",subtitle:"",count:c.length,emptyMessage:"No historical executions yet.",table:a.jsx(Sd,{columns:["Result","Task","Transitioned","Task status","Agent","Worker","Session","Tools","Error"],rows:c.map(j=>{const k=n.find(w=>w.id===j.agentActorId);return{key:j.id,expandedContent:j.errorMessage&&v.has(j.id)?a.jsx(tN,{status:j.status,message:j.errorMessage}):null,cells:[a.jsx(wa,{tone:j.status==="SUCCEEDED"?"success":"danger",children:j.status},"result"),a.jsx(_d,{taskId:j.taskId,taskName:j.taskName,onClick:()=>s(`/tasks/task/${j.taskId}`)},"task"),a.jsx(jd,{value:j.transitionedAt},"transitioned"),a.jsx(wa,{tone:Ed(j.taskStatus),children:j.taskStatus??"Unknown"},"task-status"),a.jsx(Fy,{actorId:j.agentActorId,actorName:k?.displayName,actorSlug:k?.slug},"agent"),a.jsx(Td,{value:j.workerClientId},"worker"),a.jsx(Qy,{value:j.runnerSessionId},"session"),a.jsx(Ky,{value:j.toolCallCount},"tool-count"),a.jsx(eN,{errorCode:j.errorCode,errorMessage:j.errorMessage,expanded:v.has(j.id),onToggle:()=>E(j.id)},"error")],mobile:a.jsx(wd,{tone:j.status==="SUCCEEDED"?"success":"danger",title:j.taskName??"Untitled task",badge:j.status,lines:[{label:"Transitioned",value:jo(j.transitionedAt)},{label:"Task status",value:j.taskStatus??"Unknown"},{label:"Agent",value:k?.slug?`@${k.slug}`:Hn(j.agentActorId),mono:!0},{label:"Worker",value:Hn(j.workerClientId),mono:!0},{label:"Session",value:Hd(j.runnerSessionId),mono:!0},{label:"Tool calls",value:String(j.toolCallCount)},{label:"Error",value:j.errorCode??"None"},...j.errorMessage?[{label:"Message",value:j.errorMessage}]:[]],onClick:()=>s(`/tasks/task/${j.taskId}`)},`history-mobile-${j.id}`)}})})})]}):null]})}function yo({label:s,value:n,tone:r}){return a.jsxs(Qe,{className:`executions-summary-card executions-summary-card--${r}`,children:[a.jsx(S,{as:"div",size:"2",tone:"muted",weight:"medium",children:s}),a.jsx(S,{as:"div",size:"6",weight:"bold",children:n})]})}function bd({title:s,subtitle:n,count:r,emptyMessage:o,table:c}){return a.jsxs(Qe,{padding:"0",className:"executions-section-card",children:[a.jsxs("div",{className:"executions-section-card__header",children:[a.jsxs("div",{children:[a.jsx(S,{as:"div",size:"4",weight:"bold",children:s}),a.jsx(S,{as:"div",size:"2",tone:"muted",children:n})]}),a.jsx("span",{className:"executions-count-pill",children:r})]}),r===0?a.jsx("div",{className:"executions-section-card__empty",children:a.jsx(S,{as:"div",tone:"muted",children:o})}):c]})}function Sd({columns:s,rows:n}){return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"executions-table-wrap",children:a.jsxs("table",{className:"executions-table",children:[a.jsx("thead",{children:a.jsx("tr",{children:s.map(r=>a.jsx("th",{children:r},r))})}),a.jsx("tbody",{children:n.map(r=>a.jsxs(p.Fragment,{children:[a.jsx("tr",{children:r.cells.map((o,c)=>a.jsx("td",{children:o},`${r.key}-${c}`))}),r.expandedContent?a.jsx("tr",{className:"executions-table-detail-row",children:a.jsx("td",{colSpan:s.length,children:r.expandedContent})}):null]},r.key))})]})}),a.jsx("div",{className:"executions-mobile-list",children:n.map(r=>r.mobile)})]})}function wa({children:s,tone:n}){return a.jsx("span",{className:`executions-status-pill executions-status-pill--${n}`,children:s})}function _d({taskId:s,taskName:n,onClick:r}){return r?a.jsxs("button",{type:"button",className:"executions-task-cell executions-task-cell--clickable",onClick:r,"aria-label":`Navigate to task: ${n??"Untitled task"}`,children:[a.jsx(S,{as:"div",size:"2",weight:"semibold",children:n??"Untitled task"}),a.jsx(S,{as:"div",size:"1",tone:"muted",style:"mono",children:Hn(s)})]}):a.jsxs("div",{className:"executions-task-cell",children:[a.jsx(S,{as:"div",size:"2",weight:"semibold",children:n??"Untitled task"}),a.jsx(S,{as:"div",size:"1",tone:"muted",style:"mono",children:Hn(s)})]})}function Td({value:s}){return a.jsx(S,{as:"span",size:"1",style:"mono",className:"executions-code-copy",children:Hn(s)})}function Fy({actorId:s,actorName:n,actorSlug:r}){return a.jsxs("div",{className:"executions-actor-cell",children:[a.jsx(S,{as:"div",size:"2",weight:"semibold",children:n??Hn(s)}),a.jsx(S,{as:"div",size:"1",tone:"muted",style:"mono",className:"executions-actor-slug",children:r?`@${r}`:Hn(s)})]})}function eN({errorCode:s,errorMessage:n,expanded:r,onToggle:o}){const c=!!n;return a.jsxs("div",{className:"executions-error-cell",children:[a.jsx("span",{className:s?"executions-error-copy":"executions-muted-copy",children:s??"None"}),c?a.jsx("button",{type:"button",className:"executions-error-toggle",onClick:o,"aria-expanded":r,"aria-label":r?"Hide error message":"Show error message",title:r?"Hide error message":"Show error message",children:"!"}):null]})}function tN({status:s,message:n}){return a.jsxs("div",{className:"executions-error-detail",children:[a.jsx(S,{as:"div",size:"1",weight:"medium",tone:s==="CANCELLED"?"muted":"default",className:s==="CANCELLED"?void 0:"executions-error-detail__label",children:s==="CANCELLED"?"Cancellation message":"Failure message"}),a.jsx(S,{as:"div",size:"2",wrap:!0,children:n})]})}function jd({value:s}){return a.jsxs("div",{className:"executions-time-cell",children:[a.jsx(S,{as:"div",size:"2",children:jo(s)}),s?a.jsx(S,{as:"div",size:"1",tone:"muted",children:nN(s)}):null]})}function Qy({value:s}){return a.jsx(S,{as:"span",size:"1",style:"mono",className:"executions-code-copy",children:Hd(s)})}function Ky({value:s}){return a.jsx(S,{as:"span",size:"2",weight:"semibold",children:s})}function wd({title:s,badge:n,tone:r,lines:o,onClick:c}){const d=c?"executions-mobile-card executions-mobile-card--clickable":"executions-mobile-card",f=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"executions-mobile-card__header",children:[a.jsx(S,{as:"div",size:"3",weight:"semibold",wrap:!0,children:s}),a.jsx(wa,{tone:r,children:n})]}),a.jsx("div",{className:"executions-mobile-card__body",children:o.map(y=>a.jsxs("div",{className:"executions-mobile-card__row",children:[a.jsx(S,{as:"span",size:"1",tone:"muted",children:y.label}),a.jsx(S,{as:"span",size:"2",style:y.mono?"mono":"sans",className:y.label==="Error"&&y.value!=="None"?"executions-error-copy":"",children:y.value})]},`${n}-${y.label}`))})]});return c?a.jsx("button",{type:"button",className:d,onClick:c,"aria-label":`Navigate to task: ${s}`,children:f}):a.jsx("div",{className:d,children:f})}function Ed(s){switch(s){case"NOT_STARTED":return"accent";case"IN_PROGRESS":return"warning";case"FOR_REVIEW":return"warning";case"DONE":return"success";case null:return"neutral";default:return"neutral"}}function jo(s){return s?new Date(s).toLocaleString():"Never"}function nN(s){const n=Date.now()-new Date(s).getTime(),r=Math.max(0,Math.floor(n/1e3));if(r<60)return`${r}s ago`;const o=Math.floor(r/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Hn(s){return s.length>12?`${s.slice(0,8)}…${s.slice(-4)}`:s}function Hd(s){return s?Hn(s):"pending"}function sN(){const s=bt(),n="Runs",r=[];return a.jsx("div",{style:{minHeight:0},children:s?a.jsx(Ra,{sectionTitle:n,children:a.jsx(Ot,{})}):a.jsx(za,{appTitle:"Runs",sectionTitle:n,navItems:r,children:a.jsx(Ot,{})})})}function aN(){return a.jsx(ts,{children:a.jsx(xe,{element:a.jsx(sN,{}),children:a.jsx(xe,{index:!0,element:a.jsx(W0,{})})})})}function lN({children:s}){const{user:n,refreshAuth:r}=zn(),o=p.useRef(!1);return p.useEffect(()=>{o.current||!n||n.onboardingDisplayMode==="FULL_PAGE"&&(o.current=!0,eh.WalkthroughController_acknowledge().then(()=>r()).catch(console.error))},[n,r]),!o.current&&n?.onboardingDisplayMode==="FULL_PAGE"?a.jsx(Ca,{to:"/walkthrough",replace:!0}):a.jsx(a.Fragment,{children:s})}function rN(){return a.jsxs(ts,{children:[a.jsx(xe,{path:"/logout",element:a.jsx(WE,{})}),a.jsx(xe,{index:!0,element:a.jsx(Ca,{to:"home",replace:!0})}),a.jsx(xe,{path:"/consent",element:a.jsx(K0,{})}),a.jsx(xe,{path:"/*",element:a.jsx(eE,{})}),a.jsx(xe,{path:"/tasks/*",element:a.jsx(JE,{})}),a.jsx(xe,{path:"/context/*",element:a.jsx(pC,{})}),a.jsx(xe,{path:"/agents/*",element:a.jsx(VC,{})}),a.jsx(xe,{path:"/threads/*",element:a.jsx(p0,{})}),a.jsx(xe,{path:"/tools/*",element:a.jsx(I0,{})}),a.jsx(xe,{path:"/runs/*",element:a.jsx(aN,{})}),a.jsx(xe,{path:"/executions/*",element:a.jsx(Ca,{to:"/runs",replace:!0})})]})}function iN(){return a.jsx(gT,{basename:tE,children:a.jsx(wT,{children:a.jsx(Pj,{children:a.jsx(HT,{children:a.jsxs(kE,{children:[a.jsxs(ts,{children:[a.jsx(xe,{path:"/onboarding",element:a.jsx(ZT,{})}),a.jsx(xe,{path:"/login",element:a.jsx(ej,{children:a.jsx(KT,{})})}),a.jsx(xe,{path:"*",element:a.jsx(JT,{children:a.jsx(Hj,{children:a.jsx(lN,{children:a.jsx(nj,{children:a.jsx(rN,{})})})})})})]}),a.jsx(Vj,{})]})})})})})}YS.createRoot(document.getElementById("root")).render(a.jsx(BS.StrictMode,{children:a.jsx(iN,{})}));
|