@tea-agent/loop-agent 0.34.5 → 0.35.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/worker/console/static/assets/index-fsjzREob.js +56 -0
- package/dist/worker/console/static/assets/{index-qpkysQYW.css → index-hJqCPs_g.css} +1 -1
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/observe/static/operator-chrome.css +34 -0
- package/dist/worker/observe/static/operator-chrome.js +57 -0
- package/dist/workflows/dag/dynamic-runtime/shared.js +3 -1
- package/dist/workflows/dag/frontend-implementation-contract.js +49 -0
- package/dist/workflows/dag/frontend-prewrite-gate.js +17 -1
- package/dist/workflows/dag/init-hybrid.js +90 -77
- package/dist/workflows/dag/types.js +2 -0
- package/package.json +1 -1
- package/skills/frontend-implementation/references/node-contracts.md +4 -2
- package/dist/worker/console/static/assets/index-y980PqtP.js +0 -56
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&l(u)}).observe(document,{childList:!0,subtree:!0});function i(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(o){if(o.ep)return;o.ep=!0;const c=i(o);fetch(o.href,c)}})();function ad(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hc={exports:{}},Va={};var Ep;function r1(){if(Ep)return Va;Ep=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(l,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:t,type:l,key:u,ref:o!==void 0?o:null,props:c}}return Va.Fragment=r,Va.jsx=i,Va.jsxs=i,Va}var Np;function i1(){return Np||(Np=1,hc.exports=r1()),hc.exports}var d=i1(),mc={exports:{}},Re={};var Ap;function a1(){if(Ap)return Re;Ap=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),S=Symbol.iterator;function x(E){return E===null||typeof E!="object"?null:(E=S&&E[S]||E["@@iterator"],typeof E=="function"?E:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,H={};function O(E,L,j){this.props=E,this.context=L,this.refs=H,this.updater=j||C}O.prototype.isReactComponent={},O.prototype.setState=function(E,L){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,L,"setState")},O.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function I(){}I.prototype=O.prototype;function A(E,L,j){this.props=E,this.context=L,this.refs=H,this.updater=j||C}var F=A.prototype=new I;F.constructor=A,N(F,O.prototype),F.isPureReactComponent=!0;var W=Array.isArray;function w(){}var q={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function se(E,L,j){var te=j.ref;return{$$typeof:t,type:E,key:L,ref:te!==void 0?te:null,props:j}}function z(E,L){return se(E.type,L,E.props)}function Y(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function ne(E){var L={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(j){return L[j]})}var ue=/\/+/g;function P(E,L){return typeof E=="object"&&E!==null&&E.key!=null?ne(""+E.key):L.toString(36)}function B(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(w,w):(E.status="pending",E.then(function(L){E.status==="pending"&&(E.status="fulfilled",E.value=L)},function(L){E.status==="pending"&&(E.status="rejected",E.reason=L)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function D(E,L,j,te,de){var J=typeof E;(J==="undefined"||J==="boolean")&&(E=null);var ae=!1;if(E===null)ae=!0;else switch(J){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(E.$$typeof){case t:case r:ae=!0;break;case v:return ae=E._init,D(ae(E._payload),L,j,te,de)}}if(ae)return de=de(E),ae=te===""?"."+P(E,0):te,W(de)?(j="",ae!=null&&(j=ae.replace(ue,"$&/")+"/"),D(de,L,j,"",function(pe){return pe})):de!=null&&(Y(de)&&(de=z(de,j+(de.key==null||E&&E.key===de.key?"":(""+de.key).replace(ue,"$&/")+"/")+ae)),L.push(de)),1;ae=0;var fe=te===""?".":te+":";if(W(E))for(var me=0;me<E.length;me++)te=E[me],J=fe+P(te,me),ae+=D(te,L,j,J,de);else if(me=x(E),typeof me=="function")for(E=me.call(E),me=0;!(te=E.next()).done;)te=te.value,J=fe+P(te,me++),ae+=D(te,L,j,J,de);else if(J==="object"){if(typeof E.then=="function")return D(B(E),L,j,te,de);throw L=String(E),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return ae}function U(E,L,j){if(E==null)return E;var te=[],de=0;return D(E,te,"","",function(J){return L.call(j,J,de++)}),te}function G(E){if(E._status===-1){var L=E._result;L=L(),L.then(function(j){(E._status===0||E._status===-1)&&(E._status=1,E._result=j)},function(j){(E._status===0||E._status===-1)&&(E._status=2,E._result=j)}),E._status===-1&&(E._status=0,E._result=L)}if(E._status===1)return E._result.default;throw E._result}var K=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=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(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},T={map:U,forEach:function(E,L,j){U(E,function(){L.apply(this,arguments)},j)},count:function(E){var L=0;return U(E,function(){L++}),L},toArray:function(E){return U(E,function(L){return L})||[]},only:function(E){if(!Y(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Re.Activity=y,Re.Children=T,Re.Component=O,Re.Fragment=i,Re.Profiler=o,Re.PureComponent=A,Re.StrictMode=l,Re.Suspense=g,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,Re.__COMPILER_RUNTIME={__proto__:null,c:function(E){return q.H.useMemoCache(E)}},Re.cache=function(E){return function(){return E.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(E,L,j){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var te=N({},E.props),de=E.key;if(L!=null)for(J in L.key!==void 0&&(de=""+L.key),L)!Q.call(L,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&L.ref===void 0||(te[J]=L[J]);var J=arguments.length-2;if(J===1)te.children=j;else if(1<J){for(var ae=Array(J),fe=0;fe<J;fe++)ae[fe]=arguments[fe+2];te.children=ae}return se(E.type,de,te)},Re.createContext=function(E){return E={$$typeof:u,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:c,_context:E},E},Re.createElement=function(E,L,j){var te,de={},J=null;if(L!=null)for(te in L.key!==void 0&&(J=""+L.key),L)Q.call(L,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(de[te]=L[te]);var ae=arguments.length-2;if(ae===1)de.children=j;else if(1<ae){for(var fe=Array(ae),me=0;me<ae;me++)fe[me]=arguments[me+2];de.children=fe}if(E&&E.defaultProps)for(te in ae=E.defaultProps,ae)de[te]===void 0&&(de[te]=ae[te]);return se(E,J,de)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(E){return{$$typeof:h,render:E}},Re.isValidElement=Y,Re.lazy=function(E){return{$$typeof:v,_payload:{_status:-1,_result:E},_init:G}},Re.memo=function(E,L){return{$$typeof:p,type:E,compare:L===void 0?null:L}},Re.startTransition=function(E){var L=q.T,j={};q.T=j;try{var te=E(),de=q.S;de!==null&&de(j,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(w,K)}catch(J){K(J)}finally{L!==null&&j.types!==null&&(L.types=j.types),q.T=L}},Re.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},Re.use=function(E){return q.H.use(E)},Re.useActionState=function(E,L,j){return q.H.useActionState(E,L,j)},Re.useCallback=function(E,L){return q.H.useCallback(E,L)},Re.useContext=function(E){return q.H.useContext(E)},Re.useDebugValue=function(){},Re.useDeferredValue=function(E,L){return q.H.useDeferredValue(E,L)},Re.useEffect=function(E,L){return q.H.useEffect(E,L)},Re.useEffectEvent=function(E){return q.H.useEffectEvent(E)},Re.useId=function(){return q.H.useId()},Re.useImperativeHandle=function(E,L,j){return q.H.useImperativeHandle(E,L,j)},Re.useInsertionEffect=function(E,L){return q.H.useInsertionEffect(E,L)},Re.useLayoutEffect=function(E,L){return q.H.useLayoutEffect(E,L)},Re.useMemo=function(E,L){return q.H.useMemo(E,L)},Re.useOptimistic=function(E,L){return q.H.useOptimistic(E,L)},Re.useReducer=function(E,L,j){return q.H.useReducer(E,L,j)},Re.useRef=function(E){return q.H.useRef(E)},Re.useState=function(E){return q.H.useState(E)},Re.useSyncExternalStore=function(E,L,j){return q.H.useSyncExternalStore(E,L,j)},Re.useTransition=function(){return q.H.useTransition()},Re.version="19.2.8",Re}var Ip;function ld(){return Ip||(Ip=1,mc.exports=a1()),mc.exports}var k=ld();const Er=ad(k);var pc={exports:{}},Ya={},gc={exports:{}},yc={};var Dp;function l1(){return Dp||(Dp=1,(function(t){function r(D,U){var G=D.length;D.push(U);e:for(;0<G;){var K=G-1>>>1,T=D[K];if(0<o(T,U))D[K]=U,D[G]=T,G=K;else break e}}function i(D){return D.length===0?null:D[0]}function l(D){if(D.length===0)return null;var U=D[0],G=D.pop();if(G!==U){D[0]=G;e:for(var K=0,T=D.length,E=T>>>1;K<E;){var L=2*(K+1)-1,j=D[L],te=L+1,de=D[te];if(0>o(j,G))te<T&&0>o(de,j)?(D[K]=de,D[te]=G,K=te):(D[K]=j,D[L]=G,K=L);else if(te<T&&0>o(de,G))D[K]=de,D[te]=G,K=te;else break e}}return U}function o(D,U){var G=D.sortIndex-U.sortIndex;return G!==0?G:D.id-U.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var u=Date,h=u.now();t.unstable_now=function(){return u.now()-h}}var g=[],p=[],v=1,y=null,S=3,x=!1,C=!1,N=!1,H=!1,O=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function F(D){for(var U=i(p);U!==null;){if(U.callback===null)l(p);else if(U.startTime<=D)l(p),U.sortIndex=U.expirationTime,r(g,U);else break;U=i(p)}}function W(D){if(N=!1,F(D),!C)if(i(g)!==null)C=!0,w||(w=!0,ne());else{var U=i(p);U!==null&&B(W,U.startTime-D)}}var w=!1,q=-1,Q=5,se=-1;function z(){return H?!0:!(t.unstable_now()-se<Q)}function Y(){if(H=!1,w){var D=t.unstable_now();se=D;var U=!0;try{e:{C=!1,N&&(N=!1,I(q),q=-1),x=!0;var G=S;try{t:{for(F(D),y=i(g);y!==null&&!(y.expirationTime>D&&z());){var K=y.callback;if(typeof K=="function"){y.callback=null,S=y.priorityLevel;var T=K(y.expirationTime<=D);if(D=t.unstable_now(),typeof T=="function"){y.callback=T,F(D),U=!0;break t}y===i(g)&&l(g),F(D)}else l(g);y=i(g)}if(y!==null)U=!0;else{var E=i(p);E!==null&&B(W,E.startTime-D),U=!1}}break e}finally{y=null,S=G,x=!1}U=void 0}}finally{U?ne():w=!1}}}var ne;if(typeof A=="function")ne=function(){A(Y)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,P=ue.port2;ue.port1.onmessage=Y,ne=function(){P.postMessage(null)}}else ne=function(){O(Y,0)};function B(D,U){q=O(function(){D(t.unstable_now())},U)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(D){D.callback=null},t.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<D?Math.floor(1e3/D):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_next=function(D){switch(S){case 1:case 2:case 3:var U=3;break;default:U=S}var G=S;S=U;try{return D()}finally{S=G}},t.unstable_requestPaint=function(){H=!0},t.unstable_runWithPriority=function(D,U){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var G=S;S=D;try{return U()}finally{S=G}},t.unstable_scheduleCallback=function(D,U,G){var K=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?K+G:K):G=K,D){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=G+T,D={id:v++,callback:U,priorityLevel:D,startTime:G,expirationTime:T,sortIndex:-1},G>K?(D.sortIndex=G,r(p,D),i(g)===null&&D===i(p)&&(N?(I(q),q=-1):N=!0,B(W,G-K))):(D.sortIndex=T,r(g,D),C||x||(C=!0,w||(w=!0,ne()))),D},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(D){var U=S;return function(){var G=S;S=U;try{return D.apply(this,arguments)}finally{S=G}}}})(yc)),yc}var Op;function s1(){return Op||(Op=1,gc.exports=l1()),gc.exports}var vc={exports:{}},Ot={};var Mp;function o1(){if(Mp)return Ot;Mp=1;var t=ld();function r(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var l={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(g,p,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:g,containerInfo:p,implementation:v}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Ot.createPortal=function(g,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return c(g,p,null,v)},Ot.flushSync=function(g){var p=u.T,v=l.p;try{if(u.T=null,l.p=2,g)return g()}finally{u.T=p,l.p=v,l.d.f()}},Ot.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(g,p))},Ot.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},Ot.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var v=p.as,y=h(v,p.crossOrigin),S=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?l.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:S,fetchPriority:x}):v==="script"&&l.d.X(g,{crossOrigin:y,integrity:S,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ot.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=h(p.as,p.crossOrigin);l.d.M(g,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(g)},Ot.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,y=h(v,p.crossOrigin);l.d.L(g,v,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ot.preloadModule=function(g,p){if(typeof g=="string")if(p){var v=h(p.as,p.crossOrigin);l.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(g)},Ot.requestFormReset=function(g){l.d.r(g)},Ot.unstable_batchedUpdates=function(g,p){return g(p)},Ot.useFormState=function(g,p,v){return u.H.useFormState(g,p,v)},Ot.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ot.version="19.2.8",Ot}var zp;function ty(){if(zp)return vc.exports;zp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),vc.exports=o1(),vc.exports}var _p;function u1(){if(_p)return Ya;_p=1;var t=s1(),r=ld(),i=ty();function l(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function u(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(c(e)!==e)throw Error(l(188))}function p(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(l(188));return n!==e?null:e}for(var a=e,s=n;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(s=f.return,s!==null){a=s;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return g(f),e;if(m===s)return g(f),n;m=m.sibling}throw Error(l(188))}if(a.return!==s.return)a=f,s=m;else{for(var b=!1,R=f.child;R;){if(R===a){b=!0,a=f,s=m;break}if(R===s){b=!0,s=f,a=m;break}R=R.sibling}if(!b){for(R=m.child;R;){if(R===a){b=!0,a=m,s=f;break}if(R===s){b=!0,s=m,a=f;break}R=R.sibling}if(!b)throw Error(l(189))}}if(a.alternate!==s)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var y=Object.assign,S=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),A=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=Y&&e[Y]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Symbol.for("react.client.reference");function P(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case O:return"Profiler";case H:return"StrictMode";case W:return"Suspense";case w:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case A:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case F:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return n=e.displayName||null,n!==null?n:P(e.type)||"Memo";case Q:n=e._payload,e=e._init;try{return P(e(n))}catch{}}return null}var B=Array.isArray,D=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},K=[],T=-1;function E(e){return{current:e}}function L(e){0>T||(e.current=K[T],K[T]=null,T--)}function j(e,n){T++,K[T]=e.current,e.current=n}var te=E(null),de=E(null),J=E(null),ae=E(null);function fe(e,n){switch(j(J,n),j(de,e),j(te,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Zm(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Zm(n),e=Jm(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(te),j(te,e)}function me(){L(te),L(de),L(J)}function pe(e){e.memoizedState!==null&&j(ae,e);var n=te.current,a=Jm(n,e.type);n!==a&&(j(de,e),j(te,a))}function Ie(e){de.current===e&&(L(te),L(de)),ae.current===e&&(L(ae),qa._currentValue=G)}var Ne,$e;function Pe(e){if(Ne===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);Ne=n&&n[1]||"",$e=-1<a.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Ne+e+$e}var it=!1;function sn(e,n){if(!e||it)return"";it=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(re){var ee=re}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(re){ee=re}e.call(ce.prototype)}}else{try{throw Error()}catch(re){ee=re}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(re){if(re&&ee&&typeof re.stack=="string")return[re.stack,ee.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=s.DetermineComponentFrameRoot(),b=m[0],R=m[1];if(b&&R){var _=b.split(`
|
|
4
|
-
`),Z=R.split(`
|
|
5
|
-
`);for(f=s=0;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;for(;f<Z.length&&!Z[f].includes("DetermineComponentFrameRoot");)f++;if(s===_.length||f===Z.length)for(s=_.length-1,f=Z.length-1;1<=s&&0<=f&&_[s]!==Z[f];)f--;for(;1<=s&&0<=f;s--,f--)if(_[s]!==Z[f]){if(s!==1||f!==1)do if(s--,f--,0>f||_[s]!==Z[f]){var le=`
|
|
6
|
-
`+_[s].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=s&&0<=f);break}}}finally{it=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Pe(a):""}function jt(e,n){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe("Lazy");case 13:return e.child!==n&&n!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return sn(e.type,!1);case 11:return sn(e.type.render,!1);case 1:return sn(e.type,!0);case 31:return Pe("Activity");default:return""}}function on(e){try{var n="",a=null;do n+=jt(e,a),a=e,e=e.return;while(e);return n}catch(s){return`
|
|
7
|
-
Error generating stack: `+s.message+`
|
|
8
|
-
`+s.stack}}var Bt=Object.prototype.hasOwnProperty,Rt=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,qe=t.unstable_shouldYield,ot=t.unstable_requestPaint,Fe=t.unstable_now,Ht=t.unstable_getCurrentPriorityLevel,M=t.unstable_ImmediatePriority,ie=t.unstable_UserBlockingPriority,ge=t.unstable_NormalPriority,we=t.unstable_LowPriority,Te=t.unstable_IdlePriority,be=t.log,Ge=t.unstable_setDisableYieldValue,Ee=null,Oe=null;function ft(e){if(typeof be=="function"&&Ge(e),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(Ee,e)}catch{}}var Xe=Math.clz32?Math.clz32:Ws,jn=Math.log,Qt=Math.LN2;function Ws(e){return e>>>=0,e===0?32:31-(jn(e)/Qt|0)|0}var Tt=256,Ar=262144,ol=4194304;function Ir(e){var n=e&42;if(n!==0)return n;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 ul(e,n,a){var s=e.pendingLanes;if(s===0)return 0;var f=0,m=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var R=s&134217727;return R!==0?(s=R&~m,s!==0?f=Ir(s):(b&=R,b!==0?f=Ir(b):a||(a=R&~e,a!==0&&(f=Ir(a))))):(R=s&~m,R!==0?f=Ir(R):b!==0?f=Ir(b):a||(a=s&~e,a!==0&&(f=Ir(a)))),f===0?0:n!==0&&n!==f&&(n&m)===0&&(m=f&-f,a=n&-n,m>=a||m===32&&(a&4194048)!==0)?n:f}function ea(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Fv(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Id(){var e=ol;return ol<<=1,(ol&62914560)===0&&(ol=4194304),e}function eo(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function ta(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Vv(e,n,a,s,f,m){var b=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var R=e.entanglements,_=e.expirationTimes,Z=e.hiddenUpdates;for(a=b&~a;0<a;){var le=31-Xe(a),ce=1<<le;R[le]=0,_[le]=-1;var ee=Z[le];if(ee!==null)for(Z[le]=null,le=0;le<ee.length;le++){var re=ee[le];re!==null&&(re.lane&=-536870913)}a&=~ce}s!==0&&Dd(e,s,0),m!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=m&~(b&~n))}function Dd(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Xe(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function Od(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var s=31-Xe(a),f=1<<s;f&n|e[s]&n&&(e[s]|=n),a&=~f}}function Md(e,n){var a=n&-n;return a=(a&42)!==0?1:to(a),(a&(e.suspendedLanes|n))!==0?0:a}function to(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 no(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function zd(){var e=U.p;return e!==0?e:(e=window.event,e===void 0?32:Sp(e.type))}function _d(e,n){var a=U.p;try{return U.p=e,n()}finally{U.p=a}}var tr=Math.random().toString(36).slice(2),Et="__reactFiber$"+tr,Ut="__reactProps$"+tr,ii="__reactContainer$"+tr,ro="__reactEvents$"+tr,Yv="__reactListeners$"+tr,Pv="__reactHandles$"+tr,Ld="__reactResources$"+tr,na="__reactMarker$"+tr;function io(e){delete e[Et],delete e[Ut],delete e[ro],delete e[Yv],delete e[Pv]}function ai(e){var n=e[Et];if(n)return n;for(var a=e.parentNode;a;){if(n=a[ii]||a[Et]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=ap(e);e!==null;){if(a=e[Et])return a;e=ap(e)}return n}e=a,a=e.parentNode}return null}function li(e){if(e=e[Et]||e[ii]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function ra(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(l(33))}function si(e){var n=e[Ld];return n||(n=e[Ld]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function wt(e){e[na]=!0}var Bd=new Set,Hd={};function Dr(e,n){oi(e,n),oi(e+"Capture",n)}function oi(e,n){for(Hd[e]=n,e=0;e<n.length;e++)Bd.add(n[e])}var Kv=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]*$"),Ud={},qd={};function Xv(e){return Bt.call(qd,e)?!0:Bt.call(Ud,e)?!1:Kv.test(e)?qd[e]=!0:(Ud[e]=!0,!1)}function cl(e,n,a){if(Xv(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function dl(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function On(e,n,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+s)}}function un(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gd(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Qv(e,n,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var f=s.get,m=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(b){a=""+b,m.call(this,b)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function ao(e){if(!e._valueTracker){var n=Gd(e)?"checked":"value";e._valueTracker=Qv(e,n,""+e[n])}}function $d(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),s="";return e&&(s=Gd(e)?e.checked?"true":"false":e.value),e=s,e!==a?(n.setValue(e),!0):!1}function fl(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 Zv=/[\n"\\]/g;function cn(e){return e.replace(Zv,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function lo(e,n,a,s,f,m,b,R){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),n!=null?b==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+un(n)):e.value!==""+un(n)&&(e.value=""+un(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?so(e,b,un(n)):a!=null?so(e,b,un(a)):s!=null&&e.removeAttribute("value"),f==null&&m!=null&&(e.defaultChecked=!!m),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+un(R):e.removeAttribute("name")}function Fd(e,n,a,s,f,m,b,R){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),n!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||n!=null)){ao(e);return}a=a!=null?""+un(a):"",n=n!=null?""+un(n):a,R||n===e.value||(e.value=n),e.defaultValue=n}s=s??f,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=R?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),ao(e)}function so(e,n,a){n==="number"&&fl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ui(e,n,a,s){if(e=e.options,n){n={};for(var f=0;f<a.length;f++)n["$"+a[f]]=!0;for(a=0;a<e.length;a++)f=n.hasOwnProperty("$"+e[a].value),e[a].selected!==f&&(e[a].selected=f),f&&s&&(e[a].defaultSelected=!0)}else{for(a=""+un(a),n=null,f=0;f<e.length;f++){if(e[f].value===a){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function Vd(e,n,a){if(n!=null&&(n=""+un(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+un(a):""}function Yd(e,n,a,s){if(n==null){if(s!=null){if(a!=null)throw Error(l(92));if(B(s)){if(1<s.length)throw Error(l(93));s=s[0]}a=s}a==null&&(a=""),n=a}a=un(n),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),ao(e)}function ci(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var Jv=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 Pd(e,n,a){var s=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,a):typeof a!="number"||a===0||Jv.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function Kd(e,n,a){if(n!=null&&typeof n!="object")throw Error(l(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var f in n)s=n[f],n.hasOwnProperty(f)&&a[f]!==s&&Pd(e,f,s)}else for(var m in n)n.hasOwnProperty(m)&&Pd(e,m,n[m])}function oo(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 Wv=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"]]),eb=/^[\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 hl(e){return eb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Mn(){}var uo=null;function co(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var di=null,fi=null;function Xd(e){var n=li(e);if(n&&(e=n.stateNode)){var a=e[Ut]||null;e:switch(e=n.stateNode,n.type){case"input":if(lo(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+cn(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var s=a[n];if(s!==e&&s.form===e.form){var f=s[Ut]||null;if(!f)throw Error(l(90));lo(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<a.length;n++)s=a[n],s.form===e.form&&$d(s)}break e;case"textarea":Vd(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&ui(e,!!a.multiple,n,!1)}}}var fo=!1;function Qd(e,n,a){if(fo)return e(n,a);fo=!0;try{var s=e(n);return s}finally{if(fo=!1,(di!==null||fi!==null)&&(es(),di&&(n=di,e=fi,fi=di=null,Xd(n),e)))for(n=0;n<e.length;n++)Xd(e[n])}}function ia(e,n){var a=e.stateNode;if(a===null)return null;var s=a[Ut]||null;if(s===null)return null;a=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(l(231,n,typeof a));return a}var zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ho=!1;if(zn)try{var aa={};Object.defineProperty(aa,"passive",{get:function(){ho=!0}}),window.addEventListener("test",aa,aa),window.removeEventListener("test",aa,aa)}catch{ho=!1}var nr=null,mo=null,ml=null;function Zd(){if(ml)return ml;var e,n=mo,a=n.length,s,f="value"in nr?nr.value:nr.textContent,m=f.length;for(e=0;e<a&&n[e]===f[e];e++);var b=a-e;for(s=1;s<=b&&n[a-s]===f[m-s];s++);return ml=f.slice(e,1<s?1-s:void 0)}function pl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function gl(){return!0}function Jd(){return!1}function qt(e){function n(a,s,f,m,b){this._reactName=a,this._targetInst=f,this.type=s,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(a=e[R],this[R]=a?a(m):m[R]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?gl:Jd,this.isPropagationStopped=Jd,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=gl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=gl)},persist:function(){},isPersistent:gl}),n}var Or={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yl=qt(Or),la=y({},Or,{view:0,detail:0}),tb=qt(la),po,go,sa,vl=y({},la,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vo,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!==sa&&(sa&&e.type==="mousemove"?(po=e.screenX-sa.screenX,go=e.screenY-sa.screenY):go=po=0,sa=e),po)},movementY:function(e){return"movementY"in e?e.movementY:go}}),Wd=qt(vl),nb=y({},vl,{dataTransfer:0}),rb=qt(nb),ib=y({},la,{relatedTarget:0}),yo=qt(ib),ab=y({},Or,{animationName:0,elapsedTime:0,pseudoElement:0}),lb=qt(ab),sb=y({},Or,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ob=qt(sb),ub=y({},Or,{data:0}),ef=qt(ub),cb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},db={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"},fb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hb(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=fb[e])?!!n[e]:!1}function vo(){return hb}var mb=y({},la,{key:function(e){if(e.key){var n=cb[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=pl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?db[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vo,charCode:function(e){return e.type==="keypress"?pl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pb=qt(mb),gb=y({},vl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tf=qt(gb),yb=y({},la,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vo}),vb=qt(yb),bb=y({},Or,{propertyName:0,elapsedTime:0,pseudoElement:0}),xb=qt(bb),Sb=y({},vl,{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}),kb=qt(Sb),wb=y({},Or,{newState:0,oldState:0}),Cb=qt(wb),jb=[9,13,27,32],bo=zn&&"CompositionEvent"in window,oa=null;zn&&"documentMode"in document&&(oa=document.documentMode);var Rb=zn&&"TextEvent"in window&&!oa,nf=zn&&(!bo||oa&&8<oa&&11>=oa),rf=" ",af=!1;function lf(e,n){switch(e){case"keyup":return jb.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var hi=!1;function Tb(e,n){switch(e){case"compositionend":return sf(n);case"keypress":return n.which!==32?null:(af=!0,rf);case"textInput":return e=n.data,e===rf&&af?null:e;default:return null}}function Eb(e,n){if(hi)return e==="compositionend"||!bo&&lf(e,n)?(e=Zd(),ml=mo=nr=null,hi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return nf&&n.locale!=="ko"?null:n.data;default:return null}}var Nb={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 of(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Nb[e.type]:n==="textarea"}function uf(e,n,a,s){di?fi?fi.push(s):fi=[s]:di=s,n=ss(n,"onChange"),0<n.length&&(a=new yl("onChange","change",null,a,s),e.push({event:a,listeners:n}))}var ua=null,ca=null;function Ab(e){Vm(e,0)}function bl(e){var n=ra(e);if($d(n))return e}function cf(e,n){if(e==="change")return n}var df=!1;if(zn){var xo;if(zn){var So="oninput"in document;if(!So){var ff=document.createElement("div");ff.setAttribute("oninput","return;"),So=typeof ff.oninput=="function"}xo=So}else xo=!1;df=xo&&(!document.documentMode||9<document.documentMode)}function hf(){ua&&(ua.detachEvent("onpropertychange",mf),ca=ua=null)}function mf(e){if(e.propertyName==="value"&&bl(ca)){var n=[];uf(n,ca,e,co(e)),Qd(Ab,n)}}function Ib(e,n,a){e==="focusin"?(hf(),ua=n,ca=a,ua.attachEvent("onpropertychange",mf)):e==="focusout"&&hf()}function Db(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bl(ca)}function Ob(e,n){if(e==="click")return bl(n)}function Mb(e,n){if(e==="input"||e==="change")return bl(n)}function zb(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Zt=typeof Object.is=="function"?Object.is:zb;function da(e,n){if(Zt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),s=Object.keys(n);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var f=a[s];if(!Bt.call(n,f)||!Zt(e[f],n[f]))return!1}return!0}function pf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gf(e,n){var a=pf(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=n&&s>=n)return{node:a,offset:n-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=pf(a)}}function yf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?yf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function vf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=fl(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=fl(e.document)}return n}function ko(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var _b=zn&&"documentMode"in document&&11>=document.documentMode,mi=null,wo=null,fa=null,Co=!1;function bf(e,n,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Co||mi==null||mi!==fl(s)||(s=mi,"selectionStart"in s&&ko(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),fa&&da(fa,s)||(fa=s,s=ss(wo,"onSelect"),0<s.length&&(n=new yl("onSelect","select",null,n,a),e.push({event:n,listeners:s}),n.target=mi)))}function Mr(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var pi={animationend:Mr("Animation","AnimationEnd"),animationiteration:Mr("Animation","AnimationIteration"),animationstart:Mr("Animation","AnimationStart"),transitionrun:Mr("Transition","TransitionRun"),transitionstart:Mr("Transition","TransitionStart"),transitioncancel:Mr("Transition","TransitionCancel"),transitionend:Mr("Transition","TransitionEnd")},jo={},xf={};zn&&(xf=document.createElement("div").style,"AnimationEvent"in window||(delete pi.animationend.animation,delete pi.animationiteration.animation,delete pi.animationstart.animation),"TransitionEvent"in window||delete pi.transitionend.transition);function zr(e){if(jo[e])return jo[e];if(!pi[e])return e;var n=pi[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in xf)return jo[e]=n[a];return e}var Sf=zr("animationend"),kf=zr("animationiteration"),wf=zr("animationstart"),Lb=zr("transitionrun"),Bb=zr("transitionstart"),Hb=zr("transitioncancel"),Cf=zr("transitionend"),jf=new Map,Ro="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(" ");Ro.push("scrollEnd");function xn(e,n){jf.set(e,n),Dr(n,[e])}var xl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},dn=[],gi=0,To=0;function Sl(){for(var e=gi,n=To=gi=0;n<e;){var a=dn[n];dn[n++]=null;var s=dn[n];dn[n++]=null;var f=dn[n];dn[n++]=null;var m=dn[n];if(dn[n++]=null,s!==null&&f!==null){var b=s.pending;b===null?f.next=f:(f.next=b.next,b.next=f),s.pending=f}m!==0&&Rf(a,f,m)}}function kl(e,n,a,s){dn[gi++]=e,dn[gi++]=n,dn[gi++]=a,dn[gi++]=s,To|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Eo(e,n,a,s){return kl(e,n,a,s),wl(e)}function _r(e,n){return kl(e,null,null,n),wl(e)}function Rf(e,n,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var f=!1,m=e.return;m!==null;)m.childLanes|=a,s=m.alternate,s!==null&&(s.childLanes|=a),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(f=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,f&&n!==null&&(f=31-Xe(a),e=m.hiddenUpdates,s=e[f],s===null?e[f]=[n]:s.push(n),n.lane=a|536870912),m):null}function wl(e){if(50<Ma)throw Ma=0,Lu=null,Error(l(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var yi={};function Ub(e,n,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(e,n,a,s){return new Ub(e,n,a,s)}function No(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _n(e,n){var a=e.alternate;return a===null?(a=Jt(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Tf(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Cl(e,n,a,s,f,m){var b=0;if(s=e,typeof e=="function")No(e)&&(b=1);else if(typeof e=="string")b=Vx(e,a,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case se:return e=Jt(31,a,n,f),e.elementType=se,e.lanes=m,e;case N:return Lr(a.children,f,m,n);case H:b=8,f|=24;break;case O:return e=Jt(12,a,n,f|2),e.elementType=O,e.lanes=m,e;case W:return e=Jt(13,a,n,f),e.elementType=W,e.lanes=m,e;case w:return e=Jt(19,a,n,f),e.elementType=w,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:b=10;break e;case I:b=9;break e;case F:b=11;break e;case q:b=14;break e;case Q:b=16,s=null;break e}b=29,a=Error(l(130,e===null?"null":typeof e,"")),s=null}return n=Jt(b,a,n,f),n.elementType=e,n.type=s,n.lanes=m,n}function Lr(e,n,a,s){return e=Jt(7,e,s,n),e.lanes=a,e}function Ao(e,n,a){return e=Jt(6,e,null,n),e.lanes=a,e}function Ef(e){var n=Jt(18,null,null,0);return n.stateNode=e,n}function Io(e,n,a){return n=Jt(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Nf=new WeakMap;function fn(e,n){if(typeof e=="object"&&e!==null){var a=Nf.get(e);return a!==void 0?a:(n={value:e,source:n,stack:on(n)},Nf.set(e,n),n)}return{value:e,source:n,stack:on(n)}}var vi=[],bi=0,jl=null,ha=0,hn=[],mn=0,rr=null,Rn=1,Tn="";function Ln(e,n){vi[bi++]=ha,vi[bi++]=jl,jl=e,ha=n}function Af(e,n,a){hn[mn++]=Rn,hn[mn++]=Tn,hn[mn++]=rr,rr=e;var s=Rn;e=Tn;var f=32-Xe(s)-1;s&=~(1<<f),a+=1;var m=32-Xe(n)+f;if(30<m){var b=f-f%5;m=(s&(1<<b)-1).toString(32),s>>=b,f-=b,Rn=1<<32-Xe(n)+f|a<<f|s,Tn=m+e}else Rn=1<<m|a<<f|s,Tn=e}function Do(e){e.return!==null&&(Ln(e,1),Af(e,1,0))}function Oo(e){for(;e===jl;)jl=vi[--bi],vi[bi]=null,ha=vi[--bi],vi[bi]=null;for(;e===rr;)rr=hn[--mn],hn[mn]=null,Tn=hn[--mn],hn[mn]=null,Rn=hn[--mn],hn[mn]=null}function If(e,n){hn[mn++]=Rn,hn[mn++]=Tn,hn[mn++]=rr,Rn=n.id,Tn=n.overflow,rr=e}var Nt=null,at=null,He=!1,ir=null,pn=!1,Mo=Error(l(519));function ar(e){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ma(fn(n,e)),Mo}function Df(e){var n=e.stateNode,a=e.type,s=e.memoizedProps;switch(n[Et]=e,n[Ut]=s,a){case"dialog":ze("cancel",n),ze("close",n);break;case"iframe":case"object":case"embed":ze("load",n);break;case"video":case"audio":for(a=0;a<_a.length;a++)ze(_a[a],n);break;case"source":ze("error",n);break;case"img":case"image":case"link":ze("error",n),ze("load",n);break;case"details":ze("toggle",n);break;case"input":ze("invalid",n),Fd(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ze("invalid",n);break;case"textarea":ze("invalid",n),Yd(n,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||s.suppressHydrationWarning===!0||Xm(n.textContent,a)?(s.popover!=null&&(ze("beforetoggle",n),ze("toggle",n)),s.onScroll!=null&&ze("scroll",n),s.onScrollEnd!=null&&ze("scrollend",n),s.onClick!=null&&(n.onclick=Mn),n=!0):n=!1,n||ar(e,!0)}function Of(e){for(Nt=e.return;Nt;)switch(Nt.tag){case 5:case 31:case 13:pn=!1;return;case 27:case 3:pn=!0;return;default:Nt=Nt.return}}function xi(e){if(e!==Nt)return!1;if(!He)return Of(e),He=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ju(e.type,e.memoizedProps)),a=!a),a&&at&&ar(e),Of(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));at=ip(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));at=ip(e)}else n===27?(n=at,br(e.type)?(e=rc,rc=null,at=e):at=n):at=Nt?yn(e.stateNode.nextSibling):null;return!0}function Br(){at=Nt=null,He=!1}function zo(){var e=ir;return e!==null&&(Vt===null?Vt=e:Vt.push.apply(Vt,e),ir=null),e}function ma(e){ir===null?ir=[e]:ir.push(e)}var _o=E(null),Hr=null,Bn=null;function lr(e,n,a){j(_o,n._currentValue),n._currentValue=a}function Hn(e){e._currentValue=_o.current,L(_o)}function Lo(e,n,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===a)break;e=e.return}}function Bo(e,n,a,s){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var R=m;m=f;for(var _=0;_<n.length;_++)if(R.context===n[_]){m.lanes|=a,R=m.alternate,R!==null&&(R.lanes|=a),Lo(m.return,a,e),s||(b=null);break e}m=R.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(l(341));b.lanes|=a,m=b.alternate,m!==null&&(m.lanes|=a),Lo(b,a,e),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===e){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Si(e,n,a,s){e=null;for(var f=n,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(l(387));if(b=b.memoizedProps,b!==null){var R=f.type;Zt(f.pendingProps.value,b.value)||(e!==null?e.push(R):e=[R])}}else if(f===ae.current){if(b=f.alternate,b===null)throw Error(l(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(qa):e=[qa])}f=f.return}e!==null&&Bo(n,e,a,s),n.flags|=262144}function Rl(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ur(e){Hr=e,Bn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function At(e){return Mf(Hr,e)}function Tl(e,n){return Hr===null&&Ur(e),Mf(e,n)}function Mf(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Bn===null){if(e===null)throw Error(l(308));Bn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Bn=Bn.next=n;return a}var qb=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},Gb=t.unstable_scheduleCallback,$b=t.unstable_NormalPriority,gt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ho(){return{controller:new qb,data:new Map,refCount:0}}function pa(e){e.refCount--,e.refCount===0&&Gb($b,function(){e.controller.abort()})}var ga=null,Uo=0,ki=0,wi=null;function Fb(e,n){if(ga===null){var a=ga=[];Uo=0,ki=$u(),wi={status:"pending",value:void 0,then:function(s){a.push(s)}}}return Uo++,n.then(zf,zf),n}function zf(){if(--Uo===0&&ga!==null){wi!==null&&(wi.status="fulfilled");var e=ga;ga=null,ki=0,wi=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Vb(e,n){var a=[],s={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var f=0;f<a.length;f++)(0,a[f])(n)},function(f){for(s.status="rejected",s.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),s}var _f=D.S;D.S=function(e,n){bm=Fe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Fb(e,n),_f!==null&&_f(e,n)};var qr=E(null);function qo(){var e=qr.current;return e!==null?e:tt.pooledCache}function El(e,n){n===null?j(qr,qr.current):j(qr,n.pool)}function Lf(){var e=qo();return e===null?null:{parent:gt._currentValue,pool:e}}var Ci=Error(l(460)),Go=Error(l(474)),Nl=Error(l(542)),Al={then:function(){}};function Bf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Hf(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(Mn,Mn),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,qf(e),e;default:if(typeof n.status=="string")n.then(Mn,Mn);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=s}},function(s){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,qf(e),e}throw $r=n,Ci}}function Gr(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?($r=a,Ci):a}}var $r=null;function Uf(){if($r===null)throw Error(l(459));var e=$r;return $r=null,e}function qf(e){if(e===Ci||e===Nl)throw Error(l(483))}var ji=null,ya=0;function Il(e){var n=ya;return ya+=1,ji===null&&(ji=[]),Hf(ji,e,n)}function va(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Dl(e,n){throw n.$$typeof===S?Error(l(525)):(e=Object.prototype.toString.call(n),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Gf(e){function n(V,$){if(e){var X=V.deletions;X===null?(V.deletions=[$],V.flags|=16):X.push($)}}function a(V,$){if(!e)return null;for(;$!==null;)n(V,$),$=$.sibling;return null}function s(V){for(var $=new Map;V!==null;)V.key!==null?$.set(V.key,V):$.set(V.index,V),V=V.sibling;return $}function f(V,$){return V=_n(V,$),V.index=0,V.sibling=null,V}function m(V,$,X){return V.index=X,e?(X=V.alternate,X!==null?(X=X.index,X<$?(V.flags|=67108866,$):X):(V.flags|=67108866,$)):(V.flags|=1048576,$)}function b(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function R(V,$,X,oe){return $===null||$.tag!==6?($=Ao(X,V.mode,oe),$.return=V,$):($=f($,X),$.return=V,$)}function _(V,$,X,oe){var xe=X.type;return xe===N?le(V,$,X.props.children,oe,X.key):$!==null&&($.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===Q&&Gr(xe)===$.type)?($=f($,X.props),va($,X),$.return=V,$):($=Cl(X.type,X.key,X.props,null,V.mode,oe),va($,X),$.return=V,$)}function Z(V,$,X,oe){return $===null||$.tag!==4||$.stateNode.containerInfo!==X.containerInfo||$.stateNode.implementation!==X.implementation?($=Io(X,V.mode,oe),$.return=V,$):($=f($,X.children||[]),$.return=V,$)}function le(V,$,X,oe,xe){return $===null||$.tag!==7?($=Lr(X,V.mode,oe,xe),$.return=V,$):($=f($,X),$.return=V,$)}function ce(V,$,X){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Ao(""+$,V.mode,X),$.return=V,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case x:return X=Cl($.type,$.key,$.props,null,V.mode,X),va(X,$),X.return=V,X;case C:return $=Io($,V.mode,X),$.return=V,$;case Q:return $=Gr($),ce(V,$,X)}if(B($)||ne($))return $=Lr($,V.mode,X,null),$.return=V,$;if(typeof $.then=="function")return ce(V,Il($),X);if($.$$typeof===A)return ce(V,Tl(V,$),X);Dl(V,$)}return null}function ee(V,$,X,oe){var xe=$!==null?$.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return xe!==null?null:R(V,$,""+X,oe);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case x:return X.key===xe?_(V,$,X,oe):null;case C:return X.key===xe?Z(V,$,X,oe):null;case Q:return X=Gr(X),ee(V,$,X,oe)}if(B(X)||ne(X))return xe!==null?null:le(V,$,X,oe,null);if(typeof X.then=="function")return ee(V,$,Il(X),oe);if(X.$$typeof===A)return ee(V,$,Tl(V,X),oe);Dl(V,X)}return null}function re(V,$,X,oe,xe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return V=V.get(X)||null,R($,V,""+oe,xe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return V=V.get(oe.key===null?X:oe.key)||null,_($,V,oe,xe);case C:return V=V.get(oe.key===null?X:oe.key)||null,Z($,V,oe,xe);case Q:return oe=Gr(oe),re(V,$,X,oe,xe)}if(B(oe)||ne(oe))return V=V.get(X)||null,le($,V,oe,xe,null);if(typeof oe.then=="function")return re(V,$,X,Il(oe),xe);if(oe.$$typeof===A)return re(V,$,X,Tl($,oe),xe);Dl($,oe)}return null}function ye(V,$,X,oe){for(var xe=null,Ve=null,ve=$,De=$=0,Be=null;ve!==null&&De<X.length;De++){ve.index>De?(Be=ve,ve=null):Be=ve.sibling;var Ye=ee(V,ve,X[De],oe);if(Ye===null){ve===null&&(ve=Be);break}e&&ve&&Ye.alternate===null&&n(V,ve),$=m(Ye,$,De),Ve===null?xe=Ye:Ve.sibling=Ye,Ve=Ye,ve=Be}if(De===X.length)return a(V,ve),He&&Ln(V,De),xe;if(ve===null){for(;De<X.length;De++)ve=ce(V,X[De],oe),ve!==null&&($=m(ve,$,De),Ve===null?xe=ve:Ve.sibling=ve,Ve=ve);return He&&Ln(V,De),xe}for(ve=s(ve);De<X.length;De++)Be=re(ve,V,De,X[De],oe),Be!==null&&(e&&Be.alternate!==null&&ve.delete(Be.key===null?De:Be.key),$=m(Be,$,De),Ve===null?xe=Be:Ve.sibling=Be,Ve=Be);return e&&ve.forEach(function(Cr){return n(V,Cr)}),He&&Ln(V,De),xe}function ke(V,$,X,oe){if(X==null)throw Error(l(151));for(var xe=null,Ve=null,ve=$,De=$=0,Be=null,Ye=X.next();ve!==null&&!Ye.done;De++,Ye=X.next()){ve.index>De?(Be=ve,ve=null):Be=ve.sibling;var Cr=ee(V,ve,Ye.value,oe);if(Cr===null){ve===null&&(ve=Be);break}e&&ve&&Cr.alternate===null&&n(V,ve),$=m(Cr,$,De),Ve===null?xe=Cr:Ve.sibling=Cr,Ve=Cr,ve=Be}if(Ye.done)return a(V,ve),He&&Ln(V,De),xe;if(ve===null){for(;!Ye.done;De++,Ye=X.next())Ye=ce(V,Ye.value,oe),Ye!==null&&($=m(Ye,$,De),Ve===null?xe=Ye:Ve.sibling=Ye,Ve=Ye);return He&&Ln(V,De),xe}for(ve=s(ve);!Ye.done;De++,Ye=X.next())Ye=re(ve,V,De,Ye.value,oe),Ye!==null&&(e&&Ye.alternate!==null&&ve.delete(Ye.key===null?De:Ye.key),$=m(Ye,$,De),Ve===null?xe=Ye:Ve.sibling=Ye,Ve=Ye);return e&&ve.forEach(function(n1){return n(V,n1)}),He&&Ln(V,De),xe}function et(V,$,X,oe){if(typeof X=="object"&&X!==null&&X.type===N&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case x:e:{for(var xe=X.key;$!==null;){if($.key===xe){if(xe=X.type,xe===N){if($.tag===7){a(V,$.sibling),oe=f($,X.props.children),oe.return=V,V=oe;break e}}else if($.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===Q&&Gr(xe)===$.type){a(V,$.sibling),oe=f($,X.props),va(oe,X),oe.return=V,V=oe;break e}a(V,$);break}else n(V,$);$=$.sibling}X.type===N?(oe=Lr(X.props.children,V.mode,oe,X.key),oe.return=V,V=oe):(oe=Cl(X.type,X.key,X.props,null,V.mode,oe),va(oe,X),oe.return=V,V=oe)}return b(V);case C:e:{for(xe=X.key;$!==null;){if($.key===xe)if($.tag===4&&$.stateNode.containerInfo===X.containerInfo&&$.stateNode.implementation===X.implementation){a(V,$.sibling),oe=f($,X.children||[]),oe.return=V,V=oe;break e}else{a(V,$);break}else n(V,$);$=$.sibling}oe=Io(X,V.mode,oe),oe.return=V,V=oe}return b(V);case Q:return X=Gr(X),et(V,$,X,oe)}if(B(X))return ye(V,$,X,oe);if(ne(X)){if(xe=ne(X),typeof xe!="function")throw Error(l(150));return X=xe.call(X),ke(V,$,X,oe)}if(typeof X.then=="function")return et(V,$,Il(X),oe);if(X.$$typeof===A)return et(V,$,Tl(V,X),oe);Dl(V,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,$!==null&&$.tag===6?(a(V,$.sibling),oe=f($,X),oe.return=V,V=oe):(a(V,$),oe=Ao(X,V.mode,oe),oe.return=V,V=oe),b(V)):a(V,$)}return function(V,$,X,oe){try{ya=0;var xe=et(V,$,X,oe);return ji=null,xe}catch(ve){if(ve===Ci||ve===Nl)throw ve;var Ve=Jt(29,ve,null,V.mode);return Ve.lanes=oe,Ve.return=V,Ve}}}var Fr=Gf(!0),$f=Gf(!1),sr=!1;function $o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fo(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function or(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ur(e,n,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ke&2)!==0){var f=s.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),s.pending=n,n=wl(e),Rf(e,null,a),n}return kl(e,s,n,a),wl(e)}function ba(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,a|=s,n.lanes=a,Od(e,a)}}function Vo(e,n){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var f=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,a=a.next}while(a!==null);m===null?f=m=n:m=m.next=n}else f=m=n;a={baseState:s.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var Yo=!1;function xa(){if(Yo){var e=wi;if(e!==null)throw e}}function Sa(e,n,a,s){Yo=!1;var f=e.updateQueue;sr=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,R=f.shared.pending;if(R!==null){f.shared.pending=null;var _=R,Z=_.next;_.next=null,b===null?m=Z:b.next=Z,b=_;var le=e.alternate;le!==null&&(le=le.updateQueue,R=le.lastBaseUpdate,R!==b&&(R===null?le.firstBaseUpdate=Z:R.next=Z,le.lastBaseUpdate=_))}if(m!==null){var ce=f.baseState;b=0,le=Z=_=null,R=m;do{var ee=R.lane&-536870913,re=ee!==R.lane;if(re?(Le&ee)===ee:(s&ee)===ee){ee!==0&&ee===ki&&(Yo=!0),le!==null&&(le=le.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var ye=e,ke=R;ee=n;var et=a;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){ce=ye.call(et,ce,ee);break e}ce=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ee=typeof ye=="function"?ye.call(et,ce,ee):ye,ee==null)break e;ce=y({},ce,ee);break e;case 2:sr=!0}}ee=R.callback,ee!==null&&(e.flags|=64,re&&(e.flags|=8192),re=f.callbacks,re===null?f.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:R.tag,payload:R.payload,callback:R.callback,next:null},le===null?(Z=le=re,_=ce):le=le.next=re,b|=ee;if(R=R.next,R===null){if(R=f.shared.pending,R===null)break;re=R,R=re.next,re.next=null,f.lastBaseUpdate=re,f.shared.pending=null}}while(!0);le===null&&(_=ce),f.baseState=_,f.firstBaseUpdate=Z,f.lastBaseUpdate=le,m===null&&(f.shared.lanes=0),mr|=b,e.lanes=b,e.memoizedState=ce}}function Ff(e,n){if(typeof e!="function")throw Error(l(191,e));e.call(n)}function Vf(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Ff(a[e],n)}var Ri=E(null),Ol=E(0);function Yf(e,n){e=Kn,j(Ol,e),j(Ri,n),Kn=e|n.baseLanes}function Po(){j(Ol,Kn),j(Ri,Ri.current)}function Ko(){Kn=Ol.current,L(Ri),L(Ol)}var Wt=E(null),gn=null;function cr(e){var n=e.alternate;j(ht,ht.current&1),j(Wt,e),gn===null&&(n===null||Ri.current!==null||n.memoizedState!==null)&&(gn=e)}function Xo(e){j(ht,ht.current),j(Wt,e),gn===null&&(gn=e)}function Pf(e){e.tag===22?(j(ht,ht.current),j(Wt,e),gn===null&&(gn=e)):dr()}function dr(){j(ht,ht.current),j(Wt,Wt.current)}function en(e){L(Wt),gn===e&&(gn=null),L(ht)}var ht=E(0);function Ml(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||tc(a)||nc(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Un=0,Ae=null,Je=null,yt=null,zl=!1,Ti=!1,Vr=!1,_l=0,ka=0,Ei=null,Yb=0;function ut(){throw Error(l(321))}function Qo(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!Zt(e[a],n[a]))return!1;return!0}function Zo(e,n,a,s,f,m){return Un=m,Ae=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,D.H=e===null||e.memoizedState===null?Ah:fu,Vr=!1,m=a(s,f),Vr=!1,Ti&&(m=Xf(n,a,s,f)),Kf(e),m}function Kf(e){D.H=ja;var n=Je!==null&&Je.next!==null;if(Un=0,yt=Je=Ae=null,zl=!1,ka=0,Ei=null,n)throw Error(l(300));e===null||vt||(e=e.dependencies,e!==null&&Rl(e)&&(vt=!0))}function Xf(e,n,a,s){Ae=e;var f=0;do{if(Ti&&(Ei=null),ka=0,Ti=!1,25<=f)throw Error(l(301));if(f+=1,yt=Je=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}D.H=Ih,m=n(a,s)}while(Ti);return m}function Pb(){var e=D.H,n=e.useState()[0];return n=typeof n.then=="function"?wa(n):n,e=e.useState()[0],(Je!==null?Je.memoizedState:null)!==e&&(Ae.flags|=1024),n}function Jo(){var e=_l!==0;return _l=0,e}function Wo(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function eu(e){if(zl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}zl=!1}Un=0,yt=Je=Ae=null,Ti=!1,ka=_l=0,Ei=null}function _t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?Ae.memoizedState=yt=e:yt=yt.next=e,yt}function mt(){if(Je===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var n=yt===null?Ae.memoizedState:yt.next;if(n!==null)yt=n,Je=e;else{if(e===null)throw Ae.alternate===null?Error(l(467)):Error(l(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},yt===null?Ae.memoizedState=yt=e:yt=yt.next=e}return yt}function Ll(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wa(e){var n=ka;return ka+=1,Ei===null&&(Ei=[]),e=Hf(Ei,e,n),n=Ae,(yt===null?n.memoizedState:yt.next)===null&&(n=n.alternate,D.H=n===null||n.memoizedState===null?Ah:fu),e}function Bl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wa(e);if(e.$$typeof===A)return At(e)}throw Error(l(438,String(e)))}function tu(e){var n=null,a=Ae.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var s=Ae.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Ll(),Ae.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),s=0;s<e;s++)a[s]=z;return n.index++,a}function qn(e,n){return typeof n=="function"?n(e):n}function Hl(e){var n=mt();return nu(n,Je,e)}function nu(e,n,a){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=a;var f=e.baseQueue,m=s.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}n.baseQueue=f=m,s.pending=null}if(m=e.baseState,f===null)e.memoizedState=m;else{n=f.next;var R=b=null,_=null,Z=n,le=!1;do{var ce=Z.lane&-536870913;if(ce!==Z.lane?(Le&ce)===ce:(Un&ce)===ce){var ee=Z.revertLane;if(ee===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),ce===ki&&(le=!0);else if((Un&ee)===ee){Z=Z.next,ee===ki&&(le=!0);continue}else ce={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},_===null?(R=_=ce,b=m):_=_.next=ce,Ae.lanes|=ee,mr|=ee;ce=Z.action,Vr&&a(m,ce),m=Z.hasEagerState?Z.eagerState:a(m,ce)}else ee={lane:ce,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},_===null?(R=_=ee,b=m):_=_.next=ee,Ae.lanes|=ce,mr|=ce;Z=Z.next}while(Z!==null&&Z!==n);if(_===null?b=m:_.next=R,!Zt(m,e.memoizedState)&&(vt=!0,le&&(a=wi,a!==null)))throw a;e.memoizedState=m,e.baseState=b,e.baseQueue=_,s.lastRenderedState=m}return f===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function ru(e){var n=mt(),a=n.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=e;var s=a.dispatch,f=a.pending,m=n.memoizedState;if(f!==null){a.pending=null;var b=f=f.next;do m=e(m,b.action),b=b.next;while(b!==f);Zt(m,n.memoizedState)||(vt=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),a.lastRenderedState=m}return[m,s]}function Qf(e,n,a){var s=Ae,f=mt(),m=He;if(m){if(a===void 0)throw Error(l(407));a=a()}else a=n();var b=!Zt((Je||f).memoizedState,a);if(b&&(f.memoizedState=a,vt=!0),f=f.queue,lu(Wf.bind(null,s,f,e),[e]),f.getSnapshot!==n||b||yt!==null&&yt.memoizedState.tag&1){if(s.flags|=2048,Ni(9,{destroy:void 0},Jf.bind(null,s,f,a,n),null),tt===null)throw Error(l(349));m||(Un&127)!==0||Zf(s,n,a)}return a}function Zf(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Ae.updateQueue,n===null?(n=Ll(),Ae.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function Jf(e,n,a,s){n.value=a,n.getSnapshot=s,eh(n)&&th(e)}function Wf(e,n,a){return a(function(){eh(n)&&th(e)})}function eh(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!Zt(e,a)}catch{return!0}}function th(e){var n=_r(e,2);n!==null&&Yt(n,e,2)}function iu(e){var n=_t();if(typeof e=="function"){var a=e;if(e=a(),Vr){ft(!0);try{a()}finally{ft(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:e},n}function nh(e,n,a,s){return e.baseState=a,nu(e,Je,typeof s=="function"?s:qn)}function Kb(e,n,a,s,f){if(Gl(e))throw Error(l(485));if(e=n.action,e!==null){var m={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};D.T!==null?a(!0):m.isTransition=!1,s(m),a=n.pending,a===null?(m.next=n.pending=m,rh(n,m)):(m.next=a.next,n.pending=a.next=m)}}function rh(e,n){var a=n.action,s=n.payload,f=e.state;if(n.isTransition){var m=D.T,b={};D.T=b;try{var R=a(f,s),_=D.S;_!==null&&_(b,R),ih(e,n,R)}catch(Z){au(e,n,Z)}finally{m!==null&&b.types!==null&&(m.types=b.types),D.T=m}}else try{m=a(f,s),ih(e,n,m)}catch(Z){au(e,n,Z)}}function ih(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){ah(e,n,s)},function(s){return au(e,n,s)}):ah(e,n,a)}function ah(e,n,a){n.status="fulfilled",n.value=a,lh(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,rh(e,a)))}function au(e,n,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=a,lh(n),n=n.next;while(n!==s)}e.action=null}function lh(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function sh(e,n){return n}function oh(e,n){if(He){var a=tt.formState;if(a!==null){e:{var s=Ae;if(He){if(at){t:{for(var f=at,m=pn;f.nodeType!==8;){if(!m){f=null;break t}if(f=yn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){at=yn(f.nextSibling),s=f.data==="F!";break e}}ar(s)}s=!1}s&&(n=a[0])}}return a=_t(),a.memoizedState=a.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sh,lastRenderedState:n},a.queue=s,a=Th.bind(null,Ae,s),s.dispatch=a,s=iu(!1),m=du.bind(null,Ae,!1,s.queue),s=_t(),f={state:n,dispatch:null,action:e,pending:null},s.queue=f,a=Kb.bind(null,Ae,f,m,a),f.dispatch=a,s.memoizedState=e,[n,a,!1]}function uh(e){var n=mt();return ch(n,Je,e)}function ch(e,n,a){if(n=nu(e,n,sh)[0],e=Hl(qn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=wa(n)}catch(b){throw b===Ci?Nl:b}else s=n;n=mt();var f=n.queue,m=f.dispatch;return a!==n.memoizedState&&(Ae.flags|=2048,Ni(9,{destroy:void 0},Xb.bind(null,f,a),null)),[s,m,e]}function Xb(e,n){e.action=n}function dh(e){var n=mt(),a=Je;if(a!==null)return ch(n,a,e);mt(),n=n.memoizedState,a=mt();var s=a.queue.dispatch;return a.memoizedState=e,[n,s,!1]}function Ni(e,n,a,s){return e={tag:e,create:a,deps:s,inst:n,next:null},n=Ae.updateQueue,n===null&&(n=Ll(),Ae.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,n.lastEffect=e),e}function fh(){return mt().memoizedState}function Ul(e,n,a,s){var f=_t();Ae.flags|=e,f.memoizedState=Ni(1|n,{destroy:void 0},a,s===void 0?null:s)}function ql(e,n,a,s){var f=mt();s=s===void 0?null:s;var m=f.memoizedState.inst;Je!==null&&s!==null&&Qo(s,Je.memoizedState.deps)?f.memoizedState=Ni(n,m,a,s):(Ae.flags|=e,f.memoizedState=Ni(1|n,m,a,s))}function hh(e,n){Ul(8390656,8,e,n)}function lu(e,n){ql(2048,8,e,n)}function Qb(e){Ae.flags|=4;var n=Ae.updateQueue;if(n===null)n=Ll(),Ae.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function mh(e){var n=mt().memoizedState;return Qb({ref:n,nextImpl:e}),function(){if((Ke&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function ph(e,n){return ql(4,2,e,n)}function gh(e,n){return ql(4,4,e,n)}function yh(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function vh(e,n,a){a=a!=null?a.concat([e]):null,ql(4,4,yh.bind(null,n,e),a)}function su(){}function bh(e,n){var a=mt();n=n===void 0?null:n;var s=a.memoizedState;return n!==null&&Qo(n,s[1])?s[0]:(a.memoizedState=[e,n],e)}function xh(e,n){var a=mt();n=n===void 0?null:n;var s=a.memoizedState;if(n!==null&&Qo(n,s[1]))return s[0];if(s=e(),Vr){ft(!0);try{e()}finally{ft(!1)}}return a.memoizedState=[s,n],s}function ou(e,n,a){return a===void 0||(Un&1073741824)!==0&&(Le&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Sm(),Ae.lanes|=e,mr|=e,a)}function Sh(e,n,a,s){return Zt(a,n)?a:Ri.current!==null?(e=ou(e,a,s),Zt(e,n)||(vt=!0),e):(Un&42)===0||(Un&1073741824)!==0&&(Le&261930)===0?(vt=!0,e.memoizedState=a):(e=Sm(),Ae.lanes|=e,mr|=e,n)}function kh(e,n,a,s,f){var m=U.p;U.p=m!==0&&8>m?m:8;var b=D.T,R={};D.T=R,du(e,!1,n,a);try{var _=f(),Z=D.S;if(Z!==null&&Z(R,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var le=Vb(_,s);Ca(e,n,le,rn(e))}else Ca(e,n,s,rn(e))}catch(ce){Ca(e,n,{then:function(){},status:"rejected",reason:ce},rn())}finally{U.p=m,b!==null&&R.types!==null&&(b.types=R.types),D.T=b}}function Zb(){}function uu(e,n,a,s){if(e.tag!==5)throw Error(l(476));var f=wh(e).queue;kh(e,f,n,G,a===null?Zb:function(){return Ch(e),a(s)})}function wh(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:G},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Ch(e){var n=wh(e);n.next===null&&(n=e.alternate.memoizedState),Ca(e,n.next.queue,{},rn())}function cu(){return At(qa)}function jh(){return mt().memoizedState}function Rh(){return mt().memoizedState}function Jb(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=rn();e=or(a);var s=ur(n,e,a);s!==null&&(Yt(s,n,a),ba(s,n,a)),n={cache:Ho()},e.payload=n;return}n=n.return}}function Wb(e,n,a){var s=rn();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Gl(e)?Eh(n,a):(a=Eo(e,n,a,s),a!==null&&(Yt(a,e,s),Nh(a,n,s)))}function Th(e,n,a){var s=rn();Ca(e,n,a,s)}function Ca(e,n,a,s){var f={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Gl(e))Eh(n,f);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var b=n.lastRenderedState,R=m(b,a);if(f.hasEagerState=!0,f.eagerState=R,Zt(R,b))return kl(e,n,f,0),tt===null&&Sl(),!1}catch{}if(a=Eo(e,n,f,s),a!==null)return Yt(a,e,s),Nh(a,n,s),!0}return!1}function du(e,n,a,s){if(s={lane:2,revertLane:$u(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Gl(e)){if(n)throw Error(l(479))}else n=Eo(e,a,s,2),n!==null&&Yt(n,e,2)}function Gl(e){var n=e.alternate;return e===Ae||n!==null&&n===Ae}function Eh(e,n){Ti=zl=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function Nh(e,n,a){if((a&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,a|=s,n.lanes=a,Od(e,a)}}var ja={readContext:At,use:Bl,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};ja.useEffectEvent=ut;var Ah={readContext:At,use:Bl,useCallback:function(e,n){return _t().memoizedState=[e,n===void 0?null:n],e},useContext:At,useEffect:hh,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Ul(4194308,4,yh.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Ul(4194308,4,e,n)},useInsertionEffect:function(e,n){Ul(4,2,e,n)},useMemo:function(e,n){var a=_t();n=n===void 0?null:n;var s=e();if(Vr){ft(!0);try{e()}finally{ft(!1)}}return a.memoizedState=[s,n],s},useReducer:function(e,n,a){var s=_t();if(a!==void 0){var f=a(n);if(Vr){ft(!0);try{a(n)}finally{ft(!1)}}}else f=n;return s.memoizedState=s.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},s.queue=e,e=e.dispatch=Wb.bind(null,Ae,e),[s.memoizedState,e]},useRef:function(e){var n=_t();return e={current:e},n.memoizedState=e},useState:function(e){e=iu(e);var n=e.queue,a=Th.bind(null,Ae,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:su,useDeferredValue:function(e,n){var a=_t();return ou(a,e,n)},useTransition:function(){var e=iu(!1);return e=kh.bind(null,Ae,e.queue,!0,!1),_t().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var s=Ae,f=_t();if(He){if(a===void 0)throw Error(l(407));a=a()}else{if(a=n(),tt===null)throw Error(l(349));(Le&127)!==0||Zf(s,n,a)}f.memoizedState=a;var m={value:a,getSnapshot:n};return f.queue=m,hh(Wf.bind(null,s,m,e),[e]),s.flags|=2048,Ni(9,{destroy:void 0},Jf.bind(null,s,m,a,n),null),a},useId:function(){var e=_t(),n=tt.identifierPrefix;if(He){var a=Tn,s=Rn;a=(s&~(1<<32-Xe(s)-1)).toString(32)+a,n="_"+n+"R_"+a,a=_l++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=Yb++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:cu,useFormState:oh,useActionState:oh,useOptimistic:function(e){var n=_t();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=du.bind(null,Ae,!0,a),a.dispatch=n,[e,n]},useMemoCache:tu,useCacheRefresh:function(){return _t().memoizedState=Jb.bind(null,Ae)},useEffectEvent:function(e){var n=_t(),a={impl:e};return n.memoizedState=a,function(){if((Ke&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},fu={readContext:At,use:Bl,useCallback:bh,useContext:At,useEffect:lu,useImperativeHandle:vh,useInsertionEffect:ph,useLayoutEffect:gh,useMemo:xh,useReducer:Hl,useRef:fh,useState:function(){return Hl(qn)},useDebugValue:su,useDeferredValue:function(e,n){var a=mt();return Sh(a,Je.memoizedState,e,n)},useTransition:function(){var e=Hl(qn)[0],n=mt().memoizedState;return[typeof e=="boolean"?e:wa(e),n]},useSyncExternalStore:Qf,useId:jh,useHostTransitionStatus:cu,useFormState:uh,useActionState:uh,useOptimistic:function(e,n){var a=mt();return nh(a,Je,e,n)},useMemoCache:tu,useCacheRefresh:Rh};fu.useEffectEvent=mh;var Ih={readContext:At,use:Bl,useCallback:bh,useContext:At,useEffect:lu,useImperativeHandle:vh,useInsertionEffect:ph,useLayoutEffect:gh,useMemo:xh,useReducer:ru,useRef:fh,useState:function(){return ru(qn)},useDebugValue:su,useDeferredValue:function(e,n){var a=mt();return Je===null?ou(a,e,n):Sh(a,Je.memoizedState,e,n)},useTransition:function(){var e=ru(qn)[0],n=mt().memoizedState;return[typeof e=="boolean"?e:wa(e),n]},useSyncExternalStore:Qf,useId:jh,useHostTransitionStatus:cu,useFormState:dh,useActionState:dh,useOptimistic:function(e,n){var a=mt();return Je!==null?nh(a,Je,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:tu,useCacheRefresh:Rh};Ih.useEffectEvent=mh;function hu(e,n,a,s){n=e.memoizedState,a=a(s,n),a=a==null?n:y({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var mu={enqueueSetState:function(e,n,a){e=e._reactInternals;var s=rn(),f=or(s);f.payload=n,a!=null&&(f.callback=a),n=ur(e,f,s),n!==null&&(Yt(n,e,s),ba(n,e,s))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var s=rn(),f=or(s);f.tag=1,f.payload=n,a!=null&&(f.callback=a),n=ur(e,f,s),n!==null&&(Yt(n,e,s),ba(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=rn(),s=or(a);s.tag=2,n!=null&&(s.callback=n),n=ur(e,s,a),n!==null&&(Yt(n,e,a),ba(n,e,a))}};function Dh(e,n,a,s,f,m,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,m,b):n.prototype&&n.prototype.isPureReactComponent?!da(a,s)||!da(f,m):!0}function Oh(e,n,a,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,s),n.state!==e&&mu.enqueueReplaceState(n,n.state,null)}function Yr(e,n){var a=n;if("ref"in n){a={};for(var s in n)s!=="ref"&&(a[s]=n[s])}if(e=e.defaultProps){a===n&&(a=y({},a));for(var f in e)a[f]===void 0&&(a[f]=e[f])}return a}function Mh(e){xl(e)}function zh(e){console.error(e)}function _h(e){xl(e)}function $l(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Lh(e,n,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function pu(e,n,a){return a=or(a),a.tag=3,a.payload={element:null},a.callback=function(){$l(e,n)},a}function Bh(e){return e=or(e),e.tag=3,e}function Hh(e,n,a,s){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var m=s.value;e.payload=function(){return f(m)},e.callback=function(){Lh(n,a,s)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Lh(n,a,s),typeof f!="function"&&(pr===null?pr=new Set([this]):pr.add(this));var R=s.stack;this.componentDidCatch(s.value,{componentStack:R!==null?R:""})})}function ex(e,n,a,s,f){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=a.alternate,n!==null&&Si(n,a,f,!0),a=Wt.current,a!==null){switch(a.tag){case 31:case 13:return gn===null?ts():a.alternate===null&&ct===0&&(ct=3),a.flags&=-257,a.flags|=65536,a.lanes=f,s===Al?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([s]):n.add(s),Uu(e,s,f)),!1;case 22:return a.flags|=65536,s===Al?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([s]):a.add(s)),Uu(e,s,f)),!1}throw Error(l(435,a.tag))}return Uu(e,s,f),ts(),!1}if(He)return n=Wt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,s!==Mo&&(e=Error(l(422),{cause:s}),ma(fn(e,a)))):(s!==Mo&&(n=Error(l(423),{cause:s}),ma(fn(n,a))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=fn(s,a),f=pu(e.stateNode,s,f),Vo(e,f),ct!==4&&(ct=2)),!1;var m=Error(l(520),{cause:s});if(m=fn(m,a),Oa===null?Oa=[m]:Oa.push(m),ct!==4&&(ct=2),n===null)return!0;s=fn(s,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=f&-f,a.lanes|=e,e=pu(a.stateNode,s,e),Vo(a,e),!1;case 1:if(n=a.type,m=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(pr===null||!pr.has(m))))return a.flags|=65536,f&=-f,a.lanes|=f,f=Bh(f),Hh(f,e,a,s),Vo(a,f),!1}a=a.return}while(a!==null);return!1}var gu=Error(l(461)),vt=!1;function It(e,n,a,s){n.child=e===null?$f(n,null,a,s):Fr(n,e.child,a,s)}function Uh(e,n,a,s,f){a=a.render;var m=n.ref;if("ref"in s){var b={};for(var R in s)R!=="ref"&&(b[R]=s[R])}else b=s;return Ur(n),s=Zo(e,n,a,b,m,f),R=Jo(),e!==null&&!vt?(Wo(e,n,f),Gn(e,n,f)):(He&&R&&Do(n),n.flags|=1,It(e,n,s,f),n.child)}function qh(e,n,a,s,f){if(e===null){var m=a.type;return typeof m=="function"&&!No(m)&&m.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=m,Gh(e,n,m,s,f)):(e=Cl(a.type,null,s,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(m=e.child,!Cu(e,f)){var b=m.memoizedProps;if(a=a.compare,a=a!==null?a:da,a(b,s)&&e.ref===n.ref)return Gn(e,n,f)}return n.flags|=1,e=_n(m,s),e.ref=n.ref,e.return=n,n.child=e}function Gh(e,n,a,s,f){if(e!==null){var m=e.memoizedProps;if(da(m,s)&&e.ref===n.ref)if(vt=!1,n.pendingProps=s=m,Cu(e,f))(e.flags&131072)!==0&&(vt=!0);else return n.lanes=e.lanes,Gn(e,n,f)}return yu(e,n,a,s,f)}function $h(e,n,a,s){var f=s.children,m=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(m=m!==null?m.baseLanes|a:a,e!==null){for(s=n.child=e.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;s=f&~m}else s=0,n.child=null;return Fh(e,n,m,a,s)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&El(n,m!==null?m.cachePool:null),m!==null?Yf(n,m):Po(),Pf(n);else return s=n.lanes=536870912,Fh(e,n,m!==null?m.baseLanes|a:a,a,s)}else m!==null?(El(n,m.cachePool),Yf(n,m),dr(),n.memoizedState=null):(e!==null&&El(n,null),Po(),dr());return It(e,n,f,a),n.child}function Ra(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Fh(e,n,a,s,f){var m=qo();return m=m===null?null:{parent:gt._currentValue,pool:m},n.memoizedState={baseLanes:a,cachePool:m},e!==null&&El(n,null),Po(),Pf(n),e!==null&&Si(e,n,s,!0),n.childLanes=f,null}function Fl(e,n){return n=Yl({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Vh(e,n,a){return Fr(n,e.child,null,a),e=Fl(n,n.pendingProps),e.flags|=2,en(n),n.memoizedState=null,e}function tx(e,n,a){var s=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(He){if(s.mode==="hidden")return e=Fl(n,s),n.lanes=536870912,Ra(null,e);if(Xo(n),(e=at)?(e=rp(e,pn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:rr!==null?{id:Rn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},a=Ef(e),a.return=n,n.child=a,Nt=n,at=null)):e=null,e===null)throw ar(n);return n.lanes=536870912,null}return Fl(n,s)}var m=e.memoizedState;if(m!==null){var b=m.dehydrated;if(Xo(n),f)if(n.flags&256)n.flags&=-257,n=Vh(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(l(558));else if(vt||Si(e,n,a,!1),f=(a&e.childLanes)!==0,vt||f){if(s=tt,s!==null&&(b=Md(s,a),b!==0&&b!==m.retryLane))throw m.retryLane=b,_r(e,b),Yt(s,e,b),gu;ts(),n=Vh(e,n,a)}else e=m.treeContext,at=yn(b.nextSibling),Nt=n,He=!0,ir=null,pn=!1,e!==null&&If(n,e),n=Fl(n,s),n.flags|=4096;return n}return e=_n(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Vl(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function yu(e,n,a,s,f){return Ur(n),a=Zo(e,n,a,s,void 0,f),s=Jo(),e!==null&&!vt?(Wo(e,n,f),Gn(e,n,f)):(He&&s&&Do(n),n.flags|=1,It(e,n,a,f),n.child)}function Yh(e,n,a,s,f,m){return Ur(n),n.updateQueue=null,a=Xf(n,s,a,f),Kf(e),s=Jo(),e!==null&&!vt?(Wo(e,n,m),Gn(e,n,m)):(He&&s&&Do(n),n.flags|=1,It(e,n,a,m),n.child)}function Ph(e,n,a,s,f){if(Ur(n),n.stateNode===null){var m=yi,b=a.contextType;typeof b=="object"&&b!==null&&(m=At(b)),m=new a(s,m),n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=mu,n.stateNode=m,m._reactInternals=n,m=n.stateNode,m.props=s,m.state=n.memoizedState,m.refs={},$o(n),b=a.contextType,m.context=typeof b=="object"&&b!==null?At(b):yi,m.state=n.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(hu(n,a,b,s),m.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&mu.enqueueReplaceState(m,m.state,null),Sa(n,s,m,f),xa(),m.state=n.memoizedState),typeof m.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){m=n.stateNode;var R=n.memoizedProps,_=Yr(a,R);m.props=_;var Z=m.context,le=a.contextType;b=yi,typeof le=="object"&&le!==null&&(b=At(le));var ce=a.getDerivedStateFromProps;le=typeof ce=="function"||typeof m.getSnapshotBeforeUpdate=="function",R=n.pendingProps!==R,le||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(R||Z!==b)&&Oh(n,m,s,b),sr=!1;var ee=n.memoizedState;m.state=ee,Sa(n,s,m,f),xa(),Z=n.memoizedState,R||ee!==Z||sr?(typeof ce=="function"&&(hu(n,a,ce,s),Z=n.memoizedState),(_=sr||Dh(n,a,_,s,ee,Z,b))?(le||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(n.flags|=4194308)):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=Z),m.props=s,m.state=Z,m.context=b,s=_):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{m=n.stateNode,Fo(e,n),b=n.memoizedProps,le=Yr(a,b),m.props=le,ce=n.pendingProps,ee=m.context,Z=a.contextType,_=yi,typeof Z=="object"&&Z!==null&&(_=At(Z)),R=a.getDerivedStateFromProps,(Z=typeof R=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==ce||ee!==_)&&Oh(n,m,s,_),sr=!1,ee=n.memoizedState,m.state=ee,Sa(n,s,m,f),xa();var re=n.memoizedState;b!==ce||ee!==re||sr||e!==null&&e.dependencies!==null&&Rl(e.dependencies)?(typeof R=="function"&&(hu(n,a,R,s),re=n.memoizedState),(le=sr||Dh(n,a,le,s,ee,re,_)||e!==null&&e.dependencies!==null&&Rl(e.dependencies))?(Z||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(s,re,_),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(s,re,_)),typeof m.componentDidUpdate=="function"&&(n.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=re),m.props=s,m.state=re,m.context=_,s=le):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(n.flags|=1024),s=!1)}return m=s,Vl(e,n),s=(n.flags&128)!==0,m||s?(m=n.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:m.render(),n.flags|=1,e!==null&&s?(n.child=Fr(n,e.child,null,f),n.child=Fr(n,null,a,f)):It(e,n,a,f),n.memoizedState=m.state,e=n.child):e=Gn(e,n,f),e}function Kh(e,n,a,s){return Br(),n.flags|=256,It(e,n,a,s),n.child}var vu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bu(e){return{baseLanes:e,cachePool:Lf()}}function xu(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=nn),e}function Xh(e,n,a){var s=n.pendingProps,f=!1,m=(n.flags&128)!==0,b;if((b=m)||(b=e!==null&&e.memoizedState===null?!1:(ht.current&2)!==0),b&&(f=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(He){if(f?cr(n):dr(),(e=at)?(e=rp(e,pn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:rr!==null?{id:Rn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},a=Ef(e),a.return=n,n.child=a,Nt=n,at=null)):e=null,e===null)throw ar(n);return nc(e)?n.lanes=32:n.lanes=536870912,null}var R=s.children;return s=s.fallback,f?(dr(),f=n.mode,R=Yl({mode:"hidden",children:R},f),s=Lr(s,f,a,null),R.return=n,s.return=n,R.sibling=s,n.child=R,s=n.child,s.memoizedState=bu(a),s.childLanes=xu(e,b,a),n.memoizedState=vu,Ra(null,s)):(cr(n),Su(n,R))}var _=e.memoizedState;if(_!==null&&(R=_.dehydrated,R!==null)){if(m)n.flags&256?(cr(n),n.flags&=-257,n=ku(e,n,a)):n.memoizedState!==null?(dr(),n.child=e.child,n.flags|=128,n=null):(dr(),R=s.fallback,f=n.mode,s=Yl({mode:"visible",children:s.children},f),R=Lr(R,f,a,null),R.flags|=2,s.return=n,R.return=n,s.sibling=R,n.child=s,Fr(n,e.child,null,a),s=n.child,s.memoizedState=bu(a),s.childLanes=xu(e,b,a),n.memoizedState=vu,n=Ra(null,s));else if(cr(n),nc(R)){if(b=R.nextSibling&&R.nextSibling.dataset,b)var Z=b.dgst;b=Z,s=Error(l(419)),s.stack="",s.digest=b,ma({value:s,source:null,stack:null}),n=ku(e,n,a)}else if(vt||Si(e,n,a,!1),b=(a&e.childLanes)!==0,vt||b){if(b=tt,b!==null&&(s=Md(b,a),s!==0&&s!==_.retryLane))throw _.retryLane=s,_r(e,s),Yt(b,e,s),gu;tc(R)||ts(),n=ku(e,n,a)}else tc(R)?(n.flags|=192,n.child=e.child,n=null):(e=_.treeContext,at=yn(R.nextSibling),Nt=n,He=!0,ir=null,pn=!1,e!==null&&If(n,e),n=Su(n,s.children),n.flags|=4096);return n}return f?(dr(),R=s.fallback,f=n.mode,_=e.child,Z=_.sibling,s=_n(_,{mode:"hidden",children:s.children}),s.subtreeFlags=_.subtreeFlags&65011712,Z!==null?R=_n(Z,R):(R=Lr(R,f,a,null),R.flags|=2),R.return=n,s.return=n,s.sibling=R,n.child=s,Ra(null,s),s=n.child,R=e.child.memoizedState,R===null?R=bu(a):(f=R.cachePool,f!==null?(_=gt._currentValue,f=f.parent!==_?{parent:_,pool:_}:f):f=Lf(),R={baseLanes:R.baseLanes|a,cachePool:f}),s.memoizedState=R,s.childLanes=xu(e,b,a),n.memoizedState=vu,Ra(e.child,s)):(cr(n),a=e.child,e=a.sibling,a=_n(a,{mode:"visible",children:s.children}),a.return=n,a.sibling=null,e!==null&&(b=n.deletions,b===null?(n.deletions=[e],n.flags|=16):b.push(e)),n.child=a,n.memoizedState=null,a)}function Su(e,n){return n=Yl({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Yl(e,n){return e=Jt(22,e,null,n),e.lanes=0,e}function ku(e,n,a){return Fr(n,e.child,null,a),e=Su(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Qh(e,n,a){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),Lo(e.return,n,a)}function wu(e,n,a,s,f,m){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:f,treeForkCount:m}:(b.isBackwards=n,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=a,b.tailMode=f,b.treeForkCount=m)}function Zh(e,n,a){var s=n.pendingProps,f=s.revealOrder,m=s.tail;s=s.children;var b=ht.current,R=(b&2)!==0;if(R?(b=b&1|2,n.flags|=128):b&=1,j(ht,b),It(e,n,s,a),s=He?ha:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qh(e,a,n);else if(e.tag===19)Qh(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(a=n.child,f=null;a!==null;)e=a.alternate,e!==null&&Ml(e)===null&&(f=a),a=a.sibling;a=f,a===null?(f=n.child,n.child=null):(f=a.sibling,a.sibling=null),wu(n,!1,f,a,m,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&Ml(e)===null){n.child=f;break}e=f.sibling,f.sibling=a,a=f,f=e}wu(n,!0,a,null,m,s);break;case"together":wu(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Gn(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),mr|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(Si(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(l(153));if(n.child!==null){for(e=n.child,a=_n(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=_n(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Cu(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Rl(e)))}function nx(e,n,a){switch(n.tag){case 3:fe(n,n.stateNode.containerInfo),lr(n,gt,e.memoizedState.cache),Br();break;case 27:case 5:pe(n);break;case 4:fe(n,n.stateNode.containerInfo);break;case 10:lr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Xo(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(cr(n),n.flags|=128,null):(a&n.child.childLanes)!==0?Xh(e,n,a):(cr(n),e=Gn(e,n,a),e!==null?e.sibling:null);cr(n);break;case 19:var f=(e.flags&128)!==0;if(s=(a&n.childLanes)!==0,s||(Si(e,n,a,!1),s=(a&n.childLanes)!==0),f){if(s)return Zh(e,n,a);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),j(ht,ht.current),s)break;return null;case 22:return n.lanes=0,$h(e,n,a,n.pendingProps);case 24:lr(n,gt,e.memoizedState.cache)}return Gn(e,n,a)}function Jh(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)vt=!0;else{if(!Cu(e,a)&&(n.flags&128)===0)return vt=!1,nx(e,n,a);vt=(e.flags&131072)!==0}else vt=!1,He&&(n.flags&1048576)!==0&&Af(n,ha,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Gr(n.elementType),n.type=e,typeof e=="function")No(e)?(s=Yr(e,s),n.tag=1,n=Ph(null,n,e,s,a)):(n.tag=0,n=yu(null,n,e,s,a));else{if(e!=null){var f=e.$$typeof;if(f===F){n.tag=11,n=Uh(null,n,e,s,a);break e}else if(f===q){n.tag=14,n=qh(null,n,e,s,a);break e}}throw n=P(e)||e,Error(l(306,n,""))}}return n;case 0:return yu(e,n,n.type,n.pendingProps,a);case 1:return s=n.type,f=Yr(s,n.pendingProps),Ph(e,n,s,f,a);case 3:e:{if(fe(n,n.stateNode.containerInfo),e===null)throw Error(l(387));s=n.pendingProps;var m=n.memoizedState;f=m.element,Fo(e,n),Sa(n,s,null,a);var b=n.memoizedState;if(s=b.cache,lr(n,gt,s),s!==m.cache&&Bo(n,[gt],a,!0),xa(),s=b.element,m.isDehydrated)if(m={element:s,isDehydrated:!1,cache:b.cache},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){n=Kh(e,n,s,a);break e}else if(s!==f){f=fn(Error(l(424)),n),ma(f),n=Kh(e,n,s,a);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,at=yn(e.firstChild),Nt=n,He=!0,ir=null,pn=!0,a=$f(n,null,s,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Br(),s===f){n=Gn(e,n,a);break e}It(e,n,s,a)}n=n.child}return n;case 26:return Vl(e,n),e===null?(a=up(n.type,null,n.pendingProps,null))?n.memoizedState=a:He||(a=n.type,e=n.pendingProps,s=os(J.current).createElement(a),s[Et]=n,s[Ut]=e,Dt(s,a,e),wt(s),n.stateNode=s):n.memoizedState=up(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return pe(n),e===null&&He&&(s=n.stateNode=lp(n.type,n.pendingProps,J.current),Nt=n,pn=!0,f=at,br(n.type)?(rc=f,at=yn(s.firstChild)):at=f),It(e,n,n.pendingProps.children,a),Vl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&He&&((f=s=at)&&(s=Dx(s,n.type,n.pendingProps,pn),s!==null?(n.stateNode=s,Nt=n,at=yn(s.firstChild),pn=!1,f=!0):f=!1),f||ar(n)),pe(n),f=n.type,m=n.pendingProps,b=e!==null?e.memoizedProps:null,s=m.children,Ju(f,m)?s=null:b!==null&&Ju(f,b)&&(n.flags|=32),n.memoizedState!==null&&(f=Zo(e,n,Pb,null,null,a),qa._currentValue=f),Vl(e,n),It(e,n,s,a),n.child;case 6:return e===null&&He&&((e=a=at)&&(a=Ox(a,n.pendingProps,pn),a!==null?(n.stateNode=a,Nt=n,at=null,e=!0):e=!1),e||ar(n)),null;case 13:return Xh(e,n,a);case 4:return fe(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Fr(n,null,s,a):It(e,n,s,a),n.child;case 11:return Uh(e,n,n.type,n.pendingProps,a);case 7:return It(e,n,n.pendingProps,a),n.child;case 8:return It(e,n,n.pendingProps.children,a),n.child;case 12:return It(e,n,n.pendingProps.children,a),n.child;case 10:return s=n.pendingProps,lr(n,n.type,s.value),It(e,n,s.children,a),n.child;case 9:return f=n.type._context,s=n.pendingProps.children,Ur(n),f=At(f),s=s(f),n.flags|=1,It(e,n,s,a),n.child;case 14:return qh(e,n,n.type,n.pendingProps,a);case 15:return Gh(e,n,n.type,n.pendingProps,a);case 19:return Zh(e,n,a);case 31:return tx(e,n,a);case 22:return $h(e,n,a,n.pendingProps);case 24:return Ur(n),s=At(gt),e===null?(f=qo(),f===null&&(f=tt,m=Ho(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=a),f=m),n.memoizedState={parent:s,cache:f},$o(n),lr(n,gt,f)):((e.lanes&a)!==0&&(Fo(e,n),Sa(n,null,null,a),xa()),f=e.memoizedState,m=n.memoizedState,f.parent!==s?(f={parent:s,cache:s},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),lr(n,gt,s)):(s=m.cache,lr(n,gt,s),s!==f.cache&&Bo(n,[gt],a,!0))),It(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function $n(e){e.flags|=4}function ju(e,n,a,s,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(jm())e.flags|=8192;else throw $r=Al,Go}else e.flags&=-16777217}function Wh(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!mp(n))if(jm())e.flags|=8192;else throw $r=Al,Go}function Pl(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Id():536870912,e.lanes|=n,Oi|=n)}function Ta(e,n){if(!He)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function lt(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(n)for(var f=e.child;f!==null;)a|=f.lanes|f.childLanes,s|=f.subtreeFlags&65011712,s|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)a|=f.lanes|f.childLanes,s|=f.subtreeFlags,s|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=s,e.childLanes=a,n}function rx(e,n,a){var s=n.pendingProps;switch(Oo(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(n),null;case 1:return lt(n),null;case 3:return a=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Hn(gt),me(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(xi(n)?$n(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,zo())),lt(n),null;case 26:var f=n.type,m=n.memoizedState;return e===null?($n(n),m!==null?(lt(n),Wh(n,m)):(lt(n),ju(n,f,null,s,a))):m?m!==e.memoizedState?($n(n),lt(n),Wh(n,m)):(lt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&$n(n),lt(n),ju(n,f,e,s,a)),null;case 27:if(Ie(n),a=J.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&$n(n);else{if(!s){if(n.stateNode===null)throw Error(l(166));return lt(n),null}e=te.current,xi(n)?Df(n):(e=lp(f,s,a),n.stateNode=e,$n(n))}return lt(n),null;case 5:if(Ie(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&$n(n);else{if(!s){if(n.stateNode===null)throw Error(l(166));return lt(n),null}if(m=te.current,xi(n))Df(n);else{var b=os(J.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?m.multiple=!0:s.size&&(m.size=s.size);break;default:m=typeof s.is=="string"?b.createElement(f,{is:s.is}):b.createElement(f)}}m[Et]=n,m[Ut]=s;e:for(b=n.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=m;e:switch(Dt(m,f,s),f){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&$n(n)}}return lt(n),ju(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&$n(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(l(166));if(e=J.current,xi(n)){if(e=n.stateNode,a=n.memoizedProps,s=null,f=Nt,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[Et]=n,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||Xm(e.nodeValue,a)),e||ar(n,!0)}else e=os(e).createTextNode(s),e[Et]=n,n.stateNode=e}return lt(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(s=xi(n),a!==null){if(e===null){if(!s)throw Error(l(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Et]=n}else Br(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;lt(n),e=!1}else a=zo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(en(n),n):(en(n),null);if((n.flags&128)!==0)throw Error(l(558))}return lt(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=xi(n),s!==null&&s.dehydrated!==null){if(e===null){if(!f)throw Error(l(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[Et]=n}else Br(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;lt(n),f=!1}else f=zo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(en(n),n):(en(n),null)}return en(n),(n.flags&128)!==0?(n.lanes=a,n):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=n.child,f=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(f=s.alternate.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==f&&(s.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),Pl(n,n.updateQueue),lt(n),null);case 4:return me(),e===null&&Pu(n.stateNode.containerInfo),lt(n),null;case 10:return Hn(n.type),lt(n),null;case 19:if(L(ht),s=n.memoizedState,s===null)return lt(n),null;if(f=(n.flags&128)!==0,m=s.rendering,m===null)if(f)Ta(s,!1);else{if(ct!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(m=Ml(e),m!==null){for(n.flags|=128,Ta(s,!1),e=m.updateQueue,n.updateQueue=e,Pl(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)Tf(a,e),a=a.sibling;return j(ht,ht.current&1|2),He&&Ln(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Fe()>Jl&&(n.flags|=128,f=!0,Ta(s,!1),n.lanes=4194304)}else{if(!f)if(e=Ml(m),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Pl(n,e),Ta(s,!0),s.tail===null&&s.tailMode==="hidden"&&!m.alternate&&!He)return lt(n),null}else 2*Fe()-s.renderingStartTime>Jl&&a!==536870912&&(n.flags|=128,f=!0,Ta(s,!1),n.lanes=4194304);s.isBackwards?(m.sibling=n.child,n.child=m):(e=s.last,e!==null?e.sibling=m:n.child=m,s.last=m)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Fe(),e.sibling=null,a=ht.current,j(ht,f?a&1|2:a&1),He&&Ln(n,s.treeForkCount),e):(lt(n),null);case 22:case 23:return en(n),Ko(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(a&536870912)!==0&&(n.flags&128)===0&&(lt(n),n.subtreeFlags&6&&(n.flags|=8192)):lt(n),a=n.updateQueue,a!==null&&Pl(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==a&&(n.flags|=2048),e!==null&&L(qr),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Hn(gt),lt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function ix(e,n){switch(Oo(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Hn(gt),me(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Ie(n),null;case 31:if(n.memoizedState!==null){if(en(n),n.alternate===null)throw Error(l(340));Br()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(en(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Br()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return L(ht),null;case 4:return me(),null;case 10:return Hn(n.type),null;case 22:case 23:return en(n),Ko(),e!==null&&L(qr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Hn(gt),null;case 25:return null;default:return null}}function em(e,n){switch(Oo(n),n.tag){case 3:Hn(gt),me();break;case 26:case 27:case 5:Ie(n);break;case 4:me();break;case 31:n.memoizedState!==null&&en(n);break;case 13:en(n);break;case 19:L(ht);break;case 10:Hn(n.type);break;case 22:case 23:en(n),Ko(),e!==null&&L(qr);break;case 24:Hn(gt)}}function Ea(e,n){try{var a=n.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var f=s.next;a=f;do{if((a.tag&e)===e){s=void 0;var m=a.create,b=a.inst;s=m(),b.destroy=s}a=a.next}while(a!==f)}}catch(R){Ze(n,n.return,R)}}function fr(e,n,a){try{var s=n.updateQueue,f=s!==null?s.lastEffect:null;if(f!==null){var m=f.next;s=m;do{if((s.tag&e)===e){var b=s.inst,R=b.destroy;if(R!==void 0){b.destroy=void 0,f=n;var _=a,Z=R;try{Z()}catch(le){Ze(f,_,le)}}}s=s.next}while(s!==m)}}catch(le){Ze(n,n.return,le)}}function tm(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{Vf(n,a)}catch(s){Ze(e,e.return,s)}}}function nm(e,n,a){a.props=Yr(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Ze(e,n,s)}}function Na(e,n){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(f){Ze(e,n,f)}}function En(e,n){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(f){Ze(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Ze(e,n,f)}else a.current=null}function rm(e){var n=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(f){Ze(e,e.return,f)}}function Ru(e,n,a){try{var s=e.stateNode;Rx(s,e.type,a,n),s[Ut]=n}catch(f){Ze(e,e.return,f)}}function im(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&br(e.type)||e.tag===4}function Tu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||im(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&&br(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 Eu(e,n,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=Mn));else if(s!==4&&(s===27&&br(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Eu(e,n,a),e=e.sibling;e!==null;)Eu(e,n,a),e=e.sibling}function Kl(e,n,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(s!==4&&(s===27&&br(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Kl(e,n,a),e=e.sibling;e!==null;)Kl(e,n,a),e=e.sibling}function am(e){var n=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Dt(n,s,a),n[Et]=e,n[Ut]=a}catch(m){Ze(e,e.return,m)}}var Fn=!1,bt=!1,Nu=!1,lm=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function ax(e,n){if(e=e.containerInfo,Qu=ps,e=vf(e),ko(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var f=s.anchorOffset,m=s.focusNode;s=s.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var b=0,R=-1,_=-1,Z=0,le=0,ce=e,ee=null;t:for(;;){for(var re;ce!==a||f!==0&&ce.nodeType!==3||(R=b+f),ce!==m||s!==0&&ce.nodeType!==3||(_=b+s),ce.nodeType===3&&(b+=ce.nodeValue.length),(re=ce.firstChild)!==null;)ee=ce,ce=re;for(;;){if(ce===e)break t;if(ee===a&&++Z===f&&(R=b),ee===m&&++le===s&&(_=b),(re=ce.nextSibling)!==null)break;ce=ee,ee=ce.parentNode}ce=re}a=R===-1||_===-1?null:{start:R,end:_}}else a=null}a=a||{start:0,end:0}}else a=null;for(Zu={focusedElem:e,selectionRange:a},ps=!1,Ct=n;Ct!==null;)if(n=Ct,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Ct=e;else for(;Ct!==null;){switch(n=Ct,m=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)f=e[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,a=n,f=m.memoizedProps,m=m.memoizedState,s=a.stateNode;try{var ye=Yr(a.type,f);e=s.getSnapshotBeforeUpdate(ye,m),s.__reactInternalSnapshotBeforeUpdate=e}catch(ke){Ze(a,a.return,ke)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)ec(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ec(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(l(163))}if(e=n.sibling,e!==null){e.return=n.return,Ct=e;break}Ct=n.return}}function sm(e,n,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Yn(e,a),s&4&&Ea(5,a);break;case 1:if(Yn(e,a),s&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(b){Ze(a,a.return,b)}else{var f=Yr(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ze(a,a.return,b)}}s&64&&tm(a),s&512&&Na(a,a.return);break;case 3:if(Yn(e,a),s&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Vf(e,n)}catch(b){Ze(a,a.return,b)}}break;case 27:n===null&&s&4&&am(a);case 26:case 5:Yn(e,a),n===null&&s&4&&rm(a),s&512&&Na(a,a.return);break;case 12:Yn(e,a);break;case 31:Yn(e,a),s&4&&cm(e,a);break;case 13:Yn(e,a),s&4&&dm(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=mx.bind(null,a),Mx(e,a))));break;case 22:if(s=a.memoizedState!==null||Fn,!s){n=n!==null&&n.memoizedState!==null||bt,f=Fn;var m=bt;Fn=s,(bt=n)&&!m?Pn(e,a,(a.subtreeFlags&8772)!==0):Yn(e,a),Fn=f,bt=m}break;case 30:break;default:Yn(e,a)}}function om(e){var n=e.alternate;n!==null&&(e.alternate=null,om(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&io(n)),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 st=null,Gt=!1;function Vn(e,n,a){for(a=a.child;a!==null;)um(e,n,a),a=a.sibling}function um(e,n,a){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(Ee,a)}catch{}switch(a.tag){case 26:bt||En(a,n),Vn(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:bt||En(a,n);var s=st,f=Gt;br(a.type)&&(st=a.stateNode,Gt=!1),Vn(e,n,a),Ba(a.stateNode),st=s,Gt=f;break;case 5:bt||En(a,n);case 6:if(s=st,f=Gt,st=null,Vn(e,n,a),st=s,Gt=f,st!==null)if(Gt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(a.stateNode)}catch(m){Ze(a,n,m)}else try{st.removeChild(a.stateNode)}catch(m){Ze(a,n,m)}break;case 18:st!==null&&(Gt?(e=st,tp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),qi(e)):tp(st,a.stateNode));break;case 4:s=st,f=Gt,st=a.stateNode.containerInfo,Gt=!0,Vn(e,n,a),st=s,Gt=f;break;case 0:case 11:case 14:case 15:fr(2,a,n),bt||fr(4,a,n),Vn(e,n,a);break;case 1:bt||(En(a,n),s=a.stateNode,typeof s.componentWillUnmount=="function"&&nm(a,n,s)),Vn(e,n,a);break;case 21:Vn(e,n,a);break;case 22:bt=(s=bt)||a.memoizedState!==null,Vn(e,n,a),bt=s;break;default:Vn(e,n,a)}}function cm(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qi(e)}catch(a){Ze(n,n.return,a)}}}function dm(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qi(e)}catch(a){Ze(n,n.return,a)}}function lx(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new lm),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new lm),n;default:throw Error(l(435,e.tag))}}function Xl(e,n){var a=lx(e);n.forEach(function(s){if(!a.has(s)){a.add(s);var f=px.bind(null,e,s);s.then(f,f)}})}function $t(e,n){var a=n.deletions;if(a!==null)for(var s=0;s<a.length;s++){var f=a[s],m=e,b=n,R=b;e:for(;R!==null;){switch(R.tag){case 27:if(br(R.type)){st=R.stateNode,Gt=!1;break e}break;case 5:st=R.stateNode,Gt=!1;break e;case 3:case 4:st=R.stateNode.containerInfo,Gt=!0;break e}R=R.return}if(st===null)throw Error(l(160));um(m,b,f),st=null,Gt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)fm(n,e),n=n.sibling}var Sn=null;function fm(e,n){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$t(n,e),Ft(e),s&4&&(fr(3,e,e.return),Ea(3,e),fr(5,e,e.return));break;case 1:$t(n,e),Ft(e),s&512&&(bt||a===null||En(a,a.return)),s&64&&Fn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var f=Sn;if($t(n,e),Ft(e),s&512&&(bt||a===null||En(a,a.return)),s&4){var m=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,f=f.ownerDocument||f;t:switch(s){case"title":m=f.getElementsByTagName("title")[0],(!m||m[na]||m[Et]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(s),f.head.insertBefore(m,f.querySelector("head > title"))),Dt(m,s,a),m[Et]=e,wt(m),s=m;break e;case"link":var b=fp("link","href",f).get(s+(a.href||""));if(b){for(var R=0;R<b.length;R++)if(m=b[R],m.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&m.getAttribute("rel")===(a.rel==null?null:a.rel)&&m.getAttribute("title")===(a.title==null?null:a.title)&&m.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(R,1);break t}}m=f.createElement(s),Dt(m,s,a),f.head.appendChild(m);break;case"meta":if(b=fp("meta","content",f).get(s+(a.content||""))){for(R=0;R<b.length;R++)if(m=b[R],m.getAttribute("content")===(a.content==null?null:""+a.content)&&m.getAttribute("name")===(a.name==null?null:a.name)&&m.getAttribute("property")===(a.property==null?null:a.property)&&m.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&m.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(R,1);break t}}m=f.createElement(s),Dt(m,s,a),f.head.appendChild(m);break;default:throw Error(l(468,s))}m[Et]=e,wt(m),s=m}e.stateNode=s}else hp(f,e.type,e.stateNode);else e.stateNode=dp(f,s,e.memoizedProps);else m!==s?(m===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):m.count--,s===null?hp(f,e.type,e.stateNode):dp(f,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Ru(e,e.memoizedProps,a.memoizedProps)}break;case 27:$t(n,e),Ft(e),s&512&&(bt||a===null||En(a,a.return)),a!==null&&s&4&&Ru(e,e.memoizedProps,a.memoizedProps);break;case 5:if($t(n,e),Ft(e),s&512&&(bt||a===null||En(a,a.return)),e.flags&32){f=e.stateNode;try{ci(f,"")}catch(ye){Ze(e,e.return,ye)}}s&4&&e.stateNode!=null&&(f=e.memoizedProps,Ru(e,f,a!==null?a.memoizedProps:f)),s&1024&&(Nu=!0);break;case 6:if($t(n,e),Ft(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(ye){Ze(e,e.return,ye)}}break;case 3:if(ds=null,f=Sn,Sn=us(n.containerInfo),$t(n,e),Sn=f,Ft(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{qi(n.containerInfo)}catch(ye){Ze(e,e.return,ye)}Nu&&(Nu=!1,hm(e));break;case 4:s=Sn,Sn=us(e.stateNode.containerInfo),$t(n,e),Ft(e),Sn=s;break;case 12:$t(n,e),Ft(e);break;case 31:$t(n,e),Ft(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Xl(e,s)));break;case 13:$t(n,e),Ft(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Zl=Fe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Xl(e,s)));break;case 22:f=e.memoizedState!==null;var _=a!==null&&a.memoizedState!==null,Z=Fn,le=bt;if(Fn=Z||f,bt=le||_,$t(n,e),bt=le,Fn=Z,Ft(e),s&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(a===null||_||Fn||bt||Pr(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){_=a=n;try{if(m=_.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{R=_.stateNode;var ce=_.memoizedProps.style,ee=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;R.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ye){Ze(_,_.return,ye)}}}else if(n.tag===6){if(a===null){_=n;try{_.stateNode.nodeValue=f?"":_.memoizedProps}catch(ye){Ze(_,_.return,ye)}}}else if(n.tag===18){if(a===null){_=n;try{var re=_.stateNode;f?np(re,!0):np(_.stateNode,!1)}catch(ye){Ze(_,_.return,ye)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Xl(e,a))));break;case 19:$t(n,e),Ft(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Xl(e,s)));break;case 30:break;case 21:break;default:$t(n,e),Ft(e)}}function Ft(e){var n=e.flags;if(n&2){try{for(var a,s=e.return;s!==null;){if(im(s)){a=s;break}s=s.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var f=a.stateNode,m=Tu(e);Kl(e,m,f);break;case 5:var b=a.stateNode;a.flags&32&&(ci(b,""),a.flags&=-33);var R=Tu(e);Kl(e,R,b);break;case 3:case 4:var _=a.stateNode.containerInfo,Z=Tu(e);Eu(e,Z,_);break;default:throw Error(l(161))}}catch(le){Ze(e,e.return,le)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function hm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;hm(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Yn(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)sm(e,n.alternate,n),n=n.sibling}function Pr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:fr(4,n,n.return),Pr(n);break;case 1:En(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&nm(n,n.return,a),Pr(n);break;case 27:Ba(n.stateNode);case 26:case 5:En(n,n.return),Pr(n);break;case 22:n.memoizedState===null&&Pr(n);break;case 30:Pr(n);break;default:Pr(n)}e=e.sibling}}function Pn(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,f=e,m=n,b=m.flags;switch(m.tag){case 0:case 11:case 15:Pn(f,m,a),Ea(4,m);break;case 1:if(Pn(f,m,a),s=m,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Z){Ze(s,s.return,Z)}if(s=m,f=s.updateQueue,f!==null){var R=s.stateNode;try{var _=f.shared.hiddenCallbacks;if(_!==null)for(f.shared.hiddenCallbacks=null,f=0;f<_.length;f++)Ff(_[f],R)}catch(Z){Ze(s,s.return,Z)}}a&&b&64&&tm(m),Na(m,m.return);break;case 27:am(m);case 26:case 5:Pn(f,m,a),a&&s===null&&b&4&&rm(m),Na(m,m.return);break;case 12:Pn(f,m,a);break;case 31:Pn(f,m,a),a&&b&4&&cm(f,m);break;case 13:Pn(f,m,a),a&&b&4&&dm(f,m);break;case 22:m.memoizedState===null&&Pn(f,m,a),Na(m,m.return);break;case 30:break;default:Pn(f,m,a)}n=n.sibling}}function Au(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&pa(a))}function Iu(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&pa(e))}function kn(e,n,a,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)mm(e,n,a,s),n=n.sibling}function mm(e,n,a,s){var f=n.flags;switch(n.tag){case 0:case 11:case 15:kn(e,n,a,s),f&2048&&Ea(9,n);break;case 1:kn(e,n,a,s);break;case 3:kn(e,n,a,s),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&pa(e)));break;case 12:if(f&2048){kn(e,n,a,s),e=n.stateNode;try{var m=n.memoizedProps,b=m.id,R=m.onPostCommit;typeof R=="function"&&R(b,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(_){Ze(n,n.return,_)}}else kn(e,n,a,s);break;case 31:kn(e,n,a,s);break;case 13:kn(e,n,a,s);break;case 23:break;case 22:m=n.stateNode,b=n.alternate,n.memoizedState!==null?m._visibility&2?kn(e,n,a,s):Aa(e,n):m._visibility&2?kn(e,n,a,s):(m._visibility|=2,Ai(e,n,a,s,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Au(b,n);break;case 24:kn(e,n,a,s),f&2048&&Iu(n.alternate,n);break;default:kn(e,n,a,s)}}function Ai(e,n,a,s,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var m=e,b=n,R=a,_=s,Z=b.flags;switch(b.tag){case 0:case 11:case 15:Ai(m,b,R,_,f),Ea(8,b);break;case 23:break;case 22:var le=b.stateNode;b.memoizedState!==null?le._visibility&2?Ai(m,b,R,_,f):Aa(m,b):(le._visibility|=2,Ai(m,b,R,_,f)),f&&Z&2048&&Au(b.alternate,b);break;case 24:Ai(m,b,R,_,f),f&&Z&2048&&Iu(b.alternate,b);break;default:Ai(m,b,R,_,f)}n=n.sibling}}function Aa(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,s=n,f=s.flags;switch(s.tag){case 22:Aa(a,s),f&2048&&Au(s.alternate,s);break;case 24:Aa(a,s),f&2048&&Iu(s.alternate,s);break;default:Aa(a,s)}n=n.sibling}}var Ia=8192;function Ii(e,n,a){if(e.subtreeFlags&Ia)for(e=e.child;e!==null;)pm(e,n,a),e=e.sibling}function pm(e,n,a){switch(e.tag){case 26:Ii(e,n,a),e.flags&Ia&&e.memoizedState!==null&&Yx(a,Sn,e.memoizedState,e.memoizedProps);break;case 5:Ii(e,n,a);break;case 3:case 4:var s=Sn;Sn=us(e.stateNode.containerInfo),Ii(e,n,a),Sn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ia,Ia=16777216,Ii(e,n,a),Ia=s):Ii(e,n,a));break;default:Ii(e,n,a)}}function gm(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Da(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];Ct=s,vm(s,e)}gm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ym(e),e=e.sibling}function ym(e){switch(e.tag){case 0:case 11:case 15:Da(e),e.flags&2048&&fr(9,e,e.return);break;case 3:Da(e);break;case 12:Da(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Ql(e)):Da(e);break;default:Da(e)}}function Ql(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];Ct=s,vm(s,e)}gm(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:fr(8,n,n.return),Ql(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,Ql(n));break;default:Ql(n)}e=e.sibling}}function vm(e,n){for(;Ct!==null;){var a=Ct;switch(a.tag){case 0:case 11:case 15:fr(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:pa(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,Ct=s;else e:for(a=e;Ct!==null;){s=Ct;var f=s.sibling,m=s.return;if(om(s),s===a){Ct=null;break e}if(f!==null){f.return=m,Ct=f;break e}Ct=m}}}var sx={getCacheForType:function(e){var n=At(gt),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return At(gt).controller.signal}},ox=typeof WeakMap=="function"?WeakMap:Map,Ke=0,tt=null,Me=null,Le=0,Qe=0,tn=null,hr=!1,Di=!1,Du=!1,Kn=0,ct=0,mr=0,Kr=0,Ou=0,nn=0,Oi=0,Oa=null,Vt=null,Mu=!1,Zl=0,bm=0,Jl=1/0,Wl=null,pr=null,St=0,gr=null,Mi=null,Xn=0,zu=0,_u=null,xm=null,Ma=0,Lu=null;function rn(){return(Ke&2)!==0&&Le!==0?Le&-Le:D.T!==null?$u():zd()}function Sm(){if(nn===0)if((Le&536870912)===0||He){var e=Ar;Ar<<=1,(Ar&3932160)===0&&(Ar=262144),nn=e}else nn=536870912;return e=Wt.current,e!==null&&(e.flags|=32),nn}function Yt(e,n,a){(e===tt&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(zi(e,0),yr(e,Le,nn,!1)),ta(e,a),((Ke&2)===0||e!==tt)&&(e===tt&&((Ke&2)===0&&(Kr|=a),ct===4&&yr(e,Le,nn,!1)),Nn(e))}function km(e,n,a){if((Ke&6)!==0)throw Error(l(327));var s=!a&&(n&127)===0&&(n&e.expiredLanes)===0||ea(e,n),f=s?dx(e,n):Hu(e,n,!0),m=s;do{if(f===0){Di&&!s&&yr(e,n,0,!1);break}else{if(a=e.current.alternate,m&&!ux(a)){f=Hu(e,n,!1),m=!1;continue}if(f===2){if(m=n,e.errorRecoveryDisabledLanes&m)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){n=b;e:{var R=e;f=Oa;var _=R.current.memoizedState.isDehydrated;if(_&&(zi(R,b).flags|=256),b=Hu(R,b,!1),b!==2){if(Du&&!_){R.errorRecoveryDisabledLanes|=m,Kr|=m,f=4;break e}m=Vt,Vt=f,m!==null&&(Vt===null?Vt=m:Vt.push.apply(Vt,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){zi(e,0),yr(e,n,0,!0);break}e:{switch(s=e,m=f,m){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:yr(s,n,nn,!hr);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(f=Zl+300-Fe(),10<f)){if(yr(s,n,nn,!hr),ul(s,0,!0)!==0)break e;Xn=n,s.timeoutHandle=Wm(wm.bind(null,s,a,Vt,Wl,Mu,n,nn,Kr,Oi,hr,m,"Throttled",-0,0),f);break e}wm(s,a,Vt,Wl,Mu,n,nn,Kr,Oi,hr,m,null,-0,0)}}break}while(!0);Nn(e)}function wm(e,n,a,s,f,m,b,R,_,Z,le,ce,ee,re){if(e.timeoutHandle=-1,ce=n.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mn},pm(n,m,ce);var ye=(m&62914560)===m?Zl-Fe():(m&4194048)===m?bm-Fe():0;if(ye=Px(ce,ye),ye!==null){Xn=m,e.cancelPendingCommit=ye(Im.bind(null,e,n,m,a,s,f,b,R,_,le,ce,null,ee,re)),yr(e,m,b,!Z);return}}Im(e,n,m,a,s,f,b,R,_)}function ux(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var f=a[s],m=f.getSnapshot;f=f.value;try{if(!Zt(m(),f))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function yr(e,n,a,s){n&=~Ou,n&=~Kr,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var f=n;0<f;){var m=31-Xe(f),b=1<<m;s[m]=-1,f&=~b}a!==0&&Dd(e,a,n)}function es(){return(Ke&6)===0?(za(0),!1):!0}function Bu(){if(Me!==null){if(Qe===0)var e=Me.return;else e=Me,Bn=Hr=null,eu(e),ji=null,ya=0,e=Me;for(;e!==null;)em(e.alternate,e),e=e.return;Me=null}}function zi(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Nx(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Xn=0,Bu(),tt=e,Me=a=_n(e.current,null),Le=n,Qe=0,tn=null,hr=!1,Di=ea(e,n),Du=!1,Oi=nn=Ou=Kr=mr=ct=0,Vt=Oa=null,Mu=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var f=31-Xe(s),m=1<<f;n|=e[f],s&=~m}return Kn=n,Sl(),a}function Cm(e,n){Ae=null,D.H=ja,n===Ci||n===Nl?(n=Uf(),Qe=3):n===Go?(n=Uf(),Qe=4):Qe=n===gu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,tn=n,Me===null&&(ct=1,$l(e,fn(n,e.current)))}function jm(){var e=Wt.current;return e===null?!0:(Le&4194048)===Le?gn===null:(Le&62914560)===Le||(Le&536870912)!==0?e===gn:!1}function Rm(){var e=D.H;return D.H=ja,e===null?ja:e}function Tm(){var e=D.A;return D.A=sx,e}function ts(){ct=4,hr||(Le&4194048)!==Le&&Wt.current!==null||(Di=!0),(mr&134217727)===0&&(Kr&134217727)===0||tt===null||yr(tt,Le,nn,!1)}function Hu(e,n,a){var s=Ke;Ke|=2;var f=Rm(),m=Tm();(tt!==e||Le!==n)&&(Wl=null,zi(e,n)),n=!1;var b=ct;e:do try{if(Qe!==0&&Me!==null){var R=Me,_=tn;switch(Qe){case 8:Bu(),b=6;break e;case 3:case 2:case 9:case 6:Wt.current===null&&(n=!0);var Z=Qe;if(Qe=0,tn=null,_i(e,R,_,Z),a&&Di){b=0;break e}break;default:Z=Qe,Qe=0,tn=null,_i(e,R,_,Z)}}cx(),b=ct;break}catch(le){Cm(e,le)}while(!0);return n&&e.shellSuspendCounter++,Bn=Hr=null,Ke=s,D.H=f,D.A=m,Me===null&&(tt=null,Le=0,Sl()),b}function cx(){for(;Me!==null;)Em(Me)}function dx(e,n){var a=Ke;Ke|=2;var s=Rm(),f=Tm();tt!==e||Le!==n?(Wl=null,Jl=Fe()+500,zi(e,n)):Di=ea(e,n);e:do try{if(Qe!==0&&Me!==null){n=Me;var m=tn;t:switch(Qe){case 1:Qe=0,tn=null,_i(e,n,m,1);break;case 2:case 9:if(Bf(m)){Qe=0,tn=null,Nm(n);break}n=function(){Qe!==2&&Qe!==9||tt!==e||(Qe=7),Nn(e)},m.then(n,n);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:Bf(m)?(Qe=0,tn=null,Nm(n)):(Qe=0,tn=null,_i(e,n,m,7));break;case 5:var b=null;switch(Me.tag){case 26:b=Me.memoizedState;case 5:case 27:var R=Me;if(b?mp(b):R.stateNode.complete){Qe=0,tn=null;var _=R.sibling;if(_!==null)Me=_;else{var Z=R.return;Z!==null?(Me=Z,ns(Z)):Me=null}break t}}Qe=0,tn=null,_i(e,n,m,5);break;case 6:Qe=0,tn=null,_i(e,n,m,6);break;case 8:Bu(),ct=6;break e;default:throw Error(l(462))}}fx();break}catch(le){Cm(e,le)}while(!0);return Bn=Hr=null,D.H=s,D.A=f,Ke=a,Me!==null?0:(tt=null,Le=0,Sl(),ct)}function fx(){for(;Me!==null&&!qe();)Em(Me)}function Em(e){var n=Jh(e.alternate,e,Kn);e.memoizedProps=e.pendingProps,n===null?ns(e):Me=n}function Nm(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=Yh(a,n,n.pendingProps,n.type,void 0,Le);break;case 11:n=Yh(a,n,n.pendingProps,n.type.render,n.ref,Le);break;case 5:eu(n);default:em(a,n),n=Me=Tf(n,Kn),n=Jh(a,n,Kn)}e.memoizedProps=e.pendingProps,n===null?ns(e):Me=n}function _i(e,n,a,s){Bn=Hr=null,eu(n),ji=null,ya=0;var f=n.return;try{if(ex(e,f,n,a,Le)){ct=1,$l(e,fn(a,e.current)),Me=null;return}}catch(m){if(f!==null)throw Me=f,m;ct=1,$l(e,fn(a,e.current)),Me=null;return}n.flags&32768?(He||s===1?e=!0:Di||(Le&536870912)!==0?e=!1:(hr=e=!0,(s===2||s===9||s===3||s===6)&&(s=Wt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Am(n,e)):ns(n)}function ns(e){var n=e;do{if((n.flags&32768)!==0){Am(n,hr);return}e=n.return;var a=rx(n.alternate,n,Kn);if(a!==null){Me=a;return}if(n=n.sibling,n!==null){Me=n;return}Me=n=e}while(n!==null);ct===0&&(ct=5)}function Am(e,n){do{var a=ix(e.alternate,e);if(a!==null){a.flags&=32767,Me=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){Me=e;return}Me=e=a}while(e!==null);ct=6,Me=null}function Im(e,n,a,s,f,m,b,R,_){e.cancelPendingCommit=null;do rs();while(St!==0);if((Ke&6)!==0)throw Error(l(327));if(n!==null){if(n===e.current)throw Error(l(177));if(m=n.lanes|n.childLanes,m|=To,Vv(e,a,m,b,R,_),e===tt&&(Me=tt=null,Le=0),Mi=n,gr=e,Xn=a,zu=m,_u=f,xm=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,gx(ge,function(){return _m(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=D.T,D.T=null,f=U.p,U.p=2,b=Ke,Ke|=4;try{ax(e,n,a)}finally{Ke=b,U.p=f,D.T=s}}St=1,Dm(),Om(),Mm()}}function Dm(){if(St===1){St=0;var e=gr,n=Mi,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var s=U.p;U.p=2;var f=Ke;Ke|=4;try{fm(n,e);var m=Zu,b=vf(e.containerInfo),R=m.focusedElem,_=m.selectionRange;if(b!==R&&R&&R.ownerDocument&&yf(R.ownerDocument.documentElement,R)){if(_!==null&&ko(R)){var Z=_.start,le=_.end;if(le===void 0&&(le=Z),"selectionStart"in R)R.selectionStart=Z,R.selectionEnd=Math.min(le,R.value.length);else{var ce=R.ownerDocument||document,ee=ce&&ce.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=R.textContent.length,ke=Math.min(_.start,ye),et=_.end===void 0?ke:Math.min(_.end,ye);!re.extend&&ke>et&&(b=et,et=ke,ke=b);var V=gf(R,ke),$=gf(R,et);if(V&&$&&(re.rangeCount!==1||re.anchorNode!==V.node||re.anchorOffset!==V.offset||re.focusNode!==$.node||re.focusOffset!==$.offset)){var X=ce.createRange();X.setStart(V.node,V.offset),re.removeAllRanges(),ke>et?(re.addRange(X),re.extend($.node,$.offset)):(X.setEnd($.node,$.offset),re.addRange(X))}}}}for(ce=[],re=R;re=re.parentNode;)re.nodeType===1&&ce.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ce.length;R++){var oe=ce[R];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}ps=!!Qu,Zu=Qu=null}finally{Ke=f,U.p=s,D.T=a}}e.current=n,St=2}}function Om(){if(St===2){St=0;var e=gr,n=Mi,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var s=U.p;U.p=2;var f=Ke;Ke|=4;try{sm(e,n.alternate,n)}finally{Ke=f,U.p=s,D.T=a}}St=3}}function Mm(){if(St===4||St===3){St=0,ot();var e=gr,n=Mi,a=Xn,s=xm;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?St=5:(St=0,Mi=gr=null,zm(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(pr=null),no(a),n=n.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(Ee,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=D.T,f=U.p,U.p=2,D.T=null;try{for(var m=e.onRecoverableError,b=0;b<s.length;b++){var R=s[b];m(R.value,{componentStack:R.stack})}}finally{D.T=n,U.p=f}}(Xn&3)!==0&&rs(),Nn(e),f=e.pendingLanes,(a&261930)!==0&&(f&42)!==0?e===Lu?Ma++:(Ma=0,Lu=e):Ma=0,za(0)}}function zm(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,pa(n)))}function rs(){return Dm(),Om(),Mm(),_m()}function _m(){if(St!==5)return!1;var e=gr,n=zu;zu=0;var a=no(Xn),s=D.T,f=U.p;try{U.p=32>a?32:a,D.T=null,a=_u,_u=null;var m=gr,b=Xn;if(St=0,Mi=gr=null,Xn=0,(Ke&6)!==0)throw Error(l(331));var R=Ke;if(Ke|=4,ym(m.current),mm(m,m.current,b,a),Ke=R,za(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(Ee,m)}catch{}return!0}finally{U.p=f,D.T=s,zm(e,n)}}function Lm(e,n,a){n=fn(a,n),n=pu(e.stateNode,n,2),e=ur(e,n,2),e!==null&&(ta(e,2),Nn(e))}function Ze(e,n,a){if(e.tag===3)Lm(e,e,a);else for(;n!==null;){if(n.tag===3){Lm(n,e,a);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(pr===null||!pr.has(s))){e=fn(a,e),a=Bh(2),s=ur(n,a,2),s!==null&&(Hh(a,s,n,e),ta(s,2),Nn(s));break}}n=n.return}}function Uu(e,n,a){var s=e.pingCache;if(s===null){s=e.pingCache=new ox;var f=new Set;s.set(n,f)}else f=s.get(n),f===void 0&&(f=new Set,s.set(n,f));f.has(a)||(Du=!0,f.add(a),e=hx.bind(null,e,n,a),n.then(e,e))}function hx(e,n,a){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,tt===e&&(Le&a)===a&&(ct===4||ct===3&&(Le&62914560)===Le&&300>Fe()-Zl?(Ke&2)===0&&zi(e,0):Ou|=a,Oi===Le&&(Oi=0)),Nn(e)}function Bm(e,n){n===0&&(n=Id()),e=_r(e,n),e!==null&&(ta(e,n),Nn(e))}function mx(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),Bm(e,a)}function px(e,n){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,f=e.memoizedState;f!==null&&(a=f.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(n),Bm(e,a)}function gx(e,n){return Rt(e,n)}var is=null,Li=null,qu=!1,as=!1,Gu=!1,vr=0;function Nn(e){e!==Li&&e.next===null&&(Li===null?is=Li=e:Li=Li.next=e),as=!0,qu||(qu=!0,vx())}function za(e,n){if(!Gu&&as){Gu=!0;do for(var a=!1,s=is;s!==null;){if(e!==0){var f=s.pendingLanes;if(f===0)var m=0;else{var b=s.suspendedLanes,R=s.pingedLanes;m=(1<<31-Xe(42|e)+1)-1,m&=f&~(b&~R),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,Gm(s,m))}else m=Le,m=ul(s,s===tt?m:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(m&3)===0||ea(s,m)||(a=!0,Gm(s,m));s=s.next}while(a);Gu=!1}}function yx(){Hm()}function Hm(){as=qu=!1;var e=0;vr!==0&&Ex()&&(e=vr);for(var n=Fe(),a=null,s=is;s!==null;){var f=s.next,m=Um(s,n);m===0?(s.next=null,a===null?is=f:a.next=f,f===null&&(Li=a)):(a=s,(e!==0||(m&3)!==0)&&(as=!0)),s=f}St!==0&&St!==5||za(e),vr!==0&&(vr=0)}function Um(e,n){for(var a=e.suspendedLanes,s=e.pingedLanes,f=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var b=31-Xe(m),R=1<<b,_=f[b];_===-1?((R&a)===0||(R&s)!==0)&&(f[b]=Fv(R,n)):_<=n&&(e.expiredLanes|=R),m&=~R}if(n=tt,a=Le,a=ul(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===n&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ce(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ea(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(s!==null&&Ce(s),no(a)){case 2:case 8:a=ie;break;case 32:a=ge;break;case 268435456:a=Te;break;default:a=ge}return s=qm.bind(null,e),a=Rt(a,s),e.callbackPriority=n,e.callbackNode=a,n}return s!==null&&s!==null&&Ce(s),e.callbackPriority=2,e.callbackNode=null,2}function qm(e,n){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(rs()&&e.callbackNode!==a)return null;var s=Le;return s=ul(e,e===tt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(km(e,s,n),Um(e,Fe()),e.callbackNode!=null&&e.callbackNode===a?qm.bind(null,e):null)}function Gm(e,n){if(rs())return null;km(e,n,!0)}function vx(){Ax(function(){(Ke&6)!==0?Rt(M,yx):Hm()})}function $u(){if(vr===0){var e=ki;e===0&&(e=Tt,Tt<<=1,(Tt&261888)===0&&(Tt=256)),vr=e}return vr}function $m(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:hl(""+e)}function Fm(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function bx(e,n,a,s,f){if(n==="submit"&&a&&a.stateNode===f){var m=$m((f[Ut]||null).action),b=s.submitter;b&&(n=(n=b[Ut]||null)?$m(n.formAction):b.getAttribute("formAction"),n!==null&&(m=n,b=null));var R=new yl("action","action",null,s,f);e.push({event:R,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(vr!==0){var _=b?Fm(f,b):new FormData(f);uu(a,{pending:!0,data:_,method:f.method,action:m},null,_)}}else typeof m=="function"&&(R.preventDefault(),_=b?Fm(f,b):new FormData(f),uu(a,{pending:!0,data:_,method:f.method,action:m},m,_))},currentTarget:f}]})}}for(var Fu=0;Fu<Ro.length;Fu++){var Vu=Ro[Fu],xx=Vu.toLowerCase(),Sx=Vu[0].toUpperCase()+Vu.slice(1);xn(xx,"on"+Sx)}xn(Sf,"onAnimationEnd"),xn(kf,"onAnimationIteration"),xn(wf,"onAnimationStart"),xn("dblclick","onDoubleClick"),xn("focusin","onFocus"),xn("focusout","onBlur"),xn(Lb,"onTransitionRun"),xn(Bb,"onTransitionStart"),xn(Hb,"onTransitionCancel"),xn(Cf,"onTransitionEnd"),oi("onMouseEnter",["mouseout","mouseover"]),oi("onMouseLeave",["mouseout","mouseover"]),oi("onPointerEnter",["pointerout","pointerover"]),oi("onPointerLeave",["pointerout","pointerover"]),Dr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Dr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Dr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Dr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Dr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Dr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _a="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(" "),kx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_a));function Vm(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],f=s.event;s=s.listeners;e:{var m=void 0;if(n)for(var b=s.length-1;0<=b;b--){var R=s[b],_=R.instance,Z=R.currentTarget;if(R=R.listener,_!==m&&f.isPropagationStopped())break e;m=R,f.currentTarget=Z;try{m(f)}catch(le){xl(le)}f.currentTarget=null,m=_}else for(b=0;b<s.length;b++){if(R=s[b],_=R.instance,Z=R.currentTarget,R=R.listener,_!==m&&f.isPropagationStopped())break e;m=R,f.currentTarget=Z;try{m(f)}catch(le){xl(le)}f.currentTarget=null,m=_}}}}function ze(e,n){var a=n[ro];a===void 0&&(a=n[ro]=new Set);var s=e+"__bubble";a.has(s)||(Ym(n,e,2,!1),a.add(s))}function Yu(e,n,a){var s=0;n&&(s|=4),Ym(a,e,s,n)}var ls="_reactListening"+Math.random().toString(36).slice(2);function Pu(e){if(!e[ls]){e[ls]=!0,Bd.forEach(function(a){a!=="selectionchange"&&(kx.has(a)||Yu(a,!1,e),Yu(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[ls]||(n[ls]=!0,Yu("selectionchange",!1,n))}}function Ym(e,n,a,s){switch(Sp(n)){case 2:var f=Qx;break;case 8:f=Zx;break;default:f=oc}a=f.bind(null,n,a,e),f=void 0,!ho||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),s?f!==void 0?e.addEventListener(n,a,{capture:!0,passive:f}):e.addEventListener(n,a,!0):f!==void 0?e.addEventListener(n,a,{passive:f}):e.addEventListener(n,a,!1)}function Ku(e,n,a,s,f){var m=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var R=s.stateNode.containerInfo;if(R===f)break;if(b===4)for(b=s.return;b!==null;){var _=b.tag;if((_===3||_===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;R!==null;){if(b=ai(R),b===null)return;if(_=b.tag,_===5||_===6||_===26||_===27){s=m=b;continue e}R=R.parentNode}}s=s.return}Qd(function(){var Z=m,le=co(a),ce=[];e:{var ee=jf.get(e);if(ee!==void 0){var re=yl,ye=e;switch(e){case"keypress":if(pl(a)===0)break e;case"keydown":case"keyup":re=pb;break;case"focusin":ye="focus",re=yo;break;case"focusout":ye="blur",re=yo;break;case"beforeblur":case"afterblur":re=yo;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Wd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=rb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=vb;break;case Sf:case kf:case wf:re=lb;break;case Cf:re=xb;break;case"scroll":case"scrollend":re=tb;break;case"wheel":re=kb;break;case"copy":case"cut":case"paste":re=ob;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=tf;break;case"toggle":case"beforetoggle":re=Cb}var ke=(n&4)!==0,et=!ke&&(e==="scroll"||e==="scrollend"),V=ke?ee!==null?ee+"Capture":null:ee;ke=[];for(var $=Z,X;$!==null;){var oe=$;if(X=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||X===null||V===null||(oe=ia($,V),oe!=null&&ke.push(La($,oe,X))),et)break;$=$.return}0<ke.length&&(ee=new re(ee,ye,null,a,le),ce.push({event:ee,listeners:ke}))}}if((n&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",re=e==="mouseout"||e==="pointerout",ee&&a!==uo&&(ye=a.relatedTarget||a.fromElement)&&(ai(ye)||ye[ii]))break e;if((re||ee)&&(ee=le.window===le?le:(ee=le.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(ye=a.relatedTarget||a.toElement,re=Z,ye=ye?ai(ye):null,ye!==null&&(et=c(ye),ke=ye.tag,ye!==et||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=Z),re!==ye)){if(ke=Wd,oe="onMouseLeave",V="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(ke=tf,oe="onPointerLeave",V="onPointerEnter",$="pointer"),et=re==null?ee:ra(re),X=ye==null?ee:ra(ye),ee=new ke(oe,$+"leave",re,a,le),ee.target=et,ee.relatedTarget=X,oe=null,ai(le)===Z&&(ke=new ke(V,$+"enter",ye,a,le),ke.target=X,ke.relatedTarget=et,oe=ke),et=oe,re&&ye)t:{for(ke=wx,V=re,$=ye,X=0,oe=V;oe;oe=ke(oe))X++;oe=0;for(var xe=$;xe;xe=ke(xe))oe++;for(;0<X-oe;)V=ke(V),X--;for(;0<oe-X;)$=ke($),oe--;for(;X--;){if(V===$||$!==null&&V===$.alternate){ke=V;break t}V=ke(V),$=ke($)}ke=null}else ke=null;re!==null&&Pm(ce,ee,re,ke,!1),ye!==null&&et!==null&&Pm(ce,et,ye,ke,!0)}}e:{if(ee=Z?ra(Z):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var Ve=cf;else if(of(ee))if(df)Ve=Mb;else{Ve=Db;var ve=Ib}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?Z&&oo(Z.elementType)&&(Ve=cf):Ve=Ob;if(Ve&&(Ve=Ve(e,Z))){uf(ce,Ve,a,le);break e}ve&&ve(e,ee,Z),e==="focusout"&&Z&&ee.type==="number"&&Z.memoizedProps.value!=null&&so(ee,"number",ee.value)}switch(ve=Z?ra(Z):window,e){case"focusin":(of(ve)||ve.contentEditable==="true")&&(mi=ve,wo=Z,fa=null);break;case"focusout":fa=wo=mi=null;break;case"mousedown":Co=!0;break;case"contextmenu":case"mouseup":case"dragend":Co=!1,bf(ce,a,le);break;case"selectionchange":if(_b)break;case"keydown":case"keyup":bf(ce,a,le)}var De;if(bo)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 hi?lf(e,a)&&(Be="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Be="onCompositionStart");Be&&(nf&&a.locale!=="ko"&&(hi||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&hi&&(De=Zd()):(nr=le,mo="value"in nr?nr.value:nr.textContent,hi=!0)),ve=ss(Z,Be),0<ve.length&&(Be=new ef(Be,e,null,a,le),ce.push({event:Be,listeners:ve}),De?Be.data=De:(De=sf(a),De!==null&&(Be.data=De)))),(De=Rb?Tb(e,a):Eb(e,a))&&(Be=ss(Z,"onBeforeInput"),0<Be.length&&(ve=new ef("onBeforeInput","beforeinput",null,a,le),ce.push({event:ve,listeners:Be}),ve.data=De)),bx(ce,e,Z,a,le)}Vm(ce,n)})}function La(e,n,a){return{instance:e,listener:n,currentTarget:a}}function ss(e,n){for(var a=n+"Capture",s=[];e!==null;){var f=e,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=ia(e,a),f!=null&&s.unshift(La(e,f,m)),f=ia(e,n),f!=null&&s.push(La(e,f,m))),e.tag===3)return s;e=e.return}return[]}function wx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pm(e,n,a,s,f){for(var m=n._reactName,b=[];a!==null&&a!==s;){var R=a,_=R.alternate,Z=R.stateNode;if(R=R.tag,_!==null&&_===s)break;R!==5&&R!==26&&R!==27||Z===null||(_=Z,f?(Z=ia(a,m),Z!=null&&b.unshift(La(a,Z,_))):f||(Z=ia(a,m),Z!=null&&b.push(La(a,Z,_)))),a=a.return}b.length!==0&&e.push({event:n,listeners:b})}var Cx=/\r\n?/g,jx=/\u0000|\uFFFD/g;function Km(e){return(typeof e=="string"?e:""+e).replace(Cx,`
|
|
9
|
-
`).replace(jx,"")}function Xm(e,n){return n=Km(n),Km(e)===n}function We(e,n,a,s,f,m){switch(a){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||ci(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&ci(e,""+s);break;case"className":dl(e,"class",s);break;case"tabIndex":dl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":dl(e,a,s);break;case"style":Kd(e,s,m);break;case"data":if(n!=="object"){dl(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=hl(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(a==="formAction"?(n!=="input"&&We(e,n,"name",f.name,f,null),We(e,n,"formEncType",f.formEncType,f,null),We(e,n,"formMethod",f.formMethod,f,null),We(e,n,"formTarget",f.formTarget,f,null)):(We(e,n,"encType",f.encType,f,null),We(e,n,"method",f.method,f,null),We(e,n,"target",f.target,f,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=hl(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=Mn);break;case"onScroll":s!=null&&ze("scroll",e);break;case"onScrollEnd":s!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(f.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=hl(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":ze("beforetoggle",e),ze("toggle",e),cl(e,"popover",s);break;case"xlinkActuate":On(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":On(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":On(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":On(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":On(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":On(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":On(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":On(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":On(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":cl(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Wv.get(a)||a,cl(e,a,s))}}function Xu(e,n,a,s,f,m){switch(a){case"style":Kd(e,s,m);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(f.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"children":typeof s=="string"?ci(e,s):(typeof s=="number"||typeof s=="bigint")&&ci(e,""+s);break;case"onScroll":s!=null&&ze("scroll",e);break;case"onScrollEnd":s!=null&&ze("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Mn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Hd.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),n=a.slice(2,f?a.length-7:void 0),m=e[Ut]||null,m=m!=null?m[a]:null,typeof m=="function"&&e.removeEventListener(n,m,f),typeof s=="function")){typeof m!="function"&&m!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,s,f);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):cl(e,a,s)}}}function Dt(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var s=!1,f=!1,m;for(m in a)if(a.hasOwnProperty(m)){var b=a[m];if(b!=null)switch(m){case"src":s=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:We(e,n,m,b,a,null)}}f&&We(e,n,"srcSet",a.srcSet,a,null),s&&We(e,n,"src",a.src,a,null);return;case"input":ze("invalid",e);var R=m=b=f=null,_=null,Z=null;for(s in a)if(a.hasOwnProperty(s)){var le=a[s];if(le!=null)switch(s){case"name":f=le;break;case"type":b=le;break;case"checked":_=le;break;case"defaultChecked":Z=le;break;case"value":m=le;break;case"defaultValue":R=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(l(137,n));break;default:We(e,n,s,le,a,null)}}Fd(e,m,R,_,Z,b,f,!1);return;case"select":ze("invalid",e),s=b=m=null;for(f in a)if(a.hasOwnProperty(f)&&(R=a[f],R!=null))switch(f){case"value":m=R;break;case"defaultValue":b=R;break;case"multiple":s=R;default:We(e,n,f,R,a,null)}n=m,a=b,e.multiple=!!s,n!=null?ui(e,!!s,n,!1):a!=null&&ui(e,!!s,a,!0);return;case"textarea":ze("invalid",e),m=f=s=null;for(b in a)if(a.hasOwnProperty(b)&&(R=a[b],R!=null))switch(b){case"value":s=R;break;case"defaultValue":f=R;break;case"children":m=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(l(91));break;default:We(e,n,b,R,a,null)}Yd(e,s,f,m);return;case"option":for(_ in a)a.hasOwnProperty(_)&&(s=a[_],s!=null)&&(_==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":We(e,n,_,s,a,null));return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(s=0;s<_a.length;s++)ze(_a[s],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("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(Z in a)if(a.hasOwnProperty(Z)&&(s=a[Z],s!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:We(e,n,Z,s,a,null)}return;default:if(oo(n)){for(le in a)a.hasOwnProperty(le)&&(s=a[le],s!==void 0&&Xu(e,n,le,s,a,void 0));return}}for(R in a)a.hasOwnProperty(R)&&(s=a[R],s!=null&&We(e,n,R,s,a,null))}function Rx(e,n,a,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,R=null,_=null,Z=null,le=null;for(re in a){var ce=a[re];if(a.hasOwnProperty(re)&&ce!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":_=ce;default:s.hasOwnProperty(re)||We(e,n,re,null,s,ce)}}for(var ee in s){var re=s[ee];if(ce=a[ee],s.hasOwnProperty(ee)&&(re!=null||ce!=null))switch(ee){case"type":m=re;break;case"name":f=re;break;case"checked":Z=re;break;case"defaultChecked":le=re;break;case"value":b=re;break;case"defaultValue":R=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(l(137,n));break;default:re!==ce&&We(e,n,ee,re,s,ce)}}lo(e,b,R,_,Z,le,m,f);return;case"select":re=b=R=ee=null;for(m in a)if(_=a[m],a.hasOwnProperty(m)&&_!=null)switch(m){case"value":break;case"multiple":re=_;default:s.hasOwnProperty(m)||We(e,n,m,null,s,_)}for(f in s)if(m=s[f],_=a[f],s.hasOwnProperty(f)&&(m!=null||_!=null))switch(f){case"value":ee=m;break;case"defaultValue":R=m;break;case"multiple":b=m;default:m!==_&&We(e,n,f,m,s,_)}n=R,a=b,s=re,ee!=null?ui(e,!!a,ee,!1):!!s!=!!a&&(n!=null?ui(e,!!a,n,!0):ui(e,!!a,a?[]:"",!1));return;case"textarea":re=ee=null;for(R in a)if(f=a[R],a.hasOwnProperty(R)&&f!=null&&!s.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:We(e,n,R,null,s,f)}for(b in s)if(f=s[b],m=a[b],s.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":ee=f;break;case"defaultValue":re=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(l(91));break;default:f!==m&&We(e,n,b,f,s,m)}Vd(e,ee,re);return;case"option":for(var ye in a)ee=a[ye],a.hasOwnProperty(ye)&&ee!=null&&!s.hasOwnProperty(ye)&&(ye==="selected"?e.selected=!1:We(e,n,ye,null,s,ee));for(_ in s)ee=s[_],re=a[_],s.hasOwnProperty(_)&&ee!==re&&(ee!=null||re!=null)&&(_==="selected"?e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":We(e,n,_,ee,s,re));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 ke in a)ee=a[ke],a.hasOwnProperty(ke)&&ee!=null&&!s.hasOwnProperty(ke)&&We(e,n,ke,null,s,ee);for(Z in s)if(ee=s[Z],re=a[Z],s.hasOwnProperty(Z)&&ee!==re&&(ee!=null||re!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(l(137,n));break;default:We(e,n,Z,ee,s,re)}return;default:if(oo(n)){for(var et in a)ee=a[et],a.hasOwnProperty(et)&&ee!==void 0&&!s.hasOwnProperty(et)&&Xu(e,n,et,void 0,s,ee);for(le in s)ee=s[le],re=a[le],!s.hasOwnProperty(le)||ee===re||ee===void 0&&re===void 0||Xu(e,n,le,ee,s,re);return}}for(var V in a)ee=a[V],a.hasOwnProperty(V)&&ee!=null&&!s.hasOwnProperty(V)&&We(e,n,V,null,s,ee);for(ce in s)ee=s[ce],re=a[ce],!s.hasOwnProperty(ce)||ee===re||ee==null&&re==null||We(e,n,ce,ee,s,re)}function Qm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Tx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var f=a[s],m=f.transferSize,b=f.initiatorType,R=f.duration;if(m&&R&&Qm(b)){for(b=0,R=f.responseEnd,s+=1;s<a.length;s++){var _=a[s],Z=_.startTime;if(Z>R)break;var le=_.transferSize,ce=_.initiatorType;le&&Qm(ce)&&(_=_.responseEnd,b+=le*(_<R?1:(R-Z)/(_-Z)))}if(--s,n+=8*(m+b)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Qu=null,Zu=null;function os(e){return e.nodeType===9?e:e.ownerDocument}function Zm(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 Jm(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Ju(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Wu=null;function Ex(){var e=window.event;return e&&e.type==="popstate"?e===Wu?!1:(Wu=e,!0):(Wu=null,!1)}var Wm=typeof setTimeout=="function"?setTimeout:void 0,Nx=typeof clearTimeout=="function"?clearTimeout:void 0,ep=typeof Promise=="function"?Promise:void 0,Ax=typeof queueMicrotask=="function"?queueMicrotask:typeof ep<"u"?function(e){return ep.resolve(null).then(e).catch(Ix)}:Wm;function Ix(e){setTimeout(function(){throw e})}function br(e){return e==="head"}function tp(e,n){var a=n,s=0;do{var f=a.nextSibling;if(e.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(f),qi(n);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")Ba(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ba(a);for(var m=a.firstChild;m;){var b=m.nextSibling,R=m.nodeName;m[na]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&m.rel.toLowerCase()==="stylesheet"||a.removeChild(m),m=b}}else a==="body"&&Ba(e.ownerDocument.body);a=f}while(a);qi(n)}function np(e,n){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function ec(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ec(a),io(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Dx(e,n,a,s){for(;e.nodeType===1;){var f=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[na])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=yn(e.nextSibling),e===null)break}return null}function Ox(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=yn(e.nextSibling),e===null))return null;return e}function rp(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=yn(e.nextSibling),e===null))return null;return e}function tc(e){return e.data==="$?"||e.data==="$~"}function nc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Mx(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var s=function(){n(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function yn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var rc=null;function ip(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return yn(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function ap(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function lp(e,n,a){switch(n=os(a),e){case"html":if(e=n.documentElement,!e)throw Error(l(452));return e;case"head":if(e=n.head,!e)throw Error(l(453));return e;case"body":if(e=n.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Ba(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);io(e)}var vn=new Map,sp=new Set;function us(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Qn=U.d;U.d={f:zx,r:_x,D:Lx,C:Bx,L:Hx,m:Ux,X:Gx,S:qx,M:$x};function zx(){var e=Qn.f(),n=es();return e||n}function _x(e){var n=li(e);n!==null&&n.tag===5&&n.type==="form"?Ch(n):Qn.r(e)}var Bi=typeof document>"u"?null:document;function op(e,n,a){var s=Bi;if(s&&typeof n=="string"&&n){var f=cn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),sp.has(f)||(sp.add(f),e={rel:e,crossOrigin:a,href:n},s.querySelector(f)===null&&(n=s.createElement("link"),Dt(n,"link",e),wt(n),s.head.appendChild(n)))}}function Lx(e){Qn.D(e),op("dns-prefetch",e,null)}function Bx(e,n){Qn.C(e,n),op("preconnect",e,n)}function Hx(e,n,a){Qn.L(e,n,a);var s=Bi;if(s&&e&&n){var f='link[rel="preload"][as="'+cn(n)+'"]';n==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+cn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+cn(a.imageSizes)+'"]')):f+='[href="'+cn(e)+'"]';var m=f;switch(n){case"style":m=Hi(e);break;case"script":m=Ui(e)}vn.has(m)||(e=y({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),vn.set(m,e),s.querySelector(f)!==null||n==="style"&&s.querySelector(Ha(m))||n==="script"&&s.querySelector(Ua(m))||(n=s.createElement("link"),Dt(n,"link",e),wt(n),s.head.appendChild(n)))}}function Ux(e,n){Qn.m(e,n);var a=Bi;if(a&&e){var s=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+cn(s)+'"][href="'+cn(e)+'"]',m=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Ui(e)}if(!vn.has(m)&&(e=y({rel:"modulepreload",href:e},n),vn.set(m,e),a.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ua(m)))return}s=a.createElement("link"),Dt(s,"link",e),wt(s),a.head.appendChild(s)}}}function qx(e,n,a){Qn.S(e,n,a);var s=Bi;if(s&&e){var f=si(s).hoistableStyles,m=Hi(e);n=n||"default";var b=f.get(m);if(!b){var R={loading:0,preload:null};if(b=s.querySelector(Ha(m)))R.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},a),(a=vn.get(m))&&ic(e,a);var _=b=s.createElement("link");wt(_),Dt(_,"link",e),_._p=new Promise(function(Z,le){_.onload=Z,_.onerror=le}),_.addEventListener("load",function(){R.loading|=1}),_.addEventListener("error",function(){R.loading|=2}),R.loading|=4,cs(b,n,s)}b={type:"stylesheet",instance:b,count:1,state:R},f.set(m,b)}}}function Gx(e,n){Qn.X(e,n);var a=Bi;if(a&&e){var s=si(a).hoistableScripts,f=Ui(e),m=s.get(f);m||(m=a.querySelector(Ua(f)),m||(e=y({src:e,async:!0},n),(n=vn.get(f))&&ac(e,n),m=a.createElement("script"),wt(m),Dt(m,"link",e),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(f,m))}}function $x(e,n){Qn.M(e,n);var a=Bi;if(a&&e){var s=si(a).hoistableScripts,f=Ui(e),m=s.get(f);m||(m=a.querySelector(Ua(f)),m||(e=y({src:e,async:!0,type:"module"},n),(n=vn.get(f))&&ac(e,n),m=a.createElement("script"),wt(m),Dt(m,"link",e),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(f,m))}}function up(e,n,a,s){var f=(f=J.current)?us(f):null;if(!f)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=Hi(a.href),a=si(f).hoistableStyles,s=a.get(n),s||(s={type:"style",instance:null,count:0,state:null},a.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Hi(a.href);var m=si(f).hoistableStyles,b=m.get(e);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,b),(m=f.querySelector(Ha(e)))&&!m._p&&(b.instance=m,b.state.loading=5),vn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},vn.set(e,a),m||Fx(f,e,a,b.state))),n&&s===null)throw Error(l(528,""));return b}if(n&&s!==null)throw Error(l(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ui(a),a=si(f).hoistableScripts,s=a.get(n),s||(s={type:"script",instance:null,count:0,state:null},a.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Hi(e){return'href="'+cn(e)+'"'}function Ha(e){return'link[rel="stylesheet"]['+e+"]"}function cp(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Fx(e,n,a,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),Dt(n,"link",a),wt(n),e.head.appendChild(n))}function Ui(e){return'[src="'+cn(e)+'"]'}function Ua(e){return"script[async]"+e}function dp(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+cn(a.href)+'"]');if(s)return n.instance=s,wt(s),s;var f=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),wt(s),Dt(s,"style",f),cs(s,a.precedence,e),n.instance=s;case"stylesheet":f=Hi(a.href);var m=e.querySelector(Ha(f));if(m)return n.state.loading|=4,n.instance=m,wt(m),m;s=cp(a),(f=vn.get(f))&&ic(s,f),m=(e.ownerDocument||e).createElement("link"),wt(m);var b=m;return b._p=new Promise(function(R,_){b.onload=R,b.onerror=_}),Dt(m,"link",s),n.state.loading|=4,cs(m,a.precedence,e),n.instance=m;case"script":return m=Ui(a.src),(f=e.querySelector(Ua(m)))?(n.instance=f,wt(f),f):(s=a,(f=vn.get(m))&&(s=y({},a),ac(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),wt(f),Dt(f,"link",s),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,cs(s,a.precedence,e));return n.instance}function cs(e,n,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=s.length?s[s.length-1]:null,m=f,b=0;b<s.length;b++){var R=s[b];if(R.dataset.precedence===n)m=R;else if(m!==f)break}m?m.parentNode.insertBefore(e,m.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function ic(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function ac(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var ds=null;function fp(e,n,a){if(ds===null){var s=new Map,f=ds=new Map;f.set(a,s)}else f=ds,s=f.get(a),s||(s=new Map,f.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),f=0;f<a.length;f++){var m=a[f];if(!(m[na]||m[Et]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(n)||"";b=e+b;var R=s.get(b);R?R.push(m):s.set(b,[m])}}return s}function hp(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function Vx(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function mp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Yx(e,n,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=Hi(s.href),m=n.querySelector(Ha(f));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=fs.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=m,wt(m);return}m=n.ownerDocument||n,s=cp(s),(f=vn.get(f))&&ic(s,f),m=m.createElement("link"),wt(m);var b=m;b._p=new Promise(function(R,_){b.onload=R,b.onerror=_}),Dt(m,"link",s),a.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=fs.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var lc=0;function Px(e,n){return e.stylesheets&&e.count===0&&ms(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&ms(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+n);0<e.imgBytes&&lc===0&&(lc=62500*Tx());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ms(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>lc?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function fs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ms(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var hs=null;function ms(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hs=new Map,n.forEach(Kx,e),hs=null,fs.call(e))}function Kx(e,n){if(!(n.state.loading&4)){var a=hs.get(e);if(a)var s=a.get(null);else{a=new Map,hs.set(e,a);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),s=b)}s&&a.set(null,s)}f=n.instance,b=f.getAttribute("data-precedence"),m=a.get(b)||s,m===s&&a.set(null,f),a.set(b,f),this.count++,s=fs.bind(this),f.addEventListener("load",s),f.addEventListener("error",s),m?m.parentNode.insertBefore(f,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var qa={$$typeof:A,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function Xx(e,n,a,s,f,m,b,R,_){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=eo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eo(0),this.hiddenUpdates=eo(null),this.identifierPrefix=s,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function pp(e,n,a,s,f,m,b,R,_,Z,le,ce){return e=new Xx(e,n,a,b,_,Z,le,ce,R),n=1,m===!0&&(n|=24),m=Jt(3,null,null,n),e.current=m,m.stateNode=e,n=Ho(),n.refCount++,e.pooledCache=n,n.refCount++,m.memoizedState={element:s,isDehydrated:a,cache:n},$o(m),e}function gp(e){return e?(e=yi,e):yi}function yp(e,n,a,s,f,m){f=gp(f),s.context===null?s.context=f:s.pendingContext=f,s=or(n),s.payload={element:a},m=m===void 0?null:m,m!==null&&(s.callback=m),a=ur(e,s,n),a!==null&&(Yt(a,e,n),ba(a,e,n))}function vp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function sc(e,n){vp(e,n),(e=e.alternate)&&vp(e,n)}function bp(e){if(e.tag===13||e.tag===31){var n=_r(e,67108864);n!==null&&Yt(n,e,67108864),sc(e,67108864)}}function xp(e){if(e.tag===13||e.tag===31){var n=rn();n=to(n);var a=_r(e,n);a!==null&&Yt(a,e,n),sc(e,n)}}var ps=!0;function Qx(e,n,a,s){var f=D.T;D.T=null;var m=U.p;try{U.p=2,oc(e,n,a,s)}finally{U.p=m,D.T=f}}function Zx(e,n,a,s){var f=D.T;D.T=null;var m=U.p;try{U.p=8,oc(e,n,a,s)}finally{U.p=m,D.T=f}}function oc(e,n,a,s){if(ps){var f=uc(s);if(f===null)Ku(e,n,s,gs,a),kp(e,s);else if(Wx(f,e,n,a,s))s.stopPropagation();else if(kp(e,s),n&4&&-1<Jx.indexOf(e)){for(;f!==null;){var m=li(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Ir(m.pendingLanes);if(b!==0){var R=m;for(R.pendingLanes|=2,R.entangledLanes|=2;b;){var _=1<<31-Xe(b);R.entanglements[1]|=_,b&=~_}Nn(m),(Ke&6)===0&&(Jl=Fe()+500,za(0))}}break;case 31:case 13:R=_r(m,2),R!==null&&Yt(R,m,2),es(),sc(m,2)}if(m=uc(s),m===null&&Ku(e,n,s,gs,a),m===f)break;f=m}f!==null&&s.stopPropagation()}else Ku(e,n,s,null,a)}}function uc(e){return e=co(e),cc(e)}var gs=null;function cc(e){if(gs=null,e=ai(e),e!==null){var n=c(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=u(n),e!==null)return e;e=null}else if(a===31){if(e=h(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return gs=e,null}function Sp(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(Ht()){case M:return 2;case ie:return 8;case ge:case we:return 32;case Te:return 268435456;default:return 32}default:return 32}}var dc=!1,xr=null,Sr=null,kr=null,Ga=new Map,$a=new Map,wr=[],Jx="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 kp(e,n){switch(e){case"focusin":case"focusout":xr=null;break;case"dragenter":case"dragleave":Sr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":Ga.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":$a.delete(n.pointerId)}}function Fa(e,n,a,s,f,m){return e===null||e.nativeEvent!==m?(e={blockedOn:n,domEventName:a,eventSystemFlags:s,nativeEvent:m,targetContainers:[f]},n!==null&&(n=li(n),n!==null&&bp(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function Wx(e,n,a,s,f){switch(n){case"focusin":return xr=Fa(xr,e,n,a,s,f),!0;case"dragenter":return Sr=Fa(Sr,e,n,a,s,f),!0;case"mouseover":return kr=Fa(kr,e,n,a,s,f),!0;case"pointerover":var m=f.pointerId;return Ga.set(m,Fa(Ga.get(m)||null,e,n,a,s,f)),!0;case"gotpointercapture":return m=f.pointerId,$a.set(m,Fa($a.get(m)||null,e,n,a,s,f)),!0}return!1}function wp(e){var n=ai(e.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=u(a),n!==null){e.blockedOn=n,_d(e.priority,function(){xp(a)});return}}else if(n===31){if(n=h(a),n!==null){e.blockedOn=n,_d(e.priority,function(){xp(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ys(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=uc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);uo=s,a.target.dispatchEvent(s),uo=null}else return n=li(a),n!==null&&bp(n),e.blockedOn=a,!1;n.shift()}return!0}function Cp(e,n,a){ys(e)&&a.delete(n)}function e1(){dc=!1,xr!==null&&ys(xr)&&(xr=null),Sr!==null&&ys(Sr)&&(Sr=null),kr!==null&&ys(kr)&&(kr=null),Ga.forEach(Cp),$a.forEach(Cp)}function vs(e,n){e.blockedOn===n&&(e.blockedOn=null,dc||(dc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,e1)))}var bs=null;function jp(e){bs!==e&&(bs=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){bs===e&&(bs=null);for(var n=0;n<e.length;n+=3){var a=e[n],s=e[n+1],f=e[n+2];if(typeof s!="function"){if(cc(s||a)===null)continue;break}var m=li(a);m!==null&&(e.splice(n,3),n-=3,uu(m,{pending:!0,data:f,method:a.method,action:s},s,f))}}))}function qi(e){function n(_){return vs(_,e)}xr!==null&&vs(xr,e),Sr!==null&&vs(Sr,e),kr!==null&&vs(kr,e),Ga.forEach(n),$a.forEach(n);for(var a=0;a<wr.length;a++){var s=wr[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<wr.length&&(a=wr[0],a.blockedOn===null);)wp(a),a.blockedOn===null&&wr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var f=a[s],m=a[s+1],b=f[Ut]||null;if(typeof m=="function")b||jp(a);else if(b){var R=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[Ut]||null)R=b.formAction;else if(cc(f)!==null)continue}else R=b.action;typeof R=="function"?a[s+1]=R:(a.splice(s,3),s-=3),jp(a)}}}function Rp(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function fc(e){this._internalRoot=e}xs.prototype.render=fc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(l(409));var a=n.current,s=rn();yp(a,s,e,n,null,null)},xs.prototype.unmount=fc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;yp(e.current,2,null,e,null,null),es(),n[ii]=null}};function xs(e){this._internalRoot=e}xs.prototype.unstable_scheduleHydration=function(e){if(e){var n=zd();e={blockedOn:null,target:e,priority:n};for(var a=0;a<wr.length&&n!==0&&n<wr[a].priority;a++);wr.splice(a,0,e),a===0&&wp(e)}};var Tp=r.version;if(Tp!=="19.2.8")throw Error(l(527,Tp,"19.2.8"));U.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=p(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var t1={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ss=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ss.isDisabled&&Ss.supportsFiber)try{Ee=Ss.inject(t1),Oe=Ss}catch{}}return Ya.createRoot=function(e,n){if(!o(e))throw Error(l(299));var a=!1,s="",f=Mh,m=zh,b=_h;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError)),n=pp(e,1,!1,null,null,a,s,null,f,m,b,Rp),e[ii]=n.current,Pu(e),new fc(n)},Ya.hydrateRoot=function(e,n,a){if(!o(e))throw Error(l(299));var s=!1,f="",m=Mh,b=zh,R=_h,_=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(R=a.onRecoverableError),a.formState!==void 0&&(_=a.formState)),n=pp(e,1,!0,n,a??null,s,f,_,m,b,R,Rp),n.context=gp(null),a=n.current,s=rn(),s=to(s),f=or(s),f.callback=null,ur(a,f,s),a=s,n.current.lanes=a,ta(n,a),Nn(n),e[ii]=n.current,Pu(e),new xs(n)},Ya.version="19.2.8",Ya}var Lp;function c1(){if(Lp)return pc.exports;Lp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),pc.exports=u1(),pc.exports}var d1=c1();function Xr(t){if(t==null)return null;if(typeof t=="string")return t.trim()||null;if(typeof t=="number"||typeof t=="boolean")return String(t);if(typeof t=="object"){const r=t;if(typeof r.text=="string"&&r.text.trim())return r.text.trim();if(typeof r.errorMessage=="string"&&r.errorMessage.trim())return r.errorMessage.trim();if(Array.isArray(r.content)){const i=r.content.map(l=>{if(typeof l=="string")return l;if(l&&typeof l=="object"){const o=l;if(typeof o.text=="string")return o.text}return""}).filter(Boolean);if(i.length)return i.join(`
|
|
10
|
-
`).slice(0,240)}if(typeof r.role=="string")return`${r.role} 消息`}return null}function f1(t){const r=Xr(t.at)??Xr(t.timestamp)??Xr(t.recordedAt)??"",i=Xr(t.errorMessage)??Xr(t.label)??Xr(t.type)??Xr(t.message)??"运行事件";return r?`${r} · ${i}`:i}function Wa(t){return String(t.nodeId??t.id??"").trim()}function bc(t){const r=Wa(t);return String(t.label??t.name??(r||"未命名节点"))}function Bp(t,r){if(t.length===0)return;const i=r?.trim();if(i){const c=t.find(u=>Wa(u)===i);if(c)return c}const l=t.find(c=>{const u=String(c.status??"").toLowerCase();return u.includes("fail")||u.includes("error")||u==="blocked"});return l||(t.find(c=>{const u=String(c.status??"").toLowerCase();return u==="running"||u==="in_progress"||u==="active"})??t[0])}function h1({dagRunId:t,nodeId:r,onClose:i,onOpenFull:l}){const o=k.useRef(null),[c,u]=k.useState(null),[h,g]=k.useState([]),[p,v]=k.useState(null),[y,S]=k.useState(!0);k.useEffect(()=>{o.current?.focus();const O=I=>{I.key==="Escape"&&i()};return document.addEventListener("keydown",O),document.title=`检视 · DAG ${t} · Loop Operator`,()=>document.removeEventListener("keydown",O)},[t,i]),k.useEffect(()=>{const O=new AbortController;return S(!0),v(null),g([]),(async()=>{try{const I=await fetch(`/api/dag-runs/${encodeURIComponent(t)}`,{signal:O.signal,credentials:"same-origin"});if(!I.ok)throw new Error(`DAG 查询失败(HTTP ${I.status})`);const A=await I.json();if(O.signal.aborted)return;u(A);const F=Array.isArray(A.nodes)?A.nodes:[],W=Bp(F,r),w=W?Wa(W):r?.trim();if(w){const q=await fetch(`/api/dag-runs/${encodeURIComponent(t)}/nodes/${encodeURIComponent(w)}/session-events`,{signal:O.signal,credentials:"same-origin"});if(q.ok){const Q=await q.json();O.signal.aborted||g((Q.events??[]).slice(-20))}}}catch(I){O.signal.aborted||v(I instanceof Error?I.message:String(I))}finally{O.signal.aborted||S(!1)}})(),()=>O.abort()},[t,r]);const x=k.useMemo(()=>Array.isArray(c?.nodes)?c.nodes:[],[c]),C=Bp(x,r),N=C?Wa(C):"",H=String(c?.effectiveStatus??c?.status??(y?"加载中…":"未知"));return d.jsxs("aside",{className:"inspect-split-panel","aria-label":"DAG 紧凑检视",children:[d.jsxs("div",{className:"inspect-split-header",children:[d.jsxs("div",{children:[d.jsx("p",{className:"inspect-split-kicker",children:"Inspect"}),d.jsx("h2",{children:"检视 DAG"})]}),d.jsx("button",{ref:o,type:"button","aria-label":"关闭检视面板",onClick:i,children:"关闭"})]}),d.jsx("p",{className:"inspect-split-id",children:d.jsx("code",{children:t})}),p?d.jsx("p",{className:"error",children:p}):null,y&&!c?d.jsx("p",{className:"muted",children:"正在加载 DAG…"}):null,d.jsxs("dl",{className:"inspect-split-facts",children:[d.jsxs("div",{children:[d.jsx("dt",{children:"状态"}),d.jsx("dd",{children:H})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"当前节点"}),d.jsx("dd",{children:C?bc(C):"暂无节点"})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"节点状态"}),d.jsx("dd",{children:C?.status??"—"})]}),C?.errorPreview?d.jsxs("div",{children:[d.jsx("dt",{children:"错误摘要"}),d.jsx("dd",{children:C.errorPreview})]}):null]}),d.jsxs("section",{children:[d.jsxs("h3",{children:["节点(",x.length,")"]}),x.length?d.jsx("ul",{className:"inspect-split-nodes",children:x.slice(0,24).map(O=>{const I=Wa(O)||bc(O),A=I===N;return d.jsxs("li",{"data-active":A?"true":void 0,className:A?"is-active":void 0,children:[d.jsx("span",{children:bc(O)}),d.jsx("code",{children:O.status??"—"})]},I)})}):d.jsx("p",{className:"muted",children:y?"加载节点中…":"该运行暂无节点。"})]}),d.jsxs("section",{children:[d.jsxs("h3",{children:["最近事件",N?` · ${N}`:""]}),h.length?d.jsx("ul",{className:"inspect-split-events",children:h.map((O,I)=>d.jsx("li",{children:f1(O)},`${O.at??I}-${I}`))}):d.jsx("p",{className:"muted",children:y?"加载事件中…":"节点事件将在可用时显示。"})]}),d.jsx("button",{type:"button",className:"btn btn-secondary",onClick:l,children:"全屏观测"}),d.jsx("p",{className:"muted",children:"全屏后点顶栏「返回操作台」可回来。"})]})}function m1(t){const{board:r,busy:i}=t;return d.jsxs("details",{className:"night-advanced","data-testid":"night-advanced",open:r.advancedOpen,onToggle:l=>r.setAdvancedOpen(l.target.open),children:[d.jsx("summary",{children:"高级 / Inspect"}),d.jsxs("p",{className:"muted",children:["只读深链:"," ",d.jsx("a",{className:"external-link",href:"/inspect/#/night",children:"/inspect/#/night"})]}),d.jsx("div",{className:"cta-row",children:d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:i,"data-testid":"night-morning-btn",onClick:()=>{r.onMorningReport()},children:"早晨 night 报告"})}),r.morningPreview?d.jsx("pre",{className:"cmd","data-testid":"night-morning-preview",children:r.morningPreview}):null]})}function ks(t){return!t||typeof t!="object"||Array.isArray(t)?null:t}function pt(t,r){const i=t[r];return typeof i=="string"&&i.trim()?i.trim():void 0}function Hp(t,r){const i=t[r];if(!Array.isArray(i))return;const l=i.filter(o=>typeof o=="string");return l.length>0?l:void 0}function p1(t){const r=ks(t);if(!r)return null;const i=ks(r.result),l=[ks(r.reviewPacket),i?ks(i.reviewPacket):null,i,r].filter(Boolean);for(const o of l){const c=pt(o,"scheduleId")??pt(o,"id"),u=pt(o,"gateToken")??pt(o,"approveGate")??pt(o,"writeSetGateToken");if(!(!c||!u))return{scheduleId:c,gateToken:u,...pt(o,"featureId")?{featureId:pt(o,"featureId")}:{},...pt(o,"taskId")?{taskId:pt(o,"taskId")}:{},...Hp(o,"writeSet")?{writeSet:Hp(o,"writeSet")}:{},...pt(o,"worktreePath")?{worktreePath:pt(o,"worktreePath")}:{},...pt(o,"branch")?{branch:pt(o,"branch")}:{},...pt(o,"baseBranch")?{baseBranch:pt(o,"baseBranch")}:{},...pt(o,"baseCommit")?{baseCommit:pt(o,"baseCommit")}:{},...pt(o,"executeAtUtc")?{executeAtUtc:pt(o,"executeAtUtc")}:{},...pt(o,"taskCard")?{taskCard:pt(o,"taskCard")}:{}}}return null}function Up(t){return`docs/features/${t.trim().replace(/^\/+|\/+$/g,"")}`}function g1(t){const r=t.trim(),i=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/.exec(r);return i?`${i[1]} ${i[2]}`:null}function qp(){const t=new Date;t.setHours(20,0,0,0);const r=i=>String(i).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}T${r(t.getHours())}:${r(t.getMinutes())}`}function ny(t){if(!t)return"—";const r=Date.parse(t);if(Number.isNaN(r))return t;try{return new Intl.DateTimeFormat("zh-CN",{dateStyle:"short",timeStyle:"short",timeZone:"Asia/Shanghai"}).format(new Date(r))}catch{return t}}function y1(t){return t.mergeState==="pending-harvest"||/\bscheduler harvest\b/i.test(t.nextAction)}function v1(t){return t.status==="failed"||t.status==="human_required"||t.status==="cancelled"||/\bscheduler discard\b/i.test(t.nextAction)}function As(t){return t==="failed"||t==="human_required"}function b1(t){return`${t}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function ry(t){return{submitted:"已提交",validating:"校验中",validated:"待预约确认",scheduled:"已预约",waiting:"等待触发",dispatching:"派发中",running:"执行中",succeeded:"成功",failed:"失败",human_required:"需人工",cancelled:"已取消",rejected:"已拒绝",cancel_requested:"取消中"}[t]??t}function x1(t){const{target:r,reason:i,onReasonChange:l,force:o,onForceChange:c,busy:u}=t;return d.jsxs("div",{className:"night-discard-card","data-testid":"night-discard-card",children:[d.jsx("h3",{children:"确认 Discard"}),d.jsxs("p",{className:"muted",children:[r.featureId,"/",r.taskId,"(",ry(r.status),")"]}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"原因"}),d.jsx("input",{"data-testid":"night-discard-reason",value:i,disabled:u,placeholder:"human discard reason",onChange:h=>l(h.target.value)})]}),As(r.status)?d.jsxs("label",{className:"field checkbox-field",children:[d.jsx("input",{type:"checkbox","data-testid":"night-discard-force",checked:o,disabled:u,onChange:h=>c(h.target.checked)}),d.jsx("span",{className:"muted",children:"强制 Discard(failed / human_required)"})]}):null,d.jsxs("div",{className:"cta-row",children:[d.jsx("button",{type:"button",className:"btn btn-primary",disabled:u||As(r.status)&&!o,"data-testid":"night-discard-confirm",onClick:t.onConfirm,children:"确认 Discard"}),d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:u,onClick:t.onCancel,children:"返回"})]})]})}function S1(t){const{board:r}=t,{doctor:i,list:l,clockHint:o,doctorIssues:c,auxTicker:u}=r;return d.jsxs("div",{className:"night-health","data-testid":"night-health-bar",children:[d.jsxs("div",{className:"night-health-main",children:[d.jsx("span",{className:`night-health-pill${i?.ok===!1?" is-bad":""}`,children:i?.ok===!1?"Scheduler 异常":"Scheduler 健康"}),d.jsxs("span",{className:"muted",children:["计划 ",i?.scheduleCount??l?.summary.total??"—"," · 活动"," ",i?.activeCount??l?.summary.active??"—"]})]}),o?d.jsxs("p",{className:"muted night-health-hint","data-testid":"night-clock-hint",children:["时钟:",o.message,"(安装/启停请用 CLI:",d.jsx("code",{children:"agent-worker scheduler clock status --repo ."}),")"]}):d.jsxs("p",{className:"muted night-health-hint",children:["到点执行依赖本机 clock / tick,不在此面板安装。详见"," ",d.jsx("a",{className:"external-link",href:"/inspect/#/night",children:"/inspect/#/night"})]}),d.jsxs("div",{className:"night-aux-ticker","data-testid":"night-aux-ticker",children:[d.jsxs("p",{className:"night-aux-ticker-label",children:["开着 Console 时辅助 tick(每 ",u?.intervalSec??60,"s)"]}),d.jsx("p",{className:"muted night-health-hint","data-testid":"night-aux-ticker-disclaimer",children:u?.disclaimer??"仅在本 Console 进程开着时有效;过夜无人值守仍需 OS clock。"}),u?.lastOutcome?d.jsxs("p",{className:"muted","data-testid":"night-aux-ticker-last",children:["上次:",u.lastOutcome,u.running?"(进行中)":"",u.lastSummary?` · ${u.lastSummary}`:"",u.lastError?` · ${u.lastError}`:""]}):null]}),c.length>0?d.jsx("ul",{className:"night-doctor-list","data-testid":"night-doctor-findings",children:c.slice(0,4).map(h=>d.jsxs("li",{children:[d.jsx("strong",{children:h.severity})," ",h.message]},`${h.code}-${h.scheduleId??""}-${h.message}`))}):null]})}function k1(t){const{board:r,busy:i,onHarvest:l,onOpenDiscard:o}=t,{list:c}=r;return d.jsxs(d.Fragment,{children:[c?d.jsxs("div",{className:"night-kpi","data-testid":"night-kpi",children:[d.jsxs("span",{children:["合计 ",c.summary.total]}),d.jsxs("span",{children:["活动 ",c.summary.active]}),d.jsxs("span",{children:["待收成 ",c.summary.pendingHarvest]}),d.jsxs("span",{children:["需人工 ",c.summary.humanRequired]}),d.jsxs("span",{children:["失败 ",c.summary.failed]})]}):null,d.jsxs("div",{className:"night-board","data-testid":"night-board",children:[d.jsx("h3",{children:"计划列表"}),!c||c.schedules.length===0?d.jsxs("div",{className:"empty-state","data-testid":"night-board-empty",children:[d.jsx("p",{className:"empty-title",children:"暂无夜间计划"}),d.jsx("p",{className:"muted",children:"用下方向导预约第一个任务。"})]}):d.jsx("ul",{className:"night-schedule-list",children:c.schedules.map(u=>d.jsxs("li",{className:"night-schedule-row","data-testid":"night-schedule-row","data-status":u.status,children:[d.jsxs("div",{className:"night-schedule-head",children:[d.jsxs("strong",{children:[u.featureId,"/",u.taskId]}),d.jsx("span",{className:"night-status-chip",children:ry(u.status)})]}),d.jsxs("p",{className:"muted",children:["执行 ",ny(u.executeAtUtc),u.mergeState?` · merge ${u.mergeState}`:"",u.taskCard?` · ${u.taskCard}`:""]}),u.waitingReason?d.jsxs("p",{className:"muted",children:["等待原因:",u.waitingReason]}):null,d.jsxs("p",{className:"muted night-next-action",children:["下一步:",u.nextAction]}),d.jsxs("div",{className:"cta-row",children:[y1(u)?d.jsx("button",{type:"button",className:"btn btn-primary",disabled:i,"data-testid":"night-row-harvest",onClick:()=>l(u),children:"Harvest"}):null,v1(u)?d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:i,"data-testid":"night-row-discard",onClick:()=>o(u),children:"Discard"}):null,d.jsx("a",{className:"external-link",href:`/inspect/#/night/${encodeURIComponent(u.scheduleId)}`,children:"Inspect"})]})]},u.scheduleId))})]})]})}function w1(t){const{wizard:r,busy:i}=t;return d.jsxs("div",{className:"night-wizard","data-testid":"night-wizard",children:[d.jsx("h3",{children:"预约夜间任务"}),r.phase==="pick"?d.jsxs(d.Fragment,{children:[r.selectableTasks.length===0?d.jsxs("div",{className:"empty-state","data-testid":"night-task-empty",children:[d.jsx("p",{className:"empty-title",children:"没有可选任务"}),d.jsx("p",{className:"muted",children:"请先在 Feature Packet / Task Pool 中创建任务,再回到此处刷新。"})]}):d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"Feature / Task"}),d.jsxs("select",{"data-testid":"night-task-select",value:r.selectedKey,disabled:i,onChange:l=>r.setSelectedKey(l.target.value),children:[d.jsx("option",{value:"",children:"选择任务…"}),r.selectableTasks.map(l=>{const o=`${l.featureId}::${l.taskId}`;return d.jsxs("option",{value:o,children:[l.featureId,"/",l.taskId,l.status?` · ${l.status}`:""]},o)})]})]}),r.derivedFeatureDir?d.jsxs("p",{className:"muted","data-testid":"night-feature-dir",children:["Feature 目录:",d.jsx("code",{children:r.derivedFeatureDir})]}):null,d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"本地执行时间"}),d.jsx("input",{type:"datetime-local","data-testid":"night-at",value:r.nightAt,disabled:i,onChange:l=>r.setNightAt(l.target.value)})]}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"任务卡片(可选)"}),d.jsx("input",{"data-testid":"night-task-card",value:r.taskCard,disabled:i,placeholder:"UCP-LOOP#11",onChange:l=>r.setTaskCard(l.target.value)})]}),d.jsx("div",{className:"cta-row",children:d.jsx("button",{type:"button",className:"btn btn-primary",disabled:i||!r.selectedKey||!r.nightAt,"data-testid":"night-prepare-btn",onClick:()=>{r.onPrepare()},children:"准备并审阅"})})]}):d.jsxs("div",{className:"night-review-card","data-testid":"night-review-card",children:[d.jsx("p",{className:"muted",children:"请确认 writeSet 与执行环境后预约。Token 已隐藏。"}),d.jsxs("dl",{className:"kv",children:[d.jsxs("div",{children:[d.jsx("dt",{children:"Schedule"}),d.jsx("dd",{children:d.jsx("code",{children:r.review?.scheduleId})})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"任务"}),d.jsxs("dd",{children:[r.review?.featureId,"/",r.review?.taskId]})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"执行时间 (UTC)"}),d.jsx("dd",{children:ny(r.review?.executeAtUtc)})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"Worktree"}),d.jsx("dd",{children:d.jsx("code",{children:r.review?.worktreePath??"—"})})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"分支"}),d.jsx("dd",{children:d.jsx("code",{children:r.review?.branch??"—"})})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"Base"}),d.jsx("dd",{children:d.jsxs("code",{children:[r.review?.baseBranch??"—","@",(r.review?.baseCommit??"").slice(0,12)||"—"]})})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"WriteSet"}),d.jsx("dd",{children:r.review?.writeSet&&r.review.writeSet.length>0?d.jsx("ul",{className:"night-writeset",children:r.review.writeSet.map(l=>d.jsx("li",{children:d.jsx("code",{children:l})},l))}):d.jsx("span",{className:"muted",children:"(未返回显式 writeSet)"})})]})]}),d.jsxs("div",{className:"cta-row",children:[d.jsx("button",{type:"button",className:"btn btn-primary",disabled:i||!r.review,"data-testid":"night-confirm-add-btn",onClick:()=>{r.onConfirmAdd()},children:"确认预约"}),d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:i,"data-testid":"night-review-back-btn",onClick:r.onCancelWizard,children:"返回修改"})]})]})]})}function C1(t){const{setOpError:r}=t,[i,l]=k.useState(null),[o,c]=k.useState(null),[u,h]=k.useState([]),[g,p]=k.useState(null),[v,y]=k.useState(!1),[S,x]=k.useState(!1),[C,N]=k.useState(null),[H,O]=k.useState(null),I=k.useCallback(async()=>{y(!0),p(null);try{const[w,q,Q,se]=await Promise.all([fetch("/api/night-jobs",{credentials:"same-origin"}),fetch("/api/night-jobs/doctor",{credentials:"same-origin"}),fetch("/api/tasks",{credentials:"same-origin"}),fetch("/api/operator/v1/night-aux-ticker",{credentials:"same-origin"})]);if(!w.ok)throw new Error(`加载计划列表失败(HTTP ${w.status})`);const z=await w.json();if(l(z),q.ok?c(await q.json()):c(null),Q.ok){const Y=await Q.json();h(Array.isArray(Y)?Y:[])}else h([]);if(se.ok){const Y=await se.json();Y.ticker&&O(Y.ticker)}}catch(w){p(w instanceof Error?w.message:String(w))}finally{y(!1)}},[]);k.useEffect(()=>{I()},[I]);const A=k.useCallback(async()=>{try{const w=await fetch("/api/night-jobs/morning",{credentials:"same-origin"});if(!w.ok){r(`早晨报告加载失败(HTTP ${w.status})`);return}const q=await w.json();N(JSON.stringify(q,null,2).slice(0,4e3)),x(!0)}catch(w){r(w instanceof Error?w.message:String(w))}},[r]),F=(o?.findings??[]).filter(w=>w.severity==="error"||w.severity==="warning"),W=(o?.findings??[]).find(w=>/clock/i.test(w.code)||/clock/i.test(w.message));return{list:i,doctor:o,tasks:u,loadError:g,loadingBoard:v,advancedOpen:S,setAdvancedOpen:x,morningPreview:C,auxTicker:H,refreshBoard:I,onMorningReport:A,doctorIssues:F,clockHint:W}}function j1(t){const{board:r,runAction:i,isActionSuccess:l,setOpError:o}=t,{tasks:c,refreshBoard:u}=r,[h,g]=k.useState("pick"),[p,v]=k.useState(""),[y,S]=k.useState(qp),[x,C]=k.useState(""),[N,H]=k.useState(null),[O,I]=k.useState(""),[A,F]=k.useState(null),[W,w]=k.useState(!1),q=k.useMemo(()=>{const U=c.filter(G=>typeof G.featureId=="string"&&G.featureId.trim()&&G.taskId);return U.sort((G,K)=>{const T=G.featureId??"",E=K.featureId??"";return T!==E?T.localeCompare(E):G.taskId.localeCompare(K.taskId)}),U},[c]),Q=k.useMemo(()=>p?q.find(U=>`${U.featureId}::${U.taskId}`===p)??null:null,[q,p]),se=Q?.featureId?Up(Q.featureId):"",z=k.useCallback(async(U,G,K)=>{const T=await i("prepareMutationGate",{action:U,actionParams:G});if(!l(T))return;const E=T?.result??T,L=E.receiptId?E:E.result??E;if(!L.receiptId||!L.humanGateToken){o("prepareMutationGate 未返回可消费的 Human Gate receipt");return}return i(U,{...G,confirmationId:L.receiptId,humanGateToken:L.humanGateToken},{clientRequestId:b1(K)})},[l,i,o]),Y=k.useCallback(async()=>{if(!Q?.featureId){o("请先点选 Feature / Task");return}const U=g1(y);if(!U){o("执行时间格式无效,请使用日期时间选择器");return}const G={featureDir:Up(Q.featureId),taskId:Q.taskId,at:U,tz:"Asia/Shanghai",...x.trim()?{taskCard:x.trim()}:{}},K=await z("workerAdmissionPrepare",G,"night-prepare");if(!l(K))return;const T=p1(K?.result??K);if(!T){o("准备成功但未解析到 scheduleId / gateToken。请刷新后重试,或查看 Inspect。");return}H(T),g("review")},[l,y,z,Q,o,x]),ne=k.useCallback(async()=>{if(!N)return;const U=await z("workerSchedulerAdd",{scheduleId:N.scheduleId,approveGate:N.gateToken},"night-add");l(U)&&(H(null),g("pick"),v(""),C(""),S(qp()),await u())},[l,u,N,z]),ue=k.useCallback(()=>{g("pick"),H(null)},[]),P=k.useCallback(async U=>{const G=await z("workerSchedulerHarvest",{scheduleId:U.scheduleId},"night-harvest");l(G)&&await u()},[l,u,z]),B=k.useCallback(async()=>{if(!A)return;const U=O.trim()||"discard from console night workbench",G=As(A.status),K=await z("workerSchedulerDiscard",{scheduleId:A.scheduleId,reason:U,...G||W?{force:!0}:{}},"night-discard");l(K)&&(F(null),I(""),w(!1),await u())},[O,A,W,l,u,z]),D=k.useCallback(U=>{F(U),w(As(U.status)),I("")},[]);return{phase:h,selectedKey:p,setSelectedKey:v,nightAt:y,setNightAt:S,taskCard:x,setTaskCard:C,review:N,discardReason:O,setDiscardReason:I,discardTarget:A,setDiscardTarget:F,forceDiscard:W,setForceDiscard:w,selectableTasks:q,derivedFeatureDir:se,onPrepare:Y,onConfirmAdd:ne,onCancelWizard:ue,onHarvest:P,onDiscard:B,openDiscard:D}}function R1({busy:t,runAction:r,isActionSuccess:i,setOpError:l}){const o=C1({setOpError:l}),c=j1({board:o,runAction:r,isActionSuccess:i,setOpError:l});return d.jsxs("section",{className:"panel night-workbench","aria-labelledby":"night-title","data-testid":"night-jobs-panel",children:[d.jsx("h2",{id:"night-title",children:"夜间任务"}),d.jsx("p",{className:"panel-lead",children:"白天点选任务并预约;列表查看状态;早晨在行内收成或丢弃。写操作仍经 Human Gate,列表复用 Inspect 投影。"}),d.jsx(S1,{board:o,busy:t}),d.jsx("div",{className:"cta-row",children:d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:t||o.loadingBoard,"data-testid":"night-refresh-btn",onClick:()=>{o.refreshBoard()},children:"刷新看板"})}),o.loadError?d.jsx("p",{className:"error","data-testid":"night-load-error",children:o.loadError}):null,d.jsx(k1,{board:o,busy:t,onHarvest:u=>{c.onHarvest(u)},onOpenDiscard:c.openDiscard}),c.discardTarget?d.jsx(x1,{target:c.discardTarget,reason:c.discardReason,onReasonChange:c.setDiscardReason,force:c.forceDiscard,onForceChange:c.setForceDiscard,busy:t,onConfirm:()=>{c.onDiscard()},onCancel:()=>c.setDiscardTarget(null)}):null,d.jsx(w1,{wizard:c,busy:t}),d.jsx(m1,{board:o,busy:t})]})}var T1=ty();const E1=({color:t="currentColor",size:r=24,className:i,...l})=>Er.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:t,...l,className:"remixicon "+(i||"")},Er.createElement("path",{d:"M3 10H2V4.00293C2 3.44903 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.43788 22 4.00293V10H21V20.0015C21 20.553 20.5551 21 20.0066 21H3.9934C3.44476 21 3 20.5525 3 20.0015V10ZM19 10H5V19H19V10ZM4 5V8H20V5H4ZM9 12H15V14H9V12Z"})),N1=({color:t="currentColor",size:r=24,className:i,...l})=>Er.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:t,...l,className:"remixicon "+(i||"")},Er.createElement("path",{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"})),A1=({color:t="currentColor",size:r=24,className:i,...l})=>Er.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:t,...l,className:"remixicon "+(i||"")},Er.createElement("path",{d:"M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z"})),I1=({color:t="currentColor",size:r=24,className:i,...l})=>Er.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:t,...l,className:"remixicon "+(i||"")},Er.createElement("path",{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12H4C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.25022 4 6.82447 5.38734 5.38451 7.50024L8 7.5V9.5H2V3.5H4L3.99989 5.99918C5.82434 3.57075 8.72873 2 12 2ZM13 7L12.9998 11.585L16.2426 14.8284L14.8284 16.2426L10.9998 12.413L11 7H13Z"})),D1=["command","query","operation","tool","server","symbol","path","file_path","filePath","pattern","glob","url"],O1=120,M1=800;function Is(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}function z1(t){if(t!=null){if(typeof t=="string"){const r=t.trim();if(!r)return;try{return Is(JSON.parse(r))}catch{return}}return Is(t)}}function Jn(t,r){const i=t.replace(/\s+/g," ").trim();return i?i.length>r?`${i.slice(0,r)}…`:i:""}function kt(t,r){const i=t[r];if(typeof i=="string"&&i.trim())return i.trim();if(typeof i=="number"&&Number.isFinite(i))return String(i)}function _1(t,r,i){const l=(t??"").toLowerCase();if(l==="bash"||l==="shell"){const o=kt(r,"command");return o?Jn(o,i):void 0}if(l==="mcp"||l.startsWith("mcp_")){const o=kt(r,"server"),c=kt(r,"tool")??kt(r,"name"),u=kt(r,"query");return o&&c?Jn(`${o} · ${c}`,i):c?Jn(c,i):u?Jn(u,i):o?Jn(o,i):void 0}if(l==="lsp_navigation"||l.includes("lsp")){const o=[kt(r,"operation"),kt(r,"symbol"),kt(r,"path")??kt(r,"file_path")??kt(r,"filePath")].filter(Boolean),c=kt(r,"line")??kt(r,"position");if(o.length===0&&!c)return;const u=o.join(" · ");return Jn(c?`${u}${u?":":""}${c}`:u,i)}if(l==="symbol_search"||l.includes("symbol_search")){const o=kt(r,"query")??kt(r,"symbol");return o?Jn(o,i):void 0}if(l==="read"||l==="read_symbol"||l==="read_enclosing"||l.startsWith("read_")){const o=kt(r,"path")??kt(r,"file_path")??kt(r,"filePath"),c=kt(r,"symbol"),u=kt(r,"line");if(!o&&!c)return;const h=[o,c,u].filter(Boolean);return Jn(h.join(" · "),i)}}function L1(t,r){const i=r?.maxLen??O1,l=z1(t);if(!l){if(typeof t=="string"){const g=t.replace(/\s+/g," ").trim();return!g||g==="{}"?"":g.length>i?`${g.slice(0,i)}…`:g}return""}const o=_1(r?.toolName,l,i);if(o)return o;for(const g of D1){const p=l[g];if(typeof p=="string"&&p.trim())return Jn(p,i)}const c=Object.keys(l);if(c.length===0)return"";const u=l[c[0]],h=String(u??"").replace(/\s+/g," ").trim();return h?h.length>i?`${h.slice(0,i)}…`:h:""}function B1(t){const r=(t??"").toLowerCase();return r==="bash"||r==="shell"?{argsLabel:"命令",resultLabel:"输出"}:r==="mcp"||r.startsWith("mcp_")?{argsLabel:"参数",resultLabel:"结果"}:{argsLabel:"入参",resultLabel:"结果"}}function iy(t){if(t==null)return"";if(typeof t=="string"){const l=t.trim();if(!l)return"";if(l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]"))try{return iy(JSON.parse(l))}catch{return t}return t}if(typeof t=="number"||typeof t=="boolean")return String(t);const r=Is(t);if(!r)try{return JSON.stringify(t,null,2)}catch{return String(t)}const i=r.content;if(Array.isArray(i)){const l=[];for(const o of i){const c=Is(o);c&&(c.type==="text"&&typeof c.text=="string"||typeof c.text=="string")&&l.push(c.text)}if(l.length>0)return l.join(`
|
|
11
|
-
`)}if(typeof r.text=="string")return r.text;if(typeof r.output=="string")return r.output;if(typeof r.message=="string")return r.message;try{return JSON.stringify(t,null,2)}catch{return String(t)}}function H1(t){if(t==null)return"";try{return typeof t=="string"?t:JSON.stringify(t,null,2)}catch{return String(t)}}function U1(t,r){if(t===void 0)return{text:"",truncated:!1};const i=r?.maxLen??M1;return t.length<=i?{text:t,truncated:!1}:{text:`${t.slice(0,i)}…`,truncated:!0}}function q1(t,r){if(r===void 0||!Number.isFinite(t)||!Number.isFinite(r))return;const i=Math.round((r-t)/1e3);return i>0?i:void 0}function Kt(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function Fi(t){return`${t}-${Math.random().toString(36).slice(2,10)}`}function xc(t,r){return new Promise((i,l)=>{if(r?.aborted){l(new DOMException("Aborted","AbortError"));return}const o=setTimeout(()=>{r?.removeEventListener("abort",c),i()},t),c=()=>{clearTimeout(o),l(new DOMException("Aborted","AbortError"))};r?.addEventListener("abort",c)})}function ay(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Sc(t){const r=new Date(t),i=new Date;return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()&&r.getDate()===i.getDate()?"今天":r.toLocaleDateString([],{month:"long",day:"numeric"})}function G1(t,r){return t?t.taskId===r.taskId&&t.updatedAt===r.updatedAt&&t.lastEventId===r.lastEventId&&t.operations.length===r.operations.length:!1}const ly={status:"idle",snapshot:null,error:null,reloading:!1,reloadError:null,mutationBusy:!1,mutationToken:null};function sd(t){if(!t||typeof t!="object")return{message:"runtime snapshot request failed"};const r=t,i=r.error;if(i&&typeof i=="object"){const l=i;return{...typeof l.code=="string"&&l.code?{code:l.code}:{},...typeof r.status=="number"?{status:r.status}:{},message:typeof l.message=="string"&&l.message?l.message:"runtime snapshot request failed"}}return{...typeof r.status=="number"?{status:r.status}:{},message:typeof r=="object"&&"message"in r&&typeof r.message=="string"&&r.message?r.message:"runtime snapshot request failed"}}function $1(t,r){switch(r.type){case"load-start":return{...t,sessionId:r.sessionId,status:"loading",error:null};case"load-success":return t.snapshot&&t.sessionId===r.sessionId&&r.snapshot.revision<t.snapshot.revision?t:{...t,sessionId:r.sessionId,status:"ready",snapshot:r.snapshot,error:null,reloadError:null,reloading:!1};case"load-failure":return{...t,sessionId:r.sessionId,status:"error",error:r.error,snapshot:null};case"reload-start":return t.reloading?t:{...t,reloading:!0,reloadError:null,...t.status==="error"?{error:null}:{}};case"reload-success":return{...t,status:"ready",snapshot:r.snapshot,reloading:!1,reloadError:null,error:null,sessionId:r.snapshot.sessionId||t.sessionId};case"reload-failure":return{...t,reloading:!1,reloadError:r.error};case"mutation-start":return{...t,mutationBusy:!0,mutationToken:r.token};case"mutation-adopt":return t.mutationToken!==r.token||t.sessionId!==void 0&&t.sessionId!==r.sessionId||t.snapshot&&r.snapshot.revision<t.snapshot.revision?t:{...t,sessionId:r.sessionId,status:"ready",snapshot:r.snapshot,error:null,reloadError:null,reloading:!1};case"mutation-settle":return t.mutationToken!==r.token?t:{...t,mutationBusy:!1,mutationToken:null};case"mutation-reset":return{...t,mutationBusy:!1,mutationToken:null};case"reset":return{...ly};default:return t}}function sy(t){const r=t.selection;return{...r.model?{model:{provider:r.model.provider,modelId:r.model.id}}:{},...r.thinkingSelection==="auto"?r.effectiveThinkingLevel?{thinkingLevel:r.effectiveThinkingLevel}:{}:{thinkingLevel:r.thinkingSelection}}}function F1(t,r,i,l){const o=i&&i.sessionId===l?sy(i):{},c=o.model??t?.model,u=o.thinkingLevel??t?.thinkingLevel;return{readOnly:r.readOnly,systemPrompt:r.systemPrompt,resources:r.resources,suffix:r.suffix,...c?{model:c}:{},...u?{thinkingLevel:u}:{}}}function V1(t=ly){let r=t;const i=new Set;return{getState:()=>r,dispatch:l=>{r=$1(r,l);for(const o of i)o();return r},subscribe:l=>(i.add(l),()=>i.delete(l))}}const dt=V1();let Tr;function oy(t){return`/api/operator/v1/chat/sessions/${encodeURIComponent(t)}`}function Y1(t){const r=Tr;if(Tr=t,!(r&&r.sessionId===t.sessionId&&r.origin===t.origin)){if((!r||r.sessionId!==t.sessionId)&&dt.dispatch({type:"mutation-reset"}),!t.sessionId){dt.dispatch({type:"reset"});return}dt.dispatch({type:"load-start",sessionId:t.sessionId}),uy(t.sessionId,t.origin)}}async function uy(t,r){try{const i=await fetch(`${r}${oy(t)}/runtime-snapshot`,{credentials:"include"}),l=await i.json().catch(()=>({}));if(Tr?.sessionId!==t)return;if(!i.ok){dt.dispatch({type:"load-failure",sessionId:t,error:{...sd(l),status:i.status}});return}if(!l.snapshot){dt.dispatch({type:"load-failure",sessionId:t,error:{status:i.status,message:"runtime snapshot missing in response"}});return}dt.dispatch({type:"load-success",sessionId:t,snapshot:l.snapshot})}catch(i){if(Tr?.sessionId!==t)return;dt.dispatch({type:"load-failure",sessionId:t,error:{message:i instanceof Error?i.message:String(i)}})}}async function Pi(){const t=Tr;if(!t?.sessionId||dt.getState().reloading)return!1;const r=t.sessionId;dt.dispatch({type:"reload-start"});try{const i=await fetch(`${t.origin}${oy(r)}/reload`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":Kt()},body:"{}"}),l=await i.json().catch(()=>({}));return Tr?.sessionId!==r?!1:i.ok?l.snapshot?(dt.dispatch({type:"reload-success",snapshot:l.snapshot}),!0):(dt.dispatch({type:"reload-failure",error:{status:i.status,message:"reload succeeded but snapshot missing"}}),!1):(dt.dispatch({type:"reload-failure",error:{...sd(l),status:i.status}}),!1)}catch(i){return Tr?.sessionId!==r||dt.dispatch({type:"reload-failure",error:{message:i instanceof Error?i.message:String(i)}}),!1}}async function Ki(){const t=Tr;if(!t?.sessionId)return!1;const r=t.sessionId;return dt.dispatch({type:"load-start",sessionId:r}),uy(r,t.origin),!0}function P1(t,r,i){return i?(dt.dispatch({type:"mutation-adopt",token:t,sessionId:r,snapshot:i}),dt.getState().snapshot===i):!1}function K1(t,r,i){return i.sessionRef.current?.sessionId!==r||dt.getState().mutationToken!==t?!1:(dt.dispatch({type:"mutation-settle",token:t}),!0)}function Qi(){return k.useSyncExternalStore(dt.subscribe,dt.getState)}function cy(t){dt.dispatch(t)}function X1(){return dt.getState()}function Q1(t,r,i){return`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(r)}/skills/${encodeURIComponent(i)}/auto-invocation`}async function Z1(t){const r=t.fetchImpl??fetch;try{const i=await r(Q1(t.origin,t.sessionId,t.resourceId),{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":t.confirmationToken},body:JSON.stringify({autoInvocationEnabled:t.autoInvocationEnabled})}),l=await i.json().catch(()=>({}));if(!i.ok||l.ok===!1)return{ok:!1,error:{...sd(l),status:i.status}};const o=l.preferenceSaved===!0,c=l.reloadApplied===!0;if(!o)return{ok:!1,error:{status:i.status,code:"PI_RESOURCE_PREFERENCES_WRITE_FAILED",message:"preference was not saved"}};if(!c){const u=l.error?.code??"PI_SESSION_BUSY",h=l.error?.message??"preference saved; current session is busy and was not reloaded";return{ok:!0,preferenceSaved:!0,reloadApplied:!1,...l.snapshot?{snapshot:l.snapshot}:{},partialBusy:{code:u,message:h}}}return{ok:!0,preferenceSaved:!0,reloadApplied:!0,...l.snapshot?{snapshot:l.snapshot}:{}}}catch(i){return{ok:!1,error:{message:i instanceof Error?i.message:String(i)}}}}function J1(t){return t.autoInvocationEnabled?{badge:"允许自动使用",help:"模型可自动选择该技能,也可通过 /skill:<name> 手动调用。"}:{badge:"已隐藏自动使用",help:`已从模型自动技能列表隐藏,仍可通过 /skill:${t.name} 手动调用。`}}const $c=()=>window.__CONSOLE_CONFIRMATION_TOKEN__??"";function W1({origin:t}){const[r,i]=k.useState(null),[l,o]=k.useState(null),[c,u]=k.useState(null),[h,g]=k.useState(!1),p=Qi(),v=p.snapshot,y=p.reloading,S=p.reloadError,x=v?.diagnostics??[],C=async I=>{i(I),u(null);{o(null);try{const A=await fetch(`${t}/api/operator/v1/pi/models-config`,{credentials:"include"}),F=await A.json();if(!A.ok)throw new Error(F.error?.message??"读取失败");o(F.data)}catch(A){u(A instanceof Error?A.message:String(A))}}},N=async I=>{g(!0),u(null);try{const A=await fetch(`${t}/api/operator/v1/pi/models-config`,{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":$c()},body:JSON.stringify(I)}),F=await A.json();if(!A.ok)throw new Error(F.error?.message??"模型配置保存失败");o(F.data)}catch(A){u(A instanceof Error?A.message:String(A))}finally{g(!1)}},H=async(I,A)=>{g(!0),u(null);try{const F=await fetch(`${t}/api/operator/v1/pi/models-config/test`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":$c()},body:JSON.stringify({provider:I,modelId:A})}),W=await F.json();if(!F.ok)throw new Error(W.error?.message??"模型测试失败");return W.data?.available===!0}catch(F){return u(F instanceof Error?F.message:String(F)),!1}finally{g(!1)}},O=r==="models"?"Models":r==="skills"?"Skills":"Packages";return d.jsxs("div",{className:"oc-governance",children:[d.jsxs("div",{className:"oc-governance-links",children:[d.jsx("button",{type:"button",onClick:()=>{C("models")},children:"Models"}),d.jsx("button",{type:"button",className:r==="skills"?"is-active":"",onClick:()=>i("skills"),children:"Skills"}),d.jsx("button",{type:"button",className:r==="packages"?"is-active":"",onClick:()=>i("packages"),children:"Packages"})]}),r&&d.jsx("div",{className:"oc-resource-backdrop",onMouseDown:I=>{I.target===I.currentTarget&&i(null)},children:d.jsxs("section",{className:"oc-resource-panel",role:"dialog","aria-modal":"true","aria-label":O,children:[d.jsxs("header",{className:"oc-resource-panel-head",children:[d.jsxs("div",{className:"oc-resource-panel-head-copy",children:[d.jsx("strong",{children:O}),d.jsx("span",{className:"oc-resource-panel-meta",children:r==="models"?"models.json 管理(读写,经 mutation gate)":r==="skills"?"自动使用开关 · 当前 Pi session 实际加载的 Skills":"只读 · 当前 Pi session 实际解析的 Packages"})]}),d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>i(null),children:"关闭"})]}),d.jsxs("div",{className:"oc-resource-panel-body",children:[x.length>0&&d.jsxs("div",{className:"oc-resource-diagnostics",children:[x.map((I,A)=>d.jsx("div",{className:`oc-resource-diagnostic${I.type==="error"?" is-error":""}`,role:I.type==="error"?"alert":void 0,children:d.jsxs("span",{children:[I.type,I.code?` ${I.code}`:"",":",I.message,I.path?`(${I.path})`:"",I.retryable?" · 可重试":""]})},A)),d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Ki()},children:"重试"})]}),c&&d.jsx("p",{className:"oc-resource-error",children:c}),r==="models"&&d.jsx(eS,{busy:h,data:l,onMutate:N,onTest:H}),r==="skills"&&d.jsx(tS,{origin:t,sessionId:v?.sessionId,status:p.status,loadError:p.error,skills:v?.skills,hasSession:!!v?.sessionId,hasDiagnostics:x.length>0}),r==="packages"&&d.jsx(iS,{status:p.status,loadError:p.error,packages:v?.packages,hasSession:!!v?.sessionId,hasDiagnostics:x.length>0})]}),d.jsxs("footer",{className:"oc-resource-panel-foot",children:[d.jsx("span",{className:"oc-resource-panel-meta",children:y?"正在重新加载会话…":S?`${S.code??"ERROR"}:${S.message}`:v?`revision ${v.revision} · ${v.loadedAt}`:"等待会话快照…"}),d.jsxs("div",{className:"oc-resource-panel-actions",children:[S&&d.jsx("button",{type:"button",className:"btn btn-ghost",disabled:y,onClick:()=>{Pi()},children:"重试"}),p.status==="error"&&d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Ki()},children:"重新读取快照"}),d.jsx("button",{type:"button",className:"btn btn-ghost",disabled:y,onClick:()=>{Pi()},children:"重新加载会话"})]})]})]})})]})}function eS({busy:t,data:r,onMutate:i,onTest:l}){const[o,c]=k.useState(""),[u,h]=k.useState(""),[g,p]=k.useState(""),[v,y]=k.useState(null),S=async x=>{x.preventDefault(),!(!r||!o.trim()||!u.trim())&&(await i({expectedRevision:r.revision,action:"upsert-model",provider:o.trim(),model:{id:u.trim(),...g.trim()?{name:g.trim()}:{}}}),h(""),p(""))};return r?d.jsxs("div",{className:"oc-models-config",children:[d.jsx("p",{className:"oc-resource-panel-meta",children:"Console 不读取或写入 API key;credential 请通过 Pi CLI 配置。"}),r.providers.length===0?d.jsx("p",{className:"oc-resource-empty",children:"models.json 中暂无 Provider(真实空态;用 Pi CLI 配置)。"}):null,r.providers.map(x=>d.jsxs("article",{className:"oc-model-provider",children:[d.jsxs("div",{className:"oc-model-provider-head",children:[d.jsx("strong",{children:x.name}),d.jsx("span",{children:x.credential.configured?"credential configured":"credential 未配置"})]}),x.models.map(C=>d.jsxs("div",{className:"oc-model-row",children:[d.jsx("span",{children:C.name?`${C.name} (${C.id})`:C.id}),d.jsxs("div",{className:"oc-model-row-actions",children:[d.jsx("button",{type:"button",disabled:t,onClick:()=>{l(x.name,C.id).then(N=>y(`${x.name}/${C.id}: ${N?"可用":"不可用"}`))},children:"测试"}),d.jsx("button",{type:"button",disabled:t,onClick:()=>{window.confirm(`确认删除模型 ${x.name}/${C.id}?`)&&i({expectedRevision:r.revision,action:"remove-model",provider:x.name,model:{id:C.id}})},children:"删除"})]})]},C.id)),d.jsx("button",{type:"button",className:"oc-model-provider-remove",disabled:t,onClick:()=>{window.confirm(`确认删除 Provider ${x.name}?`)&&i({expectedRevision:r.revision,action:"remove-provider",provider:x.name})},children:"删除 Provider"})]},x.name)),v&&d.jsx("p",{className:"oc-model-test-result",children:v}),d.jsxs("form",{className:"oc-model-form",onSubmit:x=>{S(x)},children:[d.jsx("strong",{children:"新增或更新模型"}),d.jsx("input",{required:!0,placeholder:"Provider",value:o,onChange:x=>c(x.target.value)}),d.jsx("input",{required:!0,placeholder:"Model ID",value:u,onChange:x=>h(x.target.value)}),d.jsx("input",{placeholder:"显示名称(可选)",value:g,onChange:x=>p(x.target.value)}),d.jsx("button",{type:"submit",disabled:t,children:t?"保存中…":"保存模型"})]})]}):d.jsx("p",{className:"oc-resource-empty",children:"正在读取模型配置…"})}function dy(t){return t.status==="loading"?d.jsx("p",{className:"oc-resource-empty",children:"会话快照加载中…"}):t.status==="error"?d.jsxs("div",{className:"oc-resource-error",role:"alert",children:[d.jsxs("span",{children:[t.loadError?.code?`${t.loadError.code}:`:"",t.loadError?.message??"会话快照读取失败"]}),d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Ki()},children:"重试"})]}):t.hasSession?d.jsx("p",{className:"oc-resource-empty",children:t.emptyText}):d.jsx("p",{className:"oc-resource-empty",children:"当前没有活动会话;打开会话后显示真实资源清单(真实空态)。"})}function tS(t){const r=t.skills??[],[i,l]=k.useState(null),[o,c]=k.useState(null),[u,h]=k.useState(null),[g,p]=k.useState({});if(t.status!=="ready"||!t.hasSession)return d.jsx(dy,{status:t.status,loadError:t.loadError,hasSession:t.hasSession,emptyText:"当前 session 未加载任何 Skills(真实空态)"});if(r.length===0&&!t.hasDiagnostics)return d.jsx("p",{className:"oc-resource-empty",children:"当前 session 未加载任何 Skills(真实空态,未伪造列表)。"});const v=new Map;for(const x of r){const C=x.scope||"unknown",N=v.get(C)??[];N.push(x),v.set(C,N)}const y=x=>Object.prototype.hasOwnProperty.call(g,x.resourceId)?g[x.resourceId]:x.autoInvocationEnabled,S=async(x,C)=>{if(!t.sessionId||!x.resourceId||i)return;y(x),c(null),h(null),l(x.resourceId),p(H=>({...H,[x.resourceId]:C}));const N=await Z1({origin:t.origin,sessionId:t.sessionId,resourceId:x.resourceId,autoInvocationEnabled:C,confirmationToken:$c()});if(l(null),!N.ok){p(H=>{const O={...H};return delete O[x.resourceId],O}),c(`${N.error.code?`${N.error.code}:`:""}${N.error.message}`);return}if(N.reloadApplied&&N.snapshot){cy({type:"load-success",sessionId:t.sessionId,snapshot:N.snapshot}),p(H=>{const O={...H};return delete O[x.resourceId],O}),h(null);return}!N.reloadApplied&&N.partialBusy&&h(`设置已保存;当前会话正忙(${N.partialBusy.code}),请在本轮结束后点击「重新加载会话」。${N.partialBusy.message}`)};return d.jsxs("div",{className:"oc-resource-lists",children:[o?d.jsx("p",{className:"oc-resource-error",role:"alert",children:o}):null,u?d.jsx("p",{className:"oc-skill-partial-notice",role:"status",children:u}):null,[...v.entries()].map(([x,C])=>d.jsxs("section",{className:"oc-resource-group",children:[d.jsxs("header",{className:"oc-resource-group-head",children:[d.jsx("strong",{children:x}),d.jsxs("span",{children:[C.length," 项"]})]}),d.jsx("ul",{className:"oc-resource-list",children:C.map(N=>{const H=y(N),O=J1({name:N.name,autoInvocationEnabled:H}),I=i===N.resourceId;return d.jsxs("li",{className:`oc-resource-item${H?"":" is-auto-off"}`,children:[d.jsxs("div",{className:"oc-resource-item-head",children:[d.jsx("strong",{children:N.name}),d.jsx("span",{children:O.badge})]}),d.jsxs("label",{className:"oc-skill-auto-toggle",children:[d.jsx("input",{type:"checkbox",checked:H,disabled:I||!N.resourceId,"aria-label":`允许自动使用 ${N.name}`,onChange:A=>{S(N,A.target.checked)}}),d.jsx("span",{children:I?"保存中…":"允许自动使用"})]}),d.jsx("p",{className:"oc-skill-auto-help",children:O.help}),N.description?d.jsx("p",{children:N.description}):null,d.jsx("code",{children:N.path}),N.source?d.jsxs("span",{className:"oc-resource-panel-meta",children:["source: ",N.source]}):null,Array.isArray(N.diagnostics)&&N.diagnostics.length>0?d.jsx("span",{className:"oc-resource-diagnostic",children:N.diagnostics.join(";")}):null]},`${x}:${N.resourceId||N.path}`)})})]},x))]})}const nS={extension:"Extensions",skill:"Skills",prompt:"Prompts",theme:"Themes"};function rS(t){return Array.isArray(t.diagnostics)&&t.diagnostics.length>0?"error":t.enabled?t.version?"installed":"loaded":"disabled"}function iS(t){const r=t.packages??[];return t.status!=="ready"||!t.hasSession?d.jsx(dy,{status:t.status,loadError:t.loadError,hasSession:t.hasSession,emptyText:"当前 session 未配置 Packages(真实空态)"}):r.length===0&&!t.hasDiagnostics?d.jsx("p",{className:"oc-resource-empty",children:"当前 session 未配置 Packages(真实空态,未伪造列表)。"}):d.jsx("div",{className:"oc-resource-lists",children:r.map(i=>{const l=rS(i),o=new Map;for(const c of i.resolved??[]){const u=nS[c.type]??c.type,h=o.get(u)??[];h.push(c),o.set(u,h)}return d.jsxs("article",{className:"oc-resource-item oc-package",children:[d.jsxs("div",{className:"oc-resource-item-head",children:[d.jsx("strong",{children:i.spec}),d.jsx("span",{className:`oc-package-status is-${l}`,children:l})]}),d.jsxs("p",{className:"oc-resource-panel-meta",children:[i.scope," · ",i.enabled?"loaded":"disabled"]}),i.packageName?d.jsxs("p",{className:"oc-package-meta",children:[d.jsx("span",{children:"package"}),d.jsx("code",{children:i.packageName})]}):null,i.version?d.jsxs("p",{className:"oc-package-meta",children:[d.jsx("span",{children:"installed"}),d.jsxs("code",{children:["v",i.version]})]}):null,i.configuredVersion?d.jsxs("p",{className:"oc-package-meta",children:[d.jsx("span",{children:"configured"}),d.jsx("code",{children:i.configuredVersion})]}):null,i.installedPath?d.jsxs("p",{className:"oc-package-meta",children:[d.jsx("span",{children:"installed path"}),d.jsx("code",{children:i.installedPath})]}):null,i.cwd?d.jsxs("p",{className:"oc-package-meta",children:[d.jsx("span",{children:"cwd"}),d.jsx("code",{children:i.cwd})]}):null,o.size>0?d.jsx("div",{className:"oc-package-resources",children:[...o.entries()].map(([c,u])=>d.jsxs("section",{className:"oc-package-group",children:[d.jsxs("header",{className:"oc-resource-group-head",children:[d.jsx("strong",{children:c}),d.jsxs("span",{children:[u.length," 项"]})]}),d.jsx("ul",{className:"oc-resource-sub-list",children:u.map((h,g)=>d.jsxs("li",{children:[d.jsx("span",{children:h.name||h.path}),d.jsxs("span",{className:"oc-resource-panel-meta",children:[h.scope,h.source?` · ${h.source}`:""]}),d.jsx("code",{children:h.path})]},`${c}:${g}`))})]},c))}):d.jsx("p",{className:"oc-resource-panel-meta",children:"未解析出扩展/技能/提示词/主题(真实空态)"}),Array.isArray(i.diagnostics)&&i.diagnostics.length>0?d.jsx("div",{className:"oc-package-diagnostics",children:i.diagnostics.map((c,u)=>d.jsx("span",{children:c},u))}):null]},`${i.scope}:${i.spec}`)})})}const Ds=10,fy="loop-console.operator-chat.sidebar-split.v1",ei=45,Vs=28,Ys=70,Gp=5,$p=10;function Yi(t){return Number.isFinite(t)?Math.min(Ys,Math.max(Vs,Math.round(t))):ei}function aS(t){if(t==null||t==="")return null;const r=Number(t);if(!Number.isFinite(r))return null;const i=Math.round(r);return i<Vs||i>Ys?null:i}function lS(t=hy()){if(!t)return ei;try{return aS(t.getItem(fy))??ei}catch{return ei}}function Fp(t,r=hy()){const i=Yi(t);if(!r)return i;try{r.setItem(fy,String(i))}catch{}return i}function sS(t,r,i=!1){const l=Yi(t);switch(r){case"ArrowUp":return Yi(l-(i?$p:Gp));case"ArrowDown":return Yi(l+(i?$p:Gp));case"Home":return Vs;case"End":return Ys;case"Enter":return ei;default:return null}}function Vp(t,r,i){if(!Number.isFinite(i)||i<=0)return ei;const l=(t-r)/i;return Yi(l*100)}function hy(){try{return typeof globalThis>"u"?null:globalThis.localStorage??null}catch{return null}}const Yp='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function od(t){const{open:r,containerRef:i,triggerRef:l,onEscape:o}=t,c=k.useRef(null),u=k.useRef(!1);k.useEffect(()=>{if(r){if(!u.current){const h=document.activeElement;c.current=l?.current??(h instanceof HTMLElement?h:null);const g=i.current;g&&(g.querySelector(Yp)??g).focus?.(),u.current=!0}return()=>{if(!u.current)return;const h=l?.current??c.current;h&&document.contains(h)&&h.focus(),c.current=null,u.current=!1}}u.current=!1},[r,i,l]),k.useEffect(()=>{if(!r)return;const h=i.current;if(!h)return;const g=p=>{if(p.key==="Escape"){p.preventDefault(),o?.();return}if(p.key!=="Tab")return;const v=Array.from(h.querySelectorAll(Yp)).filter(C=>!C.hasAttribute("disabled")&&C.tabIndex!==-1);if(v.length===0){p.preventDefault(),h.focus?.();return}const y=v[0],S=v[v.length-1],x=document.activeElement;p.shiftKey?(x===y||!h.contains(x))&&(p.preventDefault(),S.focus()):(x===S||!h.contains(x))&&(p.preventDefault(),y.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r,i,o])}function oS(t){const{item:r,active:i,state:l}=t,o=r.title||r.displayTitle||"未命名对话",c=k.useRef(null),[u,h]=k.useState(null),g=k.useRef(null),p=()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},v=()=>{p(),h(null)},y=C=>{if(!(C.scrollWidth>C.clientWidth+1)){v();return}const H=C.getBoundingClientRect();h({x:Math.min(H.right+8,window.innerWidth-16),y:H.top+H.height/2})},S=C=>{C&&(p(),g.current=window.setTimeout(()=>y(C),350))};k.useEffect(()=>{const C=()=>v(),N=H=>{H.key==="Escape"&&v()};return window.addEventListener("scroll",C,!0),window.addEventListener("keydown",N),()=>{window.removeEventListener("scroll",C,!0),window.removeEventListener("keydown",N),p()}},[]);const x=`oc-session-tip-${r.sessionId}`;return d.jsxs("div",{className:`oc-session-item${i?" is-active":""}`,"data-session-id":r.sessionId,children:[d.jsxs("button",{type:"button",className:"oc-session-main",onClick:t.onActivate,onMouseEnter:C=>{const N=C.currentTarget.querySelector("strong");N instanceof HTMLElement&&S(N)},onMouseLeave:v,onFocus:C=>{const N=C.currentTarget.querySelector("strong");N instanceof HTMLElement&&S(N)},onBlur:v,"aria-describedby":u?x:void 0,children:[d.jsxs("strong",{ref:c,children:[o,r.activeTurnId?" · 运行中":""]}),d.jsx("span",{children:new Date(r.updatedAt).toLocaleString()})]}),d.jsxs("div",{className:"oc-session-actions",children:[d.jsx("button",{type:"button",className:"oc-session-menu",title:"重命名会话","aria-label":"重命名会话",onClick:C=>{C.stopPropagation();const N=window.prompt("会话名称",r.title??"");N!==null&&t.onRename(N)},children:d.jsx(A1,{size:16,"aria-hidden":"true"})}),d.jsx("button",{type:"button",className:"oc-session-menu",title:l==="active"?"归档会话":"恢复会话","aria-label":l==="active"?"归档会话":"恢复会话",onClick:C=>{C.stopPropagation(),t.onSetState(l==="active"?"archived":"active")},children:l==="active"?d.jsx(E1,{size:16,"aria-hidden":"true"}):d.jsx(I1,{size:16,"aria-hidden":"true"})}),d.jsx("button",{type:"button",className:"oc-session-menu oc-session-delete",title:"删除会话","aria-label":"删除会话",onClick:C=>{C.stopPropagation(),t.onDelete()},children:d.jsx(N1,{size:16,"aria-hidden":"true"})})]}),u?T1.createPortal(d.jsx("div",{id:x,role:"tooltip",className:"oc-session-title-tooltip",style:{position:"fixed",left:u.x,top:u.y,transform:"translateY(-50%)"},children:o}),document.body):null]})}function uS(t){return[...t].sort((r,i)=>r.kind!==i.kind?r.kind==="directory"?-1:1:r.name.localeCompare(i.name,void 0,{sensitivity:"base"}))}function cS({open:t}){return d.jsx("svg",{className:`oc-tree-chevron${t?" is-open":""}`,width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:d.jsx("path",{d:"M4.2 2.4 7.8 6 4.2 9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function dS({open:t}){return t?d.jsxs("svg",{className:"oc-tree-glyph is-folder-open",width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:[d.jsx("path",{d:"M1.5 4.2h3.1l1.1 1.2H12a.8.8 0 0 1 .8.8v5a.8.8 0 0 1-.8.8H2a.8.8 0 0 1-.8-.8V5a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:"0.88"}),d.jsx("path",{d:"M1.8 5.8h10.4l-.7 5.2H2.5L1.8 5.8Z",fill:"currentColor",opacity:"0.55"})]}):d.jsx("svg",{className:"oc-tree-glyph is-folder",width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:d.jsx("path",{d:"M1.5 3.8h3.2l1 1.1H12a.8.8 0 0 1 .8.8v5.5a.8.8 0 0 1-.8.8H2a.8.8 0 0 1-.8-.8V4.6a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:"0.78"})})}function fS(){return d.jsxs("svg",{className:"oc-tree-glyph is-file",width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:[d.jsx("path",{d:"M3.2 1.6h5.1L10.8 4v8.4a.8.8 0 0 1-.8.8H3.2a.8.8 0 0 1-.8-.8V2.4a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:"0.55"}),d.jsx("path",{d:"M8.3 1.7v2.5h2.4",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round",opacity:"0.75"})]})}function hS(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M3 3.5h10v2H3v-2Zm0 3.5h10v2H3V7Zm0 3.5h7V13H3v-2Z",fill:"currentColor"})})}function mS(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M8 3v10M3 8h10",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function pS(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:d.jsx("path",{d:"M8 2.2 13 4.5v3.2c0 3.1-2.1 5.5-5 6.3-2.9-.8-5-3.2-5-6.3V4.5L8 2.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function gS(t){const r=t.sessions.slice(0,Ds),[i,l]=k.useState(()=>lS()),[o,c]=k.useState(!1),u=k.useRef(null),h=k.useRef(null),g=t.layoutMode==="comfortable"&&t.open,p=t.layoutMode==="compact",v=t.drawerOpen&&(t.layoutMode==="compact"||t.layoutMode==="narrow");od({open:v,containerRef:h,triggerRef:t.drawerTriggerRef,onEscape:t.onCloseDrawer});const y=k.useCallback((I,A)=>{const F=Yi(I);l(F),A&&Fp(F)},[]),S=k.useCallback(I=>{const A=sS(i,I.key,I.shiftKey);A!=null&&(I.preventDefault(),y(A,!0))},[y,i]),x=k.useCallback(I=>{I.preventDefault(),I.currentTarget.setPointerCapture(I.pointerId),c(!0);const F=u.current;if(!F)return;const W=F.getBoundingClientRect();y(Vp(I.clientY,W.top,W.height),!1)},[y]),C=k.useCallback(I=>{if(!I.currentTarget.hasPointerCapture(I.pointerId))return;const A=u.current;if(!A)return;const F=A.getBoundingClientRect();y(Vp(I.clientY,F.top,F.height),!1)},[y]),N=k.useCallback(I=>{I.currentTarget.hasPointerCapture(I.pointerId)&&I.currentTarget.releasePointerCapture(I.pointerId),c(!1),Fp(i)},[i]),H=k.useCallback(()=>{y(ei,!0)},[y]),O=d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"oc-sidebar-split",ref:u,style:{"--oc-session-share":`${i}%`,"--oc-repo-share":`${100-i}%`},"data-dragging":o?"true":"false",children:[d.jsxs("section",{className:"oc-sidebar-section oc-sessions",children:[d.jsxs("header",{children:[d.jsx("strong",{children:"会话"}),d.jsxs("div",{className:"oc-sidebar-header-actions",children:[d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:t.onCreate,disabled:t.creatingSession,"aria-busy":t.creatingSession||void 0,children:t.creatingSession?"创建中…":"新建"}),t.layoutMode==="comfortable"?d.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:t.onToggleOpen,"aria-expanded":!0,"aria-label":"收起侧栏",title:"收起侧栏",children:d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:d.jsx("path",{d:"M8.8 2.6 5.2 7l3.6 4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}):d.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:t.onCloseDrawer,"aria-label":"关闭侧栏抽屉",title:"关闭",children:d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:d.jsx("path",{d:"M3.5 3.5 10.5 10.5M10.5 3.5 3.5 10.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})})]})]}),d.jsxs("div",{className:"oc-session-scroll",children:[["active","archived"].map(I=>{const A=r.filter(F=>F.state===I);return A.length?d.jsxs("div",{className:"oc-session-group",children:[d.jsx("small",{children:I==="active"?"进行中":"已归档"}),A.map(F=>d.jsx(oS,{item:F,active:t.activeSessionId===F.sessionId,state:I,onActivate:()=>t.onActivate(F.sessionId),onRename:W=>t.onRename(F.sessionId,W),onSetState:W=>t.onSetState(F.sessionId,W),onDelete:()=>t.onDelete(F.sessionId)},F.sessionId))]},I):null}),r.length===0?d.jsx("p",{className:"oc-tree-empty",children:"暂无会话,点击上方新建。"}):null]})]}),d.jsx("div",{className:"oc-sidebar-separator",role:"separator","aria-orientation":"horizontal","aria-valuemin":Vs,"aria-valuemax":Ys,"aria-valuenow":i,"aria-label":"调整会话与仓库高度比例",tabIndex:0,onKeyDown:S,onPointerDown:x,onPointerMove:C,onPointerUp:N,onPointerCancel:N,onDoubleClick:H}),d.jsxs("section",{className:"oc-sidebar-section oc-explorer",children:[d.jsxs("header",{children:[d.jsx("strong",{children:"仓库"}),d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:t.onRefreshTree,children:"刷新"})]}),d.jsx("p",{className:"oc-explorer-hint",children:"单击插入 @路径 · 双击预览"}),t.treeError&&d.jsx("p",{className:"oc-sidebar-error",children:t.treeError}),d.jsx("div",{className:"oc-tree-scroll",children:d.jsx(my,{entries:t.tree[""]??[],tree:t.tree,expanded:t.expanded,depth:0,onToggle:t.onToggleDir,onInsert:t.onInsert,onPreview:t.onPreview})})]})]}),d.jsx(W1,{origin:t.origin})]});return d.jsxs(d.Fragment,{children:[p?d.jsxs("nav",{className:"oc-sidebar-rail","aria-label":"紧凑侧栏",children:[d.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"打开会话与仓库",title:"会话与仓库","aria-expanded":v,onClick:()=>v?t.onCloseDrawer():t.onOpenDrawer(),children:d.jsx(hS,{})}),d.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":t.creatingSession?"创建会话中":"新建会话",title:t.creatingSession?"创建中…":"新建会话",onClick:t.onCreate,disabled:t.creatingSession,"aria-busy":t.creatingSession||void 0,children:d.jsx(mS,{})}),d.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"治理入口",title:"治理",onClick:()=>v?t.onCloseDrawer():t.onOpenDrawer(),children:d.jsx(pS,{})})]}):null,t.layoutMode==="comfortable"?d.jsx("aside",{className:`oc-sidebar${g?"":" is-collapsed"}`,"aria-label":"会话与仓库",children:g?O:d.jsx("button",{type:"button",className:"oc-sidebar-toggle is-collapsed",onClick:t.onToggleOpen,"aria-expanded":!1,"aria-label":"展开侧栏",title:"展开侧栏",children:d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:d.jsx("path",{d:"M5.2 2.6 8.8 7 5.2 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})})}):null,v?d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"oc-overlay-backdrop","aria-label":"关闭侧栏遮罩",onClick:t.onCloseDrawer}),d.jsx("aside",{ref:h,className:"oc-sidebar oc-sidebar-drawer","aria-label":"会话与仓库抽屉",role:"dialog","aria-modal":"true",tabIndex:-1,children:O})]}):null]})}function my(t){const r=k.useMemo(()=>uS(t.entries),[t.entries]);return r.length?d.jsx("ul",{className:"oc-tree",role:t.depth===0?"tree":"group",children:r.map(i=>{const l=i.name.startsWith(".");if(i.kind==="directory"){const o=t.expanded.has(i.path);return d.jsxs("li",{className:`oc-tree-node is-dir${o?" is-open":""}${l?" is-dot":""}`,role:"treeitem","aria-expanded":o,children:[d.jsxs("button",{type:"button",className:"oc-tree-row oc-tree-dir",onClick:()=>t.onToggle(i.path),style:{paddingLeft:`${8+t.depth*12}px`},children:[d.jsx(cS,{open:o}),d.jsx(dS,{open:o}),d.jsx("span",{className:"oc-tree-label",children:i.name})]}),o?d.jsx("div",{className:"oc-tree-children",style:{"--oc-tree-guide":`${14+t.depth*12}px`},children:d.jsx(my,{entries:t.tree[i.path]??[],tree:t.tree,expanded:t.expanded,depth:t.depth+1,onToggle:t.onToggle,onInsert:t.onInsert,onPreview:t.onPreview})}):null]},i.path)}return d.jsx("li",{className:`oc-tree-node is-file${l?" is-dot":""}`,role:"treeitem",children:d.jsx(yS,{entry:i,depth:t.depth,onInsert:t.onInsert,onPreview:t.onPreview})},i.path)})}):d.jsx("p",{className:"oc-tree-empty",children:"此目录为空或没有可安全浏览的文件。"})}function yS(t){const r=k.useRef(null);return k.useEffect(()=>()=>{r.current!==null&&window.clearTimeout(r.current)},[]),d.jsxs("button",{type:"button",className:"oc-tree-row oc-tree-file",style:{paddingLeft:`${8+t.depth*12}px`},title:"单击插入引用;双击预览",onClick:()=>{r.current!==null&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{t.onInsert(t.entry.path),r.current=null},220)},onDoubleClick:()=>{r.current!==null&&window.clearTimeout(r.current),r.current=null,t.onPreview(t.entry.path)},children:[d.jsx("span",{className:"oc-tree-chevron-spacer","aria-hidden":"true"}),d.jsx(fS,{}),d.jsx("span",{className:"oc-tree-label",children:t.entry.name})]})}function vS(t){const r=t.previews.find(i=>i.path===t.activePath);return!r&&!t.loading?null:d.jsxs(d.Fragment,{children:[r&&d.jsxs("section",{className:"oc-file-preview","aria-label":`文件预览 ${r.path}`,children:[d.jsxs("header",{children:[d.jsx("div",{className:"oc-file-tabs",role:"tablist","aria-label":"文件预览 Tabs",children:t.previews.map(i=>d.jsx("button",{type:"button",role:"tab","aria-selected":i.path===r.path,className:i.path===r.path?"is-active":"",onClick:()=>t.onActivate(i.path),children:i.path},i.path))}),d.jsxs("span",{children:[r.bytes," bytes",r.truncated?" · 已截断":""]}),d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>t.onClose(r.path),children:"关闭预览"})]}),d.jsx("pre",{children:d.jsx("code",{children:r.content})})]}),t.loading&&d.jsx("div",{className:"oc-file-preview-loading",children:"正在读取文件…"})]})}const ud=[{command:"/task",label:"Task context",description:"查看当前任务、Draft 与 assessment",action:"focus-panel:task",source:"operator"},{command:"/contract",label:"Contract",description:"查看 contract diff 与 apply gate",action:"focus-panel:contract",source:"operator"},{command:"/dag",label:"DAG",description:"查看 DAG spine、确认与运行状态",action:"focus-panel:dag",source:"operator"},{command:"/interview",label:"Interview",description:"打开 Requirement Interview",action:"focus:interview",source:"operator"},{command:"/reload",label:"Reload session",description:"重新加载当前 Pi 会话的设置、扩展、技能、提示词、主题与上下文文件(不产生消息)",action:"reload",source:"operator"},{command:"/help",label:"Shortcuts",description:"显示可用 shortcut",action:"show-help",source:"operator"}],py=[{command:"/compact",label:"压缩上下文",description:"压缩当前会话上下文,释放 token",action:"compact",source:"web"},{command:"/name",label:"重命名会话",description:"设置当前会话标题",action:"name",source:"web"},{command:"/session",label:"会话信息",description:"显示当前会话元信息",action:"session",source:"web"},{command:"/copy",label:"复制回复",description:"复制最后一条助手消息原文",action:"copy",source:"web"}],Jr={operator:0,web:1,extension:2,skill:3,prompt:4};function Pp(t){const r=t.trim().split(/\s+/,1)[0]??"";return r?r.startsWith("/")?r.toLowerCase():`/${r.toLowerCase()}`:""}function bS(t){const r=t.trim().split(/\s+/,1)[0]?.toLowerCase();if(!r?.startsWith("/"))return;const i=[...ud,...py].find(l=>l.command===r);return i?{command:i.command,action:i.action}:{command:r,action:"unknown"}}function xS(t=[]){const r=new Map,i=l=>{const o=Pp(l.command);if(!o)return;const c=r.get(o);if(!c){r.set(o,{...l,command:o});return}Jr[l.source]<Jr[c.source]&&r.set(o,{...l,command:o})};for(const l of ud)i({command:l.command,label:l.label,description:l.description,source:l.source,action:l.action});for(const l of py)i({command:l.command,label:l.label,description:l.description,source:l.source,action:l.action});for(const l of t){const o=Pp(l.command);o&&i({command:o,label:l.label||o,description:l.description||"",source:l.source,action:"pi-prompt"})}return[...r.values()].sort((l,o)=>{const c=Jr[l.source]-Jr[o.source];return c!==0?c:l.command.localeCompare(o.command)})}function SS(t,r){const i=(r.trim().split(/\s+/,1)[0]??"").toLowerCase();if((/\s/.test(r.trimStart().slice(1))||r.includes(" "))&&r.trimStart().includes(" "))return[];const l=i.startsWith("/")?i:i?`/${i}`:"/",o=l==="/"?"":l.slice(1),c=[];for(const u of t){const h=u.command.toLowerCase(),g=h.startsWith("/")?h.slice(1):h,p=u.description.toLowerCase();let v=100;if(!o)v=10+Jr[u.source];else if(h===l||g===o)v=0;else if(h.startsWith(l)||g.startsWith(o))v=1;else if(g.includes(o)||h.includes(o))v=2;else if(p.includes(o))v=3;else continue;c.push({...u,score:v})}return c.sort((u,h)=>{if(u.score!==h.score)return u.score-h.score;const g=Jr[u.source]-Jr[h.source];return g!==0?g:u.command.localeCompare(h.command)})}const kS={operator:"Operator",web:"Pi Web",extension:"Extensions",prompt:"Prompts",skill:"Skills"},Kp={comfortableMin:620,compactMin:480};function wS(t){return!Number.isFinite(t)||t<0?"extra-compact":t>=Kp.comfortableMin?"comfortable":t>=Kp.compactMin?"compact":"extra-compact"}function CS(t){return`is-landing-${t}`}const jS=[{label:"新建任务",hint:"从需求描述导入并创建任务",prompt:"帮我新建一个任务:我描述需求,你引导我用 PRD/需求描述导入(bootstrapFromPrd),并给出建议的 taskKind(如后端研发 backend-feature / 后端测试 backend-test)。"},{label:"查看任务状态",hint:"列出任务与就绪/阻塞状态",prompt:"列出当前所有 task 及其状态,重点说明哪些是 Ready 可以推进、哪些 Blocked 及阻塞原因。"},{label:"诊断 DAG 运行",hint:"对失败运行跑 Doctor",prompt:"帮我诊断最近失败或异常的 DAG 运行:先列出最近的 DAG 运行,对有问题的运行执行 doctor,总结根因和可执行的恢复方案。"},{label:"恢复或重跑任务",hint:"默认从节点续跑,勿无故新开 task",prompt:"我要恢复失败或卡住的 DAG。请先 dagReport/doctor 看 primaryFailure.nodeId 与 primaryRecovery;默认用 dagRerunPlan→dagRerun 从失败/安全上游节点续跑(先 plan 再 Human Gate),不要新建 task-id。仅当 plan 不合格(writer/decision/fingerprint)或契约/源真变时才 standaloneTaskRerun;paused 走 approve/resume;Worker-owned 用 workerTaskRetry。确定后直接帮我发起。"}];function gy(t){const r=t.readiness==="setup-required",i=!!t.disabled||r,l=t.density??"comfortable",o=t.mode==="no-session"?"开始一段新的对话":"今天想推进什么?",c=t.mode==="no-session"?"用自然语言编排 loop-agent:查询状态、诊断问题、创建与恢复任务。可先点选下方建议,或新建空白对话。":"会话已就绪。点选建议快速开场,或在下方输入框直接描述目标。业务写入仍经受治理 DAG。";return d.jsxs("div",{className:`oc-empty ${CS(l)}`,role:"status","data-landing-density":l,children:[d.jsxs("div",{className:"oc-empty-hero",children:[d.jsx("img",{className:"oc-empty-icon oc-empty-brand",src:"/favicon.svg",alt:"","aria-hidden":"true",draggable:!1}),d.jsxs("div",{className:"oc-empty-copy",children:[d.jsx("h3",{children:o}),d.jsx("p",{children:c})]})]}),d.jsx("div",{className:"oc-suggestions","aria-label":"开场建议",children:jS.map(u=>d.jsxs("button",{type:"button",className:"oc-suggestion",onClick:()=>t.onSuggest(u.prompt),disabled:i,children:[d.jsx("strong",{children:u.label}),d.jsx("span",{children:l==="extra-compact"?u.hint.replace(/[,,].*$/,""):u.hint})]},u.label))}),d.jsxs("ul",{className:"oc-empty-tips",children:[d.jsxs("li",{children:[d.jsx("kbd",{children:"@"}),d.jsx("span",{children:"引用仓库文件"})]}),d.jsxs("li",{children:[d.jsx("kbd",{children:"/"}),d.jsx("span",{children:"快捷命令"})]}),d.jsxs("li",{children:[d.jsx("kbd",{children:"Enter"}),d.jsx("span",{children:"发送 · Shift+Enter 换行"})]})]}),t.mode==="no-session"&&t.onCreateSession?d.jsx("button",{type:"button",className:"btn btn-primary oc-empty-cta",onClick:t.onCreateSession,disabled:i,"aria-busy":t.disabled||void 0,children:r?"需先完成 Pi setup":t.disabled?"创建中…":"新建空白对话"}):null]})}function RS(t){const{artifact:r}=t;return d.jsxs("section",{className:"oc-artifact-card","aria-label":`${r.kind} artifact`,children:[d.jsxs("header",{children:[d.jsx("strong",{children:r.title??r.artifactId}),d.jsx("span",{children:r.kind})]}),r.summary&&d.jsx("p",{children:r.summary}),r.reportText&&d.jsx("pre",{children:r.reportText}),r.htmlPreview&&d.jsx("iframe",{title:`${r.title??r.artifactId} preview`,sandbox:"",srcDoc:r.htmlPreview}),r.inspectHref&&d.jsx("a",{href:r.inspectHref,children:"查看详情"})]})}function TS({card:t,origin:r,sessionId:i}){const[l,o]=k.useState(!1),[c,u]=k.useState(),h=async()=>{o(!0),u(void 0);try{const y=t.gateType==="dag-run"?t.state==="prepared"?"dag-confirm":"dag-run":t.gateType==="mutation"?"mutation-apply":"contract-apply",S=t.gateType==="dag-run"?{confirmationId:t.confirmationId,...t.state==="prepared"?{humanGateToken:t.humanGateToken}:{}}:{receiptId:t.receiptId,humanGateToken:t.humanGateToken},x=await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(i)}/human-gate/${y}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-loop-console-confirmation":Kt()},body:JSON.stringify(S)}),C=await x.json();if(!x.ok)throw new Error(C.error?.message??`HTTP ${x.status}`)}catch(y){u(y instanceof Error?y.message:String(y))}finally{o(!1)}},g=t.state==="prepared"||t.gateType==="dag-run"&&t.state==="confirmed",p=t.gateType==="contract-apply"?"Contract apply":t.gateType==="mutation"?"Mutation":"DAG run",v=t.gateType==="contract-apply"?"Apply":t.gateType==="mutation"?"Execute":t.state==="prepared"?"Confirm":"Run";return d.jsxs("section",{className:`oc-human-gate-card is-${t.state}`,"aria-label":`Human gate ${t.cardId}`,children:[d.jsxs("header",{children:[d.jsxs("div",{children:[d.jsx("small",{children:"HumanGateCard · 仅人类可确认"}),d.jsx("strong",{children:p})]}),d.jsx("span",{children:t.state})]}),t.contractDiffSummary&&d.jsx("p",{children:t.contractDiffSummary}),t.displayOnlyChallenges&&d.jsxs("div",{className:"oc-human-gate-challenges",children:[d.jsx("b",{children:"Challenge(仅展示,不是确认信号)"}),d.jsx("ul",{children:t.displayOnlyChallenges.map(y=>d.jsx("li",{children:y},y))})]}),t.dagSpine&&t.dagSpine.length>0&&d.jsxs("div",{children:[d.jsx("b",{children:"DAG spine"}),d.jsx("ol",{children:t.dagSpine.map(y=>d.jsx("li",{children:d.jsx("code",{children:y})},y))})]}),d.jsxs("footer",{children:[d.jsx("a",{href:t.inspectHref,children:"Inspect"}),d.jsx("button",{className:"btn btn-primary",type:"button",disabled:!g||l,onClick:()=>{h()},children:l?"提交中…":v})]}),c&&d.jsx("div",{className:"oc-human-gate-error",children:c})]})}const wn="loop-console.operator-chat.active-session.v1",ES="loop-console.operator-chat.default-landing.v1";function Os(t){const r=t?.trim().toLowerCase();if(r==="chat")return"chat";if(r==="tasks")return"tasks"}function yy(t){const r=t?.trim().toLowerCase();if(r==="chat"||r==="tasks"||r==="recovery"||r==="night"||r==="models"||r==="settings")return r}function vy(t){const r=i=>t.get(i)?.trim()||void 0;return{...r("taskId")?{taskId:r("taskId")}:{},...r("dagRunId")?{dagRunId:r("dagRunId")}:{},...r("fromNodeId")?{fromNodeId:r("fromNodeId")}:{},...r("featureId")?{featureId:r("featureId")}:{}}}function by(t){const r=String(t??"").replace(/^#/,"");if(!r)return null;const i=r.indexOf("?"),l=i>=0?r.slice(0,i):r,o=i>=0?r.slice(i+1):"",c=(l||"/").split("?")[0]||"/";if(c==="/"||c==="")return null;const u=c.replace(/^\//,"").split("/")[0],h=yy(u);return h?{workspace:h,...vy(new URLSearchParams(o))}:null}function NS(t){const r=new URLSearchParams(t.search),i=t.hash.startsWith("#")?t.hash.slice(1):t.hash,l=new URLSearchParams(i),o=yy(r.get("workspace")??r.get("landing")??l.get("workspace"));return o?{workspace:o,...vy(r)}:null}function AS(t){if(!t)return;const r=by(t.hash);if(r)return r.workspace;const i=new URLSearchParams(t.search),l=Os(i.get("landing")??i.get("workspace"));if(l)return l;const o=t.hash.startsWith("#")?t.hash.slice(1):t.hash;return Os(new URLSearchParams(o).get("workspace"))}function xy(t){return AS(t.location)??Os(t.storage?.getItem(ES))??Os(t.env)??"tasks"}function Sy(t,r={}){const i=new URLSearchParams;for(const[c,u]of Object.entries(r))u?.trim()&&i.set(c,u.trim());const l=i.toString(),o=`/${t}`;return l?`${o}?${l}`:o}function IS(t,r={}){return`#${Sy(t,r)}`}function DS(t){return by(t.hash)??NS(t)}function OS(t){const{operation:r}=t,i=r.inspectHref.startsWith("/")?`${t.origin}${r.inspectHref}`:r.inspectHref,l=r.state==="failed"||r.state==="timed-out"||r.state==="needs-reconcile",o=(u,h)=>{t.onNavigateWorkspace?t.onNavigateWorkspace(u,h):window.location.assign(IS(u,h))},c=[r.taskId?["task",r.taskId]:void 0,r.dagRunId?["dag",r.dagRunId]:void 0,r.featureId?["feature",r.featureId]:void 0,r.workerRunId?["worker",r.workerRunId]:void 0].filter(u=>!!u);return d.jsxs("section",{className:`oc-operation-card is-${r.state}`,"aria-label":`Operation ${r.operationId}`,children:[d.jsxs("header",{className:"oc-operation-head",children:[d.jsxs("div",{children:[d.jsx("div",{className:"oc-operation-kicker",children:"Operation"}),d.jsx("strong",{children:r.action})]}),d.jsx("span",{className:`oc-operation-state is-${r.state}`,children:r.state})]}),d.jsx("div",{className:"oc-operation-id",children:d.jsx("code",{children:r.operationId})}),c.length>0&&d.jsx("div",{className:"oc-operation-identities",children:c.map(([u,h])=>d.jsxs("span",{children:[d.jsx("b",{children:u})," ",h]},`${u}:${h}`))}),r.controller&&d.jsxs("div",{className:"oc-operation-controller",children:["controller: ",r.controller]}),r.summaryPreview&&d.jsx("pre",{className:"oc-operation-preview",children:r.summaryPreview}),r.stderrPreview&&d.jsx("pre",{className:"oc-operation-preview is-error",children:r.stderrPreview}),r.stdoutPreview&&d.jsx("pre",{className:"oc-operation-preview",children:r.stdoutPreview}),d.jsxs("footer",{className:"oc-operation-actions",children:[d.jsx("a",{className:"btn btn-ghost",href:i,target:"_blank",rel:"noreferrer",children:"Inspect"}),r.taskId&&d.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>o("tasks",{taskId:r.taskId}),children:"打开 Task Ops"}),r.dagRunId&&d.jsx("a",{className:"btn btn-ghost",href:`${t.origin}/inspect/#/dag/${encodeURIComponent(r.dagRunId)}`,target:"_blank",rel:"noreferrer",children:"打开 Run / Inspect"}),l&&(r.dagRunId||r.taskId)&&d.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>o("recovery",{taskId:r.taskId,dagRunId:r.dagRunId}),children:"打开 Recovery"}),d.jsx("time",{dateTime:r.updatedAt,children:new Date(r.updatedAt).toLocaleString()})]})]})}function MS(t){const{interview:r,interviewAnswer:i,onAnswerChange:l,onAnswer:o}=t;return d.jsxs("section",{className:"oc-draft-card","aria-label":"Requirement Interview",children:[d.jsxs("header",{children:[d.jsx("strong",{children:"Requirement Interview"}),d.jsx("span",{children:r.state})]}),r.question&&d.jsxs("div",{className:"oc-interview-bubble",children:[d.jsx("strong",{children:r.question.text}),d.jsxs("p",{children:["建议:",r.question.recommendation]}),d.jsx("textarea",{value:i,onChange:c=>l(c.target.value),placeholder:"输入答案"}),d.jsxs("div",{children:[d.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>o("override"),disabled:!i.trim(),children:"提交答案"}),d.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>o("accept-recommendation"),children:"接受建议"})]})]}),r.draft&&d.jsxs("details",{open:!0,children:[d.jsxs("summary",{children:["TaskContractDraftV1 · ",r.draftSha256?.slice(0,12)]}),d.jsx("pre",{children:JSON.stringify(r.draft,null,2)})]}),r.assessment&&d.jsxs("div",{className:`oc-assessment${r.assessment.fresh?" is-fresh":""}`,children:[d.jsxs("strong",{children:["完整性:",r.assessment.outcome]}),(r.assessment.missingFields??[]).length>0&&d.jsxs("p",{children:["缺失:",r.assessment.missingFields?.join("、")]})]}),r.taskKindRecommendation&&d.jsxs("div",{className:"oc-task-kind-card",children:[d.jsx("span",{children:"taskKind 建议"}),d.jsx("strong",{children:r.taskKindRecommendation}),d.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>t.onConfirmTaskKind(),children:"由我确认"}),d.jsx("small",{children:"模型不能代替人类确认。"})]}),r.confirmedTaskKind&&d.jsxs("div",{className:"oc-task-kind-card is-confirmed",children:["已由人类确认:",d.jsx("strong",{children:r.confirmedTaskKind})]})]})}function zS(t,r){const i={};return(t[t.length-1]===""?[...t,""]:t).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const _S=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BS={};function Xp(t,r){return(BS.jsx?LS:_S).test(t)}const HS=/[ \t\n\f\r]/g;function US(t){return typeof t=="object"?t.type==="text"?Qp(t.value):!1:Qp(t)}function Qp(t){return t.replace(HS,"")===""}class al{constructor(r,i,l){this.normal=i,this.property=r,l&&(this.space=l)}}al.prototype.normal={};al.prototype.property={};al.prototype.space=void 0;function ky(t,r){const i={},l={};for(const o of t)Object.assign(i,o.property),Object.assign(l,o.normal);return new al(i,l,r)}function Fc(t){return t.toLowerCase()}class Xt{constructor(r,i){this.attribute=i,this.property=r}}Xt.prototype.attribute="";Xt.prototype.booleanish=!1;Xt.prototype.boolean=!1;Xt.prototype.commaOrSpaceSeparated=!1;Xt.prototype.commaSeparated=!1;Xt.prototype.defined=!1;Xt.prototype.mustUseProperty=!1;Xt.prototype.number=!1;Xt.prototype.overloadedBoolean=!1;Xt.prototype.property="";Xt.prototype.spaceSeparated=!1;Xt.prototype.space=void 0;let qS=0;const je=ri(),xt=ri(),Vc=ri(),he=ri(),nt=ri(),ti=ri(),an=ri();function ri(){return 2**++qS}const Yc=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:xt,commaOrSpaceSeparated:an,commaSeparated:ti,number:he,overloadedBoolean:Vc,spaceSeparated:nt},Symbol.toStringTag,{value:"Module"})),kc=Object.keys(Yc);class cd extends Xt{constructor(r,i,l,o){let c=-1;if(super(r,i),Zp(this,"space",o),typeof l=="number")for(;++c<kc.length;){const u=kc[c];Zp(this,kc[c],(l&Yc[u])===Yc[u])}}}cd.prototype.defined=!0;function Zp(t,r,i){i&&(t[r]=i)}function Zi(t){const r={},i={};for(const[l,o]of Object.entries(t.properties)){const c=new cd(l,t.transform(t.attributes||{},l),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(l)&&(c.mustUseProperty=!0),r[l]=c,i[Fc(l)]=l,i[Fc(c.attribute)]=l}return new al(r,i,t.space)}const wy=Zi({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:nt,ariaCurrent:null,ariaDescribedBy:nt,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:nt,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:nt,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nt,ariaLevel:he,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:nt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:nt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:xt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(t,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function Cy(t,r){return r in t?t[r]:r}function jy(t,r){return Cy(t,r.toLowerCase())}const GS=Zi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ti,acceptCharset:nt,accessKey:nt,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alpha:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:nt,autoFocus:je,autoPlay:je,blocking:nt,capture:null,charSet:null,checked:je,cite:null,className:nt,closedBy:null,colorSpace:null,cols:he,colSpan:he,command:null,commandFor:null,content:null,contentEditable:xt,controls:je,controlsList:nt,coords:he|ti,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:Vc,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:nt,height:he,hidden:Vc,high:he,href:null,hrefLang:null,htmlFor:nt,httpEquiv:nt,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:nt,itemRef:nt,itemScope:je,itemType:nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:je,optimum:he,pattern:null,ping:nt,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:nt,required:je,reversed:je,rows:he,rowSpan:he,sandbox:nt,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootCustomElementRegistry:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shadowRootSerializable:je,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:xt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:xt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:je,disablePictureInPicture:je,disableRemotePlayback:je,exportParts:ti,part:nt,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:jy}),$S=Zi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:an,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:nt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ti,g2:ti,glyphName:ti,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:an,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:an,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:an,rev:an,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:an,requiredFeatures:an,requiredFonts:an,requiredFormats:an,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:an,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:an,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:an,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Cy}),Ry=Zi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,r){return"xlink:"+r.slice(5).toLowerCase()}}),Ty=Zi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jy}),Ey=Zi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,r){return"xml:"+r.slice(3).toLowerCase()}}),FS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},VS=/[A-Z]/g,Jp=/-[a-z]/g,YS=/^data[-\w.:]+$/i;function PS(t,r){const i=Fc(r);let l=r,o=Xt;if(i in t.normal)return t.property[t.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&YS.test(r)){if(r.charAt(4)==="-"){const c=r.slice(5).replace(Jp,XS);l="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=r.slice(4);if(!Jp.test(c)){let u=c.replace(VS,KS);u.charAt(0)!=="-"&&(u="-"+u),r="data"+u}}o=cd}return new o(l,r)}function KS(t){return"-"+t.toLowerCase()}function XS(t){return t.charAt(1).toUpperCase()}const QS=ky([wy,GS,Ry,Ty,Ey],"html"),dd=ky([wy,$S,Ry,Ty,Ey],"svg");function ZS(t){return t.join(" ").trim()}var Gi={},wc,Wp;function JS(){if(Wp)return wc;Wp=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,h=/^\s+|\s+$/g,g=`
|
|
12
|
-
`,p="/",v="*",y="",S="comment",x="declaration";function C(H,O){if(typeof H!="string")throw new TypeError("First argument must be a string");if(!H)return[];O=O||{};var I=1,A=1;function F(P){var B=P.match(r);B&&(I+=B.length);var D=P.lastIndexOf(g);A=~D?P.length-D:A+P.length}function W(){var P={line:I,column:A};return function(B){return B.position=new w(P),se(),B}}function w(P){this.start=P,this.end={line:I,column:A},this.source=O.source}w.prototype.content=H;function q(P){var B=new Error(O.source+":"+I+":"+A+": "+P);if(B.reason=P,B.filename=O.source,B.line=I,B.column=A,B.source=H,!O.silent)throw B}function Q(P){var B=P.exec(H);if(B){var D=B[0];return F(D),H=H.slice(D.length),B}}function se(){Q(i)}function z(P){var B;for(P=P||[];B=Y();)B!==!1&&P.push(B);return P}function Y(){var P=W();if(!(p!=H.charAt(0)||v!=H.charAt(1))){for(var B=2;y!=H.charAt(B)&&(v!=H.charAt(B)||p!=H.charAt(B+1));)++B;if(B+=2,y===H.charAt(B-1))return q("End of comment missing");var D=H.slice(2,B-2);return A+=2,F(D),H=H.slice(B),A+=2,P({type:S,comment:D})}}function ne(){var P=W(),B=Q(l);if(B){if(Y(),!Q(o))return q("property missing ':'");var D=Q(c),U=P({type:x,property:N(B[0].replace(t,y)),value:D?N(D[0].replace(t,y)):y});return Q(u),U}}function ue(){var P=[];z(P);for(var B;B=ne();)B!==!1&&(P.push(B),z(P));return P}return se(),ue()}function N(H){return H?H.replace(h,y):y}return wc=C,wc}var eg;function WS(){if(eg)return Gi;eg=1;var t=Gi&&Gi.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=i;const r=t(JS());function i(l,o){let c=null;if(!l||typeof l!="string")return c;const u=(0,r.default)(l),h=typeof o=="function";return u.forEach(g=>{if(g.type!=="declaration")return;const{property:p,value:v}=g;h?o(p,v,g):v&&(c=c||{},c[p]=v)}),c}return Gi}var Pa={},tg;function e0(){if(tg)return Pa;tg=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,i=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,c=function(p){return!p||i.test(p)||t.test(p)},u=function(p,v){return v.toUpperCase()},h=function(p,v){return"".concat(v,"-")},g=function(p,v){return v===void 0&&(v={}),c(p)?p:(p=p.toLowerCase(),v.reactCompat?p=p.replace(o,h):p=p.replace(l,h),p.replace(r,u))};return Pa.camelCase=g,Pa}var Ka,ng;function t0(){if(ng)return Ka;ng=1;var t=Ka&&Ka.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},r=t(WS()),i=e0();function l(o,c){var u={};return!o||typeof o!="string"||(0,r.default)(o,function(h,g){h&&g&&(u[(0,i.camelCase)(h,c)]=g)}),u}return l.default=l,Ka=l,Ka}var n0=t0();const r0=ad(n0),Ny=Ay("end"),fd=Ay("start");function Ay(t){return r;function r(i){const l=i&&i.position&&i.position[t]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function i0(t){const r=fd(t),i=Ny(t);if(r&&i)return{start:r,end:i}}function el(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?rg(t.position):"start"in t||"end"in t?rg(t):"line"in t||"column"in t?Pc(t):""}function Pc(t){return ig(t&&t.line)+":"+ig(t&&t.column)}function rg(t){return Pc(t&&t.start)+"-"+Pc(t&&t.end)}function ig(t){return t&&typeof t=="number"?t:1}class zt extends Error{constructor(r,i,l){super(),typeof i=="string"&&(l=i,i=void 0);let o="",c={},u=!1;if(i&&("line"in i&&"column"in i?c={place:i}:"start"in i&&"end"in i?c={place:i}:"type"in i?c={ancestors:[i],place:i.position}:c={...i}),typeof r=="string"?o=r:!c.cause&&r&&(u=!0,o=r.message,c.cause=r),!c.ruleId&&!c.source&&typeof l=="string"){const g=l.indexOf(":");g===-1?c.ruleId=l:(c.source=l.slice(0,g),c.ruleId=l.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const h=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=h?h.line:void 0,this.name=el(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=u&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zt.prototype.file="";zt.prototype.name="";zt.prototype.reason="";zt.prototype.message="";zt.prototype.stack="";zt.prototype.column=void 0;zt.prototype.line=void 0;zt.prototype.ancestors=void 0;zt.prototype.cause=void 0;zt.prototype.fatal=void 0;zt.prototype.place=void 0;zt.prototype.ruleId=void 0;zt.prototype.source=void 0;const hd={}.hasOwnProperty,a0=new Map,l0=/[A-Z]/g,s0=new Set(["table","tbody","thead","tfoot","tr"]),o0=new Set(["td","th"]),Iy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function u0(t,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=y0(i,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=g0(i,r.jsx,r.jsxs)}const o={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?dd:QS,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},c=Dy(o,t,void 0);return c&&typeof c!="string"?c:o.create(t,o.Fragment,{children:c||void 0},void 0)}function Dy(t,r,i){if(r.type==="element")return c0(t,r,i);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return d0(t,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return h0(t,r,i);if(r.type==="mdxjsEsm")return f0(t,r);if(r.type==="root")return m0(t,r,i);if(r.type==="text")return p0(t,r)}function c0(t,r,i){const l=t.schema;let o=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=dd,t.schema=o),t.ancestors.push(r);const c=My(t,r.tagName,!1),u=v0(t,r);let h=pd(t,r);return s0.has(r.tagName)&&(h=h.filter(function(g){return typeof g=="string"?!US(g):!0})),Oy(t,u,c,r),md(u,h),t.ancestors.pop(),t.schema=l,t.create(r,c,u,i)}function d0(t,r){if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];return l.type,t.evaluater.evaluateExpression(l.expression)}rl(t,r.position)}function f0(t,r){if(r.data&&r.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(r.data.estree);rl(t,r.position)}function h0(t,r,i){const l=t.schema;let o=l;r.name==="svg"&&l.space==="html"&&(o=dd,t.schema=o),t.ancestors.push(r);const c=r.name===null?t.Fragment:My(t,r.name,!0),u=b0(t,r),h=pd(t,r);return Oy(t,u,c,r),md(u,h),t.ancestors.pop(),t.schema=l,t.create(r,c,u,i)}function m0(t,r,i){const l={};return md(l,pd(t,r)),t.create(r,t.Fragment,l,i)}function p0(t,r){return r.value}function Oy(t,r,i,l){typeof i!="string"&&i!==t.Fragment&&t.passNode&&(r.node=l)}function md(t,r){if(r.length>0){const i=r.length>1?r:r[0];i&&(t.children=i)}}function g0(t,r,i){return l;function l(o,c,u,h){const p=Array.isArray(u.children)?i:r;return h?p(c,u,h):p(c,u)}}function y0(t,r){return i;function i(l,o,c,u){const h=Array.isArray(c.children),g=fd(l);return r(o,c,u,h,{columnNumber:g?g.column-1:void 0,fileName:t,lineNumber:g?g.line:void 0},void 0)}}function v0(t,r){const i={};let l,o;for(o in r.properties)if(o!=="children"&&hd.call(r.properties,o)){const c=x0(t,o,r.properties[o]);if(c){const[u,h]=c;t.tableCellAlignToStyle&&u==="align"&&typeof h=="string"&&o0.has(r.tagName)?l=h:i[u]=h}}if(l){const c=i.style||(i.style={});c[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return i}function b0(t,r){const i={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&t.evaluater){const c=l.data.estree.body[0];c.type;const u=c.expression;u.type;const h=u.properties[0];h.type,Object.assign(i,t.evaluater.evaluateExpression(h.argument))}else rl(t,r.position);else{const o=l.name;let c;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&t.evaluater){const h=l.value.data.estree.body[0];h.type,c=t.evaluater.evaluateExpression(h.expression)}else rl(t,r.position);else c=l.value===null?!0:l.value;i[o]=c}return i}function pd(t,r){const i=[];let l=-1;const o=t.passKeys?new Map:a0;for(;++l<r.children.length;){const c=r.children[l];let u;if(t.passKeys){const g=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(g){const p=o.get(g)||0;u=g+"-"+p,o.set(g,p+1)}}const h=Dy(t,c,u);h!==void 0&&i.push(h)}return i}function x0(t,r,i){const l=PS(t.schema,r);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=l.commaSeparated?zS(i):ZS(i)),l.property==="style"){let o=typeof i=="object"?i:S0(t,String(i));return t.stylePropertyNameCase==="css"&&(o=k0(o)),["style",o]}return[t.elementAttributeNameCase==="react"&&l.space?FS[l.property]||l.property:l.attribute,i]}}function S0(t,r){try{return r0(r,{reactCompat:!0})}catch(i){if(t.ignoreInvalidStyle)return{};const l=i,o=new zt("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=t.filePath||void 0,o.url=Iy+"#cannot-parse-style-attribute",o}}function My(t,r,i){let l;if(!i)l={type:"Literal",value:r};else if(r.includes(".")){const o=r.split(".");let c=-1,u;for(;++c<o.length;){const h=Xp(o[c])?{type:"Identifier",name:o[c]}:{type:"Literal",value:o[c]};u=u?{type:"MemberExpression",object:u,property:h,computed:!!(c&&h.type==="Literal"),optional:!1}:h}l=u}else l=Xp(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const o=l.value;return hd.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(l);rl(t)}function rl(t,r){const i=new zt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Iy+"#cannot-handle-mdx-estrees-without-createevaluater",i}function k0(t){const r={};let i;for(i in t)hd.call(t,i)&&(r[w0(i)]=t[i]);return r}function w0(t){let r=t.replace(l0,C0);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function C0(t){return"-"+t.toLowerCase()}const Cc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},j0={};function gd(t,r){const i=j0,l=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,o=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return zy(t,l,o)}function zy(t,r,i){if(R0(t)){if("value"in t)return t.type==="html"&&!i?"":t.value;if(r&&"alt"in t&&t.alt)return t.alt;if("children"in t)return ag(t.children,r,i)}return Array.isArray(t)?ag(t,r,i):""}function ag(t,r,i){const l=[];let o=-1;for(;++o<t.length;)l[o]=zy(t[o],r,i);return l.join("")}function R0(t){return!!(t&&typeof t=="object")}const lg=document.createElement("i");function yd(t){const r="&"+t+";";lg.innerHTML=r;const i=lg.textContent;return i.charCodeAt(i.length-1)===59&&t!=="semi"||i===r?!1:i}function ln(t,r,i,l){const o=t.length;let c=0,u;if(r<0?r=-r>o?0:o+r:r=r>o?o:r,i=i>0?i:0,l.length<1e4)u=Array.from(l),u.unshift(r,i),t.splice(...u);else for(i&&t.splice(r,i);c<l.length;)u=l.slice(c,c+1e4),u.unshift(r,0),t.splice(...u),c+=1e4,r+=1e4}function bn(t,r){return t.length>0?(ln(t,t.length,0,r),t):r}const sg={}.hasOwnProperty;function _y(t){const r={};let i=-1;for(;++i<t.length;)T0(r,t[i]);return r}function T0(t,r){let i;for(i in r){const o=(sg.call(t,i)?t[i]:void 0)||(t[i]={}),c=r[i];let u;if(c)for(u in c){sg.call(o,u)||(o[u]=[]);const h=c[u];E0(o[u],Array.isArray(h)?h:h?[h]:[])}}}function E0(t,r){let i=-1;const l=[];for(;++i<r.length;)(r[i].add==="after"?t:l).push(r[i]);ln(t,0,0,l)}function Ly(t,r){const i=Number.parseInt(t,r);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Cn(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Lt=Nr(/[A-Za-z]/),Mt=Nr(/[\dA-Za-z]/),N0=Nr(/[#-'*+\--9=?A-Z^-~]/);function Ms(t){return t!==null&&(t<32||t===127)}const Kc=Nr(/\d/),A0=Nr(/[\dA-Fa-f]/),I0=Nr(/[!-/:-@[-`{-~]/);function Se(t){return t!==null&&t<-2}function rt(t){return t!==null&&(t<0||t===32)}function _e(t){return t===-2||t===-1||t===32}const Ps=Nr(new RegExp("\\p{P}|\\p{S}","u")),ni=Nr(/\s/);function Nr(t){return r;function r(i){return i!==null&&i>-1&&t.test(String.fromCharCode(i))}}function Ji(t){const r=[];let i=-1,l=0,o=0;for(;++i<t.length;){const c=t.charCodeAt(i);let u="";if(c===37&&Mt(t.charCodeAt(i+1))&&Mt(t.charCodeAt(i+2)))o=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(u=String.fromCharCode(c));else if(c>55295&&c<57344){const h=t.charCodeAt(i+1);c<56320&&h>56319&&h<57344?(u=String.fromCharCode(c,h),o=1):u="�"}else u=String.fromCharCode(c);u&&(r.push(t.slice(l,i),encodeURIComponent(u)),l=i+o+1,u=""),o&&(i+=o,o=0)}return r.join("")+t.slice(l)}function Ue(t,r,i,l){const o=l?l-1:Number.POSITIVE_INFINITY;let c=0;return u;function u(g){return _e(g)?(t.enter(i),h(g)):r(g)}function h(g){return _e(g)&&c++<o?(t.consume(g),h):(t.exit(i),r(g))}}const D0={tokenize:O0};function O0(t){const r=t.attempt(this.parser.constructs.contentInitial,l,o);let i;return r;function l(h){if(h===null){t.consume(h);return}return t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),Ue(t,r,"linePrefix")}function o(h){return t.enter("paragraph"),c(h)}function c(h){const g=t.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=g),i=g,u(h)}function u(h){if(h===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(h);return}return Se(h)?(t.consume(h),t.exit("chunkText"),c):(t.consume(h),u)}}const M0={tokenize:z0},og={tokenize:_0};function z0(t){const r=this,i=[];let l=0,o,c,u;return h;function h(A){if(l<i.length){const F=i[l];return r.containerState=F[1],t.attempt(F[0].continuation,g,p)(A)}return p(A)}function g(A){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,o&&I();const F=r.events.length;let W=F,w;for(;W--;)if(r.events[W][0]==="exit"&&r.events[W][1].type==="chunkFlow"){w=r.events[W][1].end;break}O(l);let q=F;for(;q<r.events.length;)r.events[q][1].end={...w},q++;return ln(r.events,W+1,0,r.events.slice(F)),r.events.length=q,p(A)}return h(A)}function p(A){if(l===i.length){if(!o)return S(A);if(o.currentConstruct&&o.currentConstruct.concrete)return C(A);r.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return r.containerState={},t.check(og,v,y)(A)}function v(A){return o&&I(),O(l),S(A)}function y(A){return r.parser.lazy[r.now().line]=l!==i.length,u=r.now().offset,C(A)}function S(A){return r.containerState={},t.attempt(og,x,C)(A)}function x(A){return l++,i.push([r.currentConstruct,r.containerState]),S(A)}function C(A){if(A===null){o&&I(),O(0),t.consume(A);return}return o=o||r.parser.flow(r.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:c}),N(A)}function N(A){if(A===null){H(t.exit("chunkFlow"),!0),O(0),t.consume(A);return}return Se(A)?(t.consume(A),H(t.exit("chunkFlow")),l=0,r.interrupt=void 0,h):(t.consume(A),N)}function H(A,F){const W=r.sliceStream(A);if(F&&W.push(null),A.previous=c,c&&(c.next=A),c=A,o.defineSkip(A.start),o.write(W),r.parser.lazy[A.start.line]){let w=o.events.length;for(;w--;)if(o.events[w][1].start.offset<u&&(!o.events[w][1].end||o.events[w][1].end.offset>u))return;const q=r.events.length;let Q=q,se,z;for(;Q--;)if(r.events[Q][0]==="exit"&&r.events[Q][1].type==="chunkFlow"){if(se){z=r.events[Q][1].end;break}se=!0}for(O(l),w=q;w<r.events.length;)r.events[w][1].end={...z},w++;ln(r.events,Q+1,0,r.events.slice(q)),r.events.length=w}}function O(A){let F=i.length;for(;F-- >A;){const W=i[F];r.containerState=W[1],W[0].exit.call(r,t)}i.length=A}function I(){o.write([null]),c=void 0,o=void 0,r.containerState._closeFlow=void 0}}function _0(t,r,i){return Ue(t,t.attempt(this.parser.constructs.document,r,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xi(t){if(t===null||rt(t)||ni(t))return 1;if(Ps(t))return 2}function Ks(t,r,i){const l=[];let o=-1;for(;++o<t.length;){const c=t[o].resolveAll;c&&!l.includes(c)&&(r=c(r,i),l.push(c))}return r}const Xc={name:"attention",resolveAll:L0,tokenize:B0};function L0(t,r){let i=-1,l,o,c,u,h,g,p,v;for(;++i<t.length;)if(t[i][0]==="enter"&&t[i][1].type==="attentionSequence"&&t[i][1]._close){for(l=i;l--;)if(t[l][0]==="exit"&&t[l][1].type==="attentionSequence"&&t[l][1]._open&&r.sliceSerialize(t[l][1]).charCodeAt(0)===r.sliceSerialize(t[i][1]).charCodeAt(0)){if((t[l][1]._close||t[i][1]._open)&&(t[i][1].end.offset-t[i][1].start.offset)%3&&!((t[l][1].end.offset-t[l][1].start.offset+t[i][1].end.offset-t[i][1].start.offset)%3))continue;g=t[l][1].end.offset-t[l][1].start.offset>1&&t[i][1].end.offset-t[i][1].start.offset>1?2:1;const y={...t[l][1].end},S={...t[i][1].start};ug(y,-g),ug(S,g),u={type:g>1?"strongSequence":"emphasisSequence",start:y,end:{...t[l][1].end}},h={type:g>1?"strongSequence":"emphasisSequence",start:{...t[i][1].start},end:S},c={type:g>1?"strongText":"emphasisText",start:{...t[l][1].end},end:{...t[i][1].start}},o={type:g>1?"strong":"emphasis",start:{...u.start},end:{...h.end}},t[l][1].end={...u.start},t[i][1].start={...h.end},p=[],t[l][1].end.offset-t[l][1].start.offset&&(p=bn(p,[["enter",t[l][1],r],["exit",t[l][1],r]])),p=bn(p,[["enter",o,r],["enter",u,r],["exit",u,r],["enter",c,r]]),p=bn(p,Ks(r.parser.constructs.insideSpan.null,t.slice(l+1,i),r)),p=bn(p,[["exit",c,r],["enter",h,r],["exit",h,r],["exit",o,r]]),t[i][1].end.offset-t[i][1].start.offset?(v=2,p=bn(p,[["enter",t[i][1],r],["exit",t[i][1],r]])):v=0,ln(t,l-1,i-l+3,p),i=l+p.length-v-2;break}}for(i=-1;++i<t.length;)t[i][1].type==="attentionSequence"&&(t[i][1].type="data");return t}function B0(t,r){const i=this.parser.constructs.attentionMarkers.null,l=this.previous,o=Xi(l);let c;return u;function u(g){return c=g,t.enter("attentionSequence"),h(g)}function h(g){if(g===c)return t.consume(g),h;const p=t.exit("attentionSequence"),v=Xi(g),y=!v||v===2&&o||i.includes(g),S=!o||o===2&&v||i.includes(l);return p._open=!!(c===42?y:y&&(o||!S)),p._close=!!(c===42?S:S&&(v||!y)),r(g)}}function ug(t,r){t.column+=r,t.offset+=r,t._bufferIndex+=r}const H0={name:"autolink",tokenize:U0};function U0(t,r,i){let l=0;return o;function o(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),c}function c(x){return Lt(x)?(t.consume(x),u):x===64?i(x):p(x)}function u(x){return x===43||x===45||x===46||Mt(x)?(l=1,h(x)):p(x)}function h(x){return x===58?(t.consume(x),l=0,g):(x===43||x===45||x===46||Mt(x))&&l++<32?(t.consume(x),h):(l=0,p(x))}function g(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),r):x===null||x===32||x===60||Ms(x)?i(x):(t.consume(x),g)}function p(x){return x===64?(t.consume(x),v):N0(x)?(t.consume(x),p):i(x)}function v(x){return Mt(x)?y(x):i(x)}function y(x){return x===46?(t.consume(x),l=0,v):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),r):S(x)}function S(x){if((x===45||Mt(x))&&l++<63){const C=x===45?S:y;return t.consume(x),C}return i(x)}}const ll={partial:!0,tokenize:q0};function q0(t,r,i){return l;function l(c){return _e(c)?Ue(t,o,"linePrefix")(c):o(c)}function o(c){return c===null||Se(c)?r(c):i(c)}}const By={continuation:{tokenize:$0},exit:F0,name:"blockQuote",tokenize:G0};function G0(t,r,i){const l=this;return o;function o(u){if(u===62){const h=l.containerState;return h.open||(t.enter("blockQuote",{_container:!0}),h.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(u),t.exit("blockQuoteMarker"),c}return i(u)}function c(u){return _e(u)?(t.enter("blockQuotePrefixWhitespace"),t.consume(u),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),r):(t.exit("blockQuotePrefix"),r(u))}}function $0(t,r,i){const l=this;return o;function o(u){return _e(u)?Ue(t,c,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):c(u)}function c(u){return t.attempt(By,r,i)(u)}}function F0(t){t.exit("blockQuote")}const Hy={name:"characterEscape",tokenize:V0};function V0(t,r,i){return l;function l(c){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(c),t.exit("escapeMarker"),o}function o(c){return I0(c)?(t.enter("characterEscapeValue"),t.consume(c),t.exit("characterEscapeValue"),t.exit("characterEscape"),r):i(c)}}const Uy={name:"characterReference",tokenize:Y0};function Y0(t,r,i){const l=this;let o=0,c,u;return h;function h(y){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(y),t.exit("characterReferenceMarker"),g}function g(y){return y===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(y),t.exit("characterReferenceMarkerNumeric"),p):(t.enter("characterReferenceValue"),c=31,u=Mt,v(y))}function p(y){return y===88||y===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(y),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),c=6,u=A0,v):(t.enter("characterReferenceValue"),c=7,u=Kc,v(y))}function v(y){if(y===59&&o){const S=t.exit("characterReferenceValue");return u===Mt&&!yd(l.sliceSerialize(S))?i(y):(t.enter("characterReferenceMarker"),t.consume(y),t.exit("characterReferenceMarker"),t.exit("characterReference"),r)}return u(y)&&o++<c?(t.consume(y),v):i(y)}}const cg={partial:!0,tokenize:K0},dg={concrete:!0,name:"codeFenced",tokenize:P0};function P0(t,r,i){const l=this,o={partial:!0,tokenize:W};let c=0,u=0,h;return g;function g(w){return p(w)}function p(w){const q=l.events[l.events.length-1];return c=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,h=w,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),v(w)}function v(w){return w===h?(u++,t.consume(w),v):u<3?i(w):(t.exit("codeFencedFenceSequence"),_e(w)?Ue(t,y,"whitespace")(w):y(w))}function y(w){return w===null||Se(w)?(t.exit("codeFencedFence"),l.interrupt?r(w):t.check(cg,N,F)(w)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),S(w))}function S(w){return w===null||Se(w)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),y(w)):_e(w)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ue(t,x,"whitespace")(w)):w===96&&w===h?i(w):(t.consume(w),S)}function x(w){return w===null||Se(w)?y(w):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),C(w))}function C(w){return w===null||Se(w)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),y(w)):w===96&&w===h?i(w):(t.consume(w),C)}function N(w){return t.attempt(o,F,H)(w)}function H(w){return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),O}function O(w){return c>0&&_e(w)?Ue(t,I,"linePrefix",c+1)(w):I(w)}function I(w){return w===null||Se(w)?t.check(cg,N,F)(w):(t.enter("codeFlowValue"),A(w))}function A(w){return w===null||Se(w)?(t.exit("codeFlowValue"),I(w)):(t.consume(w),A)}function F(w){return t.exit("codeFenced"),r(w)}function W(w,q,Q){let se=0;return z;function z(B){return w.enter("lineEnding"),w.consume(B),w.exit("lineEnding"),Y}function Y(B){return w.enter("codeFencedFence"),_e(B)?Ue(w,ne,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):ne(B)}function ne(B){return B===h?(w.enter("codeFencedFenceSequence"),ue(B)):Q(B)}function ue(B){return B===h?(se++,w.consume(B),ue):se>=u?(w.exit("codeFencedFenceSequence"),_e(B)?Ue(w,P,"whitespace")(B):P(B)):Q(B)}function P(B){return B===null||Se(B)?(w.exit("codeFencedFence"),q(B)):Q(B)}}}function K0(t,r,i){const l=this;return o;function o(u){return u===null?i(u):(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),c)}function c(u){return l.parser.lazy[l.now().line]?i(u):r(u)}}const jc={name:"codeIndented",tokenize:Q0},X0={partial:!0,tokenize:Z0};function Q0(t,r,i){const l=this;return o;function o(p){return t.enter("codeIndented"),Ue(t,c,"linePrefix",5)(p)}function c(p){const v=l.events[l.events.length-1];return v&&v[1].type==="linePrefix"&&v[2].sliceSerialize(v[1],!0).length>=4?u(p):i(p)}function u(p){return p===null?g(p):Se(p)?t.attempt(X0,u,g)(p):(t.enter("codeFlowValue"),h(p))}function h(p){return p===null||Se(p)?(t.exit("codeFlowValue"),u(p)):(t.consume(p),h)}function g(p){return t.exit("codeIndented"),r(p)}}function Z0(t,r,i){const l=this;return o;function o(u){return l.parser.lazy[l.now().line]?i(u):Se(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),o):Ue(t,c,"linePrefix",5)(u)}function c(u){const h=l.events[l.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?r(u):Se(u)?o(u):i(u)}}const J0={name:"codeText",previous:ek,resolve:W0,tokenize:tk};function W0(t){let r=t.length-4,i=3,l,o;if((t[i][1].type==="lineEnding"||t[i][1].type==="space")&&(t[r][1].type==="lineEnding"||t[r][1].type==="space")){for(l=i;++l<r;)if(t[l][1].type==="codeTextData"){t[i][1].type="codeTextPadding",t[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(l=i-1,r++;++l<=r;)o===void 0?l!==r&&t[l][1].type!=="lineEnding"&&(o=l):(l===r||t[l][1].type==="lineEnding")&&(t[o][1].type="codeTextData",l!==o+2&&(t[o][1].end=t[l-1][1].end,t.splice(o+2,l-o-2),r-=l-o-2,l=o+2),o=void 0);return t}function ek(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tk(t,r,i){let l=0,o,c;return u;function u(y){return t.enter("codeText"),t.enter("codeTextSequence"),h(y)}function h(y){return y===96?(t.consume(y),l++,h):(t.exit("codeTextSequence"),g(y))}function g(y){return y===null?i(y):y===32?(t.enter("space"),t.consume(y),t.exit("space"),g):y===96?(c=t.enter("codeTextSequence"),o=0,v(y)):Se(y)?(t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),g):(t.enter("codeTextData"),p(y))}function p(y){return y===null||y===32||y===96||Se(y)?(t.exit("codeTextData"),g(y)):(t.consume(y),p)}function v(y){return y===96?(t.consume(y),o++,v):o===l?(t.exit("codeTextSequence"),t.exit("codeText"),r(y)):(c.type="codeTextData",p(y))}}class nk{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,i){const l=i??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,i,l){const o=i||0;this.setCursor(Math.trunc(r));const c=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&Xa(this.left,l),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Xa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Xa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const i=this.left.splice(r,Number.POSITIVE_INFINITY);Xa(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Xa(this.left,i.reverse())}}}function Xa(t,r){let i=0;if(r.length<1e4)t.push(...r);else for(;i<r.length;)t.push(...r.slice(i,i+1e4)),i+=1e4}function qy(t){const r={};let i=-1,l,o,c,u,h,g,p;const v=new nk(t);for(;++i<v.length;){for(;i in r;)i=r[i];if(l=v.get(i),i&&l[1].type==="chunkFlow"&&v.get(i-1)[1].type==="listItemPrefix"&&(g=l[1]._tokenizer.events,c=0,c<g.length&&g[c][1].type==="lineEndingBlank"&&(c+=2),c<g.length&&g[c][1].type==="content"))for(;++c<g.length&&g[c][1].type!=="content";)g[c][1].type==="chunkText"&&(g[c][1]._isInFirstContentOfListItem=!0,c++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,rk(v,i)),i=r[i],p=!0);else if(l[1]._container){for(c=i,o=void 0;c--;)if(u=v.get(c),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(v.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=c);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(l[1].end={...v.get(o)[1].start},h=v.slice(o,i),h.unshift(l),v.splice(o,i-o+1,h))}}return ln(t,0,Number.POSITIVE_INFINITY,v.slice(0)),!p}function rk(t,r){const i=t.get(r)[1],l=t.get(r)[2];let o=r-1;const c=[];let u=i._tokenizer;u||(u=l.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const h=u.events,g=[],p={};let v,y,S=-1,x=i,C=0,N=0;const H=[N];for(;x;){for(;t.get(++o)[1]!==x;);c.push(o),x._tokenizer||(v=l.sliceStream(x),x.next||v.push(null),y&&u.defineSkip(x.start),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(v),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),y=x,x=x.next}for(x=i;++S<h.length;)h[S][0]==="exit"&&h[S-1][0]==="enter"&&h[S][1].type===h[S-1][1].type&&h[S][1].start.line!==h[S][1].end.line&&(N=S+1,H.push(N),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(u.events=[],x?(x._tokenizer=void 0,x.previous=void 0):H.pop(),S=H.length;S--;){const O=h.slice(H[S],H[S+1]),I=c.pop();g.push([I,I+O.length-1]),t.splice(I,2,O)}for(g.reverse(),S=-1;++S<g.length;)p[C+g[S][0]]=C+g[S][1],C+=g[S][1]-g[S][0]-1;return p}const ik={resolve:lk,tokenize:sk},ak={partial:!0,tokenize:ok};function lk(t){return qy(t),t}function sk(t,r){let i;return l;function l(h){return t.enter("content"),i=t.enter("chunkContent",{contentType:"content"}),o(h)}function o(h){return h===null?c(h):Se(h)?t.check(ak,u,c)(h):(t.consume(h),o)}function c(h){return t.exit("chunkContent"),t.exit("content"),r(h)}function u(h){return t.consume(h),t.exit("chunkContent"),i.next=t.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,o}}function ok(t,r,i){const l=this;return o;function o(u){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),Ue(t,c,"linePrefix")}function c(u){if(u===null||Se(u))return i(u);const h=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?r(u):t.interrupt(l.parser.constructs.flow,i,r)(u)}}function Gy(t,r,i,l,o,c,u,h,g){const p=g||Number.POSITIVE_INFINITY;let v=0;return y;function y(O){return O===60?(t.enter(l),t.enter(o),t.enter(c),t.consume(O),t.exit(c),S):O===null||O===32||O===41||Ms(O)?i(O):(t.enter(l),t.enter(u),t.enter(h),t.enter("chunkString",{contentType:"string"}),N(O))}function S(O){return O===62?(t.enter(c),t.consume(O),t.exit(c),t.exit(o),t.exit(l),r):(t.enter(h),t.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===62?(t.exit("chunkString"),t.exit(h),S(O)):O===null||O===60||Se(O)?i(O):(t.consume(O),O===92?C:x)}function C(O){return O===60||O===62||O===92?(t.consume(O),x):x(O)}function N(O){return!v&&(O===null||O===41||rt(O))?(t.exit("chunkString"),t.exit(h),t.exit(u),t.exit(l),r(O)):v<p&&O===40?(t.consume(O),v++,N):O===41?(t.consume(O),v--,N):O===null||O===32||O===40||Ms(O)?i(O):(t.consume(O),O===92?H:N)}function H(O){return O===40||O===41||O===92?(t.consume(O),N):N(O)}}function $y(t,r,i,l,o,c){const u=this;let h=0,g;return p;function p(x){return t.enter(l),t.enter(o),t.consume(x),t.exit(o),t.enter(c),v}function v(x){return h>999||x===null||x===91||x===93&&!g||x===94&&!h&&"_hiddenFootnoteSupport"in u.parser.constructs?i(x):x===93?(t.exit(c),t.enter(o),t.consume(x),t.exit(o),t.exit(l),r):Se(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),v):(t.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||Se(x)||h++>999?(t.exit("chunkString"),v(x)):(t.consume(x),g||(g=!_e(x)),x===92?S:y)}function S(x){return x===91||x===92||x===93?(t.consume(x),h++,y):y(x)}}function Fy(t,r,i,l,o,c){let u;return h;function h(S){return S===34||S===39||S===40?(t.enter(l),t.enter(o),t.consume(S),t.exit(o),u=S===40?41:S,g):i(S)}function g(S){return S===u?(t.enter(o),t.consume(S),t.exit(o),t.exit(l),r):(t.enter(c),p(S))}function p(S){return S===u?(t.exit(c),g(u)):S===null?i(S):Se(S)?(t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),Ue(t,p,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===u||S===null||Se(S)?(t.exit("chunkString"),p(S)):(t.consume(S),S===92?y:v)}function y(S){return S===u||S===92?(t.consume(S),v):v(S)}}function tl(t,r){let i;return l;function l(o){return Se(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i=!0,l):_e(o)?Ue(t,l,i?"linePrefix":"lineSuffix")(o):r(o)}}const uk={name:"definition",tokenize:dk},ck={partial:!0,tokenize:fk};function dk(t,r,i){const l=this;let o;return c;function c(x){return t.enter("definition"),u(x)}function u(x){return $y.call(l,t,h,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function h(x){return o=Cn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),g):i(x)}function g(x){return rt(x)?tl(t,p)(x):p(x)}function p(x){return Gy(t,v,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function v(x){return t.attempt(ck,y,y)(x)}function y(x){return _e(x)?Ue(t,S,"whitespace")(x):S(x)}function S(x){return x===null||Se(x)?(t.exit("definition"),l.parser.defined.push(o),r(x)):i(x)}}function fk(t,r,i){return l;function l(h){return rt(h)?tl(t,o)(h):i(h)}function o(h){return Fy(t,c,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function c(h){return _e(h)?Ue(t,u,"whitespace")(h):u(h)}function u(h){return h===null||Se(h)?r(h):i(h)}}const hk={name:"hardBreakEscape",tokenize:mk};function mk(t,r,i){return l;function l(c){return t.enter("hardBreakEscape"),t.consume(c),o}function o(c){return Se(c)?(t.exit("hardBreakEscape"),r(c)):i(c)}}const pk={name:"headingAtx",resolve:gk,tokenize:yk};function gk(t,r){let i=t.length-2,l=3,o,c;return t[l][1].type==="whitespace"&&(l+=2),i-2>l&&t[i][1].type==="whitespace"&&(i-=2),t[i][1].type==="atxHeadingSequence"&&(l===i-1||i-4>l&&t[i-2][1].type==="whitespace")&&(i-=l+1===i?2:4),i>l&&(o={type:"atxHeadingText",start:t[l][1].start,end:t[i][1].end},c={type:"chunkText",start:t[l][1].start,end:t[i][1].end,contentType:"text"},ln(t,l,i-l+1,[["enter",o,r],["enter",c,r],["exit",c,r],["exit",o,r]])),t}function yk(t,r,i){let l=0;return o;function o(v){return t.enter("atxHeading"),c(v)}function c(v){return t.enter("atxHeadingSequence"),u(v)}function u(v){return v===35&&l++<6?(t.consume(v),u):v===null||rt(v)?(t.exit("atxHeadingSequence"),h(v)):i(v)}function h(v){return v===35?(t.enter("atxHeadingSequence"),g(v)):v===null||Se(v)?(t.exit("atxHeading"),r(v)):_e(v)?Ue(t,h,"whitespace")(v):(t.enter("atxHeadingText"),p(v))}function g(v){return v===35?(t.consume(v),g):(t.exit("atxHeadingSequence"),h(v))}function p(v){return v===null||v===35||rt(v)?(t.exit("atxHeadingText"),h(v)):(t.consume(v),p)}}const vk=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fg=["pre","script","style","textarea"],bk={concrete:!0,name:"htmlFlow",resolveTo:kk,tokenize:wk},xk={partial:!0,tokenize:jk},Sk={partial:!0,tokenize:Ck};function kk(t){let r=t.length;for(;r--&&!(t[r][0]==="enter"&&t[r][1].type==="htmlFlow"););return r>1&&t[r-2][1].type==="linePrefix"&&(t[r][1].start=t[r-2][1].start,t[r+1][1].start=t[r-2][1].start,t.splice(r-2,2)),t}function wk(t,r,i){const l=this;let o,c,u,h,g;return p;function p(j){return v(j)}function v(j){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(j),y}function y(j){return j===33?(t.consume(j),S):j===47?(t.consume(j),c=!0,N):j===63?(t.consume(j),o=3,l.interrupt?r:T):Lt(j)?(t.consume(j),u=String.fromCharCode(j),H):i(j)}function S(j){return j===45?(t.consume(j),o=2,x):j===91?(t.consume(j),o=5,h=0,C):Lt(j)?(t.consume(j),o=4,l.interrupt?r:T):i(j)}function x(j){return j===45?(t.consume(j),l.interrupt?r:T):i(j)}function C(j){const te="CDATA[";return j===te.charCodeAt(h++)?(t.consume(j),h===te.length?l.interrupt?r:ne:C):i(j)}function N(j){return Lt(j)?(t.consume(j),u=String.fromCharCode(j),H):i(j)}function H(j){if(j===null||j===47||j===62||rt(j)){const te=j===47,de=u.toLowerCase();return!te&&!c&&fg.includes(de)?(o=1,l.interrupt?r(j):ne(j)):vk.includes(u.toLowerCase())?(o=6,te?(t.consume(j),O):l.interrupt?r(j):ne(j)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?i(j):c?I(j):A(j))}return j===45||Mt(j)?(t.consume(j),u+=String.fromCharCode(j),H):i(j)}function O(j){return j===62?(t.consume(j),l.interrupt?r:ne):i(j)}function I(j){return _e(j)?(t.consume(j),I):z(j)}function A(j){return j===47?(t.consume(j),z):j===58||j===95||Lt(j)?(t.consume(j),F):_e(j)?(t.consume(j),A):z(j)}function F(j){return j===45||j===46||j===58||j===95||Mt(j)?(t.consume(j),F):W(j)}function W(j){return j===61?(t.consume(j),w):_e(j)?(t.consume(j),W):A(j)}function w(j){return j===null||j===60||j===61||j===62||j===96?i(j):j===34||j===39?(t.consume(j),g=j,q):_e(j)?(t.consume(j),w):Q(j)}function q(j){return j===g?(t.consume(j),g=null,se):j===null||Se(j)?i(j):(t.consume(j),q)}function Q(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||rt(j)?W(j):(t.consume(j),Q)}function se(j){return j===47||j===62||_e(j)?A(j):i(j)}function z(j){return j===62?(t.consume(j),Y):i(j)}function Y(j){return j===null||Se(j)?ne(j):_e(j)?(t.consume(j),Y):i(j)}function ne(j){return j===45&&o===2?(t.consume(j),D):j===60&&o===1?(t.consume(j),U):j===62&&o===4?(t.consume(j),E):j===63&&o===3?(t.consume(j),T):j===93&&o===5?(t.consume(j),K):Se(j)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(xk,L,ue)(j)):j===null||Se(j)?(t.exit("htmlFlowData"),ue(j)):(t.consume(j),ne)}function ue(j){return t.check(Sk,P,L)(j)}function P(j){return t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),B}function B(j){return j===null||Se(j)?ue(j):(t.enter("htmlFlowData"),ne(j))}function D(j){return j===45?(t.consume(j),T):ne(j)}function U(j){return j===47?(t.consume(j),u="",G):ne(j)}function G(j){if(j===62){const te=u.toLowerCase();return fg.includes(te)?(t.consume(j),E):ne(j)}return Lt(j)&&u.length<8?(t.consume(j),u+=String.fromCharCode(j),G):ne(j)}function K(j){return j===93?(t.consume(j),T):ne(j)}function T(j){return j===62?(t.consume(j),E):j===45&&o===2?(t.consume(j),T):ne(j)}function E(j){return j===null||Se(j)?(t.exit("htmlFlowData"),L(j)):(t.consume(j),E)}function L(j){return t.exit("htmlFlow"),r(j)}}function Ck(t,r,i){const l=this;return o;function o(u){return Se(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),c):i(u)}function c(u){return l.parser.lazy[l.now().line]?i(u):r(u)}}function jk(t,r,i){return l;function l(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(ll,r,i)}}const Rk={name:"htmlText",tokenize:Tk};function Tk(t,r,i){const l=this;let o,c,u;return h;function h(T){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(T),g}function g(T){return T===33?(t.consume(T),p):T===47?(t.consume(T),W):T===63?(t.consume(T),A):Lt(T)?(t.consume(T),Q):i(T)}function p(T){return T===45?(t.consume(T),v):T===91?(t.consume(T),c=0,C):Lt(T)?(t.consume(T),I):i(T)}function v(T){return T===45?(t.consume(T),x):i(T)}function y(T){return T===null?i(T):T===45?(t.consume(T),S):Se(T)?(u=y,U(T)):(t.consume(T),y)}function S(T){return T===45?(t.consume(T),x):y(T)}function x(T){return T===62?D(T):T===45?S(T):y(T)}function C(T){const E="CDATA[";return T===E.charCodeAt(c++)?(t.consume(T),c===E.length?N:C):i(T)}function N(T){return T===null?i(T):T===93?(t.consume(T),H):Se(T)?(u=N,U(T)):(t.consume(T),N)}function H(T){return T===93?(t.consume(T),O):N(T)}function O(T){return T===62?D(T):T===93?(t.consume(T),O):N(T)}function I(T){return T===null||T===62?D(T):Se(T)?(u=I,U(T)):(t.consume(T),I)}function A(T){return T===null?i(T):T===63?(t.consume(T),F):Se(T)?(u=A,U(T)):(t.consume(T),A)}function F(T){return T===62?D(T):A(T)}function W(T){return Lt(T)?(t.consume(T),w):i(T)}function w(T){return T===45||Mt(T)?(t.consume(T),w):q(T)}function q(T){return Se(T)?(u=q,U(T)):_e(T)?(t.consume(T),q):D(T)}function Q(T){return T===45||Mt(T)?(t.consume(T),Q):T===47||T===62||rt(T)?se(T):i(T)}function se(T){return T===47?(t.consume(T),D):T===58||T===95||Lt(T)?(t.consume(T),z):Se(T)?(u=se,U(T)):_e(T)?(t.consume(T),se):D(T)}function z(T){return T===45||T===46||T===58||T===95||Mt(T)?(t.consume(T),z):Y(T)}function Y(T){return T===61?(t.consume(T),ne):Se(T)?(u=Y,U(T)):_e(T)?(t.consume(T),Y):se(T)}function ne(T){return T===null||T===60||T===61||T===62||T===96?i(T):T===34||T===39?(t.consume(T),o=T,ue):Se(T)?(u=ne,U(T)):_e(T)?(t.consume(T),ne):(t.consume(T),P)}function ue(T){return T===o?(t.consume(T),o=void 0,B):T===null?i(T):Se(T)?(u=ue,U(T)):(t.consume(T),ue)}function P(T){return T===null||T===34||T===39||T===60||T===61||T===96?i(T):T===47||T===62||rt(T)?se(T):(t.consume(T),P)}function B(T){return T===47||T===62||rt(T)?se(T):i(T)}function D(T){return T===62?(t.consume(T),t.exit("htmlTextData"),t.exit("htmlText"),r):i(T)}function U(T){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),G}function G(T){return _e(T)?Ue(t,K,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):K(T)}function K(T){return t.enter("htmlTextData"),u(T)}}const vd={name:"labelEnd",resolveAll:Ik,resolveTo:Dk,tokenize:Ok},Ek={tokenize:Mk},Nk={tokenize:zk},Ak={tokenize:_k};function Ik(t){let r=-1;const i=[];for(;++r<t.length;){const l=t[r][1];if(i.push(t[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",r+=o}}return t.length!==i.length&&ln(t,0,t.length,i),t}function Dk(t,r){let i=t.length,l=0,o,c,u,h;for(;i--;)if(o=t[i][1],c){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;t[i][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(t[i][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(c=i,o.type!=="labelLink")){l=2;break}}else o.type==="labelEnd"&&(u=i);const g={type:t[c][1].type==="labelLink"?"link":"image",start:{...t[c][1].start},end:{...t[t.length-1][1].end}},p={type:"label",start:{...t[c][1].start},end:{...t[u][1].end}},v={type:"labelText",start:{...t[c+l+2][1].end},end:{...t[u-2][1].start}};return h=[["enter",g,r],["enter",p,r]],h=bn(h,t.slice(c+1,c+l+3)),h=bn(h,[["enter",v,r]]),h=bn(h,Ks(r.parser.constructs.insideSpan.null,t.slice(c+l+4,u-3),r)),h=bn(h,[["exit",v,r],t[u-2],t[u-1],["exit",p,r]]),h=bn(h,t.slice(u+1)),h=bn(h,[["exit",g,r]]),ln(t,c,t.length,h),t}function Ok(t,r,i){const l=this;let o=l.events.length,c,u;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){c=l.events[o][1];break}return h;function h(S){return c?c._inactive?y(S):(u=l.parser.defined.includes(Cn(l.sliceSerialize({start:c.end,end:l.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(S),t.exit("labelMarker"),t.exit("labelEnd"),g):i(S)}function g(S){return S===40?t.attempt(Ek,v,u?v:y)(S):S===91?t.attempt(Nk,v,u?p:y)(S):u?v(S):y(S)}function p(S){return t.attempt(Ak,v,y)(S)}function v(S){return r(S)}function y(S){return c._balanced=!0,i(S)}}function Mk(t,r,i){return l;function l(y){return t.enter("resource"),t.enter("resourceMarker"),t.consume(y),t.exit("resourceMarker"),o}function o(y){return rt(y)?tl(t,c)(y):c(y)}function c(y){return y===41?v(y):Gy(t,u,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return rt(y)?tl(t,g)(y):v(y)}function h(y){return i(y)}function g(y){return y===34||y===39||y===40?Fy(t,p,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):v(y)}function p(y){return rt(y)?tl(t,v)(y):v(y)}function v(y){return y===41?(t.enter("resourceMarker"),t.consume(y),t.exit("resourceMarker"),t.exit("resource"),r):i(y)}}function zk(t,r,i){const l=this;return o;function o(h){return $y.call(l,t,c,u,"reference","referenceMarker","referenceString")(h)}function c(h){return l.parser.defined.includes(Cn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(h):i(h)}function u(h){return i(h)}}function _k(t,r,i){return l;function l(c){return t.enter("reference"),t.enter("referenceMarker"),t.consume(c),t.exit("referenceMarker"),o}function o(c){return c===93?(t.enter("referenceMarker"),t.consume(c),t.exit("referenceMarker"),t.exit("reference"),r):i(c)}}const Lk={name:"labelStartImage",resolveAll:vd.resolveAll,tokenize:Bk};function Bk(t,r,i){const l=this;return o;function o(h){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(h),t.exit("labelImageMarker"),c}function c(h){return h===91?(t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),t.exit("labelImage"),u):i(h)}function u(h){return h===94&&"_hiddenFootnoteSupport"in l.parser.constructs?i(h):r(h)}}const Hk={name:"labelStartLink",resolveAll:vd.resolveAll,tokenize:Uk};function Uk(t,r,i){const l=this;return o;function o(u){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelLink"),c}function c(u){return u===94&&"_hiddenFootnoteSupport"in l.parser.constructs?i(u):r(u)}}const Rc={name:"lineEnding",tokenize:qk};function qk(t,r){return i;function i(l){return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Ue(t,r,"linePrefix")}}const Ns={name:"thematicBreak",tokenize:Gk};function Gk(t,r,i){let l=0,o;return c;function c(p){return t.enter("thematicBreak"),u(p)}function u(p){return o=p,h(p)}function h(p){return p===o?(t.enter("thematicBreakSequence"),g(p)):l>=3&&(p===null||Se(p))?(t.exit("thematicBreak"),r(p)):i(p)}function g(p){return p===o?(t.consume(p),l++,g):(t.exit("thematicBreakSequence"),_e(p)?Ue(t,h,"whitespace")(p):h(p))}}const Pt={continuation:{tokenize:Yk},exit:Kk,name:"list",tokenize:Vk},$k={partial:!0,tokenize:Xk},Fk={partial:!0,tokenize:Pk};function Vk(t,r,i){const l=this,o=l.events[l.events.length-1];let c=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return h;function h(x){const C=l.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!l.containerState.marker||x===l.containerState.marker:Kc(x)){if(l.containerState.type||(l.containerState.type=C,t.enter(C,{_container:!0})),C==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(Ns,i,p)(x):p(x);if(!l.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),g(x)}return i(x)}function g(x){return Kc(x)&&++u<10?(t.consume(x),g):(!l.interrupt||u<2)&&(l.containerState.marker?x===l.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),p(x)):i(x)}function p(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||x,t.check(ll,l.interrupt?i:v,t.attempt($k,S,y))}function v(x){return l.containerState.initialBlankLine=!0,c++,S(x)}function y(x){return _e(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),S):i(x)}function S(x){return l.containerState.size=c+l.sliceSerialize(t.exit("listItemPrefix"),!0).length,r(x)}}function Yk(t,r,i){const l=this;return l.containerState._closeFlow=void 0,t.check(ll,o,c);function o(h){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Ue(t,r,"listItemIndent",l.containerState.size+1)(h)}function c(h){return l.containerState.furtherBlankLines||!_e(h)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,u(h)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,t.attempt(Fk,r,u)(h))}function u(h){return l.containerState._closeFlow=!0,l.interrupt=void 0,Ue(t,t.attempt(Pt,r,i),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function Pk(t,r,i){const l=this;return Ue(t,o,"listItemIndent",l.containerState.size+1);function o(c){const u=l.events[l.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===l.containerState.size?r(c):i(c)}}function Kk(t){t.exit(this.containerState.type)}function Xk(t,r,i){const l=this;return Ue(t,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(c){const u=l.events[l.events.length-1];return!_e(c)&&u&&u[1].type==="listItemPrefixWhitespace"?r(c):i(c)}}const hg={name:"setextUnderline",resolveTo:Qk,tokenize:Zk};function Qk(t,r){let i=t.length,l,o,c;for(;i--;)if(t[i][0]==="enter"){if(t[i][1].type==="content"){l=i;break}t[i][1].type==="paragraph"&&(o=i)}else t[i][1].type==="content"&&t.splice(i,1),!c&&t[i][1].type==="definition"&&(c=i);const u={type:"setextHeading",start:{...t[l][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",c?(t.splice(o,0,["enter",u,r]),t.splice(c+1,0,["exit",t[l][1],r]),t[l][1].end={...t[c][1].end}):t[l][1]=u,t.push(["exit",u,r]),t}function Zk(t,r,i){const l=this;let o;return c;function c(p){let v=l.events.length,y;for(;v--;)if(l.events[v][1].type!=="lineEnding"&&l.events[v][1].type!=="linePrefix"&&l.events[v][1].type!=="content"){y=l.events[v][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||y)?(t.enter("setextHeadingLine"),o=p,u(p)):i(p)}function u(p){return t.enter("setextHeadingLineSequence"),h(p)}function h(p){return p===o?(t.consume(p),h):(t.exit("setextHeadingLineSequence"),_e(p)?Ue(t,g,"lineSuffix")(p):g(p))}function g(p){return p===null||Se(p)?(t.exit("setextHeadingLine"),r(p)):i(p)}}const Jk={tokenize:Wk};function Wk(t){const r=this,i=t.attempt(ll,l,t.attempt(this.parser.constructs.flowInitial,o,Ue(t,t.attempt(this.parser.constructs.flow,o,t.attempt(ik,o)),"linePrefix")));return i;function l(c){if(c===null){t.consume(c);return}return t.enter("lineEndingBlank"),t.consume(c),t.exit("lineEndingBlank"),r.currentConstruct=void 0,i}function o(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),r.currentConstruct=void 0,i}}const ew={resolveAll:Yy()},tw=Vy("string"),nw=Vy("text");function Vy(t){return{resolveAll:Yy(t==="text"?rw:void 0),tokenize:r};function r(i){const l=this,o=this.parser.constructs[t],c=i.attempt(o,u,h);return u;function u(v){return p(v)?c(v):h(v)}function h(v){if(v===null){i.consume(v);return}return i.enter("data"),i.consume(v),g}function g(v){return p(v)?(i.exit("data"),c(v)):(i.consume(v),g)}function p(v){if(v===null)return!0;const y=o[v];let S=-1;if(y)for(;++S<y.length;){const x=y[S];if(!x.previous||x.previous.call(l,l.previous))return!0}return!1}}}function Yy(t){return r;function r(i,l){let o=-1,c;for(;++o<=i.length;)c===void 0?i[o]&&i[o][1].type==="data"&&(c=o,o++):(!i[o]||i[o][1].type!=="data")&&(o!==c+2&&(i[c][1].end=i[o-1][1].end,i.splice(c+2,o-c-2),o=c+2),c=void 0);return t?t(i,l):i}}function rw(t,r){let i=0;for(;++i<=t.length;)if((i===t.length||t[i][1].type==="lineEnding")&&t[i-1][1].type==="data"){const l=t[i-1][1],o=r.sliceStream(l);let c=o.length,u=-1,h=0,g;for(;c--;){const p=o[c];if(typeof p=="string"){for(u=p.length;p.charCodeAt(u-1)===32;)h++,u--;if(u)break;u=-1}else if(p===-2)g=!0,h++;else if(p!==-1){c++;break}}if(r._contentTypeTextTrailing&&i===t.length&&(h=0),h){const p={type:i===t.length||g||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?u:l.start._bufferIndex+u,_index:l.start._index+c,line:l.end.line,column:l.end.column-h,offset:l.end.offset-h},end:{...l.end}};l.end={...p.start},l.start.offset===l.end.offset?Object.assign(l,p):(t.splice(i,0,["enter",p,r],["exit",p,r]),i+=2)}i++}return t}const iw={42:Pt,43:Pt,45:Pt,48:Pt,49:Pt,50:Pt,51:Pt,52:Pt,53:Pt,54:Pt,55:Pt,56:Pt,57:Pt,62:By},aw={91:uk},lw={[-2]:jc,[-1]:jc,32:jc},sw={35:pk,42:Ns,45:[hg,Ns],60:bk,61:hg,95:Ns,96:dg,126:dg},ow={38:Uy,92:Hy},uw={[-5]:Rc,[-4]:Rc,[-3]:Rc,33:Lk,38:Uy,42:Xc,60:[H0,Rk],91:Hk,92:[hk,Hy],93:vd,95:Xc,96:J0},cw={null:[Xc,ew]},dw={null:[42,95]},fw={null:[]},hw=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:dw,contentInitial:aw,disable:fw,document:iw,flow:sw,flowInitial:lw,insideSpan:cw,string:ow,text:uw},Symbol.toStringTag,{value:"Module"}));function mw(t,r,i){let l={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const o={},c=[];let u=[],h=[];const g={attempt:q(W),check:q(w),consume:I,enter:A,exit:F,interrupt:q(w,{interrupt:!0})},p={code:null,containerState:{},defineSkip:N,events:[],now:C,parser:t,previous:null,sliceSerialize:S,sliceStream:x,write:y};let v=r.tokenize.call(p,g);return r.resolveAll&&c.push(r),p;function y(Y){return u=bn(u,Y),H(),u[u.length-1]!==null?[]:(Q(r,0),p.events=Ks(c,p.events,p),p.events)}function S(Y,ne){return gw(x(Y),ne)}function x(Y){return pw(u,Y)}function C(){const{_bufferIndex:Y,_index:ne,line:ue,column:P,offset:B}=l;return{_bufferIndex:Y,_index:ne,line:ue,column:P,offset:B}}function N(Y){o[Y.line]=Y.column,z()}function H(){let Y;for(;l._index<u.length;){const ne=u[l._index];if(typeof ne=="string")for(Y=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===Y&&l._bufferIndex<ne.length;)O(ne.charCodeAt(l._bufferIndex));else O(ne)}}function O(Y){v=v(Y)}function I(Y){Se(Y)?(l.line++,l.column=1,l.offset+=Y===-3?2:1,z()):Y!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===u[l._index].length&&(l._bufferIndex=-1,l._index++)),p.previous=Y}function A(Y,ne){const ue=ne||{};return ue.type=Y,ue.start=C(),p.events.push(["enter",ue,p]),h.push(ue),ue}function F(Y){const ne=h.pop();return ne.end=C(),p.events.push(["exit",ne,p]),ne}function W(Y,ne){Q(Y,ne.from)}function w(Y,ne){ne.restore()}function q(Y,ne){return ue;function ue(P,B,D){let U,G,K,T;return Array.isArray(P)?L(P):"tokenize"in P?L([P]):E(P);function E(J){return ae;function ae(fe){const me=fe!==null&&J[fe],pe=fe!==null&&J.null,Ie=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return L(Ie)(fe)}}function L(J){return U=J,G=0,J.length===0?D:j(J[G])}function j(J){return ae;function ae(fe){return T=se(),K=J,J.partial||(p.currentConstruct=J),J.name&&p.parser.constructs.disable.null.includes(J.name)?de():J.tokenize.call(ne?Object.assign(Object.create(p),ne):p,g,te,de)(fe)}}function te(J){return Y(K,T),B}function de(J){return T.restore(),++G<U.length?j(U[G]):D}}}function Q(Y,ne){Y.resolveAll&&!c.includes(Y)&&c.push(Y),Y.resolve&&ln(p.events,ne,p.events.length-ne,Y.resolve(p.events.slice(ne),p)),Y.resolveTo&&(p.events=Y.resolveTo(p.events,p))}function se(){const Y=C(),ne=p.previous,ue=p.currentConstruct,P=p.events.length,B=Array.from(h);return{from:P,restore:D};function D(){l=Y,p.previous=ne,p.currentConstruct=ue,p.events.length=P,h=B,z()}}function z(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function pw(t,r){const i=r.start._index,l=r.start._bufferIndex,o=r.end._index,c=r.end._bufferIndex;let u;if(i===o)u=[t[i].slice(l,c)];else{if(u=t.slice(i,o),l>-1){const h=u[0];typeof h=="string"?u[0]=h.slice(l):u.shift()}c>0&&u.push(t[o].slice(0,c))}return u}function gw(t,r){let i=-1;const l=[];let o;for(;++i<t.length;){const c=t[i];let u;if(typeof c=="string")u=c;else switch(c){case-5:{u="\r";break}case-4:{u=`
|
|
13
|
-
`;break}case-3:{u=`\r
|
|
14
|
-
`;break}case-2:{u=r?" ":" ";break}case-1:{if(!r&&o)continue;u=" ";break}default:u=String.fromCharCode(c)}o=c===-2,l.push(u)}return l.join("")}function yw(t){const l={constructs:_y([hw,...(t||{}).extensions||[]]),content:o(D0),defined:[],document:o(M0),flow:o(Jk),lazy:{},string:o(tw),text:o(nw)};return l;function o(c){return u;function u(h){return mw(l,c,h)}}}function vw(t){for(;!qy(t););return t}const mg=/[\0\t\n\r]/g;function bw(){let t=1,r="",i=!0,l;return o;function o(c,u,h){const g=[];let p,v,y,S,x;for(c=r+(typeof c=="string"?c.toString():new TextDecoder(u||void 0).decode(c)),y=0,r="",i&&(c.charCodeAt(0)===65279&&y++,i=void 0);y<c.length;){if(mg.lastIndex=y,p=mg.exec(c),S=p&&p.index!==void 0?p.index:c.length,x=c.charCodeAt(S),!p){r=c.slice(y);break}if(x===10&&y===S&&l)g.push(-3),l=void 0;else switch(l&&(g.push(-5),l=void 0),y<S&&(g.push(c.slice(y,S)),t+=S-y),x){case 0:{g.push(65533),t++;break}case 9:{for(v=Math.ceil(t/4)*4,g.push(-2);t++<v;)g.push(-1);break}case 10:{g.push(-4),t=1;break}default:l=!0,t=1}y=S+1}return h&&(l&&g.push(-5),r&&g.push(r),g.push(null)),g}}const xw=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Sw(t){return t.replace(xw,kw)}function kw(t,r,i){if(r)return r;if(i.charCodeAt(0)===35){const o=i.charCodeAt(1),c=o===120||o===88;return Ly(i.slice(c?2:1),c?16:10)}return yd(i)||t}const Py={}.hasOwnProperty;function ww(t,r,i){return r&&typeof r=="object"&&(i=r,r=void 0),Cw(i)(vw(yw(i).document().write(bw()(t,r,!0))))}function Cw(t){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Bt),autolinkProtocol:se,autolinkEmail:se,atxHeading:c(it),blockQuote:c(pe),characterEscape:se,characterReference:se,codeFenced:c(Ie),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:c(Ie,u),codeText:c(Ne,u),codeTextData:se,data:se,codeFlowValue:se,definition:c($e),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:c(Pe),hardBreakEscape:c(sn),hardBreakTrailing:c(sn),htmlFlow:c(jt,u),htmlFlowData:se,htmlText:c(jt,u),htmlTextData:se,image:c(on),label:u,link:c(Bt),listItem:c(Ce),listItemValue:S,listOrdered:c(Rt,y),listUnordered:c(Rt),paragraph:c(qe),reference:j,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:c(it),strong:c(ot),thematicBreak:c(Ht)},exit:{atxHeading:g(),atxHeadingSequence:W,autolink:g(),autolinkEmail:me,autolinkProtocol:fe,blockQuote:g(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:J,characterReference:ae,codeFenced:g(H),codeFencedFence:N,codeFencedFenceInfo:x,codeFencedFenceMeta:C,codeFlowValue:z,codeIndented:g(O),codeText:g(B),codeTextData:z,data:z,definition:g(),definitionDestinationString:F,definitionLabelString:I,definitionTitleString:A,emphasis:g(),hardBreakEscape:g(ne),hardBreakTrailing:g(ne),htmlFlow:g(ue),htmlFlowData:z,htmlText:g(P),htmlTextData:z,image:g(U),label:K,labelText:G,lineEnding:Y,link:g(D),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:te,resourceDestinationString:T,resourceTitleString:E,resource:L,setextHeading:g(Q),setextHeadingLineSequence:q,setextHeadingText:w,strong:g(),thematicBreak:g()}};Ky(r,(t||{}).mdastExtensions||[]);const i={};return l;function l(M){let ie={type:"root",children:[]};const ge={stack:[ie],tokenStack:[],config:r,enter:h,exit:p,buffer:u,resume:v,data:i},we=[];let Te=-1;for(;++Te<M.length;)if(M[Te][1].type==="listOrdered"||M[Te][1].type==="listUnordered")if(M[Te][0]==="enter")we.push(Te);else{const be=we.pop();Te=o(M,be,Te)}for(Te=-1;++Te<M.length;){const be=r[M[Te][0]];Py.call(be,M[Te][1].type)&&be[M[Te][1].type].call(Object.assign({sliceSerialize:M[Te][2].sliceSerialize},ge),M[Te][1])}if(ge.tokenStack.length>0){const be=ge.tokenStack[ge.tokenStack.length-1];(be[1]||pg).call(ge,void 0,be[0])}for(ie.position={start:jr(M.length>0?M[0][1].start:{line:1,column:1,offset:0}),end:jr(M.length>0?M[M.length-2][1].end:{line:1,column:1,offset:0})},Te=-1;++Te<r.transforms.length;)ie=r.transforms[Te](ie)||ie;return ie}function o(M,ie,ge){let we=ie-1,Te=-1,be=!1,Ge,Ee,Oe,ft;for(;++we<=ge;){const Xe=M[we];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Te++:Te--,ft=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Ge&&!ft&&!Te&&!Oe&&(Oe=we),ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ft=void 0}if(!Te&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Te===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Ge){let jn=we;for(Ee=void 0;jn--;){const Qt=M[jn];if(Qt[1].type==="lineEnding"||Qt[1].type==="lineEndingBlank"){if(Qt[0]==="exit")continue;Ee&&(M[Ee][1].type="lineEndingBlank",be=!0),Qt[1].type="lineEnding",Ee=jn}else if(!(Qt[1].type==="linePrefix"||Qt[1].type==="blockQuotePrefix"||Qt[1].type==="blockQuotePrefixWhitespace"||Qt[1].type==="blockQuoteMarker"||Qt[1].type==="listItemIndent"))break}Oe&&(!Ee||Oe<Ee)&&(Ge._spread=!0),Ge.end=Object.assign({},Ee?M[Ee][1].start:Xe[1].end),M.splice(Ee||we,0,["exit",Ge,Xe[2]]),we++,ge++}if(Xe[1].type==="listItemPrefix"){const jn={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Ge=jn,M.splice(we,0,["enter",jn,Xe[2]]),we++,ge++,Oe=void 0,ft=!0}}}return M[ie][1]._spread=be,ge}function c(M,ie){return ge;function ge(we){h.call(this,M(we),we),ie&&ie.call(this,we)}}function u(){this.stack.push({type:"fragment",children:[]})}function h(M,ie,ge){this.stack[this.stack.length-1].children.push(M),this.stack.push(M),this.tokenStack.push([ie,ge||void 0]),M.position={start:jr(ie.start),end:void 0}}function g(M){return ie;function ie(ge){M&&M.call(this,ge),p.call(this,ge)}}function p(M,ie){const ge=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==M.type&&(ie?ie.call(this,M,we[0]):(we[1]||pg).call(this,M,we[0]));else throw new Error("Cannot close `"+M.type+"` ("+el({start:M.start,end:M.end})+"): it’s not open");ge.position.end=jr(M.end)}function v(){return gd(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function S(M){if(this.data.expectingFirstListItemValue){const ie=this.stack[this.stack.length-2];ie.start=Number.parseInt(this.sliceSerialize(M),10),this.data.expectingFirstListItemValue=void 0}}function x(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.lang=M}function C(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.meta=M}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function H(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.value=M.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function O(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.value=M.replace(/(\r?\n|\r)$/g,"")}function I(M){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.label=ie,ge.identifier=Cn(this.sliceSerialize(M)).toLowerCase()}function A(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.title=M}function F(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.url=M}function W(M){const ie=this.stack[this.stack.length-1];if(!ie.depth){const ge=this.sliceSerialize(M).length;ie.depth=ge}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function q(M){const ie=this.stack[this.stack.length-1];ie.depth=this.sliceSerialize(M).codePointAt(0)===61?1:2}function Q(){this.data.setextHeadingSlurpLineEnding=void 0}function se(M){const ge=this.stack[this.stack.length-1].children;let we=ge[ge.length-1];(!we||we.type!=="text")&&(we=Fe(),we.position={start:jr(M.start),end:void 0},ge.push(we)),this.stack.push(we)}function z(M){const ie=this.stack.pop();ie.value+=this.sliceSerialize(M),ie.position.end=jr(M.end)}function Y(M){const ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ge=ie.children[ie.children.length-1];ge.position.end=jr(M.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(ie.type)&&(se.call(this,M),z.call(this,M))}function ne(){this.data.atHardBreak=!0}function ue(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.value=M}function P(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.value=M}function B(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.value=M}function D(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=ie,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function U(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=ie,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function G(M){const ie=this.sliceSerialize(M),ge=this.stack[this.stack.length-2];ge.label=Sw(ie),ge.identifier=Cn(ie).toLowerCase()}function K(){const M=this.stack[this.stack.length-1],ie=this.resume(),ge=this.stack[this.stack.length-1];if(this.data.inReference=!0,ge.type==="link"){const we=M.children;ge.children=we}else ge.alt=ie}function T(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.url=M}function E(){const M=this.resume(),ie=this.stack[this.stack.length-1];ie.title=M}function L(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function te(M){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.label=ie,ge.identifier=Cn(this.sliceSerialize(M)).toLowerCase(),this.data.referenceType="full"}function de(M){this.data.characterReferenceType=M.type}function J(M){const ie=this.sliceSerialize(M),ge=this.data.characterReferenceType;let we;ge?(we=Ly(ie,ge==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=yd(ie);const Te=this.stack[this.stack.length-1];Te.value+=we}function ae(M){const ie=this.stack.pop();ie.position.end=jr(M.end)}function fe(M){z.call(this,M);const ie=this.stack[this.stack.length-1];ie.url=this.sliceSerialize(M)}function me(M){z.call(this,M);const ie=this.stack[this.stack.length-1];ie.url="mailto:"+this.sliceSerialize(M)}function pe(){return{type:"blockquote",children:[]}}function Ie(){return{type:"code",lang:null,meta:null,value:""}}function Ne(){return{type:"inlineCode",value:""}}function $e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function it(){return{type:"heading",depth:0,children:[]}}function sn(){return{type:"break"}}function jt(){return{type:"html",value:""}}function on(){return{type:"image",title:null,url:"",alt:null}}function Bt(){return{type:"link",title:null,url:"",children:[]}}function Rt(M){return{type:"list",ordered:M.type==="listOrdered",start:null,spread:M._spread,children:[]}}function Ce(M){return{type:"listItem",spread:M._spread,checked:null,children:[]}}function qe(){return{type:"paragraph",children:[]}}function ot(){return{type:"strong",children:[]}}function Fe(){return{type:"text",value:""}}function Ht(){return{type:"thematicBreak"}}}function jr(t){return{line:t.line,column:t.column,offset:t.offset}}function Ky(t,r){let i=-1;for(;++i<r.length;){const l=r[i];Array.isArray(l)?Ky(t,l):jw(t,l)}}function jw(t,r){let i;for(i in r)if(Py.call(r,i))switch(i){case"canContainEols":{const l=r[i];l&&t[i].push(...l);break}case"transforms":{const l=r[i];l&&t[i].push(...l);break}case"enter":case"exit":{const l=r[i];l&&Object.assign(t[i],l);break}}}function pg(t,r){throw t?new Error("Cannot close `"+t.type+"` ("+el({start:t.start,end:t.end})+"): a different token (`"+r.type+"`, "+el({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+el({start:r.start,end:r.end})+") is still open")}function Rw(t){const r=this;r.parser=i;function i(l){return ww(l,{...r.data("settings"),...t,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function Tw(t,r){const i={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(r),!0)};return t.patch(r,i),t.applyData(r,i)}function Ew(t,r){const i={type:"element",tagName:"br",properties:{},children:[]};return t.patch(r,i),[t.applyData(r,i),{type:"text",value:`
|
|
15
|
-
`}]}function Nw(t,r){const i=r.value?r.value+`
|
|
16
|
-
`:"",l={},o=r.lang?r.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let c={type:"element",tagName:"code",properties:l,children:[{type:"text",value:i}]};return r.meta&&(c.data={meta:r.meta}),t.patch(r,c),c=t.applyData(r,c),c={type:"element",tagName:"pre",properties:{},children:[c]},t.patch(r,c),c}function Aw(t,r){const i={type:"element",tagName:"del",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function Iw(t,r){const i={type:"element",tagName:"em",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function Dw(t,r){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),o=Ji(l.toLowerCase()),c=t.footnoteOrder.indexOf(l);let u,h=t.footnoteCounts.get(l);h===void 0?(h=0,t.footnoteOrder.push(l),u=t.footnoteOrder.length):u=c+1,h+=1,t.footnoteCounts.set(l,h);const g={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+o,id:i+"fnref-"+o+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};t.patch(r,g);const p={type:"element",tagName:"sup",properties:{},children:[g]};return t.patch(r,p),t.applyData(r,p)}function Ow(t,r){const i={type:"element",tagName:"h"+r.depth,properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function Mw(t,r){if(t.options.allowDangerousHtml){const i={type:"raw",value:r.value};return t.patch(r,i),t.applyData(r,i)}}function Xy(t,r){const i=r.referenceType;let l="]";if(i==="collapsed"?l+="[]":i==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];const o=t.all(r),c=o[0];c&&c.type==="text"?c.value="["+c.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=l:o.push({type:"text",value:l}),o}function zw(t,r){const i=String(r.identifier).toUpperCase(),l=t.definitionById.get(i);if(!l)return Xy(t,r);const o={src:Ji(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(o.title=l.title);const c={type:"element",tagName:"img",properties:o,children:[]};return t.patch(r,c),t.applyData(r,c)}function _w(t,r){const i={src:Ji(r.url)};r.alt!==null&&r.alt!==void 0&&(i.alt=r.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return t.patch(r,l),t.applyData(r,l)}function Lw(t,r){const i={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};t.patch(r,i);const l={type:"element",tagName:"code",properties:{},children:[i]};return t.patch(r,l),t.applyData(r,l)}function Bw(t,r){const i=String(r.identifier).toUpperCase(),l=t.definitionById.get(i);if(!l)return Xy(t,r);const o={href:Ji(l.url||"")};l.title!==null&&l.title!==void 0&&(o.title=l.title);const c={type:"element",tagName:"a",properties:o,children:t.all(r)};return t.patch(r,c),t.applyData(r,c)}function Hw(t,r){const i={href:Ji(r.url)};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function Uw(t,r,i){const l=t.all(r),o=i?qw(i):Qy(r),c={},u=[];if(typeof r.checked=="boolean"){const v=l[0];let y;v&&v.type==="element"&&v.tagName==="p"?y=v:(y={type:"element",tagName:"p",properties:{},children:[]},l.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let h=-1;for(;++h<l.length;){const v=l[h];(o||h!==0||v.type!=="element"||v.tagName!=="p")&&u.push({type:"text",value:`
|
|
17
|
-
`}),v.type==="element"&&v.tagName==="p"&&!o?u.push(...v.children):u.push(v)}const g=l[l.length-1];g&&(o||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
|
|
18
|
-
`});const p={type:"element",tagName:"li",properties:c,children:u};return t.patch(r,p),t.applyData(r,p)}function qw(t){let r=!1;if(t.type==="list"){r=t.spread||!1;const i=t.children;let l=-1;for(;!r&&++l<i.length;)r=Qy(i[l])}return r}function Qy(t){const r=t.spread;return r??t.children.length>1}function Gw(t,r){const i={},l=t.all(r);let o=-1;for(typeof r.start=="number"&&r.start!==1&&(i.start=r.start);++o<l.length;){const u=l[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const c={type:"element",tagName:r.ordered?"ol":"ul",properties:i,children:t.wrap(l,!0)};return t.patch(r,c),t.applyData(r,c)}function $w(t,r){const i={type:"element",tagName:"p",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function Fw(t,r){const i={type:"root",children:t.wrap(t.all(r))};return t.patch(r,i),t.applyData(r,i)}function Vw(t,r){const i={type:"element",tagName:"strong",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function Yw(t,r){const i=t.all(r),l=i.shift(),o=[];if(l){const u={type:"element",tagName:"thead",properties:{},children:t.wrap([l],!0)};t.patch(r.children[0],u),o.push(u)}if(i.length>0){const u={type:"element",tagName:"tbody",properties:{},children:t.wrap(i,!0)},h=fd(r.children[1]),g=Ny(r.children[r.children.length-1]);h&&g&&(u.position={start:h,end:g}),o.push(u)}const c={type:"element",tagName:"table",properties:{},children:t.wrap(o,!0)};return t.patch(r,c),t.applyData(r,c)}function Pw(t,r,i){const l=i?i.children:void 0,c=(l?l.indexOf(r):1)===0?"th":"td",u=i&&i.type==="table"?i.align:void 0,h=u?u.length:r.children.length;let g=-1;const p=[];for(;++g<h;){const y=r.children[g],S={},x=u?u[g]:void 0;x&&(S.align=x);let C={type:"element",tagName:c,properties:S,children:[]};y&&(C.children=t.all(y),t.patch(y,C),C=t.applyData(y,C)),p.push(C)}const v={type:"element",tagName:"tr",properties:{},children:t.wrap(p,!0)};return t.patch(r,v),t.applyData(r,v)}function Kw(t,r){const i={type:"element",tagName:"td",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}const gg=9,yg=32;function Xw(t){const r=String(t),i=/\r?\n|\r/g;let l=i.exec(r),o=0;const c=[];for(;l;)c.push(vg(r.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=i.exec(r);return c.push(vg(r.slice(o),o>0,!1)),c.join("")}function vg(t,r,i){let l=0,o=t.length;if(r){let c=t.codePointAt(l);for(;c===gg||c===yg;)l++,c=t.codePointAt(l)}if(i){let c=t.codePointAt(o-1);for(;c===gg||c===yg;)o--,c=t.codePointAt(o-1)}return o>l?t.slice(l,o):""}function Qw(t,r){const i={type:"text",value:Xw(String(r.value))};return t.patch(r,i),t.applyData(r,i)}function Zw(t,r){const i={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(r,i),t.applyData(r,i)}const Jw={blockquote:Tw,break:Ew,code:Nw,delete:Aw,emphasis:Iw,footnoteReference:Dw,heading:Ow,html:Mw,imageReference:zw,image:_w,inlineCode:Lw,linkReference:Bw,link:Hw,listItem:Uw,list:Gw,paragraph:$w,root:Fw,strong:Vw,table:Yw,tableCell:Kw,tableRow:Pw,text:Qw,thematicBreak:Zw,toml:ws,yaml:ws,definition:ws,footnoteDefinition:ws};function ws(){}const Zy=-1,Xs=0,nl=1,zs=2,bd=3,xd=4,Sd=5,kd=6,Jy=7,Wy=8,ev=typeof self=="object"?self:globalThis,bg=(t,r)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new ev[t](r)},Ww=(t,r)=>{const i=(o,c)=>(t.set(c,o),o),l=o=>{if(t.has(o))return t.get(o);const[c,u]=r[o];switch(c){case Xs:case Zy:return i(u,o);case nl:{const h=i([],o);for(const g of u)h.push(l(g));return h}case zs:{const h=i({},o);for(const[g,p]of u)h[l(g)]=l(p);return h}case bd:return i(new Date(u),o);case xd:{const{source:h,flags:g}=u;return i(new RegExp(h,g),o)}case Sd:{const h=i(new Map,o);for(const[g,p]of u)h.set(l(g),l(p));return h}case kd:{const h=i(new Set,o);for(const g of u)h.add(l(g));return h}case Jy:{const{name:h,message:g}=u;return i(typeof ev[h]=="function"?bg(h,g):new Error(g),o)}case Wy:return i(BigInt(u),o);case"BigInt":return i(Object(BigInt(u)),o);case"ArrayBuffer":return i(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:h}=new Uint8Array(u);return i(new DataView(h),u)}}return i(bg(c,u),o)};return l},xg=t=>Ww(new Map,t)(0),Zr="",{toString:eC}={},{keys:tC}=Object,Qa=t=>{const r=typeof t;if(r!=="object"||!t)return[Xs,r];const i=eC.call(t).slice(8,-1);switch(i){case"Array":return[nl,Zr];case"Object":return[zs,Zr];case"Date":return[bd,Zr];case"RegExp":return[xd,Zr];case"Map":return[Sd,Zr];case"Set":return[kd,Zr];case"DataView":return[nl,i]}return i.includes("Array")?[nl,i]:t instanceof Error?[Jy,t.name||"Error"]:[zs,i]},Cs=([t,r])=>t===Xs&&(r==="function"||r==="symbol"),nC=(t,r,i,l)=>{const o=(u,h)=>{const g=l.push(u)-1;return i.set(h,g),g},c=u=>{if(i.has(u))return i.get(u);let[h,g]=Qa(u);switch(h){case Xs:{let v=u;switch(g){case"bigint":h=Wy,v=u.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+g);v=null;break;case"undefined":return o([Zy],u)}return o([h,v],u)}case nl:{if(g){let S=u;return g==="DataView"?S=new Uint8Array(u.buffer):g==="ArrayBuffer"&&(S=new Uint8Array(u)),o([g,[...S]],u)}const v=[],y=o([h,v],u);for(const S of u)v.push(c(S));return y}case zs:{if(g)switch(g){case"BigInt":return o([g,u.toString()],u);case"Boolean":case"Number":case"String":return o([g,u.valueOf()],u)}if(r&&"toJSON"in u)return c(u.toJSON());const v=[],y=o([h,v],u);for(const S of tC(u))(t||!Cs(Qa(u[S])))&&v.push([c(S),c(u[S])]);return y}case bd:return o([h,isNaN(u.getTime())?Zr:u.toISOString()],u);case xd:{const{source:v,flags:y}=u;return o([h,{source:v,flags:y}],u)}case Sd:{const v=[],y=o([h,v],u);for(const[S,x]of u)(t||!(Cs(Qa(S))||Cs(Qa(x))))&&v.push([c(S),c(x)]);return y}case kd:{const v=[],y=o([h,v],u);for(const S of u)(t||!Cs(Qa(S)))&&v.push(c(S));return y}}const{message:p}=u;return o([h,{name:g,message:p}],u)};return c},Sg=(t,{json:r,lossy:i}={})=>{const l=[];return nC(!(r||i),!!r,new Map,l)(t),l},_s=typeof structuredClone=="function"?(t,r)=>r&&("json"in r||"lossy"in r)?xg(Sg(t,r)):structuredClone(t):(t,r)=>xg(Sg(t,r));function rC(t,r){const i=[{type:"text",value:"↩"}];return r>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),i}function iC(t,r){return"Back to reference "+(t+1)+(r>1?"-"+r:"")}function aC(t){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=t.options.footnoteBackContent||rC,l=t.options.footnoteBackLabel||iC,o=t.options.footnoteLabel||"Footnotes",c=t.options.footnoteLabelTagName||"h2",u=t.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let g=-1;for(;++g<t.footnoteOrder.length;){const p=t.footnoteById.get(t.footnoteOrder[g]);if(!p)continue;const v=t.all(p),y=String(p.identifier).toUpperCase(),S=Ji(y.toLowerCase());let x=0;const C=[],N=t.footnoteCounts.get(y);for(;N!==void 0&&++x<=N;){C.length>0&&C.push({type:"text",value:" "});let I=typeof i=="string"?i:i(g,x);typeof I=="string"&&(I={type:"text",value:I}),C.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+S+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(g,x),className:["data-footnote-backref"]},children:Array.isArray(I)?I:[I]})}const H=v[v.length-1];if(H&&H.type==="element"&&H.tagName==="p"){const I=H.children[H.children.length-1];I&&I.type==="text"?I.value+=" ":H.children.push({type:"text",value:" "}),H.children.push(...C)}else v.push(...C);const O={type:"element",tagName:"li",properties:{id:r+"fn-"+S},children:t.wrap(v,!0)};t.patch(p,O),h.push(O)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{..._s(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
19
|
-
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(h,!0)},{type:"text",value:`
|
|
20
|
-
`}]}}const Qs=(function(t){if(t==null)return uC;if(typeof t=="function")return Zs(t);if(typeof t=="object")return Array.isArray(t)?lC(t):sC(t);if(typeof t=="string")return oC(t);throw new Error("Expected function, string, or object as test")});function lC(t){const r=[];let i=-1;for(;++i<t.length;)r[i]=Qs(t[i]);return Zs(l);function l(...o){let c=-1;for(;++c<r.length;)if(r[c].apply(this,o))return!0;return!1}}function sC(t){const r=t;return Zs(i);function i(l){const o=l;let c;for(c in t)if(o[c]!==r[c])return!1;return!0}}function oC(t){return Zs(r);function r(i){return i&&i.type===t}}function Zs(t){return r;function r(i,l,o){return!!(cC(i)&&t.call(this,i,typeof l=="number"?l:void 0,o||void 0))}}function uC(){return!0}function cC(t){return t!==null&&typeof t=="object"&&"type"in t}const tv=[],dC=!0,Qc=!1,fC="skip";function nv(t,r,i,l){let o;typeof r=="function"&&typeof i!="function"?(l=i,i=r):o=r;const c=Qs(o),u=l?-1:1;h(t,void 0,[])();function h(g,p,v){const y=g&&typeof g=="object"?g:{};if(typeof y.type=="string"){const x=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(g.type+(x?"<"+x+">":""))+")"})}return S;function S(){let x=tv,C,N,H;if((!r||c(g,p,v[v.length-1]||void 0))&&(x=hC(i(g,v)),x[0]===Qc))return x;if("children"in g&&g.children){const O=g;if(O.children&&x[0]!==fC)for(N=(l?O.children.length:-1)+u,H=v.concat(O);N>-1&&N<O.children.length;){const I=O.children[N];if(C=h(I,N,H)(),C[0]===Qc)return C;N=typeof C[1]=="number"?C[1]:N+u}}return x}}}function hC(t){return Array.isArray(t)?t:typeof t=="number"?[dC,t]:t==null?tv:[t]}function wd(t,r,i,l){let o,c,u;typeof r=="function"&&typeof i!="function"?(c=void 0,u=r,o=i):(c=r,u=i,o=l),nv(t,c,h,o);function h(g,p){const v=p[p.length-1],y=v?v.children.indexOf(g):void 0;return u(g,y,v)}}const Zc={}.hasOwnProperty,mC={};function pC(t,r){const i=r||mC,l=new Map,o=new Map,c=new Map,u={...Jw,...i.handlers},h={all:p,applyData:yC,definitionById:l,footnoteById:o,footnoteCounts:c,footnoteOrder:[],handlers:u,one:g,options:i,patch:gC,wrap:bC};return wd(t,function(v){if(v.type==="definition"||v.type==="footnoteDefinition"){const y=v.type==="definition"?l:o,S=String(v.identifier).toUpperCase();y.has(S)||y.set(S,v)}}),h;function g(v,y){const S=v.type,x=h.handlers[S];if(Zc.call(h.handlers,S)&&x)return x(h,v,y);if(h.options.passThrough&&h.options.passThrough.includes(S)){if("children"in v){const{children:N,...H}=v,O=_s(H);return O.children=h.all(v),O}return _s(v)}return(h.options.unknownHandler||vC)(h,v,y)}function p(v){const y=[];if("children"in v){const S=v.children;let x=-1;for(;++x<S.length;){const C=h.one(S[x],v);if(C){if(x&&S[x-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=kg(C.value)),!Array.isArray(C)&&C.type==="element")){const N=C.children[0];N&&N.type==="text"&&(N.value=kg(N.value))}Array.isArray(C)?y.push(...C):y.push(C)}}}return y}}function gC(t,r){t.position&&(r.position=i0(t))}function yC(t,r){let i=r;if(t&&t.data){const l=t.data.hName,o=t.data.hChildren,c=t.data.hProperties;if(typeof l=="string")if(i.type==="element")i.tagName=l;else{const u="children"in i?i.children:[i];i={type:"element",tagName:l,properties:{},children:u}}i.type==="element"&&c&&Object.assign(i.properties,_s(c)),"children"in i&&i.children&&o!==null&&o!==void 0&&(i.children=o)}return i}function vC(t,r){const i=r.data||{},l="value"in r&&!(Zc.call(i,"hProperties")||Zc.call(i,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function bC(t,r){const i=[];let l=-1;for(r&&i.push({type:"text",value:`
|
|
21
|
-
`});++l<t.length;)l&&i.push({type:"text",value:`
|
|
22
|
-
`}),i.push(t[l]);return r&&t.length>0&&i.push({type:"text",value:`
|
|
23
|
-
`}),i}function kg(t){let r=0,i=t.charCodeAt(r);for(;i===9||i===32;)r++,i=t.charCodeAt(r);return t.slice(r)}function wg(t,r){const i=pC(t,r),l=i.one(t,void 0),o=aC(i),c=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return o&&c.children.push({type:"text",value:`
|
|
24
|
-
`},o),c}function xC(t,r){return t&&"run"in t?async function(i,l){const o=wg(i,{file:l,...r});await t.run(o,l)}:function(i,l){return wg(i,{file:l,...t||r})}}function Cg(t){if(t)throw t}var Tc,jg;function SC(){if(jg)return Tc;jg=1;var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):r.call(p)==="[object Array]"},c=function(p){if(!p||r.call(p)!=="[object Object]")return!1;var v=t.call(p,"constructor"),y=p.constructor&&p.constructor.prototype&&t.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!v&&!y)return!1;var S;for(S in p);return typeof S>"u"||t.call(p,S)},u=function(p,v){i&&v.name==="__proto__"?i(p,v.name,{enumerable:!0,configurable:!0,value:v.newValue,writable:!0}):p[v.name]=v.newValue},h=function(p,v){if(v==="__proto__")if(t.call(p,v)){if(l)return l(p,v).value}else return;return p[v]};return Tc=function g(){var p,v,y,S,x,C,N=arguments[0],H=1,O=arguments.length,I=!1;for(typeof N=="boolean"&&(I=N,N=arguments[1]||{},H=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});H<O;++H)if(p=arguments[H],p!=null)for(v in p)y=h(N,v),S=h(p,v),N!==S&&(I&&S&&(c(S)||(x=o(S)))?(x?(x=!1,C=y&&o(y)?y:[]):C=y&&c(y)?y:{},u(N,{name:v,newValue:g(I,C,S)})):typeof S<"u"&&u(N,{name:v,newValue:S}));return N},Tc}var kC=SC();const Ec=ad(kC);function Jc(t){if(typeof t!="object"||t===null)return!1;const r=Object.getPrototypeOf(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function wC(){const t=[],r={run:i,use:l};return r;function i(...o){let c=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);h(null,...o);function h(g,...p){const v=t[++c];let y=-1;if(g){u(g);return}for(;++y<o.length;)(p[y]===null||p[y]===void 0)&&(p[y]=o[y]);o=p,v?CC(v,h)(...p):u(null,...p)}}function l(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return t.push(o),r}}function CC(t,r){let i;return l;function l(...u){const h=t.length>u.length;let g;h&&u.push(o);try{g=t.apply(this,u)}catch(p){const v=p;if(h&&i)throw v;return o(v)}h||(g&&g.then&&typeof g.then=="function"?g.then(c,o):g instanceof Error?o(g):c(g))}function o(u,...h){i||(i=!0,r(u,...h))}function c(u){o(null,u)}}const In={basename:jC,dirname:RC,extname:TC,join:EC,sep:"/"};function jC(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');sl(t);let i=0,l=-1,o=t.length,c;if(r===void 0||r.length===0||r.length>t.length){for(;o--;)if(t.codePointAt(o)===47){if(c){i=o+1;break}}else l<0&&(c=!0,l=o+1);return l<0?"":t.slice(i,l)}if(r===t)return"";let u=-1,h=r.length-1;for(;o--;)if(t.codePointAt(o)===47){if(c){i=o+1;break}}else u<0&&(c=!0,u=o+1),h>-1&&(t.codePointAt(o)===r.codePointAt(h--)?h<0&&(l=o):(h=-1,l=u));return i===l?l=u:l<0&&(l=t.length),t.slice(i,l)}function RC(t){if(sl(t),t.length===0)return".";let r=-1,i=t.length,l;for(;--i;)if(t.codePointAt(i)===47){if(l){r=i;break}}else l||(l=!0);return r<0?t.codePointAt(0)===47?"/":".":r===1&&t.codePointAt(0)===47?"//":t.slice(0,r)}function TC(t){sl(t);let r=t.length,i=-1,l=0,o=-1,c=0,u;for(;r--;){const h=t.codePointAt(r);if(h===47){if(u){l=r+1;break}continue}i<0&&(u=!0,i=r+1),h===46?o<0?o=r:c!==1&&(c=1):o>-1&&(c=-1)}return o<0||i<0||c===0||c===1&&o===i-1&&o===l+1?"":t.slice(o,i)}function EC(...t){let r=-1,i;for(;++r<t.length;)sl(t[r]),t[r]&&(i=i===void 0?t[r]:i+"/"+t[r]);return i===void 0?".":NC(i)}function NC(t){sl(t);const r=t.codePointAt(0)===47;let i=AC(t,!r);return i.length===0&&!r&&(i="."),i.length>0&&t.codePointAt(t.length-1)===47&&(i+="/"),r?"/"+i:i}function AC(t,r){let i="",l=0,o=-1,c=0,u=-1,h,g;for(;++u<=t.length;){if(u<t.length)h=t.codePointAt(u);else{if(h===47)break;h=47}if(h===47){if(!(o===u-1||c===1))if(o!==u-1&&c===2){if(i.length<2||l!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(g=i.lastIndexOf("/"),g!==i.length-1){g<0?(i="",l=0):(i=i.slice(0,g),l=i.length-1-i.lastIndexOf("/")),o=u,c=0;continue}}else if(i.length>0){i="",l=0,o=u,c=0;continue}}r&&(i=i.length>0?i+"/..":"..",l=2)}else i.length>0?i+="/"+t.slice(o+1,u):i=t.slice(o+1,u),l=u-o-1;o=u,c=0}else h===46&&c>-1?c++:c=-1}return i}function sl(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const IC={cwd:DC};function DC(){return"/"}function Wc(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function OC(t){if(typeof t=="string")t=new URL(t);else if(!Wc(t)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(t.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return MC(t)}function MC(t){if(t.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=t.pathname;let i=-1;for(;++i<r.length;)if(r.codePointAt(i)===37&&r.codePointAt(i+1)===50){const l=r.codePointAt(i+2);if(l===70||l===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(r)}const Nc=["history","path","basename","stem","extname","dirname"];class rv{constructor(r){let i;r?Wc(r)?i={path:r}:typeof r=="string"||zC(r)?i={value:r}:i=r:i={},this.cwd="cwd"in i?"":IC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<Nc.length;){const c=Nc[l];c in i&&i[c]!==void 0&&i[c]!==null&&(this[c]=c==="history"?[...i[c]]:i[c])}let o;for(o in i)Nc.includes(o)||(this[o]=i[o])}get basename(){return typeof this.path=="string"?In.basename(this.path):void 0}set basename(r){Ic(r,"basename"),Ac(r,"basename"),this.path=In.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?In.dirname(this.path):void 0}set dirname(r){Rg(this.basename,"dirname"),this.path=In.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?In.extname(this.path):void 0}set extname(r){if(Ac(r,"extname"),Rg(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=In.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Wc(r)&&(r=OC(r)),Ic(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?In.basename(this.path,this.extname):void 0}set stem(r){Ic(r,"stem"),Ac(r,"stem"),this.path=In.join(this.dirname||"",r+(this.extname||""))}fail(r,i,l){const o=this.message(r,i,l);throw o.fatal=!0,o}info(r,i,l){const o=this.message(r,i,l);return o.fatal=void 0,o}message(r,i,l){const o=new zt(r,i,l);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Ac(t,r){if(t&&t.includes(In.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+In.sep+"`")}function Ic(t,r){if(!t)throw new Error("`"+r+"` cannot be empty")}function Rg(t,r){if(!t)throw new Error("Setting `"+r+"` requires `path` to be set too")}function zC(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const _C=(function(t){const l=this.constructor.prototype,o=l[t],c=function(){return o.apply(c,arguments)};return Object.setPrototypeOf(c,l),c}),LC={}.hasOwnProperty;class Cd extends _C{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wC()}copy(){const r=new Cd;let i=-1;for(;++i<this.attachers.length;){const l=this.attachers[i];r.use(...l)}return r.data(Ec(!0,{},this.namespace)),r}data(r,i){return typeof r=="string"?arguments.length===2?(Mc("data",this.frozen),this.namespace[r]=i,this):LC.call(this.namespace,r)&&this.namespace[r]||void 0:r?(Mc("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const o=i.call(r,...l);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const i=js(r),l=this.parser||this.Parser;return Dc("parse",l),l(String(i),i)}process(r,i){const l=this;return this.freeze(),Dc("process",this.parser||this.Parser),Oc("process",this.compiler||this.Compiler),i?o(void 0,i):new Promise(o);function o(c,u){const h=js(r),g=l.parse(h);l.run(g,h,function(v,y,S){if(v||!y||!S)return p(v);const x=y,C=l.stringify(x,S);UC(C)?S.value=C:S.result=C,p(v,S)});function p(v,y){v||!y?u(v):c?c(y):i(void 0,y)}}}processSync(r){let i=!1,l;return this.freeze(),Dc("processSync",this.parser||this.Parser),Oc("processSync",this.compiler||this.Compiler),this.process(r,o),Eg("processSync","process",i),l;function o(c,u){i=!0,Cg(c),l=u}}run(r,i,l){Tg(r),this.freeze();const o=this.transformers;return!l&&typeof i=="function"&&(l=i,i=void 0),l?c(void 0,l):new Promise(c);function c(u,h){const g=js(i);o.run(r,g,p);function p(v,y,S){const x=y||r;v?h(v):u?u(x):l(void 0,x,S)}}}runSync(r,i){let l=!1,o;return this.run(r,i,c),Eg("runSync","run",l),o;function c(u,h){Cg(u),o=h,l=!0}}stringify(r,i){this.freeze();const l=js(i),o=this.compiler||this.Compiler;return Oc("stringify",o),Tg(r),o(r,l)}use(r,...i){const l=this.attachers,o=this.namespace;if(Mc("use",this.frozen),r!=null)if(typeof r=="function")g(r,i);else if(typeof r=="object")Array.isArray(r)?h(r):u(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function c(p){if(typeof p=="function")g(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[v,...y]=p;g(v,y)}else u(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function u(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");h(p.plugins),p.settings&&(o.settings=Ec(!0,o.settings,p.settings))}function h(p){let v=-1;if(p!=null)if(Array.isArray(p))for(;++v<p.length;){const y=p[v];c(y)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function g(p,v){let y=-1,S=-1;for(;++y<l.length;)if(l[y][0]===p){S=y;break}if(S===-1)l.push([p,...v]);else if(v.length>0){let[x,...C]=v;const N=l[S][1];Jc(N)&&Jc(x)&&(x=Ec(!0,N,x)),l[S]=[p,x,...C]}}}}const BC=new Cd().freeze();function Dc(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Oc(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Mc(t,r){if(r)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Tg(t){if(!Jc(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Eg(t,r,i){if(!i)throw new Error("`"+t+"` finished async. Use `"+r+"` instead")}function js(t){return HC(t)?t:new rv(t)}function HC(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function UC(t){return typeof t=="string"||qC(t)}function qC(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const GC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ng=[],Ag={allowDangerousHtml:!0},$C=/^(https?|ircs?|mailto|xmpp)$/i,FC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function VC(t){const r=YC(t),i=PC(t);return KC(r.runSync(r.parse(i),i),t)}function YC(t){const r=t.rehypePlugins||Ng,i=t.remarkPlugins||Ng,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Ag}:Ag;return BC().use(Rw).use(i).use(xC,l).use(r)}function PC(t){const r=t.children||"",i=new rv;return typeof r=="string"&&(i.value=r),i}function KC(t,r){const i=r.allowedElements,l=r.allowElement,o=r.components,c=r.disallowedElements,u=r.skipHtml,h=r.unwrapDisallowed,g=r.urlTransform||XC;for(const v of FC)Object.hasOwn(r,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+GC+v.id,void 0);return wd(t,p),u0(t,{Fragment:d.Fragment,components:o,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function p(v,y,S){if(v.type==="raw"&&S&&typeof y=="number")return u?S.children.splice(y,1):S.children[y]={type:"text",value:v.value},y;if(v.type==="element"){let x;for(x in Cc)if(Object.hasOwn(Cc,x)&&Object.hasOwn(v.properties,x)){const C=v.properties[x],N=Cc[x];(N===null||N.includes(v.tagName))&&(v.properties[x]=g(String(C||""),x,v))}}if(v.type==="element"){let x=i?!i.includes(v.tagName):c?c.includes(v.tagName):!1;if(!x&&l&&typeof y=="number"&&(x=!l(v,y,S)),x&&S&&typeof y=="number")return h&&v.children?S.children.splice(y,1,...v.children):S.children.splice(y,1),y}}}function XC(t){const r=t.indexOf(":"),i=t.indexOf("?"),l=t.indexOf("#"),o=t.indexOf("/");return r===-1||o!==-1&&r>o||i!==-1&&r>i||l!==-1&&r>l||$C.test(t.slice(0,r))?t:""}function Ig(t,r){const i=String(t);if(typeof r!="string")throw new TypeError("Expected character");let l=0,o=i.indexOf(r);for(;o!==-1;)l++,o=i.indexOf(r,o+r.length);return l}function QC(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ZC(t,r,i){const o=Qs((i||{}).ignore||[]),c=JC(r);let u=-1;for(;++u<c.length;)nv(t,"text",h);function h(p,v){let y=-1,S;for(;++y<v.length;){const x=v[y],C=S?S.children:void 0;if(o(x,C?C.indexOf(x):void 0,S))return;S=x}if(S)return g(p,v)}function g(p,v){const y=v[v.length-1],S=c[u][0],x=c[u][1];let C=0;const H=y.children.indexOf(p);let O=!1,I=[];S.lastIndex=0;let A=S.exec(p.value);for(;A;){const F=A.index,W={index:A.index,input:A.input,stack:[...v,p]};let w=x(...A,W);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?S.lastIndex=F+1:(C!==F&&I.push({type:"text",value:p.value.slice(C,F)}),Array.isArray(w)?I.push(...w):w&&I.push(w),C=F+A[0].length,O=!0),!S.global)break;A=S.exec(p.value)}return O?(C<p.value.length&&I.push({type:"text",value:p.value.slice(C)}),y.children.splice(H,1,...I)):I=[p],H+I.length}}function JC(t){const r=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!t[0]||Array.isArray(t[0])?t:[t];let l=-1;for(;++l<i.length;){const o=i[l];r.push([WC(o[0]),ej(o[1])])}return r}function WC(t){return typeof t=="string"?new RegExp(QC(t),"g"):t}function ej(t){return typeof t=="function"?t:function(){return t}}const zc="phrasing",_c=["autolink","link","image","label"];function tj(){return{transforms:[oj],enter:{literalAutolink:rj,literalAutolinkEmail:Lc,literalAutolinkHttp:Lc,literalAutolinkWww:Lc},exit:{literalAutolink:sj,literalAutolinkEmail:lj,literalAutolinkHttp:ij,literalAutolinkWww:aj}}}function nj(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zc,notInConstruct:_c},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zc,notInConstruct:_c},{character:":",before:"[ps]",after:"\\/",inConstruct:zc,notInConstruct:_c}]}}function rj(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Lc(t){this.config.enter.autolinkProtocol.call(this,t)}function ij(t){this.config.exit.autolinkProtocol.call(this,t)}function aj(t){this.config.exit.data.call(this,t);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(t)}function lj(t){this.config.exit.autolinkEmail.call(this,t)}function sj(t){this.exit(t)}function oj(t){ZC(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,uj],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),cj]],{ignore:["link","linkReference"]})}function uj(t,r,i,l,o){let c="";if(!iv(o)||(/^w/i.test(r)&&(i=r+i,r="",c="http://"),!dj(i)))return!1;const u=fj(i+l);if(!u[0])return!1;const h={type:"link",title:null,url:c+r+u[0],children:[{type:"text",value:r+u[0]}]};return u[1]?[h,{type:"text",value:u[1]}]:h}function cj(t,r,i,l){return!iv(l,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+i,children:[{type:"text",value:r+"@"+i}]}}function dj(t){const r=t.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function fj(t){const r=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!r)return[t,void 0];t=t.slice(0,r.index);let i=r[0],l=i.indexOf(")");const o=Ig(t,"(");let c=Ig(t,")");for(;l!==-1&&o>c;)t+=i.slice(0,l+1),i=i.slice(l+1),l=i.indexOf(")"),c++;return[t,i]}function iv(t,r){const i=t.input.charCodeAt(t.index-1);return(t.index===0||ni(i)||Ps(i))&&(!r||i!==47)}av.peek=Sj;function hj(){this.buffer()}function mj(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function pj(){this.buffer()}function gj(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function yj(t){const r=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Cn(this.sliceSerialize(t)).toLowerCase(),i.label=r}function vj(t){this.exit(t)}function bj(t){const r=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Cn(this.sliceSerialize(t)).toLowerCase(),i.label=r}function xj(t){this.exit(t)}function Sj(){return"["}function av(t,r,i,l){const o=i.createTracker(l);let c=o.move("[^");const u=i.enter("footnoteReference"),h=i.enter("reference");return c+=o.move(i.safe(i.associationId(t),{after:"]",before:c})),h(),u(),c+=o.move("]"),c}function kj(){return{enter:{gfmFootnoteCallString:hj,gfmFootnoteCall:mj,gfmFootnoteDefinitionLabelString:pj,gfmFootnoteDefinition:gj},exit:{gfmFootnoteCallString:yj,gfmFootnoteCall:vj,gfmFootnoteDefinitionLabelString:bj,gfmFootnoteDefinition:xj}}}function wj(t){let r=!1;return t&&t.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:i,footnoteReference:av},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(l,o,c,u){const h=c.createTracker(u);let g=h.move("[^");const p=c.enter("footnoteDefinition"),v=c.enter("label");return g+=h.move(c.safe(c.associationId(l),{before:g,after:"]"})),v(),g+=h.move("]:"),l.children&&l.children.length>0&&(h.shift(4),g+=h.move((r?`
|
|
25
|
-
`:" ")+c.indentLines(c.containerFlow(l,h.current()),r?lv:Cj))),p(),g}}function Cj(t,r,i){return r===0?t:lv(t,r,i)}function lv(t,r,i){return(i?"":" ")+t}const jj=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];sv.peek=Aj;function Rj(){return{canContainEols:["delete"],enter:{strikethrough:Ej},exit:{strikethrough:Nj}}}function Tj(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:jj}],handlers:{delete:sv}}}function Ej(t){this.enter({type:"delete",children:[]},t)}function Nj(t){this.exit(t)}function sv(t,r,i,l){const o=i.createTracker(l),c=i.enter("strikethrough");let u=o.move("~~");return u+=i.containerPhrasing(t,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),c(),u}function Aj(){return"~"}function Ij(t){return t.length}function Dj(t,r){const i=r||{},l=(i.align||[]).concat(),o=i.stringLength||Ij,c=[],u=[],h=[],g=[];let p=0,v=-1;for(;++v<t.length;){const N=[],H=[];let O=-1;for(t[v].length>p&&(p=t[v].length);++O<t[v].length;){const I=Oj(t[v][O]);if(i.alignDelimiters!==!1){const A=o(I);H[O]=A,(g[O]===void 0||A>g[O])&&(g[O]=A)}N.push(I)}u[v]=N,h[v]=H}let y=-1;if(typeof l=="object"&&"length"in l)for(;++y<p;)c[y]=Dg(l[y]);else{const N=Dg(l);for(;++y<p;)c[y]=N}y=-1;const S=[],x=[];for(;++y<p;){const N=c[y];let H="",O="";N===99?(H=":",O=":"):N===108?H=":":N===114&&(O=":");let I=i.alignDelimiters===!1?1:Math.max(1,g[y]-H.length-O.length);const A=H+"-".repeat(I)+O;i.alignDelimiters!==!1&&(I=H.length+I+O.length,I>g[y]&&(g[y]=I),x[y]=I),S[y]=A}u.splice(1,0,S),h.splice(1,0,x),v=-1;const C=[];for(;++v<u.length;){const N=u[v],H=h[v];y=-1;const O=[];for(;++y<p;){const I=N[y]||"";let A="",F="";if(i.alignDelimiters!==!1){const W=g[y]-(H[y]||0),w=c[y];w===114?A=" ".repeat(W):w===99?W%2?(A=" ".repeat(W/2+.5),F=" ".repeat(W/2-.5)):(A=" ".repeat(W/2),F=A):F=" ".repeat(W)}i.delimiterStart!==!1&&!y&&O.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&I==="")&&(i.delimiterStart!==!1||y)&&O.push(" "),i.alignDelimiters!==!1&&O.push(A),O.push(I),i.alignDelimiters!==!1&&O.push(F),i.padding!==!1&&O.push(" "),(i.delimiterEnd!==!1||y!==p-1)&&O.push("|")}C.push(i.delimiterEnd===!1?O.join("").replace(/ +$/,""):O.join(""))}return C.join(`
|
|
26
|
-
`)}function Oj(t){return t==null?"":String(t)}function Dg(t){const r=typeof t=="string"?t.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function Mj(t,r,i,l){const o=i.enter("blockquote"),c=i.createTracker(l);c.move("> "),c.shift(2);const u=i.indentLines(i.containerFlow(t,c.current()),zj);return o(),u}function zj(t,r,i){return">"+(i?"":" ")+t}function _j(t,r){return Og(t,r.inConstruct,!0)&&!Og(t,r.notInConstruct,!1)}function Og(t,r,i){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return i;let l=-1;for(;++l<r.length;)if(t.includes(r[l]))return!0;return!1}function Mg(t,r,i,l){let o=-1;for(;++o<i.unsafe.length;)if(i.unsafe[o].character===`
|
|
27
|
-
`&&_j(i.stack,i.unsafe[o]))return/[ \t]/.test(l.before)?"":" ";return`\\
|
|
28
|
-
`}function Lj(t,r){const i=String(t);let l=i.indexOf(r),o=l,c=0,u=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===o?++c>u&&(u=c):c=1,o=l+r.length,l=i.indexOf(r,o);return u}function Bj(t,r){return!!(r.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Hj(t){const r=t.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function Uj(t,r,i,l){const o=Hj(i),c=t.value||"",u=o==="`"?"GraveAccent":"Tilde";if(Bj(t,i)){const y=i.enter("codeIndented"),S=i.indentLines(c,qj);return y(),S}const h=i.createTracker(l),g=o.repeat(Math.max(Lj(c,o)+1,3)),p=i.enter("codeFenced");let v=h.move(g);if(t.lang){const y=i.enter(`codeFencedLang${u}`);v+=h.move(i.safe(t.lang,{before:v,after:" ",encode:["`"],...h.current()})),y()}if(t.lang&&t.meta){const y=i.enter(`codeFencedMeta${u}`);v+=h.move(" "),v+=h.move(i.safe(t.meta,{before:v,after:`
|
|
29
|
-
`,encode:["`"],...h.current()})),y()}return v+=h.move(`
|
|
30
|
-
`),c&&(v+=h.move(c+`
|
|
31
|
-
`)),v+=h.move(g),p(),v}function qj(t,r,i){return(i?"":" ")+t}function jd(t){const r=t.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function Gj(t,r,i,l){const o=jd(i),c=o==='"'?"Quote":"Apostrophe",u=i.enter("definition");let h=i.enter("label");const g=i.createTracker(l);let p=g.move("[");return p+=g.move(i.safe(i.associationId(t),{before:p,after:"]",...g.current()})),p+=g.move("]: "),h(),!t.url||/[\0- \u007F]/.test(t.url)?(h=i.enter("destinationLiteral"),p+=g.move("<"),p+=g.move(i.safe(t.url,{before:p,after:">",...g.current()})),p+=g.move(">")):(h=i.enter("destinationRaw"),p+=g.move(i.safe(t.url,{before:p,after:t.title?" ":`
|
|
32
|
-
`,...g.current()}))),h(),t.title&&(h=i.enter(`title${c}`),p+=g.move(" "+o),p+=g.move(i.safe(t.title,{before:p,after:o,...g.current()})),p+=g.move(o),h()),u(),p}function $j(t){const r=t.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function il(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Ls(t,r,i){const l=Xi(t),o=Xi(r);return l===void 0?o===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ov.peek=Fj;function ov(t,r,i,l){const o=$j(i),c=i.enter("emphasis"),u=i.createTracker(l),h=u.move(o);let g=u.move(i.containerPhrasing(t,{after:o,before:h,...u.current()}));const p=g.charCodeAt(0),v=Ls(l.before.charCodeAt(l.before.length-1),p,o);v.inside&&(g=il(p)+g.slice(1));const y=g.charCodeAt(g.length-1),S=Ls(l.after.charCodeAt(0),y,o);S.inside&&(g=g.slice(0,-1)+il(y));const x=u.move(o);return c(),i.attentionEncodeSurroundingInfo={after:S.outside,before:v.outside},h+g+x}function Fj(t,r,i){return i.options.emphasis||"*"}function Vj(t,r){let i=!1;return wd(t,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return i=!0,Qc}),!!((!t.depth||t.depth<3)&&gd(t)&&(r.options.setext||i))}function Yj(t,r,i,l){const o=Math.max(Math.min(6,t.depth||1),1),c=i.createTracker(l);if(Vj(t,i)){const v=i.enter("headingSetext"),y=i.enter("phrasing"),S=i.containerPhrasing(t,{...c.current(),before:`
|
|
33
|
-
`,after:`
|
|
34
|
-
`});return y(),v(),S+`
|
|
35
|
-
`+(o===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
|
|
36
|
-
`))+1))}const u="#".repeat(o),h=i.enter("headingAtx"),g=i.enter("phrasing");c.move(u+" ");let p=i.containerPhrasing(t,{before:"# ",after:`
|
|
37
|
-
`,...c.current()});return/^[\t ]/.test(p)&&(p=il(p.charCodeAt(0))+p.slice(1)),p=p?u+" "+p:u,i.options.closeAtx&&(p+=" "+u),g(),h(),p}uv.peek=Pj;function uv(t){return t.value||""}function Pj(){return"<"}cv.peek=Kj;function cv(t,r,i,l){const o=jd(i),c=o==='"'?"Quote":"Apostrophe",u=i.enter("image");let h=i.enter("label");const g=i.createTracker(l);let p=g.move("![");return p+=g.move(i.safe(t.alt,{before:p,after:"]",...g.current()})),p+=g.move("]("),h(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(h=i.enter("destinationLiteral"),p+=g.move("<"),p+=g.move(i.safe(t.url,{before:p,after:">",...g.current()})),p+=g.move(">")):(h=i.enter("destinationRaw"),p+=g.move(i.safe(t.url,{before:p,after:t.title?" ":")",...g.current()}))),h(),t.title&&(h=i.enter(`title${c}`),p+=g.move(" "+o),p+=g.move(i.safe(t.title,{before:p,after:o,...g.current()})),p+=g.move(o),h()),p+=g.move(")"),u(),p}function Kj(){return"!"}dv.peek=Xj;function dv(t,r,i,l){const o=t.referenceType,c=i.enter("imageReference");let u=i.enter("label");const h=i.createTracker(l);let g=h.move("![");const p=i.safe(t.alt,{before:g,after:"]",...h.current()});g+=h.move(p+"]["),u();const v=i.stack;i.stack=[],u=i.enter("reference");const y=i.safe(i.associationId(t),{before:g,after:"]",...h.current()});return u(),i.stack=v,c(),o==="full"||!p||p!==y?g+=h.move(y+"]"):o==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function Xj(){return"!"}fv.peek=Qj;function fv(t,r,i){let l=t.value||"",o="`",c=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(l);)o+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++c<i.unsafe.length;){const u=i.unsafe[c],h=i.compilePattern(u);let g;if(u.atBreak)for(;g=h.exec(l);){let p=g.index;l.charCodeAt(p)===10&&l.charCodeAt(p-1)===13&&p--,l=l.slice(0,p)+" "+l.slice(g.index+1)}}return o+l+o}function Qj(){return"`"}function hv(t,r){const i=gd(t);return!!(!r.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(i===t.url||"mailto:"+i===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}mv.peek=Zj;function mv(t,r,i,l){const o=jd(i),c=o==='"'?"Quote":"Apostrophe",u=i.createTracker(l);let h,g;if(hv(t,i)){const v=i.stack;i.stack=[],h=i.enter("autolink");let y=u.move("<");return y+=u.move(i.containerPhrasing(t,{before:y,after:">",...u.current()})),y+=u.move(">"),h(),i.stack=v,y}h=i.enter("link"),g=i.enter("label");let p=u.move("[");return p+=u.move(i.containerPhrasing(t,{before:p,after:"](",...u.current()})),p+=u.move("]("),g(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(g=i.enter("destinationLiteral"),p+=u.move("<"),p+=u.move(i.safe(t.url,{before:p,after:">",...u.current()})),p+=u.move(">")):(g=i.enter("destinationRaw"),p+=u.move(i.safe(t.url,{before:p,after:t.title?" ":")",...u.current()}))),g(),t.title&&(g=i.enter(`title${c}`),p+=u.move(" "+o),p+=u.move(i.safe(t.title,{before:p,after:o,...u.current()})),p+=u.move(o),g()),p+=u.move(")"),h(),p}function Zj(t,r,i){return hv(t,i)?"<":"["}pv.peek=Jj;function pv(t,r,i,l){const o=t.referenceType,c=i.enter("linkReference");let u=i.enter("label");const h=i.createTracker(l);let g=h.move("[");const p=i.containerPhrasing(t,{before:g,after:"]",...h.current()});g+=h.move(p+"]["),u();const v=i.stack;i.stack=[],u=i.enter("reference");const y=i.safe(i.associationId(t),{before:g,after:"]",...h.current()});return u(),i.stack=v,c(),o==="full"||!p||p!==y?g+=h.move(y+"]"):o==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function Jj(){return"["}function Rd(t){const r=t.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function Wj(t){const r=Rd(t),i=t.options.bulletOther;if(!i)return r==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+i+"`) to be different");return i}function eR(t){const r=t.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function gv(t){const r=t.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function tR(t,r,i,l){const o=i.enter("list"),c=i.bulletCurrent;let u=t.ordered?eR(i):Rd(i);const h=t.ordered?u==="."?")":".":Wj(i);let g=r&&i.bulletLastUsed?u===i.bulletLastUsed:!1;if(!t.ordered){const v=t.children?t.children[0]:void 0;if((u==="*"||u==="-")&&v&&(!v.children||!v.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(g=!0),gv(i)===u&&v){let y=-1;for(;++y<t.children.length;){const S=t.children[y];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(u=h),i.bulletCurrent=u;const p=i.containerFlow(t,l);return i.bulletLastUsed=u,i.bulletCurrent=c,o(),p}function nR(t){const r=t.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function rR(t,r,i,l){const o=nR(i);let c=i.bulletCurrent||Rd(i);r&&r.type==="list"&&r.ordered&&(c=(typeof r.start=="number"&&r.start>-1?r.start:1)+(i.options.incrementListMarker===!1?0:r.children.indexOf(t))+c);let u=c.length+1;(o==="tab"||o==="mixed"&&(r&&r.type==="list"&&r.spread||t.spread))&&(u=Math.ceil(u/4)*4);const h=i.createTracker(l);h.move(c+" ".repeat(u-c.length)),h.shift(u);const g=i.enter("listItem"),p=i.indentLines(i.containerFlow(t,h.current()),v);return g(),p;function v(y,S,x){return S?(x?"":" ".repeat(u))+y:(x?c:c+" ".repeat(u-c.length))+y}}function iR(t,r,i,l){const o=i.enter("paragraph"),c=i.enter("phrasing"),u=i.containerPhrasing(t,l);return c(),o(),u}const aR=Qs(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function lR(t,r,i,l){return(t.children.some(function(u){return aR(u)})?i.containerPhrasing:i.containerFlow).call(i,t,l)}function sR(t){const r=t.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}yv.peek=oR;function yv(t,r,i,l){const o=sR(i),c=i.enter("strong"),u=i.createTracker(l),h=u.move(o+o);let g=u.move(i.containerPhrasing(t,{after:o,before:h,...u.current()}));const p=g.charCodeAt(0),v=Ls(l.before.charCodeAt(l.before.length-1),p,o);v.inside&&(g=il(p)+g.slice(1));const y=g.charCodeAt(g.length-1),S=Ls(l.after.charCodeAt(0),y,o);S.inside&&(g=g.slice(0,-1)+il(y));const x=u.move(o+o);return c(),i.attentionEncodeSurroundingInfo={after:S.outside,before:v.outside},h+g+x}function oR(t,r,i){return i.options.strong||"*"}function uR(t,r,i,l){return i.safe(t.value,l)}function cR(t){const r=t.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function dR(t,r,i){const l=(gv(i)+(i.options.ruleSpaces?" ":"")).repeat(cR(i));return i.options.ruleSpaces?l.slice(0,-1):l}const vv={blockquote:Mj,break:Mg,code:Uj,definition:Gj,emphasis:ov,hardBreak:Mg,heading:Yj,html:uv,image:cv,imageReference:dv,inlineCode:fv,link:mv,linkReference:pv,list:tR,listItem:rR,paragraph:iR,root:lR,strong:yv,text:uR,thematicBreak:dR};function fR(){return{enter:{table:hR,tableData:zg,tableHeader:zg,tableRow:pR},exit:{codeText:gR,table:mR,tableData:Bc,tableHeader:Bc,tableRow:Bc}}}function hR(t){const r=t._align;this.enter({type:"table",align:r.map(function(i){return i==="none"?null:i}),children:[]},t),this.data.inTable=!0}function mR(t){this.exit(t),this.data.inTable=void 0}function pR(t){this.enter({type:"tableRow",children:[]},t)}function Bc(t){this.exit(t)}function zg(t){this.enter({type:"tableCell",children:[]},t)}function gR(t){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,yR));const i=this.stack[this.stack.length-1];i.type,i.value=r,this.exit(t)}function yR(t,r){return r==="|"?r:t}function vR(t){const r=t||{},i=r.tableCellPadding,l=r.tablePipeAlign,o=r.stringLength,c=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
38
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:u,tableCell:g,tableRow:h}};function u(x,C,N,H){return p(v(x,N,H),x.align)}function h(x,C,N,H){const O=y(x,N,H),I=p([O]);return I.slice(0,I.indexOf(`
|
|
39
|
-
`))}function g(x,C,N,H){const O=N.enter("tableCell"),I=N.enter("phrasing"),A=N.containerPhrasing(x,{...H,before:c,after:c});return I(),O(),A}function p(x,C){return Dj(x,{align:C,alignDelimiters:l,padding:i,stringLength:o})}function v(x,C,N){const H=x.children;let O=-1;const I=[],A=C.enter("table");for(;++O<H.length;)I[O]=y(H[O],C,N);return A(),I}function y(x,C,N){const H=x.children;let O=-1;const I=[],A=C.enter("tableRow");for(;++O<H.length;)I[O]=g(H[O],x,C,N);return A(),I}function S(x,C,N){let H=vv.inlineCode(x,C,N);return N.stack.includes("tableCell")&&(H=H.replace(/\|/g,"\\$&")),H}}function bR(){return{exit:{taskListCheckValueChecked:_g,taskListCheckValueUnchecked:_g,paragraph:SR}}}function xR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:kR}}}function _g(t){const r=this.stack[this.stack.length-2];r.type,r.checked=t.type==="taskListCheckValueChecked"}function SR(t){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const l=i.children[0];if(l&&l.type==="text"){const o=r.children;let c=-1,u;for(;++c<o.length;){const h=o[c];if(h.type==="paragraph"){u=h;break}}u===i&&(l.value=l.value.slice(1),l.value.length===0?i.children.shift():i.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,i.position.start=Object.assign({},l.position.start)))}}this.exit(t)}function kR(t,r,i,l){const o=t.children[0],c=typeof t.checked=="boolean"&&o&&o.type==="paragraph",u="["+(t.checked?"x":" ")+"] ",h=i.createTracker(l);c&&h.move(u);let g=vv.listItem(t,r,i,{...l,...h.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),g;function p(v){return v+u}}function wR(){return[tj(),kj(),Rj(),fR(),bR()]}function CR(t){return{extensions:[nj(),wj(t),Tj(),vR(t),xR()]}}const jR={tokenize:IR,partial:!0},bv={tokenize:DR,partial:!0},xv={tokenize:OR,partial:!0},Sv={tokenize:MR,partial:!0},RR={tokenize:zR,partial:!0},kv={name:"wwwAutolink",tokenize:NR,previous:Cv},wv={name:"protocolAutolink",tokenize:AR,previous:jv},er={name:"emailAutolink",tokenize:ER,previous:Rv},Dn={};function TR(){return{text:Dn}}let Qr=48;for(;Qr<123;)Dn[Qr]=er,Qr++,Qr===58?Qr=65:Qr===91&&(Qr=97);Dn[43]=er;Dn[45]=er;Dn[46]=er;Dn[95]=er;Dn[72]=[er,wv];Dn[104]=[er,wv];Dn[87]=[er,kv];Dn[119]=[er,kv];function ER(t,r,i){const l=this;let o,c;return u;function u(y){return!ed(y)||!Rv.call(l,l.previous)||Td(l.events)?i(y):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),h(y))}function h(y){return ed(y)?(t.consume(y),h):y===64?(t.consume(y),g):i(y)}function g(y){return y===46?t.check(RR,v,p)(y):y===45||y===95||Mt(y)?(c=!0,t.consume(y),g):v(y)}function p(y){return t.consume(y),o=!0,g}function v(y){return c&&o&&Lt(l.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),r(y)):i(y)}}function NR(t,r,i){const l=this;return o;function o(u){return u!==87&&u!==119||!Cv.call(l,l.previous)||Td(l.events)?i(u):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(jR,t.attempt(bv,t.attempt(xv,c),i),i)(u))}function c(u){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),r(u)}}function AR(t,r,i){const l=this;let o="",c=!1;return u;function u(y){return(y===72||y===104)&&jv.call(l,l.previous)&&!Td(l.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(y),t.consume(y),h):i(y)}function h(y){if(Lt(y)&&o.length<5)return o+=String.fromCodePoint(y),t.consume(y),h;if(y===58){const S=o.toLowerCase();if(S==="http"||S==="https")return t.consume(y),g}return i(y)}function g(y){return y===47?(t.consume(y),c?p:(c=!0,g)):i(y)}function p(y){return y===null||Ms(y)||rt(y)||ni(y)||Ps(y)?i(y):t.attempt(bv,t.attempt(xv,v),i)(y)}function v(y){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),r(y)}}function IR(t,r,i){let l=0;return o;function o(u){return(u===87||u===119)&&l<3?(l++,t.consume(u),o):u===46&&l===3?(t.consume(u),c):i(u)}function c(u){return u===null?i(u):r(u)}}function DR(t,r,i){let l,o,c;return u;function u(p){return p===46||p===95?t.check(Sv,g,h)(p):p===null||rt(p)||ni(p)||p!==45&&Ps(p)?g(p):(c=!0,t.consume(p),u)}function h(p){return p===95?l=!0:(o=l,l=void 0),t.consume(p),u}function g(p){return o||l||!c?i(p):r(p)}}function OR(t,r){let i=0,l=0;return o;function o(u){return u===40?(i++,t.consume(u),o):u===41&&l<i?c(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?t.check(Sv,r,c)(u):u===null||rt(u)||ni(u)?r(u):(t.consume(u),o)}function c(u){return u===41&&l++,t.consume(u),o}}function MR(t,r,i){return l;function l(h){return h===33||h===34||h===39||h===41||h===42||h===44||h===46||h===58||h===59||h===63||h===95||h===126?(t.consume(h),l):h===38?(t.consume(h),c):h===93?(t.consume(h),o):h===60||h===null||rt(h)||ni(h)?r(h):i(h)}function o(h){return h===null||h===40||h===91||rt(h)||ni(h)?r(h):l(h)}function c(h){return Lt(h)?u(h):i(h)}function u(h){return h===59?(t.consume(h),l):Lt(h)?(t.consume(h),u):i(h)}}function zR(t,r,i){return l;function l(c){return t.consume(c),o}function o(c){return Mt(c)?i(c):r(c)}}function Cv(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||rt(t)}function jv(t){return!Lt(t)}function Rv(t){return!(t===47||ed(t))}function ed(t){return t===43||t===45||t===46||t===95||Mt(t)}function Td(t){let r=t.length,i=!1;for(;r--;){const l=t[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){i=!0;break}if(l._gfmAutolinkLiteralWalkedInto){i=!1;break}}return t.length>0&&!i&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const _R={tokenize:FR,partial:!0};function LR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:qR,continuation:{tokenize:GR},exit:$R}},text:{91:{name:"gfmFootnoteCall",tokenize:UR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:BR,resolveTo:HR}}}}function BR(t,r,i){const l=this;let o=l.events.length;const c=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u;for(;o--;){const g=l.events[o][1];if(g.type==="labelImage"){u=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return h;function h(g){if(!u||!u._balanced)return i(g);const p=Cn(l.sliceSerialize({start:u.end,end:l.now()}));return p.codePointAt(0)!==94||!c.includes(p.slice(1))?i(g):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),r(g))}}function HR(t,r){let i=t.length;for(;i--;)if(t[i][1].type==="labelImage"&&t[i][0]==="enter"){t[i][1];break}t[i+1][1].type="data",t[i+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},t[i+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[i+3][1].end),end:Object.assign({},t[i+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},h=[t[i+1],t[i+2],["enter",l,r],t[i+3],t[i+4],["enter",o,r],["exit",o,r],["enter",c,r],["enter",u,r],["exit",u,r],["exit",c,r],t[t.length-2],t[t.length-1],["exit",l,r]];return t.splice(i,t.length-i+1,...h),t}function UR(t,r,i){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c=0,u;return h;function h(y){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(y),t.exit("gfmFootnoteCallLabelMarker"),g}function g(y){return y!==94?i(y):(t.enter("gfmFootnoteCallMarker"),t.consume(y),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",p)}function p(y){if(c>999||y===93&&!u||y===null||y===91||rt(y))return i(y);if(y===93){t.exit("chunkString");const S=t.exit("gfmFootnoteCallString");return o.includes(Cn(l.sliceSerialize(S)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(y),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),r):i(y)}return rt(y)||(u=!0),c++,t.consume(y),y===92?v:p}function v(y){return y===91||y===92||y===93?(t.consume(y),c++,p):p(y)}}function qR(t,r,i){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c,u=0,h;return g;function g(C){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(C){return C===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",v):i(C)}function v(C){if(u>999||C===93&&!h||C===null||C===91||rt(C))return i(C);if(C===93){t.exit("chunkString");const N=t.exit("gfmFootnoteDefinitionLabelString");return c=Cn(l.sliceSerialize(N)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),S}return rt(C)||(h=!0),u++,t.consume(C),C===92?y:v}function y(C){return C===91||C===92||C===93?(t.consume(C),u++,v):v(C)}function S(C){return C===58?(t.enter("definitionMarker"),t.consume(C),t.exit("definitionMarker"),o.includes(c)||o.push(c),Ue(t,x,"gfmFootnoteDefinitionWhitespace")):i(C)}function x(C){return r(C)}}function GR(t,r,i){return t.check(ll,r,t.attempt(_R,r,i))}function $R(t){t.exit("gfmFootnoteDefinition")}function FR(t,r,i){const l=this;return Ue(t,o,"gfmFootnoteDefinitionIndent",5);function o(c){const u=l.events[l.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?r(c):i(c)}}function VR(t){let i=(t||{}).singleTilde;const l={name:"strikethrough",tokenize:c,resolveAll:o};return i==null&&(i=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function o(u,h){let g=-1;for(;++g<u.length;)if(u[g][0]==="enter"&&u[g][1].type==="strikethroughSequenceTemporary"&&u[g][1]._close){let p=g;for(;p--;)if(u[p][0]==="exit"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._open&&u[g][1].end.offset-u[g][1].start.offset===u[p][1].end.offset-u[p][1].start.offset){u[g][1].type="strikethroughSequence",u[p][1].type="strikethroughSequence";const v={type:"strikethrough",start:Object.assign({},u[p][1].start),end:Object.assign({},u[g][1].end)},y={type:"strikethroughText",start:Object.assign({},u[p][1].end),end:Object.assign({},u[g][1].start)},S=[["enter",v,h],["enter",u[p][1],h],["exit",u[p][1],h],["enter",y,h]],x=h.parser.constructs.insideSpan.null;x&&ln(S,S.length,0,Ks(x,u.slice(p+1,g),h)),ln(S,S.length,0,[["exit",y,h],["enter",u[g][1],h],["exit",u[g][1],h],["exit",v,h]]),ln(u,p-1,g-p+3,S),g=p+S.length-2;break}}for(g=-1;++g<u.length;)u[g][1].type==="strikethroughSequenceTemporary"&&(u[g][1].type="data");return u}function c(u,h,g){const p=this.previous,v=this.events;let y=0;return S;function S(C){return p===126&&v[v.length-1][1].type!=="characterEscape"?g(C):(u.enter("strikethroughSequenceTemporary"),x(C))}function x(C){const N=Xi(p);if(C===126)return y>1?g(C):(u.consume(C),y++,x);if(y<2&&!i)return g(C);const H=u.exit("strikethroughSequenceTemporary"),O=Xi(C);return H._open=!O||O===2&&!!N,H._close=!N||N===2&&!!O,h(C)}}}class YR{constructor(){this.map=[]}add(r,i,l){PR(this,r,i,l)}consume(r){if(this.map.sort(function(c,u){return c[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const l=[];for(;i>0;)i-=1,l.push(r.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),r.length=this.map[i][0];l.push(r.slice()),r.length=0;let o=l.pop();for(;o;){for(const c of o)r.push(c);o=l.pop()}this.map.length=0}}function PR(t,r,i,l){let o=0;if(!(i===0&&l.length===0)){for(;o<t.map.length;){if(t.map[o][0]===r){t.map[o][1]+=i,t.map[o][2].push(...l);return}o+=1}t.map.push([r,i,l])}}function KR(t,r){let i=!1;const l=[];for(;r<t.length;){const o=t[r];if(i){if(o[0]==="enter")o[1].type==="tableContent"&&l.push(t[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(t[r-1][1].type==="tableDelimiterMarker"){const c=l.length-1;l[c]=l[c]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(i=!0);r+=1}return l}function XR(){return{flow:{null:{name:"table",tokenize:QR,resolveAll:ZR}}}}function QR(t,r,i){const l=this;let o=0,c=0,u;return h;function h(z){let Y=l.events.length-1;for(;Y>-1;){const P=l.events[Y][1].type;if(P==="lineEnding"||P==="linePrefix")Y--;else break}const ne=Y>-1?l.events[Y][1].type:null,ue=ne==="tableHead"||ne==="tableRow"?w:g;return ue===w&&l.parser.lazy[l.now().line]?i(z):ue(z)}function g(z){return t.enter("tableHead"),t.enter("tableRow"),p(z)}function p(z){return z===124||(u=!0,c+=1),v(z)}function v(z){return z===null?i(z):Se(z)?c>1?(c=0,l.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(z),t.exit("lineEnding"),x):i(z):_e(z)?Ue(t,v,"whitespace")(z):(c+=1,u&&(u=!1,o+=1),z===124?(t.enter("tableCellDivider"),t.consume(z),t.exit("tableCellDivider"),u=!0,v):(t.enter("data"),y(z)))}function y(z){return z===null||z===124||rt(z)?(t.exit("data"),v(z)):(t.consume(z),z===92?S:y)}function S(z){return z===92||z===124?(t.consume(z),y):y(z)}function x(z){return l.interrupt=!1,l.parser.lazy[l.now().line]?i(z):(t.enter("tableDelimiterRow"),u=!1,_e(z)?Ue(t,C,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):C(z))}function C(z){return z===45||z===58?H(z):z===124?(u=!0,t.enter("tableCellDivider"),t.consume(z),t.exit("tableCellDivider"),N):W(z)}function N(z){return _e(z)?Ue(t,H,"whitespace")(z):H(z)}function H(z){return z===58?(c+=1,u=!0,t.enter("tableDelimiterMarker"),t.consume(z),t.exit("tableDelimiterMarker"),O):z===45?(c+=1,O(z)):z===null||Se(z)?F(z):W(z)}function O(z){return z===45?(t.enter("tableDelimiterFiller"),I(z)):W(z)}function I(z){return z===45?(t.consume(z),I):z===58?(u=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(z),t.exit("tableDelimiterMarker"),A):(t.exit("tableDelimiterFiller"),A(z))}function A(z){return _e(z)?Ue(t,F,"whitespace")(z):F(z)}function F(z){return z===124?C(z):z===null||Se(z)?!u||o!==c?W(z):(t.exit("tableDelimiterRow"),t.exit("tableHead"),r(z)):W(z)}function W(z){return i(z)}function w(z){return t.enter("tableRow"),q(z)}function q(z){return z===124?(t.enter("tableCellDivider"),t.consume(z),t.exit("tableCellDivider"),q):z===null||Se(z)?(t.exit("tableRow"),r(z)):_e(z)?Ue(t,q,"whitespace")(z):(t.enter("data"),Q(z))}function Q(z){return z===null||z===124||rt(z)?(t.exit("data"),q(z)):(t.consume(z),z===92?se:Q)}function se(z){return z===92||z===124?(t.consume(z),Q):Q(z)}}function ZR(t,r){let i=-1,l=!0,o=0,c=[0,0,0,0],u=[0,0,0,0],h=!1,g=0,p,v,y;const S=new YR;for(;++i<t.length;){const x=t[i],C=x[1];x[0]==="enter"?C.type==="tableHead"?(h=!1,g!==0&&(Lg(S,r,g,p,v),v=void 0,g=0),p={type:"table",start:Object.assign({},C.start),end:Object.assign({},C.end)},S.add(i,0,[["enter",p,r]])):C.type==="tableRow"||C.type==="tableDelimiterRow"?(l=!0,y=void 0,c=[0,0,0,0],u=[0,i+1,0,0],h&&(h=!1,v={type:"tableBody",start:Object.assign({},C.start),end:Object.assign({},C.end)},S.add(i,0,[["enter",v,r]])),o=C.type==="tableDelimiterRow"?2:v?3:1):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")?(l=!1,u[2]===0&&(c[1]!==0&&(u[0]=u[1],y=Rs(S,r,c,o,void 0,y),c=[0,0,0,0]),u[2]=i)):C.type==="tableCellDivider"&&(l?l=!1:(c[1]!==0&&(u[0]=u[1],y=Rs(S,r,c,o,void 0,y)),c=u,u=[c[1],i,0,0])):C.type==="tableHead"?(h=!0,g=i):C.type==="tableRow"||C.type==="tableDelimiterRow"?(g=i,c[1]!==0?(u[0]=u[1],y=Rs(S,r,c,o,i,y)):u[1]!==0&&(y=Rs(S,r,u,o,i,y)),o=0):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")&&(u[3]=i)}for(g!==0&&Lg(S,r,g,p,v),S.consume(r.events),i=-1;++i<r.events.length;){const x=r.events[i];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=KR(r.events,i))}return t}function Rs(t,r,i,l,o,c){const u=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",h="tableContent";i[0]!==0&&(c.end=Object.assign({},$i(r.events,i[0])),t.add(i[0],0,[["exit",c,r]]));const g=$i(r.events,i[1]);if(c={type:u,start:Object.assign({},g),end:Object.assign({},g)},t.add(i[1],0,[["enter",c,r]]),i[2]!==0){const p=$i(r.events,i[2]),v=$i(r.events,i[3]),y={type:h,start:Object.assign({},p),end:Object.assign({},v)};if(t.add(i[2],0,[["enter",y,r]]),l!==2){const S=r.events[i[2]],x=r.events[i[3]];if(S[1].end=Object.assign({},x[1].end),S[1].type="chunkText",S[1].contentType="text",i[3]>i[2]+1){const C=i[2]+1,N=i[3]-i[2]-1;t.add(C,N,[])}}t.add(i[3]+1,0,[["exit",y,r]])}return o!==void 0&&(c.end=Object.assign({},$i(r.events,o)),t.add(o,0,[["exit",c,r]]),c=void 0),c}function Lg(t,r,i,l,o){const c=[],u=$i(r.events,i);o&&(o.end=Object.assign({},u),c.push(["exit",o,r])),l.end=Object.assign({},u),c.push(["exit",l,r]),t.add(i+1,0,c)}function $i(t,r){const i=t[r],l=i[0]==="enter"?"start":"end";return i[1][l]}const JR={name:"tasklistCheck",tokenize:eT};function WR(){return{text:{91:JR}}}function eT(t,r,i){const l=this;return o;function o(g){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?i(g):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),c)}function c(g){return rt(g)?(t.enter("taskListCheckValueUnchecked"),t.consume(g),t.exit("taskListCheckValueUnchecked"),u):g===88||g===120?(t.enter("taskListCheckValueChecked"),t.consume(g),t.exit("taskListCheckValueChecked"),u):i(g)}function u(g){return g===93?(t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),h):i(g)}function h(g){return Se(g)?r(g):_e(g)?t.check({tokenize:tT},r,i)(g):i(g)}}function tT(t,r,i){return Ue(t,l,"whitespace");function l(o){return o===null?i(o):r(o)}}function nT(t){return _y([TR(),LR(),VR(t),XR(),WR()])}const rT={};function iT(t){const r=this,i=t||rT,l=r.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),c=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),u=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push(nT(i)),c.push(wR()),u.push(CR(i))}const Tv=/^(javascript|vbscript|data):/i;function aT(t){if(!t)return!1;const r=t.trim();return!(!r||Tv.test(r))}function lT(t){if(!t)return!1;const r=t.trim();return!r||Tv.test(r)||r.startsWith("blob:")||r.startsWith("data:image/")||/^https?:\/\//i.test(r)?!1:!!(r.startsWith("/")||r.startsWith("./")||r.startsWith("../")||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r))}const sT=[[iT,{singleTilde:!1}]];function Bg({lang:t,text:r}){const[i,l]=k.useState(!1),o=()=>{navigator.clipboard?.writeText(r).then(()=>{l(!0),window.setTimeout(()=>l(!1),1600)},()=>{})};return d.jsxs("div",{className:"oc-codeblock",children:[d.jsxs("div",{className:"oc-codeblock-head",children:[d.jsx("span",{className:"oc-codeblock-lang",children:t||"text"}),d.jsx("button",{type:"button",className:"oc-codeblock-copy",onClick:o,children:i?"已复制":"复制"})]}),d.jsx("pre",{children:d.jsx("code",{children:r})})]})}const oT={pre({children:t}){return d.jsx(d.Fragment,{children:t})},code({className:t,children:r,...i}){const l=String(r??"").replace(/\n$/,""),o=/language-([\w-]+)/.exec(t??"");return o||t&&l.includes(`
|
|
40
|
-
`)?d.jsx(Bg,{lang:o?.[1]??"",text:l}):l.includes(`
|
|
41
|
-
`)?d.jsx(Bg,{lang:"",text:l}):d.jsx("code",{className:t,...i,children:r})},a({href:t,children:r,...i}){if(!aT(t))return d.jsx("span",{...i,children:r});const l=/^https?:\/\//i.test(t??"");return d.jsx("a",{href:t,...l?{target:"_blank",rel:"noopener noreferrer"}:{},...i,children:r})},img({src:t,alt:r}){return lT(t)?d.jsxs(d.Fragment,{children:[d.jsx("img",{src:t,alt:r??"",loading:"lazy",onError:i=>{const l=i.currentTarget;l.hidden=!0,l.nextElementSibling?.removeAttribute("hidden")}}),d.jsx("span",{className:"oc-md-img-fallback",hidden:!0,title:t??void 0,children:r?`[图片加载失败: ${r}]`:"[图片加载失败]"})]}):d.jsx("span",{className:"oc-md-img-fallback",title:t??void 0,children:r?`[图片: ${r}]`:"[图片已屏蔽]"})},table({children:t}){return d.jsx("div",{className:"oc-md-table-wrap",children:d.jsx("table",{children:t})})},input(t){return t.type==="checkbox"?d.jsx("input",{type:"checkbox",checked:!!t.checked,disabled:!0,readOnly:!0}):d.jsx("input",{...t,disabled:!0,readOnly:!0})}};function uT({text:t}){try{return d.jsx("div",{className:"oc-md",children:d.jsx(VC,{remarkPlugins:sT,components:oT,children:t})})}catch{return d.jsx("div",{className:"oc-md",children:d.jsx("pre",{className:"oc-md-fallback",children:t})})}}function cT(){return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function dT(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})})}function fT(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),d.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function hT(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:d.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Ev(){return d.jsx("svg",{className:"oc-tool-chevron",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("polyline",{points:"4 2.5 7.5 6 4 9.5"})})}function mT(){return d.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})})}function Nv(t){const[r,i]=k.useState(!1),l=()=>{navigator.clipboard?.writeText(t.text).then(()=>{i(!0),window.setTimeout(()=>i(!1),1600)},()=>{})};return d.jsx("button",{type:"button",className:`oc-message-copy${r?" is-copied":""}`,"aria-label":r?"已复制":"复制消息",title:r?"已复制":"复制",onClick:l,children:r?d.jsx(dT,{}):d.jsx(cT,{})})}function Hg(t){const{message:r,streaming:i,activeAssistantId:l}=t,o=r.role==="user",c=o?"你":"π",u=o?"你":"助手",h=!o&&i&&l!==null&&r.id===l,g=h&&r.text.length===0,p=r.text.trim().length>0;return d.jsxs("div",{className:`oc-row ${o?"is-user":"is-assistant"}`,children:[d.jsxs("div",{className:"oc-meta",children:[d.jsx("span",{className:`oc-avatar ${o?"oc-avatar-user":"oc-avatar-assistant"}`,"aria-hidden":"true",children:c}),d.jsx("span",{className:"oc-role",children:u}),d.jsx("span",{className:"oc-time",children:ay(r.createdAt)}),p&&d.jsx(Nv,{text:r.text})]}),d.jsxs("div",{className:`oc-bubble ${o?"oc-bubble-user":"oc-bubble-assistant"}`,children:[p?o?d.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r.text}):d.jsx(uT,{text:r.text}):g?d.jsx("span",{className:"oc-cursor","aria-hidden":"true"}):null,h&&p&&d.jsx("span",{className:"oc-cursor","aria-hidden":"true"})]})]})}function pT(t){const r=[],i=[];let l,o=[];const c=u=>{for(const h of o)h.assistantMessageId||(h.assistantMessageId=u),h.turnId||(h.turnId=l);o=[]};for(const u of t){const h=Date.parse(u.at)||Date.now();if(u.role==="user"){l=`restored-${u.id}`,o=[],r.push({id:u.id,role:"user",text:u.text,createdAt:h});continue}if(u.role==="assistant"){l||(l=`restored-${u.id}`),r.push({id:u.id,role:"assistant",text:u.text,createdAt:h}),c(u.id);continue}if(u.role==="tool"){l||(l=`restored-tool-${u.id}`);const g={id:u.toolCallId||u.id,toolName:u.toolName||"tool",status:u.isError===!0?"error":"ok",resultText:u.text,result:u.text,createdAt:h,finishedAt:h,turnId:l};i.push(g),o.push(g)}}return{messages:r,toolCalls:i}}function gT(t){const r=t.messages.filter(h=>h.role==="user"||h.role==="assistant"),i=[];let l=null;const o=h=>{const g={key:h,assistants:[],tools:[],live:!1};return i.push(g),g};for(const h of r){if(h.role==="user"){l=o(`user-${h.id}`),l.user=h;continue}l||(l=o(`assistant-${h.id}`)),l.assistants.push(h)}i.length===0&&t.toolCalls.length>0&&i.push({key:"orphan-tools",assistants:[],tools:[],live:!1});const c=new Set,u=new Map;for(const h of i)for(const g of h.assistants)u.set(g.id,h);for(const h of t.toolCalls)if(h.assistantMessageId){const g=u.get(h.assistantMessageId);if(g){g.tools.push(h),c.add(h.id);continue}}for(const h of t.toolCalls)if(!c.has(h.id)&&h.turnId){const g=i.find(v=>v.tools.some(y=>y.turnId===h.turnId)||v.key===`turn-${h.turnId}`||v.user&&`restored-${v.user.id}`===h.turnId);if(g){g.tools.push(h),c.add(h.id);continue}const p=i.find(v=>h.turnId===`restored-${v.user?.id}`||v.assistants.some(y=>h.turnId===`restored-${y.id}`));if(p){p.tools.push(h),c.add(h.id);continue}}for(const h of t.toolCalls){if(c.has(h.id))continue;const g=i.find((p,v)=>{const y=p.user?.createdAt??p.assistants[0]?.createdAt??0,x=i[v+1]?.user?.createdAt??Number.POSITIVE_INFINITY;return h.createdAt>=y&&h.createdAt<x});g?(g.tools.push(h),c.add(h.id)):i.length>0&&(i[i.length-1].tools.push(h),c.add(h.id))}for(const h of i)h.tools.sort((g,p)=>g.createdAt-p.createdAt),h.live=t.streaming&&t.activeAssistantId!==null&&h.assistants.some(g=>g.id===t.activeAssistantId);return i}function yT(t){const r=t.length,i=t.filter(c=>c.status==="error").length,l=t.filter(c=>c.status==="running").length,o=[`执行过程 · ${r} 工具`];return i>0?o.push(`${i} 出错`):l>0&&o.push("运行中"),{count:r,errorCount:i,runningCount:l,label:o.join(" · ")}}function Av(t){const{entry:r}=t,[i,l]=k.useState(r.status==="error"),[o,c]=k.useState(!1),u=r.status==="running"?"运行中":r.status==="error"?"出错":"完成",h=`is-${r.status}`,g=L1(r.args,{toolName:r.toolName}),p=q1(r.createdAt,r.finishedAt),v=B1(r.toolName),y=iy(r.resultText??r.result),S=U1(y,o?{maxLen:Number.MAX_SAFE_INTEGER}:void 0);return d.jsxs("div",{className:`oc-tool ${r.status==="error"?"is-error":""} ${r.status==="running"?"is-running":""}`,children:[d.jsxs("button",{type:"button",className:"oc-tool-head","aria-expanded":i,onClick:()=>l(x=>!x),children:[d.jsx(Ev,{}),d.jsx("span",{className:"oc-tool-icon","aria-hidden":"true",children:d.jsx(mT,{})}),d.jsx("span",{className:"oc-tool-name",children:r.toolName}),g&&d.jsx("span",{className:"oc-tool-args",children:g}),p!==void 0&&d.jsxs("span",{className:"oc-tool-duration",children:[p,"s"]}),d.jsx("span",{className:`oc-tool-status ${h}`,children:u})]}),i&&d.jsxs("div",{className:"oc-tool-body",children:[r.args!==void 0&&d.jsxs("div",{className:"oc-tool-section",children:[d.jsx("div",{className:"oc-tool-label",children:v.argsLabel}),d.jsx("pre",{className:"oc-tool-code",children:H1(r.args)})]}),(r.resultText!==void 0||r.result!==void 0)&&d.jsxs("div",{className:"oc-tool-section",children:[d.jsx("div",{className:"oc-tool-label",children:r.status==="error"?"错误":v.resultLabel}),d.jsx("pre",{className:"oc-tool-code",children:S.text}),S.truncated&&!o&&d.jsx("button",{type:"button",className:"btn btn-ghost oc-tool-expand-result",onClick:()=>c(!0),children:"展开全部"})]}),r.status==="running"&&r.resultText===void 0&&r.result===void 0&&r.args===void 0&&d.jsx("div",{className:"oc-tool-section",children:d.jsx("div",{className:"oc-tool-waiting",children:"等待结果…"})})]})]})}function vT(t){const{tools:r,defaultOpen:i}=t,[l,o]=k.useState(i),c=yT(r);return k.useEffect(()=>{i&&o(!0)},[i]),d.jsxs("div",{className:"oc-process-inline",children:[d.jsxs("button",{type:"button",className:`oc-process-inline-summary${l?" is-open":""}${c.errorCount>0?" is-error":c.runningCount>0?" is-running":""}`,"aria-expanded":l,onClick:()=>o(u=>!u),children:[d.jsx(Ev,{}),d.jsx("span",{children:c.label})]}),l?d.jsx("div",{className:"oc-process-inline-body",children:r.map(u=>d.jsx(Av,{entry:u},u.id))}):null]})}function bT(t){const{scrollContainerRef:r,messagesEndRef:i,onScroll:l,hasThread:o,readiness:c,streaming:u,streamingAssistantId:h,messagesCount:g,visibleCount:p,onLoadMore:v,turnGroups:y,interview:S,humanGateCards:x,operationCards:C,artifactCards:N,origin:H,sessionId:O}=t;return d.jsxs("div",{ref:r,className:`oc-messages${o?" has-thread":" is-empty"}`,onScroll:l,children:[o?null:d.jsx(gy,{mode:"empty-session",readiness:c,disabled:u,onSuggest:t.onSuggest}),o&&g>p&&d.jsx("button",{type:"button",className:"btn btn-ghost oc-load-history",onClick:v,children:"加载更早消息"}),o&&y.map((I,A)=>{const F=I.user??I.assistants[0],W=A>0?y[A-1].user??y[A-1].assistants[0]:void 0,w=!!F&&(!W||Sc(W.createdAt)!==Sc(F.createdAt)),q=I.assistants[I.assistants.length-1];return d.jsxs("div",{className:"oc-turn-group",children:[w&&F&&d.jsx("div",{className:"oc-day-sep",children:Sc(F.createdAt)}),I.user&&d.jsx(Hg,{message:I.user,streaming:u,activeAssistantId:h}),I.tools.length>0&&d.jsx(vT,{tools:I.tools,defaultOpen:I.live}),q&&d.jsx(Hg,{message:q,streaming:u,activeAssistantId:h})]},I.key)}),S&&d.jsx(MS,{interview:S,interviewAnswer:t.interviewAnswer,onAnswerChange:t.onInterviewAnswerChange,onAnswer:t.onAnswerInterview,onConfirmTaskKind:t.onConfirmTaskKind}),x.map(I=>d.jsx(TS,{card:I,origin:H,sessionId:O},I.cardId)),C.map(I=>d.jsx(OS,{operation:I,origin:H,onNavigateWorkspace:t.onNavigateWorkspace},I.operationId)),N.map(I=>d.jsx(RS,{artifact:I},I.artifactId)),d.jsx("div",{ref:i})]})}function Za(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toLocaleString()}function Ug(t){const r=[],i=t.inputTokens??0,l=t.outputTokens??0,o=t.cacheReadTokens??0,c=t.cacheWriteTokens??0,u=t.cost??0;if(i>0&&r.push(`${Za(i)} in`),l>0&&r.push(`${Za(l)} out`),o>0&&r.push(`${Za(o)} cache R`),c>0&&r.push(`${Za(c)} cache W`),u>0&&r.push(u>=.01?`$${u.toFixed(2)}`:"<$0.01"),r.length===0){const h=t.totalTokens??0;return h>0?`${Za(h)} tokens`:"—"}return r.join(" · ")}const xT={auto:"auto(跟随 Pi 默认等级)",off:"off · 关闭",minimal:"minimal · 极简",low:"low · 低",medium:"medium · 中",high:"high · 高",xhigh:"xhigh · 极高",max:"max · 最高"};function ST(t,r){const i=r.trim().toLowerCase(),l=new Map;for(const o of t){if(i&&!o.provider.toLowerCase().includes(i)&&!o.id.toLowerCase().includes(i)&&!(o.name??"").toLowerCase().includes(i))continue;const c=l.get(o.provider)??[];c.push(o),l.set(o.provider,c)}return[...l.entries()].map(([o,c])=>({provider:o,models:c}))}function kT(t,r){const i=new Set,l=[],o=c=>{i.has(c)||(i.add(c),l.push({value:c,label:xT[c]??c,...c==="auto"&&r?{effective:r}:{}}))};o("auto");for(const c of t)o(c);return l}function Bs(t,r){return`${t}/${r}`}function td(t){return{...t.modelProvider&&t.modelId?{model:{provider:t.modelProvider,modelId:t.modelId}}:{},...t.thinkingLevel?{thinkingLevel:t.thinkingLevel}:{}}}function Iv(t,r){return{...t,model:r.model??t.model,thinkingLevel:r.thinkingLevel??t.thinkingLevel}}function wT(t,r){const i=Iv(t,r);return i.model?.provider===t.model?.provider&&i.model?.modelId===t.model?.modelId&&i.thinkingLevel===t.thinkingLevel}function CT(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:d.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function qg(t){const r=Qi(),[i,l]=k.useState(!1),[o,c]=k.useState(""),[u,h]=k.useState(0),g=k.useRef(null),p=k.useRef(null),v=r.snapshot,y=r.status==="loading",S=r.status==="error"?r.error:null,x=v?(v.models??[]).map(I=>({provider:I.provider,id:I.id,...I.name?{name:I.name}:{},...I.hasCredentials!==void 0?{hasCredentials:I.hasCredentials}:{}})):t.models,C=k.useMemo(()=>ST(x,o),[x,o]),N=k.useMemo(()=>C.flatMap(I=>I.models),[C]);k.useEffect(()=>{i&&(c(""),h(0),window.setTimeout(()=>p.current?.focus(),0))},[i]),k.useEffect(()=>{if(!i)return;const I=F=>{const W=g.current;W&&F.target instanceof Node&&!W.contains(F.target)&&l(!1)},A=F=>{F.key==="Escape"&&l(!1)};return document.addEventListener("mousedown",I),document.addEventListener("keydown",A),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",A)}},[i]);const H=I=>{if(t.disabled)return;const A=N[I];A&&(l(!1),t.onSelect(A.provider,A.id))},O=I=>{if(I.key==="ArrowDown"){I.preventDefault(),h(A=>N.length?(A+1)%N.length:0);return}if(I.key==="ArrowUp"){I.preventDefault(),h(A=>N.length?(A-1+N.length)%N.length:0);return}if(I.key==="Enter"){I.preventDefault(),H(u);return}if(I.key==="Escape"){I.preventDefault(),l(!1);return}};return d.jsxs("div",{className:"oc-select-menu oc-model-menu",ref:g,children:[d.jsxs("button",{type:"button",className:"oc-select-trigger","aria-haspopup":"listbox","aria-expanded":i,title:"选择模型",disabled:t.disabled,onClick:()=>l(I=>!I),children:[d.jsx("span",{className:"oc-select-trigger-label",children:t.triggerLabel}),d.jsx(CT,{})]}),i&&d.jsxs("div",{className:"oc-select-panel oc-model-panel",role:"listbox","aria-label":"选择模型",children:[d.jsx("input",{ref:p,className:"oc-select-search",placeholder:"搜索模型或 Provider…",value:o,onChange:I=>{c(I.target.value),h(0)},onKeyDown:O}),y&&d.jsx("div",{className:"oc-select-status",children:"模型列表加载中…"}),S&&d.jsxs("div",{className:"oc-select-status is-error",children:[d.jsxs("span",{children:[S.code?`${S.code}:`:"",S.message]}),d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Ki()},children:"重试"})]}),!y&&!S&&C.length===0&&d.jsx("div",{className:"oc-select-status",children:"当前没有可用模型(真实空态,未伪造列表)"}),C.map(I=>d.jsxs("div",{className:"oc-model-group",children:[d.jsx("div",{className:"oc-model-group-head",children:I.provider}),I.models.map(A=>{const F=Bs(A.provider,A.id),W=F===t.activeModelRef,w=N[u]===A;return d.jsxs("button",{type:"button",role:"option","aria-selected":W,disabled:t.disabled,className:`oc-select-option oc-model-option${w?" is-highlighted":""}${W?" is-active":""}`,onMouseDown:q=>q.preventDefault(),onClick:()=>{t.disabled||(l(!1),t.onSelect(A.provider,A.id))},children:[d.jsxs("span",{className:"oc-model-option-name",children:[A.name?`${A.name} · `:"",A.id]}),W&&d.jsx("span",{className:"oc-model-option-check",children:"✓"})]},F)})]},I.provider))]})]})}function jT(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:d.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function RT(t){const r=Qi(),[i,l]=k.useState(!1),[o,c]=k.useState(0),u=k.useRef(null),h=t.effectiveLevel??r.snapshot?.selection?.effectiveThinkingLevel,g=r.snapshot?.thinkingLevels?.length?r.snapshot.thinkingLevels.map(S=>S.value):void 0,p=k.useMemo(()=>kT(g??t.levels,h),[g,t.levels,h]);k.useEffect(()=>{i&&c(0)},[i]),k.useEffect(()=>{if(!i)return;const S=C=>{const N=u.current;N&&C.target instanceof Node&&!N.contains(C.target)&&l(!1)},x=C=>{C.key==="Escape"&&l(!1)};return document.addEventListener("mousedown",S),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("keydown",x)}},[i]);const v=S=>{if(t.disabled)return;const x=p[S];x&&(l(!1),t.onSelect(x.value))},y=S=>{if(S.key==="ArrowDown"){S.preventDefault(),c(x=>p.length?(x+1)%p.length:0);return}if(S.key==="ArrowUp"){S.preventDefault(),c(x=>p.length?(x-1+p.length)%p.length:0);return}if(S.key==="Enter"){S.preventDefault(),v(o);return}if(S.key==="Escape"){S.preventDefault(),l(!1);return}};return d.jsxs("div",{className:"oc-select-menu oc-thinking-menu",ref:u,children:[d.jsxs("button",{type:"button",className:"oc-select-trigger","aria-haspopup":"listbox","aria-expanded":i,title:"思考等级",disabled:t.disabled,onClick:()=>l(S=>!S),children:[d.jsx("span",{className:"oc-select-trigger-label",children:t.triggerLabel}),d.jsx(jT,{})]}),i&&d.jsx("div",{className:"oc-select-panel oc-thinking-panel",role:"listbox","aria-label":"思考等级",onKeyDown:y,children:p.map((S,x)=>{const C=S.value===t.activeValue,N=x===o;return d.jsxs("button",{type:"button",role:"option","aria-selected":C,disabled:t.disabled,className:`oc-select-option oc-thinking-option${N?" is-highlighted":""}${C?" is-active":""}`,onMouseDown:H=>H.preventDefault(),onClick:()=>{t.disabled||(l(!1),t.onSelect(S.value))},children:[d.jsx("span",{className:"oc-thinking-option-label",children:S.label}),S.value==="auto"&&S.effective?d.jsxs("span",{className:"oc-thinking-badge",children:["Pi 实际:",S.effective]}):null,C&&d.jsx("span",{className:"oc-model-option-check",children:"✓"})]},S.value)})})]})}function TT(){return d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),d.jsx("circle",{cx:"8.5",cy:"10",r:"1.5"}),d.jsx("path",{d:"m21 16-5.5-5.5L9 17"})]})}function ET(t){const{composer:r,streaming:i,hasThread:l}=t,o=!!t.compactControls,[c,u]=k.useState(!1),h=k.useRef(null),g=k.useRef(null),p=Qi(),v=p.reloading,y=p.reloadError,x=p.mutationBusy||v||i;k.useEffect(()=>{o||u(!1)},[o]),k.useEffect(()=>{if(!c)return;const w=Q=>{const se=h.current;se&&Q.target instanceof Node&&!se.contains(Q.target)&&u(!1)},q=Q=>{Q.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",w),document.addEventListener("keydown",q),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",q)}},[c]);const C=k.useCallback(()=>{r.setInput(""),r.setShortcutOpen(!1),Pi()},[r.setInput,r.setShortcutOpen]),N=k.useCallback(w=>{const q=r.isComposingNow()||w.nativeEvent.isComposing,Q=r.recentlyComposedNow();if(w.key==="Enter"&&!w.shiftKey&&!q&&!Q){if(r.shortcutOpen&&r.filteredShortcuts.length>0){if((r.filteredShortcuts[r.shortcutIndex]??r.filteredShortcuts[0])?.command==="/reload"){w.preventDefault(),C();return}}else if(r.input.trim()==="/reload"){w.preventDefault(),C();return}}t.onKeyDown(w)},[r.isComposingNow,r.recentlyComposedNow,r.shortcutOpen,r.filteredShortcuts,r.shortcutIndex,r.input,C,t.onKeyDown]),H=k.useCallback((w,q)=>{if(q==="pi-prompt"||w==="/name"||w==="/compact"){r.setInput(`${w} `),r.setShortcutOpen(!1),r.textareaRef.current?.focus();return}if(w==="/reload"){C();return}t.onRunShortcut(w)},[C,t.onRunShortcut,r]),O=k.useCallback(()=>{if(r.input.trim()==="/reload"){C();return}t.onSend(r.input)},[r.input,C,t.onSend]),I=(()=>{const w=t.activeModelRef||"模型",q=w.split("/"),Q=q[q.length-1]||w;return Q.length>18?`${Q.slice(0,16)}…`:Q})(),A=(()=>{const w=t.processSummary;return w?w.statusKind==="error"?`查看工具调用记录,共 ${w.count} 次,其中 ${w.statusLabel}`:w.statusKind==="running"?`查看工具调用记录,共 ${w.count} 次,${w.statusLabel||"正在运行"}`:`查看工具调用记录,共 ${w.count} 次,全部已完成`:"查看工具调用记录"})(),F=d.jsxs(d.Fragment,{children:[o?null:d.jsx(qg,{models:t.models,activeModelRef:t.activeModelRef,triggerLabel:t.activeModelRef||"选择模型",disabled:x,onSelect:(w,q)=>t.onSwitchRuntime({provider:w,modelId:q})}),d.jsx(RT,{levels:t.thinkingLevels,activeValue:t.activeThinkingLevel||"auto",triggerLabel:t.activeThinkingLevel||"auto",disabled:x,onSelect:w=>t.onSwitchRuntime({thinkingLevel:w})}),d.jsxs("span",{className:"oc-usage",title:Ug(t.usage),children:[i?"运行中":"空闲",t.unread>0?` · ${t.unread} 未读`:""," · ",Ug(t.usage)]}),d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:t.onCompact,disabled:i||!l,title:l?i?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文","aria-label":l?i?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文",children:"压缩"}),t.processSummary&&d.jsxs("button",{type:"button",ref:t.processTriggerRef,className:`oc-process-summary is-${t.processSummary.statusKind}${t.processOpen?" is-open":""}`,"aria-expanded":t.processOpen,"aria-controls":"oc-process-panel","aria-label":A,title:A,onClick:t.onToggleProcess,children:[d.jsx("span",{className:"oc-process-summary-label",children:"调用记录"}),d.jsx("span",{className:"oc-process-summary-badge",children:t.processSummary.count}),t.processSummary.statusKind!=="ok"&&t.processSummary.statusLabel?d.jsx("span",{className:"oc-process-summary-status",children:t.processSummary.statusLabel}):null]}),t.runtimeContext?d.jsx("button",{type:"button",ref:t.runtimeContextTriggerRef,className:`btn btn-ghost oc-runtime-context-toggle${t.runtimeContextOpen?" is-active":""}`,"aria-expanded":t.runtimeContextOpen,"aria-controls":"oc-runtime-context-panel",onClick:()=>{u(!1),t.onToggleRuntimeContext(),o&&g.current?.focus()},children:"注入上下文"}):null]}),W=(()=>{const w=new Map;for(const q of r.filteredShortcuts){const Q=q.source??"operator",se=w.get(Q)??[];se.push(q),w.set(Q,se)}return w})();return d.jsx("div",{className:`oc-composer${o?" is-compact-controls":""}`,children:d.jsxs("div",{className:"oc-composer-inner",children:[r.fileOptions.length>0&&d.jsx("div",{className:"oc-file-palette",role:"listbox","aria-label":"Repository files",children:r.fileOptions.map(w=>d.jsx("button",{type:"button",role:"option",onMouseDown:q=>q.preventDefault(),onClick:()=>r.insertFileReference(w),children:d.jsxs("code",{children:["@",w]})},w))}),r.pendingImages.length>0&&d.jsx("div",{className:"oc-attachment-list",children:r.pendingImages.map(w=>d.jsxs("span",{children:[w.name,d.jsx("button",{type:"button","aria-label":`移除 ${w.name}`,onClick:()=>r.removeImage(w),children:"×"})]},w.name))}),d.jsxs("div",{className:"oc-composer-toolbar",children:[d.jsxs("label",{className:"oc-attach-button oc-attach-icon",title:"添加图片","aria-label":"添加图片",children:[d.jsx(TT,{}),d.jsx("span",{className:"sr-only",children:"添加图片"}),d.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:w=>{r.addImagesFromFiles(Array.from(w.target.files??[]).slice(0,4)),w.target.value=""}})]}),o?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"oc-composer-primary-model",children:d.jsx(qg,{models:t.models,activeModelRef:t.activeModelRef,triggerLabel:I,disabled:x,onSelect:(w,q)=>t.onSwitchRuntime({provider:w,modelId:q})})}),d.jsxs("div",{className:"oc-composer-more",ref:h,children:[d.jsx("button",{type:"button",ref:g,className:`oc-composer-more-btn${c?" is-open":""}`,"aria-expanded":c,"aria-haspopup":"menu","aria-label":"更多控制",title:"更多",onClick:()=>u(w=>!w),children:"更多"}),c?d.jsx("div",{className:"oc-composer-more-menu",role:"menu","aria-label":"低频控制",children:F}):null]})]}):d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"oc-composer-hint",children:[d.jsx("span",{className:"oc-kbd",children:"Enter"})," 发送"]}),d.jsxs("span",{className:"oc-composer-hint",children:[d.jsx("span",{className:"oc-kbd",children:"Shift"}),"+",d.jsx("span",{className:"oc-kbd",children:"Enter"})," 换行"]})]}),v&&d.jsx("span",{className:"oc-reload-status",children:"正在重新加载会话…"})]}),r.shortcutOpen&&r.filteredShortcuts.length>0&&d.jsxs("div",{className:"oc-shortcut-palette",role:"listbox","aria-label":"命令","aria-busy":r.dynamicCommandsLoading||void 0,children:[d.jsxs("div",{className:"oc-shortcut-palette-head",children:[d.jsxs("strong",{children:["命令 · ",r.filteredShortcuts.length]}),r.dynamicCommandsLoading?d.jsx("span",{className:"oc-shortcut-palette-meta",children:"正在加载扩展、提示词与技能…"}):null,r.dynamicCommandsError?d.jsxs("span",{className:"oc-shortcut-palette-meta is-error",children:[r.dynamicCommandsError,d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>r.retryDynamicCommands(),children:"重试"})]}):null]}),[...W.entries()].map(([w,q])=>d.jsxs("div",{className:"oc-shortcut-group",children:[d.jsxs("small",{children:[kS[w]??w," ","· ",q.length]}),q.map(Q=>{const se=r.filteredShortcuts.indexOf(Q);return d.jsxs("button",{type:"button",role:"option","aria-selected":se===r.shortcutIndex,className:se===r.shortcutIndex?"is-active":"",title:Q.command,onMouseDown:z=>z.preventDefault(),onClick:z=>{z.currentTarget.scrollIntoView({block:"nearest"}),H(Q.command,Q.action)},children:[d.jsx("code",{children:Q.command}),d.jsxs("span",{children:[d.jsx("strong",{children:Q.label}),d.jsx("small",{children:Q.description})]})]},`${Q.source}:${Q.command}`)})]},w))]}),d.jsxs("div",{className:`oc-composer-shell${i?" is-busy":""}`,children:[d.jsx("textarea",{ref:r.textareaRef,className:"oc-textarea",value:r.input,rows:3,placeholder:i?"正在生成回复…(停止后可发送下一轮)":l?"输入消息… Enter 发送 · Shift+Enter 换行":"描述目标,或点选上方建议开始…",onChange:w=>r.handleInputChange(w.target.value),onKeyDown:N,onCompositionStart:r.onCompositionStart,onCompositionEnd:r.onCompositionEnd,disabled:i,"aria-expanded":r.shortcutOpen,"aria-controls":(r.shortcutOpen,void 0)}),i?d.jsx("button",{type:"button",className:"oc-stop",title:"停止生成","aria-label":"停止生成",onClick:t.onStop,children:d.jsx(hT,{})}):d.jsx("button",{type:"button",className:"oc-send",title:"发送","aria-label":"发送",onClick:O,disabled:!r.input.trim()&&r.pendingImages.length===0||v,children:d.jsx(fT,{})})]}),y&&d.jsxs("div",{className:"oc-reload-banner is-error",role:"alert",children:[d.jsxs("span",{children:[y.code?`${y.code}:`:"",y.message]}),d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Pi()},children:"重试"})]}),o?null:d.jsx("div",{className:"oc-runtime-controls",children:F})]})})}function NT(t){const{toolCalls:r,onClose:i,overlay:l=!1}=t,o=k.useRef(null);return od({open:l,containerRef:o,triggerRef:t.triggerRef,onEscape:i}),d.jsxs("aside",{ref:o,id:"oc-process-panel",className:`oc-process${l?" is-process-overlay":""}`,"aria-label":"工具调用记录",role:l?"dialog":void 0,"aria-modal":l?!0:void 0,tabIndex:-1,children:[d.jsxs("header",{className:"oc-process-head",children:[d.jsxs("div",{className:"oc-process-title",children:[d.jsx("span",{className:"oc-process-title-mark","aria-hidden":"true"}),"工具调用记录",d.jsxs("span",{className:"oc-process-count",children:[r.length," 次"]})]}),d.jsx("button",{type:"button",className:"btn btn-ghost oc-process-close","aria-label":"关闭工具调用记录",onClick:i,children:"关闭"})]}),d.jsx("div",{className:"oc-process-timeline",children:r.length===0?d.jsx("div",{className:"oc-process-empty",children:"本轮对话尚无工具调用。诊断细节会在这里按时间线展示。"}):r.map((c,u)=>d.jsxs("div",{className:`oc-process-item${u===0?" is-first":""}${u===r.length-1?" is-last":""}${c.status==="error"?" is-error":""}${c.status==="running"?" is-running":""}`,children:[d.jsx("div",{className:"oc-process-rail","aria-hidden":"true",children:d.jsx("span",{className:"oc-process-dot"})}),d.jsx("div",{className:"oc-process-time",children:ay(c.createdAt)}),d.jsx("div",{className:"oc-process-body",children:d.jsx(Av,{entry:c})})]},c.id))})]})}const AT=[{id:"overview",label:"概览"},{id:"system",label:"System prompt"},{id:"files",label:"Context files"},{id:"skills",label:"Skills"},{id:"extensions",label:"Extensions"},{id:"packages",label:"Packages"},{id:"tools",label:"Active tools"},{id:"raw",label:"原始 JSON"}];function Ts(t){const r=Array.isArray(t.items)?t.items:void 0;return d.jsxs("section",{className:"oc-runtime-context-section",children:[d.jsxs("header",{className:"oc-runtime-context-section-head",children:[d.jsx("strong",{children:t.title}),d.jsx("span",{className:"oc-runtime-context-meta",children:r?`${r.length} 项`:"未投影"})]}),r===void 0?d.jsx("p",{className:"oc-runtime-context-empty",children:"该 session 未提供资源投影"}):r.length===0?d.jsx("p",{className:"oc-runtime-context-empty",children:t.emptyText}):d.jsx("ul",{className:"oc-runtime-context-resources",children:r.map((i,l)=>d.jsxs("li",{children:[d.jsx("strong",{children:i.name||i.path||"未命名资源"}),i.description?d.jsx("span",{children:i.description}):null,i.path?d.jsxs("code",{children:[i.path,i.baseDir?`(base: ${i.baseDir})`:""]}):null,d.jsxs("span",{className:"oc-runtime-context-meta",children:[i.scope?`scope ${i.scope}`:"",i.source?` · ${i.source}`:"",i.version?` · v${i.version}`:"",i.cwd?` · cwd ${i.cwd}`:""]}),i.error?d.jsx("span",{className:"oc-runtime-context-diag is-error",children:i.error}):null,Array.isArray(i.diagnostics)&&i.diagnostics.length>0?d.jsx("span",{className:"oc-runtime-context-diag",children:i.diagnostics.join(";")}):null,Array.isArray(i.resolved)&&i.resolved.length>0?d.jsx("code",{className:"oc-runtime-context-resolved",children:i.resolved.map(o=>`${o.type??"?"}:${o.name??o.path??"?"}`).join(" · ")}):null]},`${i.name??i.path??l}:${l}`))})]})}const IT=k.forwardRef(function({open:r,onToggle:i,onClose:l,context:o,panelOnly:c=!1,triggerOnly:u=!1,triggerRef:h},g){const p=Qi(),v=p.reloading,y=p.reloadError,[S,x]=k.useState("overview"),C=k.useRef(null);od({open:r&&!u,containerRef:C,triggerRef:h,onEscape:l}),k.useEffect(()=>{r||x("overview")},[r]);const N=Array.isArray(o.resources.activeTools)?o.resources.activeTools:[],H=typeof o.resources.activeToolCount=="number"?o.resources.activeToolCount:N.length,O=o.systemPrompt.text??o.systemPrompt.summary??"",I=o.systemPrompt.charCount??O.length,A=o.resources,F=d.jsx("button",{type:"button",ref:w=>{typeof g=="function"?g(w):g&&(g.current=w)},className:`btn btn-ghost oc-runtime-context-toggle${r?" is-active":""}`,"aria-expanded":r,"aria-controls":"oc-runtime-context-panel",onClick:i,children:"注入上下文"});if(u)return F;const W=r?d.jsxs("div",{ref:C,id:"oc-runtime-context-panel",className:"oc-runtime-context-sidepanel",role:"dialog","aria-modal":"true","aria-label":"注入上下文",tabIndex:-1,children:[d.jsxs("header",{className:"oc-runtime-context-head",children:[d.jsxs("div",{className:"oc-runtime-context-head-copy",children:[d.jsx("strong",{children:"注入上下文"}),d.jsx("span",{className:"oc-runtime-context-meta",children:"只读 · 本轮实际注入的 system prompt / 资源(已脱敏)"})]}),d.jsx("button",{type:"button",className:"btn btn-ghost oc-runtime-context-close","aria-label":"关闭注入上下文",onClick:l,children:"关闭"})]}),d.jsxs("div",{className:"oc-runtime-context-layout",children:[d.jsx("nav",{className:"oc-runtime-context-nav","aria-label":"上下文分类",children:AT.map(w=>d.jsx("button",{type:"button",className:`oc-runtime-context-nav-item${S===w.id?" is-active":""}`,"aria-current":S===w.id?"page":void 0,onClick:()=>x(w.id),children:w.label},w.id))}),d.jsxs("div",{className:"oc-runtime-context-body",children:[S==="overview"?d.jsxs("div",{className:"oc-runtime-context-chips","aria-label":"摘要",children:[o.model&&d.jsxs("span",{className:"oc-runtime-context-chip",children:["模型"," ",d.jsx("code",{children:Bs(o.model.provider,o.model.modelId)})]}),o.thinkingLevel&&d.jsxs("span",{className:"oc-runtime-context-chip",children:["思考 ",o.thinkingLevel]}),d.jsxs("span",{className:"oc-runtime-context-chip",children:["Prompt ",I.toLocaleString()," 字"]}),d.jsxs("span",{className:"oc-runtime-context-chip",children:["工具 ",H]}),d.jsxs("span",{className:"oc-runtime-context-chip",children:["资源面 ",String(o.resources.mode??"closed")]}),d.jsxs("span",{className:"oc-runtime-context-chip",children:["Files ",A.contextFiles?.length??0]}),d.jsxs("span",{className:"oc-runtime-context-chip",children:["Skills ",A.skills?.length??0]}),d.jsxs("span",{className:"oc-runtime-context-chip",children:["Extensions ",A.extensions?.length??0]}),d.jsxs("span",{className:"oc-runtime-context-chip",children:["Packages ",A.packages?.length??0]})]}):null,S==="system"?d.jsxs(d.Fragment,{children:[d.jsxs("section",{className:"oc-runtime-context-section",children:[d.jsxs("header",{className:"oc-runtime-context-section-head",children:[d.jsxs("div",{children:[d.jsx("strong",{children:"System prompt"}),d.jsxs("code",{className:"oc-runtime-context-hash",children:[o.systemPrompt.hash.slice(0,12),"…"]})]}),O?d.jsx(Nv,{text:O}):null]}),d.jsx("pre",{className:"oc-runtime-context-text",children:O||"(空)"})]}),d.jsxs("section",{className:"oc-runtime-context-section",children:[d.jsxs("header",{className:"oc-runtime-context-section-head",children:[d.jsx("strong",{children:"Session suffix"}),d.jsx("span",{className:"oc-runtime-context-meta",children:o.suffix.present?`${(o.suffix.charCount??0).toLocaleString()} 字`:"未注入"})]}),o.suffix.present?d.jsx("pre",{className:"oc-runtime-context-text",children:o.suffix.text??o.suffix.summary??"已注入"}):d.jsx("p",{className:"oc-runtime-context-empty",children:"本会话无额外 suffix"})]})]}):null,S==="files"?d.jsx(Ts,{title:"Context files",items:A.contextFiles?.map(w=>({name:w.path,path:w.path,description:`${w.characters.toLocaleString()} 字符`})),emptyText:"该 session 未加载任何上下文文件(真实空态)"}):null,S==="skills"?d.jsx(Ts,{title:"Skills",items:A.skills,emptyText:"该 session 未加载任何 Skills(真实空态)"}):null,S==="extensions"?d.jsx(Ts,{title:"Extensions",items:A.extensions,emptyText:"该 session 未加载任何 Extensions(真实空态)"}):null,S==="packages"?d.jsx(Ts,{title:"Packages",items:A.packages,emptyText:"该 session 未配置 Packages(真实空态)"}):null,S==="tools"?d.jsxs("section",{className:"oc-runtime-context-section",children:[d.jsxs("header",{className:"oc-runtime-context-section-head",children:[d.jsx("strong",{children:"Active tools"}),d.jsxs("span",{className:"oc-runtime-context-meta",children:[H," 个"]})]}),N.length===0?d.jsx("p",{className:"oc-runtime-context-empty",children:"无激活工具"}):d.jsx("ul",{className:"oc-runtime-context-tools",children:N.map(w=>d.jsx("li",{children:d.jsx("code",{children:w})},w))}),Array.isArray(A.diagnostics)&&A.diagnostics.length>0?d.jsx("ul",{className:"oc-runtime-context-resources",children:A.diagnostics.map((w,q)=>d.jsxs("li",{children:[d.jsxs("span",{className:`oc-runtime-context-diag is-${w.type??"warning"}`,children:[w.type,": ",w.message]}),w.path?d.jsx("code",{children:w.path}):null]},q))}):null]}):null,S==="raw"?d.jsxs("details",{className:"oc-runtime-context-raw",open:!0,children:[d.jsx("summary",{children:"原始投影 JSON"}),d.jsx("pre",{children:JSON.stringify(o,null,2)})]}):null]})]}),d.jsxs("footer",{className:"oc-runtime-context-foot",children:[d.jsx("span",{className:"oc-runtime-context-meta",children:v?"正在重新加载会话…":"重新加载 Pi 会话设置、扩展、技能、提示词与上下文文件"}),d.jsx("button",{type:"button",className:"btn btn-ghost",disabled:v,onClick:()=>{Pi()},children:"重新加载会话"}),y&&d.jsxs("span",{className:"oc-runtime-context-diag is-error",role:"alert",children:[y.code?`${y.code}:`:"",y.message,d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Pi()},children:"重试"})]})]})]}):null;return c?W:d.jsxs("div",{className:"oc-runtime-context-menu",children:[F,W]})});function DT(){const t=k.useRef(null),r=k.useRef(!1),i=k.useRef(null),l=k.useRef(new Map),o=k.useRef(new Set),c=k.useRef(null),u=k.useRef(null),h=k.useRef(0),g=k.useRef(null),p=k.useRef(new Set),v=k.useRef(new Set),y=k.useRef(new Map),S=k.useRef(null),x=k.useRef(null),C=k.useRef(!1),N=k.useRef(0),H=k.useRef(null),O=k.useRef(!1),I=k.useRef(!1),A=k.useRef(null),F=k.useRef(new Set),W=k.useRef(new Set),w=k.useRef(new Set),q=k.useRef(!1),Q=k.useRef(0);return k.useMemo(()=>({sessionRef:t,streamingRef:r,abortRef:i,sessionAbortControllersRef:l,inlineStreamSessionIdsRef:o,assistantIdRef:c,lastEventIdRef:u,sessionGenerationRef:h,eventsStreamStateRef:g,settledTurnIdsRef:p,seenEventIdsRef:v,turnAssistantIdsRef:y,reconnectAbortRef:S,activeTurnIdRef:x,submitInFlightRef:C,submitGenerationRef:N,pendingSubmissionRef:H,stopInFlightRef:O,stopRequestedRef:I,stoppingTurnIdRef:A,abortPostedTurnIdsRef:F,releasedClientRequestIdsRef:W,usageResponseKeysRef:w,isComposingRef:q,compositionEndedAtRef:Q}),[t,r,i,l,o,c,u,h,g,p,v,y,S,x,C,N,H,O,I,A,F,W,w,q,Q])}const OT=["operation","contract","dag","report","html"];function MT(t){const r=t.artifact;if(!r||typeof r!="object")return;const i=r;if(!(i.schemaVersion!==1||typeof i.artifactId!="string"||!i.artifactId||typeof i.kind!="string"||!OT.includes(i.kind)||typeof i.previewHash!="string")){for(const l of["title","summary","htmlPreview","reportText","inspectHref"])if(i[l]!==void 0&&typeof i[l]!="string")return;return i}}function zT(t,r){const i=t.findIndex(l=>l.artifactId===r.artifactId);return i<0?[...t,r]:t.map((l,o)=>o===i?{...l,...r}:l)}function _T(t){if(!t||typeof t!="object")return;const r=t;if(!(r.schemaVersion!==1||typeof r.cardId!="string"||r.gateType!=="contract-apply"&&r.gateType!=="dag-run"||typeof r.taskId!="string"||typeof r.state!="string"||typeof r.expiresAt!="string"||typeof r.inspectHref!="string"||typeof r.previewHash!="string"))return r}function LT(t,r){const i=t.findIndex(o=>o.cardId===r.cardId);if(i<0)return[...t,r];const l=[...t];return l[i]=r,l}function BT(t,r){const i=t.findIndex(l=>l.operationId===r.operationId);return i<0?[...t,r]:t.map((l,o)=>o===i?{...l,...r}:l)}function HT(t){const r=t.operation;if(!r||typeof r!="object")return;const i=r;if(!(i.schemaVersion!==1||typeof i.operationId!="string"||typeof i.action!="string"||typeof i.state!="string"||typeof i.inspectHref!="string"||typeof i.createdAt!="string"||typeof i.updatedAt!="string"||typeof i.previewHash!="string"))return i}function UT(t){const{refs:r,onReconcile:i,setError:l,setInterview:o,setHumanGateCards:c,setArtifactCards:u,setStreaming:h,setStreamingAssistantId:g,setUnread:p,setOperationCards:v,setUsage:y,setMessages:S,setToolCalls:x}=t;return(C,N,H,O)=>{if(O?.generation!==void 0&&r.sessionGenerationRef.current!==O.generation)return;const I=O?.replay===!0;if(C==="stream_ready")return;if(C==="reconcile"){const w=typeof N.reason=="string"?N.reason:"cursor_expired";i?.({reason:w,...typeof N.minSeq=="number"?{minSeq:N.minSeq}:{},...typeof N.epoch=="string"?{epoch:N.epoch}:{},...typeof N.latestTurnId=="string"?{latestTurnId:N.latestTurnId}:{},...typeof N.latestEventId=="string"?{latestEventId:N.latestEventId}:N.latestEventId===null?{latestEventId:null}:{}});return}const A=N.data&&typeof N.data=="object"?N.data:N,F=typeof N.turnId=="string"?N.turnId:void 0;if(F&&(C==="agent_start"||C==="message_update")&&r.settledTurnIdsRef.current.has(F))return;let W=H;if(F){const w=r.turnAssistantIdsRef.current.get(F);w?W=w:r.turnAssistantIdsRef.current.set(F,H)}if(C==="interview-turn"){o(w=>({...w??{},interviewSessionId:typeof A.interviewSessionId=="string"?A.interviewSessionId:w?.interviewSessionId,taskId:typeof A.taskId=="string"?A.taskId:w?.taskId,state:typeof A.state=="string"?A.state:w?.state,question:A.question&&typeof A.question=="object"?A.question:void 0}));return}if(C==="draft"){o(w=>({...w??{},taskId:typeof A.taskId=="string"?A.taskId:w?.taskId,draft:A.draft&&typeof A.draft=="object"?A.draft:w?.draft,draftSha256:typeof A.draftSha256=="string"?A.draftSha256:w?.draftSha256,taskKindRecommendation:typeof A.taskKindRecommendation=="string"?A.taskKindRecommendation:w?.taskKindRecommendation}));return}if(C==="assessment"){o(w=>({...w??{},assessment:A}));return}if(C==="taskKind-confirmed"){o(w=>({...w??{},confirmedTaskKind:typeof A.taskKind=="string"?A.taskKind:w?.confirmedTaskKind,taskKindRecommendation:void 0}));return}if(C==="human-gate-card"){const w=_T(A);w&&c(q=>LT(q,w));return}if(C==="artifact-ref"){const w=MT(A);w&&u(q=>zT(q,w));return}if(C==="agent_start"){if(I&&F!==void 0&&F!==r.activeTurnIdRef.current)return;F&&(r.settledTurnIdsRef.current.delete(F),r.activeTurnIdRef.current=F),r.streamingRef.current=!0,h(!0),g(W);return}if(C==="agent_settled"||C==="agent_end"){if(F&&r.settledTurnIdsRef.current.add(F),C==="agent_end")return;F===r.activeTurnIdRef.current&&(r.activeTurnIdRef.current=null),r.streamingRef.current=!1,h(!1),g(null),C==="agent_settled"&&!I&&typeof document<"u"&&document.hidden&&p(w=>w+1),S(w=>w.filter(q=>!(q.id===W&&q.role==="assistant"&&!q.text.trim()))),x(w=>w.map(q=>q.status==="running"&&q.assistantMessageId===W?{...q,status:"error",finishedAt:Date.now()}:q));return}if(C==="operation-ref"||C==="operation-status"){const w=HT(A);w&&v(q=>BT(q,w));return}if(C==="usage"){if(I)return;const w=A,q=typeof w.responseKey=="string"&&w.responseKey?w.responseKey:void 0;if(q&&r.usageResponseKeysRef.current.has(q))return;q&&r.usageResponseKeysRef.current.add(q),y(Q=>{const se=w.inputTokens??0,z=w.outputTokens??0,Y=w.cacheReadTokens??0,ne=w.cacheWriteTokens??0,ue=w.totalTokens??se+z+Y+ne;return{inputTokens:Q.inputTokens+se,outputTokens:Q.outputTokens+z,cacheReadTokens:Q.cacheReadTokens+Y,cacheWriteTokens:Q.cacheWriteTokens+ne,totalTokens:Q.totalTokens+ue,cost:w.cost===void 0?Q.cost:(Q.cost??0)+w.cost}});return}if(C==="message_update"||C==="message_end"){if(I)return;const w=typeof A.text=="string"?A.text:"";S(q=>q.some(se=>se.id===W)?q.map(se=>se.id===W?{...se,text:w}:se):[...q,{id:W,role:"assistant",text:w,createdAt:Date.now()}])}else if(C==="tool_call"){const w=typeof A.toolCallId=="string"?A.toolCallId:Fi("t"),q=typeof A.toolName=="string"?A.toolName:"tool",Q=typeof A.argsPreview=="string"?A.argsPreview:"{}",se=Date.now();x(z=>z.some(Y=>Y.id===w)?z.map(Y=>Y.id===w?{...Y,args:Q,status:"running",turnId:F??Y.turnId,assistantMessageId:W}:Y):[...z,{id:w,toolName:q,args:Q,status:"running",createdAt:se,turnId:F,assistantMessageId:W}])}else if(C==="tool_result"){const w=typeof A.toolCallId=="string"?A.toolCallId:Fi("r"),q=typeof A.toolName=="string"?A.toolName:"tool",Q=A.isError===!0,se=typeof A.resultPreview=="string"?A.resultPreview:"{}",z=Date.now();x(Y=>Y.find(ue=>ue.id===w)?Y.map(ue=>ue.id===w?{...ue,result:se,resultText:se,status:Q?"error":"ok",finishedAt:z,turnId:F??ue.turnId,assistantMessageId:ue.assistantMessageId??W}:ue):[...Y,{id:w,toolName:q,result:se,resultText:se,status:Q?"error":"ok",createdAt:z,finishedAt:z,turnId:F,assistantMessageId:W}])}else C==="error"&&l(typeof A.message=="string"?A.message:"chat error")}}const Hc={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,totalTokens:0};function qT(t){const{origin:r,refs:i,sessionId:l,setError:o,onReconcile:c}=t,[u,h]=k.useState([]),[g,p]=k.useState([]),[v,y]=k.useState([]),[S,x]=k.useState([]),[C,N]=k.useState(50),[H,O]=k.useState(0),[I,A]=k.useState([]),[F,W]=k.useState(null),[w,q]=k.useState(null),[Q,se]=k.useState(!1),[z,Y]=k.useState(Hc),[ne,ue]=k.useState(!1),[P,B]=k.useState(null),[D]=k.useState(!1),U=k.useMemo(()=>UT({refs:i,onReconcile:c,setError:o,setInterview:W,setHumanGateCards:A,setArtifactCards:x,setStreaming:ue,setStreamingAssistantId:B,setUnread:O,setOperationCards:y,setUsage:Y,setMessages:h,setToolCalls:p}),[i,c,o]),G=k.useCallback((J,ae,fe)=>{if(fe?.targetSessionId&&i.sessionRef.current?.sessionId!==fe.targetSessionId||fe?.generation!==void 0&&i.sessionGenerationRef.current!==fe.generation)return null;const me=J.split(`
|
|
42
|
-
`);let pe="message",Ie="",Ne=null;for(const it of me)it.startsWith("event: ")?pe=it.slice(7).trim():it.startsWith("data: ")?Ie+=it.slice(6):it.startsWith("id: ")&&(Ne=it.slice(4).trim());if(!Ie)return Ne;let $e;try{$e=JSON.parse(Ie)}catch{return Ne}const Pe=Ne??(typeof $e.eventId=="string"?$e.eventId:null);if(Pe){if(i.seenEventIdsRef.current.has(Pe))return Pe;i.seenEventIdsRef.current.add(Pe)}return U(pe,$e,ae,fe),Ne??Pe},[U,i]),K=k.useCallback(async(J,ae)=>{const fe=ae?.background===!0;fe||se(!0);try{const me=await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(J)}/context`,{credentials:"include"});if(!me.ok)return;const pe=await me.json();pe.context&&i.sessionRef.current?.sessionId===J&&q(Ie=>G1(Ie,pe.context)?Ie:pe.context)}finally{fe||se(!1)}},[r,i]);k.useEffect(()=>{l&&K(l)},[l,K]),k.useEffect(()=>{if(!l)return;const J=window.setTimeout(()=>{K(l,{background:!0})},350);return()=>window.clearTimeout(J)},[l,v,I,F,K]);const T=k.useMemo(()=>u.filter(J=>J.role!=="system"||D).slice(-C),[u,D,C]);k.useEffect(()=>{const J=()=>{document.hidden||O(0)};return document.addEventListener("visibilitychange",J),()=>document.removeEventListener("visibilitychange",J)},[]);const E=k.useMemo(()=>{if(g.length===0)return null;const J=g.filter(Ie=>Ie.status==="running"),ae=g.filter(Ie=>Ie.status==="error"),fe=J[J.length-1];let me="完成",pe="ok";return ae.length>0?(me=`${ae.length} 次出错`,pe="error"):J.length>0?(me=fe?`${fe.toolName} 运行中`:"运行中",pe="running"):me="",{count:g.length,statusLabel:me,statusKind:pe}},[g]),L=k.useMemo(()=>gT({messages:T,toolCalls:g,streaming:ne,activeAssistantId:P}),[T,g,ne,P]),j=k.useCallback(()=>{h([]),p([]),y([]),A([]),x([]),W(null),q(null),Y(Hc),ue(!1),B(null),O(0),N(50),i.usageResponseKeysRef.current=new Set},[i]),te=k.useCallback(J=>{h(J.messages),p(J.toolCalls),y([]),A([]),x([]),q(null),W(null),Y(Hc),i.usageResponseKeysRef.current=new Set,ue(J.streaming),B(null),O(0),N(50)},[i]),de=k.useCallback(async J=>{try{const ae=await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(J)}`,{credentials:"include"});if(!ae.ok)return!1;const fe=await ae.json();if(!fe.session||i.sessionRef.current?.sessionId!==J)return!1;const me=fe.session.activeTurnId??null;return i.activeTurnIdRef.current=me,i.streamingRef.current=!!me,i.lastEventIdRef.current=fe.lastEventId??null,i.seenEventIdsRef.current=new Set,i.turnAssistantIdsRef.current=new Map,h((fe.session.messages??[]).filter(pe=>pe.role==="user"||pe.role==="assistant").map(pe=>({id:pe.id,role:pe.role,text:pe.text,createdAt:Date.parse(pe.at)||Date.now()}))),B(null),!0}catch{return!1}},[r,i,h,B]);return{messages:u,setMessages:h,toolCalls:g,setToolCalls:p,operationCards:v,artifactCards:S,historyLimit:C,setHistoryLimit:N,unread:H,humanGateCards:I,interview:F,setInterview:W,taskContext:w,contextLoading:Q,usage:z,streaming:ne,setStreaming:ue,streamingAssistantId:P,setStreamingAssistantId:B,visibleMessages:T,turnGroups:L,processSummary:E,applyChatSseEvent:U,applySseBlock:G,loadTaskContext:K,resetForNewSession:j,applyActivatedSession:te,recoverSession:de}}class GT{constructor(r){this.options=r,this.fetchFn=r.fetchFn??fetch,this.backoffMs=r.backoffMs??1e3,this.deadlineMs=r.deadlineMs??3e4}options;eligible=new Set;controllers=new Map;fetchFn;backoffMs;deadlineMs;markEligible(r){this.eligible.add(r)}startIfEligible(r){if(!this.eligible.delete(r)||this.controllers.has(r))return;const i=new AbortController;this.controllers.set(r,i),this.run(r,i)}cancel(r){this.eligible.delete(r),this.controllers.get(r)?.abort(),this.controllers.delete(r)}reconcile(r){const i=new Set(r);for(const l of this.controllers.keys())i.has(l)||this.cancel(l)}dispose(){for(const r of this.controllers.values())r.abort();this.controllers.clear(),this.eligible.clear()}async run(r,i){let l;const o=new Set;let c=!1;const u=window.setTimeout(()=>{c=!0,i.abort()},this.deadlineMs);try{for(;!i.signal.aborted;){try{const h={Accept:"text/event-stream"};l&&(h["Last-Event-ID"]=l);const g=await this.fetchFn(`${this.options.origin}/api/operator/v1/chat/sessions/${encodeURIComponent(r)}/events`,{headers:h,credentials:"include",signal:i.signal});if(g.status===404||!g.body)return;if(!g.ok)throw new Error(`HTTP ${g.status}`);const p=g.body.getReader(),v=new TextDecoder;let y="";for(;;){const{done:S,value:x}=await p.read();if(S||i.signal.aborted)break;y+=v.decode(x,{stream:!0});const C=y.split(`
|
|
43
|
-
|
|
44
|
-
`);y=C.pop()??"";for(const N of C){const H=N.split(`
|
|
45
|
-
`).find(I=>I.startsWith("id: "))?.slice(4);if(H&&(l=H),!H||o.has(H)||!N.includes("event: session_title"))continue;const O=N.split(`
|
|
46
|
-
`).find(I=>I.startsWith("data: "))?.slice(6);if(O)try{const I=JSON.parse(O),A=I.data?.title?.trim();if(!A)continue;if(o.add(H),!this.options.hasSession(r)||(this.options.onTitle(r,{title:A,automatic:!!I.data?.automatic}),I.data?.automatic))return}catch{}}}}catch{if(i.signal.aborted)return}i.signal.aborted||await $T(this.backoffMs,i.signal)}}finally{window.clearTimeout(u),this.controllers.get(r)===i&&this.controllers.delete(r),(c||!this.options.hasSession(r))&&this.options.refresh()}}}function $T(t,r){return new Promise(i=>{const l=window.setTimeout(c,t),o=()=>c();function c(){window.clearTimeout(l),r.removeEventListener("abort",o),i()}r.addEventListener("abort",o,{once:!0})})}async function FT(t){if(t.creatingRef?.current)throw new Error("CREATE_SESSION_IN_FLIGHT");t.creatingRef&&(t.creatingRef.current=!0),t.setCreatingSession?.(!0);try{const r=await(t.fetchFn??fetch)(`${t.origin}/api/operator/v1/chat/sessions`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":Kt()},credentials:"include",body:JSON.stringify(t.options??{})});if(!r.ok){const u=await r.json().catch(()=>({}));throw new Error(u.error?.message??`HTTP ${r.status}`)}const i=await r.json();if(!i.session)throw new Error("创建会话响应缺少 durable session");const l=i.session,o={sessionId:l.sessionId,...td(l)},c=[l,...t.sessionListRef.current.filter(u=>u.sessionId!==l.sessionId)].slice(0,Ds);return t.sessionListRef.current=c,t.setSessionList(c),t.titleWatcher?.markEligible(l.sessionId),t.refreshSessionList(),o}finally{t.creatingRef&&(t.creatingRef.current=!1),t.setCreatingSession?.(!1)}}function VT(t){const{origin:r,refs:i,setSession:l,thread:o,composer:c,browser:u,setError:h,setProcessOpen:g,setAutoScroll:p}=t,{applyActivatedSession:v,resetForNewSession:y,setMessages:S}=o,{setInput:x,setPendingImages:C}=c,{setPreviews:N,setActivePreviewPath:H}=u,[O,I]=k.useState([]),A=k.useRef([]);A.current=O;const F=k.useRef(null),[W,w]=k.useState(!1),q=k.useRef(!1),Q=k.useRef(0),se=k.useCallback(()=>{i.sessionGenerationRef.current+=1,i.abortRef.current?.abort(),i.reconnectAbortRef.current?.abort();for(const G of i.sessionAbortControllersRef.current.values())G.abort();i.sessionAbortControllersRef.current.clear(),i.reconnectAbortRef.current=null,i.eventsStreamStateRef.current=null,i.streamingRef.current=!1,i.abortRef.current=null,i.assistantIdRef.current=null,i.lastEventIdRef.current=null,i.seenEventIdsRef.current=new Set,i.turnAssistantIdsRef.current=new Map,i.settledTurnIdsRef.current=new Set,i.activeTurnIdRef.current=null,y(),x(""),C([]),N([]),H(null),g(!1),p(!0)},[i,y,x,C,N,H,g,p]),z=k.useCallback(async()=>{try{const G=await fetch(`${r}/api/operator/v1/chat/sessions`,{credentials:"include"});if(!G.ok)return;const K=(await G.json()).sessions??[],T=K.slice(0,Ds),E=K.slice(Ds);if(I(T),E.length===0)return;await Promise.all(E.map(j=>fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(j.sessionId)}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":Kt()}}).catch(()=>{})));const L=i.sessionRef.current?.sessionId;L&&E.some(j=>j.sessionId===L)&&(Q.current+=1,i.sessionRef.current=null,se(),l(null),window.localStorage.removeItem(wn))}catch{}},[r,i,se,l]),Y=k.useCallback(async G=>{if(window.confirm("确定删除该会话?删除后不可恢复。"))try{if(!(await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(G)}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":Kt()}})).ok){h("删除会话失败");return}F.current?.cancel(G),i.sessionRef.current?.sessionId===G&&(Q.current+=1,i.sessionRef.current=null,se(),l(null),window.localStorage.removeItem(wn)),await z()}catch(K){h(K instanceof Error?K.message:String(K))}},[r,i,l,se,z,h]),ne=k.useCallback(async G=>{const K=++Q.current;try{const T=await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(G)}`,{credentials:"include"}),E=await T.json();if(!T.ok||!E.session)throw new Error(E.error?.message??"会话不可用");if(K!==Q.current)return;const L={sessionId:E.session.sessionId,...td(E.session)};se(),i.sessionRef.current=L,i.streamingRef.current=!!E.session.activeTurnId,i.activeTurnIdRef.current=E.session.activeTurnId??null,i.seenEventIdsRef.current=new Set,i.turnAssistantIdsRef.current=new Map,i.settledTurnIdsRef.current=new Set,i.lastEventIdRef.current=null,l(L),i.assistantIdRef.current=null,i.abortRef.current=i.sessionAbortControllersRef.current.get(G)??null,C([]),N([]),x(E.session.composerDraft??"");const j=pT(E.session.messages??[]);v({messages:j.messages,toolCalls:j.toolCalls,streaming:!!E.session.activeTurnId}),window.localStorage.setItem(wn,G),H(null)}catch(T){if(K!==Q.current)return;h(T instanceof Error?T.message:String(T))}},[r,i,l,C,N,x,v,se,H,h]);k.useEffect(()=>{z()},[z]),F.current||(F.current=new GT({origin:r,hasSession:G=>A.current.some(K=>K.sessionId===G),onTitle:(G,K)=>{I(T=>T.map(E=>E.sessionId!==G||K.automatic&&E.title?E:K.automatic?{...E,title:K.title}:{...E,displayTitle:K.title}))},refresh:z}));const ue=k.useCallback(G=>F.current?.startIfEligible(G),[]);k.useEffect(()=>{F.current?.reconcile(O.filter(G=>G.state!=="archived"&&!G.title).map(G=>G.sessionId))},[O]),k.useEffect(()=>()=>F.current?.dispose(),[]),k.useEffect(()=>{let G=!1;const K=window.localStorage.getItem(wn);if(!K)return;const T=++Q.current;return(async()=>{try{const E=await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(K)}`,{credentials:"include"});if(!E.ok){window.localStorage.removeItem(wn);return}const L=await E.json();if(G||T!==Q.current||!L.session)return;const j={sessionId:L.session.sessionId,...td(L.session)};i.sessionGenerationRef.current+=1,i.sessionRef.current=j,i.activeTurnIdRef.current=L.session.activeTurnId??null,i.seenEventIdsRef.current=new Set,i.turnAssistantIdsRef.current=new Map,i.settledTurnIdsRef.current=new Set,i.lastEventIdRef.current=null,l(j),x(L.session.composerDraft??""),S((L.session.messages??[]).filter(te=>te.role==="user"||te.role==="assistant").map(te=>({id:te.id,role:te.role,text:te.text,createdAt:Date.parse(te.at)||Date.now()})))}catch{}})(),()=>{G=!0}},[r,i,l,x,S]);const P=k.useCallback(G=>FT({origin:r,sessionListRef:A,setSessionList:I,titleWatcher:F.current,refreshSessionList:z,options:G,setCreatingSession:w,creatingRef:q}),[r,z]),B=k.useCallback(async G=>{if(q.current)return null;const K=++Q.current;h(null);try{const T=await P(G);return K!==Q.current?null:(se(),i.sessionRef.current=T,window.localStorage.setItem(wn,T.sessionId),l(T),T)}catch(T){if(K!==Q.current)return null;const E=T instanceof Error?T.message:String(T);return E!=="CREATE_SESSION_IN_FLIGHT"&&h(E),null}},[i,l,h,se,P]),D=k.useCallback(async()=>{const G=i.sessionRef.current;if(!(!G||i.streamingRef.current))try{const K=await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(G.sessionId)}/compact`,{method:"POST",credentials:"include",headers:{"x-loop-console-confirmation":Kt()}}),T=await K.json().catch(()=>({}));if(!K.ok){h(T.error?.message??"上下文压缩失败");return}h(null)}catch(K){h(K instanceof Error?K.message:"上下文压缩失败")}},[r,i,h]);return{sessionList:O,creatingSession:W,activateSession:ne,refreshSessionList:z,deleteSession:Y,createSession:B,updateSession:async(G,K)=>{if(!(await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(G)}`,{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":Kt()},body:JSON.stringify(K)})).ok){h("会话更新失败");return}await z(),K.state==="archived"&&F.current?.cancel(G),K.state==="archived"&&i.sessionRef.current?.sessionId===G&&(Q.current+=1,i.sessionRef.current=null,se(),l(null),window.localStorage.removeItem(wn))},watchSessionTitle:ue,compactSession:D}}function Vi(t){const r=(t??"").trim();return r?/controller identity changed|package fingerprint changed|entry binary sha256 changed/i.test(r)?"控制器版本已变更(Console 启动后代码被重新编译)。请重启 Console 后再试,一次会话中途不要升级/重建控制器。":/Pi session file missing or not openable|cannot reopen chat session .* no persisted Pi session file/i.test(r)?"该对话的 Pi 会话文件已丢失,无法恢复上下文。请新建对话继续(历史记录无法重开)。":/reopened Pi sessionId mismatch/i.test(r)?"重开对话失败:Pi 会话身份与记录不一致(常见于会话文件丢失后被误建)。请新建对话继续。":/base HEAD .+ != frozen baseCommit|exact-base|not a descendant of frozen baseCommit/i.test(r)?"主分支已相对夜间冻结的 baseCommit 前进,无法安全 fast-forward harvest。请人工核对后使用 Discard(必要时勾选强制),或改走日间合并流程。":/force-required|requires --force/i.test(r)?"该终态需要强制 Discard。请确认后勾选强制再试。":r:"操作失败"}function YT(t){let r;const i=new Promise(l=>{r=l});return{...t,outcomePromise:i,resolveOutcome:r}}function Gg(t="network error while creating turn"){return{kind:"ambiguous",message:t}}function PT(t="无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"){return{kind:"ambiguous",message:t}}function $g(t){const{body:r,clientRequestId:i}=t,l=r.error?.code,o=r.error?.message??(t.httpOk?"turn was not accepted":`HTTP ${t.status}`);if(l==="TURN_ACTIVE"&&r.activeTurn?.turnId)return{kind:"adopt-active",activeTurn:r.activeTurn,message:"上一轮仍在运行,已重新连接;当前消息已保留。"};if(r.accepted===!0||t.httpOk&&r.turnId){const c=r.turn?.turnId??r.turnId;return c?{kind:"accepted",turnId:c,idempotent:r.idempotent===!0,turn:r.turn??{turnId:c,clientRequestId:i,state:r.state}}:{kind:"ambiguous",message:o}}return r.accepted===!1||l?{kind:"rejected",code:l,message:o}:{kind:"ambiguous",message:o}}function KT(t){const r=t.clientRequestId,i=t.state?.activeTurn,l=t.state?.latestTurn;return i?.clientRequestId===r&&i.turnId?{kind:"accepted",turnId:i.turnId,idempotent:!0,turn:i}:l?.clientRequestId===r&&l.turnId?{kind:"accepted",turnId:l.turnId,idempotent:!0,turn:l}:i?.turnId?{kind:"adopt-active",activeTurn:i,message:"上一轮仍在运行,已重新连接;当前消息已保留。"}:null}function XT(t){const r=t.clientRequestId,i=t.state?.activeTurn,l=t.state?.latestTurn,o=i?.state??t.state?.activeTurnState??void 0,c=l?.state??t.state?.latestTurnState??void 0;if(i?.clientRequestId===r&&i.turnId)return Wr(o)?{action:"release-terminal",turnId:i.turnId,state:String(o)}:{action:"bind-active",turnId:i.turnId};if(l?.clientRequestId===r&&l.turnId){if(Wr(c))return{action:"release-terminal",turnId:l.turnId,state:String(c)};if(!i?.turnId||i.clientRequestId===r)return{action:"bind-active",turnId:l.turnId}}return!Hs(t.state)&&!(!!i?.turnId&&i?.clientRequestId!==r)?{action:"release-not-accepted"}:{action:"hold"}}function Hs(t){if(t?.activeTurnId||t?.activeTurn?.turnId)return!0;const r=t?.runtime;return r?r.isStreaming===!0||r.isPromptRunning===!0||r.isCompacting===!0||r.isBashRunning===!0:!1}function Wr(t){return t==="settled"||t==="aborted"||t==="failed"}function Us(t){return t.pending.sessionId===t.sessionId&&t.pending.sessionGeneration===t.sessionGeneration&&t.pending.submitGeneration===t.submitGeneration}function QT(t,r){return`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(r)}/turns`}function Fg(t,r){return`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(r)}/state`}function ZT(t,r){return`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(r)}/events`}function JT(t,r,i){return`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(r)}/turns/${encodeURIComponent(i)}/abort`}function Wi(t,r){const i=t.pendingSubmission;r&&i&&i.clientRequestId!==r||(t.submitInFlight=!1,(!r||i?.clientRequestId===r)&&(i?.clientRequestId?t.releasedClientRequestIds.add(i.clientRequestId):r&&t.releasedClientRequestIds.add(r),t.pendingSubmission=null),t.pendingSubmission||(t.stopRequested=!1))}function Dv(t){t.stopRequested=!0}function qs(t){t.stopRequested=!1}function WT(t,r){return!(!r||t.abortPostedTurnIds.has(r))}function eE(t,r){r&&t.abortPostedTurnIds.add(r)}function Gs(t,r){return!t.stopRequested||!WT(t,r)?null:(eE(t,r),t.stoppingTurnId=r,t.activeTurnId=r,r)}function Vg(t,r){const i=t.pendingSubmission;return i&&i.clientRequestId!==r.clientRequestId?!1:(r.turnId&&t.settledTurnIds.add(r.turnId),Wi(t,r.clientRequestId),qs(t),r.markIdle!==!1&&(t.streaming=!1,t.activeTurnId=null,t.assistantId=null,t.stoppingTurnId=null),!0)}function tE(t,r){return Us({pending:r.pending,sessionId:t.sessionId,sessionGeneration:t.sessionGeneration,submitGeneration:t.submitGeneration})?(r.pending.acceptedTurnId=r.turnId,t.activeTurnId=r.turnId,t.turnAssistantIds.set(r.turnId,r.assistantId),t.streaming=!0,t.submitInFlight=!1,r.pending.resolveOutcome({kind:"accepted",turnId:r.turnId}),r.ui?.setStreaming(!0),r.ui?.setStreamingAssistantId(r.assistantId),r.ui?.setPendingImages([]),r.ui?.watchSessionTitle?.(r.sessionId),!0):(r.pending.resolveOutcome({kind:"stale"}),!1)}function nE(t,r){r.pending.resolveOutcome({kind:"adopt-active",activeTurn:{turnId:r.activeTurnId},message:r.message}),Wi(t,r.pending.clientRequestId),r.current&&(r.ui?.clearEmptyAssistant(r.assistantId),r.ui?.setInput(r.text),r.ui?.setPendingImages(r.images),t.activeTurnId=r.activeTurnId,t.assistantId=null,t.streaming=!0,r.ui?.setStreaming(!0),r.ui?.setStreamingAssistantId(null),r.notice.setError(null),r.notice.showNotice(r.message))}function rE(t,r){if(r.pending.resolveOutcome({kind:"rejected",message:r.message}),Wi(t,r.pending.clientRequestId),!r.current)return;const i=r.ui?.formatError?r.ui.formatError(r.message):r.message;r.ui?.setError(i),t.streaming=!1,t.assistantId=null,r.ui?.setStreaming(!1),r.ui?.setStreamingAssistantId(null),r.ui?.clearEmptyAssistant(r.assistantId),r.ui?.setInput(r.text),r.ui?.setPendingImages(r.images)}function iE(t,r,i){const l=Us({pending:i.pending,sessionId:t.sessionId,sessionGeneration:t.sessionGeneration,submitGeneration:t.submitGeneration});if(r.kind==="accepted"){if(tE(t,{turnId:r.turnId,assistantId:i.assistantId,pending:i.pending,sessionId:i.sessionId,ui:i.acceptedUi})){const c=Gs(t,r.turnId);c&&i.onAutoAbort?.(c)}return}if(r.kind==="adopt-active"){const o=l?Gs(t,r.activeTurn.turnId):null;nE(t,{activeTurnId:r.activeTurn.turnId,message:r.message,assistantId:i.assistantId,text:i.text,images:i.images,pending:i.pending,current:l,notice:i.notice,ui:i.adoptUi}),o&&i.onAutoAbort?.(o);return}if(r.kind==="rejected"){rE(t,{message:r.message,assistantId:i.assistantId,text:i.text,images:i.images,pending:i.pending,current:l,ui:i.rejectedUi}),qs(t);return}if(r.kind==="stale"){i.pending.resolveOutcome(r),Wi(t,i.pending.clientRequestId),qs(t);return}i.pending.resolveOutcome(r)}function aE(t,r,i,l){const o=t.pendingSubmission;if(!o)return"held";if(r.action==="bind-active"){const u=!!o.acceptedTurnId;u||(o.acceptedTurnId=r.turnId,t.activeTurnId=r.turnId,t.turnAssistantIds.set(r.turnId,o.assistantId),t.streaming=!0,t.submitInFlight=!1);const h=Gs(t,r.turnId);return h&&l?.onAutoAbort?.(h),u?"held":"bound"}if(r.action==="release-terminal"||r.action==="release-not-accepted")return r.action==="release-terminal"&&t.settledTurnIds.add(r.turnId),Wi(t,o.clientRequestId),qs(t),Hs(i)||(t.streaming=!1,t.activeTurnId=null,t.assistantId=null,t.stoppingTurnId=null,l?.markIdle?.()),"released";const c=i?.activeTurn?.turnId??i?.activeTurnId??null;return c&&(t.activeTurnId=c),"held"}const lE="正在停止…",sE="正在停止…",oE="停止请求未完成,正在与服务端对账…",uE="停止请求失败,正在与服务端对账…";function Yg(t){t.showNotice(lE)}function Pg(t){if(t.networkError)return{action:"keep-busy-notice",message:uE};const r=t.body.turn?.state;return t.body.accepted===!0&&Wr(r)?{action:"terminal-idle",turnId:t.turnId}:t.body.error?.code==="TURN_ABORT_PENDING"?{action:"abort-pending-notice"}:t.body.error?.code==="CHAT_TURN_OWNER_LOST"||t.body.error?.code==="OWNER_LOST"?{action:"owner-lost-reconcile"}:t.httpOk?{action:"noop"}:{action:"keep-busy-notice",message:oE}}function Uc(t,r,i,l){const o=l?.sessionStillCurrent!==!1;if(r.action==="terminal-idle"){if(!o)return;t.settledTurnIds.add(r.turnId),t.streaming=!1,t.activeTurnId=null,t.assistantId=null,t.stoppingTurnId=null,l?.markIdle?.();return}if(r.action==="abort-pending-notice"){i.showNotice(sE);return}if(r.action==="owner-lost-reconcile"){if(!o)return;l?.runtimeBusy||(t.stoppingTurnId&&t.settledTurnIds.add(t.stoppingTurnId),t.streaming=!1,t.activeTurnId=null,t.assistantId=null,t.stoppingTurnId=null,l?.markIdle?.());return}if(r.action==="keep-busy-notice"){i.showNotice(r.message);return}}function Kg(t,r){Dv(t);const i=t.activeTurnId??t.pendingSubmission?.acceptedTurnId??null;if(i){const l=Gs(t,i);return l?(r.notice&&Yg(r.notice),r.postAbort(l),{abortedTurnId:l,stopRequested:!0}):{abortedTurnId:null,stopRequested:!0}}return r.notice&&Yg(r.notice),{abortedTurnId:null,stopRequested:!0}}function Zn(t){return{submitInFlight:t.submitInFlightRef.current,pendingSubmission:t.pendingSubmissionRef.current,activeTurnId:t.activeTurnIdRef.current,streaming:t.streamingRef.current,assistantId:t.assistantIdRef.current,stoppingTurnId:t.stoppingTurnIdRef.current,settledTurnIds:t.settledTurnIdsRef.current,turnAssistantIds:t.turnAssistantIdsRef.current,sessionId:t.sessionRef.current?.sessionId??null,sessionGeneration:t.sessionGenerationRef.current,submitGeneration:t.submitGenerationRef.current,stopInFlight:t.stopInFlightRef.current,stopRequested:t.stopRequestedRef.current,abortPostedTurnIds:t.abortPostedTurnIdsRef.current,releasedClientRequestIds:t.releasedClientRequestIdsRef.current}}function An(t,r){t.submitInFlightRef.current=r.submitInFlight,t.pendingSubmissionRef.current=r.pendingSubmission,t.activeTurnIdRef.current=r.activeTurnId,t.streamingRef.current=r.streaming,t.assistantIdRef.current=r.assistantId,t.stoppingTurnIdRef.current=r.stoppingTurnId,t.submitGenerationRef.current=r.submitGeneration,t.stopInFlightRef.current=r.stopInFlight,t.stopRequestedRef.current=r.stopRequested}function cE(t){return t.split(`
|
|
47
|
-
`).find(r=>r.startsWith("event: "))?.slice(7).trim()??"message"}function dE(){return new Promise(t=>window.setTimeout(t,25))}function qc(t,r){r&&t(i=>i.filter(l=>!(l.id===r&&l.role==="assistant"&&!l.text.trim())))}function fE(t){const{origin:r,refs:i,session:l,thread:o,composer:c,setError:u,setAutoScroll:h,setNotice:g,recoveryVersion:p=0,watchSessionTitle:v}=t,{applySseBlock:y,setMessages:S,setStreaming:x,setStreamingAssistantId:C,streaming:N}=o,{setInput:H,setPendingImages:O}=c,I=k.useCallback(B=>{g&&g({id:Date.now(),message:B})},[g]),A=k.useCallback(B=>{const D=Zn(i);Wi(D,B),An(i,D)},[i]),F=k.useCallback((B,D,U)=>{i.sessionRef.current?.sessionId!==B||i.sessionGenerationRef.current!==D||(i.streamingRef.current=!1,i.activeTurnIdRef.current=null,i.assistantIdRef.current=null,i.stoppingTurnIdRef.current=null,x(!1),C(null),qc(S,U))},[i,x,C,S]),W=k.useCallback(async(B,D,U)=>{for(;!U.aborted;){const G=i.eventsStreamStateRef.current;if(!G||G.sessionId!==B||G.generation!==D)return;G.ready=!1;try{const K={Accept:"text/event-stream"},T=i.lastEventIdRef.current;T&&(K["Last-Event-ID"]=T);const E=await fetch(ZT(r,B),{headers:K,credentials:"include",signal:U});if(!E.ok||!E.body){if(E.status===404)return;await xc(2e3,U);continue}const L=E.body.getReader(),j=new TextDecoder;let te="",de=!0;const J=Fi("a");for(;;){const{done:fe,value:me}=await L.read();if(fe)break;te+=j.decode(me,{stream:!0});const pe=te.split(`
|
|
48
|
-
|
|
49
|
-
`);te=pe.pop()??"";for(const Ie of pe){if(cE(Ie)==="stream_ready"){const Pe=i.eventsStreamStateRef.current;Pe?.sessionId===B&&Pe.generation===D&&(Pe.ready=!0),de=!1;continue}const Ne=i.assistantIdRef.current??J,$e=y(Ie,Ne,{replay:de,targetSessionId:B,generation:D});$e&&(i.lastEventIdRef.current=$e)}}const ae=i.eventsStreamStateRef.current;ae?.sessionId===B&&ae.generation===D&&(ae.ready=!1),await xc(1e3,U)}catch{if(U.aborted)return;await xc(2e3,U)}}},[r,i,y]),w=k.useCallback((B,D)=>{const U=i.eventsStreamStateRef.current;if(U?.sessionId===B&&U.generation===D&&i.reconnectAbortRef.current)return;i.reconnectAbortRef.current?.abort();const G=new AbortController;i.reconnectAbortRef.current=G,i.eventsStreamStateRef.current={sessionId:B,generation:D,ready:!1},W(B,D,G.signal)},[i,W]),q=k.useCallback(async(B,D)=>{w(B,D);const U=Date.now()+5e3;for(;Date.now()<U;){const G=i.eventsStreamStateRef.current;if(G?.sessionId===B&&G.generation===D&&G.ready)return;if(i.sessionRef.current?.sessionId!==B||i.sessionGenerationRef.current!==D)throw new Error("会话已切换");await dE()}throw new Error("事件连接未就绪,请检查 Console 连接后重试")},[i,w]),Q=k.useCallback(async B=>{try{const D=await fetch(Fg(r,B),{credentials:"include"}),U=await D.json().catch(()=>({}));return D.ok?U.state??null:null}catch{return null}},[r]),se=k.useCallback(async B=>{try{const D=await fetch(QT(r,B.sessionId),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":Kt()},credentials:"include",body:JSON.stringify({clientRequestId:B.clientRequestId,text:B.text.trim()||"请查看附件图片。",images:B.images.map(({type:G,mimeType:K,data:T})=>({type:G,mimeType:K,data:T}))})}),U=await D.json().catch(()=>({}));return{httpOk:D.ok,status:D.status,body:U}}catch{return{httpOk:!1,status:0,body:{},networkError:!0}}},[r]),z=k.useCallback(()=>({showNotice:I,setError:B=>u(B)}),[I,u]),Y=k.useCallback(async(B,D,U)=>{i.stoppingTurnIdRef.current=U,i.streamingRef.current=!0,x(!0);try{const G=await fetch(JT(r,B,U),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":Kt()},credentials:"include",body:"{}"}),K=await G.json().catch(()=>({}));if(i.sessionRef.current?.sessionId!==B||i.sessionGenerationRef.current!==D||i.stoppingTurnIdRef.current!==U)return;const T=Pg({httpOk:G.ok,turnId:U,body:K}),E=Zn(i);if(E.stoppingTurnId=U,T.action==="owner-lost-reconcile"){const L=await Q(B),j=i.sessionRef.current?.sessionId===B&&i.sessionGenerationRef.current===D;Uc(E,T,z(),{sessionStillCurrent:j,runtimeBusy:Hs(L??void 0),markIdle:()=>F(B,D,i.assistantIdRef.current)}),An(i,E);return}Uc(E,T,z(),{sessionStillCurrent:!0,markIdle:()=>F(B,D,i.assistantIdRef.current)}),An(i,E)}catch{const G=Zn(i);Uc(G,Pg({httpOk:!1,turnId:U,body:{},networkError:!0}),z()),An(i,G)}},[r,i,x,F,Q,z]),ne=k.useCallback((B,D)=>{const U=Zn(i);U.sessionId=i.sessionRef.current?.sessionId??null,U.sessionGeneration=i.sessionGenerationRef.current,U.submitGeneration=i.submitGenerationRef.current;const G=K=>{O(K)};iE(U,B,{assistantId:D.assistantId,text:D.text,images:D.images,pending:D.pending,sessionId:D.sessionId,notice:z(),acceptedUi:{setStreaming:x,setStreamingAssistantId:C,setPendingImages:G,watchSessionTitle:v},adoptUi:{clearEmptyAssistant:K=>qc(S,K),setInput:H,setPendingImages:G,setStreaming:x,setStreamingAssistantId:C},rejectedUi:{setError:u,setStreaming:x,setStreamingAssistantId:C,clearEmptyAssistant:K=>qc(S,K),setInput:H,setPendingImages:G,formatError:Vi},onAutoAbort:K=>{Y(D.sessionId,D.generation,K)}}),An(i,U)},[i,z,x,C,O,v,S,H,u,Y]),ue=k.useCallback(async(B,D)=>{const U=i.sessionRef.current,G=i.sessionGenerationRef.current;if(!U||!B.trim()&&D.length===0||i.streamingRef.current||i.submitInFlightRef.current||i.pendingSubmissionRef.current)return;i.submitInFlightRef.current=!0;const K=++i.submitGenerationRef.current,T=Fi("chat-submit"),E=Fi("u"),L=Fi("a"),j=B.trim(),te=D.slice(),de=YT({clientRequestId:T,submitGeneration:K,sessionId:U.sessionId,sessionGeneration:G,text:j,images:te,assistantId:L,userMessageId:E});i.pendingSubmissionRef.current=de;try{await q(U.sessionId,G)}catch(pe){i.sessionRef.current?.sessionId===U.sessionId&&i.sessionGenerationRef.current===G&&u(Vi(pe instanceof Error?pe.message:String(pe))),A(T);return}if(i.sessionRef.current?.sessionId!==U.sessionId||i.sessionGenerationRef.current!==G){A(T);return}const J={id:E,role:"user",text:j,createdAt:Date.now()};S(pe=>[...pe,J,{id:L,role:"assistant",text:"",createdAt:Date.now()}]),H(""),h(!0),u(null),i.streamingRef.current=!0,i.assistantIdRef.current=L,x(!0),C(L);const ae={sessionId:U.sessionId,generation:G,submitGeneration:K,assistantId:L,text:j,images:te,pending:de},fe=await se({sessionId:U.sessionId,clientRequestId:T,text:j,images:te});if(!Us({pending:de,sessionId:i.sessionRef.current?.sessionId,sessionGeneration:i.sessionGenerationRef.current,submitGeneration:i.submitGenerationRef.current})){de.resolveOutcome({kind:"stale"}),A(T);return}let me=fe.networkError?Gg():$g({httpOk:fe.httpOk,status:fe.status,body:fe.body,clientRequestId:T});if(me.kind==="ambiguous"){const pe=await Q(U.sessionId),Ie=pe?KT({clientRequestId:T,state:pe}):null;if(Ie)me=Ie;else{const Ne=await se({sessionId:U.sessionId,clientRequestId:T,text:j,images:te});if(!Us({pending:de,sessionId:i.sessionRef.current?.sessionId,sessionGeneration:i.sessionGenerationRef.current,submitGeneration:i.submitGenerationRef.current})){de.resolveOutcome({kind:"stale"}),A(T);return}if(me=Ne.networkError?Gg("无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"):$g({httpOk:Ne.httpOk,status:Ne.status,body:Ne.body,clientRequestId:T}),me.kind==="ambiguous"){const $e=me.message||"无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)";me=PT($e),I($e)}}}ne(me,ae)},[r,i,q,se,Q,ne,A,I,S,H,h,u,x,C]),P=k.useCallback(async()=>{const B=i.sessionRef.current?.sessionId,D=i.sessionGenerationRef.current;if(!B)return;const U=Zn(i),G=Kg(U,{postAbort:()=>{},notice:z()});if(An(i,U),G.abortedTurnId){if(i.stopInFlightRef.current)return;i.stopInFlightRef.current=!0;try{await Y(B,D,G.abortedTurnId)}finally{i.stopInFlightRef.current=!1}return}const K=i.pendingSubmissionRef.current;if(K&&!i.stopInFlightRef.current){i.stopInFlightRef.current=!0;try{const T=await K.outcomePromise;if(i.sessionRef.current?.sessionId!==B||i.sessionGenerationRef.current!==D)return;let E=null;if(T.kind==="accepted")E=T.turnId;else if(T.kind==="adopt-active")E=T.activeTurn.turnId;else{if(T.kind==="ambiguous")return;i.stopRequestedRef.current=!1;return}if(!E)return;const L=Zn(i);Dv(L);const j=Kg(L,{postAbort:()=>{},notice:z()});An(i,L),j.abortedTurnId&&await Y(B,D,j.abortedTurnId)}finally{i.stopInFlightRef.current=!1}}},[i,z,Y]);return k.useEffect(()=>{const B=!!i.pendingSubmissionRef.current||i.submitInFlightRef.current||i.stopRequestedRef.current||!!i.activeTurnIdRef.current;if(!l||!N&&!B)return;const D=l.sessionId,U=i.sessionGenerationRef.current;let G=!1;const K=async()=>{try{const j=await fetch(Fg(r,D),{credentials:"include"}),te=await j.json().catch(()=>({}));if(G||!j.ok||i.sessionRef.current?.sessionId!==D||i.sessionGenerationRef.current!==U)return;const de=te.state,J=i.pendingSubmissionRef.current;if(J){const Ne=XT({clientRequestId:J.clientRequestId,state:de}),$e=Zn(i),Pe=aE($e,Ne,de,{markIdle:()=>F(D,U,i.assistantIdRef.current),onAutoAbort:it=>{Y(D,U,it)}});if(An(i,$e),Pe==="bound"){x(!0);return}if(Pe==="released"||!J.acceptedTurnId&&!$e.pendingSubmission?.acceptedTurnId)return}const ae=de?.activeTurn?.turnId??de?.activeTurnId??null;i.activeTurnIdRef.current=ae;const fe=Hs(de),me=i.pendingSubmissionRef.current;if(me){const Ne=de?.latestTurn?.clientRequestId===me.clientRequestId&&Wr(de?.latestTurn?.state),$e=de?.activeTurn?.clientRequestId===me.clientRequestId&&Wr(de?.activeTurn?.state);if(Ne||$e){const Pe=$e?de?.activeTurn?.turnId??null:de?.latestTurn?.turnId??me.acceptedTurnId??null,it=Zn(i);Vg(it,{clientRequestId:me.clientRequestId,turnId:Pe,markIdle:!fe}),An(i,it),fe||F(D,U,i.assistantIdRef.current);return}}if(fe)return;const pe=i.assistantIdRef.current;if(ae&&!(Wr(de?.activeTurn?.state)||Wr(de?.activeTurnState)))return;ae&&i.settledTurnIdsRef.current.add(ae);const Ie=me?.clientRequestId;if(Ie){const Ne=Zn(i);Vg(Ne,{clientRequestId:Ie,turnId:ae,markIdle:!0}),An(i,Ne)}else A();F(D,U,pe)}catch{}},T=()=>{document.visibilityState==="visible"&&K()},E=()=>{K()},L=window.setInterval(()=>{K()},15e3);return document.addEventListener("visibilitychange",T),window.addEventListener("online",E),K(),()=>{G=!0,window.clearInterval(L),document.removeEventListener("visibilitychange",T),window.removeEventListener("online",E)}},[r,i,l,N,F,A,Y]),k.useEffect(()=>{if(!l)return;const B=i.sessionGenerationRef.current;return w(l.sessionId,B),()=>{const D=i.eventsStreamStateRef.current;D?.sessionId===l.sessionId&&D.generation===B&&(i.reconnectAbortRef.current?.abort(),i.reconnectAbortRef.current=null,i.eventsStreamStateRef.current=null)}},[l,p,i,w]),{sendPrompt:ue,handleStop:P,openEventsStream:W}}function hE(t){const{origin:r,refs:i,thread:l,setError:o}=t,{interview:c,setInterview:u}=l,[h,g]=k.useState(""),p=k.useCallback(async()=>{const S=i.sessionRef.current;if(!S)return;const x=window.prompt("Task ID(例如 2026-07-26-my-task)")?.trim();if(!x)return;const C=await fetch(`${r}/api/operator/v1/chat/sessions/${S.sessionId}/interviews`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":Kt()},credentials:"include",body:JSON.stringify({taskId:x})}),N=await C.json();if(!C.ok){o(N.error?.message??`HTTP ${C.status}`);return}u({interviewSessionId:N.interview?.sessionId,taskId:x,state:N.interview?.state,question:N.question,draft:N.draft?.draft,draftSha256:N.draft?.draftSha256,assessment:N.assessment})},[r,i,u,o]),v=k.useCallback(async S=>{const x=i.sessionRef.current;if(!x||!c?.interviewSessionId||!c.question)return;const C=await fetch(`${r}/api/operator/v1/chat/sessions/${x.sessionId}/interviews/${c.interviewSessionId}/answers`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":Kt()},credentials:"include",body:JSON.stringify({questionId:c.question.id,response:S,...S==="override"?{text:h}:{}})}),N=await C.json();if(!C.ok){o(N.error?.message??`HTTP ${C.status}`);return}u(H=>({...H??{},state:N.interview?.state,question:N.question,draft:N.draft?.draft,draftSha256:N.draft?.draftSha256,assessment:N.assessment,taskKindRecommendation:N.taskKindRecommendation??H?.taskKindRecommendation})),g("")},[r,i,c,h,u,o]),y=k.useCallback(async()=>{const S=i.sessionRef.current;if(!S||!c?.interviewSessionId||!c.taskKindRecommendation)return;const x=await fetch(`${r}/api/operator/v1/chat/sessions/${S.sessionId}/interviews/${c.interviewSessionId}/task-kind/confirm`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":Kt()},credentials:"include",body:JSON.stringify({taskKind:c.taskKindRecommendation})}),C=await x.json();if(!x.ok){o(C.error?.message??`HTTP ${x.status}`);return}u(N=>({...N??{},confirmedTaskKind:N?.taskKindRecommendation,taskKindRecommendation:void 0,draft:C.draft?.draft,draftSha256:C.draft?.draftSha256,assessment:C.assessment}))},[r,i,c,u,o]);return{interviewAnswer:h,setInterviewAnswer:g,startInterview:p,answerInterview:v,confirmTaskKind:y}}function mE(t){const{origin:r,refs:i,sessionId:l,setError:o}=t,[c,u]=k.useState({}),[h,g]=k.useState(new Set),[p,v]=k.useState(null),[y,S]=k.useState([]),[x,C]=k.useState(null),[N,H]=k.useState(!1),O=k.useCallback(async(W="")=>{try{v(null);const w=await fetch(`${r}/api/operator/v1/chat/repo/tree?path=${encodeURIComponent(W)}`,{credentials:"include"}),q=await w.json();if(!w.ok)throw new Error(q.error?.message??"无法读取仓库目录");u(Q=>({...Q,[W]:q.data?.entries??[]}))}catch(w){v(w instanceof Error?w.message:String(w))}},[r]);k.useEffect(()=>{O()},[O]);const I=k.useCallback(async W=>{H(!0);try{const w=await fetch(`${r}/api/operator/v1/chat/repo/file?path=${encodeURIComponent(W)}`,{credentials:"include"}),q=await w.json();if(!w.ok||!q.data)throw new Error(q.error?.message??"无法预览文件");S(Q=>{const se=[...Q.filter(Y=>Y.path!==q.data.path),q.data],z=i.sessionRef.current?.sessionId;return z&&window.localStorage.setItem(`${wn}.previews.${z}`,JSON.stringify(se.map(Y=>Y.path))),se}),C(q.data.path)}catch(w){o(w instanceof Error?w.message:String(w))}finally{H(!1)}},[r,i,o]);k.useEffect(()=>{if(!l)return;let W=[];try{const w=JSON.parse(window.localStorage.getItem(`${wn}.previews.${l}`)??"[]");Array.isArray(w)&&(W=w.filter(q=>typeof q=="string").slice(0,10))}catch{}W.length&&Promise.all(W.map(async w=>{const q=await fetch(`${r}/api/operator/v1/chat/repo/file?path=${encodeURIComponent(w)}`,{credentials:"include"});if(q.ok)return(await q.json()).data})).then(w=>{if(i.sessionRef.current?.sessionId!==l)return;const q=w.filter(Q=>!!Q);S(q),C(q.at(-1)?.path??null)})},[r,l,i]);const A=k.useCallback(W=>{g(w=>{const q=new Set(w);return q.has(W)?q.delete(W):q.add(W),q}),c[W]||O(W)},[c,O]),F=k.useCallback(W=>{S(w=>{const q=w.filter(Q=>Q.path!==W);return l&&window.localStorage.setItem(`${wn}.previews.${l}`,JSON.stringify(q.map(Q=>Q.path))),q}),C(w=>w===W?y.find(q=>q.path!==W)?.path??null:w)},[y,l]);return{tree:c,expandedDirs:h,treeError:p,previews:y,activePreviewPath:x,setActivePreviewPath:C,previewLoading:N,setPreviews:S,loadTree:O,openPreview:I,closePreview:F,toggleDir:A}}function pE(t){const{origin:r,sessionId:i,refs:l,setError:o}=t,[c,u]=k.useState(""),[h,g]=k.useState([]),[p,v]=k.useState([]),[y,S]=k.useState(!1),[x,C]=k.useState(0),[N,H]=k.useState([]),[O,I]=k.useState(!1),[A,F]=k.useState(null),[W,w]=k.useState(0),q=k.useRef(null),Q=k.useRef(void 0),se=k.useCallback(E=>{u(E),S(E.startsWith("/")),C(0)},[]),z=k.useCallback(async()=>{if(!i){H([]),F(null),I(!1);return}const E=i;Q.current=E,I(!0),F(null);try{const L=await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(E)}/commands`,{credentials:"include"});if(Q.current!==E)return;if(!L.ok){F("动态命令加载失败"),H([]);return}const j=await L.json().catch(()=>null),te=[];for(const de of j?.commands??[]){const J=de.source;if(J!=="extension"&&J!=="prompt"&&J!=="skill")continue;const ae=String(de.command??de.name??"").trim();ae&&te.push({command:ae.startsWith("/")?ae:`/${ae}`,label:String(de.label??de.name??ae),description:String(de.description??""),source:J})}if(Q.current!==E)return;H(te)}catch{if(Q.current!==E)return;F("动态命令加载失败"),H([])}finally{Q.current===E&&I(!1)}},[r,i]);k.useEffect(()=>{H([]),F(null),i&&(!y&&W===0||z())},[i,y,W,z]);const Y=k.useCallback(()=>{w(E=>E+1),z()},[z]);k.useEffect(()=>{if(!i)return;const E=c.slice(0,q.current?.selectionStart??c.length).match(/(?:^|\s)@([^\s@]*)$/);if(!E){g([]);return}const L=window.setTimeout(()=>{fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(i)}/files?q=${encodeURIComponent(E[1]??"")}`).then(j=>j.ok?j.json():null).then(j=>g((j?.files??[]).map(te=>te.path)))},150);return()=>window.clearTimeout(L)},[r,i,c]);const ne=k.useCallback(E=>{const L=q.current?.selectionStart??c.length,te=c.slice(0,L).search(/@[^\s@]*$/);te<0||(u(`${c.slice(0,te)}@${E} ${c.slice(L)}`),g([]))},[c]),ue=k.useCallback(E=>{for(const L of Array.from(E).slice(0,4)){if(!L.type.startsWith("image/")||L.size>5*1024*1024){o("图片仅支持 PNG/JPEG/GIF/WebP,单张不超过 5 MiB");continue}const j=new FileReader;j.onload=()=>{const te=String(j.result??""),de=te.slice(te.indexOf(",")+1);v(J=>[...J,{name:L.name,type:"image",mimeType:L.type,data:de}].slice(0,4))},j.readAsDataURL(L)}},[o]),P=k.useCallback(E=>{v(L=>L.filter(j=>j!==E))},[]);k.useLayoutEffect(()=>{const E=q.current;E&&(E.style.height="auto",E.style.height=`${Math.min(E.scrollHeight,280)}px`)},[c]),k.useEffect(()=>{if(!i)return;const E=window.setTimeout(()=>{fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(i)}/draft`,{method:"PUT",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":Kt()},body:JSON.stringify({text:c})})},400);return()=>window.clearTimeout(E)},[r,i,c]);const B=k.useMemo(()=>xS(N),[N]),D=k.useMemo(()=>c.startsWith("/")?SS(B,c):[],[c,B]),U=k.useCallback(()=>{l.isComposingRef.current=!0},[l]),G=k.useCallback(()=>{l.isComposingRef.current=!1,l.compositionEndedAtRef.current=Date.now()},[l]),K=k.useCallback(()=>l.isComposingRef.current,[l]),T=k.useCallback(()=>Date.now()-l.compositionEndedAtRef.current<100,[l]);return k.useEffect(()=>{Y1({origin:r,sessionId:i,refs:l})},[r,i,l]),{input:c,setInput:u,handleInputChange:se,fileOptions:h,pendingImages:p,setPendingImages:v,addImagesFromFiles:ue,removeImage:P,shortcutOpen:y,setShortcutOpen:S,shortcutIndex:x,setShortcutIndex:C,filteredShortcuts:D,dynamicCommandsLoading:O,dynamicCommandsError:A,retryDynamicCommands:Y,insertFileReference:ne,textareaRef:q,onCompositionStart:U,onCompositionEnd:G,isComposingNow:K,recentlyComposedNow:T}}const gE=[{toolId:"read",kind:"explore",description:"Pi 内置读取文件。"},{toolId:"write",kind:"explore",description:"Pi 内置写入文件(软约束:大改优先走 DAG)。"},{toolId:"edit",kind:"explore",description:"Pi 内置编辑文件(软约束:大改优先走 DAG)。"},{toolId:"bash",kind:"explore",description:"Pi 内置 shell 执行(软约束:优先受治路径)。"},{toolId:"grep",kind:"explore",description:"Pi 内置内容搜索。"},{toolId:"find",kind:"explore",description:"按名称查找文件路径。"},{toolId:"ls",kind:"explore",description:"列出目录内容。"},{toolId:"safe-read",kind:"explore",description:"安全读取仓库相对路径文件;拒绝敏感文件并自动脱敏 secret。"},{toolId:"safe-grep",kind:"explore",description:"安全搜索仓库内容;跳过敏感文件并自动脱敏搜索结果。"},{toolId:"git-status",kind:"explore",description:"固定参数执行 git status --porcelain(无 shell)。"},{toolId:"git-diff",kind:"explore",description:"固定参数查看 git diff;敏感路径不可查看且结果自动脱敏。"}];function yE(t){if(!t)return null;const r=(t.tools??[]).map(l=>({toolId:l.toolId,action:l.action,description:l.description,kind:l.kind??"read",cli:l.cli})),i=[...gE];return{explore:i,operator:r,total:i.length+r.length}}let vE=0;function bE(t){const{origin:r,session:i,setSession:l,refs:o,setError:c}=t,[u,h]=k.useState(null),[g,p]=k.useState([]),[v,y]=k.useState("idle"),[S,x]=k.useState(null),[C,N]=k.useState([]),[H,O]=k.useState(null),[I,A]=k.useState(null),[F,W]=k.useState(!1),[w,q]=k.useState(!1),[Q,se]=k.useState(!1),z=k.useRef(null),Y=k.useRef(null),ne=k.useRef(0);k.useEffect(()=>{ne.current=-1,W(!1)},[i?.sessionId,W]);const P=Qi().snapshot,B=k.useCallback(async()=>{try{const J=await fetch(`${r}/api/operator/v1/chat/capabilities`);if(!J.ok)return;const ae=await J.json();h(ae)}catch{}},[r]);k.useEffect(()=>{B()},[B]);const D=k.useCallback(async()=>{if(!i){p([]),y("idle");return}const J=i.sessionId;y("loading"),x(null);try{const ae=await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(J)}/models`,{credentials:"include"}),fe=await ae.json().catch(()=>null);if(o.sessionRef.current?.sessionId!==J)return;if(!ae.ok||!fe){y("error"),x(fe?.error?.message??`模型列表读取失败(HTTP ${ae.status})`);return}p(fe.models??[]),N(fe.thinkingLevels??[]),y("ready")}catch(ae){if(o.sessionRef.current?.sessionId!==J)return;y("error"),x(ae instanceof Error?ae.message:String(ae))}},[r,i,o]);k.useEffect(()=>{D()},[D]),k.useEffect(()=>{if(!i){O(null),A(null);return}const J=i.sessionId,ae=`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(J)}`;A(null),fetch(`${ae}/runtime-context`,{credentials:"include"}).then(async fe=>{const me=await fe.json().catch(()=>null);if(!me?.context||o.sessionRef.current?.sessionId!==J)return;const pe=me.context,Ie=X1().snapshot;O(Ne=>F1(Ne,pe,Ie,J))}).catch(()=>{o.sessionRef.current?.sessionId===J&&A("注入上下文读取失败,请重试")})},[r,i?.sessionId,o]),k.useEffect(()=>{if(!P||!i||P.sessionId!==i.sessionId)return;const J=sy(P);l(ae=>{if(!ae||ae.sessionId!==P.sessionId||wT(ae,J))return ae;const fe=Iv(ae,J);return o.sessionRef.current=fe,fe}),O(ae=>{if(!ae)return ae;const fe={...ae,...J.model?{model:J.model}:{},...J.thinkingLevel?{thinkingLevel:J.thinkingLevel}:{}};return fe.model?.provider===ae.model?.provider&&fe.model?.modelId===ae.model?.modelId&&fe.thinkingLevel===ae.thinkingLevel?ae:fe})},[P,i?.sessionId,o,l,O]);const U=k.useCallback(async J=>{if(!i)return!1;const ae=i.sessionId,fe=++vE;ne.current=fe,cy({type:"mutation-start",token:fe}),W(!0);try{const me=await fetch(`${r}/api/operator/v1/chat/sessions/${encodeURIComponent(i.sessionId)}/model`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":Kt()},body:JSON.stringify(J)}),pe=await me.json().catch(()=>({}));return ne.current!==fe?!1:me.ok?!pe.session||o.sessionRef.current?.sessionId!==ae?!1:P1(fe,ae,pe.snapshot):(o.sessionRef.current?.sessionId===ae&&(c(pe.error?.message??`模型或思考等级切换失败(HTTP ${me.status})`),Ki()),!1)}catch(me){return ne.current!==fe||o.sessionRef.current?.sessionId===ae&&c(me instanceof Error?me.message:String(me)),!1}finally{K1(fe,ae,o)&&ne.current===fe&&W(!1)}},[r,i,o,l,c]);k.useEffect(()=>{if(!w)return;const J=fe=>{const me=z.current;me&&fe.target instanceof Node&&!me.contains(fe.target)&&q(!1)},ae=fe=>{fe.key==="Escape"&&q(!1)};return document.addEventListener("mousedown",J),document.addEventListener("keydown",ae),()=>{document.removeEventListener("mousedown",J),document.removeEventListener("keydown",ae)}},[w]),k.useEffect(()=>{if(!Q)return;const J=fe=>{const me=Y.current;me&&fe.target instanceof Node&&!me.contains(fe.target)&&se(!1)},ae=fe=>{fe.key==="Escape"&&se(!1)};return document.addEventListener("mousedown",J),document.addEventListener("keydown",ae),()=>{document.removeEventListener("mousedown",J),document.removeEventListener("keydown",ae)}},[Q]);const G=k.useMemo(()=>yE(u),[u]),K=P?(P.models??[]).map(J=>({provider:J.provider,id:J.id,...J.name?{name:J.name}:{},...J.hasCredentials!==void 0?{hasCredentials:J.hasCredentials}:{}})):g,T=P?.thinkingLevels?.length?P.thinkingLevels.map(J=>J.value):C,E=i?.model??H?.model,L=E?Bs(E.provider,E.modelId):"",j=P?.selection?.thinkingSelection??i?.thinkingLevel??"",te=P?.selection?.effectiveThinkingLevel??i?.thinkingLevel??void 0,de=!L||K.some(J=>Bs(J.provider,J.id)===L);return{capabilities:u,models:K,modelsStatus:v,modelsError:S,onRetryModels:()=>{D()},thinkingLevels:T,runtimeContext:H,runtimeContextError:I,onRetryRuntimeContext:()=>{A(null),Ki()},toolsOpen:w,setToolsOpen:q,runtimeContextOpen:Q,setRuntimeContextOpen:se,toolsMenuRef:z,runtimeContextMenuRef:Y,switchRuntime:U,switching:F,toolCatalog:G,activeModel:E,activeModelRef:L,activeThinkingLevel:j,effectiveThinkingLevel:te,activeModelListed:de}}const Xg={comfortableMin:1450,compactMin:1100};function xE(t){return!Number.isFinite(t)||t<0?"narrow":t>=Xg.comfortableMin?"comfortable":t>=Xg.compactMin?"compact":"narrow"}function SE(t){return t==="compact"||t==="narrow"}const kE={mode:"comfortable",width:1600,landingDensity:"comfortable",emptyHeight:720};function wE(t,r){const[i,l]=k.useState(kE);return k.useEffect(()=>{const o=t.current;if(!o||typeof ResizeObserver>"u")return;const c=()=>{const v=o.getBoundingClientRect().width,y=r?.current??null,S=y?y.getBoundingClientRect().height:720;l({mode:xE(v),width:v,landingDensity:wS(S),emptyHeight:S})};c();const u=new ResizeObserver(()=>c());u.observe(o);let h=null;const g=()=>{const v=r?.current??null;v&&v!==h&&(h&&u.unobserve(h),u.observe(v),h=v,c())};g();const p=window.setInterval(g,250);return()=>{window.clearInterval(p),u.disconnect()}},[t,r]),i}function CE(t="none"){return{active:t}}function Ja(t,r){return{active:r}}function Rr(t={active:"none"}){return{active:"none"}}function jE(t){return{sidebarDrawerOpen:t.active==="sidebar-drawer",processOpen:t.active==="process",runtimeContextOpen:t.active==="runtime-context",toolsOpen:t.active==="tools"}}function RE(t){const{origin:r,surface:i="standalone"}=t,l=i==="workspace",o=DT(),[c,u]=k.useState(null),[h,g]=k.useState(null),[p,v]=k.useState(!0),[y,S]=k.useState(!0),[x,C]=k.useState(()=>CE()),[N,H]=k.useState(null),[O,I]=k.useState(0),A=k.useRef(null),F=k.useRef(null),W=k.useRef(null),w=k.useRef(null),q=k.useRef(null),Q=k.useRef(null),se=k.useRef(null),z=k.useRef(null),Y=k.useRef(()=>{}),ne=wE(w,q),ue=ne.mode,P=jE(x),B=P.processOpen,D=SE(ue)&&B,U=P.runtimeContextOpen;k.useEffect(()=>{ue==="comfortable"&&x.active==="sidebar-drawer"&&C(M=>M.active==="sidebar-drawer"?Rr(M):M)},[ue,x.active]);const G=k.useCallback(M=>{C(ie=>{const ge=ie.active==="process";return(typeof M=="function"?M(ge):M)?Ja(ie,"process"):ie.active==="process"?Rr(ie):ie})},[]),K=pE({origin:r,sessionId:h?.sessionId,refs:o,setError:u}),T=mE({origin:r,refs:o,sessionId:h?.sessionId,setError:u}),E=k.useRef(()=>{}),L=k.useCallback(M=>{E.current(M)},[]),j=qT({origin:r,refs:o,sessionId:h?.sessionId,setError:u,onReconcile:L});E.current=M=>{const ie=o.sessionRef.current?.sessionId;ie&&(async()=>await j.recoverSession(ie)?(H({id:Date.now(),message:"已自动恢复:会话事件已重新同步,可继续对话。"}),I(we=>we+1)):H({id:Date.now(),message:"自动恢复未完成,将在重连时重试。"}))()};const te=VT({origin:r,refs:o,setSession:g,thread:j,composer:{setInput:K.setInput,setPendingImages:K.setPendingImages},browser:{setPreviews:T.setPreviews,setActivePreviewPath:T.setActivePreviewPath},setError:u,setProcessOpen:G,setAutoScroll:S}),de=fE({origin:r,refs:o,session:h,thread:j,composer:{setInput:K.setInput,setPendingImages:K.setPendingImages},setError:u,setNotice:H,setAutoScroll:S,recoveryVersion:O,watchSessionTitle:te.watchSessionTitle}),J=hE({origin:r,refs:o,thread:j,setError:u}),ae=bE({origin:r,session:h,setSession:g,refs:o,setError:u});k.useEffect(()=>{ae.runtimeContextOpen&&x.active!=="runtime-context"?C(M=>Ja(M,"runtime-context")):!ae.runtimeContextOpen&&x.active==="runtime-context"&&C(M=>Rr(M))},[ae.runtimeContextOpen,x.active]),k.useEffect(()=>{x.active!=="runtime-context"&&ae.runtimeContextOpen&&ae.setRuntimeContextOpen(!1)},[x.active]);const{sendPrompt:fe,handleStop:me}=de,pe=k.useCallback(async M=>{await fe(M,K.pendingImages)},[fe,K.pendingImages]);Y.current=M=>{pe(M)};const Ie=k.useCallback(()=>{K.textareaRef.current?.focus()},[K.textareaRef]),Ne=k.useCallback(()=>{C(M=>M.active==="sidebar-drawer"?Rr(M):M)},[]),$e=k.useCallback(()=>{ae.setRuntimeContextOpen(!1),C(M=>Ja(M,"sidebar-drawer"))},[ae.setRuntimeContextOpen]),Pe=k.useCallback(M=>{te.activateSession(M),Ne(),queueMicrotask(()=>{F.current?.focus?.(),Ie()})},[te,Ne,Ie]),it=k.useCallback(M=>{K.setInput(ie=>`${ie}${ie&&!ie.endsWith(" ")?" ":""}@${M} `),Ne(),queueMicrotask(()=>Ie())},[K,Ne,Ie]),sn=k.useCallback(M=>{T.openPreview(M),Ne()},[T,Ne]),jt=k.useCallback(()=>{const M=F.current;if(!M)return;const ie=M.scrollHeight-M.scrollTop-M.clientHeight<80;S(ie)},[]);k.useEffect(()=>{y&&A.current?.scrollIntoView({behavior:"smooth",block:"end"})},[j.messages,y,j.streaming]),k.useEffect(()=>{if(!N)return;const M=window.setTimeout(()=>H(null),6e3);return()=>window.clearTimeout(M)},[N]);const on=k.useCallback(M=>{const ie=bS(M),ge=M.trim(),we=ge.split(/\s+/,1)[0]?.toLowerCase()??"";if(K.setInput(""),K.setShortcutOpen(!1),!!ie){if(ie.action==="focus:interview"){J.startInterview();return}if(ie.action==="show-help"){u(`可用 shortcuts:${ud.map(Te=>Te.command).join("、")};以及 /compact /name /session /copy`);return}if(ie.action.startsWith("focus-panel:")){W.current?.scrollIntoView({behavior:"smooth",block:"nearest"});return}if(ie.action==="compact"){te.compactSession();return}if(ie.action==="name"){const Te=ge.slice(we.length).trim(),be=h?.sessionId;if(!be){u("当前没有可重命名的会话");return}const Ge=te.sessionList.find(Oe=>Oe.sessionId===be),Ee=Te||window.prompt("会话名称",Ge?.title??Ge?.displayTitle??"")||"";Ee.trim()&&te.updateSession(be,{title:Ee.trim()});return}if(ie.action==="session"){const Te=h?.sessionId??"(none)",be=te.sessionList.find(Ee=>Ee.sessionId===Te),Ge=be?.title||be?.displayTitle||"未命名对话";H({id:Date.now(),message:`当前会话:${Ge}(${Te})`});return}if(ie.action==="copy"){const be=[...j.visibleMessages??[]].reverse().find(Ge=>Ge.role==="assistant");if(!be?.text){u("没有可复制的助手消息");return}navigator.clipboard?.writeText(be.text).then(()=>H({id:Date.now(),message:"已复制最后一条助手消息"}),()=>u("复制失败"));return}if(ie.action==="unknown"){Y.current(ge);return}u(`未知 shortcut:${ie.command}`)}},[K.setInput,K.setShortcutOpen,J.startInterview,te,h,j.visibleMessages]),Bt=k.useCallback(M=>{if(K.shortcutOpen&&K.filteredShortcuts.length>0&&!M.nativeEvent.isComposing){if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault(),K.setShortcutIndex(we=>(we+(M.key==="ArrowDown"?1:K.filteredShortcuts.length-1))%K.filteredShortcuts.length);return}if(M.key==="Escape"){M.preventDefault(),K.setShortcutOpen(!1);return}if(M.key==="Enter"){M.preventDefault(),on(K.filteredShortcuts[K.shortcutIndex]?.command??K.filteredShortcuts[0].command);return}}const ie=Date.now()-o.compositionEndedAtRef.current<100,ge=o.isComposingRef.current||M.nativeEvent.isComposing;if(M.key==="Enter"&&!M.shiftKey&&(ge||ie)){ie&&M.preventDefault();return}if(M.key==="Enter"&&!M.shiftKey){M.preventDefault(),pe(K.input);return}},[K.input,K.shortcutOpen,K.filteredShortcuts,K.shortcutIndex,K.setShortcutIndex,K.setShortcutOpen,o,pe,on]),Rt=j.visibleMessages.length>0||j.operationCards.length>0||j.humanGateCards.length>0||j.artifactCards.length>0||!!j.interview,Ce=t.readiness==="setup-required"?"⚠ Pi 未就绪(setup-required):Chat 需要先完成 Pi 认证 / 模型配置。":t.readiness==="degraded"?"⚠ Pi 降级(degraded):可继续对话,但部分能力不可用。":null,qe=ue==="compact"||ue==="narrow",ot=d.jsx(gS,{origin:r,open:p,layoutMode:ue,drawerOpen:P.sidebarDrawerOpen,activeSessionId:h?.sessionId,sessions:te.sessionList,tree:T.tree,expanded:T.expandedDirs,treeError:T.treeError,onToggleOpen:()=>v(M=>!M),onOpenDrawer:$e,onCloseDrawer:Ne,onCreate:()=>{te.createSession()},creatingSession:te.creatingSession,onActivate:M=>{P.sidebarDrawerOpen?Pe(M):te.activateSession(M)},onRename:(M,ie)=>{te.updateSession(M,{title:ie})},onSetState:(M,ie)=>{te.updateSession(M,{state:ie})},onDelete:M=>{te.deleteSession(M)},onRefreshTree:()=>{T.loadTree()},onToggleDir:T.toggleDir,onInsert:M=>{P.sidebarDrawerOpen?it(M):K.setInput(ie=>`${ie}${ie&&!ie.endsWith(" ")?" ":""}@${M} `)},onPreview:M=>{P.sidebarDrawerOpen?sn(M):T.openPreview(M)},drawerTriggerRef:Q}),Fe=["oc-workspace",B&&!D?"has-process":"",D?"has-process-overlay":""].filter(Boolean).join(" "),Ht=M=>d.jsx("div",{className:"oc-messages is-empty",ref:q,"data-landing-density":ne.landingDensity,children:d.jsx(gy,{mode:M,readiness:t.readiness,density:ne.landingDensity,onSuggest:async ie=>{te.creatingSession||(M==="no-session"?await te.createSession()&&await pe(ie):await pe(ie))},disabled:te.creatingSession,onCreateSession:M==="no-session"?()=>{te.createSession()}:void 0})});return d.jsxs("div",{className:"oc-shell",children:[l?null:d.jsxs("div",{className:"oc-banner",children:[d.jsxs("span",{className:"oc-banner-title",children:[d.jsx("span",{className:"oc-banner-dot","aria-hidden":"true"}),"对话"]}),d.jsxs("span",{className:"oc-banner-body",children:["用自然语言编排 loop-agent / agent-worker 的",d.jsx("strong",{children:"全部能力"}),"。这是 ",d.jsx("strong",{children:"Operator"})," 面:默认具备完整 Pi 工具(read/write/edit/bash/grep/find/ls)与 safe-* 探查、以及受策略约束的 operator action(ADR 0011)。",d.jsx("strong",{children:"软约束"}),":大改与高风险变更优先走受治 DAG 的 implement-pi / repair-pi 与 Human Gate,而非把 Chat 当作第二套 DAG kernel。"]})]}),Ce&&d.jsx("div",{className:"oc-alert oc-alert-warning",children:Ce}),c&&d.jsxs("div",{className:"oc-alert oc-alert-error",children:[d.jsx("strong",{children:"出错了:"}),c]}),N&&d.jsx("div",{className:"oc-alert oc-alert-warning",role:"status",children:N.message}),h?d.jsxs("div",{className:Fe,ref:w,"data-layout-mode":ue,children:[ot,d.jsxs("div",{className:`oc-main${Rt?"":" is-landing"}`,children:[ue==="narrow"?d.jsx("div",{className:"oc-main-topbar",children:d.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:Q,"aria-label":"打开会话与仓库","aria-expanded":P.sidebarDrawerOpen,onClick:()=>P.sidebarDrawerOpen?Ne():$e(),children:"会话与仓库"})}):null,d.jsx(vS,{previews:T.previews,activePath:T.activePreviewPath,loading:T.previewLoading,onActivate:T.setActivePreviewPath,onClose:T.closePreview}),Rt?d.jsx(bT,{scrollContainerRef:F,messagesEndRef:A,onScroll:jt,hasThread:Rt,readiness:t.readiness,streaming:j.streaming,streamingAssistantId:j.streamingAssistantId,messagesCount:j.messages.length,visibleCount:j.visibleMessages.length,onLoadMore:()=>j.setHistoryLimit(M=>M+50),turnGroups:j.turnGroups,interview:j.interview,interviewAnswer:J.interviewAnswer,onInterviewAnswerChange:J.setInterviewAnswer,onAnswerInterview:M=>{J.answerInterview(M)},onConfirmTaskKind:()=>{J.confirmTaskKind()},humanGateCards:j.humanGateCards,operationCards:j.operationCards,artifactCards:j.artifactCards,origin:r,sessionId:h.sessionId,onNavigateWorkspace:t.onNavigateWorkspace,onSuggest:M=>{pe(M)}}):Ht("empty-session"),d.jsx(ET,{composer:K,streaming:j.streaming,hasThread:Rt,compactControls:qe,onSend:M=>{pe(M)},onStop:me,onKeyDown:Bt,onRunShortcut:on,models:ae.models,activeModel:ae.activeModel,activeModelRef:ae.activeModelRef,activeModelListed:ae.activeModelListed,activeThinkingLevel:ae.activeThinkingLevel,thinkingLevels:ae.thinkingLevels,onSwitchRuntime:M=>{ae.switchRuntime(M)},usage:j.usage,unread:j.unread,onCompact:()=>{te.compactSession()},processSummary:j.processSummary,processOpen:B,onToggleProcess:()=>{C(M=>M.active==="process"?Rr(M):Ja(M,"process")),B||ae.setRuntimeContextOpen(!1)},processTriggerRef:se,runtimeContext:ae.runtimeContext,runtimeContextOpen:U,onToggleRuntimeContext:()=>{U?(ae.setRuntimeContextOpen(!1),C(M=>M.active==="runtime-context"?Rr(M):M)):(ae.setRuntimeContextOpen(!0),C(M=>Ja(M,"runtime-context")))},runtimeContextTriggerRef:z})]}),U&&ae.runtimeContext?d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"oc-overlay-backdrop is-runtime-context","aria-label":"关闭注入上下文遮罩",onClick:()=>{ae.setRuntimeContextOpen(!1),C(M=>M.active==="runtime-context"?Rr(M):M)}}),d.jsx(IT,{panelOnly:!0,open:U,onToggle:()=>{},onClose:()=>{ae.setRuntimeContextOpen(!1),C(M=>M.active==="runtime-context"?Rr(M):M)},context:ae.runtimeContext,triggerRef:z})]}):null,B&&d.jsxs(d.Fragment,{children:[D?d.jsx("button",{type:"button",className:"oc-overlay-backdrop is-process","aria-label":"关闭工具调用记录遮罩",onClick:()=>G(!1)}):null,d.jsx(NT,{toolCalls:j.toolCalls,overlay:D,onClose:()=>G(!1),triggerRef:se})]})]}):d.jsxs("div",{className:Fe,ref:w,"data-layout-mode":ue,children:[ot,d.jsxs("div",{className:"oc-main is-landing",children:[ue==="narrow"?d.jsx("div",{className:"oc-main-topbar",children:d.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:Q,"aria-label":"打开会话与仓库","aria-expanded":P.sidebarDrawerOpen,onClick:()=>P.sidebarDrawerOpen?Ne():$e(),children:"会话与仓库"})}):null,Ht("no-session")]})]})]})}function TE(t){return t==="validate"||t==="apply"||t==="spine"?"contract":t}const Ov="X-Loop-Console-Confirmation",Mv="agent-worker console doctor --repo .",nd=[{kind:"standard",label:"后端研发(默认 DAG)",hint:"生成标准 hybrid DAG(contract → implement → verify)"},{kind:"frontend-implementation",label:"前端研发",hint:"生成 frontend-implementation 专用节点链"},{kind:"backend-test",label:"后端测试",hint:"生成 backend-test-dag(分析 / 用例 / pytest)"},{kind:"frontend-test",label:"前端测试",hint:"生成 frontend-test-dag(RAG 用例 + Playwright CLI)"}],zv={"setup-required":"需要设置",ready:"已就绪",degraded:"降级可用",unknown:"未知"},EE={idle:"未探测",match:"匹配",mismatch:"仓库不匹配",unavailable:"不可用"},_v={low:"低",medium:"中",high:"高"},Lv={"validation-failed":"校验失败","contract-drift":"契约漂移","runtime-mismatch":"运行时不匹配","pause-on-human":"等待人工","verification-failed":"验证失败","orphan-unknown":"孤立/未知","terminal-failed":"已终止(失败)","terminal-succeeded":"已终止(成功)","needs-reconcile":"需要对账"},NE={idle:"空闲","not-started":"未开始","not-run":"未运行","n/a (MVP)":"不适用(MVP)",accepted:"已接受",succeeded:"已成功",running:"运行中",ran:"已执行"};function Es(t){return NE[t]??t}function Bv(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function $s(t){return`${t}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}async function Ed(t,r={},i){const l={"Content-Type":"application/json",[Ov]:Bv()},o=await fetch("/api/operator/v1/operations",{method:"POST",credentials:"same-origin",headers:l,body:JSON.stringify({action:t,actionParams:r,...i?{clientRequestId:i}:{}})});let c={};try{c=await o.json()}catch{c={ok:!1,error:{code:"INVALID_INPUT",message:"操作响应不是合法 JSON"}}}return{status:o.status,body:c}}const AE=new Set(["runDag","dagRerun","dagReconcileRun","standaloneTaskRerun"]);function Gc(t){const r=(t.blockedReasons??[]).map(String),i=(t.blockingNodes??[]).map(o=>[o.nodeId,o.reasonCode].filter(Boolean).join(":")),l=[...r,...i].filter(Boolean);return l.length===0?"从节点重跑不具备安全资格(子图含 writer / unsafe shell / decision-gate 等)。可改用「完整重跑任务」,或另选只读安全子图的起始节点。":`从节点重跑不具备安全资格:${l.slice(0,6).join("; ")}${l.length>6?"…":""}。可改用「完整重跑任务」。`}async function Qg(t,r=9e4){const i=Date.now();for(;Date.now()-i<r;){const l=await fetch(`/api/operator/v1/operations/${encodeURIComponent(t)}`,{credentials:"same-origin"});if(!l.ok)return null;const o=await l.json(),c=o.operation??o,u=c.state??"";if(u==="succeeded"||u==="failed"||u==="needs-reconcile"||u==="timed-out")return c;await new Promise(h=>setTimeout(h,250))}return{state:"needs-reconcile",errorMessage:"等待操作结果超时"}}const IE={};function DE(){const[t,r]=k.useState(()=>xy({env:IE?.VITE_OPERATOR_CHAT_DEFAULT_LANDING,storage:window.localStorage,location:window.location})),[i,l]=k.useState(null),[o,c]=k.useState("setup-required"),[u,h]=k.useState(null),[g,p]=k.useState(null),[v,y]=k.useState(!1),[S,x]=k.useState(!1),[C,N]=k.useState(null),[H,O]=k.useState(null),[I,A]=k.useState(null),[F,W]=k.useState(null),[w,q]=k.useState({command:"idle",dag:"not-started",verification:"not-run",promote:"n/a (MVP)"}),[Q,se]=k.useState("setup"),z=k.useCallback(B=>{se(D=>TE(typeof B=="function"?B(D):B))},[]),Y=o==="setup-required",ne=o==="degraded",ue=k.useCallback(B=>{B!==t&&(N(null),A(null),O(null)),r(B)},[t]),P=k.useCallback(async()=>{try{const D=await(await fetch("/api/health")).json();l(D);const U=D.piReadiness??"setup-required";c(U),p(null),z(U==="ready"||U==="degraded"?G=>G==="setup"?"import-prd":G:"setup")}catch(B){p(B instanceof Error?B.message:String(B))}try{const D=await(await fetch("/api/operator/v1/readiness")).json();h(D),D.state&&c(D.state)}catch{}},[z]);return{nav:t,setNav:r,selectNav:ue,health:i,readiness:o,setReadiness:c,readinessReport:u,healthError:g,loadHealth:P,busy:v,setBusy:y,observeBusy:S,setObserveBusy:x,opError:C,setOpError:N,opMessage:H,setOpMessage:O,opErrorCode:I,setOpErrorCode:A,lastOpState:F,setLastOpState:W,layers:w,setLayers:q,step:Q,setStep:z,setupBlocked:Y,degraded:ne}}function OE(t){const{shell:r,applyInterviewPayload:i}=t,{setBusy:l,setOpError:o,setOpErrorCode:c,setOpMessage:u,setReadiness:h,setStep:g,setNav:p,setLastOpState:v,setLayers:y,step:S,nav:x}=r,[C,N]=k.useState(null),[H,O]=k.useState([]),[I,A]=k.useState(!0),F=k.useRef(null),[W,w]=k.useState(null),[q,Q]=k.useState(null),se=k.useCallback(async(P,B={},D)=>{l(!0),o(null),c(null),u(null);try{const{status:U,body:G}=await Ed(P,B,D?.clientRequestId);if(U===412||G.error?.code==="PI_SETUP_REQUIRED")return o(Vi(G.error?.message??"Pi 未就绪或已降级:该操作暂不可用")),c(G.error?.code??"PI_SETUP_REQUIRED"),h("setup-required"),g("setup"),p("models"),G;if(U>=400||G.ok===!1)return o(Vi(G.error?.message??G.message??`操作失败(HTTP ${U})`)),c(G.error?.code??String(U)),v(G.state??`failed:${U}`),y(E=>({...E,command:G.error?.message??`failed:${G.error?.code??U}`})),G;if(G.operationId){const E=window.localStorage.getItem(wn)?.trim();if(E&&fetch(`/api/operator/v1/chat/sessions/${encodeURIComponent(E)}/operation-links`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",[Ov]:Bv()},body:JSON.stringify({operationId:G.operationId})}).then(L=>{L.ok||console.warn("Operator Chat operation link failed",L.status)}).catch(L=>console.warn("Operator Chat operation link failed",L)),N(G.operationId),v(G.state??"accepted"),y(L=>({...L,command:G.state??"accepted",dag:P==="runDag"?"running":L.dag})),AE.has(P)){A(!0),u(`操作已接受,后台运行中:${G.operationId}(请看事件流;可同时打开 Observe)`);const L=G.operationId;Qg(L,30*6e4).then(j=>{if(j){if(v(j.state??null),j.state==="failed"||j.state==="needs-reconcile"||j.state==="timed-out"){o(Vi(j.errorMessage??j.stderrPreview??`操作失败:${j.state}`)),c(j.errorCode??j.state??null),y(te=>({...te,command:`failed:${j.errorCode??j.state}`}));return}j.state==="succeeded"&&(u(`${P} 已成功`),y(te=>({...te,command:"succeeded"})))}})}else{u(`操作已接受:${G.operationId}`);const L=await Qg(G.operationId);if(L){if(v(L.state??null),L.state==="failed"||L.state==="needs-reconcile"||L.state==="timed-out")return o(Vi(L.errorMessage??L.stderrPreview??`操作失败:${L.state}`)),c(L.errorCode??L.state??null),y(J=>({...J,command:`failed:${L.errorCode??L.state}`})),{ok:!1,operationId:G.operationId,state:L.state,error:{code:L.errorCode??L.state??"INTERNAL_ERROR",message:L.errorMessage??L.stderrPreview??`操作失败:${L.state}`}};u(L.errorMessage?`${P}:${L.errorMessage}`:`${P} 已成功`),y(J=>({...J,command:L.state??"succeeded"}));const j=L.result??{},te={ok:!0,operationId:G.operationId,state:L.state??"succeeded",result:j};(P==="interviewStart"||P==="interviewTurn"||P==="interviewSkip")&&i(j);const de=j.confirmation;return de?.confirmationId&&(w(de.confirmationId),Q(j)),D?.advanceTo&&g(D.advanceTo),te}}}else u(`${P} 已完成`),v(G.state??"succeeded"),y(E=>({...E,command:"succeeded",verification:P==="contractValidate"||P==="spineCheck"?"ran":E.verification}));const K=G.result??{};(P==="interviewStart"||P==="interviewTurn"||P==="interviewSkip")&&i(K);const T=K.confirmation;return T?.confirmationId&&(w(T.confirmationId),Q(K)),D?.advanceTo&&g(D.advanceTo),G}catch(U){o(U instanceof Error?U.message:String(U));return}finally{l(!1)}},[i,l,o,c,u,h,g,p,v,y]),z=k.useCallback(P=>{if(!P)return"无响应";if(P.error?.message)return P.error.message;if(P.message)return P.message;const B=P.result;if(B&&typeof B=="object")try{return JSON.stringify(B).slice(0,1200)}catch{return"已返回结果"}return P.ok===!1?"失败":"成功"},[]),Y=k.useCallback(P=>{if(!P||P.ok===!1||P.error)return!1;const B=P.result;if(!B)return!0;if(typeof B.valid=="boolean")return B.valid;const D=B.result;return D&&typeof D.valid=="boolean"?D.valid:!0},[]),ne=k.useCallback(async P=>{F.current?.abort();const B=new AbortController;F.current=B,O(D=>[...D,`开始跟随事件流 ${P}`]);try{const D=await fetch(`/api/operator/v1/operations/${encodeURIComponent(P)}/events`,{credentials:"same-origin",signal:B.signal});if(!D.ok||!D.body){O(T=>[...T,`事件流 HTTP ${D.status}`]);return}const U=D.body.getReader(),G=new TextDecoder;let K="";for(;I;){const{done:T,value:E}=await U.read();if(T)break;K+=G.decode(E,{stream:!0});const L=K.split(`
|
|
50
|
-
|
|
51
|
-
`);K=L.pop()??"";for(const j of L){const te=j.split(`
|
|
52
|
-
`).find(J=>J.startsWith("data:"));if(!te)continue;const de=te.slice(5).trim();O(J=>[...J.slice(-80),de.slice(0,240)])}}}catch(D){D.name!=="AbortError"&&O(U=>[...U,`事件流错误:${D instanceof Error?D.message:String(D)}`])}},[I]);k.useEffect(()=>(C&&I&&(S==="run"||x==="recovery")&&ne(C),()=>F.current?.abort()),[C,I,S,x,ne]);const ue=k.useCallback(()=>{A(!1),F.current?.abort(),u("已停止跟随日志(未取消子进程)")},[u]);return{runAction:se,summarizeEnvelope:z,isActionSuccess:Y,operationId:C,setOperationId:N,sseLog:H,followSse:I,setFollowSse:A,stopFollowSse:ue,confirmationId:W,setConfirmationId:w,confirmationDetails:q,setConfirmationDetails:Q}}const rd=8*1024*1024,ME=10*1024*1024,Fs=8,zE=".md,.markdown,.txt,text/markdown,text/plain",_E=[".md",".markdown",".txt"],Nd=/\.[^.]+$/;function LE(t){const r=Nd.exec(t.trim());return r?r[0].toLowerCase():""}function BE(t){const r=LE(t);return _E.includes(r)}function id(t){if(!Number.isFinite(t)||t<0)return"0 B";if(t<1024)return`${t} B`;if(t<1024*1024){const i=t/1024;return`${i>=10?i.toFixed(0):i.toFixed(1)} KiB`}const r=t/(1024*1024);return`${r>=10?r.toFixed(1):r.toFixed(2)} MiB`}function Wn(t,r){return{ok:!1,code:t,message:r}}function HE(t,r){const i=t?Array.from(t):[],l=r?.maxFiles??Fs,o=r?.existingCount??0;return i.length===0?Wn("file-count","请选择至少一个 .md / .markdown / .txt 文件"):o+i.length>l?Wn("file-count",`最多支持 ${l} 个文件(当前已有 ${o} 个)`):null}async function UE(t){const r=t.name?.trim()||"untitled.md";if(!BE(r))return Wn("unsupported-extension","仅支持 .md、.markdown、.txt 文件");if(t.size>rd)return Wn("file-too-large",`文件不能超过 ${id(rd)}`);let i;try{i=await t.arrayBuffer()}catch{return Wn("read-failed","文件读取失败,请重试或直接粘贴")}let l;try{l=new TextDecoder("utf-8",{fatal:!0}).decode(i)}catch{return Wn("invalid-utf8","文件不是有效 UTF-8,请另存为 UTF-8")}if(l.trim().length===0)return Wn("empty-content","文件内容不能为空或只有空白");const o=new TextEncoder().encode(l).byteLength;return{ok:!0,text:l,fileName:r,sourceBytes:t.size,textBytes:o}}async function qE(t){if(t.length===0)return Wn("file-count","请选择至少一个 .md / .markdown / .txt 文件");if(t.length>Fs)return Wn("file-count",`最多支持 ${Fs} 个文件`);const r=[];for(const i of t){const l=await UE(i);if(!l.ok)return l;r.push({fileName:l.fileName,text:l.text,sourceBytes:l.sourceBytes,textBytes:l.textBytes})}return{ok:!0,documents:r}}function GE(t,r){const i=t.split(/\r?\n/);for(const o of i){const c=/^(#{1,6})\s+(.+)$/.exec(o.trim());if(c?.[2])return c[2].trim()}for(const o of i){const c=o.trim();if(c&&!/^---+$/.test(c)&&!/^```/.test(c)&&!/^<!--/.test(c))return c.replace(/^>\s+/,"").slice(0,120)}return r.replace(Nd,"").trim()||"需求"}function $E(t){return t.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")||"requirement"}function FE(t,r){const i=t.replace(Nd,"").trim(),l=$E(i);return l==="requirement"&&/[^\u0000-\u007f]/.test(i)?`part-${r+1}`:l==="requirement"?i?`part-${r+1}`:`part-${r+1}`:l}function VE(t){const r=new Set;return t.map((i,l)=>{let o=FE(i.fileName,l);if(r.has(o)){let c=2;for(;r.has(`${o}-${c}`);)c+=1;o=`${o}-${c}`}return r.add(o),{name:o,content:i.text,fileName:i.fileName}})}function YE(t,r){if(t.length===0)return"";if(t.length===1)return t[0].text;const i=Math.min(Math.max(0,r?.primaryIndex??0),t.length-1),l=t[i],o=GE(l.text,l.fileName),u=[`<!-- composed-from: ${t.map(h=>h.fileName).join(", ")} -->`,"",`# ${o}`,""];for(const h of t)u.push(`## 来源:${h.fileName}`,"",h.text.trim(),"");return`${u.join(`
|
|
53
|
-
`).trimEnd()}
|
|
54
|
-
`}function PE(t,r,i){const l={action:t,actionParams:r};return new TextEncoder().encode(JSON.stringify(l)).byteLength<=ME}function KE(){return"最终内容导致请求体超过服务端限制,请缩小文档或减少文件数量"}function XE(){const[t,r]=k.useState(""),[i,l]=k.useState([]),[o,c]=k.useState(0),[u,h]=k.useState(!1),[g,p]=k.useState(null),[v,y]=k.useState(!1),[S,x]=k.useState(!1),C=k.useRef(0),N=k.useRef(0),H=k.useCallback((Y,ne)=>{const ue=Y.length===0?0:Math.min(Math.max(0,ne),Y.length-1);c(ue),r(YE(Y,{primaryIndex:ue})),h(!1)},[]),O=k.useCallback(async Y=>{const ne=HE(Y,{existingCount:i.length});if(ne){p(ne.message);return}const ue=Array.from(Y),P=++N.current;y(!0),p(null);try{const B=await qE(ue);if(P!==N.current)return;if(!B.ok){p(B.message);return}const D=[...i,...B.documents],U=i.length===0?0:o;l(D),i.length===0||!u?(H(D,U),p(null)):p("已追加文件,未改正文(正文已手动编辑);可点「按文件重新合成」覆盖。")}catch{if(P!==N.current)return;p("文件读取失败,请重试或直接粘贴")}finally{P===N.current&&y(!1)}},[H,u,i,o]),I=k.useCallback(Y=>{r(Y),i.length>0&&h(!0)},[i.length]),A=k.useCallback(Y=>{c(Y),u||H(i,Y)},[H,u,i]),F=k.useCallback((Y,ne)=>{const ue=Y+ne,P=[...i],B=P[ue];P[ue]=P[Y],P[Y]=B;const D=o===Y?ue:o===ue?Y:o;l(P),c(D),u||H(P,D)},[H,u,i,o]),W=k.useCallback(Y=>{const ne=i.filter((P,B)=>B!==Y),ue=ne.length===0?0:Math.min(o>=Y?Math.max(0,o-1):o,Math.max(0,ne.length-1));l(ne),c(ue),ne.length===0?h(!1):u||H(ne,ue)},[H,u,i,o]),w=k.useCallback(()=>{l([]),c(0),h(!1),p(null)},[]),q=k.useCallback(()=>{u&&!window.confirm("将用当前文件列表重新合成正文,覆盖你在编辑区的修改。继续?")||(H(i,o),p(null))},[H,u,i,o]),Q=k.useCallback((Y,ne)=>{Y.preventDefault(),Y.stopPropagation(),!ne&&(C.current+=1,x(!0))},[]),se=k.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),C.current=Math.max(0,C.current-1),C.current===0&&x(!1)},[]),z=k.useCallback((Y,ne)=>{Y.preventDefault(),Y.stopPropagation(),C.current=0,x(!1),!ne&&O(Y.dataTransfer.files)},[O]);return{prdText:t,setPrdText:r,onPrdTextChange:I,prdDocuments:i,prdPrimaryIndex:o,prdComposedDirty:u,prdFileError:g,setPrdFileError:p,prdFileReading:v,prdDragOver:S,loadPrdFromFiles:O,applyPrdComposition:H,setPrimaryDocument:A,moveDocument:F,removeDocument:W,clearDocuments:w,recomposeDocuments:q,onDragEnter:Q,onDragLeave:se,onDrop:z}}const QE={report:{id:"report",label:"查看报告",action:"dagReport",lane:"dag",guide:"看失败分类与建议动作(交接报告摘要)",commandHint:"loop-agent dag report --run-id <run-id> --json"},doctor:{id:"doctor",label:"Doctor 诊断",action:"doctor",lane:"dag",guide:"只读诊断:检查 Console / Pi / 仓库就绪,不是重跑前置",commandHint:"agent-worker console doctor --repo ."},decision:{id:"decision",label:"人工决策",lane:"dag",guide:"暂停等人时:先看 doctor 输出再做决策(经 CLI)",commandHint:"loop-agent dag doctor --run-id <run-id> --markdown"},resume:{id:"resume",label:"恢复运行",lane:"dag",guide:"仅当运行可安全 resume 时使用(经 CLI)",commandHint:"loop-agent task advance <task-id> --json"},reconcile:{id:"reconcile",label:"对账 / reconcile",requiresReason:!0,action:"dagReconcileRun",lane:"dag",guide:"Orphan/中断时先对账归档(默认 supersede);runner 仍存活时勿盲 supersede",commandHint:"loop-agent dag reconcile-run --run-id <run-id> --action supersede --reason <structured-reason>"},regenerate:{id:"regenerate",label:"重新生成契约/计划",lane:"dag",guide:"契约/计划过期时:回任务页或经 CLI 重新 task advance(本页仅提示)",commandHint:"loop-agent task advance <task-id> --json"},observeLink:{id:"observeLink",label:"全屏观测",action:"observeLink",lane:"dag",guide:"打开完整 Inspect 画布;顶栏可返回操作台",commandHint:"agent-worker console --repo . --port 8790"},dagRerun:{id:"dagRerun",label:"从节点重跑",requiresReason:!0,action:"dagRerun",lane:"dag",guide:"终端失败默认首选:先 dagRerunPlan,plan 合格再 Human Gate 执行;provider 抖动/只读下游优先,勿无理由新开 task",commandHint:"loop-agent dag rerun --run-id <run-id> --from-node <node-id> --plan"},standaloneTaskRerun:{id:"standaloneTaskRerun",label:"完整重跑任务",requiresReason:!0,action:"standaloneTaskRerun",lane:"dag",guide:"整单重跑:仅当 from-node plan 不合格(writer/decision/fingerprint)或契约/源真变时;需确认原因",commandHint:"loop-agent dag rerun-task --run-id <run-id> --reason <text> --json"},workerTaskRetry:{id:"workerTaskRetry",label:"重新排队 Worker Task",requiresReason:!0,action:"workerTaskRetry",lane:"worker",guide:"仅 Worker 队列任务失败时使用,不要与 DAG 重跑混用",commandHint:"agent-worker task retry <task-id> --feature-id <feature-id> --repo . --reason <reason>"}},Zg={"validation-failed":["report","doctor","regenerate"],"contract-drift":["report","doctor","decision","reconcile","regenerate"],"runtime-mismatch":["report","doctor","reconcile","regenerate"],"pause-on-human":["decision","resume","report","doctor"],"verification-failed":["report","doctor","dagRerun","standaloneTaskRerun","resume","regenerate"],"orphan-unknown":["report","doctor"],"terminal-failed":["report","doctor","dagRerun","standaloneTaskRerun","workerTaskRetry","regenerate"],"terminal-succeeded":["report","observeLink"],"needs-reconcile":["report","doctor","reconcile","regenerate"]};function ZE(t){return(Zg[t]??Zg["orphan-unknown"]).map(i=>QE[i])}function JE(t){const r=[],i=[];for(const l of t)l.lane==="worker"?i.push(l):r.push(l);return{dag:r,worker:i}}function WE(t){return typeof t.action=="string"&&t.action.trim().length>0}function Hv(t){return ZE(t).filter(WE)}function eN(t){const r=new Set(Hv(t).map(l=>l.id)),i=(...l)=>{for(const o of l)if(r.has(o))return o;return null};switch(t){case"terminal-failed":case"verification-failed":return i("dagRerun","standaloneTaskRerun","doctor","report");case"pause-on-human":return i("doctor","report");case"needs-reconcile":return i("doctor","reconcile","report");case"runtime-mismatch":case"contract-drift":return i("doctor","report");case"validation-failed":return i("doctor","report");case"terminal-succeeded":return i("observeLink","report");default:return i("doctor","report")}}function tN(t){if(t.needsReconcile)return"needs-reconcile";const r=(t.errorCode??"").toLowerCase(),i=(t.operationState??"").toLowerCase(),l=(t.dagStatus??"").toLowerCase(),o=(t.failureCategory??"").toLowerCase();return r.includes("validation")||r.includes("invalid")||i.includes("validation")?"validation-failed":r.includes("contract")||r.includes("drift")||r.includes("binding")?"contract-drift":r.includes("runtime")||r.includes("mismatch")||r.includes("fingerprint")?"runtime-mismatch":r.includes("human")||i.includes("paused")||l.includes("paused")||i.includes("awaiting")?"pause-on-human":r.includes("verif")||i.includes("verif")?"verification-failed":o==="controller-interrupted"||r.includes("controller-interrupted")||r.includes("interrupted")||l==="interrupted"||l==="orphaned"||i.includes("controller-interrupted")||i.includes("interrupted")?"needs-reconcile":l==="running-suspected-stall"||l==="running-quiet"||l==="suspected-stall"||l.includes("suspected-stall")||i.includes("suspected-stall")?"orphan-unknown":i==="succeeded"||i==="completed"||i==="finished"||l==="succeeded"||l==="completed"||l==="finished"?"terminal-succeeded":i==="failed"||i.includes("fail")||l==="failed"||l==="partial_failed"||r.includes("fail")?"terminal-failed":r.includes("reconcil")||i.includes("reconcil")?"needs-reconcile":"orphan-unknown"}const Ad=new Set(["failed","error","partial_failed"]),Uv=new Set(["blocked","paused","awaiting_human"]);function Js(t){return(t??"").trim().toLowerCase()}function nN(t){return Ad.has(Js(t))}function Jg(t){const r=Js(t.status);return Ad.has(r)||r.includes("fail")?0:t.lifecycle==="paused"||r==="paused"?1:t.lifecycle==="active"?2:3}function rN(t){return[...t].sort((r,i)=>{const l=Jg(r)-Jg(i);return l!==0?l:i.mtimeMs-r.mtimeMs})}function iN(t){return rN(t)[0]?.dagRunId}function Wg(t){const r=Js(t.status);return Ad.has(r)?0:Uv.has(r)?1:2}function qv(t){return[...t].sort((r,i)=>{const l=Wg(r)-Wg(i);return l!==0?l:r.nodeId.localeCompare(i.nodeId)})}function aN(t){const r=qv(t);return r.find(l=>nN(l.status)||Uv.has(Js(l.status)))?.nodeId??r[0]?.nodeId}function lN(t){const r=t.status?.trim()||t.lifecycle;return`${t.dagRunId.length>36?`${t.dagRunId.slice(0,18)}…${t.dagRunId.slice(-8)}`:t.dagRunId} · ${r}`}function sN(t){const r=t.status?.trim()||"unknown",i=t.label?.trim();return i&&i!==t.nodeId?`${t.nodeId} · ${r} · ${i}`:`${t.nodeId} · ${r}`}function oN(t){const i=[`operator-recovery: ${t.actionLabel?.trim()||"恢复"}`],l=t.dagRunId?.trim();if(l){const h=t.runStatus?.trim();i.push(h?`run=${l} (${h})`:`run=${l}`)}const o=t.fromNodeId?.trim();if(o){const h=t.nodeStatus?.trim();i.push(h?`from-node=${o} (${h})`:`from-node=${o}`)}const c=t.factClassLabel?.trim();c&&i.push(`fact=${c}`);const u=t.nodeError?.trim()||t.errorMessage?.trim()||(t.errorCode?.trim()?`code=${t.errorCode.trim()}`:"");return u&&i.push(`detail=${u.replace(/\s+/g," ").slice(0,280)}`),i.join(`
|
|
55
|
-
`).slice(0,500)}function Gv(t){const r=t.trim();return r?r==="operator-recovery"||r.startsWith("operator-recovery:")||r.startsWith("recovery:"):!0}function uN(t){const{shell:r,actions:i,taskId:l,dagRunId:o,fromNodeId:c,featureId:u,recoveryReason:h,recoveryReasonTouched:g,recoveryConfirm:p,recoveryPlanSummary:v,setRecoveryConfirm:y,setRecoveryPlanSummary:S,setRecoveryReport:x,setRecoveryReason:C,setRecoveryReasonTouched:N,buildCurrentRecoveryReason:H,openFullCanvas:O}=t,{setOpError:I,setOpErrorCode:A,setOpMessage:F,setBusy:W}=r,{runAction:w,isActionSuccess:q}=i,Q=k.useCallback(async z=>{if(z.requiresReason||(y(null),S(null)),z.action==="doctor"){x(null),w("doctor",{});return}if(z.action==="dagReport"||z.id==="report"){const Y=o.trim();if(Y){y(null),S(null);const ne=await w("dagReport",{runId:Y}),ue=ne?.result??{},P=(ue.raw?.runs??ue.runs)?.[0];ne&&ne.ok!==!1&&!ne.error&&P&&(x({runId:P.runId??Y,title:P.title,status:P.status,category:P.productLineFailureCategory,recommendation:P.recoveryRecommendation?.summary??P.recommendedFollowUp??void 0}),F(null));return}if(l.trim()){x(null),w("status",{taskId:l});return}I("查看报告需要先选择 DAG 运行 ID(或填写任务 ID)");return}if(z.action==="observeLink"){x(null),O();return}if(z.requiresReason){if(x(null),y(z),S(null),z.id!=="dagRerun"&&(I(null),A(null)),(!g||Gv(h))&&(C(H(z.label)),N(!1)),z.id==="dagRerun"&&o.trim()&&c.trim()){W(!0);try{const{status:Y,body:ne}=await Ed("dagRerunPlan",{runId:o.trim(),fromNode:c.trim()}),ue=ne.result??{};ue&&typeof ue=="object"&&("eligible"in ue||ue.planHash)&&S(ue),Y<400&&ne.ok!==!1&&ue.eligible!==!1?F(null):ue.eligible===!1?I(ne.error?.message??Gc(ue)):F(ne.error?.message??"无法预检重跑计划;确认后仍将尝试提交(CLI 可能尚未就绪)")}finally{W(!1)}}return}I(null),A(null),F(`${z.label}:请经 CLI — ${z.commandHint??""}`)},[H,o,c,O,h,g,w,W,I,A,F,y,S,x,C,N,l]),se=k.useCallback(async()=>{const z=p;if(!z)return;const Y=h.trim();if(!Y){I("恢复操作需要结构化原因");return}const ne=$s(`recovery-${z.id}`);if(y(null),z.id==="dagRerun"){const ue=o.trim(),P=c.trim();if(!ue||!P){I("从节点重跑需要 DAG 运行 ID 与起始节点 ID");return}let B=v?.planHash?.trim(),D=v?.eligible;if(!B||D===void 0){const U=await w("dagRerunPlan",{runId:ue,fromNode:P}),G=U?.result??{};if((G.planHash||G.eligible!==void 0)&&S(G),B=G.planHash?.trim()||B,D=G.eligible,G.eligible===!1){I(U?.error?.message??Gc(G));return}if(U&&U.ok===!1&&!B){I(U.error?.message??"无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}}if(D===!1){I(Gc(v??{}));return}if(!B){I("无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}await w("dagRerun",{runId:ue,fromNode:P,planHash:B,reason:Y},{clientRequestId:ne});return}if(z.id==="standaloneTaskRerun"){const ue=o.trim();if(!ue){I("完整重跑任务需要 DAG 运行 ID");return}const P={runId:ue,reason:Y,...l.trim()?{taskId:l.trim()}:{}},B=await w("prepareMutationGate",{action:"standaloneTaskRerun",actionParams:P});if(!q(B))return;const D=B?.result??B;if(!D.receiptId||!D.humanGateToken){I("prepareMutationGate 未返回可消费的 Human Gate receipt");return}await w("standaloneTaskRerun",{...P,confirmationId:D.receiptId,humanGateToken:D.humanGateToken},{clientRequestId:ne});return}if(z.id==="workerTaskRetry"){const ue=l.trim();if(!ue){I("重新排队 Worker Task 需要任务 ID");return}const P={taskId:ue,reason:Y,...u.trim()?{featureId:u.trim()}:{}},B=await w("prepareMutationGate",{action:"workerTaskRetry",actionParams:P});if(!q(B))return;const D=B?.result??B;if(!D.receiptId||!D.humanGateToken){I("prepareMutationGate 未返回可消费的 Human Gate receipt");return}await w("workerTaskRetry",{...P,confirmationId:D.receiptId,humanGateToken:D.humanGateToken},{clientRequestId:ne});return}if(z.id==="reconcile"){const ue=o.trim();if(!ue){I("对账恢复需要 DAG 运行 ID");return}const P={runId:ue,reason:Y,reconcileAction:"supersede"},B=await w("prepareMutationGate",{action:"dagReconcileRun",actionParams:P});if(!q(B))return;const D=B?.result??B;if(!D.receiptId||!D.humanGateToken){I("prepareMutationGate 未返回可消费的 Human Gate receipt");return}await w("dagReconcileRun",{...P,confirmationId:D.receiptId,humanGateToken:D.humanGateToken},{clientRequestId:ne});return}F(`${z.label}:请经 CLI — ${z.commandHint??""}`)},[o,u,c,p,v?.planHash,h,w,q,I,F,y,S,l]);return{handleRecoveryCta:Q,submitRecoveryConfirm:se}}function cN(t){const{shell:r,actions:i,wizard:l}=t,{nav:o,opError:c,opErrorCode:u,lastOpState:h,setOpError:g,setObserveBusy:p}=r,{taskId:v}=l,[y,S]=k.useState(""),[x,C]=k.useState(""),[N,H]=k.useState(""),[O,I]=k.useState(""),[A,F]=k.useState(!1),[W,w]=k.useState(null),[q,Q]=k.useState(null),[se,z]=k.useState([]),[Y,ne]=k.useState([]),[ue,P]=k.useState(!1),[B,D]=k.useState(!1),[U,G]=k.useState(null),[K,T]=k.useState(null),[E,L]=k.useState(!1),[j,te]=k.useState(!1),[de,J]=k.useState(null),[ae,fe]=k.useState("idle"),[me,pe]=k.useState(null),[Ie,Ne]=k.useState(null),[$e,Pe]=k.useState(!1),it=k.useCallback(()=>y.trim()?`/inspect/#/dag/${encodeURIComponent(y.trim())}?from=recovery`:"/inspect/#/",[y]),sn=k.useCallback(()=>{window.location.assign(it())},[it]),jt=k.useCallback(async()=>{if(y.trim())return y.trim();const be=v.trim();if(!be)return g("打开 DAG 检视需要任务 ID 或 DAG 运行 ID"),null;p(!0),g(null);try{const{status:Ge,body:Ee}=await Ed("observeLink",{taskId:be}),Oe=Ee.result??{};if(Ge>=400||Ee.ok===!1)return g(Ee.error?.message??"无法解析 DAG 画布地址"),fe("unavailable"),pe(Ee.error?.message??null),null;const ft=typeof Oe.dagRunId=="string"?Oe.dagRunId.trim():"";return ft?(S(ft),fe("match"),pe(null),Ne(`/inspect/#/dag/${encodeURIComponent(ft)}`),ft):(g("尚未找到该任务的 DAG 运行,请稍后再打开检视"),fe("unavailable"),pe(Oe.message??"未解析到 DAG run"),null)}catch(Ge){return g(Ge instanceof Error?Ge.message:String(Ge)),null}finally{p(!1)}},[y,v,g,p]),on=k.useCallback(async()=>{await jt()&&Pe(!0)},[jt]),Bt=k.useCallback(async()=>{const be=await jt();be&&window.location.assign(`/inspect/#/dag/${encodeURIComponent(be)}?from=recovery`)},[jt]),Rt=k.useCallback(async()=>{P(!0);try{const be=v.trim(),Ge=new URLSearchParams;be&&Ge.set("taskId",be),Ge.set("limit","40");const Ee=await fetch(`/api/operator/v1/recovery/candidates?${Ge.toString()}`,{credentials:"same-origin"});if(!Ee.ok){z([]);return}const Oe=await Ee.json();z(Array.isArray(Oe.runs)?Oe.runs:[])}catch{z([])}finally{P(!1)}},[v]),Ce=k.useCallback(async be=>{const Ge=be.trim();if(!Ge){ne([]),G(null),T(null);return}D(!0);try{const Ee=await fetch(`/api/dag-runs/${encodeURIComponent(Ge)}`,{credentials:"same-origin"});if(!Ee.ok){ne([]),G(null),T(null);return}const Oe=await Ee.json(),ft=typeof Oe.effectiveStatus=="string"&&Oe.effectiveStatus||typeof Oe.status=="string"&&Oe.status||null;G(ft);const Xe=Array.isArray(Oe.nodes)?Oe.nodes:[],jn=qv(Xe.map(Tt=>{const Ar=(Tt.nodeId??Tt.id??"").trim();return Ar?{nodeId:Ar,status:Tt.status,label:Tt.label??Tt.name,errorPreview:Tt.errorPreview}:null}).filter(Tt=>Tt!==null));ne(jn);const Qt=typeof Oe.failureCategory=="string"&&Oe.failureCategory||void 0,Ws=Xe.find(Tt=>typeof Tt.failureCategory=="string"&&Tt.failureCategory&&Tt.failureCategory!=="success")?.failureCategory;T(Qt??Ws??null)}catch{ne([]),G(null),T(null)}finally{D(!1)}},[]);k.useEffect(()=>{o==="recovery"&&Rt()},[o,v,Rt]),k.useEffect(()=>{if(o!=="recovery"||E||se.length===0)return;const be=y.trim(),Ge=be?se.some(Ee=>Ee.dagRunId===be):!1;if(!be||!Ge){const Ee=iN(se);Ee&&Ee!==be&&S(Ee)}},[o,se,y,E]),k.useEffect(()=>{o==="recovery"&&Ce(y)},[o,y,Ce]),k.useEffect(()=>{if(o!=="recovery"||j||Y.length===0)return;const be=x.trim(),Ge=be?Y.some(Ee=>Ee.nodeId===be):!1;if(!be||!Ge){const Ee=aN(Y);Ee&&Ee!==be&&C(Ee)}},[o,Y,x,j]);const qe=tN({operationState:U?null:h,errorCode:U?null:u,dagStatus:U,failureCategory:K}),ot=k.useMemo(()=>Hv(qe),[qe]),Fe=k.useMemo(()=>JE(ot),[ot]),Ht=k.useMemo(()=>eN(qe),[qe]),M=k.useMemo(()=>Y.find(be=>be.nodeId===x.trim()),[Y,x]),ie=k.useRef(null);k.useEffect(()=>{q&&ie.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},[q?.id]);const ge=k.useCallback(be=>oN({actionLabel:be,dagRunId:y.trim()||void 0,fromNodeId:x.trim()||void 0,runStatus:U,nodeStatus:M?.status,nodeError:M?.errorPreview,factClassLabel:Lv[qe],errorMessage:c,errorCode:u}),[y,x,c,u,qe,U,M?.errorPreview,M?.status]);k.useEffect(()=>{if(o!=="recovery"||A&&!Gv(O))return;const be=ge(q?.label);be&&be!==O&&I(be)},[o,y,x,U,M,qe,c,u,q?.label,A,O,ge]);const{handleRecoveryCta:we,submitRecoveryConfirm:Te}=uN({shell:r,actions:i,taskId:v,dagRunId:y,fromNodeId:x,featureId:N,recoveryReason:O,recoveryReasonTouched:A,recoveryConfirm:q,recoveryPlanSummary:W,setRecoveryConfirm:Q,setRecoveryPlanSummary:w,setRecoveryReport:J,setRecoveryReason:I,setRecoveryReasonTouched:F,buildCurrentRecoveryReason:ge,openFullCanvas:Bt});return{dagRunId:y,setDagRunId:S,fromNodeId:x,setFromNodeId:C,featureId:N,setFeatureId:H,recoveryReason:O,setRecoveryReason:I,recoveryReasonTouched:A,setRecoveryReasonTouched:F,recoveryPlanSummary:W,recoveryConfirm:q,setRecoveryConfirm:Q,setRecoveryPlanSummary:w,recoveryRuns:se,recoveryNodes:Y,recoveryRunsLoading:ue,recoveryNodesLoading:B,recoveryRunStatus:U,manualRunId:E,setManualRunId:L,manualNodeId:j,setManualNodeId:te,recoveryReport:de,setRecoveryReport:J,observeLinkStatus:ae,observeLinkMessage:me,observeUrl:Ie,inspectSplitOpen:$e,setInspectSplitOpen:Pe,inspectPath:it,openFullInspect:sn,resolveDagRunForInspect:jt,openInspectSplit:on,openFullCanvas:Bt,loadRecoveryRuns:Rt,loadRecoveryNodes:Ce,recoveryFact:qe,recoveryCtas:ot,recoveryLanes:Fe,recommendedCtaId:Ht,recoveryConfirmRef:ie,buildCurrentRecoveryReason:ge,handleRecoveryCta:we,submitRecoveryConfirm:Te}}function dN(t){const{shell:r,actions:i,prd:l}=t,{step:o,setStep:c,setOpMessage:u}=r,{runAction:h,isActionSuccess:g,summarizeEnvelope:p}=i,[v,y]=k.useState(""),[S,x]=k.useState(""),[C,N]=k.useState("standard"),[H,O]=k.useState(""),[I,A]=k.useState(""),[F,W]=k.useState(""),w=nd.find(Ce=>Ce.kind===C)??nd[0],[q,Q]=k.useState(null),[se,z]=k.useState(null),[Y,ne]=k.useState(""),[ue,P]=k.useState(null),[B,D]=k.useState(null),[U,G]=k.useState(null),[K,T]=k.useState(null),[E,L]=k.useState(null),[j,te]=k.useState(!1),[de,J]=k.useState(null),[ae,fe]=k.useState(null),me=k.useRef(!1),pe=k.useCallback(()=>{G(null),T(null),L(null),te(!1),J(null),fe(null),me.current=!1},[]),Ie=k.useCallback(()=>{pe(),c("contract")},[pe,c]),Ne=k.useCallback(Ce=>{const qe=Ce.session;qe?.sessionId&&Q(qe.sessionId);const ot=Ce.question;z(ot),P(Ce.summary??null);const Fe=Ce.assessmentId;typeof Fe=="string"&&Fe&&D(Fe),(Ce.complete===!0||typeof Fe=="string"&&Fe)&&(Ie(),u(Ce.skipped===!0?"已跳过访谈:已按推荐补齐草稿并签发评估":"访谈已完成:草稿已绑定完整评估结果"))},[Ie,u]),$e=k.useCallback(async(Ce=!1)=>{const qe=v.trim();if(!qe)return;const ot=`${qe}:${B??""}`;if(!(!Ce&&ae===ot&&U!==null)&&!me.current){me.current=!0,G(null),T(null),L(null),J(null),te(!1);try{const Fe=await h("contractValidate",{taskId:qe}),Ht=g(Fe);if(G(Ht),T(p(Fe)),!Ht){fe(ot),u("契约校验未通过:请先修正草稿后再应用");return}const M=await h("contractDiff",{taskId:qe});L(p(M)),fe(ot),u(g(M)?"校验与差异已就绪:确认后可应用契约":"校验通过,但差异查询失败(仍可查看下方摘要)")}finally{me.current=!1}}},[B,ae,U,g,h,u,p,v]),Pe=k.useCallback(async()=>{const Ce=v.trim();if(!Ce||!B)return;const qe=await h("contractApply",{taskId:Ce,assessmentId:B},{clientRequestId:$s("apply")});if(!g(qe)){te(!1);return}te(!0);const ot=await h("spineCheck",{taskId:Ce});if(g(ot)){J(!0),c("dag-confirm"),u("契约已应用并通过 Spine 审计,可生成并运行 DAG");return}J(!1),u("契约已应用,但 Spine 审计未通过:可重试 Spine")},[B,g,h,u,c,v]),it=k.useCallback(async()=>{const Ce=v.trim();if(!Ce)return;const qe=await h("spineCheck",{taskId:Ce});if(g(qe)){J(!0),c("dag-confirm"),u("Spine 审计已通过,可生成并运行 DAG");return}J(!1)},[g,h,u,c,v]),sn=k.useCallback(async()=>{const Ce=i.confirmationId?.trim();if(!Ce)return;const qe=i.confirmationDetails?.confirmation?.humanGateToken,ot=await h("confirmDagConfirmation",{confirmationId:Ce,humanGateToken:qe});g(ot)&&(c("run"),await h("runDag",{confirmationId:Ce},{clientRequestId:$s("run")}))},[i.confirmationId,i.confirmationDetails,g,h,c]);k.useEffect(()=>{o==="contract"&&v.trim()&&$e(!1)},[o,v,B,$e]);const jt=k.useCallback(Ce=>Ce.split(/[\n,;,;]+/).map(qe=>qe.trim()).filter(Boolean),[]),on=k.useCallback(async()=>{const Ce=l.prdDocuments.length>0?VE(l.prdDocuments):void 0,qe=jt(H),ot=jt(I),Fe=jt(F),Ht={content:l.prdText,taskKind:C,...Ce?{documents:Ce}:{},...qe.length>0?{allowedPaths:qe}:{},...ot.length>0?{forbiddenPaths:ot}:{},...Fe.length>0?{verifyCommands:Fe}:{}};if(!PE("bootstrapFromPrd",Ht)){l.setPrdFileError(KE());return}const M=await h("bootstrapFromPrd",Ht);if(!M||M.ok===!1)return;const ie=M.result??{};ie.taskId&&y(ie.taskId),ie.title&&x(ie.title);const ge=ie.parseStatus??"pending",we=ie.draftPreview?.objective?.trim(),Te=Array.isArray(ie.gaps)?ie.gaps.length:0,be=ie.semanticIntake?.applied?"semantic":ie.semanticIntake?.code??"no-semantic";u([`已创建任务「${ie.title??""}」(${ie.taskId??""})`,`来源:${ie.identitySource??"prd"}`,`解析:${ge}(${be})`,we?`目标:${we.slice(0,120)}`:null,Te>0?`缺口 ${Te} 项待确认`:null].filter(Boolean).join(" · ")),c("interview")},[H,I,l,h,u,c,jt,C,F]),Bt=[{id:"setup",label:"就绪检查"},{id:"import-prd",label:"导入需求"},{id:"interview",label:"需求访谈(可跳过)"},{id:"contract",label:"契约落地"},{id:"dag-confirm",label:"确认 DAG"},{id:"run",label:"运行"}],Rt=Bt.findIndex(Ce=>Ce.id===o);return{taskId:v,setTaskId:y,taskTitle:S,taskKind:C,setTaskKind:N,engineering:{allowedPathsText:H,forbiddenPathsText:I,verifyCommandsText:F},setEngineering:Ce=>{Ce.allowedPathsText!==void 0&&O(Ce.allowedPathsText),Ce.forbiddenPathsText!==void 0&&A(Ce.forbiddenPathsText),Ce.verifyCommandsText!==void 0&&W(Ce.verifyCommandsText)},workflowMeta:w,sessionId:q,question:se,answerText:Y,setAnswerText:ne,draftSummary:ue,assessmentId:B,contractValidateOk:U,contractValidateSummary:K,contractDiffSummary:E,contractApplied:j,spineOk:de,applyInterviewPayload:Ne,runContractPreflight:$e,applyContractThenSpine:Pe,retrySpineOnly:it,confirmAndRunDag:sn,importPrdAndCreate:on,wizardSteps:Bt,stepIndex:Rt}}const fN={chat:"对话",tasks:"任务",recovery:"恢复",night:"夜间",models:"模型与认证",settings:"设置"};async function hN(t){return await import(t)}function mN(t){const r=t.repoName?.trim();if(r)return r;const i=(t.repoRoot??"").split(/[\\/]/).filter(Boolean);return i.length?i[i.length-1]:"repository"}function pN(t){const{nav:r,readiness:i,setupBlocked:l,degraded:o,health:c,inspectHref:u}=t,h=l||o?"models":"settings",g=l?"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。点击前往模型与认证。":o?"Pi 暂时降级:仍可恢复草稿与需求访谈。点击查看详情。":"Pi 已就绪。点击打开设置查看详情。";return{mode:"operate",activeTabHref:`#/${r}`,operateHref:"/#/",inspectHref:u,freshness:!1,readinessState:i,readinessHref:`#/${h}`,readinessTitle:g,repo:c?{name:mN(c),fingerprint:c.repoFingerprint??"",version:c.packageVersion??"",product:c.productName??c.product??"",inspectReady:c.inspect?.ready}:null}}function gN(t){const r=k.useRef(null),i=k.useRef(null),[l,o]=k.useState(!1),c=k.useMemo(()=>pN(t),[t.nav,t.readiness,t.setupBlocked,t.degraded,t.health,t.inspectHref]),u=k.useRef(c);return u.current=c,k.useEffect(()=>{let h=!1;return hN("/inspect/operator-chrome.js").then(g=>{h||!r.current||(i.current=g.mountOperatorChrome(r.current,u.current))}).catch(()=>{h||o(!0)}),()=>{h=!0,i.current?.destroy(),i.current=null}},[]),k.useEffect(()=>{i.current?.update(c)},[c]),d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:r,"data-testid":"operator-chrome"}),l?d.jsxs("nav",{className:"operator-chrome-fallback","aria-label":"操作工作区",children:[d.jsx("button",{type:"button",onClick:()=>window.location.assign("/#/"),children:"Loop Agent"}),d.jsx("button",{type:"button",onClick:()=>window.location.assign(`#/${t.nav}`),children:fN[t.nav]}),d.jsx("button",{type:"button",onClick:()=>window.location.assign(t.inspectHref),children:"观测"}),d.jsx("span",{role:"status",children:"共享导航加载失败,请刷新页面"})]}):null]})}function yN(t){return d.jsxs(d.Fragment,{children:[t.opError?d.jsxs("div",{className:"flash flash-error","data-testid":"op-error",children:[d.jsx("span",{className:"flash-label",children:"错误"}),d.jsx("p",{className:"flash-body",children:t.opError})]}):null,t.opMessage?d.jsxs("div",{className:"flash flash-info","data-testid":"op-message",children:[d.jsx("span",{className:"flash-label",children:"状态"}),d.jsx("p",{className:"flash-body",children:t.opMessage})]}):null]})}const vN=[{key:"sdkAvailable",detailKey:"sdkMessage",label:"Pi SDK",hint:"Node 侧 Pi SDK 可加载"},{key:"authReady",detailKey:"authMessage",label:"认证凭据",hint:"Pi auth / provider 密钥已配置"},{key:"modelsAvailable",detailKey:"modelsMessage",label:"可用模型",hint:"harness.json executors.pi(LOW/MED/HIGH)可在 Pi 凭据面解析"},{key:"interviewSessionOk",detailKey:"sessionMessage",label:"访谈会话",hint:"Interview 会话预检通过"}];function bN(t){if(!t)return null;const r=Date.parse(t);return Number.isNaN(r)?t:new Date(r).toLocaleString()}function xN(t){const r=t.readinessReport?.state??t.readiness,i=t.readinessReport?.probe,l=i?.details??{},o=t.readinessReport?.blockedActions??[],c=bN(t.readinessReport?.generatedAt),u=t.readinessReport??{state:t.readiness,health:t.health};return d.jsxs("section",{className:"panel models-page","aria-labelledby":"models-title",children:[d.jsxs("div",{className:"models-header",children:[d.jsx("h2",{id:"models-title",children:"模型与认证"}),d.jsx("span",{className:"models-status-pill","data-state":r,"data-testid":"models-readiness-pill",children:zv[r]??r})]}),d.jsxs("p",{className:"panel-lead",children:["复用 Pi ModelRuntime 凭据平面;密钥不会回传到页面。请用"," ",d.jsx("code",{children:"pi"})," 或 Pi 认证存储完成配置,然后刷新就绪探测。"]}),d.jsxs("section",{className:"models-probe-card","aria-labelledby":"models-probe-title","data-testid":"readiness-details",children:[d.jsx("h3",{id:"models-probe-title",className:"models-subtitle",children:"就绪检查"}),d.jsx("ul",{className:"models-probe-list",children:vN.map(h=>{const g=i?.[h.key],p=l[h.detailKey],v=g===void 0;return d.jsxs("li",{className:`models-probe-item${v?" is-pending":g?" is-ok":" is-bad"}`,children:[d.jsx("span",{className:"models-probe-badge","aria-label":v?"未探测":g?"通过":"未通过",children:v?"—":g?"✓":"✕"}),d.jsxs("div",{className:"models-probe-body",children:[d.jsx("strong",{children:h.label}),d.jsx("span",{className:"muted",children:h.hint}),p?d.jsx("p",{className:"models-probe-detail",children:p}):null]})]},h.key)})})]}),r==="setup-required"?d.jsxs("div",{className:"models-setup-card","data-testid":"models-setup-hint",children:[d.jsx("h3",{className:"models-subtitle",children:"如何完成配置"}),d.jsxs("ol",{className:"models-setup-steps",children:[d.jsxs("li",{children:["在终端配置 Pi 认证(例如 ",d.jsx("code",{children:"pi auth login"}),")或写入 provider API key。"]}),d.jsxs("li",{children:["确认 agent 目录下 ",d.jsx("code",{children:"models.json"})," / 认证文件可读。"]}),d.jsx("li",{children:"点击下方「刷新就绪探测」,或运行诊断命令查看详情。"})]}),d.jsx("pre",{className:"cmd",children:Mv})]}):null,r==="degraded"?d.jsx("p",{className:"models-degraded-note","data-testid":"models-degraded-note",children:"Pi 暂时降级:仍可恢复草稿与需求访谈;部分写入/运行类操作会被拦截。"}):null,o.length>0?d.jsxs("div",{className:"models-blocked-card",children:[d.jsx("h3",{className:"models-subtitle",children:"当前受限操作"}),d.jsx("ul",{className:"models-blocked-list",children:o.map(h=>d.jsx("li",{children:d.jsx("code",{children:h})},h))})]}):null,d.jsxs("div",{className:"models-actions",children:[d.jsx("button",{type:"button",className:"btn btn-primary",disabled:t.busy,onClick:t.onRefreshReadiness,children:"刷新就绪探测"}),c?d.jsxs("span",{className:"muted models-generated-at",children:["上次探测:",c]}):null]}),d.jsxs("details",{className:"models-raw-details",children:[d.jsx("summary",{children:"查看原始探测数据(调试)"}),d.jsx("pre",{className:"cmd models-raw-json",children:JSON.stringify(u,null,2)})]})]})}function ey(t){const{lane:r,cta:i,planSummary:l,reason:o,busy:c,confirmRef:u}=t;return!i||i.lane!==r?null:d.jsxs("div",{ref:u,className:"recovery-confirm","data-testid":"recovery-confirm",children:[d.jsxs("h3",{children:["待确认:",i.label]}),d.jsx("p",{className:"muted",children:"请核对上方运行 / 节点与恢复原因,再点「确定」执行。"}),l?d.jsxs("div",{className:"recovery-plan-summary",children:[d.jsxs("p",{className:"muted",children:["计划 eligible=",String(l.eligible??"—")," · 风险=",_v[l.risk??""]??l.risk??"—"]}),l.effectiveFromNodeId?d.jsxs("p",{className:"muted",children:["有效起点:",l.effectiveFromNodeId]}):null,l.estimatedExecution?d.jsxs("p",{className:"muted",children:["将执行 ",l.estimatedExecution.nodeCount??"?"," 个节点 / ",l.estimatedExecution.piCallCount??"?"," 次 Pi;预计避免"," ",l.estimatedExecution.avoidedNodeCount??"?"," 个节点"]}):null,l.planHash?d.jsxs("p",{className:"muted",children:["planHash: ",d.jsxs("code",{children:[l.planHash.slice(0,16),"…"]})]}):null]}):i.id==="dagRerun"?d.jsx("p",{className:"muted",children:"未加载计划摘要;点「确定」前将再次尝试资格检查。"}):null,d.jsxs("div",{className:"cta-row",children:[d.jsx("button",{type:"button",className:"btn btn-primary",disabled:c||!o.trim(),"data-testid":"recovery-confirm-submit",onClick:t.onSubmit,children:"确定"}),d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:c,"data-testid":"recovery-confirm-cancel",onClick:t.onCancel,children:"取消"})]})]})}function SN(t){const{shell:r,recovery:i,wizard:l}=t,{busy:o}=r,c={planSummary:i.recoveryPlanSummary,reason:i.recoveryReason,busy:o,confirmRef:i.recoveryConfirmRef,onSubmit:()=>{i.submitRecoveryConfirm()},onCancel:()=>{i.setRecoveryConfirm(null),i.setRecoveryPlanSummary(null)}};return d.jsxs("section",{className:"panel","aria-labelledby":"recovery-title",children:[d.jsx("h2",{id:"recovery-title",children:"恢复"}),d.jsxs("p",{className:"muted",children:["事实分类:",Lv[i.recoveryFact]," · 无 Cancel · 无「直接改代码」"]}),d.jsxs("ol",{className:"muted recovery-steps",children:[d.jsx("li",{children:"上方选 DAG 运行 / 节点,用「DAG 运行恢复」动作"}),d.jsx("li",{children:"Worker 队列失败才用下方「Worker Task 重排队」(二者不要混用)"}),d.jsx("li",{children:"带 * 的动作:核对预填原因 → 点下方「确定」"})]}),d.jsxs("p",{className:"muted",children:[l.taskId.trim()?`按任务 ${l.taskId.trim()} 拉取候选。`:"未填任务 ID 时列出最近 DAG 运行。","Doctor 诊断可选,不是重跑前置。"," ",d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:o||i.recoveryRunsLoading,"data-testid":"recovery-refresh-candidates",onClick:()=>{i.loadRecoveryRuns()},children:i.recoveryRunsLoading?"刷新中…":"刷新候选"})]}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"DAG 运行 ID"}),!i.manualRunId&&i.recoveryRuns.length>0?d.jsxs("select",{"data-testid":"recovery-run-select",value:i.dagRunId,disabled:o||i.recoveryRunsLoading,onChange:u=>{i.setManualRunId(!1),i.setManualNodeId(!1),i.setFromNodeId(""),i.setDagRunId(u.target.value),i.recoveryReasonTouched||i.setRecoveryReasonTouched(!1)},children:[i.recoveryRuns.some(u=>u.dagRunId===i.dagRunId)?null:d.jsx("option",{value:i.dagRunId||"",children:i.dagRunId?`${i.dagRunId}(当前)`:"— 请选择 —"}),i.recoveryRuns.map(u=>d.jsx("option",{value:u.dagRunId,children:lN(u)},u.dagRunId))]}):d.jsx("input",{"data-testid":"recovery-run-input",value:i.dagRunId,disabled:o,onChange:u=>{i.setManualRunId(!0),i.setDagRunId(u.target.value.trim())},placeholder:"dag-run-id(子图/完整重跑)"}),d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:o,"data-testid":"recovery-run-manual-toggle",onClick:()=>{if(!i.manualRunId&&i.recoveryRuns.length>0){i.setManualRunId(!0);return}i.setManualRunId(!1),i.loadRecoveryRuns()},children:!i.manualRunId&&i.recoveryRuns.length>0?"手动输入运行 ID":"刷新并改用下拉"})]}),d.jsxs("label",{className:"field",children:[d.jsxs("span",{className:"muted",children:["起始节点 ID(从节点重跑)",i.recoveryNodesLoading?" · 加载节点…":""]}),!i.manualNodeId&&i.recoveryNodes.length>0?d.jsxs("select",{"data-testid":"recovery-node-select",value:i.fromNodeId,disabled:o||i.recoveryNodesLoading,onChange:u=>{i.setManualNodeId(!1),i.setFromNodeId(u.target.value)},children:[i.recoveryNodes.some(u=>u.nodeId===i.fromNodeId)?null:d.jsx("option",{value:i.fromNodeId||"",children:i.fromNodeId?`${i.fromNodeId}(当前)`:"— 请选择 —"}),i.recoveryNodes.map(u=>d.jsx("option",{value:u.nodeId,children:sN(u)},u.nodeId))]}):d.jsx("input",{"data-testid":"recovery-node-input",value:i.fromNodeId,disabled:o,onChange:u=>{i.setManualNodeId(!0),i.setFromNodeId(u.target.value.trim())},placeholder:"例如 review-verdict-recovery-pi"}),d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:o,"data-testid":"recovery-node-manual-toggle",onClick:()=>{if(!i.manualNodeId&&i.recoveryNodes.length>0){i.setManualNodeId(!0);return}i.setManualNodeId(!1),i.loadRecoveryNodes(i.dagRunId)},children:!i.manualNodeId&&i.recoveryNodes.length>0?"手动输入节点 ID":"刷新并改用下拉"})]}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"恢复原因(已按 run/节点失败事实自动预填,可编辑)"}),d.jsx("textarea",{"data-testid":"recovery-reason",value:i.recoveryReason,disabled:o,rows:4,onChange:u=>{i.setRecoveryReasonTouched(!0),i.setRecoveryReason(u.target.value)},placeholder:"将自动预填 operator-recovery / run / from-node / detail"}),d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:o,"data-testid":"recovery-reason-refresh",onClick:()=>{i.setRecoveryReasonTouched(!1),i.setRecoveryReason(i.buildCurrentRecoveryReason(i.recoveryConfirm?.label))},children:"重新预填原因"})]}),d.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-dag",children:[d.jsx("h3",{children:"DAG 运行恢复"}),d.jsx("p",{className:"muted",children:"针对 `.harness/dag-runs` 的 Agent DAG 运行。橙色为当前建议;带 * 需确认原因。"}),d.jsxs("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-dag",children:[i.recoveryLanes.dag.map(u=>{const h=u.id===i.recommendedCtaId;return d.jsxs("button",{type:"button",className:h?"btn btn-primary":"btn btn-secondary",disabled:o,title:u.guide,"aria-pressed":i.recoveryConfirm?.id===u.id?!0:void 0,"data-testid":`recovery-cta-${u.id}`,"data-recommended":h?"true":void 0,onClick:()=>{i.handleRecoveryCta(u)},children:[u.label,u.requiresReason?" *":""]},u.id)}),d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!i.dagRunId.trim(),"data-testid":"recovery-dag-preview",title:"在本页侧栏预览,可关闭返回",onClick:()=>{if(!i.dagRunId.trim()){r.setOpError("侧栏预览需要先选择 DAG 运行 ID");return}i.setInspectSplitOpen(!0)},children:"侧栏预览"})]}),i.recoveryReport?d.jsxs("div",{className:"recovery-report","data-testid":"recovery-report",children:[d.jsxs("div",{className:"recovery-report-header",children:[d.jsx("h3",{children:"交接报告摘要"}),d.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"recovery-report-close",onClick:()=>i.setRecoveryReport(null),children:"关闭"})]}),d.jsxs("dl",{className:"recovery-report-facts",children:[d.jsxs("div",{children:[d.jsx("dt",{children:"运行"}),d.jsx("dd",{children:d.jsx("code",{children:i.recoveryReport.runId})})]}),i.recoveryReport.title?d.jsxs("div",{children:[d.jsx("dt",{children:"标题"}),d.jsx("dd",{children:i.recoveryReport.title})]}):null,d.jsxs("div",{children:[d.jsx("dt",{children:"状态"}),d.jsx("dd",{children:i.recoveryReport.status??"—"})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"失败分类"}),d.jsx("dd",{children:i.recoveryReport.category??"—"})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"建议"}),d.jsx("dd",{children:i.recoveryReport.recommendation??"暂无结构化建议"})]})]}),d.jsxs("p",{className:"muted",children:["完整 Markdown 可用 CLI:",d.jsxs("code",{children:["loop-agent dag report --run-id"," ",i.recoveryReport.runId," --markdown"]})]})]}):null,d.jsx(ey,{lane:"dag",cta:i.recoveryConfirm,...c})]}),d.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-worker",children:[d.jsx("h3",{children:"Worker Task 重排队"}),d.jsx("p",{className:"muted",children:"针对 agent-worker Task Pool,不是 DAG run。需要 Task ID;Feature ID 可选。"}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"Task ID(Worker 重排队必填)"}),d.jsx("input",{"data-testid":"recovery-worker-task-id",value:l.taskId,disabled:o,onChange:u=>l.setTaskId(u.target.value.trim()),placeholder:"harness / worker task-id"})]}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"Feature ID(可选)"}),d.jsx("input",{"data-testid":"recovery-feature-id",value:i.featureId,disabled:o,onChange:u=>i.setFeatureId(u.target.value.trim()),placeholder:"feature-id"})]}),d.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-worker",children:i.recoveryLanes.worker.length>0?i.recoveryLanes.worker.map(u=>d.jsxs("button",{type:"button",className:u.id===i.recommendedCtaId?"btn btn-primary":"btn btn-secondary",disabled:o,title:u.guide,"data-testid":`recovery-cta-${u.id}`,"data-recommended":u.id===i.recommendedCtaId?"true":void 0,onClick:()=>{i.handleRecoveryCta(u)},children:[u.label,u.requiresReason?" *":""]},u.id)):d.jsx("p",{className:"muted","data-testid":"recovery-worker-unavailable",children:"当前事实分类下不提供 Worker 重排队。"})}),d.jsx(ey,{lane:"worker",cta:i.recoveryConfirm,...c})]}),d.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row",hidden:!0,children:i.recoveryCtas.map(u=>d.jsx("span",{children:u.id},u.id))}),i.observeLinkMessage?d.jsxs("p",{className:"muted",children:["[",EE[i.observeLinkStatus],"]"," ",i.observeLinkMessage]}):null,i.observeUrl?d.jsx("p",{className:"muted",children:d.jsx("a",{className:"external-link",href:i.observeUrl,children:i.observeUrl})}):null]})}function kN(t){const{health:r,readiness:i,healthError:l,layers:o,setupBlocked:c,degraded:u}=t;return d.jsxs(d.Fragment,{children:[d.jsxs("section",{className:"panel","aria-labelledby":"settings-title",children:[d.jsx("h2",{id:"settings-title",children:"设置"}),d.jsxs("dl",{className:"kv",children:[d.jsxs("div",{children:[d.jsx("dt",{children:"产品"}),d.jsx("dd",{children:r?.productName??"Loop Operator Console"})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"仓库根目录"}),d.jsx("dd",{children:d.jsx("code",{children:r?.repoRoot??"—"})})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"仓库指纹"}),d.jsx("dd",{children:d.jsx("code",{title:r?.repoFingerprint??void 0,children:r?.repoFingerprint?`${r.repoFingerprint.slice(0,12)}…`:"—"})})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"Pi 就绪"}),d.jsxs("dd",{children:[d.jsxs("code",{children:[zv[i]??i,"(",i,")"]}),c?d.jsx("p",{className:"muted",children:"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。请前往「模型与认证」。"}):u?d.jsx("p",{className:"muted",children:"Pi 暂时降级:仍可恢复草稿与需求访谈。"}):null]})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"Inspect"}),d.jsxs("dd",{children:[d.jsx("code",{children:"/inspect/"}),"(同一 Console 进程)"]})]})]}),l?d.jsx("p",{className:"error",children:l}):null]}),d.jsxs("section",{className:"panel","aria-labelledby":"layers-title",children:[d.jsx("h2",{id:"layers-title",children:"完成语义分层"}),d.jsx("p",{className:"muted",children:"MVP 不执行收尾提交;不显示「任务已关闭/已交付」。"}),d.jsxs("dl",{className:"kv","data-testid":"completion-layers",children:[d.jsxs("div",{children:[d.jsx("dt",{children:"命令"}),d.jsx("dd",{children:Es(o.command)})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"DAG 生命周期"}),d.jsx("dd",{children:Es(o.dag)})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"最终验证"}),d.jsx("dd",{children:Es(o.verification)})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"晋升"}),d.jsx("dd",{children:Es(o.promote)})]}),d.jsxs("div",{children:[d.jsx("dt",{children:"任务关闭"}),d.jsx("dd",{children:"不可用(MVP)"})]})]})]})]})}function wN(t){const{busy:r,degraded:i,taskId:l,assessmentId:o,contractValidateOk:c,contractValidateSummary:u,contractDiffSummary:h,contractApplied:g,spineOk:p,onRerunPreflight:v,onApplyContract:y,onRetrySpine:S}=t;return d.jsxs("div",{"data-testid":"panel-contract",children:[d.jsx("h3",{children:"契约落地"}),d.jsx("p",{className:"muted",children:"进入本步后自动跑确定性校验与差异(非 AI 代判)。写入仓库仍需你人工确认一次;应用成功后会自动跑 Spine 审计。"}),d.jsxs("p",{className:"muted",children:["评估 ID: ",d.jsx("code",{children:o??"—"})]}),d.jsxs("div",{className:"contract-checks",children:[d.jsxs("p",{children:[d.jsx("strong",{children:"校验"}),":"," ",c===null?r?"进行中…":"等待开始":c?"通过":"未通过"]}),u?d.jsx("pre",{className:"cmd","data-testid":"contract-validate-summary",children:u}):null,d.jsxs("p",{children:[d.jsx("strong",{children:"差异"}),h?"":":尚未拉取"]}),h?d.jsx("pre",{className:"cmd","data-testid":"contract-diff-summary",children:h}):null,g?d.jsxs("p",{children:[d.jsx("strong",{children:"Spine"}),":"," ",p===null?"待检查":p?"通过":"未通过"]}):null]}),d.jsxs("div",{className:"cta-row",children:[d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:r||!l.trim(),onClick:v,children:"重新校验"}),d.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"contract-apply",disabled:r||i||!o||c!==!0||g,onClick:y,children:"确认并应用契约"}),g&&p===!1?d.jsx("button",{type:"button",className:"btn btn-primary",disabled:r,onClick:S,children:"重试 Spine"}):null]})]})}function CN(t){const{busy:r,taskId:i,confirmationId:l,confirmationDetails:o,runAction:c,onConfirmAndRun:u}=t;return d.jsxs("div",{"data-testid":"panel-dag-confirm",children:[d.jsx("h3",{children:"DAG 确认(§5.5)"}),d.jsxs("ul",{className:"checklist",children:[d.jsx("li",{children:"源绑定(source)"}),d.jsx("li",{children:"Writer 写集范围(writer-scope)"}),d.jsx("li",{children:"验证命令(verification)"}),d.jsx("li",{children:"人工门禁(human-gates)"})]}),o?d.jsx("pre",{className:"cmd",children:JSON.stringify(o,null,2).slice(0,4e3)}):null,d.jsxs("div",{className:"cta-row",children:[d.jsx("button",{type:"button",className:"btn btn-primary",disabled:r,onClick:()=>{c("prepareDagConfirmation",{taskId:i,dagHandle:`${i}.dag.json`,profile:"auto"})},children:"生成 DAG 并准备确认"}),d.jsx("button",{type:"button",className:"btn btn-primary",disabled:r||!l,onClick:u,children:"开始运行"})]}),l?d.jsxs("p",{className:"muted",children:["确认 ID: ",d.jsx("code",{children:l})]}):null]})}function jN(t){const{busy:r,taskKind:i,onTaskKindChange:l,workflowHint:o,prd:c,engineering:u,onEngineeringChange:h,onImport:g}=t,p=r||c.prdFileReading;return d.jsxs("div",{"data-testid":"panel-import-prd",children:[d.jsx("h3",{children:"导入需求"}),d.jsx("p",{className:"muted",children:"粘贴、选择或拖入一份或多份 PRD / 需求 Markdown。多文件会分别归档到 source/references,并合成一份可编辑正文。创建前可继续编辑。 系统会对 PRD 做确定性/语义结构化;工程边界(路径与验证)须人类确认,不会由模型编造。"}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"流程类型"}),d.jsx("select",{"data-testid":"workflow-kind-select",value:i,disabled:r||c.prdFileReading,onChange:v=>l(v.target.value),children:nd.map(v=>d.jsx("option",{value:v.kind,children:v.label},v.kind))})]}),d.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-hint",children:[o," · taskKind=",d.jsx("code",{children:i})]}),d.jsxs("div",{className:`prd-drop-zone${c.prdDragOver?" is-dragover":""}`,"data-testid":"prd-drop-zone","data-dragover":c.prdDragOver?"true":"false",onDragEnter:v=>c.onDragEnter(v,p),onDragOver:v=>{v.preventDefault(),v.stopPropagation()},onDragLeave:c.onDragLeave,onDrop:v=>c.onDrop(v,p),children:[d.jsxs("div",{className:"prd-upload-toolbar",children:[d.jsxs("label",{className:`btn btn-ghost prd-upload-btn${p?" is-disabled":""}`,children:["选择需求文档",d.jsx("input",{type:"file",accept:zE,multiple:!0,hidden:!0,disabled:p,"data-testid":"prd-file-input",onChange:v=>{const y=v.currentTarget;c.loadPrdFromFiles(y.files).finally(()=>{y.value=""})}})]}),d.jsxs("span",{className:"muted prd-upload-hint",children:["支持多文件 .md / .markdown / .txt,单文件最大"," ",id(rd),",最多 ",Fs," 个"]}),c.prdDocuments.length>0?d.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"prd-recompose",disabled:p,onClick:c.recomposeDocuments,children:"按文件重新合成"}):null]}),c.prdDocuments.length>0?d.jsx("ul",{className:"prd-file-list","data-testid":"prd-file-list",children:c.prdDocuments.map((v,y)=>d.jsxs("li",{className:y===c.prdPrimaryIndex?"is-primary":void 0,"data-testid":`prd-file-item-${y}`,children:[d.jsxs("span",{className:"prd-file-item-name",children:[v.fileName,y===c.prdPrimaryIndex?d.jsx("span",{className:"prd-file-primary-tag",children:"主"}):null,d.jsxs("span",{className:"muted",children:[" ","· ",id(v.sourceBytes)]})]}),d.jsxs("span",{className:"prd-file-item-actions",children:[d.jsx("button",{type:"button",className:"btn btn-ghost",disabled:p||y===c.prdPrimaryIndex,onClick:()=>c.setPrimaryDocument(y),children:"设为主"}),d.jsx("button",{type:"button",className:"btn btn-ghost",disabled:p||y===0,onClick:()=>c.moveDocument(y,-1),children:"上移"}),d.jsx("button",{type:"button",className:"btn btn-ghost",disabled:p||y===c.prdDocuments.length-1,onClick:()=>c.moveDocument(y,1),children:"下移"}),d.jsx("button",{type:"button",className:"btn btn-ghost",disabled:p,onClick:()=>c.removeDocument(y),children:"移除"})]})]},`${v.fileName}-${y}`))}):null,c.prdDocuments.length>0?d.jsxs("div",{className:"prd-file-meta",children:[d.jsxs("span",{children:["分卷=上传原件(将分别归档);正文=本会话采用稿",c.prdComposedDirty?"(已手动编辑)":""]}),d.jsx("button",{type:"button",className:"btn btn-ghost prd-file-clear","data-testid":"prd-file-clear",disabled:p,onClick:c.clearDocuments,children:"清除来源列表"})]}):null,c.prdDragOver?d.jsx("p",{className:"prd-drop-hint","data-testid":"prd-drop-hint",children:"释放以载入"}):null,d.jsxs("label",{className:"field prd-text-field",children:[d.jsx("span",{className:"muted",children:"PRD Markdown"}),d.jsx("textarea",{rows:10,value:c.prdText,disabled:p,"data-testid":"prd-textarea",onChange:v=>c.onPrdTextChange(v.target.value)})]})]}),c.prdFileError?d.jsx("p",{className:"prd-file-error",role:"alert","aria-live":"polite","data-testid":"prd-file-error",children:c.prdFileError}):null,d.jsxs("details",{className:"engineering-boundary","data-testid":"engineering-boundary",children:[d.jsx("summary",{children:"工程边界(可选,人类确认)"}),d.jsxs("p",{className:"muted",children:["逗号或换行分隔。留空则 intake 后进入访谈补齐;不会自动填",d.jsx("code",{children:"src/worker/console/**"})," 模板。"]}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"allowedPaths"}),d.jsx("textarea",{rows:2,value:u.allowedPathsText,disabled:p,"data-testid":"prd-allowed-paths",placeholder:"src/**, test/**",onChange:v=>h({allowedPathsText:v.target.value})})]}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"forbiddenPaths"}),d.jsx("textarea",{rows:2,value:u.forbiddenPathsText,disabled:p,"data-testid":"prd-forbidden-paths",placeholder:".harness/**, node_modules/**",onChange:v=>h({forbiddenPathsText:v.target.value})})]}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"verifyCommands(label:command 或纯命令)"}),d.jsx("textarea",{rows:2,value:u.verifyCommandsText,disabled:p,"data-testid":"prd-verify-commands",placeholder:"typecheck:npm run typecheck",onChange:v=>h({verifyCommandsText:v.target.value})})]})]}),d.jsx("div",{className:"cta-row",children:d.jsx("button",{type:"button",className:"btn btn-primary",disabled:r||c.prdFileReading||!c.prdText.trim(),onClick:g,children:"导入并创建任务"})})]})}function RN(t){const{busy:r,taskId:i,taskTitle:l,taskKind:o,sessionId:c,question:u,answerText:h,onAnswerTextChange:g,draftSummary:p,assessmentId:v,runAction:y}=t;return d.jsxs("div",{"data-testid":"panel-interview",children:[d.jsx("h3",{children:"需求访谈(grill-me)"}),d.jsx("p",{className:"muted",children:"一次一问;也可跳过:系统会按推荐补齐草稿并签发评估,随后进入校验。 访谈中不可应用契约 / 运行 DAG / 对账。"}),p?d.jsx("pre",{className:"cmd","data-testid":"draft-summary",children:JSON.stringify(p,null,2)}):null,d.jsxs("div",{className:"cta-row",style:{marginBottom:"0.75rem"},children:[!c||!u?d.jsx("button",{type:"button",className:"btn btn-primary",disabled:r||!i.trim(),onClick:()=>{y("interviewStart",{taskId:i,title:l,taskKind:o})},children:"开始 / 继续访谈"}):null,d.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"interview-skip",disabled:r||!i.trim(),onClick:()=>{y("interviewSkip",{taskId:i,title:l,taskKind:o})},children:"跳过访谈"})]}),c&&u?d.jsxs("div",{className:"interview-card",children:[d.jsxs("p",{className:"interview-q",children:[d.jsx("strong",{children:u.id})," · 风险=",_v[u.risk??""]??u.risk??"—"]}),d.jsx("p",{children:u.text}),u.recommendation?d.jsxs("p",{className:"muted",children:["推荐:",u.recommendation]}):null,d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"你的回答(覆盖推荐)"}),d.jsx("textarea",{rows:3,value:h,disabled:r,onChange:S=>g(S.target.value)})]}),d.jsxs("div",{className:"cta-row",children:[d.jsx("button",{type:"button",className:"btn btn-primary",disabled:r,onClick:()=>{y("interviewTurn",{sessionId:c,questionId:u.id,response:"accept-recommendation"}).then(()=>g(""))},children:"接受推荐"}),d.jsx("button",{type:"button",className:"btn btn-primary",disabled:r||!h.trim(),onClick:()=>{y("interviewTurn",{sessionId:c,questionId:u.id,response:"override",text:h}).then(()=>g(""))},children:"提交自定义回答"}),d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:r||u.risk==="high",onClick:()=>{y("interviewTurn",{sessionId:c,questionId:u.id,response:"defer",text:h||u.recommendation}).then(()=>g(""))},children:"暂缓(非高风险)"})]})]}):null,v?d.jsxs("p",{className:"muted",children:["评估 ID: ",d.jsx("code",{children:v})]}):null]})}function TN(t){const{busy:r,confirmationId:i,operationId:l,dagRunId:o,taskId:c,observeBusy:u,sseLog:h,runAction:g,onStopFollow:p,onShowInspectSplit:v,onOpenInspectSplit:y}=t;return d.jsxs("div",{"data-testid":"panel-run",children:[d.jsx("h3",{children:"运行详情"}),d.jsxs("div",{className:"meta-row",children:[d.jsxs("div",{children:["操作 ID: ",d.jsx("code",{children:l??"—"})]}),d.jsxs("div",{children:["确认 ID: ",d.jsx("code",{children:i??"—"})]})]}),d.jsxs("div",{className:"cta-row",children:[d.jsx("button",{type:"button",className:"btn btn-primary",disabled:r||!i,onClick:()=>{g("runDag",{confirmationId:i},{clientRequestId:$s("run")})},children:"重新运行"}),d.jsx("button",{type:"button",className:"btn btn-secondary",onClick:p,children:"停止跟随日志"}),d.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!o.trim(),onClick:v,children:"打开检视"}),d.jsx("button",{type:"button",className:"btn btn-ghost",disabled:u||!o.trim()&&!c.trim(),title:"在本页侧栏预览,可关闭返回",onClick:y,children:"侧栏预览"})]}),d.jsx("pre",{className:"cmd","data-testid":"sse-log",children:h.join(`
|
|
56
|
-
`)||"(尚无事件)"})]})}function EN(t){const{shell:r,actions:i,wizard:l,prd:o,recovery:c}=t,{busy:u,step:h,setupBlocked:g,degraded:p}=r;return d.jsxs("section",{className:"panel task-ops","aria-labelledby":"task-ops-title",children:[d.jsx("h2",{id:"task-ops-title",children:"任务操作"}),d.jsx("p",{className:"panel-lead",children:"按 Happy Path 推进;契约落地一步内自动校验,人工确认写入。"}),d.jsx("ol",{className:"wizard-steps","data-testid":"wizard-steps",children:l.wizardSteps.map((v,y)=>d.jsxs("li",{"data-active":h===v.id,"data-done":y<l.stepIndex,children:[d.jsx("span",{className:"step-index",children:String(y+1).padStart(2,"0")}),d.jsx("span",{className:"step-label",children:v.label})]},v.id))}),d.jsxs("label",{className:"field",children:[d.jsx("span",{className:"muted",children:"任务 ID"}),d.jsx("input",{"data-testid":"task-id-input",value:l.taskId,disabled:u||g||h==="import-prd",placeholder:h==="import-prd"?"导入需求后自动生成":"task-id",onChange:v=>l.setTaskId(v.target.value.trim())})]}),l.taskTitle?d.jsxs("p",{className:"workflow-hint","data-testid":"task-title-chip",children:["任务名称:",l.taskTitle]}):null,h!=="import-prd"&&!g?d.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-chip",children:["当前流程:",l.workflowMeta.label," ·"," ",d.jsx("code",{children:l.taskKind})]}):null,g||h==="setup"?d.jsxs("div",{className:"empty-state","data-testid":"setup-gate",children:[d.jsx("p",{className:"empty-title",children:"需要先完成设置"}),d.jsx("p",{className:"muted",children:"请先在「模型与认证」完成 Pi 就绪,再导入需求与访谈。"}),d.jsxs("div",{className:"cta-row",children:[d.jsx("button",{type:"button",className:"btn btn-primary",disabled:u,onClick:()=>{r.selectNav("models"),i.runAction("refreshReadiness",{}).then(()=>r.loadHealth())},children:"刷新就绪状态"}),d.jsx("button",{type:"button",className:"btn btn-primary",disabled:u,onClick:()=>{i.runAction("doctor",{})},children:"运行诊断"}),d.jsx("pre",{className:"cmd",children:Mv})]})]}):d.jsxs("div",{className:"wizard-body","data-testid":"wizard-body",children:[h==="import-prd"&&d.jsx(jN,{busy:u,taskKind:l.taskKind,onTaskKindChange:l.setTaskKind,workflowHint:l.workflowMeta.hint,prd:o,engineering:l.engineering,onEngineeringChange:l.setEngineering,onImport:()=>{l.importPrdAndCreate()}}),h==="interview"&&d.jsx(RN,{busy:u,taskId:l.taskId,taskTitle:l.taskTitle,taskKind:l.taskKind,sessionId:l.sessionId,question:l.question,answerText:l.answerText,onAnswerTextChange:l.setAnswerText,draftSummary:l.draftSummary,assessmentId:l.assessmentId,runAction:i.runAction}),h==="contract"&&d.jsx(wN,{busy:u,degraded:p,taskId:l.taskId,assessmentId:l.assessmentId,contractValidateOk:l.contractValidateOk,contractValidateSummary:l.contractValidateSummary,contractDiffSummary:l.contractDiffSummary,contractApplied:l.contractApplied,spineOk:l.spineOk,onRerunPreflight:()=>{l.runContractPreflight(!0)},onApplyContract:()=>{l.applyContractThenSpine()},onRetrySpine:()=>{l.retrySpineOnly()}}),h==="dag-confirm"&&d.jsx(CN,{busy:u,taskId:l.taskId,confirmationId:i.confirmationId,confirmationDetails:i.confirmationDetails,runAction:i.runAction,onConfirmAndRun:()=>{l.confirmAndRunDag()}}),h==="run"&&d.jsx(TN,{busy:u,confirmationId:i.confirmationId,operationId:i.operationId,dagRunId:c.dagRunId,taskId:l.taskId,observeBusy:r.observeBusy,sseLog:i.sseLog,runAction:i.runAction,onStopFollow:i.stopFollowSse,onShowInspectSplit:()=>c.setInspectSplitOpen(!0),onOpenInspectSplit:()=>{c.openInspectSplit()}})]})]})}const NN={};function AN(){const t=DE(),r=k.useRef(()=>{}),i=k.useCallback(v=>r.current(v),[]),l=OE({shell:t,applyInterviewPayload:i}),o=XE(),c=dN({shell:t,actions:l,prd:o}),u=cN({shell:t,actions:l,wizard:c});k.useEffect(()=>{r.current=c.applyInterviewPayload}),k.useEffect(()=>{t.loadHealth()},[t.loadHealth]);const h=k.useCallback((v,y={})=>{t.selectNav(v),y.taskId&&c.setTaskId(y.taskId),y.dagRunId&&u.setDagRunId(y.dagRunId),y.fromNodeId&&u.setFromNodeId(y.fromNodeId),y.featureId&&u.setFeatureId(y.featureId);const S=Sy(v,y);window.location.hash.replace(/^#/,"")!==S&&(window.location.hash=S)},[t.selectNav,c.setTaskId,u.setDagRunId,u.setFromNodeId,u.setFeatureId]),g=k.useCallback(()=>{const v=DS(window.location);if(v){h(v.workspace,v);return}const y=xy({env:NN?.VITE_OPERATOR_CHAT_DEFAULT_LANDING,storage:window.localStorage,location:window.location});h(y,{})},[h]);k.useEffect(()=>(g(),window.addEventListener("hashchange",g),()=>window.removeEventListener("hashchange",g)),[g]);const p=t.nav==="recovery"&&u.dagRunId.trim()?`/inspect/#/dag/${encodeURIComponent(u.dagRunId.trim())}?from=recovery`:"/inspect/#/";return d.jsx(d.Fragment,{children:d.jsxs("div",{className:`console-app${t.nav==="chat"?" is-chat-focus":""}`,children:[d.jsx(gN,{nav:t.nav,readiness:t.readiness,setupBlocked:t.setupBlocked,degraded:t.degraded,health:t.health,inspectHref:p}),d.jsxs("div",{className:`console-shell${t.nav==="chat"?" is-chat-focus":""}`,children:[d.jsx(yN,{opError:t.opError,opMessage:t.opMessage}),d.jsxs("main",{className:`console-main${t.nav==="chat"?" console-main--fill":""}`,children:[t.nav==="tasks"?d.jsx(EN,{shell:t,actions:l,wizard:c,prd:o,recovery:u}):null,t.nav==="recovery"?d.jsx(SN,{shell:t,recovery:u,wizard:c}):null,t.nav==="night"?d.jsx(R1,{busy:t.busy,runAction:l.runAction,isActionSuccess:l.isActionSuccess,setOpError:t.setOpError}):null,t.nav==="models"?d.jsx(xN,{busy:t.busy,readiness:t.readiness,readinessReport:t.readinessReport,health:t.health,onRefreshReadiness:()=>{l.runAction("refreshReadiness",{}).then(()=>t.loadHealth())}}):null,t.nav==="chat"?d.jsxs("section",{className:"panel panel--chat","aria-labelledby":"chat-title",children:[d.jsx("h2",{id:"chat-title",className:"sr-only",children:"对话"}),d.jsx(RE,{origin:"",readiness:t.readiness,surface:"workspace",onNavigateWorkspace:h})]}):null,t.nav==="settings"?d.jsx(kN,{health:t.health,readiness:t.readiness,healthError:t.healthError,layers:t.layers,setupBlocked:t.setupBlocked,degraded:t.degraded}):null]}),u.inspectSplitOpen&&u.dagRunId.trim()?d.jsx(h1,{dagRunId:u.dagRunId.trim(),nodeId:u.fromNodeId.trim()||void 0,onClose:()=>u.setInspectSplitOpen(!1),onOpenFull:u.openFullInspect}):null]})]})})}const $v=document.getElementById("root");if(!$v)throw new Error("Loop Operator Console: #root missing");d1.createRoot($v).render(d.jsx(k.StrictMode,{children:d.jsx(AN,{})}));
|