@seele00/seele 0.1.68 → 0.1.69
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/libexec/seele-server +0 -0
- package/libexec/seele-worker +0 -0
- package/package.json +1 -1
- package/web/dist/assets/{abnfDiagram-VRR7QNED-BjOBp60C.js → abnfDiagram-VRR7QNED-DG5A2-zr.js} +1 -1
- package/web/dist/assets/{arc-DWNjkzCj.js → arc-BDWVVN0r.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-BhJgtsd2.js → architectureDiagram-ZJ3FMSHR-CbWJ3wxh.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-CQL2hrG6.js → blockDiagram-677ZJIJ3-BYnbQtrs.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-i3id2p5H.js → c4Diagram-LMCZKHZV-C564oin9.js} +1 -1
- package/web/dist/assets/channel-ByTa84EB.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-vldrBz7z.js → chunk-2Q5K7J3B-C4mCSO58.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-BYKVrGHG.js → chunk-32BRIVSS-CmfOKz76.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-BSkatTTy.js → chunk-5VM5RSS4-DoPBPRPO.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-BUT7WtYc.js → chunk-EX3LRPZG-BUMJsDUF.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-DkIel1W4.js → chunk-JWPE2WC7-DpsMKNoS.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-CQHnq-qa.js → chunk-MOJQB5TN-DiPYnKEx.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-BMGhR4Pf.js → chunk-RYQCIY6F-DkuZiY8S.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-PZLcSRMm.js → chunk-V7JOEXUC-CStgx-46.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-Bi2o1Sks.js → chunk-VR4S4FIN-D-UjMQS2.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-hLvrOsqk.js → chunk-XXDRQBXY-C_ySFIFc.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-CKk_9pfr.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-CKk_9pfr.js +1 -0
- package/web/dist/assets/{core-C37HqXUQ.js → core-DeEzFyeU.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-BT3I5Dlr.js → cose-bilkent-JH36ORCC-Cwn4ahFQ.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-Dlu-1CCa.js → cynefin-VYW2F7L2-CsDa9alO.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-Bcyd3WiC.js → cynefinDiagram-TSTJHNR4-TlapQhr9.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-uGsjH0IB.js → dagre-VKFMJZFB-DhSMhSLS.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-BeAlI2Sx.js → diagram-FQU43EPY-DCdja0iN.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-BovEeBcz.js → diagram-G47NLZAW-Bu3ZBmer.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-OCXvbd2Y.js → diagram-NH7WQ7WH-BMlAnuHW.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-Dhw0i9SU.js → diagram-OA4YK3LP-CY28jwH8.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-CNiciHwx.js → diagram-WEI45ONY-BgtmszcK.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-B4zyJI3F.js → ebnfDiagram-CCIWWBDH-DMBkMav7.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-CTg7rKw7.js → erDiagram-Q63AITRT-w3WBuDLn.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-BYOcQZHY.js → flowDiagram-23GEKE2U-CwFE3PdB.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-EHfiyzV7.js → ganttDiagram-NO4QXBWP-CvU3naUf.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-2khId8yV.js → gitGraphDiagram-IHSO6WYX-BwEejp3A.js} +1 -1
- package/web/dist/assets/index-B9WzglxP.css +1 -0
- package/web/dist/assets/index-CJjBspDG.js +120 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-CpAG9Ers.js → infoDiagram-FWYZ7A6U-BfiJnWDm.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-7WPE4LpU.js → ishikawaDiagram-FXEZZL3T-S_-p_r5w.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-CTNr7NWP.js → journeyDiagram-5HDEW3XC-BSacLC5E.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-ENr17lJW.js → kanban-definition-HUTT4EX6-DaydDtum.js} +1 -1
- package/web/dist/assets/{linear-CQAJRi6v.js → linear-CiL-_MLs.js} +1 -1
- package/web/dist/assets/{mermaid.core-BLflHVXr.js → mermaid.core-DFI7lMCr.js} +4 -4
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-Cdc53u_R.js → mindmap-definition-LN4V7U3C-CqLePpeB.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-WA8CeEJY.js → pegDiagram-2B236MQR-BjdF6iXp.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-2sHT6S9v.js → pieDiagram-ENE6RG2P-1zX7h93s.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-DLueuY0z.js → quadrantDiagram-ABIIQ3AL-Cxn6GXia.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-U0UiODwu.js → railroadDiagram-RFXS5EU6-BXxgRENs.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-BcLWz1K7.js → requirementDiagram-TGXJPOKE-c9qaTaTL.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-C1L8QOju.js → sankeyDiagram-HTMAVEWB-CQbWn5CM.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-fBYlterW.js → sequenceDiagram-DBY2YBRQ-CVrs_i3n.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-CCRT4QRx.js → sizeCapture-X5ZJPWSS-C6sYo9lX.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-BXAjCK7x.js → stateDiagram-2N3HPSRC-DA9x-QQ-.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-hw3MYcZR.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-X9Ho-RvL.js → swimlanes-5IMT3BWC-CfvuRARc.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-CTGkjpub.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-CuTeumWf.js → timeline-definition-FHXFAJF6-f3bX2AOB.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-B2nAmQbt.js → vennDiagram-L72KCM5P-c6e5jlIY.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-tb6HXTNK.js → wardleyDiagram-EHGQE667-DN58EtHQ.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-C5czv02d.js → xychartDiagram-FW5EYKEG-MqJ_fR5r.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/channel-95G0oMQW.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-BNuRXHqD.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-BNuRXHqD.js +0 -1
- package/web/dist/assets/index-CE_oWBFj.css +0 -1
- package/web/dist/assets/index-g9r3tklj.js +0 -118
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-B8Nl6PEf.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BzlgR5Zx.js +0 -8
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Jw=Object.defineProperty;var e1=(t,i,a)=>i in t?Jw(t,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[i]=a;var ac=(t,i,a)=>e1(t,typeof i!="symbol"?i+"":i,a);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))r(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function a(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(u){if(u.ep)return;u.ep=!0;const c=a(u);fetch(u.href,c)}})();const t1="modulepreload",n1=function(t,i){return new URL(t,i).href},ly={},vt=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let d=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const h=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(a.map(b=>{if(b=n1(b,r),b in ly)return;ly[b]=!0;const x=b.endsWith(".css"),w=x?'[rel="stylesheet"]':"";if(!!r)for(let L=h.length-1;L>=0;L--){const z=h[L];if(z.href===b&&(!x||z.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${w}`))return;const T=document.createElement("link");if(T.rel=x?"stylesheet":t1,x||(T.as="script"),T.crossOrigin="",T.href=b,m&&T.setAttribute("nonce",m),document.head.appendChild(T),x)return new Promise((L,z)=>{T.addEventListener("load",L),T.addEventListener("error",()=>z(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return u.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return i().catch(c)})};function Vx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Af={exports:{}},no={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var ay;function i1(){if(ay)return no;ay=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var h in u)h!=="key"&&(c[h]=u[h])}else c=u;return u=c.ref,{$$typeof:t,type:r,key:d,ref:u!==void 0?u:null,props:c}}return no.Fragment=i,no.jsx=a,no.jsxs=a,no}var ry;function l1(){return ry||(ry=1,Af.exports=i1()),Af.exports}var o=l1(),Nf={exports:{}},Ue={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var sy;function a1(){if(sy)return Ue;sy=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),w=Symbol.iterator;function S(C){return C===null||typeof C!="object"?null:(C=w&&C[w]||C["@@iterator"],typeof C=="function"?C:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,z={};function D(C,B,A){this.props=C,this.context=B,this.refs=z,this.updater=A||T}D.prototype.isReactComponent={},D.prototype.setState=function(C,B){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,B,"setState")},D.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function W(){}W.prototype=D.prototype;function Y(C,B,A){this.props=C,this.context=B,this.refs=z,this.updater=A||T}var K=Y.prototype=new W;K.constructor=Y,L(K,D.prototype),K.isPureReactComponent=!0;var de=Array.isArray;function _(){}var Z={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function P(C,B,A){var ae=A.ref;return{$$typeof:t,type:C,key:B,ref:ae!==void 0?ae:null,props:A}}function $(C,B){return P(C.type,B,C.props)}function oe(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function ue(C){var B={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(A){return B[A]})}var Te=/\/+/g;function he(C,B){return typeof C=="object"&&C!==null&&C.key!=null?ue(""+C.key):B.toString(36)}function re(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(_,_):(C.status="pending",C.then(function(B){C.status==="pending"&&(C.status="fulfilled",C.value=B)},function(B){C.status==="pending"&&(C.status="rejected",C.reason=B)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function H(C,B,A,ae,me){var fe=typeof C;(fe==="undefined"||fe==="boolean")&&(C=null);var xe=!1;if(C===null)xe=!0;else switch(fe){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(C.$$typeof){case t:case i:xe=!0;break;case b:return xe=C._init,H(xe(C._payload),B,A,ae,me)}}if(xe)return me=me(C),xe=ae===""?"."+he(C,0):ae,de(me)?(A="",xe!=null&&(A=xe.replace(Te,"$&/")+"/"),H(me,B,A,"",function(Tt){return Tt})):me!=null&&(oe(me)&&(me=$(me,A+(me.key==null||C&&C.key===me.key?"":(""+me.key).replace(Te,"$&/")+"/")+xe)),B.push(me)),1;xe=0;var ze=ae===""?".":ae+":";if(de(C))for(var qe=0;qe<C.length;qe++)ae=C[qe],fe=ze+he(ae,qe),xe+=H(ae,B,A,fe,me);else if(qe=S(C),typeof qe=="function")for(C=qe.call(C),qe=0;!(ae=C.next()).done;)ae=ae.value,fe=ze+he(ae,qe++),xe+=H(ae,B,A,fe,me);else if(fe==="object"){if(typeof C.then=="function")return H(re(C),B,A,ae,me);throw B=String(C),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return xe}function le(C,B,A){if(C==null)return C;var ae=[],me=0;return H(C,ae,"","",function(fe){return B.call(A,fe,me++)}),ae}function ye(C){if(C._status===-1){var B=C._result;B=B(),B.then(function(A){(C._status===0||C._status===-1)&&(C._status=1,C._result=A)},function(A){(C._status===0||C._status===-1)&&(C._status=2,C._result=A)}),C._status===-1&&(C._status=0,C._result=B)}if(C._status===1)return C._result.default;throw C._result}var Ce=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},N={map:le,forEach:function(C,B,A){le(C,function(){B.apply(this,arguments)},A)},count:function(C){var B=0;return le(C,function(){B++}),B},toArray:function(C){return le(C,function(B){return B})||[]},only:function(C){if(!oe(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Ue.Activity=x,Ue.Children=N,Ue.Component=D,Ue.Fragment=a,Ue.Profiler=u,Ue.PureComponent=Y,Ue.StrictMode=r,Ue.Suspense=g,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(C){return Z.H.useMemoCache(C)}},Ue.cache=function(C){return function(){return C.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(C,B,A){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var ae=L({},C.props),me=C.key;if(B!=null)for(fe in B.key!==void 0&&(me=""+B.key),B)!te.call(B,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&B.ref===void 0||(ae[fe]=B[fe]);var fe=arguments.length-2;if(fe===1)ae.children=A;else if(1<fe){for(var xe=Array(fe),ze=0;ze<fe;ze++)xe[ze]=arguments[ze+2];ae.children=xe}return P(C.type,me,ae)},Ue.createContext=function(C){return C={$$typeof:d,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:c,_context:C},C},Ue.createElement=function(C,B,A){var ae,me={},fe=null;if(B!=null)for(ae in B.key!==void 0&&(fe=""+B.key),B)te.call(B,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(me[ae]=B[ae]);var xe=arguments.length-2;if(xe===1)me.children=A;else if(1<xe){for(var ze=Array(xe),qe=0;qe<xe;qe++)ze[qe]=arguments[qe+2];me.children=ze}if(C&&C.defaultProps)for(ae in xe=C.defaultProps,xe)me[ae]===void 0&&(me[ae]=xe[ae]);return P(C,fe,me)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(C){return{$$typeof:h,render:C}},Ue.isValidElement=oe,Ue.lazy=function(C){return{$$typeof:b,_payload:{_status:-1,_result:C},_init:ye}},Ue.memo=function(C,B){return{$$typeof:m,type:C,compare:B===void 0?null:B}},Ue.startTransition=function(C){var B=Z.T,A={};Z.T=A;try{var ae=C(),me=Z.S;me!==null&&me(A,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(_,Ce)}catch(fe){Ce(fe)}finally{B!==null&&A.types!==null&&(B.types=A.types),Z.T=B}},Ue.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},Ue.use=function(C){return Z.H.use(C)},Ue.useActionState=function(C,B,A){return Z.H.useActionState(C,B,A)},Ue.useCallback=function(C,B){return Z.H.useCallback(C,B)},Ue.useContext=function(C){return Z.H.useContext(C)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(C,B){return Z.H.useDeferredValue(C,B)},Ue.useEffect=function(C,B){return Z.H.useEffect(C,B)},Ue.useEffectEvent=function(C){return Z.H.useEffectEvent(C)},Ue.useId=function(){return Z.H.useId()},Ue.useImperativeHandle=function(C,B,A){return Z.H.useImperativeHandle(C,B,A)},Ue.useInsertionEffect=function(C,B){return Z.H.useInsertionEffect(C,B)},Ue.useLayoutEffect=function(C,B){return Z.H.useLayoutEffect(C,B)},Ue.useMemo=function(C,B){return Z.H.useMemo(C,B)},Ue.useOptimistic=function(C,B){return Z.H.useOptimistic(C,B)},Ue.useReducer=function(C,B,A){return Z.H.useReducer(C,B,A)},Ue.useRef=function(C){return Z.H.useRef(C)},Ue.useState=function(C){return Z.H.useState(C)},Ue.useSyncExternalStore=function(C,B,A){return Z.H.useSyncExternalStore(C,B,A)},Ue.useTransition=function(){return Z.H.useTransition()},Ue.version="19.2.7",Ue}var oy;function Up(){return oy||(oy=1,Nf.exports=a1()),Nf.exports}var R=Up(),_f={exports:{}},io={},Df={exports:{}},Mf={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var uy;function r1(){return uy||(uy=1,(function(t){function i(H,le){var ye=H.length;H.push(le);e:for(;0<ye;){var Ce=ye-1>>>1,N=H[Ce];if(0<u(N,le))H[Ce]=le,H[ye]=N,ye=Ce;else break e}}function a(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var le=H[0],ye=H.pop();if(ye!==le){H[0]=ye;e:for(var Ce=0,N=H.length,C=N>>>1;Ce<C;){var B=2*(Ce+1)-1,A=H[B],ae=B+1,me=H[ae];if(0>u(A,ye))ae<N&&0>u(me,A)?(H[Ce]=me,H[ae]=ye,Ce=ae):(H[Ce]=A,H[B]=ye,Ce=B);else if(ae<N&&0>u(me,ye))H[Ce]=me,H[ae]=ye,Ce=ae;else break e}}return le}function u(H,le){var ye=H.sortIndex-le.sortIndex;return ye!==0?ye:H.id-le.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 d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var g=[],m=[],b=1,x=null,w=3,S=!1,T=!1,L=!1,z=!1,D=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function K(H){for(var le=a(m);le!==null;){if(le.callback===null)r(m);else if(le.startTime<=H)r(m),le.sortIndex=le.expirationTime,i(g,le);else break;le=a(m)}}function de(H){if(L=!1,K(H),!T)if(a(g)!==null)T=!0,_||(_=!0,ue());else{var le=a(m);le!==null&&re(de,le.startTime-H)}}var _=!1,Z=-1,te=5,P=-1;function $(){return z?!0:!(t.unstable_now()-P<te)}function oe(){if(z=!1,_){var H=t.unstable_now();P=H;var le=!0;try{e:{T=!1,L&&(L=!1,W(Z),Z=-1),S=!0;var ye=w;try{t:{for(K(H),x=a(g);x!==null&&!(x.expirationTime>H&&$());){var Ce=x.callback;if(typeof Ce=="function"){x.callback=null,w=x.priorityLevel;var N=Ce(x.expirationTime<=H);if(H=t.unstable_now(),typeof N=="function"){x.callback=N,K(H),le=!0;break t}x===a(g)&&r(g),K(H)}else r(g);x=a(g)}if(x!==null)le=!0;else{var C=a(m);C!==null&&re(de,C.startTime-H),le=!1}}break e}finally{x=null,w=ye,S=!1}le=void 0}}finally{le?ue():_=!1}}}var ue;if(typeof Y=="function")ue=function(){Y(oe)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,he=Te.port2;Te.port1.onmessage=oe,ue=function(){he.postMessage(null)}}else ue=function(){D(oe,0)};function re(H,le){Z=D(function(){H(t.unstable_now())},le)}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(H){H.callback=null},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function(H){switch(w){case 1:case 2:case 3:var le=3;break;default:le=w}var ye=w;w=le;try{return H()}finally{w=ye}},t.unstable_requestPaint=function(){z=!0},t.unstable_runWithPriority=function(H,le){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ye=w;w=H;try{return le()}finally{w=ye}},t.unstable_scheduleCallback=function(H,le,ye){var Ce=t.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?Ce+ye:Ce):ye=Ce,H){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=ye+N,H={id:b++,callback:le,priorityLevel:H,startTime:ye,expirationTime:N,sortIndex:-1},ye>Ce?(H.sortIndex=ye,i(m,H),a(g)===null&&H===a(m)&&(L?(W(Z),Z=-1):L=!0,re(de,ye-Ce))):(H.sortIndex=N,i(g,H),T||S||(T=!0,_||(_=!0,ue()))),H},t.unstable_shouldYield=$,t.unstable_wrapCallback=function(H){var le=w;return function(){var ye=w;w=le;try{return H.apply(this,arguments)}finally{w=ye}}}})(Mf)),Mf}var cy;function s1(){return cy||(cy=1,Df.exports=r1()),Df.exports}var Of={exports:{}},rn={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var dy;function o1(){if(dy)return rn;dy=1;var t=Up();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:b}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,rn.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return c(g,m,null,b)},rn.flushSync=function(g){var m=d.T,b=r.p;try{if(d.T=null,r.p=2,g)return g()}finally{d.T=m,r.p=b,r.d.f()}},rn.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(g,m))},rn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},rn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=h(b,m.crossOrigin),w=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:w,fetchPriority:S}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:w,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},rn.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=h(m.as,m.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(g)},rn.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=h(b,m.crossOrigin);r.d.L(g,b,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},rn.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=h(m.as,m.crossOrigin);r.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(g)},rn.requestFormReset=function(g){r.d.r(g)},rn.unstable_batchedUpdates=function(g,m){return g(m)},rn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},rn.useFormStatus=function(){return d.H.useHostTransitionStatus()},rn.version="19.2.7",rn}var fy;function u1(){if(fy)return Of.exports;fy=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(i){console.error(i)}}return t(),Of.exports=o1(),Of.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var py;function c1(){if(py)return io;py=1;var t=s1(),i=Up(),a=u1();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,l=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(l=n.return),e=n.return;while(e)}return n.tag===3?l:null}function d(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(r(188))}function m(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(r(188));return n!==e?null:e}for(var l=e,s=n;;){var f=l.return;if(f===null)break;var p=f.alternate;if(p===null){if(s=f.return,s!==null){l=s;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===l)return g(f),e;if(p===s)return g(f),n;p=p.sibling}throw Error(r(188))}if(l.return!==s.return)l=f,s=p;else{for(var v=!1,j=f.child;j;){if(j===l){v=!0,l=f,s=p;break}if(j===s){v=!0,s=f,l=p;break}j=j.sibling}if(!v){for(j=p.child;j;){if(j===l){v=!0,l=p,s=f;break}if(j===s){v=!0,s=p,l=f;break}j=j.sibling}if(!v)throw Error(r(189))}}if(l.alternate!==s)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?e:n}function b(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=b(e),n!==null)return n;e=e.sibling}return null}var x=Object.assign,w=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var Te=Symbol.for("react.client.reference");function he(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case L:return"Fragment";case D:return"Profiler";case z:return"StrictMode";case de:return"Suspense";case _:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case Y:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case K:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return n=e.displayName||null,n!==null?n:he(e.type)||"Memo";case te:n=e._payload,e=e._init;try{return he(e(n))}catch{}}return null}var re=Array.isArray,H=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},Ce=[],N=-1;function C(e){return{current:e}}function B(e){0>N||(e.current=Ce[N],Ce[N]=null,N--)}function A(e,n){N++,Ce[N]=e.current,e.current=n}var ae=C(null),me=C(null),fe=C(null),xe=C(null);function ze(e,n){switch(A(fe,n),A(me,e),A(ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Tg(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Tg(n),e=Ag(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(ae),A(ae,e)}function qe(){B(ae),B(me),B(fe)}function Tt(e){e.memoizedState!==null&&A(xe,e);var n=ae.current,l=Ag(n,e.type);n!==l&&(A(me,e),A(ae,l))}function wt(e){me.current===e&&(B(ae),B(me)),xe.current===e&&(B(xe),Zs._currentValue=ye)}var un,bn;function kt(e){if(un===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);un=n&&n[1]||"",bn=-1<l.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+un+e+bn}var vn=!1;function Oe(e,n){if(!e||vn)return"";vn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(X){var F=X}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(X){F=X}e.call(ie.prototype)}}else{try{throw Error()}catch(X){F=X}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(X){if(X&&F&&typeof X.stack=="string")return[X.stack,F.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 p=s.DetermineComponentFrameRoot(),v=p[0],j=p[1];if(v&&j){var O=v.split(`
|
|
45
|
+
`),V=j.split(`
|
|
46
|
+
`);for(f=s=0;s<O.length&&!O[s].includes("DetermineComponentFrameRoot");)s++;for(;f<V.length&&!V[f].includes("DetermineComponentFrameRoot");)f++;if(s===O.length||f===V.length)for(s=O.length-1,f=V.length-1;1<=s&&0<=f&&O[s]!==V[f];)f--;for(;1<=s&&0<=f;s--,f--)if(O[s]!==V[f]){if(s!==1||f!==1)do if(s--,f--,0>f||O[s]!==V[f]){var J=`
|
|
47
|
+
`+O[s].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=s&&0<=f);break}}}finally{vn=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?kt(l):""}function Vt(e,n){switch(e.tag){case 26:case 27:case 5:return kt(e.type);case 16:return kt("Lazy");case 13:return e.child!==n&&n!==null?kt("Suspense Fallback"):kt("Suspense");case 19:return kt("SuspenseList");case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return kt("Activity");default:return""}}function Zn(e){try{var n="",l=null;do n+=Vt(e,l),l=e,e=e.return;while(e);return n}catch(s){return`
|
|
48
|
+
Error generating stack: `+s.message+`
|
|
49
|
+
`+s.stack}}var In=Object.prototype.hasOwnProperty,oi=t.unstable_scheduleCallback,yt=t.unstable_cancelCallback,Yt=t.unstable_shouldYield,vi=t.unstable_requestPaint,At=t.unstable_now,wi=t.unstable_getCurrentPriorityLevel,ee=t.unstable_ImmediatePriority,se=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,$e=t.unstable_LowPriority,Qe=t.unstable_IdlePriority,cn=t.log,ui=t.unstable_setDisableYieldValue,Pt=null,St=null;function Qt(e){if(typeof cn=="function"&&ui(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Pt,e)}catch{}}var tt=Math.clz32?Math.clz32:bt,Rt=Math.log,Ft=Math.LN2;function bt(e){return e>>>=0,e===0?32:31-(Rt(e)/Ft|0)|0}var ki=256,ar=262144,Si=4194304;function ji(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 Ci(e,n,l){var s=e.pendingLanes;if(s===0)return 0;var f=0,p=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var j=s&134217727;return j!==0?(s=j&~p,s!==0?f=ji(s):(v&=j,v!==0?f=ji(v):l||(l=j&~e,l!==0&&(f=ji(l))))):(j=s&~p,j!==0?f=ji(j):v!==0?f=ji(v):l||(l=s&~e,l!==0&&(f=ji(l)))),f===0?0:n!==0&&n!==f&&(n&p)===0&&(p=f&-f,l=n&-n,p>=l||p===32&&(l&4194048)!==0)?n:f}function ma(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Do(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 Mo(){var e=Si;return Si<<=1,(Si&62914560)===0&&(Si=4194304),e}function rr(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function ga(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Oo(e,n,l,s,f,p){var v=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var j=e.entanglements,O=e.expirationTimes,V=e.hiddenUpdates;for(l=v&~l;0<l;){var J=31-tt(l),ie=1<<J;j[J]=0,O[J]=-1;var F=V[J];if(F!==null)for(V[J]=null,J=0;J<F.length;J++){var X=F[J];X!==null&&(X.lane&=-536870913)}l&=~ie}s!==0&&Ro(e,s,0),p!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=p&~(v&~n))}function Ro(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-tt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|l&261930}function jl(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var s=31-tt(l),f=1<<s;f&n|e[s]&n&&(e[s]|=n),l&=~f}}function $i(e,n){var l=n&-n;return l=(l&42)!==0?1:Ei(l),(l&(e.suspendedLanes|n))!==0?0:l}function Ei(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 Ti(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Gi(){var e=le.p;return e!==0?e:(e=window.event,e===void 0?32:Wg(e.type))}function sr(e,n){var l=le.p;try{return le.p=e,n()}finally{le.p=l}}var Un=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Un,zt="__reactProps$"+Un,Ai="__reactContainer$"+Un,ya="__reactEvents$"+Un,Jr="__reactListeners$"+Un,es="__reactHandles$"+Un,zo="__reactResources$"+Un,Cl="__reactMarker$"+Un;function Jn(e){delete e[Ht],delete e[zt],delete e[ya],delete e[Jr],delete e[es]}function Ni(e){var n=e[Ht];if(n)return n;for(var l=e.parentNode;l;){if(n=l[Ai]||l[Ht]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=zg(e);e!==null;){if(l=e[Ht])return l;e=zg(e)}return n}e=l,l=e.parentNode}return null}function Vi(e){if(e=e[Ht]||e[Ai]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function xa(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function El(e){var n=e[zo];return n||(n=e[zo]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Nt(e){e[Cl]=!0}var Lo=new Set,ts={};function dn(e,n){Bn(e,n),Bn(e+"Capture",n)}function Bn(e,n){for(ts[e]=n,e=0;e<n.length;e++)Lo.add(n[e])}var zc=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]*$"),Tl={},Al={};function Io(e){return In.call(Al,e)?!0:In.call(Tl,e)?!1:zc.test(e)?Al[e]=!0:(Tl[e]=!0,!1)}function wn(e,n,l){if(Io(n))if(l===null)e.removeAttribute(n);else{switch(typeof l){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,""+l)}}function kn(e,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+l)}}function Wt(e,n,l,s){if(s===null)e.removeAttribute(l);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(n,l,""+s)}}function fn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nl(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Lc(e,n,l){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,p=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,p.call(this,v)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Yi(e){if(!e._valueTracker){var n=Nl(e)?"checked":"value";e._valueTracker=Lc(e,n,""+e[n])}}function Uo(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return e&&(s=Nl(e)?e.checked?"true":"false":e.value),e=s,e!==l?(n.setValue(e),!0):!1}function Fi(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 ba=/[\n"\\]/g;function nn(e){return e.replace(ba,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function va(e,n,l,s,f,p,v,j){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),n!=null?v==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+fn(n)):e.value!==""+fn(n)&&(e.value=""+fn(n)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),n!=null?_l(e,v,fn(n)):l!=null?_l(e,v,fn(l)):s!=null&&e.removeAttribute("value"),f==null&&p!=null&&(e.defaultChecked=!!p),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+fn(j):e.removeAttribute("name")}function ns(e,n,l,s,f,p,v,j){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),n!=null||l!=null){if(!(p!=="submit"&&p!=="reset"||n!=null)){Yi(e);return}l=l!=null?""+fn(l):"",n=n!=null?""+fn(n):l,j||n===e.value||(e.value=n),e.defaultValue=n}s=s??f,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=j?e.checked:!!s,e.defaultChecked=!!s,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),Yi(e)}function _l(e,n,l){n==="number"&&Fi(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Zt(e,n,l,s){if(e=e.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<e.length;l++)f=n.hasOwnProperty("$"+e[l].value),e[l].selected!==f&&(e[l].selected=f),f&&s&&(e[l].defaultSelected=!0)}else{for(l=""+fn(l),n=null,f=0;f<e.length;f++){if(e[f].value===l){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function ci(e,n,l){if(n!=null&&(n=""+fn(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+fn(l):""}function or(e,n,l,s){if(n==null){if(s!=null){if(l!=null)throw Error(r(92));if(re(s)){if(1<s.length)throw Error(r(93));s=s[0]}l=s}l==null&&(l=""),n=l}l=fn(n),e.defaultValue=l,s=e.textContent,s===l&&s!==""&&s!==null&&(e.value=s),Yi(e)}function ei(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var is=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 ur(e,n,l){var s=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,l):typeof l!="number"||l===0||is.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function Bo(e,n,l){if(n!=null&&typeof n!="object")throw Error(r(62));if(e=e.style,l!=null){for(var s in l)!l.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)&&l[f]!==s&&ur(e,f,s)}else for(var p in n)n.hasOwnProperty(p)&&ur(e,p,n[p])}function wa(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 qo=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"]]),Ic=/^[\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 di(e){return Ic.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function fi(){}var cr=null;function Dl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ki=null,Xi=null;function ka(e){var n=Vi(e);if(n&&(e=n.stateNode)){var l=e[zt]||null;e:switch(e=n.stateNode,n.type){case"input":if(va(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+nn(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==e&&s.form===e.form){var f=s[zt]||null;if(!f)throw Error(r(90));va(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)s=l[n],s.form===e.form&&Uo(s)}break e;case"textarea":ci(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&Zt(e,!!l.multiple,n,!1)}}}var dr=!1;function Ml(e,n,l){if(dr)return e(n,l);dr=!0;try{var s=e(n);return s}finally{if(dr=!1,(Ki!==null||Xi!==null)&&(Iu(),Ki&&(n=Ki,e=Xi,Xi=Ki=null,ka(n),e)))for(n=0;n<e.length;n++)ka(e[n])}}function Pi(e,n){var l=e.stateNode;if(l===null)return null;var s=l[zt]||null;if(s===null)return null;l=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(l&&typeof l!="function")throw Error(r(231,n,typeof l));return l}var qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sa=!1;if(qn)try{var Ol={};Object.defineProperty(Ol,"passive",{get:function(){Sa=!0}}),window.addEventListener("test",Ol,Ol),window.removeEventListener("test",Ol,Ol)}catch{Sa=!1}var pi=null,ti=null,pn=null;function Jt(){if(pn)return pn;var e,n=ti,l=n.length,s,f="value"in pi?pi.value:pi.textContent,p=f.length;for(e=0;e<l&&n[e]===f[e];e++);var v=l-e;for(s=1;s<=v&&n[l-s]===f[p-s];s++);return pn=f.slice(e,1<s?1-s:void 0)}function Qi(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 Wi(){return!0}function Rl(){return!1}function _t(e){function n(l,s,f,p,v){this._reactName=l,this._targetInst=f,this.type=s,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(l=e[j],this[j]=l?l(p):p[j]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Wi:Rl,this.isPropagationStopped=Rl,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Wi)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Wi)},persist:function(){},isPersistent:Wi}),n}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zi=_t(ni),Ji=x({},ni,{view:0,detail:0}),ls=_t(Ji),ke,fr,Hn,Dt=x({},Ji,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Aa,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!==Hn&&(Hn&&e.type==="mousemove"?(ke=e.screenX-Hn.screenX,fr=e.screenY-Hn.screenY):fr=ke=0,Hn=e),ke)},movementY:function(e){return"movementY"in e?e.movementY:fr}}),pr=_t(Dt),ja=x({},Dt,{dataTransfer:0}),nt=_t(ja),zl=x({},Ji,{relatedTarget:0}),Ll=_t(zl),Ca=x({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),Ea=_t(Ca),as=x({},ni,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hr=_t(as),Uc=x({},ni,{data:0}),Ho=_t(Uc),Ta={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$o={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"},rs={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ss(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=rs[e])?!!n[e]:!1}function Aa(){return ss}var os=x({},Ji,{key:function(e){if(e.key){var n=Ta[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Qi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$o[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Aa,charCode:function(e){return e.type==="keypress"?Qi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Qi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mr=_t(os),Bc=x({},Dt,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Il=_t(Bc),qc=x({},Ji,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Aa}),Hc=_t(qc),$c=x({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),Go=_t($c),el=x({},Dt,{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}),Na=_t(el),Ae=x({},ni,{newState:0,oldState:0}),Gc=_t(Ae),Sn=[9,13,27,32],us=qn&&"CompositionEvent"in window,_a=null;qn&&"documentMode"in document&&(_a=document.documentMode);var cs=qn&&"TextEvent"in window&&!_a,Vo=qn&&(!us||_a&&8<_a&&11>=_a),ds=" ",gr=!1;function Yo(e,n){switch(e){case"keyup":return Sn.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tl=!1;function fs(e,n){switch(e){case"compositionend":return yr(n);case"keypress":return n.which!==32?null:(gr=!0,ds);case"textInput":return e=n.data,e===ds&&gr?null:e;default:return null}}function Vc(e,n){if(tl)return e==="compositionend"||!us&&Yo(e,n)?(e=Jt(),pn=ti=pi=null,tl=!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 Vo&&n.locale!=="ko"?null:n.data;default:return null}}var ps={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 Fo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ps[e.type]:n==="textarea"}function Ko(e,n,l,s){Ki?Xi?Xi.push(s):Xi=[s]:Ki=s,n=Vu(n,"onChange"),0<n.length&&(l=new Zi("onChange","change",null,l,s),e.push({event:l,listeners:n}))}var Ul=null,Da=null;function Yc(e){wg(e,0)}function Ma(e){var n=xa(e);if(Uo(n))return e}function Xo(e,n){if(e==="change")return n}var Po=!1;if(qn){var hs;if(qn){var ms="oninput"in document;if(!ms){var Qo=document.createElement("div");Qo.setAttribute("oninput","return;"),ms=typeof Qo.oninput=="function"}hs=ms}else hs=!1;Po=hs&&(!document.documentMode||9<document.documentMode)}function Wo(){Ul&&(Ul.detachEvent("onpropertychange",Zo),Da=Ul=null)}function Zo(e){if(e.propertyName==="value"&&Ma(Da)){var n=[];Ko(n,Da,e,Dl(e)),Ml(Yc,n)}}function Fc(e,n,l){e==="focusin"?(Wo(),Ul=n,Da=l,Ul.attachEvent("onpropertychange",Zo)):e==="focusout"&&Wo()}function Kc(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ma(Da)}function Xc(e,n){if(e==="click")return Ma(n)}function Pc(e,n){if(e==="input"||e==="change")return Ma(n)}function Qc(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var hn=typeof Object.is=="function"?Object.is:Qc;function Oa(e,n){if(hn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var l=Object.keys(e),s=Object.keys(n);if(l.length!==s.length)return!1;for(s=0;s<l.length;s++){var f=l[s];if(!In.call(n,f)||!hn(e[f],n[f]))return!1}return!0}function Jo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gs(e,n){var l=Jo(e);e=0;for(var s;l;){if(l.nodeType===3){if(s=e+l.textContent.length,e<=n&&s>=n)return{node:l,offset:n-e};e=s}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Jo(l)}}function _i(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?_i(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ys(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Fi(e.document);n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=Fi(e.document)}return n}function nl(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 il=qn&&"documentMode"in document&&11>=document.documentMode,Bl=null,xs=null,Ra=null,bs=!1;function eu(e,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;bs||Bl==null||Bl!==Fi(s)||(s=Bl,"selectionStart"in s&&nl(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}),Ra&&Oa(Ra,s)||(Ra=s,s=Vu(xs,"onSelect"),0<s.length&&(n=new Zi("onSelect","select",null,n,l),e.push({event:n,listeners:s}),n.target=Bl)))}function ll(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var al={animationend:ll("Animation","AnimationEnd"),animationiteration:ll("Animation","AnimationIteration"),animationstart:ll("Animation","AnimationStart"),transitionrun:ll("Transition","TransitionRun"),transitionstart:ll("Transition","TransitionStart"),transitioncancel:ll("Transition","TransitionCancel"),transitionend:ll("Transition","TransitionEnd")},xr={},tu={};qn&&(tu=document.createElement("div").style,"AnimationEvent"in window||(delete al.animationend.animation,delete al.animationiteration.animation,delete al.animationstart.animation),"TransitionEvent"in window||delete al.transitionend.transition);function rl(e){if(xr[e])return xr[e];if(!al[e])return e;var n=al[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in tu)return xr[e]=n[l];return e}var nu=rl("animationend"),sl=rl("animationiteration"),za=rl("animationstart"),Wc=rl("transitionrun"),Zc=rl("transitionstart"),iu=rl("transitioncancel"),lu=rl("transitionend"),vs=new Map,ws="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(" ");ws.push("scrollEnd");function $n(e,n){vs.set(e,n),dn(n,[e])}var br=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)},jn=[],ql=0,ks=0;function vr(){for(var e=ql,n=ks=ql=0;n<e;){var l=jn[n];jn[n++]=null;var s=jn[n];jn[n++]=null;var f=jn[n];jn[n++]=null;var p=jn[n];if(jn[n++]=null,s!==null&&f!==null){var v=s.pending;v===null?f.next=f:(f.next=v.next,v.next=f),s.pending=f}p!==0&&au(l,f,p)}}function wr(e,n,l,s){jn[ql++]=e,jn[ql++]=n,jn[ql++]=l,jn[ql++]=s,ks|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Ss(e,n,l,s){return wr(e,n,l,s),kr(e)}function ol(e,n){return wr(e,null,null,n),kr(e)}function au(e,n,l){e.lanes|=l;var s=e.alternate;s!==null&&(s.lanes|=l);for(var f=!1,p=e.return;p!==null;)p.childLanes|=l,s=p.alternate,s!==null&&(s.childLanes|=l),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(f=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,f&&n!==null&&(f=31-tt(l),e=p.hiddenUpdates,s=e[f],s===null?e[f]=[n]:s.push(n),n.lane=l|536870912),p):null}function kr(e){if(50<Ys)throw Ys=0,Wd=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Hl={};function Sr(e,n,l,s){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=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 mn(e,n,l,s){return new Sr(e,n,l,s)}function La(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hi(e,n){var l=e.alternate;return l===null?(l=mn(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function ru(e,n){e.flags&=65011714;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,n=l.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function $l(e,n,l,s,f,p){var v=0;if(s=e,typeof e=="function")La(e)&&(v=1);else if(typeof e=="string")v=Hw(e,l,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=mn(31,l,n,f),e.elementType=P,e.lanes=p,e;case L:return Di(l.children,f,p,n);case z:v=8,f|=24;break;case D:return e=mn(12,l,n,f|2),e.elementType=D,e.lanes=p,e;case de:return e=mn(13,l,n,f),e.elementType=de,e.lanes=p,e;case _:return e=mn(19,l,n,f),e.elementType=_,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:v=10;break e;case W:v=9;break e;case K:v=11;break e;case Z:v=14;break e;case te:v=16,s=null;break e}v=29,l=Error(r(130,e===null?"null":typeof e,"")),s=null}return n=mn(v,l,n,f),n.elementType=e,n.type=s,n.lanes=p,n}function Di(e,n,l,s){return e=mn(7,e,s,n),e.lanes=l,e}function Ia(e,n,l){return e=mn(6,e,null,n),e.lanes=l,e}function js(e){var n=mn(18,null,null,0);return n.stateNode=e,n}function Ua(e,n,l){return n=mn(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var su=new WeakMap;function Cn(e,n){if(typeof e=="object"&&e!==null){var l=su.get(e);return l!==void 0?l:(n={value:e,source:n,stack:Zn(n)},su.set(e,n),n)}return{value:e,source:n,stack:Zn(n)}}var Gl=[],Vl=0,Ba=null,mi=0,En=[],Tn=0,An=null,ln=1,an="";function gi(e,n){Gl[Vl++]=mi,Gl[Vl++]=Ba,Ba=e,mi=n}function ou(e,n,l){En[Tn++]=ln,En[Tn++]=an,En[Tn++]=An,An=e;var s=ln;e=an;var f=32-tt(s)-1;s&=~(1<<f),l+=1;var p=32-tt(n)+f;if(30<p){var v=f-f%5;p=(s&(1<<v)-1).toString(32),s>>=v,f-=v,ln=1<<32-tt(n)+f|l<<f|s,an=p+e}else ln=1<<p|l<<f|s,an=e}function lt(e){e.return!==null&&(gi(e,1),ou(e,1,0))}function Mi(e){for(;e===Ba;)Ba=Gl[--Vl],Gl[Vl]=null,mi=Gl[--Vl],Gl[Vl]=null;for(;e===An;)An=En[--Tn],En[Tn]=null,an=En[--Tn],En[Tn]=null,ln=En[--Tn],En[Tn]=null}function Gn(e,n){En[Tn++]=ln,En[Tn++]=an,En[Tn++]=An,ln=n.id,an=n.overflow,An=e}var $t=null,We=null,Ge=!1,Oi=null,Nn=!1,qa=Error(r(519));function Ri(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yl(Cn(n,e)),qa}function uu(e){var n=e.stateNode,l=e.type,s=e.memoizedProps;switch(n[Ht]=e,n[zt]=s,l){case"dialog":Ye("cancel",n),Ye("close",n);break;case"iframe":case"object":case"embed":Ye("load",n);break;case"video":case"audio":for(l=0;l<Ks.length;l++)Ye(Ks[l],n);break;case"source":Ye("error",n);break;case"img":case"image":case"link":Ye("error",n),Ye("load",n);break;case"details":Ye("toggle",n);break;case"input":Ye("invalid",n),ns(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ye("invalid",n);break;case"textarea":Ye("invalid",n),or(n,s.value,s.defaultValue,s.children)}l=s.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||s.suppressHydrationWarning===!0||Cg(n.textContent,l)?(s.popover!=null&&(Ye("beforetoggle",n),Ye("toggle",n)),s.onScroll!=null&&Ye("scroll",n),s.onScrollEnd!=null&&Ye("scrollend",n),s.onClick!=null&&(n.onclick=fi),n=!0):n=!1,n||Ri(e,!0)}function cu(e){for($t=e.return;$t;)switch($t.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:$t=$t.return}}function ul(e){if(e!==$t)return!1;if(!Ge)return cu(e),Ge=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||pf(e.type,e.memoizedProps)),l=!l),l&&We&&Ri(e),cu(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));We=Rg(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));We=Rg(e)}else n===27?(n=We,la(e.type)?(e=xf,xf=null,We=e):We=n):We=$t?li(e.stateNode.nextSibling):null;return!0}function zi(){We=$t=null,Ge=!1}function jr(){var e=Oi;return e!==null&&(On===null?On=e:On.push.apply(On,e),Oi=null),e}function Yl(e){Oi===null?Oi=[e]:Oi.push(e)}var y=C(null),k=null,E=null;function M(e,n,l){A(y,n._currentValue),n._currentValue=l}function I(e){e._currentValue=y.current,B(y)}function Q(e,n,l){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===l)break;e=e.return}}function Ee(e,n,l,s){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var p=f.dependencies;if(p!==null){var v=f.child;p=p.firstContext;e:for(;p!==null;){var j=p;p=f;for(var O=0;O<n.length;O++)if(j.context===n[O]){p.lanes|=l,j=p.alternate,j!==null&&(j.lanes|=l),Q(p.return,l,e),s||(v=null);break e}p=j.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=l,p=v.alternate,p!==null&&(p.lanes|=l),Q(v,l,e),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===e){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function Se(e,n,l,s){e=null;for(var f=n,p=!1;f!==null;){if(!p){if((f.flags&524288)!==0)p=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var j=f.type;hn(f.pendingProps.value,v.value)||(e!==null?e.push(j):e=[j])}}else if(f===xe.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Zs):e=[Zs])}f=f.return}e!==null&&Ee(n,e,l,s),n.flags|=262144}function Re(e){for(e=e.firstContext;e!==null;){if(!hn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function be(e){k=e,E=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return gn(k,e)}function dt(e,n){return k===null&&be(e),gn(e,n)}function gn(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},E===null){if(e===null)throw Error(r(308));E=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else E=E.next=n;return l}var cl=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(l,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(l){return l()})}},Ha=t.unstable_scheduleCallback,Cs=t.unstable_NormalPriority,Lt={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jc(){return{controller:new cl,data:new Map,refCount:0}}function Es(e){e.refCount--,e.refCount===0&&Ha(Cs,function(){e.controller.abort()})}var Ts=null,ed=0,Cr=0,Er=null;function qv(e,n){if(Ts===null){var l=Ts=[];ed=0,Cr=lf(),Er={status:"pending",value:void 0,then:function(s){l.push(s)}}}return ed++,n.then(dh,dh),n}function dh(){if(--ed===0&&Ts!==null){Er!==null&&(Er.status="fulfilled");var e=Ts;Ts=null,Cr=0,Er=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Hv(e,n){var l=[],s={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(s.status="rejected",s.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),s}var fh=H.S;H.S=function(e,n){Pm=At(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&qv(e,n),fh!==null&&fh(e,n)};var $a=C(null);function td(){var e=$a.current;return e!==null?e:ft.pooledCache}function du(e,n){n===null?A($a,$a.current):A($a,n.pool)}function ph(){var e=td();return e===null?null:{parent:Lt._currentValue,pool:e}}var Tr=Error(r(460)),nd=Error(r(474)),fu=Error(r(542)),pu={then:function(){}};function hh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function mh(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then(fi,fi),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,yh(e),e;default:if(typeof n.status=="string")n.then(fi,fi);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(r(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,yh(e),e}throw Va=n,Tr}}function Ga(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Va=l,Tr):l}}var Va=null;function gh(){if(Va===null)throw Error(r(459));var e=Va;return Va=null,e}function yh(e){if(e===Tr||e===fu)throw Error(r(483))}var Ar=null,As=0;function hu(e){var n=As;return As+=1,Ar===null&&(Ar=[]),mh(Ar,e,n)}function Ns(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function mu(e,n){throw n.$$typeof===w?Error(r(525)):(e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function xh(e){function n(q,U){if(e){var G=q.deletions;G===null?(q.deletions=[U],q.flags|=16):G.push(U)}}function l(q,U){if(!e)return null;for(;U!==null;)n(q,U),U=U.sibling;return null}function s(q){for(var U=new Map;q!==null;)q.key!==null?U.set(q.key,q):U.set(q.index,q),q=q.sibling;return U}function f(q,U){return q=hi(q,U),q.index=0,q.sibling=null,q}function p(q,U,G){return q.index=G,e?(G=q.alternate,G!==null?(G=G.index,G<U?(q.flags|=67108866,U):G):(q.flags|=67108866,U)):(q.flags|=1048576,U)}function v(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function j(q,U,G,ne){return U===null||U.tag!==6?(U=Ia(G,q.mode,ne),U.return=q,U):(U=f(U,G),U.return=q,U)}function O(q,U,G,ne){var je=G.type;return je===L?J(q,U,G.props.children,ne,G.key):U!==null&&(U.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===te&&Ga(je)===U.type)?(U=f(U,G.props),Ns(U,G),U.return=q,U):(U=$l(G.type,G.key,G.props,null,q.mode,ne),Ns(U,G),U.return=q,U)}function V(q,U,G,ne){return U===null||U.tag!==4||U.stateNode.containerInfo!==G.containerInfo||U.stateNode.implementation!==G.implementation?(U=Ua(G,q.mode,ne),U.return=q,U):(U=f(U,G.children||[]),U.return=q,U)}function J(q,U,G,ne,je){return U===null||U.tag!==7?(U=Di(G,q.mode,ne,je),U.return=q,U):(U=f(U,G),U.return=q,U)}function ie(q,U,G){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Ia(""+U,q.mode,G),U.return=q,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return G=$l(U.type,U.key,U.props,null,q.mode,G),Ns(G,U),G.return=q,G;case T:return U=Ua(U,q.mode,G),U.return=q,U;case te:return U=Ga(U),ie(q,U,G)}if(re(U)||ue(U))return U=Di(U,q.mode,G,null),U.return=q,U;if(typeof U.then=="function")return ie(q,hu(U),G);if(U.$$typeof===Y)return ie(q,dt(q,U),G);mu(q,U)}return null}function F(q,U,G,ne){var je=U!==null?U.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return je!==null?null:j(q,U,""+G,ne);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case S:return G.key===je?O(q,U,G,ne):null;case T:return G.key===je?V(q,U,G,ne):null;case te:return G=Ga(G),F(q,U,G,ne)}if(re(G)||ue(G))return je!==null?null:J(q,U,G,ne,null);if(typeof G.then=="function")return F(q,U,hu(G),ne);if(G.$$typeof===Y)return F(q,U,dt(q,G),ne);mu(q,G)}return null}function X(q,U,G,ne,je){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return q=q.get(G)||null,j(U,q,""+ne,je);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return q=q.get(ne.key===null?G:ne.key)||null,O(U,q,ne,je);case T:return q=q.get(ne.key===null?G:ne.key)||null,V(U,q,ne,je);case te:return ne=Ga(ne),X(q,U,G,ne,je)}if(re(ne)||ue(ne))return q=q.get(G)||null,J(U,q,ne,je,null);if(typeof ne.then=="function")return X(q,U,G,hu(ne),je);if(ne.$$typeof===Y)return X(q,U,G,dt(U,ne),je);mu(U,ne)}return null}function ve(q,U,G,ne){for(var je=null,Ze=null,we=U,He=U=0,Xe=null;we!==null&&He<G.length;He++){we.index>He?(Xe=we,we=null):Xe=we.sibling;var Je=F(q,we,G[He],ne);if(Je===null){we===null&&(we=Xe);break}e&&we&&Je.alternate===null&&n(q,we),U=p(Je,U,He),Ze===null?je=Je:Ze.sibling=Je,Ze=Je,we=Xe}if(He===G.length)return l(q,we),Ge&&gi(q,He),je;if(we===null){for(;He<G.length;He++)we=ie(q,G[He],ne),we!==null&&(U=p(we,U,He),Ze===null?je=we:Ze.sibling=we,Ze=we);return Ge&&gi(q,He),je}for(we=s(we);He<G.length;He++)Xe=X(we,q,He,G[He],ne),Xe!==null&&(e&&Xe.alternate!==null&&we.delete(Xe.key===null?He:Xe.key),U=p(Xe,U,He),Ze===null?je=Xe:Ze.sibling=Xe,Ze=Xe);return e&&we.forEach(function(ua){return n(q,ua)}),Ge&&gi(q,He),je}function Me(q,U,G,ne){if(G==null)throw Error(r(151));for(var je=null,Ze=null,we=U,He=U=0,Xe=null,Je=G.next();we!==null&&!Je.done;He++,Je=G.next()){we.index>He?(Xe=we,we=null):Xe=we.sibling;var ua=F(q,we,Je.value,ne);if(ua===null){we===null&&(we=Xe);break}e&&we&&ua.alternate===null&&n(q,we),U=p(ua,U,He),Ze===null?je=ua:Ze.sibling=ua,Ze=ua,we=Xe}if(Je.done)return l(q,we),Ge&&gi(q,He),je;if(we===null){for(;!Je.done;He++,Je=G.next())Je=ie(q,Je.value,ne),Je!==null&&(U=p(Je,U,He),Ze===null?je=Je:Ze.sibling=Je,Ze=Je);return Ge&&gi(q,He),je}for(we=s(we);!Je.done;He++,Je=G.next())Je=X(we,q,He,Je.value,ne),Je!==null&&(e&&Je.alternate!==null&&we.delete(Je.key===null?He:Je.key),U=p(Je,U,He),Ze===null?je=Je:Ze.sibling=Je,Ze=Je);return e&&we.forEach(function(Zw){return n(q,Zw)}),Ge&&gi(q,He),je}function ct(q,U,G,ne){if(typeof G=="object"&&G!==null&&G.type===L&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case S:e:{for(var je=G.key;U!==null;){if(U.key===je){if(je=G.type,je===L){if(U.tag===7){l(q,U.sibling),ne=f(U,G.props.children),ne.return=q,q=ne;break e}}else if(U.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===te&&Ga(je)===U.type){l(q,U.sibling),ne=f(U,G.props),Ns(ne,G),ne.return=q,q=ne;break e}l(q,U);break}else n(q,U);U=U.sibling}G.type===L?(ne=Di(G.props.children,q.mode,ne,G.key),ne.return=q,q=ne):(ne=$l(G.type,G.key,G.props,null,q.mode,ne),Ns(ne,G),ne.return=q,q=ne)}return v(q);case T:e:{for(je=G.key;U!==null;){if(U.key===je)if(U.tag===4&&U.stateNode.containerInfo===G.containerInfo&&U.stateNode.implementation===G.implementation){l(q,U.sibling),ne=f(U,G.children||[]),ne.return=q,q=ne;break e}else{l(q,U);break}else n(q,U);U=U.sibling}ne=Ua(G,q.mode,ne),ne.return=q,q=ne}return v(q);case te:return G=Ga(G),ct(q,U,G,ne)}if(re(G))return ve(q,U,G,ne);if(ue(G)){if(je=ue(G),typeof je!="function")throw Error(r(150));return G=je.call(G),Me(q,U,G,ne)}if(typeof G.then=="function")return ct(q,U,hu(G),ne);if(G.$$typeof===Y)return ct(q,U,dt(q,G),ne);mu(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,U!==null&&U.tag===6?(l(q,U.sibling),ne=f(U,G),ne.return=q,q=ne):(l(q,U),ne=Ia(G,q.mode,ne),ne.return=q,q=ne),v(q)):l(q,U)}return function(q,U,G,ne){try{As=0;var je=ct(q,U,G,ne);return Ar=null,je}catch(we){if(we===Tr||we===fu)throw we;var Ze=mn(29,we,null,q.mode);return Ze.lanes=ne,Ze.return=q,Ze}finally{}}}var Ya=xh(!0),bh=xh(!1),Fl=!1;function id(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ld(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 Kl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xl(e,n,l){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(it&2)!==0){var f=s.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),s.pending=n,n=kr(e),au(e,null,l),n}return wr(e,s,n,l),kr(e)}function _s(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,jl(e,l)}}function ad(e,n){var l=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,l===s)){var f=null,p=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};p===null?f=p=v:p=p.next=v,l=l.next}while(l!==null);p===null?f=p=n:p=p.next=n}else f=p=n;l={baseState:s.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:s.shared,callbacks:s.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}var rd=!1;function Ds(){if(rd){var e=Er;if(e!==null)throw e}}function Ms(e,n,l,s){rd=!1;var f=e.updateQueue;Fl=!1;var p=f.firstBaseUpdate,v=f.lastBaseUpdate,j=f.shared.pending;if(j!==null){f.shared.pending=null;var O=j,V=O.next;O.next=null,v===null?p=V:v.next=V,v=O;var J=e.alternate;J!==null&&(J=J.updateQueue,j=J.lastBaseUpdate,j!==v&&(j===null?J.firstBaseUpdate=V:j.next=V,J.lastBaseUpdate=O))}if(p!==null){var ie=f.baseState;v=0,J=V=O=null,j=p;do{var F=j.lane&-536870913,X=F!==j.lane;if(X?(Ke&F)===F:(s&F)===F){F!==0&&F===Cr&&(rd=!0),J!==null&&(J=J.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var ve=e,Me=j;F=n;var ct=l;switch(Me.tag){case 1:if(ve=Me.payload,typeof ve=="function"){ie=ve.call(ct,ie,F);break e}ie=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Me.payload,F=typeof ve=="function"?ve.call(ct,ie,F):ve,F==null)break e;ie=x({},ie,F);break e;case 2:Fl=!0}}F=j.callback,F!==null&&(e.flags|=64,X&&(e.flags|=8192),X=f.callbacks,X===null?f.callbacks=[F]:X.push(F))}else X={lane:F,tag:j.tag,payload:j.payload,callback:j.callback,next:null},J===null?(V=J=X,O=ie):J=J.next=X,v|=F;if(j=j.next,j===null){if(j=f.shared.pending,j===null)break;X=j,j=X.next,X.next=null,f.lastBaseUpdate=X,f.shared.pending=null}}while(!0);J===null&&(O=ie),f.baseState=O,f.firstBaseUpdate=V,f.lastBaseUpdate=J,p===null&&(f.shared.lanes=0),Jl|=v,e.lanes=v,e.memoizedState=ie}}function vh(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function wh(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)vh(l[e],n)}var Nr=C(null),gu=C(0);function kh(e,n){e=bl,A(gu,e),A(Nr,n),bl=e|n.baseLanes}function sd(){A(gu,bl),A(Nr,Nr.current)}function od(){bl=gu.current,B(Nr),B(gu)}var Vn=C(null),ii=null;function Pl(e){var n=e.alternate;A(Mt,Mt.current&1),A(Vn,e),ii===null&&(n===null||Nr.current!==null||n.memoizedState!==null)&&(ii=e)}function ud(e){A(Mt,Mt.current),A(Vn,e),ii===null&&(ii=e)}function Sh(e){e.tag===22?(A(Mt,Mt.current),A(Vn,e),ii===null&&(ii=e)):Ql()}function Ql(){A(Mt,Mt.current),A(Vn,Vn.current)}function Yn(e){B(Vn),ii===e&&(ii=null),B(Mt)}var Mt=C(0);function yu(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||gf(l)||yf(l)))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 dl=0,Be=null,ot=null,It=null,xu=!1,_r=!1,Fa=!1,bu=0,Os=0,Dr=null,$v=0;function jt(){throw Error(r(321))}function cd(e,n){if(n===null)return!1;for(var l=0;l<n.length&&l<e.length;l++)if(!hn(e[l],n[l]))return!1;return!0}function dd(e,n,l,s,f,p){return dl=p,Be=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,H.H=e===null||e.memoizedState===null?rm:Ed,Fa=!1,p=l(s,f),Fa=!1,_r&&(p=Ch(n,l,s,f)),jh(e),p}function jh(e){H.H=Ls;var n=ot!==null&&ot.next!==null;if(dl=0,It=ot=Be=null,xu=!1,Os=0,Dr=null,n)throw Error(r(300));e===null||Ut||(e=e.dependencies,e!==null&&Re(e)&&(Ut=!0))}function Ch(e,n,l,s){Be=e;var f=0;do{if(_r&&(Dr=null),Os=0,_r=!1,25<=f)throw Error(r(301));if(f+=1,It=ot=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}H.H=sm,p=n(l,s)}while(_r);return p}function Gv(){var e=H.H,n=e.useState()[0];return n=typeof n.then=="function"?Rs(n):n,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(Be.flags|=1024),n}function fd(){var e=bu!==0;return bu=0,e}function pd(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function hd(e){if(xu){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}xu=!1}dl=0,It=ot=Be=null,_r=!1,Os=bu=0,Dr=null}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?Be.memoizedState=It=e:It=It.next=e,It}function Ot(){if(ot===null){var e=Be.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var n=It===null?Be.memoizedState:It.next;if(n!==null)It=n,ot=e;else{if(e===null)throw Be.alternate===null?Error(r(467)):Error(r(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},It===null?Be.memoizedState=It=e:It=It.next=e}return It}function vu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rs(e){var n=Os;return Os+=1,Dr===null&&(Dr=[]),e=mh(Dr,e,n),n=Be,(It===null?n.memoizedState:It.next)===null&&(n=n.alternate,H.H=n===null||n.memoizedState===null?rm:Ed),e}function wu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Rs(e);if(e.$$typeof===Y)return mt(e)}throw Error(r(438,String(e)))}function md(e){var n=null,l=Be.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var s=Be.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}),l===null&&(l=vu(),Be.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(e),s=0;s<e;s++)l[s]=$;return n.index++,l}function fl(e,n){return typeof n=="function"?n(e):n}function ku(e){var n=Ot();return gd(n,ot,e)}function gd(e,n,l){var s=e.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=l;var f=e.baseQueue,p=s.pending;if(p!==null){if(f!==null){var v=f.next;f.next=p.next,p.next=v}n.baseQueue=f=p,s.pending=null}if(p=e.baseState,f===null)e.memoizedState=p;else{n=f.next;var j=v=null,O=null,V=n,J=!1;do{var ie=V.lane&-536870913;if(ie!==V.lane?(Ke&ie)===ie:(dl&ie)===ie){var F=V.revertLane;if(F===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),ie===Cr&&(J=!0);else if((dl&F)===F){V=V.next,F===Cr&&(J=!0);continue}else ie={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},O===null?(j=O=ie,v=p):O=O.next=ie,Be.lanes|=F,Jl|=F;ie=V.action,Fa&&l(p,ie),p=V.hasEagerState?V.eagerState:l(p,ie)}else F={lane:ie,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},O===null?(j=O=F,v=p):O=O.next=F,Be.lanes|=ie,Jl|=ie;V=V.next}while(V!==null&&V!==n);if(O===null?v=p:O.next=j,!hn(p,e.memoizedState)&&(Ut=!0,J&&(l=Er,l!==null)))throw l;e.memoizedState=p,e.baseState=v,e.baseQueue=O,s.lastRenderedState=p}return f===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function yd(e){var n=Ot(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=e;var s=l.dispatch,f=l.pending,p=n.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do p=e(p,v.action),v=v.next;while(v!==f);hn(p,n.memoizedState)||(Ut=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),l.lastRenderedState=p}return[p,s]}function Eh(e,n,l){var s=Be,f=Ot(),p=Ge;if(p){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!hn((ot||f).memoizedState,l);if(v&&(f.memoizedState=l,Ut=!0),f=f.queue,vd(Nh.bind(null,s,f,e),[e]),f.getSnapshot!==n||v||It!==null&&It.memoizedState.tag&1){if(s.flags|=2048,Mr(9,{destroy:void 0},Ah.bind(null,s,f,l,n),null),ft===null)throw Error(r(349));p||(dl&127)!==0||Th(s,n,l)}return l}function Th(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=Be.updateQueue,n===null?(n=vu(),Be.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function Ah(e,n,l,s){n.value=l,n.getSnapshot=s,_h(n)&&Dh(e)}function Nh(e,n,l){return l(function(){_h(n)&&Dh(e)})}function _h(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!hn(e,l)}catch{return!0}}function Dh(e){var n=ol(e,2);n!==null&&Rn(n,e,2)}function xd(e){var n=yn();if(typeof e=="function"){var l=e;if(e=l(),Fa){Qt(!0);try{l()}finally{Qt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:e},n}function Mh(e,n,l,s){return e.baseState=l,gd(e,ot,typeof s=="function"?s:fl)}function Vv(e,n,l,s,f){if(Cu(e))throw Error(r(485));if(e=n.action,e!==null){var p={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){p.listeners.push(v)}};H.T!==null?l(!0):p.isTransition=!1,s(p),l=n.pending,l===null?(p.next=n.pending=p,Oh(n,p)):(p.next=l.next,n.pending=l.next=p)}}function Oh(e,n){var l=n.action,s=n.payload,f=e.state;if(n.isTransition){var p=H.T,v={};H.T=v;try{var j=l(f,s),O=H.S;O!==null&&O(v,j),Rh(e,n,j)}catch(V){bd(e,n,V)}finally{p!==null&&v.types!==null&&(p.types=v.types),H.T=p}}else try{p=l(f,s),Rh(e,n,p)}catch(V){bd(e,n,V)}}function Rh(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(s){zh(e,n,s)},function(s){return bd(e,n,s)}):zh(e,n,l)}function zh(e,n,l){n.status="fulfilled",n.value=l,Lh(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,Oh(e,l)))}function bd(e,n,l){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=l,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 Ih(e,n){return n}function Uh(e,n){if(Ge){var l=ft.formState;if(l!==null){e:{var s=Be;if(Ge){if(We){t:{for(var f=We,p=Nn;f.nodeType!==8;){if(!p){f=null;break t}if(f=li(f.nextSibling),f===null){f=null;break t}}p=f.data,f=p==="F!"||p==="F"?f:null}if(f){We=li(f.nextSibling),s=f.data==="F!";break e}}Ri(s)}s=!1}s&&(n=l[0])}}return l=yn(),l.memoizedState=l.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ih,lastRenderedState:n},l.queue=s,l=im.bind(null,Be,s),s.dispatch=l,s=xd(!1),p=Cd.bind(null,Be,!1,s.queue),s=yn(),f={state:n,dispatch:null,action:e,pending:null},s.queue=f,l=Vv.bind(null,Be,f,p,l),f.dispatch=l,s.memoizedState=e,[n,l,!1]}function Bh(e){var n=Ot();return qh(n,ot,e)}function qh(e,n,l){if(n=gd(e,n,Ih)[0],e=ku(fl)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Rs(n)}catch(v){throw v===Tr?fu:v}else s=n;n=Ot();var f=n.queue,p=f.dispatch;return l!==n.memoizedState&&(Be.flags|=2048,Mr(9,{destroy:void 0},Yv.bind(null,f,l),null)),[s,p,e]}function Yv(e,n){e.action=n}function Hh(e){var n=Ot(),l=ot;if(l!==null)return qh(n,l,e);Ot(),n=n.memoizedState,l=Ot();var s=l.queue.dispatch;return l.memoizedState=e,[n,s,!1]}function Mr(e,n,l,s){return e={tag:e,create:l,deps:s,inst:n,next:null},n=Be.updateQueue,n===null&&(n=vu(),Be.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=e.next=e:(s=l.next,l.next=e,e.next=s,n.lastEffect=e),e}function $h(){return Ot().memoizedState}function Su(e,n,l,s){var f=yn();Be.flags|=e,f.memoizedState=Mr(1|n,{destroy:void 0},l,s===void 0?null:s)}function ju(e,n,l,s){var f=Ot();s=s===void 0?null:s;var p=f.memoizedState.inst;ot!==null&&s!==null&&cd(s,ot.memoizedState.deps)?f.memoizedState=Mr(n,p,l,s):(Be.flags|=e,f.memoizedState=Mr(1|n,p,l,s))}function Gh(e,n){Su(8390656,8,e,n)}function vd(e,n){ju(2048,8,e,n)}function Fv(e){Be.flags|=4;var n=Be.updateQueue;if(n===null)n=vu(),Be.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function Vh(e){var n=Ot().memoizedState;return Fv({ref:n,nextImpl:e}),function(){if((it&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Yh(e,n){return ju(4,2,e,n)}function Fh(e,n){return ju(4,4,e,n)}function Kh(e,n){if(typeof n=="function"){e=e();var l=n(e);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Xh(e,n,l){l=l!=null?l.concat([e]):null,ju(4,4,Kh.bind(null,n,e),l)}function wd(){}function Ph(e,n){var l=Ot();n=n===void 0?null:n;var s=l.memoizedState;return n!==null&&cd(n,s[1])?s[0]:(l.memoizedState=[e,n],e)}function Qh(e,n){var l=Ot();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&cd(n,s[1]))return s[0];if(s=e(),Fa){Qt(!0);try{e()}finally{Qt(!1)}}return l.memoizedState=[s,n],s}function kd(e,n,l){return l===void 0||(dl&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Wm(),Be.lanes|=e,Jl|=e,l)}function Wh(e,n,l,s){return hn(l,n)?l:Nr.current!==null?(e=kd(e,l,s),hn(e,n)||(Ut=!0),e):(dl&42)===0||(dl&1073741824)!==0&&(Ke&261930)===0?(Ut=!0,e.memoizedState=l):(e=Wm(),Be.lanes|=e,Jl|=e,n)}function Zh(e,n,l,s,f){var p=le.p;le.p=p!==0&&8>p?p:8;var v=H.T,j={};H.T=j,Cd(e,!1,n,l);try{var O=f(),V=H.S;if(V!==null&&V(j,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var J=Hv(O,s);zs(e,n,J,Xn(e))}else zs(e,n,s,Xn(e))}catch(ie){zs(e,n,{then:function(){},status:"rejected",reason:ie},Xn())}finally{le.p=p,v!==null&&j.types!==null&&(v.types=j.types),H.T=v}}function Kv(){}function Sd(e,n,l,s){if(e.tag!==5)throw Error(r(476));var f=Jh(e).queue;Zh(e,f,n,ye,l===null?Kv:function(){return em(e),l(s)})}function Jh(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:ye},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function em(e){var n=Jh(e);n.next===null&&(n=e.alternate.memoizedState),zs(e,n.next.queue,{},Xn())}function jd(){return mt(Zs)}function tm(){return Ot().memoizedState}function nm(){return Ot().memoizedState}function Xv(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=Xn();e=Kl(l);var s=Xl(n,e,l);s!==null&&(Rn(s,n,l),_s(s,n,l)),n={cache:Jc()},e.payload=n;return}n=n.return}}function Pv(e,n,l){var s=Xn();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Cu(e)?lm(n,l):(l=Ss(e,n,l,s),l!==null&&(Rn(l,e,s),am(l,n,s)))}function im(e,n,l){var s=Xn();zs(e,n,l,s)}function zs(e,n,l,s){var f={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Cu(e))lm(n,f);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var v=n.lastRenderedState,j=p(v,l);if(f.hasEagerState=!0,f.eagerState=j,hn(j,v))return wr(e,n,f,0),ft===null&&vr(),!1}catch{}finally{}if(l=Ss(e,n,f,s),l!==null)return Rn(l,e,s),am(l,n,s),!0}return!1}function Cd(e,n,l,s){if(s={lane:2,revertLane:lf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Cu(e)){if(n)throw Error(r(479))}else n=Ss(e,l,s,2),n!==null&&Rn(n,e,2)}function Cu(e){var n=e.alternate;return e===Be||n!==null&&n===Be}function lm(e,n){_r=xu=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function am(e,n,l){if((l&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,jl(e,l)}}var Ls={readContext:mt,use:wu,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};Ls.useEffectEvent=jt;var rm={readContext:mt,use:wu,useCallback:function(e,n){return yn().memoizedState=[e,n===void 0?null:n],e},useContext:mt,useEffect:Gh,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,Su(4194308,4,Kh.bind(null,n,e),l)},useLayoutEffect:function(e,n){return Su(4194308,4,e,n)},useInsertionEffect:function(e,n){Su(4,2,e,n)},useMemo:function(e,n){var l=yn();n=n===void 0?null:n;var s=e();if(Fa){Qt(!0);try{e()}finally{Qt(!1)}}return l.memoizedState=[s,n],s},useReducer:function(e,n,l){var s=yn();if(l!==void 0){var f=l(n);if(Fa){Qt(!0);try{l(n)}finally{Qt(!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=Pv.bind(null,Be,e),[s.memoizedState,e]},useRef:function(e){var n=yn();return e={current:e},n.memoizedState=e},useState:function(e){e=xd(e);var n=e.queue,l=im.bind(null,Be,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:wd,useDeferredValue:function(e,n){var l=yn();return kd(l,e,n)},useTransition:function(){var e=xd(!1);return e=Zh.bind(null,Be,e.queue,!0,!1),yn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var s=Be,f=yn();if(Ge){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),ft===null)throw Error(r(349));(Ke&127)!==0||Th(s,n,l)}f.memoizedState=l;var p={value:l,getSnapshot:n};return f.queue=p,Gh(Nh.bind(null,s,p,e),[e]),s.flags|=2048,Mr(9,{destroy:void 0},Ah.bind(null,s,p,l,n),null),l},useId:function(){var e=yn(),n=ft.identifierPrefix;if(Ge){var l=an,s=ln;l=(s&~(1<<32-tt(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=bu++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=$v++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:jd,useFormState:Uh,useActionState:Uh,useOptimistic:function(e){var n=yn();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Cd.bind(null,Be,!0,l),l.dispatch=n,[e,n]},useMemoCache:md,useCacheRefresh:function(){return yn().memoizedState=Xv.bind(null,Be)},useEffectEvent:function(e){var n=yn(),l={impl:e};return n.memoizedState=l,function(){if((it&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Ed={readContext:mt,use:wu,useCallback:Ph,useContext:mt,useEffect:vd,useImperativeHandle:Xh,useInsertionEffect:Yh,useLayoutEffect:Fh,useMemo:Qh,useReducer:ku,useRef:$h,useState:function(){return ku(fl)},useDebugValue:wd,useDeferredValue:function(e,n){var l=Ot();return Wh(l,ot.memoizedState,e,n)},useTransition:function(){var e=ku(fl)[0],n=Ot().memoizedState;return[typeof e=="boolean"?e:Rs(e),n]},useSyncExternalStore:Eh,useId:tm,useHostTransitionStatus:jd,useFormState:Bh,useActionState:Bh,useOptimistic:function(e,n){var l=Ot();return Mh(l,ot,e,n)},useMemoCache:md,useCacheRefresh:nm};Ed.useEffectEvent=Vh;var sm={readContext:mt,use:wu,useCallback:Ph,useContext:mt,useEffect:vd,useImperativeHandle:Xh,useInsertionEffect:Yh,useLayoutEffect:Fh,useMemo:Qh,useReducer:yd,useRef:$h,useState:function(){return yd(fl)},useDebugValue:wd,useDeferredValue:function(e,n){var l=Ot();return ot===null?kd(l,e,n):Wh(l,ot.memoizedState,e,n)},useTransition:function(){var e=yd(fl)[0],n=Ot().memoizedState;return[typeof e=="boolean"?e:Rs(e),n]},useSyncExternalStore:Eh,useId:tm,useHostTransitionStatus:jd,useFormState:Hh,useActionState:Hh,useOptimistic:function(e,n){var l=Ot();return ot!==null?Mh(l,ot,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:md,useCacheRefresh:nm};sm.useEffectEvent=Vh;function Td(e,n,l,s){n=e.memoizedState,l=l(s,n),l=l==null?n:x({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ad={enqueueSetState:function(e,n,l){e=e._reactInternals;var s=Xn(),f=Kl(s);f.payload=n,l!=null&&(f.callback=l),n=Xl(e,f,s),n!==null&&(Rn(n,e,s),_s(n,e,s))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var s=Xn(),f=Kl(s);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=Xl(e,f,s),n!==null&&(Rn(n,e,s),_s(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=Xn(),s=Kl(l);s.tag=2,n!=null&&(s.callback=n),n=Xl(e,s,l),n!==null&&(Rn(n,e,l),_s(n,e,l))}};function om(e,n,l,s,f,p,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,p,v):n.prototype&&n.prototype.isPureReactComponent?!Oa(l,s)||!Oa(f,p):!0}function um(e,n,l,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,s),n.state!==e&&Ad.enqueueReplaceState(n,n.state,null)}function Ka(e,n){var l=n;if("ref"in n){l={};for(var s in n)s!=="ref"&&(l[s]=n[s])}if(e=e.defaultProps){l===n&&(l=x({},l));for(var f in e)l[f]===void 0&&(l[f]=e[f])}return l}function cm(e){br(e)}function dm(e){console.error(e)}function fm(e){br(e)}function Eu(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function pm(e,n,l){try{var s=e.onCaughtError;s(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Nd(e,n,l){return l=Kl(l),l.tag=3,l.payload={element:null},l.callback=function(){Eu(e,n)},l}function hm(e){return e=Kl(e),e.tag=3,e}function mm(e,n,l,s){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var p=s.value;e.payload=function(){return f(p)},e.callback=function(){pm(n,l,s)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){pm(n,l,s),typeof f!="function"&&(ea===null?ea=new Set([this]):ea.add(this));var j=s.stack;this.componentDidCatch(s.value,{componentStack:j!==null?j:""})})}function Qv(e,n,l,s,f){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&Se(n,l,f,!0),l=Vn.current,l!==null){switch(l.tag){case 31:case 13:return ii===null?Uu():l.alternate===null&&Ct===0&&(Ct=3),l.flags&=-257,l.flags|=65536,l.lanes=f,s===pu?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([s]):n.add(s),ef(e,s,f)),!1;case 22:return l.flags|=65536,s===pu?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([s]):l.add(s)),ef(e,s,f)),!1}throw Error(r(435,l.tag))}return ef(e,s,f),Uu(),!1}if(Ge)return n=Vn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,s!==qa&&(e=Error(r(422),{cause:s}),Yl(Cn(e,l)))):(s!==qa&&(n=Error(r(423),{cause:s}),Yl(Cn(n,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=Cn(s,l),f=Nd(e.stateNode,s,f),ad(e,f),Ct!==4&&(Ct=2)),!1;var p=Error(r(520),{cause:s});if(p=Cn(p,l),Vs===null?Vs=[p]:Vs.push(p),Ct!==4&&(Ct=2),n===null)return!0;s=Cn(s,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=f&-f,l.lanes|=e,e=Nd(l.stateNode,s,e),ad(l,e),!1;case 1:if(n=l.type,p=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(ea===null||!ea.has(p))))return l.flags|=65536,f&=-f,l.lanes|=f,f=hm(f),mm(f,e,l,s),ad(l,f),!1}l=l.return}while(l!==null);return!1}var _d=Error(r(461)),Ut=!1;function en(e,n,l,s){n.child=e===null?bh(n,null,l,s):Ya(n,e.child,l,s)}function gm(e,n,l,s,f){l=l.render;var p=n.ref;if("ref"in s){var v={};for(var j in s)j!=="ref"&&(v[j]=s[j])}else v=s;return be(n),s=dd(e,n,l,v,p,f),j=fd(),e!==null&&!Ut?(pd(e,n,f),pl(e,n,f)):(Ge&&j&<(n),n.flags|=1,en(e,n,s,f),n.child)}function ym(e,n,l,s,f){if(e===null){var p=l.type;return typeof p=="function"&&!La(p)&&p.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=p,xm(e,n,p,s,f)):(e=$l(l.type,null,s,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,!Ud(e,f)){var v=p.memoizedProps;if(l=l.compare,l=l!==null?l:Oa,l(v,s)&&e.ref===n.ref)return pl(e,n,f)}return n.flags|=1,e=hi(p,s),e.ref=n.ref,e.return=n,n.child=e}function xm(e,n,l,s,f){if(e!==null){var p=e.memoizedProps;if(Oa(p,s)&&e.ref===n.ref)if(Ut=!1,n.pendingProps=s=p,Ud(e,f))(e.flags&131072)!==0&&(Ut=!0);else return n.lanes=e.lanes,pl(e,n,f)}return Dd(e,n,l,s,f)}function bm(e,n,l,s){var f=s.children,p=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(p=p!==null?p.baseLanes|l:l,e!==null){for(s=n.child=e.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;s=f&~p}else s=0,n.child=null;return vm(e,n,p,l,s)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&du(n,p!==null?p.cachePool:null),p!==null?kh(n,p):sd(),Sh(n);else return s=n.lanes=536870912,vm(e,n,p!==null?p.baseLanes|l:l,l,s)}else p!==null?(du(n,p.cachePool),kh(n,p),Ql(),n.memoizedState=null):(e!==null&&du(n,null),sd(),Ql());return en(e,n,f,l),n.child}function Is(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function vm(e,n,l,s,f){var p=td();return p=p===null?null:{parent:Lt._currentValue,pool:p},n.memoizedState={baseLanes:l,cachePool:p},e!==null&&du(n,null),sd(),Sh(n),e!==null&&Se(e,n,s,!0),n.childLanes=f,null}function Tu(e,n){return n=Nu({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function wm(e,n,l){return Ya(n,e.child,null,l),e=Tu(n,n.pendingProps),e.flags|=2,Yn(n),n.memoizedState=null,e}function Wv(e,n,l){var s=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ge){if(s.mode==="hidden")return e=Tu(n,s),n.lanes=536870912,Is(null,e);if(ud(n),(e=We)?(e=Og(e,Nn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:An!==null?{id:ln,overflow:an}:null,retryLane:536870912,hydrationErrors:null},l=js(e),l.return=n,n.child=l,$t=n,We=null)):e=null,e===null)throw Ri(n);return n.lanes=536870912,null}return Tu(n,s)}var p=e.memoizedState;if(p!==null){var v=p.dehydrated;if(ud(n),f)if(n.flags&256)n.flags&=-257,n=wm(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ut||Se(e,n,l,!1),f=(l&e.childLanes)!==0,Ut||f){if(s=ft,s!==null&&(v=$i(s,l),v!==0&&v!==p.retryLane))throw p.retryLane=v,ol(e,v),Rn(s,e,v),_d;Uu(),n=wm(e,n,l)}else e=p.treeContext,We=li(v.nextSibling),$t=n,Ge=!0,Oi=null,Nn=!1,e!==null&&Gn(n,e),n=Tu(n,s),n.flags|=4096;return n}return e=hi(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Au(e,n){var l=n.ref;if(l===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(e===null||e.ref!==l)&&(n.flags|=4194816)}}function Dd(e,n,l,s,f){return be(n),l=dd(e,n,l,s,void 0,f),s=fd(),e!==null&&!Ut?(pd(e,n,f),pl(e,n,f)):(Ge&&s&<(n),n.flags|=1,en(e,n,l,f),n.child)}function km(e,n,l,s,f,p){return be(n),n.updateQueue=null,l=Ch(n,s,l,f),jh(e),s=fd(),e!==null&&!Ut?(pd(e,n,p),pl(e,n,p)):(Ge&&s&<(n),n.flags|=1,en(e,n,l,p),n.child)}function Sm(e,n,l,s,f){if(be(n),n.stateNode===null){var p=Hl,v=l.contextType;typeof v=="object"&&v!==null&&(p=mt(v)),p=new l(s,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Ad,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=s,p.state=n.memoizedState,p.refs={},id(n),v=l.contextType,p.context=typeof v=="object"&&v!==null?mt(v):Hl,p.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Td(n,l,v,s),p.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(v=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),v!==p.state&&Ad.enqueueReplaceState(p,p.state,null),Ms(n,s,p,f),Ds(),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){p=n.stateNode;var j=n.memoizedProps,O=Ka(l,j);p.props=O;var V=p.context,J=l.contextType;v=Hl,typeof J=="object"&&J!==null&&(v=mt(J));var ie=l.getDerivedStateFromProps;J=typeof ie=="function"||typeof p.getSnapshotBeforeUpdate=="function",j=n.pendingProps!==j,J||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(j||V!==v)&&um(n,p,s,v),Fl=!1;var F=n.memoizedState;p.state=F,Ms(n,s,p,f),Ds(),V=n.memoizedState,j||F!==V||Fl?(typeof ie=="function"&&(Td(n,l,ie,s),V=n.memoizedState),(O=Fl||om(n,l,O,s,F,V,v))?(J||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(n.flags|=4194308)):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=V),p.props=s,p.state=V,p.context=v,s=O):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{p=n.stateNode,ld(e,n),v=n.memoizedProps,J=Ka(l,v),p.props=J,ie=n.pendingProps,F=p.context,V=l.contextType,O=Hl,typeof V=="object"&&V!==null&&(O=mt(V)),j=l.getDerivedStateFromProps,(V=typeof j=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(v!==ie||F!==O)&&um(n,p,s,O),Fl=!1,F=n.memoizedState,p.state=F,Ms(n,s,p,f),Ds();var X=n.memoizedState;v!==ie||F!==X||Fl||e!==null&&e.dependencies!==null&&Re(e.dependencies)?(typeof j=="function"&&(Td(n,l,j,s),X=n.memoizedState),(J=Fl||om(n,l,J,s,F,X,O)||e!==null&&e.dependencies!==null&&Re(e.dependencies))?(V||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(s,X,O),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(s,X,O)),typeof p.componentDidUpdate=="function"&&(n.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof p.componentDidUpdate!="function"||v===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=X),p.props=s,p.state=X,p.context=O,s=J):(typeof p.componentDidUpdate!="function"||v===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),s=!1)}return p=s,Au(e,n),s=(n.flags&128)!==0,p||s?(p=n.stateNode,l=s&&typeof l.getDerivedStateFromError!="function"?null:p.render(),n.flags|=1,e!==null&&s?(n.child=Ya(n,e.child,null,f),n.child=Ya(n,null,l,f)):en(e,n,l,f),n.memoizedState=p.state,e=n.child):e=pl(e,n,f),e}function jm(e,n,l,s){return zi(),n.flags|=256,en(e,n,l,s),n.child}var Md={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Od(e){return{baseLanes:e,cachePool:ph()}}function Rd(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Kn),e}function Cm(e,n,l){var s=n.pendingProps,f=!1,p=(n.flags&128)!==0,v;if((v=p)||(v=e!==null&&e.memoizedState===null?!1:(Mt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ge){if(f?Pl(n):Ql(),(e=We)?(e=Og(e,Nn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:An!==null?{id:ln,overflow:an}:null,retryLane:536870912,hydrationErrors:null},l=js(e),l.return=n,n.child=l,$t=n,We=null)):e=null,e===null)throw Ri(n);return yf(e)?n.lanes=32:n.lanes=536870912,null}var j=s.children;return s=s.fallback,f?(Ql(),f=n.mode,j=Nu({mode:"hidden",children:j},f),s=Di(s,f,l,null),j.return=n,s.return=n,j.sibling=s,n.child=j,s=n.child,s.memoizedState=Od(l),s.childLanes=Rd(e,v,l),n.memoizedState=Md,Is(null,s)):(Pl(n),zd(n,j))}var O=e.memoizedState;if(O!==null&&(j=O.dehydrated,j!==null)){if(p)n.flags&256?(Pl(n),n.flags&=-257,n=Ld(e,n,l)):n.memoizedState!==null?(Ql(),n.child=e.child,n.flags|=128,n=null):(Ql(),j=s.fallback,f=n.mode,s=Nu({mode:"visible",children:s.children},f),j=Di(j,f,l,null),j.flags|=2,s.return=n,j.return=n,s.sibling=j,n.child=s,Ya(n,e.child,null,l),s=n.child,s.memoizedState=Od(l),s.childLanes=Rd(e,v,l),n.memoizedState=Md,n=Is(null,s));else if(Pl(n),yf(j)){if(v=j.nextSibling&&j.nextSibling.dataset,v)var V=v.dgst;v=V,s=Error(r(419)),s.stack="",s.digest=v,Yl({value:s,source:null,stack:null}),n=Ld(e,n,l)}else if(Ut||Se(e,n,l,!1),v=(l&e.childLanes)!==0,Ut||v){if(v=ft,v!==null&&(s=$i(v,l),s!==0&&s!==O.retryLane))throw O.retryLane=s,ol(e,s),Rn(v,e,s),_d;gf(j)||Uu(),n=Ld(e,n,l)}else gf(j)?(n.flags|=192,n.child=e.child,n=null):(e=O.treeContext,We=li(j.nextSibling),$t=n,Ge=!0,Oi=null,Nn=!1,e!==null&&Gn(n,e),n=zd(n,s.children),n.flags|=4096);return n}return f?(Ql(),j=s.fallback,f=n.mode,O=e.child,V=O.sibling,s=hi(O,{mode:"hidden",children:s.children}),s.subtreeFlags=O.subtreeFlags&65011712,V!==null?j=hi(V,j):(j=Di(j,f,l,null),j.flags|=2),j.return=n,s.return=n,s.sibling=j,n.child=s,Is(null,s),s=n.child,j=e.child.memoizedState,j===null?j=Od(l):(f=j.cachePool,f!==null?(O=Lt._currentValue,f=f.parent!==O?{parent:O,pool:O}:f):f=ph(),j={baseLanes:j.baseLanes|l,cachePool:f}),s.memoizedState=j,s.childLanes=Rd(e,v,l),n.memoizedState=Md,Is(e.child,s)):(Pl(n),l=e.child,e=l.sibling,l=hi(l,{mode:"visible",children:s.children}),l.return=n,l.sibling=null,e!==null&&(v=n.deletions,v===null?(n.deletions=[e],n.flags|=16):v.push(e)),n.child=l,n.memoizedState=null,l)}function zd(e,n){return n=Nu({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Nu(e,n){return e=mn(22,e,null,n),e.lanes=0,e}function Ld(e,n,l){return Ya(n,e.child,null,l),e=zd(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Em(e,n,l){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),Q(e.return,n,l)}function Id(e,n,l,s,f,p){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:l,tailMode:f,treeForkCount:p}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=s,v.tail=l,v.tailMode=f,v.treeForkCount=p)}function Tm(e,n,l){var s=n.pendingProps,f=s.revealOrder,p=s.tail;s=s.children;var v=Mt.current,j=(v&2)!==0;if(j?(v=v&1|2,n.flags|=128):v&=1,A(Mt,v),en(e,n,s,l),s=Ge?mi:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Em(e,l,n);else if(e.tag===19)Em(e,l,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(l=n.child,f=null;l!==null;)e=l.alternate,e!==null&&yu(e)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),Id(n,!1,f,l,p,s);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&yu(e)===null){n.child=f;break}e=f.sibling,f.sibling=l,l=f,f=e}Id(n,!0,l,null,p,s);break;case"together":Id(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function pl(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),Jl|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(Se(e,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,l=hi(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=hi(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function Ud(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Re(e)))}function Zv(e,n,l){switch(n.tag){case 3:ze(n,n.stateNode.containerInfo),M(n,Lt,e.memoizedState.cache),zi();break;case 27:case 5:Tt(n);break;case 4:ze(n,n.stateNode.containerInfo);break;case 10:M(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,ud(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(Pl(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Cm(e,n,l):(Pl(n),e=pl(e,n,l),e!==null?e.sibling:null);Pl(n);break;case 19:var f=(e.flags&128)!==0;if(s=(l&n.childLanes)!==0,s||(Se(e,n,l,!1),s=(l&n.childLanes)!==0),f){if(s)return Tm(e,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),A(Mt,Mt.current),s)break;return null;case 22:return n.lanes=0,bm(e,n,l,n.pendingProps);case 24:M(n,Lt,e.memoizedState.cache)}return pl(e,n,l)}function Am(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)Ut=!0;else{if(!Ud(e,l)&&(n.flags&128)===0)return Ut=!1,Zv(e,n,l);Ut=(e.flags&131072)!==0}else Ut=!1,Ge&&(n.flags&1048576)!==0&&ou(n,mi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Ga(n.elementType),n.type=e,typeof e=="function")La(e)?(s=Ka(e,s),n.tag=1,n=Sm(null,n,e,s,l)):(n.tag=0,n=Dd(null,n,e,s,l));else{if(e!=null){var f=e.$$typeof;if(f===K){n.tag=11,n=gm(null,n,e,s,l);break e}else if(f===Z){n.tag=14,n=ym(null,n,e,s,l);break e}}throw n=he(e)||e,Error(r(306,n,""))}}return n;case 0:return Dd(e,n,n.type,n.pendingProps,l);case 1:return s=n.type,f=Ka(s,n.pendingProps),Sm(e,n,s,f,l);case 3:e:{if(ze(n,n.stateNode.containerInfo),e===null)throw Error(r(387));s=n.pendingProps;var p=n.memoizedState;f=p.element,ld(e,n),Ms(n,s,null,l);var v=n.memoizedState;if(s=v.cache,M(n,Lt,s),s!==p.cache&&Ee(n,[Lt],l,!0),Ds(),s=v.element,p.isDehydrated)if(p={element:s,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){n=jm(e,n,s,l);break e}else if(s!==f){f=Cn(Error(r(424)),n),Yl(f),n=jm(e,n,s,l);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(We=li(e.firstChild),$t=n,Ge=!0,Oi=null,Nn=!0,l=bh(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(zi(),s===f){n=pl(e,n,l);break e}en(e,n,s,l)}n=n.child}return n;case 26:return Au(e,n),e===null?(l=Bg(n.type,null,n.pendingProps,null))?n.memoizedState=l:Ge||(l=n.type,e=n.pendingProps,s=Yu(fe.current).createElement(l),s[Ht]=n,s[zt]=e,tn(s,l,e),Nt(s),n.stateNode=s):n.memoizedState=Bg(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Tt(n),e===null&&Ge&&(s=n.stateNode=Lg(n.type,n.pendingProps,fe.current),$t=n,Nn=!0,f=We,la(n.type)?(xf=f,We=li(s.firstChild)):We=f),en(e,n,n.pendingProps.children,l),Au(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ge&&((f=s=We)&&(s=Aw(s,n.type,n.pendingProps,Nn),s!==null?(n.stateNode=s,$t=n,We=li(s.firstChild),Nn=!1,f=!0):f=!1),f||Ri(n)),Tt(n),f=n.type,p=n.pendingProps,v=e!==null?e.memoizedProps:null,s=p.children,pf(f,p)?s=null:v!==null&&pf(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=dd(e,n,Gv,null,null,l),Zs._currentValue=f),Au(e,n),en(e,n,s,l),n.child;case 6:return e===null&&Ge&&((e=l=We)&&(l=Nw(l,n.pendingProps,Nn),l!==null?(n.stateNode=l,$t=n,We=null,e=!0):e=!1),e||Ri(n)),null;case 13:return Cm(e,n,l);case 4:return ze(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Ya(n,null,s,l):en(e,n,s,l),n.child;case 11:return gm(e,n,n.type,n.pendingProps,l);case 7:return en(e,n,n.pendingProps,l),n.child;case 8:return en(e,n,n.pendingProps.children,l),n.child;case 12:return en(e,n,n.pendingProps.children,l),n.child;case 10:return s=n.pendingProps,M(n,n.type,s.value),en(e,n,s.children,l),n.child;case 9:return f=n.type._context,s=n.pendingProps.children,be(n),f=mt(f),s=s(f),n.flags|=1,en(e,n,s,l),n.child;case 14:return ym(e,n,n.type,n.pendingProps,l);case 15:return xm(e,n,n.type,n.pendingProps,l);case 19:return Tm(e,n,l);case 31:return Wv(e,n,l);case 22:return bm(e,n,l,n.pendingProps);case 24:return be(n),s=mt(Lt),e===null?(f=td(),f===null&&(f=ft,p=Jc(),f.pooledCache=p,p.refCount++,p!==null&&(f.pooledCacheLanes|=l),f=p),n.memoizedState={parent:s,cache:f},id(n),M(n,Lt,f)):((e.lanes&l)!==0&&(ld(e,n),Ms(n,null,null,l),Ds()),f=e.memoizedState,p=n.memoizedState,f.parent!==s?(f={parent:s,cache:s},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),M(n,Lt,s)):(s=p.cache,M(n,Lt,s),s!==f.cache&&Ee(n,[Lt],l,!0))),en(e,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function hl(e){e.flags|=4}function Bd(e,n,l,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(tg())e.flags|=8192;else throw Va=pu,nd}else e.flags&=-16777217}function Nm(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Vg(n))if(tg())e.flags|=8192;else throw Va=pu,nd}function _u(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Mo():536870912,e.lanes|=n,Lr|=n)}function Us(e,n){if(!Ge)switch(e.tailMode){case"hidden":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var s=null;l!==null;)l.alternate!==null&&(s=l),l=l.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function gt(e){var n=e.alternate!==null&&e.alternate.child===e.child,l=0,s=0;if(n)for(var f=e.child;f!==null;)l|=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;)l|=f.lanes|f.childLanes,s|=f.subtreeFlags,s|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=s,e.childLanes=l,n}function Jv(e,n,l){var s=n.pendingProps;switch(Mi(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(n),null;case 1:return gt(n),null;case 3:return l=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),I(Lt),qe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ul(n)?hl(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,jr())),gt(n),null;case 26:var f=n.type,p=n.memoizedState;return e===null?(hl(n),p!==null?(gt(n),Nm(n,p)):(gt(n),Bd(n,f,null,s,l))):p?p!==e.memoizedState?(hl(n),gt(n),Nm(n,p)):(gt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&hl(n),gt(n),Bd(n,f,e,s,l)),null;case 27:if(wt(n),l=fe.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&hl(n);else{if(!s){if(n.stateNode===null)throw Error(r(166));return gt(n),null}e=ae.current,ul(n)?uu(n):(e=Lg(f,s,l),n.stateNode=e,hl(n))}return gt(n),null;case 5:if(wt(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&hl(n);else{if(!s){if(n.stateNode===null)throw Error(r(166));return gt(n),null}if(p=ae.current,ul(n))uu(n);else{var v=Yu(fe.current);switch(p){case 1:p=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:p=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":p=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":p=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":p=v.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof s.is=="string"?v.createElement("select",{is:s.is}):v.createElement("select"),s.multiple?p.multiple=!0:s.size&&(p.size=s.size);break;default:p=typeof s.is=="string"?v.createElement(f,{is:s.is}):v.createElement(f)}}p[Ht]=n,p[zt]=s;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)p.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=p;e:switch(tn(p,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&&hl(n)}}return gt(n),Bd(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&hl(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(r(166));if(e=fe.current,ul(n)){if(e=n.stateNode,l=n.memoizedProps,s=null,f=$t,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[Ht]=n,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||Cg(e.nodeValue,l)),e||Ri(n,!0)}else e=Yu(e).createTextNode(s),e[Ht]=n,n.stateNode=e}return gt(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(s=ul(n),l!==null){if(e===null){if(!s)throw Error(r(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Ht]=n}else zi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),e=!1}else l=jr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return n.flags&256?(Yn(n),n):(Yn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return gt(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=ul(n),s!==null&&s.dehydrated!==null){if(e===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Ht]=n}else zi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),f=!1}else f=jr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Yn(n),n):(Yn(n),null)}return Yn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=s!==null,e=e!==null&&e.memoizedState!==null,l&&(s=n.child,f=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(f=s.alternate.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==f&&(s.flags|=2048)),l!==e&&l&&(n.child.flags|=8192),_u(n,n.updateQueue),gt(n),null);case 4:return qe(),e===null&&of(n.stateNode.containerInfo),gt(n),null;case 10:return I(n.type),gt(n),null;case 19:if(B(Mt),s=n.memoizedState,s===null)return gt(n),null;if(f=(n.flags&128)!==0,p=s.rendering,p===null)if(f)Us(s,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(p=yu(e),p!==null){for(n.flags|=128,Us(s,!1),e=p.updateQueue,n.updateQueue=e,_u(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)ru(l,e),l=l.sibling;return A(Mt,Mt.current&1|2),Ge&&gi(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&At()>zu&&(n.flags|=128,f=!0,Us(s,!1),n.lanes=4194304)}else{if(!f)if(e=yu(p),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,_u(n,e),Us(s,!0),s.tail===null&&s.tailMode==="hidden"&&!p.alternate&&!Ge)return gt(n),null}else 2*At()-s.renderingStartTime>zu&&l!==536870912&&(n.flags|=128,f=!0,Us(s,!1),n.lanes=4194304);s.isBackwards?(p.sibling=n.child,n.child=p):(e=s.last,e!==null?e.sibling=p:n.child=p,s.last=p)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=At(),e.sibling=null,l=Mt.current,A(Mt,f?l&1|2:l&1),Ge&&gi(n,s.treeForkCount),e):(gt(n),null);case 22:case 23:return Yn(n),od(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(l&536870912)!==0&&(n.flags&128)===0&&(gt(n),n.subtreeFlags&6&&(n.flags|=8192)):gt(n),l=n.updateQueue,l!==null&&_u(n,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==l&&(n.flags|=2048),e!==null&&B($a),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),I(Lt),gt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function ew(e,n){switch(Mi(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return I(Lt),qe(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return wt(n),null;case 31:if(n.memoizedState!==null){if(Yn(n),n.alternate===null)throw Error(r(340));zi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Yn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));zi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return B(Mt),null;case 4:return qe(),null;case 10:return I(n.type),null;case 22:case 23:return Yn(n),od(),e!==null&&B($a),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return I(Lt),null;case 25:return null;default:return null}}function _m(e,n){switch(Mi(n),n.tag){case 3:I(Lt),qe();break;case 26:case 27:case 5:wt(n);break;case 4:qe();break;case 31:n.memoizedState!==null&&Yn(n);break;case 13:Yn(n);break;case 19:B(Mt);break;case 10:I(n.type);break;case 22:case 23:Yn(n),od(),e!==null&&B($a);break;case 24:I(Lt)}}function Bs(e,n){try{var l=n.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var f=s.next;l=f;do{if((l.tag&e)===e){s=void 0;var p=l.create,v=l.inst;s=p(),v.destroy=s}l=l.next}while(l!==f)}}catch(j){st(n,n.return,j)}}function Wl(e,n,l){try{var s=n.updateQueue,f=s!==null?s.lastEffect:null;if(f!==null){var p=f.next;s=p;do{if((s.tag&e)===e){var v=s.inst,j=v.destroy;if(j!==void 0){v.destroy=void 0,f=n;var O=l,V=j;try{V()}catch(J){st(f,O,J)}}}s=s.next}while(s!==p)}}catch(J){st(n,n.return,J)}}function Dm(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{wh(n,l)}catch(s){st(e,e.return,s)}}}function Mm(e,n,l){l.props=Ka(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){st(e,n,s)}}function qs(e,n){try{var l=e.ref;if(l!==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 l=="function"?e.refCleanup=l(s):l.current=s}}catch(f){st(e,n,f)}}function Li(e,n){var l=e.ref,s=e.refCleanup;if(l!==null)if(typeof s=="function")try{s()}catch(f){st(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){st(e,n,f)}else l.current=null}function Om(e){var n=e.type,l=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&s.focus();break e;case"img":l.src?s.src=l.src:l.srcSet&&(s.srcset=l.srcSet)}}catch(f){st(e,e.return,f)}}function qd(e,n,l){try{var s=e.stateNode;kw(s,e.type,l,n),s[zt]=n}catch(f){st(e,e.return,f)}}function Rm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&la(e.type)||e.tag===4}function Hd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&la(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 $d(e,n,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(e),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=fi));else if(s!==4&&(s===27&&la(e.type)&&(l=e.stateNode,n=null),e=e.child,e!==null))for($d(e,n,l),e=e.sibling;e!==null;)$d(e,n,l),e=e.sibling}function Du(e,n,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(s!==4&&(s===27&&la(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Du(e,n,l),e=e.sibling;e!==null;)Du(e,n,l),e=e.sibling}function zm(e){var n=e.stateNode,l=e.memoizedProps;try{for(var s=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);tn(n,s,l),n[Ht]=e,n[zt]=l}catch(p){st(e,e.return,p)}}var ml=!1,Bt=!1,Gd=!1,Lm=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function tw(e,n){if(e=e.containerInfo,df=Zu,e=ys(e),nl(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var s=l.getSelection&&l.getSelection();if(s&&s.rangeCount!==0){l=s.anchorNode;var f=s.anchorOffset,p=s.focusNode;s=s.focusOffset;try{l.nodeType,p.nodeType}catch{l=null;break e}var v=0,j=-1,O=-1,V=0,J=0,ie=e,F=null;t:for(;;){for(var X;ie!==l||f!==0&&ie.nodeType!==3||(j=v+f),ie!==p||s!==0&&ie.nodeType!==3||(O=v+s),ie.nodeType===3&&(v+=ie.nodeValue.length),(X=ie.firstChild)!==null;)F=ie,ie=X;for(;;){if(ie===e)break t;if(F===l&&++V===f&&(j=v),F===p&&++J===s&&(O=v),(X=ie.nextSibling)!==null)break;ie=F,F=ie.parentNode}ie=X}l=j===-1||O===-1?null:{start:j,end:O}}else l=null}l=l||{start:0,end:0}}else l=null;for(ff={focusedElem:e,selectionRange:l},Zu=!1,Kt=n;Kt!==null;)if(n=Kt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Kt=e;else for(;Kt!==null;){switch(n=Kt,p=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(l=0;l<e.length;l++)f=e[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,l=n,f=p.memoizedProps,p=p.memoizedState,s=l.stateNode;try{var ve=Ka(l.type,f);e=s.getSnapshotBeforeUpdate(ve,p),s.__reactInternalSnapshotBeforeUpdate=e}catch(Me){st(l,l.return,Me)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,l=e.nodeType,l===9)mf(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mf(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(r(163))}if(e=n.sibling,e!==null){e.return=n.return,Kt=e;break}Kt=n.return}}function Im(e,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:yl(e,l),s&4&&Bs(5,l);break;case 1:if(yl(e,l),s&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(v){st(l,l.return,v)}else{var f=Ka(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(v){st(l,l.return,v)}}s&64&&Dm(l),s&512&&qs(l,l.return);break;case 3:if(yl(e,l),s&64&&(e=l.updateQueue,e!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{wh(e,n)}catch(v){st(l,l.return,v)}}break;case 27:n===null&&s&4&&zm(l);case 26:case 5:yl(e,l),n===null&&s&4&&Om(l),s&512&&qs(l,l.return);break;case 12:yl(e,l);break;case 31:yl(e,l),s&4&&qm(e,l);break;case 13:yl(e,l),s&4&&Hm(e,l),s&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=cw.bind(null,l),_w(e,l))));break;case 22:if(s=l.memoizedState!==null||ml,!s){n=n!==null&&n.memoizedState!==null||Bt,f=ml;var p=Bt;ml=s,(Bt=n)&&!p?xl(e,l,(l.subtreeFlags&8772)!==0):yl(e,l),ml=f,Bt=p}break;case 30:break;default:yl(e,l)}}function Um(e){var n=e.alternate;n!==null&&(e.alternate=null,Um(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Jn(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 xt=null,_n=!1;function gl(e,n,l){for(l=l.child;l!==null;)Bm(e,n,l),l=l.sibling}function Bm(e,n,l){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Pt,l)}catch{}switch(l.tag){case 26:Bt||Li(l,n),gl(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Bt||Li(l,n);var s=xt,f=_n;la(l.type)&&(xt=l.stateNode,_n=!1),gl(e,n,l),Ps(l.stateNode),xt=s,_n=f;break;case 5:Bt||Li(l,n);case 6:if(s=xt,f=_n,xt=null,gl(e,n,l),xt=s,_n=f,xt!==null)if(_n)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(l.stateNode)}catch(p){st(l,n,p)}else try{xt.removeChild(l.stateNode)}catch(p){st(l,n,p)}break;case 18:xt!==null&&(_n?(e=xt,Dg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Vr(e)):Dg(xt,l.stateNode));break;case 4:s=xt,f=_n,xt=l.stateNode.containerInfo,_n=!0,gl(e,n,l),xt=s,_n=f;break;case 0:case 11:case 14:case 15:Wl(2,l,n),Bt||Wl(4,l,n),gl(e,n,l);break;case 1:Bt||(Li(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&Mm(l,n,s)),gl(e,n,l);break;case 21:gl(e,n,l);break;case 22:Bt=(s=Bt)||l.memoizedState!==null,gl(e,n,l),Bt=s;break;default:gl(e,n,l)}}function qm(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vr(e)}catch(l){st(n,n.return,l)}}}function Hm(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vr(e)}catch(l){st(n,n.return,l)}}function nw(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(r(435,e.tag))}}function Mu(e,n){var l=nw(e);n.forEach(function(s){if(!l.has(s)){l.add(s);var f=dw.bind(null,e,s);s.then(f,f)}})}function Dn(e,n){var l=n.deletions;if(l!==null)for(var s=0;s<l.length;s++){var f=l[s],p=e,v=n,j=v;e:for(;j!==null;){switch(j.tag){case 27:if(la(j.type)){xt=j.stateNode,_n=!1;break e}break;case 5:xt=j.stateNode,_n=!1;break e;case 3:case 4:xt=j.stateNode.containerInfo,_n=!0;break e}j=j.return}if(xt===null)throw Error(r(160));Bm(p,v,f),xt=null,_n=!1,p=f.alternate,p!==null&&(p.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)$m(n,e),n=n.sibling}var yi=null;function $m(e,n){var l=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Dn(n,e),Mn(e),s&4&&(Wl(3,e,e.return),Bs(3,e),Wl(5,e,e.return));break;case 1:Dn(n,e),Mn(e),s&512&&(Bt||l===null||Li(l,l.return)),s&64&&ml&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?s:l.concat(s))));break;case 26:var f=yi;if(Dn(n,e),Mn(e),s&512&&(Bt||l===null||Li(l,l.return)),s&4){var p=l!==null?l.memoizedState:null;if(s=e.memoizedState,l===null)if(s===null)if(e.stateNode===null){e:{s=e.type,l=e.memoizedProps,f=f.ownerDocument||f;t:switch(s){case"title":p=f.getElementsByTagName("title")[0],(!p||p[Cl]||p[Ht]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=f.createElement(s),f.head.insertBefore(p,f.querySelector("head > title"))),tn(p,s,l),p[Ht]=e,Nt(p),s=p;break e;case"link":var v=$g("link","href",f).get(s+(l.href||""));if(v){for(var j=0;j<v.length;j++)if(p=v[j],p.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&p.getAttribute("rel")===(l.rel==null?null:l.rel)&&p.getAttribute("title")===(l.title==null?null:l.title)&&p.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(j,1);break t}}p=f.createElement(s),tn(p,s,l),f.head.appendChild(p);break;case"meta":if(v=$g("meta","content",f).get(s+(l.content||""))){for(j=0;j<v.length;j++)if(p=v[j],p.getAttribute("content")===(l.content==null?null:""+l.content)&&p.getAttribute("name")===(l.name==null?null:l.name)&&p.getAttribute("property")===(l.property==null?null:l.property)&&p.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&p.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(j,1);break t}}p=f.createElement(s),tn(p,s,l),f.head.appendChild(p);break;default:throw Error(r(468,s))}p[Ht]=e,Nt(p),s=p}e.stateNode=s}else Gg(f,e.type,e.stateNode);else e.stateNode=Hg(f,s,e.memoizedProps);else p!==s?(p===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):p.count--,s===null?Gg(f,e.type,e.stateNode):Hg(f,s,e.memoizedProps)):s===null&&e.stateNode!==null&&qd(e,e.memoizedProps,l.memoizedProps)}break;case 27:Dn(n,e),Mn(e),s&512&&(Bt||l===null||Li(l,l.return)),l!==null&&s&4&&qd(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Dn(n,e),Mn(e),s&512&&(Bt||l===null||Li(l,l.return)),e.flags&32){f=e.stateNode;try{ei(f,"")}catch(ve){st(e,e.return,ve)}}s&4&&e.stateNode!=null&&(f=e.memoizedProps,qd(e,f,l!==null?l.memoizedProps:f)),s&1024&&(Gd=!0);break;case 6:if(Dn(n,e),Mn(e),s&4){if(e.stateNode===null)throw Error(r(162));s=e.memoizedProps,l=e.stateNode;try{l.nodeValue=s}catch(ve){st(e,e.return,ve)}}break;case 3:if(Xu=null,f=yi,yi=Fu(n.containerInfo),Dn(n,e),yi=f,Mn(e),s&4&&l!==null&&l.memoizedState.isDehydrated)try{Vr(n.containerInfo)}catch(ve){st(e,e.return,ve)}Gd&&(Gd=!1,Gm(e));break;case 4:s=yi,yi=Fu(e.stateNode.containerInfo),Dn(n,e),Mn(e),yi=s;break;case 12:Dn(n,e),Mn(e);break;case 31:Dn(n,e),Mn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Mu(e,s)));break;case 13:Dn(n,e),Mn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ru=At()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Mu(e,s)));break;case 22:f=e.memoizedState!==null;var O=l!==null&&l.memoizedState!==null,V=ml,J=Bt;if(ml=V||f,Bt=J||O,Dn(n,e),Bt=J,ml=V,Mn(e),s&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||O||ml||Bt||Xa(e)),l=null,n=e;;){if(n.tag===5||n.tag===26){if(l===null){O=l=n;try{if(p=O.stateNode,f)v=p.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{j=O.stateNode;var ie=O.memoizedProps.style,F=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;j.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ve){st(O,O.return,ve)}}}else if(n.tag===6){if(l===null){O=n;try{O.stateNode.nodeValue=f?"":O.memoizedProps}catch(ve){st(O,O.return,ve)}}}else if(n.tag===18){if(l===null){O=n;try{var X=O.stateNode;f?Mg(X,!0):Mg(O.stateNode,!1)}catch(ve){st(O,O.return,ve)}}}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;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(l=s.retryQueue,l!==null&&(s.retryQueue=null,Mu(e,l))));break;case 19:Dn(n,e),Mn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Mu(e,s)));break;case 30:break;case 21:break;default:Dn(n,e),Mn(e)}}function Mn(e){var n=e.flags;if(n&2){try{for(var l,s=e.return;s!==null;){if(Rm(s)){l=s;break}s=s.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,p=Hd(e);Du(e,p,f);break;case 5:var v=l.stateNode;l.flags&32&&(ei(v,""),l.flags&=-33);var j=Hd(e);Du(e,j,v);break;case 3:case 4:var O=l.stateNode.containerInfo,V=Hd(e);$d(e,V,O);break;default:throw Error(r(161))}}catch(J){st(e,e.return,J)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Gm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Gm(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function yl(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Im(e,n.alternate,n),n=n.sibling}function Xa(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Wl(4,n,n.return),Xa(n);break;case 1:Li(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Mm(n,n.return,l),Xa(n);break;case 27:Ps(n.stateNode);case 26:case 5:Li(n,n.return),Xa(n);break;case 22:n.memoizedState===null&&Xa(n);break;case 30:Xa(n);break;default:Xa(n)}e=e.sibling}}function xl(e,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,f=e,p=n,v=p.flags;switch(p.tag){case 0:case 11:case 15:xl(f,p,l),Bs(4,p);break;case 1:if(xl(f,p,l),s=p,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(V){st(s,s.return,V)}if(s=p,f=s.updateQueue,f!==null){var j=s.stateNode;try{var O=f.shared.hiddenCallbacks;if(O!==null)for(f.shared.hiddenCallbacks=null,f=0;f<O.length;f++)vh(O[f],j)}catch(V){st(s,s.return,V)}}l&&v&64&&Dm(p),qs(p,p.return);break;case 27:zm(p);case 26:case 5:xl(f,p,l),l&&s===null&&v&4&&Om(p),qs(p,p.return);break;case 12:xl(f,p,l);break;case 31:xl(f,p,l),l&&v&4&&qm(f,p);break;case 13:xl(f,p,l),l&&v&4&&Hm(f,p);break;case 22:p.memoizedState===null&&xl(f,p,l),qs(p,p.return);break;case 30:break;default:xl(f,p,l)}n=n.sibling}}function Vd(e,n){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Es(l))}function Yd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Es(e))}function xi(e,n,l,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Vm(e,n,l,s),n=n.sibling}function Vm(e,n,l,s){var f=n.flags;switch(n.tag){case 0:case 11:case 15:xi(e,n,l,s),f&2048&&Bs(9,n);break;case 1:xi(e,n,l,s);break;case 3:xi(e,n,l,s),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Es(e)));break;case 12:if(f&2048){xi(e,n,l,s),e=n.stateNode;try{var p=n.memoizedProps,v=p.id,j=p.onPostCommit;typeof j=="function"&&j(v,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){st(n,n.return,O)}}else xi(e,n,l,s);break;case 31:xi(e,n,l,s);break;case 13:xi(e,n,l,s);break;case 23:break;case 22:p=n.stateNode,v=n.alternate,n.memoizedState!==null?p._visibility&2?xi(e,n,l,s):Hs(e,n):p._visibility&2?xi(e,n,l,s):(p._visibility|=2,Or(e,n,l,s,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Vd(v,n);break;case 24:xi(e,n,l,s),f&2048&&Yd(n.alternate,n);break;default:xi(e,n,l,s)}}function Or(e,n,l,s,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=e,v=n,j=l,O=s,V=v.flags;switch(v.tag){case 0:case 11:case 15:Or(p,v,j,O,f),Bs(8,v);break;case 23:break;case 22:var J=v.stateNode;v.memoizedState!==null?J._visibility&2?Or(p,v,j,O,f):Hs(p,v):(J._visibility|=2,Or(p,v,j,O,f)),f&&V&2048&&Vd(v.alternate,v);break;case 24:Or(p,v,j,O,f),f&&V&2048&&Yd(v.alternate,v);break;default:Or(p,v,j,O,f)}n=n.sibling}}function Hs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=e,s=n,f=s.flags;switch(s.tag){case 22:Hs(l,s),f&2048&&Vd(s.alternate,s);break;case 24:Hs(l,s),f&2048&&Yd(s.alternate,s);break;default:Hs(l,s)}n=n.sibling}}var $s=8192;function Rr(e,n,l){if(e.subtreeFlags&$s)for(e=e.child;e!==null;)Ym(e,n,l),e=e.sibling}function Ym(e,n,l){switch(e.tag){case 26:Rr(e,n,l),e.flags&$s&&e.memoizedState!==null&&$w(l,yi,e.memoizedState,e.memoizedProps);break;case 5:Rr(e,n,l);break;case 3:case 4:var s=yi;yi=Fu(e.stateNode.containerInfo),Rr(e,n,l),yi=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=$s,$s=16777216,Rr(e,n,l),$s=s):Rr(e,n,l));break;default:Rr(e,n,l)}}function Fm(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 Gs(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Kt=s,Xm(s,e)}Fm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Km(e),e=e.sibling}function Km(e){switch(e.tag){case 0:case 11:case 15:Gs(e),e.flags&2048&&Wl(9,e,e.return);break;case 3:Gs(e);break;case 12:Gs(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Ou(e)):Gs(e);break;default:Gs(e)}}function Ou(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Kt=s,Xm(s,e)}Fm(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Wl(8,n,n.return),Ou(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Ou(n));break;default:Ou(n)}e=e.sibling}}function Xm(e,n){for(;Kt!==null;){var l=Kt;switch(l.tag){case 0:case 11:case 15:Wl(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var s=l.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Es(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,Kt=s;else e:for(l=e;Kt!==null;){s=Kt;var f=s.sibling,p=s.return;if(Um(s),s===l){Kt=null;break e}if(f!==null){f.return=p,Kt=f;break e}Kt=p}}}var iw={getCacheForType:function(e){var n=mt(Lt),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return mt(Lt).controller.signal}},lw=typeof WeakMap=="function"?WeakMap:Map,it=0,ft=null,Ve=null,Ke=0,rt=0,Fn=null,Zl=!1,zr=!1,Fd=!1,bl=0,Ct=0,Jl=0,Pa=0,Kd=0,Kn=0,Lr=0,Vs=null,On=null,Xd=!1,Ru=0,Pm=0,zu=1/0,Lu=null,ea=null,Gt=0,ta=null,Ir=null,vl=0,Pd=0,Qd=null,Qm=null,Ys=0,Wd=null;function Xn(){return(it&2)!==0&&Ke!==0?Ke&-Ke:H.T!==null?lf():Gi()}function Wm(){if(Kn===0)if((Ke&536870912)===0||Ge){var e=ar;ar<<=1,(ar&3932160)===0&&(ar=262144),Kn=e}else Kn=536870912;return e=Vn.current,e!==null&&(e.flags|=32),Kn}function Rn(e,n,l){(e===ft&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(Ur(e,0),na(e,Ke,Kn,!1)),ga(e,l),((it&2)===0||e!==ft)&&(e===ft&&((it&2)===0&&(Pa|=l),Ct===4&&na(e,Ke,Kn,!1)),Ii(e))}function Zm(e,n,l){if((it&6)!==0)throw Error(r(327));var s=!l&&(n&127)===0&&(n&e.expiredLanes)===0||ma(e,n),f=s?sw(e,n):Jd(e,n,!0),p=s;do{if(f===0){zr&&!s&&na(e,n,0,!1);break}else{if(l=e.current.alternate,p&&!aw(l)){f=Jd(e,n,!1),p=!1;continue}if(f===2){if(p=n,e.errorRecoveryDisabledLanes&p)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var j=e;f=Vs;var O=j.current.memoizedState.isDehydrated;if(O&&(Ur(j,v).flags|=256),v=Jd(j,v,!1),v!==2){if(Fd&&!O){j.errorRecoveryDisabledLanes|=p,Pa|=p,f=4;break e}p=On,On=f,p!==null&&(On===null?On=p:On.push.apply(On,p))}f=v}if(p=!1,f!==2)continue}}if(f===1){Ur(e,0),na(e,n,0,!0);break}e:{switch(s=e,p=f,p){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:na(s,n,Kn,!Zl);break e;case 2:On=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Ru+300-At(),10<f)){if(na(s,n,Kn,!Zl),Ci(s,0,!0)!==0)break e;vl=n,s.timeoutHandle=Ng(Jm.bind(null,s,l,On,Lu,Xd,n,Kn,Pa,Lr,Zl,p,"Throttled",-0,0),f);break e}Jm(s,l,On,Lu,Xd,n,Kn,Pa,Lr,Zl,p,null,-0,0)}}break}while(!0);Ii(e)}function Jm(e,n,l,s,f,p,v,j,O,V,J,ie,F,X){if(e.timeoutHandle=-1,ie=n.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fi},Ym(n,p,ie);var ve=(p&62914560)===p?Ru-At():(p&4194048)===p?Pm-At():0;if(ve=Gw(ie,ve),ve!==null){vl=p,e.cancelPendingCommit=ve(sg.bind(null,e,n,p,l,s,f,v,j,O,J,ie,null,F,X)),na(e,p,v,!V);return}}sg(e,n,p,l,s,f,v,j,O)}function aw(e){for(var n=e;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var s=0;s<l.length;s++){var f=l[s],p=f.getSnapshot;f=f.value;try{if(!hn(p(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;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 na(e,n,l,s){n&=~Kd,n&=~Pa,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var f=n;0<f;){var p=31-tt(f),v=1<<p;s[p]=-1,f&=~v}l!==0&&Ro(e,l,n)}function Iu(){return(it&6)===0?(Fs(0),!1):!0}function Zd(){if(Ve!==null){if(rt===0)var e=Ve.return;else e=Ve,E=k=null,hd(e),Ar=null,As=0,e=Ve;for(;e!==null;)_m(e.alternate,e),e=e.return;Ve=null}}function Ur(e,n){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Cw(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),vl=0,Zd(),ft=e,Ve=l=hi(e.current,null),Ke=n,rt=0,Fn=null,Zl=!1,zr=ma(e,n),Fd=!1,Lr=Kn=Kd=Pa=Jl=Ct=0,On=Vs=null,Xd=!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-tt(s),p=1<<f;n|=e[f],s&=~p}return bl=n,vr(),l}function eg(e,n){Be=null,H.H=Ls,n===Tr||n===fu?(n=gh(),rt=3):n===nd?(n=gh(),rt=4):rt=n===_d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Fn=n,Ve===null&&(Ct=1,Eu(e,Cn(n,e.current)))}function tg(){var e=Vn.current;return e===null?!0:(Ke&4194048)===Ke?ii===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===ii:!1}function ng(){var e=H.H;return H.H=Ls,e===null?Ls:e}function ig(){var e=H.A;return H.A=iw,e}function Uu(){Ct=4,Zl||(Ke&4194048)!==Ke&&Vn.current!==null||(zr=!0),(Jl&134217727)===0&&(Pa&134217727)===0||ft===null||na(ft,Ke,Kn,!1)}function Jd(e,n,l){var s=it;it|=2;var f=ng(),p=ig();(ft!==e||Ke!==n)&&(Lu=null,Ur(e,n)),n=!1;var v=Ct;e:do try{if(rt!==0&&Ve!==null){var j=Ve,O=Fn;switch(rt){case 8:Zd(),v=6;break e;case 3:case 2:case 9:case 6:Vn.current===null&&(n=!0);var V=rt;if(rt=0,Fn=null,Br(e,j,O,V),l&&zr){v=0;break e}break;default:V=rt,rt=0,Fn=null,Br(e,j,O,V)}}rw(),v=Ct;break}catch(J){eg(e,J)}while(!0);return n&&e.shellSuspendCounter++,E=k=null,it=s,H.H=f,H.A=p,Ve===null&&(ft=null,Ke=0,vr()),v}function rw(){for(;Ve!==null;)lg(Ve)}function sw(e,n){var l=it;it|=2;var s=ng(),f=ig();ft!==e||Ke!==n?(Lu=null,zu=At()+500,Ur(e,n)):zr=ma(e,n);e:do try{if(rt!==0&&Ve!==null){n=Ve;var p=Fn;t:switch(rt){case 1:rt=0,Fn=null,Br(e,n,p,1);break;case 2:case 9:if(hh(p)){rt=0,Fn=null,ag(n);break}n=function(){rt!==2&&rt!==9||ft!==e||(rt=7),Ii(e)},p.then(n,n);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:hh(p)?(rt=0,Fn=null,ag(n)):(rt=0,Fn=null,Br(e,n,p,7));break;case 5:var v=null;switch(Ve.tag){case 26:v=Ve.memoizedState;case 5:case 27:var j=Ve;if(v?Vg(v):j.stateNode.complete){rt=0,Fn=null;var O=j.sibling;if(O!==null)Ve=O;else{var V=j.return;V!==null?(Ve=V,Bu(V)):Ve=null}break t}}rt=0,Fn=null,Br(e,n,p,5);break;case 6:rt=0,Fn=null,Br(e,n,p,6);break;case 8:Zd(),Ct=6;break e;default:throw Error(r(462))}}ow();break}catch(J){eg(e,J)}while(!0);return E=k=null,H.H=s,H.A=f,it=l,Ve!==null?0:(ft=null,Ke=0,vr(),Ct)}function ow(){for(;Ve!==null&&!Yt();)lg(Ve)}function lg(e){var n=Am(e.alternate,e,bl);e.memoizedProps=e.pendingProps,n===null?Bu(e):Ve=n}function ag(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=km(l,n,n.pendingProps,n.type,void 0,Ke);break;case 11:n=km(l,n,n.pendingProps,n.type.render,n.ref,Ke);break;case 5:hd(n);default:_m(l,n),n=Ve=ru(n,bl),n=Am(l,n,bl)}e.memoizedProps=e.pendingProps,n===null?Bu(e):Ve=n}function Br(e,n,l,s){E=k=null,hd(n),Ar=null,As=0;var f=n.return;try{if(Qv(e,f,n,l,Ke)){Ct=1,Eu(e,Cn(l,e.current)),Ve=null;return}}catch(p){if(f!==null)throw Ve=f,p;Ct=1,Eu(e,Cn(l,e.current)),Ve=null;return}n.flags&32768?(Ge||s===1?e=!0:zr||(Ke&536870912)!==0?e=!1:(Zl=e=!0,(s===2||s===9||s===3||s===6)&&(s=Vn.current,s!==null&&s.tag===13&&(s.flags|=16384))),rg(n,e)):Bu(n)}function Bu(e){var n=e;do{if((n.flags&32768)!==0){rg(n,Zl);return}e=n.return;var l=Jv(n.alternate,n,bl);if(l!==null){Ve=l;return}if(n=n.sibling,n!==null){Ve=n;return}Ve=n=e}while(n!==null);Ct===0&&(Ct=5)}function rg(e,n){do{var l=ew(e.alternate,e);if(l!==null){l.flags&=32767,Ve=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=l}while(e!==null);Ct=6,Ve=null}function sg(e,n,l,s,f,p,v,j,O){e.cancelPendingCommit=null;do qu();while(Gt!==0);if((it&6)!==0)throw Error(r(327));if(n!==null){if(n===e.current)throw Error(r(177));if(p=n.lanes|n.childLanes,p|=ks,Oo(e,l,p,v,j,O),e===ft&&(Ve=ft=null,Ke=0),Ir=n,ta=e,vl=l,Pd=p,Qd=f,Qm=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,fw(De,function(){return fg(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=H.T,H.T=null,f=le.p,le.p=2,v=it,it|=4;try{tw(e,n,l)}finally{it=v,le.p=f,H.T=s}}Gt=1,og(),ug(),cg()}}function og(){if(Gt===1){Gt=0;var e=ta,n=Ir,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=H.T,H.T=null;var s=le.p;le.p=2;var f=it;it|=4;try{$m(n,e);var p=ff,v=ys(e.containerInfo),j=p.focusedElem,O=p.selectionRange;if(v!==j&&j&&j.ownerDocument&&_i(j.ownerDocument.documentElement,j)){if(O!==null&&nl(j)){var V=O.start,J=O.end;if(J===void 0&&(J=V),"selectionStart"in j)j.selectionStart=V,j.selectionEnd=Math.min(J,j.value.length);else{var ie=j.ownerDocument||document,F=ie&&ie.defaultView||window;if(F.getSelection){var X=F.getSelection(),ve=j.textContent.length,Me=Math.min(O.start,ve),ct=O.end===void 0?Me:Math.min(O.end,ve);!X.extend&&Me>ct&&(v=ct,ct=Me,Me=v);var q=gs(j,Me),U=gs(j,ct);if(q&&U&&(X.rangeCount!==1||X.anchorNode!==q.node||X.anchorOffset!==q.offset||X.focusNode!==U.node||X.focusOffset!==U.offset)){var G=ie.createRange();G.setStart(q.node,q.offset),X.removeAllRanges(),Me>ct?(X.addRange(G),X.extend(U.node,U.offset)):(G.setEnd(U.node,U.offset),X.addRange(G))}}}}for(ie=[],X=j;X=X.parentNode;)X.nodeType===1&&ie.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<ie.length;j++){var ne=ie[j];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Zu=!!df,ff=df=null}finally{it=f,le.p=s,H.T=l}}e.current=n,Gt=2}}function ug(){if(Gt===2){Gt=0;var e=ta,n=Ir,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=H.T,H.T=null;var s=le.p;le.p=2;var f=it;it|=4;try{Im(e,n.alternate,n)}finally{it=f,le.p=s,H.T=l}}Gt=3}}function cg(){if(Gt===4||Gt===3){Gt=0,vi();var e=ta,n=Ir,l=vl,s=Qm;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Gt=5:(Gt=0,Ir=ta=null,dg(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(ea=null),Ti(l),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Pt,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=H.T,f=le.p,le.p=2,H.T=null;try{for(var p=e.onRecoverableError,v=0;v<s.length;v++){var j=s[v];p(j.value,{componentStack:j.stack})}}finally{H.T=n,le.p=f}}(vl&3)!==0&&qu(),Ii(e),f=e.pendingLanes,(l&261930)!==0&&(f&42)!==0?e===Wd?Ys++:(Ys=0,Wd=e):Ys=0,Fs(0)}}function dg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Es(n)))}function qu(){return og(),ug(),cg(),fg()}function fg(){if(Gt!==5)return!1;var e=ta,n=Pd;Pd=0;var l=Ti(vl),s=H.T,f=le.p;try{le.p=32>l?32:l,H.T=null,l=Qd,Qd=null;var p=ta,v=vl;if(Gt=0,Ir=ta=null,vl=0,(it&6)!==0)throw Error(r(331));var j=it;if(it|=4,Km(p.current),Vm(p,p.current,v,l),it=j,Fs(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Pt,p)}catch{}return!0}finally{le.p=f,H.T=s,dg(e,n)}}function pg(e,n,l){n=Cn(l,n),n=Nd(e.stateNode,n,2),e=Xl(e,n,2),e!==null&&(ga(e,2),Ii(e))}function st(e,n,l){if(e.tag===3)pg(e,e,l);else for(;n!==null;){if(n.tag===3){pg(n,e,l);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ea===null||!ea.has(s))){e=Cn(l,e),l=hm(2),s=Xl(n,l,2),s!==null&&(mm(l,s,n,e),ga(s,2),Ii(s));break}}n=n.return}}function ef(e,n,l){var s=e.pingCache;if(s===null){s=e.pingCache=new lw;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(l)||(Fd=!0,f.add(l),e=uw.bind(null,e,n,l),n.then(e,e))}function uw(e,n,l){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,ft===e&&(Ke&l)===l&&(Ct===4||Ct===3&&(Ke&62914560)===Ke&&300>At()-Ru?(it&2)===0&&Ur(e,0):Kd|=l,Lr===Ke&&(Lr=0)),Ii(e)}function hg(e,n){n===0&&(n=Mo()),e=ol(e,n),e!==null&&(ga(e,n),Ii(e))}function cw(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),hg(e,l)}function dw(e,n){var l=0;switch(e.tag){case 31:case 13:var s=e.stateNode,f=e.memoizedState;f!==null&&(l=f.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(r(314))}s!==null&&s.delete(n),hg(e,l)}function fw(e,n){return oi(e,n)}var Hu=null,qr=null,tf=!1,$u=!1,nf=!1,ia=0;function Ii(e){e!==qr&&e.next===null&&(qr===null?Hu=qr=e:qr=qr.next=e),$u=!0,tf||(tf=!0,hw())}function Fs(e,n){if(!nf&&$u){nf=!0;do for(var l=!1,s=Hu;s!==null;){if(e!==0){var f=s.pendingLanes;if(f===0)var p=0;else{var v=s.suspendedLanes,j=s.pingedLanes;p=(1<<31-tt(42|e)+1)-1,p&=f&~(v&~j),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(l=!0,xg(s,p))}else p=Ke,p=Ci(s,s===ft?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(p&3)===0||ma(s,p)||(l=!0,xg(s,p));s=s.next}while(l);nf=!1}}function pw(){mg()}function mg(){$u=tf=!1;var e=0;ia!==0&&jw()&&(e=ia);for(var n=At(),l=null,s=Hu;s!==null;){var f=s.next,p=gg(s,n);p===0?(s.next=null,l===null?Hu=f:l.next=f,f===null&&(qr=l)):(l=s,(e!==0||(p&3)!==0)&&($u=!0)),s=f}Gt!==0&&Gt!==5||Fs(e),ia!==0&&(ia=0)}function gg(e,n){for(var l=e.suspendedLanes,s=e.pingedLanes,f=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var v=31-tt(p),j=1<<v,O=f[v];O===-1?((j&l)===0||(j&s)!==0)&&(f[v]=Do(j,n)):O<=n&&(e.expiredLanes|=j),p&=~j}if(n=ft,l=Ke,l=Ci(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,l===0||e===n&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&yt(s),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||ma(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(s!==null&&yt(s),Ti(l)){case 2:case 8:l=se;break;case 32:l=De;break;case 268435456:l=Qe;break;default:l=De}return s=yg.bind(null,e),l=oi(l,s),e.callbackPriority=n,e.callbackNode=l,n}return s!==null&&s!==null&&yt(s),e.callbackPriority=2,e.callbackNode=null,2}function yg(e,n){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(qu()&&e.callbackNode!==l)return null;var s=Ke;return s=Ci(e,e===ft?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Zm(e,s,n),gg(e,At()),e.callbackNode!=null&&e.callbackNode===l?yg.bind(null,e):null)}function xg(e,n){if(qu())return null;Zm(e,n,!0)}function hw(){Ew(function(){(it&6)!==0?oi(ee,pw):mg()})}function lf(){if(ia===0){var e=Cr;e===0&&(e=ki,ki<<=1,(ki&261888)===0&&(ki=256)),ia=e}return ia}function bg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:di(""+e)}function vg(e,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,e.id&&l.setAttribute("form",e.id),n.parentNode.insertBefore(l,n),e=new FormData(e),l.parentNode.removeChild(l),e}function mw(e,n,l,s,f){if(n==="submit"&&l&&l.stateNode===f){var p=bg((f[zt]||null).action),v=s.submitter;v&&(n=(n=v[zt]||null)?bg(n.formAction):v.getAttribute("formAction"),n!==null&&(p=n,v=null));var j=new Zi("action","action",null,s,f);e.push({event:j,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ia!==0){var O=v?vg(f,v):new FormData(f);Sd(l,{pending:!0,data:O,method:f.method,action:p},null,O)}}else typeof p=="function"&&(j.preventDefault(),O=v?vg(f,v):new FormData(f),Sd(l,{pending:!0,data:O,method:f.method,action:p},p,O))},currentTarget:f}]})}}for(var af=0;af<ws.length;af++){var rf=ws[af],gw=rf.toLowerCase(),yw=rf[0].toUpperCase()+rf.slice(1);$n(gw,"on"+yw)}$n(nu,"onAnimationEnd"),$n(sl,"onAnimationIteration"),$n(za,"onAnimationStart"),$n("dblclick","onDoubleClick"),$n("focusin","onFocus"),$n("focusout","onBlur"),$n(Wc,"onTransitionRun"),$n(Zc,"onTransitionStart"),$n(iu,"onTransitionCancel"),$n(lu,"onTransitionEnd"),Bn("onMouseEnter",["mouseout","mouseover"]),Bn("onMouseLeave",["mouseout","mouseover"]),Bn("onPointerEnter",["pointerout","pointerover"]),Bn("onPointerLeave",["pointerout","pointerover"]),dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ks="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(" "),xw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ks));function wg(e,n){n=(n&4)!==0;for(var l=0;l<e.length;l++){var s=e[l],f=s.event;s=s.listeners;e:{var p=void 0;if(n)for(var v=s.length-1;0<=v;v--){var j=s[v],O=j.instance,V=j.currentTarget;if(j=j.listener,O!==p&&f.isPropagationStopped())break e;p=j,f.currentTarget=V;try{p(f)}catch(J){br(J)}f.currentTarget=null,p=O}else for(v=0;v<s.length;v++){if(j=s[v],O=j.instance,V=j.currentTarget,j=j.listener,O!==p&&f.isPropagationStopped())break e;p=j,f.currentTarget=V;try{p(f)}catch(J){br(J)}f.currentTarget=null,p=O}}}}function Ye(e,n){var l=n[ya];l===void 0&&(l=n[ya]=new Set);var s=e+"__bubble";l.has(s)||(kg(n,e,2,!1),l.add(s))}function sf(e,n,l){var s=0;n&&(s|=4),kg(l,e,s,n)}var Gu="_reactListening"+Math.random().toString(36).slice(2);function of(e){if(!e[Gu]){e[Gu]=!0,Lo.forEach(function(l){l!=="selectionchange"&&(xw.has(l)||sf(l,!1,e),sf(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Gu]||(n[Gu]=!0,sf("selectionchange",!1,n))}}function kg(e,n,l,s){switch(Wg(n)){case 2:var f=Fw;break;case 8:f=Kw;break;default:f=Sf}l=f.bind(null,n,l,e),f=void 0,!Sa||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),s?f!==void 0?e.addEventListener(n,l,{capture:!0,passive:f}):e.addEventListener(n,l,!0):f!==void 0?e.addEventListener(n,l,{passive:f}):e.addEventListener(n,l,!1)}function uf(e,n,l,s,f){var p=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var v=s.tag;if(v===3||v===4){var j=s.stateNode.containerInfo;if(j===f)break;if(v===4)for(v=s.return;v!==null;){var O=v.tag;if((O===3||O===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;j!==null;){if(v=Ni(j),v===null)return;if(O=v.tag,O===5||O===6||O===26||O===27){s=p=v;continue e}j=j.parentNode}}s=s.return}Ml(function(){var V=p,J=Dl(l),ie=[];e:{var F=vs.get(e);if(F!==void 0){var X=Zi,ve=e;switch(e){case"keypress":if(Qi(l)===0)break e;case"keydown":case"keyup":X=mr;break;case"focusin":ve="focus",X=Ll;break;case"focusout":ve="blur",X=Ll;break;case"beforeblur":case"afterblur":X=Ll;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=pr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=nt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=Hc;break;case nu:case sl:case za:X=Ea;break;case lu:X=Go;break;case"scroll":case"scrollend":X=ls;break;case"wheel":X=Na;break;case"copy":case"cut":case"paste":X=hr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Il;break;case"toggle":case"beforetoggle":X=Gc}var Me=(n&4)!==0,ct=!Me&&(e==="scroll"||e==="scrollend"),q=Me?F!==null?F+"Capture":null:F;Me=[];for(var U=V,G;U!==null;){var ne=U;if(G=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||G===null||q===null||(ne=Pi(U,q),ne!=null&&Me.push(Xs(U,ne,G))),ct)break;U=U.return}0<Me.length&&(F=new X(F,ve,null,l,J),ie.push({event:F,listeners:Me}))}}if((n&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",F&&l!==cr&&(ve=l.relatedTarget||l.fromElement)&&(Ni(ve)||ve[Ai]))break e;if((X||F)&&(F=J.window===J?J:(F=J.ownerDocument)?F.defaultView||F.parentWindow:window,X?(ve=l.relatedTarget||l.toElement,X=V,ve=ve?Ni(ve):null,ve!==null&&(ct=c(ve),Me=ve.tag,ve!==ct||Me!==5&&Me!==27&&Me!==6)&&(ve=null)):(X=null,ve=V),X!==ve)){if(Me=pr,ne="onMouseLeave",q="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(Me=Il,ne="onPointerLeave",q="onPointerEnter",U="pointer"),ct=X==null?F:xa(X),G=ve==null?F:xa(ve),F=new Me(ne,U+"leave",X,l,J),F.target=ct,F.relatedTarget=G,ne=null,Ni(J)===V&&(Me=new Me(q,U+"enter",ve,l,J),Me.target=G,Me.relatedTarget=ct,ne=Me),ct=ne,X&&ve)t:{for(Me=bw,q=X,U=ve,G=0,ne=q;ne;ne=Me(ne))G++;ne=0;for(var je=U;je;je=Me(je))ne++;for(;0<G-ne;)q=Me(q),G--;for(;0<ne-G;)U=Me(U),ne--;for(;G--;){if(q===U||U!==null&&q===U.alternate){Me=q;break t}q=Me(q),U=Me(U)}Me=null}else Me=null;X!==null&&Sg(ie,F,X,Me,!1),ve!==null&&ct!==null&&Sg(ie,ct,ve,Me,!0)}}e:{if(F=V?xa(V):window,X=F.nodeName&&F.nodeName.toLowerCase(),X==="select"||X==="input"&&F.type==="file")var Ze=Xo;else if(Fo(F))if(Po)Ze=Pc;else{Ze=Kc;var we=Fc}else X=F.nodeName,!X||X.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?V&&wa(V.elementType)&&(Ze=Xo):Ze=Xc;if(Ze&&(Ze=Ze(e,V))){Ko(ie,Ze,l,J);break e}we&&we(e,F,V),e==="focusout"&&V&&F.type==="number"&&V.memoizedProps.value!=null&&_l(F,"number",F.value)}switch(we=V?xa(V):window,e){case"focusin":(Fo(we)||we.contentEditable==="true")&&(Bl=we,xs=V,Ra=null);break;case"focusout":Ra=xs=Bl=null;break;case"mousedown":bs=!0;break;case"contextmenu":case"mouseup":case"dragend":bs=!1,eu(ie,l,J);break;case"selectionchange":if(il)break;case"keydown":case"keyup":eu(ie,l,J)}var He;if(us)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else tl?Yo(e,l)&&(Xe="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Xe="onCompositionStart");Xe&&(Vo&&l.locale!=="ko"&&(tl||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&tl&&(He=Jt()):(pi=J,ti="value"in pi?pi.value:pi.textContent,tl=!0)),we=Vu(V,Xe),0<we.length&&(Xe=new Ho(Xe,e,null,l,J),ie.push({event:Xe,listeners:we}),He?Xe.data=He:(He=yr(l),He!==null&&(Xe.data=He)))),(He=cs?fs(e,l):Vc(e,l))&&(Xe=Vu(V,"onBeforeInput"),0<Xe.length&&(we=new Ho("onBeforeInput","beforeinput",null,l,J),ie.push({event:we,listeners:Xe}),we.data=He)),mw(ie,e,V,l,J)}wg(ie,n)})}function Xs(e,n,l){return{instance:e,listener:n,currentTarget:l}}function Vu(e,n){for(var l=n+"Capture",s=[];e!==null;){var f=e,p=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||p===null||(f=Pi(e,l),f!=null&&s.unshift(Xs(e,f,p)),f=Pi(e,n),f!=null&&s.push(Xs(e,f,p))),e.tag===3)return s;e=e.return}return[]}function bw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Sg(e,n,l,s,f){for(var p=n._reactName,v=[];l!==null&&l!==s;){var j=l,O=j.alternate,V=j.stateNode;if(j=j.tag,O!==null&&O===s)break;j!==5&&j!==26&&j!==27||V===null||(O=V,f?(V=Pi(l,p),V!=null&&v.unshift(Xs(l,V,O))):f||(V=Pi(l,p),V!=null&&v.push(Xs(l,V,O)))),l=l.return}v.length!==0&&e.push({event:n,listeners:v})}var vw=/\r\n?/g,ww=/\u0000|\uFFFD/g;function jg(e){return(typeof e=="string"?e:""+e).replace(vw,`
|
|
50
|
+
`).replace(ww,"")}function Cg(e,n){return n=jg(n),jg(e)===n}function ut(e,n,l,s,f,p){switch(l){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||ei(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&ei(e,""+s);break;case"className":kn(e,"class",s);break;case"tabIndex":kn(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":kn(e,l,s);break;case"style":Bo(e,s,p);break;case"data":if(n!=="object"){kn(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||l!=="href")){e.removeAttribute(l);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=di(""+s),e.setAttribute(l,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(l==="formAction"?(n!=="input"&&ut(e,n,"name",f.name,f,null),ut(e,n,"formEncType",f.formEncType,f,null),ut(e,n,"formMethod",f.formMethod,f,null),ut(e,n,"formTarget",f.formTarget,f,null)):(ut(e,n,"encType",f.encType,f,null),ut(e,n,"method",f.method,f,null),ut(e,n,"target",f.target,f,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=di(""+s),e.setAttribute(l,s);break;case"onClick":s!=null&&(e.onclick=fi);break;case"onScroll":s!=null&&Ye("scroll",e);break;case"onScrollEnd":s!=null&&Ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(r(61));if(l=s.__html,l!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=l}}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}l=di(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,""+s):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":s===!0?e.setAttribute(l,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,s):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(l,s):e.removeAttribute(l);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(l):e.setAttribute(l,s);break;case"popover":Ye("beforetoggle",e),Ye("toggle",e),wn(e,"popover",s);break;case"xlinkActuate":Wt(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Wt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Wt(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Wt(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Wt(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Wt(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Wt(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Wt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Wt(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":wn(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=qo.get(l)||l,wn(e,l,s))}}function cf(e,n,l,s,f,p){switch(l){case"style":Bo(e,s,p);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(r(61));if(l=s.__html,l!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"children":typeof s=="string"?ei(e,s):(typeof s=="number"||typeof s=="bigint")&&ei(e,""+s);break;case"onScroll":s!=null&&Ye("scroll",e);break;case"onScrollEnd":s!=null&&Ye("scrollend",e);break;case"onClick":s!=null&&(e.onclick=fi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ts.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),p=e[zt]||null,p=p!=null?p[l]:null,typeof p=="function"&&e.removeEventListener(n,p,f),typeof s=="function")){typeof p!="function"&&p!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(n,s,f);break e}l in e?e[l]=s:s===!0?e.setAttribute(l,""):wn(e,l,s)}}}function tn(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",e),Ye("load",e);var s=!1,f=!1,p;for(p in l)if(l.hasOwnProperty(p)){var v=l[p];if(v!=null)switch(p){case"src":s=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ut(e,n,p,v,l,null)}}f&&ut(e,n,"srcSet",l.srcSet,l,null),s&&ut(e,n,"src",l.src,l,null);return;case"input":Ye("invalid",e);var j=p=v=f=null,O=null,V=null;for(s in l)if(l.hasOwnProperty(s)){var J=l[s];if(J!=null)switch(s){case"name":f=J;break;case"type":v=J;break;case"checked":O=J;break;case"defaultChecked":V=J;break;case"value":p=J;break;case"defaultValue":j=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,n));break;default:ut(e,n,s,J,l,null)}}ns(e,p,j,O,V,v,f,!1);return;case"select":Ye("invalid",e),s=v=p=null;for(f in l)if(l.hasOwnProperty(f)&&(j=l[f],j!=null))switch(f){case"value":p=j;break;case"defaultValue":v=j;break;case"multiple":s=j;default:ut(e,n,f,j,l,null)}n=p,l=v,e.multiple=!!s,n!=null?Zt(e,!!s,n,!1):l!=null&&Zt(e,!!s,l,!0);return;case"textarea":Ye("invalid",e),p=f=s=null;for(v in l)if(l.hasOwnProperty(v)&&(j=l[v],j!=null))switch(v){case"value":s=j;break;case"defaultValue":f=j;break;case"children":p=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(r(91));break;default:ut(e,n,v,j,l,null)}or(e,s,f,p);return;case"option":for(O in l)if(l.hasOwnProperty(O)&&(s=l[O],s!=null))switch(O){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:ut(e,n,O,s,l,null)}return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(s=0;s<Ks.length;s++)Ye(Ks[s],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("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(V in l)if(l.hasOwnProperty(V)&&(s=l[V],s!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ut(e,n,V,s,l,null)}return;default:if(wa(n)){for(J in l)l.hasOwnProperty(J)&&(s=l[J],s!==void 0&&cf(e,n,J,s,l,void 0));return}}for(j in l)l.hasOwnProperty(j)&&(s=l[j],s!=null&&ut(e,n,j,s,l,null))}function kw(e,n,l,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,p=null,v=null,j=null,O=null,V=null,J=null;for(X in l){var ie=l[X];if(l.hasOwnProperty(X)&&ie!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":O=ie;default:s.hasOwnProperty(X)||ut(e,n,X,null,s,ie)}}for(var F in s){var X=s[F];if(ie=l[F],s.hasOwnProperty(F)&&(X!=null||ie!=null))switch(F){case"type":p=X;break;case"name":f=X;break;case"checked":V=X;break;case"defaultChecked":J=X;break;case"value":v=X;break;case"defaultValue":j=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,n));break;default:X!==ie&&ut(e,n,F,X,s,ie)}}va(e,v,j,O,V,J,p,f);return;case"select":X=v=j=F=null;for(p in l)if(O=l[p],l.hasOwnProperty(p)&&O!=null)switch(p){case"value":break;case"multiple":X=O;default:s.hasOwnProperty(p)||ut(e,n,p,null,s,O)}for(f in s)if(p=s[f],O=l[f],s.hasOwnProperty(f)&&(p!=null||O!=null))switch(f){case"value":F=p;break;case"defaultValue":j=p;break;case"multiple":v=p;default:p!==O&&ut(e,n,f,p,s,O)}n=j,l=v,s=X,F!=null?Zt(e,!!l,F,!1):!!s!=!!l&&(n!=null?Zt(e,!!l,n,!0):Zt(e,!!l,l?[]:"",!1));return;case"textarea":X=F=null;for(j in l)if(f=l[j],l.hasOwnProperty(j)&&f!=null&&!s.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:ut(e,n,j,null,s,f)}for(v in s)if(f=s[v],p=l[v],s.hasOwnProperty(v)&&(f!=null||p!=null))switch(v){case"value":F=f;break;case"defaultValue":X=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==p&&ut(e,n,v,f,s,p)}ci(e,F,X);return;case"option":for(var ve in l)if(F=l[ve],l.hasOwnProperty(ve)&&F!=null&&!s.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:ut(e,n,ve,null,s,F)}for(O in s)if(F=s[O],X=l[O],s.hasOwnProperty(O)&&F!==X&&(F!=null||X!=null))switch(O){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:ut(e,n,O,F,s,X)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in l)F=l[Me],l.hasOwnProperty(Me)&&F!=null&&!s.hasOwnProperty(Me)&&ut(e,n,Me,null,s,F);for(V in s)if(F=s[V],X=l[V],s.hasOwnProperty(V)&&F!==X&&(F!=null||X!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(137,n));break;default:ut(e,n,V,F,s,X)}return;default:if(wa(n)){for(var ct in l)F=l[ct],l.hasOwnProperty(ct)&&F!==void 0&&!s.hasOwnProperty(ct)&&cf(e,n,ct,void 0,s,F);for(J in s)F=s[J],X=l[J],!s.hasOwnProperty(J)||F===X||F===void 0&&X===void 0||cf(e,n,J,F,s,X);return}}for(var q in l)F=l[q],l.hasOwnProperty(q)&&F!=null&&!s.hasOwnProperty(q)&&ut(e,n,q,null,s,F);for(ie in s)F=s[ie],X=l[ie],!s.hasOwnProperty(ie)||F===X||F==null&&X==null||ut(e,n,ie,F,s,X)}function Eg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Sw(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,l=performance.getEntriesByType("resource"),s=0;s<l.length;s++){var f=l[s],p=f.transferSize,v=f.initiatorType,j=f.duration;if(p&&j&&Eg(v)){for(v=0,j=f.responseEnd,s+=1;s<l.length;s++){var O=l[s],V=O.startTime;if(V>j)break;var J=O.transferSize,ie=O.initiatorType;J&&Eg(ie)&&(O=O.responseEnd,v+=J*(O<j?1:(j-V)/(O-V)))}if(--s,n+=8*(p+v)/(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 df=null,ff=null;function Yu(e){return e.nodeType===9?e:e.ownerDocument}function Tg(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 Ag(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 pf(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 hf=null;function jw(){var e=window.event;return e&&e.type==="popstate"?e===hf?!1:(hf=e,!0):(hf=null,!1)}var Ng=typeof setTimeout=="function"?setTimeout:void 0,Cw=typeof clearTimeout=="function"?clearTimeout:void 0,_g=typeof Promise=="function"?Promise:void 0,Ew=typeof queueMicrotask=="function"?queueMicrotask:typeof _g<"u"?function(e){return _g.resolve(null).then(e).catch(Tw)}:Ng;function Tw(e){setTimeout(function(){throw e})}function la(e){return e==="head"}function Dg(e,n){var l=n,s=0;do{var f=l.nextSibling;if(e.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(s===0){e.removeChild(f),Vr(n);return}s--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")s++;else if(l==="html")Ps(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Ps(l);for(var p=l.firstChild;p;){var v=p.nextSibling,j=p.nodeName;p[Cl]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&p.rel.toLowerCase()==="stylesheet"||l.removeChild(p),p=v}}else l==="body"&&Ps(e.ownerDocument.body);l=f}while(l);Vr(n)}function Mg(e,n){var l=e;e=0;do{var s=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),s&&s.nodeType===8)if(l=s.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=s}while(l)}function mf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":mf(l),Jn(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Aw(e,n,l,s){for(;e.nodeType===1;){var f=l;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Cl])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==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(p=e.getAttribute("src"),(p!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var p=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=li(e.nextSibling),e===null)break}return null}function Nw(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=li(e.nextSibling),e===null))return null;return e}function Og(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=li(e.nextSibling),e===null))return null;return e}function gf(e){return e.data==="$?"||e.data==="$~"}function yf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _w(e,n){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||l.readyState!=="loading")n();else{var s=function(){n(),l.removeEventListener("DOMContentLoaded",s)};l.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function li(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 xf=null;function Rg(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return li(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function zg(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return e;n--}else l!=="/$"&&l!=="/&"||n++}e=e.previousSibling}return null}function Lg(e,n,l){switch(n=Yu(l),e){case"html":if(e=n.documentElement,!e)throw Error(r(452));return e;case"head":if(e=n.head,!e)throw Error(r(453));return e;case"body":if(e=n.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Ps(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Jn(e)}var ai=new Map,Ig=new Set;function Fu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wl=le.d;le.d={f:Dw,r:Mw,D:Ow,C:Rw,L:zw,m:Lw,X:Uw,S:Iw,M:Bw};function Dw(){var e=wl.f(),n=Iu();return e||n}function Mw(e){var n=Vi(e);n!==null&&n.tag===5&&n.type==="form"?em(n):wl.r(e)}var Hr=typeof document>"u"?null:document;function Ug(e,n,l){var s=Hr;if(s&&typeof n=="string"&&n){var f=nn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Ig.has(f)||(Ig.add(f),e={rel:e,crossOrigin:l,href:n},s.querySelector(f)===null&&(n=s.createElement("link"),tn(n,"link",e),Nt(n),s.head.appendChild(n)))}}function Ow(e){wl.D(e),Ug("dns-prefetch",e,null)}function Rw(e,n){wl.C(e,n),Ug("preconnect",e,n)}function zw(e,n,l){wl.L(e,n,l);var s=Hr;if(s&&e&&n){var f='link[rel="preload"][as="'+nn(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+nn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+nn(l.imageSizes)+'"]')):f+='[href="'+nn(e)+'"]';var p=f;switch(n){case"style":p=$r(e);break;case"script":p=Gr(e)}ai.has(p)||(e=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),ai.set(p,e),s.querySelector(f)!==null||n==="style"&&s.querySelector(Qs(p))||n==="script"&&s.querySelector(Ws(p))||(n=s.createElement("link"),tn(n,"link",e),Nt(n),s.head.appendChild(n)))}}function Lw(e,n){wl.m(e,n);var l=Hr;if(l&&e){var s=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+nn(s)+'"][href="'+nn(e)+'"]',p=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Gr(e)}if(!ai.has(p)&&(e=x({rel:"modulepreload",href:e},n),ai.set(p,e),l.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ws(p)))return}s=l.createElement("link"),tn(s,"link",e),Nt(s),l.head.appendChild(s)}}}function Iw(e,n,l){wl.S(e,n,l);var s=Hr;if(s&&e){var f=El(s).hoistableStyles,p=$r(e);n=n||"default";var v=f.get(p);if(!v){var j={loading:0,preload:null};if(v=s.querySelector(Qs(p)))j.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":n},l),(l=ai.get(p))&&bf(e,l);var O=v=s.createElement("link");Nt(O),tn(O,"link",e),O._p=new Promise(function(V,J){O.onload=V,O.onerror=J}),O.addEventListener("load",function(){j.loading|=1}),O.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Ku(v,n,s)}v={type:"stylesheet",instance:v,count:1,state:j},f.set(p,v)}}}function Uw(e,n){wl.X(e,n);var l=Hr;if(l&&e){var s=El(l).hoistableScripts,f=Gr(e),p=s.get(f);p||(p=l.querySelector(Ws(f)),p||(e=x({src:e,async:!0},n),(n=ai.get(f))&&vf(e,n),p=l.createElement("script"),Nt(p),tn(p,"link",e),l.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(f,p))}}function Bw(e,n){wl.M(e,n);var l=Hr;if(l&&e){var s=El(l).hoistableScripts,f=Gr(e),p=s.get(f);p||(p=l.querySelector(Ws(f)),p||(e=x({src:e,async:!0,type:"module"},n),(n=ai.get(f))&&vf(e,n),p=l.createElement("script"),Nt(p),tn(p,"link",e),l.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(f,p))}}function Bg(e,n,l,s){var f=(f=fe.current)?Fu(f):null;if(!f)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=$r(l.href),l=El(f).hoistableStyles,s=l.get(n),s||(s={type:"style",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=$r(l.href);var p=El(f).hoistableStyles,v=p.get(e);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,v),(p=f.querySelector(Qs(e)))&&!p._p&&(v.instance=p,v.state.loading=5),ai.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ai.set(e,l),p||qw(f,e,l,v.state))),n&&s===null)throw Error(r(528,""));return v}if(n&&s!==null)throw Error(r(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Gr(l),l=El(f).hoistableScripts,s=l.get(n),s||(s={type:"script",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function $r(e){return'href="'+nn(e)+'"'}function Qs(e){return'link[rel="stylesheet"]['+e+"]"}function qg(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function qw(e,n,l,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}),tn(n,"link",l),Nt(n),e.head.appendChild(n))}function Gr(e){return'[src="'+nn(e)+'"]'}function Ws(e){return"script[async]"+e}function Hg(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+nn(l.href)+'"]');if(s)return n.instance=s,Nt(s),s;var f=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Nt(s),tn(s,"style",f),Ku(s,l.precedence,e),n.instance=s;case"stylesheet":f=$r(l.href);var p=e.querySelector(Qs(f));if(p)return n.state.loading|=4,n.instance=p,Nt(p),p;s=qg(l),(f=ai.get(f))&&bf(s,f),p=(e.ownerDocument||e).createElement("link"),Nt(p);var v=p;return v._p=new Promise(function(j,O){v.onload=j,v.onerror=O}),tn(p,"link",s),n.state.loading|=4,Ku(p,l.precedence,e),n.instance=p;case"script":return p=Gr(l.src),(f=e.querySelector(Ws(p)))?(n.instance=f,Nt(f),f):(s=l,(f=ai.get(p))&&(s=x({},l),vf(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),Nt(f),tn(f,"link",s),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,Ku(s,l.precedence,e));return n.instance}function Ku(e,n,l){for(var s=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=s.length?s[s.length-1]:null,p=f,v=0;v<s.length;v++){var j=s[v];if(j.dataset.precedence===n)p=j;else if(p!==f)break}p?p.parentNode.insertBefore(e,p.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(e,n.firstChild))}function bf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function vf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Xu=null;function $g(e,n,l){if(Xu===null){var s=new Map,f=Xu=new Map;f.set(l,s)}else f=Xu,s=f.get(l),s||(s=new Map,f.set(l,s));if(s.has(e))return s;for(s.set(e,null),l=l.getElementsByTagName(e),f=0;f<l.length;f++){var p=l[f];if(!(p[Cl]||p[Ht]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var v=p.getAttribute(n)||"";v=e+v;var j=s.get(v);j?j.push(p):s.set(v,[p])}}return s}function Gg(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function Hw(e,n,l){if(l===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;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!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 Vg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $w(e,n,l,s){if(l.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=$r(s.href),p=n.querySelector(Qs(f));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Pu.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=p,Nt(p);return}p=n.ownerDocument||n,s=qg(s),(f=ai.get(f))&&bf(s,f),p=p.createElement("link"),Nt(p);var v=p;v._p=new Promise(function(j,O){v.onload=j,v.onerror=O}),tn(p,"link",s),l.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Pu.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var wf=0;function Gw(e,n){return e.stylesheets&&e.count===0&&Wu(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var s=setTimeout(function(){if(e.stylesheets&&Wu(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+n);0<e.imgBytes&&wf===0&&(wf=62500*Sw());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Wu(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>wf?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function Pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qu=null;function Wu(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qu=new Map,n.forEach(Vw,e),Qu=null,Pu.call(e))}function Vw(e,n){if(!(n.state.loading&4)){var l=Qu.get(e);if(l)var s=l.get(null);else{l=new Map,Qu.set(e,l);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<f.length;p++){var v=f[p];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),s=v)}s&&l.set(null,s)}f=n.instance,v=f.getAttribute("data-precedence"),p=l.get(v)||s,p===s&&l.set(null,f),l.set(v,f),this.count++,s=Pu.bind(this),f.addEventListener("load",s),f.addEventListener("error",s),p?p.parentNode.insertBefore(f,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Zs={$$typeof:Y,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function Yw(e,n,l,s,f,p,v,j,O){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=rr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rr(0),this.hiddenUpdates=rr(null),this.identifierPrefix=s,this.onUncaughtError=f,this.onCaughtError=p,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function Yg(e,n,l,s,f,p,v,j,O,V,J,ie){return e=new Yw(e,n,l,v,O,V,J,ie,j),n=1,p===!0&&(n|=24),p=mn(3,null,null,n),e.current=p,p.stateNode=e,n=Jc(),n.refCount++,e.pooledCache=n,n.refCount++,p.memoizedState={element:s,isDehydrated:l,cache:n},id(p),e}function Fg(e){return e?(e=Hl,e):Hl}function Kg(e,n,l,s,f,p){f=Fg(f),s.context===null?s.context=f:s.pendingContext=f,s=Kl(n),s.payload={element:l},p=p===void 0?null:p,p!==null&&(s.callback=p),l=Xl(e,s,n),l!==null&&(Rn(l,e,n),_s(l,e,n))}function Xg(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function kf(e,n){Xg(e,n),(e=e.alternate)&&Xg(e,n)}function Pg(e){if(e.tag===13||e.tag===31){var n=ol(e,67108864);n!==null&&Rn(n,e,67108864),kf(e,67108864)}}function Qg(e){if(e.tag===13||e.tag===31){var n=Xn();n=Ei(n);var l=ol(e,n);l!==null&&Rn(l,e,n),kf(e,n)}}var Zu=!0;function Fw(e,n,l,s){var f=H.T;H.T=null;var p=le.p;try{le.p=2,Sf(e,n,l,s)}finally{le.p=p,H.T=f}}function Kw(e,n,l,s){var f=H.T;H.T=null;var p=le.p;try{le.p=8,Sf(e,n,l,s)}finally{le.p=p,H.T=f}}function Sf(e,n,l,s){if(Zu){var f=jf(s);if(f===null)uf(e,n,s,Ju,l),Zg(e,s);else if(Pw(f,e,n,l,s))s.stopPropagation();else if(Zg(e,s),n&4&&-1<Xw.indexOf(e)){for(;f!==null;){var p=Vi(f);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var v=ji(p.pendingLanes);if(v!==0){var j=p;for(j.pendingLanes|=2,j.entangledLanes|=2;v;){var O=1<<31-tt(v);j.entanglements[1]|=O,v&=~O}Ii(p),(it&6)===0&&(zu=At()+500,Fs(0))}}break;case 31:case 13:j=ol(p,2),j!==null&&Rn(j,p,2),Iu(),kf(p,2)}if(p=jf(s),p===null&&uf(e,n,s,Ju,l),p===f)break;f=p}f!==null&&s.stopPropagation()}else uf(e,n,s,null,l)}}function jf(e){return e=Dl(e),Cf(e)}var Ju=null;function Cf(e){if(Ju=null,e=Ni(e),e!==null){var n=c(e);if(n===null)e=null;else{var l=n.tag;if(l===13){if(e=d(n),e!==null)return e;e=null}else if(l===31){if(e=h(n),e!==null)return e;e=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Ju=e,null}function Wg(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(wi()){case ee:return 2;case se:return 8;case De:case $e:return 32;case Qe:return 268435456;default:return 32}default:return 32}}var Ef=!1,aa=null,ra=null,sa=null,Js=new Map,eo=new Map,oa=[],Xw="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 Zg(e,n){switch(e){case"focusin":case"focusout":aa=null;break;case"dragenter":case"dragleave":ra=null;break;case"mouseover":case"mouseout":sa=null;break;case"pointerover":case"pointerout":Js.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":eo.delete(n.pointerId)}}function to(e,n,l,s,f,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:l,eventSystemFlags:s,nativeEvent:p,targetContainers:[f]},n!==null&&(n=Vi(n),n!==null&&Pg(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function Pw(e,n,l,s,f){switch(n){case"focusin":return aa=to(aa,e,n,l,s,f),!0;case"dragenter":return ra=to(ra,e,n,l,s,f),!0;case"mouseover":return sa=to(sa,e,n,l,s,f),!0;case"pointerover":var p=f.pointerId;return Js.set(p,to(Js.get(p)||null,e,n,l,s,f)),!0;case"gotpointercapture":return p=f.pointerId,eo.set(p,to(eo.get(p)||null,e,n,l,s,f)),!0}return!1}function Jg(e){var n=Ni(e.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=d(l),n!==null){e.blockedOn=n,sr(e.priority,function(){Qg(l)});return}}else if(n===31){if(n=h(l),n!==null){e.blockedOn=n,sr(e.priority,function(){Qg(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ec(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=jf(e.nativeEvent);if(l===null){l=e.nativeEvent;var s=new l.constructor(l.type,l);cr=s,l.target.dispatchEvent(s),cr=null}else return n=Vi(l),n!==null&&Pg(n),e.blockedOn=l,!1;n.shift()}return!0}function ey(e,n,l){ec(e)&&l.delete(n)}function Qw(){Ef=!1,aa!==null&&ec(aa)&&(aa=null),ra!==null&&ec(ra)&&(ra=null),sa!==null&&ec(sa)&&(sa=null),Js.forEach(ey),eo.forEach(ey)}function tc(e,n){e.blockedOn===n&&(e.blockedOn=null,Ef||(Ef=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Qw)))}var nc=null;function ty(e){nc!==e&&(nc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){nc===e&&(nc=null);for(var n=0;n<e.length;n+=3){var l=e[n],s=e[n+1],f=e[n+2];if(typeof s!="function"){if(Cf(s||l)===null)continue;break}var p=Vi(l);p!==null&&(e.splice(n,3),n-=3,Sd(p,{pending:!0,data:f,method:l.method,action:s},s,f))}}))}function Vr(e){function n(O){return tc(O,e)}aa!==null&&tc(aa,e),ra!==null&&tc(ra,e),sa!==null&&tc(sa,e),Js.forEach(n),eo.forEach(n);for(var l=0;l<oa.length;l++){var s=oa[l];s.blockedOn===e&&(s.blockedOn=null)}for(;0<oa.length&&(l=oa[0],l.blockedOn===null);)Jg(l),l.blockedOn===null&&oa.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(s=0;s<l.length;s+=3){var f=l[s],p=l[s+1],v=f[zt]||null;if(typeof p=="function")v||ty(l);else if(v){var j=null;if(p&&p.hasAttribute("formAction")){if(f=p,v=p[zt]||null)j=v.formAction;else if(Cf(f)!==null)continue}else j=v.action;typeof j=="function"?l[s+1]=j:(l.splice(s,3),s-=3),ty(l)}}}function ny(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),s||setTimeout(l,20)}function l(){if(!s&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.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(l,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Tf(e){this._internalRoot=e}ic.prototype.render=Tf.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,s=Xn();Kg(l,s,e,n,null,null)},ic.prototype.unmount=Tf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Kg(e.current,2,null,e,null,null),Iu(),n[Ai]=null}};function ic(e){this._internalRoot=e}ic.prototype.unstable_scheduleHydration=function(e){if(e){var n=Gi();e={blockedOn:null,target:e,priority:n};for(var l=0;l<oa.length&&n!==0&&n<oa[l].priority;l++);oa.splice(l,0,e),l===0&&Jg(e)}};var iy=i.version;if(iy!=="19.2.7")throw Error(r(527,iy,"19.2.7"));le.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=m(n),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Ww={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lc.isDisabled&&lc.supportsFiber)try{Pt=lc.inject(Ww),St=lc}catch{}}return io.createRoot=function(e,n){if(!u(e))throw Error(r(299));var l=!1,s="",f=cm,p=dm,v=fm;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=Yg(e,1,!1,null,null,l,s,null,f,p,v,ny),e[Ai]=n.current,of(e),new Tf(n)},io.hydrateRoot=function(e,n,l){if(!u(e))throw Error(r(299));var s=!1,f="",p=cm,v=dm,j=fm,O=null;return l!=null&&(l.unstable_strictMode===!0&&(s=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(p=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(j=l.onRecoverableError),l.formState!==void 0&&(O=l.formState)),n=Yg(e,1,!0,n,l??null,s,f,O,p,v,j,ny),n.context=Fg(null),l=n.current,s=Xn(),s=Ei(s),f=Kl(s),f.callback=null,Xl(l,f,s),l=s,n.current.lanes=l,ga(n,l),Ii(n),e[Ai]=n.current,of(e),new ic(n)},io.version="19.2.7",io}var hy;function d1(){if(hy)return _f.exports;hy=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(i){console.error(i)}}return t(),_f.exports=c1(),_f.exports}var f1=d1();function p1(t,i){const a=i||{};return(t[t.length-1]===""?[...t,""]:t).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const h1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,m1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,g1={};function my(t,i){return(g1.jsx?m1:h1).test(t)}const y1=/[ \t\n\f\r]/g;function x1(t){return typeof t=="object"?t.type==="text"?gy(t.value):!1:gy(t)}function gy(t){return t.replace(y1,"")===""}class Ao{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}Ao.prototype.normal={};Ao.prototype.property={};Ao.prototype.space=void 0;function Yx(t,i){const a={},r={};for(const u of t)Object.assign(a,u.property),Object.assign(r,u.normal);return new Ao(a,r,i)}function yp(t){return t.toLowerCase()}class Ln{constructor(i,a){this.attribute=a,this.property=i}}Ln.prototype.attribute="";Ln.prototype.booleanish=!1;Ln.prototype.boolean=!1;Ln.prototype.commaOrSpaceSeparated=!1;Ln.prototype.commaSeparated=!1;Ln.prototype.defined=!1;Ln.prototype.mustUseProperty=!1;Ln.prototype.number=!1;Ln.prototype.overloadedBoolean=!1;Ln.prototype.property="";Ln.prototype.spaceSeparated=!1;Ln.prototype.space=void 0;let b1=0;const Le=lr(),qt=lr(),xp=lr(),ce=lr(),pt=lr(),tr=lr(),Pn=lr();function lr(){return 2**++b1}const bp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:qt,commaOrSpaceSeparated:Pn,commaSeparated:tr,number:ce,overloadedBoolean:xp,spaceSeparated:pt},Symbol.toStringTag,{value:"Module"})),Rf=Object.keys(bp);class Bp extends Ln{constructor(i,a,r,u){let c=-1;if(super(i,a),yy(this,"space",u),typeof r=="number")for(;++c<Rf.length;){const d=Rf[c];yy(this,Rf[c],(r&bp[d])===bp[d])}}}Bp.prototype.defined=!0;function yy(t,i,a){a&&(t[i]=a)}function Wr(t){const i={},a={};for(const[r,u]of Object.entries(t.properties)){const c=new Bp(r,t.transform(t.attributes||{},r),u,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[yp(r)]=r,a[yp(c.attribute)]=r}return new Ao(i,a,t.space)}const Fx=Wr({properties:{ariaActiveDescendant:null,ariaAtomic:qt,ariaAutoComplete:null,ariaBusy:qt,ariaChecked:qt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:pt,ariaCurrent:null,ariaDescribedBy:pt,ariaDetails:null,ariaDisabled:qt,ariaDropEffect:pt,ariaErrorMessage:null,ariaExpanded:qt,ariaFlowTo:pt,ariaGrabbed:qt,ariaHasPopup:null,ariaHidden:qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pt,ariaLevel:ce,ariaLive:null,ariaModal:qt,ariaMultiLine:qt,ariaMultiSelectable:qt,ariaOrientation:null,ariaOwns:pt,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:qt,ariaReadOnly:qt,ariaRelevant:null,ariaRequired:qt,ariaRoleDescription:pt,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:qt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(t,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Kx(t,i){return i in t?t[i]:i}function Xx(t,i){return Kx(t,i.toLowerCase())}const v1=Wr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:tr,acceptCharset:pt,accessKey:pt,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alpha:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:pt,autoFocus:Le,autoPlay:Le,blocking:pt,capture:null,charSet:null,checked:Le,cite:null,className:pt,closedBy:null,colorSpace:null,cols:ce,colSpan:ce,command:null,commandFor:null,content:null,contentEditable:qt,controls:Le,controlsList:pt,coords:ce|tr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:xp,draggable:qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:pt,height:ce,hidden:xp,high:ce,href:null,hrefLang:null,htmlFor:pt,httpEquiv:pt,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:pt,itemRef:pt,itemScope:Le,itemType:pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,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:Le,optimum:ce,pattern:null,ping:pt,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:pt,required:Le,reversed:Le,rows:ce,rowSpan:ce,sandbox:pt,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootCustomElementRegistry:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shadowRootSerializable:Le,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:qt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pt,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:qt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Le,disablePictureInPicture:Le,disableRemotePlayback:Le,exportParts:tr,part:pt,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:Xx}),w1=Wr({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:Pn,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:pt,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:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,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:tr,g2:tr,glyphName:tr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:Pn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,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:ce,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:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pn,rev:Pn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pn,requiredFeatures:Pn,requiredFonts:Pn,requiredFormats:Pn,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:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:Pn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pn,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Kx}),Px=Wr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,i){return"xlink:"+i.slice(5).toLowerCase()}}),Qx=Wr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xx}),Wx=Wr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,i){return"xml:"+i.slice(3).toLowerCase()}}),k1={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"},S1=/[A-Z]/g,xy=/-[a-z]/g,j1=/^data[-\w.:]+$/i;function C1(t,i){const a=yp(i);let r=i,u=Ln;if(a in t.normal)return t.property[t.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&j1.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(xy,T1);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!xy.test(c)){let d=c.replace(S1,E1);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=Bp}return new u(r,i)}function E1(t){return"-"+t.toLowerCase()}function T1(t){return t.charAt(1).toUpperCase()}const A1=Yx([Fx,v1,Px,Qx,Wx],"html"),qp=Yx([Fx,w1,Px,Qx,Wx],"svg");function N1(t){return t.join(" ").trim()}var Yr={},zf,by;function _1(){if(by)return zf;by=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,h=/^\s+|\s+$/g,g=`
|
|
51
|
+
`,m="/",b="*",x="",w="comment",S="declaration";function T(z,D){if(typeof z!="string")throw new TypeError("First argument must be a string");if(!z)return[];D=D||{};var W=1,Y=1;function K(he){var re=he.match(i);re&&(W+=re.length);var H=he.lastIndexOf(g);Y=~H?he.length-H:Y+he.length}function de(){var he={line:W,column:Y};return function(re){return re.position=new _(he),P(),re}}function _(he){this.start=he,this.end={line:W,column:Y},this.source=D.source}_.prototype.content=z;function Z(he){var re=new Error(D.source+":"+W+":"+Y+": "+he);if(re.reason=he,re.filename=D.source,re.line=W,re.column=Y,re.source=z,!D.silent)throw re}function te(he){var re=he.exec(z);if(re){var H=re[0];return K(H),z=z.slice(H.length),re}}function P(){te(a)}function $(he){var re;for(he=he||[];re=oe();)re!==!1&&he.push(re);return he}function oe(){var he=de();if(!(m!=z.charAt(0)||b!=z.charAt(1))){for(var re=2;x!=z.charAt(re)&&(b!=z.charAt(re)||m!=z.charAt(re+1));)++re;if(re+=2,x===z.charAt(re-1))return Z("End of comment missing");var H=z.slice(2,re-2);return Y+=2,K(H),z=z.slice(re),Y+=2,he({type:w,comment:H})}}function ue(){var he=de(),re=te(r);if(re){if(oe(),!te(u))return Z("property missing ':'");var H=te(c),le=he({type:S,property:L(re[0].replace(t,x)),value:H?L(H[0].replace(t,x)):x});return te(d),le}}function Te(){var he=[];$(he);for(var re;re=ue();)re!==!1&&(he.push(re),$(he));return he}return P(),Te()}function L(z){return z?z.replace(h,x):x}return zf=T,zf}var vy;function D1(){if(vy)return Yr;vy=1;var t=Yr&&Yr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.default=a;const i=t(_1());function a(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),h=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;h?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return Yr}var lo={},wy;function M1(){if(wy)return lo;wy=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(m){return!m||a.test(m)||t.test(m)},d=function(m,b){return b.toUpperCase()},h=function(m,b){return"".concat(b,"-")},g=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(u,h):m=m.replace(r,h),m.replace(i,d))};return lo.camelCase=g,lo}var ao,ky;function O1(){if(ky)return ao;ky=1;var t=ao&&ao.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=t(D1()),a=M1();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(h,g){h&&g&&(d[(0,a.camelCase)(h,c)]=g)}),d}return r.default=r,ao=r,ao}var R1=O1();const z1=Vx(R1),Zx=Jx("end"),Hp=Jx("start");function Jx(t){return i;function i(a){const r=a&&a.position&&a.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function L1(t){const i=Hp(t),a=Zx(t);if(i&&a)return{start:i,end:a}}function xo(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Sy(t.position):"start"in t||"end"in t?Sy(t):"line"in t||"column"in t?vp(t):""}function vp(t){return jy(t&&t.line)+":"+jy(t&&t.column)}function Sy(t){return vp(t&&t.start)+"-"+vp(t&&t.end)}function jy(t){return t&&typeof t=="number"?t:1}class on extends Error{constructor(i,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let u="",c={},d=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c={...a}),typeof i=="string"?u=i:!c.cause&&i&&(d=!0,u=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?c.ruleId=r:(c.source=r.slice(0,g),c.ruleId=r.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=u,this.line=h?h.line:void 0,this.name=xo(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=d&&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}}on.prototype.file="";on.prototype.name="";on.prototype.reason="";on.prototype.message="";on.prototype.stack="";on.prototype.column=void 0;on.prototype.line=void 0;on.prototype.ancestors=void 0;on.prototype.cause=void 0;on.prototype.fatal=void 0;on.prototype.place=void 0;on.prototype.ruleId=void 0;on.prototype.source=void 0;const $p={}.hasOwnProperty,I1=new Map,U1=/[A-Z]/g,B1=new Set(["table","tbody","thead","tfoot","tr"]),q1=new Set(["td","th"]),eb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function H1(t,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=i.filePath||void 0;let r;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=P1(a,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=X1(a,i.jsx,i.jsxs)}const u={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:r,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?qp:A1,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=tb(u,t,void 0);return c&&typeof c!="string"?c:u.create(t,u.Fragment,{children:c||void 0},void 0)}function tb(t,i,a){if(i.type==="element")return $1(t,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return G1(t,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return Y1(t,i,a);if(i.type==="mdxjsEsm")return V1(t,i);if(i.type==="root")return F1(t,i,a);if(i.type==="text")return K1(t,i)}function $1(t,i,a){const r=t.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=qp,t.schema=u),t.ancestors.push(i);const c=ib(t,i.tagName,!1),d=Q1(t,i);let h=Vp(t,i);return B1.has(i.tagName)&&(h=h.filter(function(g){return typeof g=="string"?!x1(g):!0})),nb(t,d,c,i),Gp(d,h),t.ancestors.pop(),t.schema=r,t.create(i,c,d,a)}function G1(t,i){if(i.data&&i.data.estree&&t.evaluater){const r=i.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Co(t,i.position)}function V1(t,i){if(i.data&&i.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(i.data.estree);Co(t,i.position)}function Y1(t,i,a){const r=t.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=qp,t.schema=u),t.ancestors.push(i);const c=i.name===null?t.Fragment:ib(t,i.name,!0),d=W1(t,i),h=Vp(t,i);return nb(t,d,c,i),Gp(d,h),t.ancestors.pop(),t.schema=r,t.create(i,c,d,a)}function F1(t,i,a){const r={};return Gp(r,Vp(t,i)),t.create(i,t.Fragment,r,a)}function K1(t,i){return i.value}function nb(t,i,a,r){typeof a!="string"&&a!==t.Fragment&&t.passNode&&(i.node=r)}function Gp(t,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(t.children=a)}}function X1(t,i,a){return r;function r(u,c,d,h){const m=Array.isArray(d.children)?a:i;return h?m(c,d,h):m(c,d)}}function P1(t,i){return a;function a(r,u,c,d){const h=Array.isArray(c.children),g=Hp(r);return i(u,c,d,h,{columnNumber:g?g.column-1:void 0,fileName:t,lineNumber:g?g.line:void 0},void 0)}}function Q1(t,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&$p.call(i.properties,u)){const c=Z1(t,u,i.properties[u]);if(c){const[d,h]=c;t.tableCellAlignToStyle&&d==="align"&&typeof h=="string"&&q1.has(i.tagName)?r=h:a[d]=h}}if(r){const c=a.style||(a.style={});c[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function W1(t,i){const a={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const h=d.properties[0];h.type,Object.assign(a,t.evaluater.evaluateExpression(h.argument))}else Co(t,i.position);else{const u=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const h=r.value.data.estree.body[0];h.type,c=t.evaluater.evaluateExpression(h.expression)}else Co(t,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function Vp(t,i){const a=[];let r=-1;const u=t.passKeys?new Map:I1;for(;++r<i.children.length;){const c=i.children[r];let d;if(t.passKeys){const g=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(g){const m=u.get(g)||0;d=g+"-"+m,u.set(g,m+1)}}const h=tb(t,c,d);h!==void 0&&a.push(h)}return a}function Z1(t,i,a){const r=C1(t.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?p1(a):N1(a)),r.property==="style"){let u=typeof a=="object"?a:J1(t,String(a));return t.stylePropertyNameCase==="css"&&(u=ek(u)),["style",u]}return[t.elementAttributeNameCase==="react"&&r.space?k1[r.property]||r.property:r.attribute,a]}}function J1(t,i){try{return z1(i,{reactCompat:!0})}catch(a){if(t.ignoreInvalidStyle)return{};const r=a,u=new on("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=t.filePath||void 0,u.url=eb+"#cannot-parse-style-attribute",u}}function ib(t,i,a){let r;if(!a)r={type:"Literal",value:i};else if(i.includes(".")){const u=i.split(".");let c=-1,d;for(;++c<u.length;){const h=my(u[c])?{type:"Identifier",name:u[c]}:{type:"Literal",value:u[c]};d=d?{type:"MemberExpression",object:d,property:h,computed:!!(c&&h.type==="Literal"),optional:!1}:h}r=d}else r=my(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return $p.call(t.components,u)?t.components[u]:u}if(t.evaluater)return t.evaluater.evaluateExpression(r);Co(t)}function Co(t,i){const a=new on("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=t.filePath||void 0,a.url=eb+"#cannot-handle-mdx-estrees-without-createevaluater",a}function ek(t){const i={};let a;for(a in t)$p.call(t,a)&&(i[tk(a)]=t[a]);return i}function tk(t){let i=t.replace(U1,nk);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function nk(t){return"-"+t.toLowerCase()}const Lf={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"]},ik={};function Yp(t,i){const a=ik,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return lb(t,r,u)}function lb(t,i,a){if(lk(t)){if("value"in t)return t.type==="html"&&!a?"":t.value;if(i&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Cy(t.children,i,a)}return Array.isArray(t)?Cy(t,i,a):""}function Cy(t,i,a){const r=[];let u=-1;for(;++u<t.length;)r[u]=lb(t[u],i,a);return r.join("")}function lk(t){return!!(t&&typeof t=="object")}const Ey=document.createElement("i");function Fp(t){const i="&"+t+";";Ey.innerHTML=i;const a=Ey.textContent;return a.charCodeAt(a.length-1)===59&&t!=="semi"||a===i?!1:a}function Wn(t,i,a,r){const u=t.length;let c=0,d;if(i<0?i=-i>u?0:u+i:i=i>u?u:i,a=a>0?a:0,r.length<1e4)d=Array.from(r),d.unshift(i,a),t.splice(...d);else for(a&&t.splice(i,a);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),t.splice(...d),c+=1e4,i+=1e4}function ri(t,i){return t.length>0?(Wn(t,t.length,0,i),t):i}const Ty={}.hasOwnProperty;function ab(t){const i={};let a=-1;for(;++a<t.length;)ak(i,t[a]);return i}function ak(t,i){let a;for(a in i){const u=(Ty.call(t,a)?t[a]:void 0)||(t[a]={}),c=i[a];let d;if(c)for(d in c){Ty.call(u,d)||(u[d]=[]);const h=c[d];rk(u[d],Array.isArray(h)?h:h?[h]:[])}}}function rk(t,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?t:r).push(i[a]);Wn(t,0,0,r)}function rb(t,i){const a=Number.parseInt(t,i);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function bi(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xn=ha(/[A-Za-z]/),sn=ha(/[\dA-Za-z]/),sk=ha(/[#-'*+\--9=?A-Z^-~]/);function bc(t){return t!==null&&(t<32||t===127)}const wp=ha(/\d/),ok=ha(/[\dA-Fa-f]/),uk=ha(/[!-/:-@[-`{-~]/);function Ne(t){return t!==null&&t<-2}function ht(t){return t!==null&&(t<0||t===32)}function Fe(t){return t===-2||t===-1||t===32}const Tc=ha(new RegExp("\\p{P}|\\p{S}","u")),nr=ha(/\s/);function ha(t){return i;function i(a){return a!==null&&a>-1&&t.test(String.fromCharCode(a))}}function Zr(t){const i=[];let a=-1,r=0,u=0;for(;++a<t.length;){const c=t.charCodeAt(a);let d="";if(c===37&&sn(t.charCodeAt(a+1))&&sn(t.charCodeAt(a+2)))u=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const h=t.charCodeAt(a+1);c<56320&&h>56319&&h<57344?(d=String.fromCharCode(c,h),u=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(t.slice(r,a),encodeURIComponent(d)),r=a+u+1,d=""),u&&(a+=u,u=0)}return i.join("")+t.slice(r)}function Pe(t,i,a,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return Fe(g)?(t.enter(a),h(g)):i(g)}function h(g){return Fe(g)&&c++<u?(t.consume(g),h):(t.exit(a),i(g))}}const ck={tokenize:dk};function dk(t){const i=t.attempt(this.parser.constructs.contentInitial,r,u);let a;return i;function r(h){if(h===null){t.consume(h);return}return t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),Pe(t,i,"linePrefix")}function u(h){return t.enter("paragraph"),c(h)}function c(h){const g=t.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=g),a=g,d(h)}function d(h){if(h===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(h);return}return Ne(h)?(t.consume(h),t.exit("chunkText"),c):(t.consume(h),d)}}const fk={tokenize:pk},Ay={tokenize:hk};function pk(t){const i=this,a=[];let r=0,u,c,d;return h;function h(Y){if(r<a.length){const K=a[r];return i.containerState=K[1],t.attempt(K[0].continuation,g,m)(Y)}return m(Y)}function g(Y){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&W();const K=i.events.length;let de=K,_;for(;de--;)if(i.events[de][0]==="exit"&&i.events[de][1].type==="chunkFlow"){_=i.events[de][1].end;break}D(r);let Z=K;for(;Z<i.events.length;)i.events[Z][1].end={..._},Z++;return Wn(i.events,de+1,0,i.events.slice(K)),i.events.length=Z,m(Y)}return h(Y)}function m(Y){if(r===a.length){if(!u)return w(Y);if(u.currentConstruct&&u.currentConstruct.concrete)return T(Y);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},t.check(Ay,b,x)(Y)}function b(Y){return u&&W(),D(r),w(Y)}function x(Y){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,T(Y)}function w(Y){return i.containerState={},t.attempt(Ay,S,T)(Y)}function S(Y){return r++,a.push([i.currentConstruct,i.containerState]),w(Y)}function T(Y){if(Y===null){u&&W(),D(0),t.consume(Y);return}return u=u||i.parser.flow(i.now()),t.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),L(Y)}function L(Y){if(Y===null){z(t.exit("chunkFlow"),!0),D(0),t.consume(Y);return}return Ne(Y)?(t.consume(Y),z(t.exit("chunkFlow")),r=0,i.interrupt=void 0,h):(t.consume(Y),L)}function z(Y,K){const de=i.sliceStream(Y);if(K&&de.push(null),Y.previous=c,c&&(c.next=Y),c=Y,u.defineSkip(Y.start),u.write(de),i.parser.lazy[Y.start.line]){let _=u.events.length;for(;_--;)if(u.events[_][1].start.offset<d&&(!u.events[_][1].end||u.events[_][1].end.offset>d))return;const Z=i.events.length;let te=Z,P,$;for(;te--;)if(i.events[te][0]==="exit"&&i.events[te][1].type==="chunkFlow"){if(P){$=i.events[te][1].end;break}P=!0}for(D(r),_=Z;_<i.events.length;)i.events[_][1].end={...$},_++;Wn(i.events,te+1,0,i.events.slice(Z)),i.events.length=_}}function D(Y){let K=a.length;for(;K-- >Y;){const de=a[K];i.containerState=de[1],de[0].exit.call(i,t)}a.length=Y}function W(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function hk(t,i,a){return Pe(t,t.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qr(t){if(t===null||ht(t)||nr(t))return 1;if(Tc(t))return 2}function Ac(t,i,a){const r=[];let u=-1;for(;++u<t.length;){const c=t[u].resolveAll;c&&!r.includes(c)&&(i=c(i,a),r.push(c))}return i}const kp={name:"attention",resolveAll:mk,tokenize:gk};function mk(t,i){let a=-1,r,u,c,d,h,g,m,b;for(;++a<t.length;)if(t[a][0]==="enter"&&t[a][1].type==="attentionSequence"&&t[a][1]._close){for(r=a;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&i.sliceSerialize(t[r][1]).charCodeAt(0)===i.sliceSerialize(t[a][1]).charCodeAt(0)){if((t[r][1]._close||t[a][1]._open)&&(t[a][1].end.offset-t[a][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[a][1].end.offset-t[a][1].start.offset)%3))continue;g=t[r][1].end.offset-t[r][1].start.offset>1&&t[a][1].end.offset-t[a][1].start.offset>1?2:1;const x={...t[r][1].end},w={...t[a][1].start};Ny(x,-g),Ny(w,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...t[r][1].end}},h={type:g>1?"strongSequence":"emphasisSequence",start:{...t[a][1].start},end:w},c={type:g>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[a][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...h.end}},t[r][1].end={...d.start},t[a][1].start={...h.end},m=[],t[r][1].end.offset-t[r][1].start.offset&&(m=ri(m,[["enter",t[r][1],i],["exit",t[r][1],i]])),m=ri(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=ri(m,Ac(i.parser.constructs.insideSpan.null,t.slice(r+1,a),i)),m=ri(m,[["exit",c,i],["enter",h,i],["exit",h,i],["exit",u,i]]),t[a][1].end.offset-t[a][1].start.offset?(b=2,m=ri(m,[["enter",t[a][1],i],["exit",t[a][1],i]])):b=0,Wn(t,r-1,a-r+3,m),a=r+m.length-b-2;break}}for(a=-1;++a<t.length;)t[a][1].type==="attentionSequence"&&(t[a][1].type="data");return t}function gk(t,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=Qr(r);let c;return d;function d(g){return c=g,t.enter("attentionSequence"),h(g)}function h(g){if(g===c)return t.consume(g),h;const m=t.exit("attentionSequence"),b=Qr(g),x=!b||b===2&&u||a.includes(g),w=!u||u===2&&b||a.includes(r);return m._open=!!(c===42?x:x&&(u||!w)),m._close=!!(c===42?w:w&&(b||!x)),i(g)}}function Ny(t,i){t.column+=i,t.offset+=i,t._bufferIndex+=i}const yk={name:"autolink",tokenize:xk};function xk(t,i,a){let r=0;return u;function u(S){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(S),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),c}function c(S){return xn(S)?(t.consume(S),d):S===64?a(S):m(S)}function d(S){return S===43||S===45||S===46||sn(S)?(r=1,h(S)):m(S)}function h(S){return S===58?(t.consume(S),r=0,g):(S===43||S===45||S===46||sn(S))&&r++<32?(t.consume(S),h):(r=0,m(S))}function g(S){return S===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(S),t.exit("autolinkMarker"),t.exit("autolink"),i):S===null||S===32||S===60||bc(S)?a(S):(t.consume(S),g)}function m(S){return S===64?(t.consume(S),b):sk(S)?(t.consume(S),m):a(S)}function b(S){return sn(S)?x(S):a(S)}function x(S){return S===46?(t.consume(S),r=0,b):S===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(S),t.exit("autolinkMarker"),t.exit("autolink"),i):w(S)}function w(S){if((S===45||sn(S))&&r++<63){const T=S===45?w:x;return t.consume(S),T}return a(S)}}const No={partial:!0,tokenize:bk};function bk(t,i,a){return r;function r(c){return Fe(c)?Pe(t,u,"linePrefix")(c):u(c)}function u(c){return c===null||Ne(c)?i(c):a(c)}}const sb={continuation:{tokenize:wk},exit:kk,name:"blockQuote",tokenize:vk};function vk(t,i,a){const r=this;return u;function u(d){if(d===62){const h=r.containerState;return h.open||(t.enter("blockQuote",{_container:!0}),h.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(d),t.exit("blockQuoteMarker"),c}return a(d)}function c(d){return Fe(d)?(t.enter("blockQuotePrefixWhitespace"),t.consume(d),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),i):(t.exit("blockQuotePrefix"),i(d))}}function wk(t,i,a){const r=this;return u;function u(d){return Fe(d)?Pe(t,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return t.attempt(sb,i,a)(d)}}function kk(t){t.exit("blockQuote")}const ob={name:"characterEscape",tokenize:Sk};function Sk(t,i,a){return r;function r(c){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(c),t.exit("escapeMarker"),u}function u(c){return uk(c)?(t.enter("characterEscapeValue"),t.consume(c),t.exit("characterEscapeValue"),t.exit("characterEscape"),i):a(c)}}const ub={name:"characterReference",tokenize:jk};function jk(t,i,a){const r=this;let u=0,c,d;return h;function h(x){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(x),t.exit("characterReferenceMarker"),g}function g(x){return x===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(x),t.exit("characterReferenceMarkerNumeric"),m):(t.enter("characterReferenceValue"),c=31,d=sn,b(x))}function m(x){return x===88||x===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(x),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),c=6,d=ok,b):(t.enter("characterReferenceValue"),c=7,d=wp,b(x))}function b(x){if(x===59&&u){const w=t.exit("characterReferenceValue");return d===sn&&!Fp(r.sliceSerialize(w))?a(x):(t.enter("characterReferenceMarker"),t.consume(x),t.exit("characterReferenceMarker"),t.exit("characterReference"),i)}return d(x)&&u++<c?(t.consume(x),b):a(x)}}const _y={partial:!0,tokenize:Ek},Dy={concrete:!0,name:"codeFenced",tokenize:Ck};function Ck(t,i,a){const r=this,u={partial:!0,tokenize:de};let c=0,d=0,h;return g;function g(_){return m(_)}function m(_){const Z=r.events[r.events.length-1];return c=Z&&Z[1].type==="linePrefix"?Z[2].sliceSerialize(Z[1],!0).length:0,h=_,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),b(_)}function b(_){return _===h?(d++,t.consume(_),b):d<3?a(_):(t.exit("codeFencedFenceSequence"),Fe(_)?Pe(t,x,"whitespace")(_):x(_))}function x(_){return _===null||Ne(_)?(t.exit("codeFencedFence"),r.interrupt?i(_):t.check(_y,L,K)(_)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===null||Ne(_)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),x(_)):Fe(_)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Pe(t,S,"whitespace")(_)):_===96&&_===h?a(_):(t.consume(_),w)}function S(_){return _===null||Ne(_)?x(_):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),T(_))}function T(_){return _===null||Ne(_)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),x(_)):_===96&&_===h?a(_):(t.consume(_),T)}function L(_){return t.attempt(u,K,z)(_)}function z(_){return t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),D}function D(_){return c>0&&Fe(_)?Pe(t,W,"linePrefix",c+1)(_):W(_)}function W(_){return _===null||Ne(_)?t.check(_y,L,K)(_):(t.enter("codeFlowValue"),Y(_))}function Y(_){return _===null||Ne(_)?(t.exit("codeFlowValue"),W(_)):(t.consume(_),Y)}function K(_){return t.exit("codeFenced"),i(_)}function de(_,Z,te){let P=0;return $;function $(re){return _.enter("lineEnding"),_.consume(re),_.exit("lineEnding"),oe}function oe(re){return _.enter("codeFencedFence"),Fe(re)?Pe(_,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):ue(re)}function ue(re){return re===h?(_.enter("codeFencedFenceSequence"),Te(re)):te(re)}function Te(re){return re===h?(P++,_.consume(re),Te):P>=d?(_.exit("codeFencedFenceSequence"),Fe(re)?Pe(_,he,"whitespace")(re):he(re)):te(re)}function he(re){return re===null||Ne(re)?(_.exit("codeFencedFence"),Z(re)):te(re)}}}function Ek(t,i,a){const r=this;return u;function u(d){return d===null?a(d):(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}const If={name:"codeIndented",tokenize:Ak},Tk={partial:!0,tokenize:Nk};function Ak(t,i,a){const r=this;return u;function u(m){return t.enter("codeIndented"),Pe(t,c,"linePrefix",5)(m)}function c(m){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(m):a(m)}function d(m){return m===null?g(m):Ne(m)?t.attempt(Tk,d,g)(m):(t.enter("codeFlowValue"),h(m))}function h(m){return m===null||Ne(m)?(t.exit("codeFlowValue"),d(m)):(t.consume(m),h)}function g(m){return t.exit("codeIndented"),i(m)}}function Nk(t,i,a){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?a(d):Ne(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),u):Pe(t,c,"linePrefix",5)(d)}function c(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?i(d):Ne(d)?u(d):a(d)}}const _k={name:"codeText",previous:Mk,resolve:Dk,tokenize:Ok};function Dk(t){let i=t.length-4,a=3,r,u;if((t[a][1].type==="lineEnding"||t[a][1].type==="space")&&(t[i][1].type==="lineEnding"||t[i][1].type==="space")){for(r=a;++r<i;)if(t[r][1].type==="codeTextData"){t[a][1].type="codeTextPadding",t[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(r=a-1,i++;++r<=i;)u===void 0?r!==i&&t[r][1].type!=="lineEnding"&&(u=r):(r===i||t[r][1].type==="lineEnding")&&(t[u][1].type="codeTextData",r!==u+2&&(t[u][1].end=t[r-1][1].end,t.splice(u+2,r-u-2),i-=r-u-2,r=u+2),u=void 0);return t}function Mk(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ok(t,i,a){let r=0,u,c;return d;function d(x){return t.enter("codeText"),t.enter("codeTextSequence"),h(x)}function h(x){return x===96?(t.consume(x),r++,h):(t.exit("codeTextSequence"),g(x))}function g(x){return x===null?a(x):x===32?(t.enter("space"),t.consume(x),t.exit("space"),g):x===96?(c=t.enter("codeTextSequence"),u=0,b(x)):Ne(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),g):(t.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Ne(x)?(t.exit("codeTextData"),g(x)):(t.consume(x),m)}function b(x){return x===96?(t.consume(x),u++,b):u===r?(t.exit("codeTextSequence"),t.exit("codeText"),i(x)):(c.type="codeTextData",m(x))}}class Rk{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(i,r):i>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(i,a,r){const u=a||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&ro(this.left,r),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),ro(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),ro(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const a=this.left.splice(i,Number.POSITIVE_INFINITY);ro(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);ro(this.left,a.reverse())}}}function ro(t,i){let a=0;if(i.length<1e4)t.push(...i);else for(;a<i.length;)t.push(...i.slice(a,a+1e4)),a+=1e4}function cb(t){const i={};let a=-1,r,u,c,d,h,g,m;const b=new Rk(t);for(;++a<b.length;){for(;a in i;)a=i[a];if(r=b.get(a),a&&r[1].type==="chunkFlow"&&b.get(a-1)[1].type==="listItemPrefix"&&(g=r[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(r[0]==="enter")r[1].contentType&&(Object.assign(i,zk(b,a)),a=i[a],m=!0);else if(r[1]._container){for(c=a,u=void 0;c--;)if(d=b.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),d[1].type="lineEnding",u=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;u&&(r[1].end={...b.get(u)[1].start},h=b.slice(u,a),h.unshift(r),b.splice(u,a-u+1,h))}}return Wn(t,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function zk(t,i){const a=t.get(i)[1],r=t.get(i)[2];let u=i-1;const c=[];let d=a._tokenizer;d||(d=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const h=d.events,g=[],m={};let b,x,w=-1,S=a,T=0,L=0;const z=[L];for(;S;){for(;t.get(++u)[1]!==S;);c.push(u),S._tokenizer||(b=r.sliceStream(S),S.next||b.push(null),x&&d.defineSkip(S.start),S._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),S._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=S,S=S.next}for(S=a;++w<h.length;)h[w][0]==="exit"&&h[w-1][0]==="enter"&&h[w][1].type===h[w-1][1].type&&h[w][1].start.line!==h[w][1].end.line&&(L=w+1,z.push(L),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(d.events=[],S?(S._tokenizer=void 0,S.previous=void 0):z.pop(),w=z.length;w--;){const D=h.slice(z[w],z[w+1]),W=c.pop();g.push([W,W+D.length-1]),t.splice(W,2,D)}for(g.reverse(),w=-1;++w<g.length;)m[T+g[w][0]]=T+g[w][1],T+=g[w][1]-g[w][0]-1;return m}const Lk={resolve:Uk,tokenize:Bk},Ik={partial:!0,tokenize:qk};function Uk(t){return cb(t),t}function Bk(t,i){let a;return r;function r(h){return t.enter("content"),a=t.enter("chunkContent",{contentType:"content"}),u(h)}function u(h){return h===null?c(h):Ne(h)?t.check(Ik,d,c)(h):(t.consume(h),u)}function c(h){return t.exit("chunkContent"),t.exit("content"),i(h)}function d(h){return t.consume(h),t.exit("chunkContent"),a.next=t.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function qk(t,i,a){const r=this;return u;function u(d){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Pe(t,c,"linePrefix")}function c(d){if(d===null||Ne(d))return a(d);const h=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?i(d):t.interrupt(r.parser.constructs.flow,a,i)(d)}}function db(t,i,a,r,u,c,d,h,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(D){return D===60?(t.enter(r),t.enter(u),t.enter(c),t.consume(D),t.exit(c),w):D===null||D===32||D===41||bc(D)?a(D):(t.enter(r),t.enter(d),t.enter(h),t.enter("chunkString",{contentType:"string"}),L(D))}function w(D){return D===62?(t.enter(c),t.consume(D),t.exit(c),t.exit(u),t.exit(r),i):(t.enter(h),t.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===62?(t.exit("chunkString"),t.exit(h),w(D)):D===null||D===60||Ne(D)?a(D):(t.consume(D),D===92?T:S)}function T(D){return D===60||D===62||D===92?(t.consume(D),S):S(D)}function L(D){return!b&&(D===null||D===41||ht(D))?(t.exit("chunkString"),t.exit(h),t.exit(d),t.exit(r),i(D)):b<m&&D===40?(t.consume(D),b++,L):D===41?(t.consume(D),b--,L):D===null||D===32||D===40||bc(D)?a(D):(t.consume(D),D===92?z:L)}function z(D){return D===40||D===41||D===92?(t.consume(D),L):L(D)}}function fb(t,i,a,r,u,c){const d=this;let h=0,g;return m;function m(S){return t.enter(r),t.enter(u),t.consume(S),t.exit(u),t.enter(c),b}function b(S){return h>999||S===null||S===91||S===93&&!g||S===94&&!h&&"_hiddenFootnoteSupport"in d.parser.constructs?a(S):S===93?(t.exit(c),t.enter(u),t.consume(S),t.exit(u),t.exit(r),i):Ne(S)?(t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),b):(t.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===null||S===91||S===93||Ne(S)||h++>999?(t.exit("chunkString"),b(S)):(t.consume(S),g||(g=!Fe(S)),S===92?w:x)}function w(S){return S===91||S===92||S===93?(t.consume(S),h++,x):x(S)}}function pb(t,i,a,r,u,c){let d;return h;function h(w){return w===34||w===39||w===40?(t.enter(r),t.enter(u),t.consume(w),t.exit(u),d=w===40?41:w,g):a(w)}function g(w){return w===d?(t.enter(u),t.consume(w),t.exit(u),t.exit(r),i):(t.enter(c),m(w))}function m(w){return w===d?(t.exit(c),g(d)):w===null?a(w):Ne(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),Pe(t,m,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),b(w))}function b(w){return w===d||w===null||Ne(w)?(t.exit("chunkString"),m(w)):(t.consume(w),w===92?x:b)}function x(w){return w===d||w===92?(t.consume(w),b):b(w)}}function bo(t,i){let a;return r;function r(u){return Ne(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),a=!0,r):Fe(u)?Pe(t,r,a?"linePrefix":"lineSuffix")(u):i(u)}}const Hk={name:"definition",tokenize:Gk},$k={partial:!0,tokenize:Vk};function Gk(t,i,a){const r=this;let u;return c;function c(S){return t.enter("definition"),d(S)}function d(S){return fb.call(r,t,h,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function h(S){return u=bi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),S===58?(t.enter("definitionMarker"),t.consume(S),t.exit("definitionMarker"),g):a(S)}function g(S){return ht(S)?bo(t,m)(S):m(S)}function m(S){return db(t,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function b(S){return t.attempt($k,x,x)(S)}function x(S){return Fe(S)?Pe(t,w,"whitespace")(S):w(S)}function w(S){return S===null||Ne(S)?(t.exit("definition"),r.parser.defined.push(u),i(S)):a(S)}}function Vk(t,i,a){return r;function r(h){return ht(h)?bo(t,u)(h):a(h)}function u(h){return pb(t,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function c(h){return Fe(h)?Pe(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Ne(h)?i(h):a(h)}}const Yk={name:"hardBreakEscape",tokenize:Fk};function Fk(t,i,a){return r;function r(c){return t.enter("hardBreakEscape"),t.consume(c),u}function u(c){return Ne(c)?(t.exit("hardBreakEscape"),i(c)):a(c)}}const Kk={name:"headingAtx",resolve:Xk,tokenize:Pk};function Xk(t,i){let a=t.length-2,r=3,u,c;return t[r][1].type==="whitespace"&&(r+=2),a-2>r&&t[a][1].type==="whitespace"&&(a-=2),t[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&t[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(u={type:"atxHeadingText",start:t[r][1].start,end:t[a][1].end},c={type:"chunkText",start:t[r][1].start,end:t[a][1].end,contentType:"text"},Wn(t,r,a-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),t}function Pk(t,i,a){let r=0;return u;function u(b){return t.enter("atxHeading"),c(b)}function c(b){return t.enter("atxHeadingSequence"),d(b)}function d(b){return b===35&&r++<6?(t.consume(b),d):b===null||ht(b)?(t.exit("atxHeadingSequence"),h(b)):a(b)}function h(b){return b===35?(t.enter("atxHeadingSequence"),g(b)):b===null||Ne(b)?(t.exit("atxHeading"),i(b)):Fe(b)?Pe(t,h,"whitespace")(b):(t.enter("atxHeadingText"),m(b))}function g(b){return b===35?(t.consume(b),g):(t.exit("atxHeadingSequence"),h(b))}function m(b){return b===null||b===35||ht(b)?(t.exit("atxHeadingText"),h(b)):(t.consume(b),m)}}const Qk=["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"],My=["pre","script","style","textarea"],Wk={concrete:!0,name:"htmlFlow",resolveTo:e0,tokenize:t0},Zk={partial:!0,tokenize:i0},Jk={partial:!0,tokenize:n0};function e0(t){let i=t.length;for(;i--&&!(t[i][0]==="enter"&&t[i][1].type==="htmlFlow"););return i>1&&t[i-2][1].type==="linePrefix"&&(t[i][1].start=t[i-2][1].start,t[i+1][1].start=t[i-2][1].start,t.splice(i-2,2)),t}function t0(t,i,a){const r=this;let u,c,d,h,g;return m;function m(A){return b(A)}function b(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),x}function x(A){return A===33?(t.consume(A),w):A===47?(t.consume(A),c=!0,L):A===63?(t.consume(A),u=3,r.interrupt?i:N):xn(A)?(t.consume(A),d=String.fromCharCode(A),z):a(A)}function w(A){return A===45?(t.consume(A),u=2,S):A===91?(t.consume(A),u=5,h=0,T):xn(A)?(t.consume(A),u=4,r.interrupt?i:N):a(A)}function S(A){return A===45?(t.consume(A),r.interrupt?i:N):a(A)}function T(A){const ae="CDATA[";return A===ae.charCodeAt(h++)?(t.consume(A),h===ae.length?r.interrupt?i:ue:T):a(A)}function L(A){return xn(A)?(t.consume(A),d=String.fromCharCode(A),z):a(A)}function z(A){if(A===null||A===47||A===62||ht(A)){const ae=A===47,me=d.toLowerCase();return!ae&&!c&&My.includes(me)?(u=1,r.interrupt?i(A):ue(A)):Qk.includes(d.toLowerCase())?(u=6,ae?(t.consume(A),D):r.interrupt?i(A):ue(A)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(A):c?W(A):Y(A))}return A===45||sn(A)?(t.consume(A),d+=String.fromCharCode(A),z):a(A)}function D(A){return A===62?(t.consume(A),r.interrupt?i:ue):a(A)}function W(A){return Fe(A)?(t.consume(A),W):$(A)}function Y(A){return A===47?(t.consume(A),$):A===58||A===95||xn(A)?(t.consume(A),K):Fe(A)?(t.consume(A),Y):$(A)}function K(A){return A===45||A===46||A===58||A===95||sn(A)?(t.consume(A),K):de(A)}function de(A){return A===61?(t.consume(A),_):Fe(A)?(t.consume(A),de):Y(A)}function _(A){return A===null||A===60||A===61||A===62||A===96?a(A):A===34||A===39?(t.consume(A),g=A,Z):Fe(A)?(t.consume(A),_):te(A)}function Z(A){return A===g?(t.consume(A),g=null,P):A===null||Ne(A)?a(A):(t.consume(A),Z)}function te(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||ht(A)?de(A):(t.consume(A),te)}function P(A){return A===47||A===62||Fe(A)?Y(A):a(A)}function $(A){return A===62?(t.consume(A),oe):a(A)}function oe(A){return A===null||Ne(A)?ue(A):Fe(A)?(t.consume(A),oe):a(A)}function ue(A){return A===45&&u===2?(t.consume(A),H):A===60&&u===1?(t.consume(A),le):A===62&&u===4?(t.consume(A),C):A===63&&u===3?(t.consume(A),N):A===93&&u===5?(t.consume(A),Ce):Ne(A)&&(u===6||u===7)?(t.exit("htmlFlowData"),t.check(Zk,B,Te)(A)):A===null||Ne(A)?(t.exit("htmlFlowData"),Te(A)):(t.consume(A),ue)}function Te(A){return t.check(Jk,he,B)(A)}function he(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),re}function re(A){return A===null||Ne(A)?Te(A):(t.enter("htmlFlowData"),ue(A))}function H(A){return A===45?(t.consume(A),N):ue(A)}function le(A){return A===47?(t.consume(A),d="",ye):ue(A)}function ye(A){if(A===62){const ae=d.toLowerCase();return My.includes(ae)?(t.consume(A),C):ue(A)}return xn(A)&&d.length<8?(t.consume(A),d+=String.fromCharCode(A),ye):ue(A)}function Ce(A){return A===93?(t.consume(A),N):ue(A)}function N(A){return A===62?(t.consume(A),C):A===45&&u===2?(t.consume(A),N):ue(A)}function C(A){return A===null||Ne(A)?(t.exit("htmlFlowData"),B(A)):(t.consume(A),C)}function B(A){return t.exit("htmlFlow"),i(A)}}function n0(t,i,a){const r=this;return u;function u(d){return Ne(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):a(d)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}function i0(t,i,a){return r;function r(u){return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),t.attempt(No,i,a)}}const l0={name:"htmlText",tokenize:a0};function a0(t,i,a){const r=this;let u,c,d;return h;function h(N){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(N),g}function g(N){return N===33?(t.consume(N),m):N===47?(t.consume(N),de):N===63?(t.consume(N),Y):xn(N)?(t.consume(N),te):a(N)}function m(N){return N===45?(t.consume(N),b):N===91?(t.consume(N),c=0,T):xn(N)?(t.consume(N),W):a(N)}function b(N){return N===45?(t.consume(N),S):a(N)}function x(N){return N===null?a(N):N===45?(t.consume(N),w):Ne(N)?(d=x,le(N)):(t.consume(N),x)}function w(N){return N===45?(t.consume(N),S):x(N)}function S(N){return N===62?H(N):N===45?w(N):x(N)}function T(N){const C="CDATA[";return N===C.charCodeAt(c++)?(t.consume(N),c===C.length?L:T):a(N)}function L(N){return N===null?a(N):N===93?(t.consume(N),z):Ne(N)?(d=L,le(N)):(t.consume(N),L)}function z(N){return N===93?(t.consume(N),D):L(N)}function D(N){return N===62?H(N):N===93?(t.consume(N),D):L(N)}function W(N){return N===null||N===62?H(N):Ne(N)?(d=W,le(N)):(t.consume(N),W)}function Y(N){return N===null?a(N):N===63?(t.consume(N),K):Ne(N)?(d=Y,le(N)):(t.consume(N),Y)}function K(N){return N===62?H(N):Y(N)}function de(N){return xn(N)?(t.consume(N),_):a(N)}function _(N){return N===45||sn(N)?(t.consume(N),_):Z(N)}function Z(N){return Ne(N)?(d=Z,le(N)):Fe(N)?(t.consume(N),Z):H(N)}function te(N){return N===45||sn(N)?(t.consume(N),te):N===47||N===62||ht(N)?P(N):a(N)}function P(N){return N===47?(t.consume(N),H):N===58||N===95||xn(N)?(t.consume(N),$):Ne(N)?(d=P,le(N)):Fe(N)?(t.consume(N),P):H(N)}function $(N){return N===45||N===46||N===58||N===95||sn(N)?(t.consume(N),$):oe(N)}function oe(N){return N===61?(t.consume(N),ue):Ne(N)?(d=oe,le(N)):Fe(N)?(t.consume(N),oe):P(N)}function ue(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(t.consume(N),u=N,Te):Ne(N)?(d=ue,le(N)):Fe(N)?(t.consume(N),ue):(t.consume(N),he)}function Te(N){return N===u?(t.consume(N),u=void 0,re):N===null?a(N):Ne(N)?(d=Te,le(N)):(t.consume(N),Te)}function he(N){return N===null||N===34||N===39||N===60||N===61||N===96?a(N):N===47||N===62||ht(N)?P(N):(t.consume(N),he)}function re(N){return N===47||N===62||ht(N)?P(N):a(N)}function H(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),i):a(N)}function le(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),ye}function ye(N){return Fe(N)?Pe(t,Ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):Ce(N)}function Ce(N){return t.enter("htmlTextData"),d(N)}}const Kp={name:"labelEnd",resolveAll:u0,resolveTo:c0,tokenize:d0},r0={tokenize:f0},s0={tokenize:p0},o0={tokenize:h0};function u0(t){let i=-1;const a=[];for(;++i<t.length;){const r=t[i][1];if(a.push(t[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",i+=u}}return t.length!==a.length&&Wn(t,0,t.length,a),t}function c0(t,i){let a=t.length,r=0,u,c,d,h;for(;a--;)if(u=t[a][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;t[a][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(t[a][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=a,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(d=a);const g={type:t[c][1].type==="labelLink"?"link":"image",start:{...t[c][1].start},end:{...t[t.length-1][1].end}},m={type:"label",start:{...t[c][1].start},end:{...t[d][1].end}},b={type:"labelText",start:{...t[c+r+2][1].end},end:{...t[d-2][1].start}};return h=[["enter",g,i],["enter",m,i]],h=ri(h,t.slice(c+1,c+r+3)),h=ri(h,[["enter",b,i]]),h=ri(h,Ac(i.parser.constructs.insideSpan.null,t.slice(c+r+4,d-3),i)),h=ri(h,[["exit",b,i],t[d-2],t[d-1],["exit",m,i]]),h=ri(h,t.slice(d+1)),h=ri(h,[["exit",g,i]]),Wn(t,c,t.length,h),t}function d0(t,i,a){const r=this;let u=r.events.length,c,d;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){c=r.events[u][1];break}return h;function h(w){return c?c._inactive?x(w):(d=r.parser.defined.includes(bi(r.sliceSerialize({start:c.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(w),t.exit("labelMarker"),t.exit("labelEnd"),g):a(w)}function g(w){return w===40?t.attempt(r0,b,d?b:x)(w):w===91?t.attempt(s0,b,d?m:x)(w):d?b(w):x(w)}function m(w){return t.attempt(o0,b,x)(w)}function b(w){return i(w)}function x(w){return c._balanced=!0,a(w)}}function f0(t,i,a){return r;function r(x){return t.enter("resource"),t.enter("resourceMarker"),t.consume(x),t.exit("resourceMarker"),u}function u(x){return ht(x)?bo(t,c)(x):c(x)}function c(x){return x===41?b(x):db(t,d,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return ht(x)?bo(t,g)(x):b(x)}function h(x){return a(x)}function g(x){return x===34||x===39||x===40?pb(t,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return ht(x)?bo(t,b)(x):b(x)}function b(x){return x===41?(t.enter("resourceMarker"),t.consume(x),t.exit("resourceMarker"),t.exit("resource"),i):a(x)}}function p0(t,i,a){const r=this;return u;function u(h){return fb.call(r,t,c,d,"reference","referenceMarker","referenceString")(h)}function c(h){return r.parser.defined.includes(bi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(h):a(h)}function d(h){return a(h)}}function h0(t,i,a){return r;function r(c){return t.enter("reference"),t.enter("referenceMarker"),t.consume(c),t.exit("referenceMarker"),u}function u(c){return c===93?(t.enter("referenceMarker"),t.consume(c),t.exit("referenceMarker"),t.exit("reference"),i):a(c)}}const m0={name:"labelStartImage",resolveAll:Kp.resolveAll,tokenize:g0};function g0(t,i,a){const r=this;return u;function u(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"),d):a(h)}function d(h){return h===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(h):i(h)}}const y0={name:"labelStartLink",resolveAll:Kp.resolveAll,tokenize:x0};function x0(t,i,a){const r=this;return u;function u(d){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(d),t.exit("labelMarker"),t.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(d):i(d)}}const Uf={name:"lineEnding",tokenize:b0};function b0(t,i){return a;function a(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Pe(t,i,"linePrefix")}}const hc={name:"thematicBreak",tokenize:v0};function v0(t,i,a){let r=0,u;return c;function c(m){return t.enter("thematicBreak"),d(m)}function d(m){return u=m,h(m)}function h(m){return m===u?(t.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Ne(m))?(t.exit("thematicBreak"),i(m)):a(m)}function g(m){return m===u?(t.consume(m),r++,g):(t.exit("thematicBreakSequence"),Fe(m)?Pe(t,h,"whitespace")(m):h(m))}}const zn={continuation:{tokenize:j0},exit:E0,name:"list",tokenize:S0},w0={partial:!0,tokenize:T0},k0={partial:!0,tokenize:C0};function S0(t,i,a){const r=this,u=r.events[r.events.length-1];let c=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,d=0;return h;function h(S){const T=r.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!r.containerState.marker||S===r.containerState.marker:wp(S)){if(r.containerState.type||(r.containerState.type=T,t.enter(T,{_container:!0})),T==="listUnordered")return t.enter("listItemPrefix"),S===42||S===45?t.check(hc,a,m)(S):m(S);if(!r.interrupt||S===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),g(S)}return a(S)}function g(S){return wp(S)&&++d<10?(t.consume(S),g):(!r.interrupt||d<2)&&(r.containerState.marker?S===r.containerState.marker:S===41||S===46)?(t.exit("listItemValue"),m(S)):a(S)}function m(S){return t.enter("listItemMarker"),t.consume(S),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||S,t.check(No,r.interrupt?a:b,t.attempt(w0,w,x))}function b(S){return r.containerState.initialBlankLine=!0,c++,w(S)}function x(S){return Fe(S)?(t.enter("listItemPrefixWhitespace"),t.consume(S),t.exit("listItemPrefixWhitespace"),w):a(S)}function w(S){return r.containerState.size=c+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,i(S)}}function j0(t,i,a){const r=this;return r.containerState._closeFlow=void 0,t.check(No,u,c);function u(h){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Pe(t,i,"listItemIndent",r.containerState.size+1)(h)}function c(h){return r.containerState.furtherBlankLines||!Fe(h)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(h)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(k0,i,d)(h))}function d(h){return r.containerState._closeFlow=!0,r.interrupt=void 0,Pe(t,t.attempt(zn,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function C0(t,i,a){const r=this;return Pe(t,u,"listItemIndent",r.containerState.size+1);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(c):a(c)}}function E0(t){t.exit(this.containerState.type)}function T0(t,i,a){const r=this;return Pe(t,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!Fe(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):a(c)}}const Oy={name:"setextUnderline",resolveTo:A0,tokenize:N0};function A0(t,i){let a=t.length,r,u,c;for(;a--;)if(t[a][0]==="enter"){if(t[a][1].type==="content"){r=a;break}t[a][1].type==="paragraph"&&(u=a)}else t[a][1].type==="content"&&t.splice(a,1),!c&&t[a][1].type==="definition"&&(c=a);const d={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[u][1].type="setextHeadingText",c?(t.splice(u,0,["enter",d,i]),t.splice(c+1,0,["exit",t[r][1],i]),t[r][1].end={...t[c][1].end}):t[r][1]=d,t.push(["exit",d,i]),t}function N0(t,i,a){const r=this;let u;return c;function c(m){let b=r.events.length,x;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){x=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||x)?(t.enter("setextHeadingLine"),u=m,d(m)):a(m)}function d(m){return t.enter("setextHeadingLineSequence"),h(m)}function h(m){return m===u?(t.consume(m),h):(t.exit("setextHeadingLineSequence"),Fe(m)?Pe(t,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Ne(m)?(t.exit("setextHeadingLine"),i(m)):a(m)}}const _0={tokenize:D0};function D0(t){const i=this,a=t.attempt(No,r,t.attempt(this.parser.constructs.flowInitial,u,Pe(t,t.attempt(this.parser.constructs.flow,u,t.attempt(Lk,u)),"linePrefix")));return a;function r(c){if(c===null){t.consume(c);return}return t.enter("lineEndingBlank"),t.consume(c),t.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function u(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),i.currentConstruct=void 0,a}}const M0={resolveAll:mb()},O0=hb("string"),R0=hb("text");function hb(t){return{resolveAll:mb(t==="text"?z0:void 0),tokenize:i};function i(a){const r=this,u=this.parser.constructs[t],c=a.attempt(u,d,h);return d;function d(b){return m(b)?c(b):h(b)}function h(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),g}function g(b){return m(b)?(a.exit("data"),c(b)):(a.consume(b),g)}function m(b){if(b===null)return!0;const x=u[b];let w=-1;if(x)for(;++w<x.length;){const S=x[w];if(!S.previous||S.previous.call(r,r.previous))return!0}return!1}}}function mb(t){return i;function i(a,r){let u=-1,c;for(;++u<=a.length;)c===void 0?a[u]&&a[u][1].type==="data"&&(c=u,u++):(!a[u]||a[u][1].type!=="data")&&(u!==c+2&&(a[c][1].end=a[u-1][1].end,a.splice(c+2,u-c-2),u=c+2),c=void 0);return t?t(a,r):a}}function z0(t,i){let a=0;for(;++a<=t.length;)if((a===t.length||t[a][1].type==="lineEnding")&&t[a-1][1].type==="data"){const r=t[a-1][1],u=i.sliceStream(r);let c=u.length,d=-1,h=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)h++,d--;if(d)break;d=-1}else if(m===-2)g=!0,h++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===t.length&&(h=0),h){const m={type:a===t.length||g||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-h,offset:r.end.offset-h},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(t.splice(a,0,["enter",m,i],["exit",m,i]),a+=2)}a++}return t}const L0={42:zn,43:zn,45:zn,48:zn,49:zn,50:zn,51:zn,52:zn,53:zn,54:zn,55:zn,56:zn,57:zn,62:sb},I0={91:Hk},U0={[-2]:If,[-1]:If,32:If},B0={35:Kk,42:hc,45:[Oy,hc],60:Wk,61:Oy,95:hc,96:Dy,126:Dy},q0={38:ub,92:ob},H0={[-5]:Uf,[-4]:Uf,[-3]:Uf,33:m0,38:ub,42:kp,60:[yk,l0],91:y0,92:[Yk,ob],93:Kp,95:kp,96:_k},$0={null:[kp,M0]},G0={null:[42,95]},V0={null:[]},Y0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:G0,contentInitial:I0,disable:V0,document:L0,flow:B0,flowInitial:U0,insideSpan:$0,string:q0,text:H0},Symbol.toStringTag,{value:"Module"}));function F0(t,i,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const u={},c=[];let d=[],h=[];const g={attempt:Z(de),check:Z(_),consume:W,enter:Y,exit:K,interrupt:Z(_,{interrupt:!0})},m={code:null,containerState:{},defineSkip:L,events:[],now:T,parser:t,previous:null,sliceSerialize:w,sliceStream:S,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(oe){return d=ri(d,oe),z(),d[d.length-1]!==null?[]:(te(i,0),m.events=Ac(c,m.events,m),m.events)}function w(oe,ue){return X0(S(oe),ue)}function S(oe){return K0(d,oe)}function T(){const{_bufferIndex:oe,_index:ue,line:Te,column:he,offset:re}=r;return{_bufferIndex:oe,_index:ue,line:Te,column:he,offset:re}}function L(oe){u[oe.line]=oe.column,$()}function z(){let oe;for(;r._index<d.length;){const ue=d[r._index];if(typeof ue=="string")for(oe=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===oe&&r._bufferIndex<ue.length;)D(ue.charCodeAt(r._bufferIndex));else D(ue)}}function D(oe){b=b(oe)}function W(oe){Ne(oe)?(r.line++,r.column=1,r.offset+=oe===-3?2:1,$()):oe!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=oe}function Y(oe,ue){const Te=ue||{};return Te.type=oe,Te.start=T(),m.events.push(["enter",Te,m]),h.push(Te),Te}function K(oe){const ue=h.pop();return ue.end=T(),m.events.push(["exit",ue,m]),ue}function de(oe,ue){te(oe,ue.from)}function _(oe,ue){ue.restore()}function Z(oe,ue){return Te;function Te(he,re,H){let le,ye,Ce,N;return Array.isArray(he)?B(he):"tokenize"in he?B([he]):C(he);function C(fe){return xe;function xe(ze){const qe=ze!==null&&fe[ze],Tt=ze!==null&&fe.null,wt=[...Array.isArray(qe)?qe:qe?[qe]:[],...Array.isArray(Tt)?Tt:Tt?[Tt]:[]];return B(wt)(ze)}}function B(fe){return le=fe,ye=0,fe.length===0?H:A(fe[ye])}function A(fe){return xe;function xe(ze){return N=P(),Ce=fe,fe.partial||(m.currentConstruct=fe),fe.name&&m.parser.constructs.disable.null.includes(fe.name)?me():fe.tokenize.call(ue?Object.assign(Object.create(m),ue):m,g,ae,me)(ze)}}function ae(fe){return oe(Ce,N),re}function me(fe){return N.restore(),++ye<le.length?A(le[ye]):H}}}function te(oe,ue){oe.resolveAll&&!c.includes(oe)&&c.push(oe),oe.resolve&&Wn(m.events,ue,m.events.length-ue,oe.resolve(m.events.slice(ue),m)),oe.resolveTo&&(m.events=oe.resolveTo(m.events,m))}function P(){const oe=T(),ue=m.previous,Te=m.currentConstruct,he=m.events.length,re=Array.from(h);return{from:he,restore:H};function H(){r=oe,m.previous=ue,m.currentConstruct=Te,m.events.length=he,h=re,$()}}function $(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function K0(t,i){const a=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(a===u)d=[t[a].slice(r,c)];else{if(d=t.slice(a,u),r>-1){const h=d[0];typeof h=="string"?d[0]=h.slice(r):d.shift()}c>0&&d.push(t[u].slice(0,c))}return d}function X0(t,i){let a=-1;const r=[];let u;for(;++a<t.length;){const c=t[a];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
|
|
52
|
+
`;break}case-3:{d=`\r
|
|
53
|
+
`;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&u)continue;d=" ";break}default:d=String.fromCharCode(c)}u=c===-2,r.push(d)}return r.join("")}function P0(t){const r={constructs:ab([Y0,...(t||{}).extensions||[]]),content:u(ck),defined:[],document:u(fk),flow:u(_0),lazy:{},string:u(O0),text:u(R0)};return r;function u(c){return d;function d(h){return F0(r,c,h)}}}function Q0(t){for(;!cb(t););return t}const Ry=/[\0\t\n\r]/g;function W0(){let t=1,i="",a=!0,r;return u;function u(c,d,h){const g=[];let m,b,x,w,S;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),x=0,i="",a&&(c.charCodeAt(0)===65279&&x++,a=void 0);x<c.length;){if(Ry.lastIndex=x,m=Ry.exec(c),w=m&&m.index!==void 0?m.index:c.length,S=c.charCodeAt(w),!m){i=c.slice(x);break}if(S===10&&x===w&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<w&&(g.push(c.slice(x,w)),t+=w-x),S){case 0:{g.push(65533),t++;break}case 9:{for(b=Math.ceil(t/4)*4,g.push(-2);t++<b;)g.push(-1);break}case 10:{g.push(-4),t=1;break}default:r=!0,t=1}x=w+1}return h&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const Z0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function J0(t){return t.replace(Z0,eS)}function eS(t,i,a){if(i)return i;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),c=u===120||u===88;return rb(a.slice(c?2:1),c?16:10)}return Fp(a)||t}const gb={}.hasOwnProperty;function tS(t,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),nS(a)(Q0(P0(a).document().write(W0()(t,i,!0))))}function nS(t){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(In),autolinkProtocol:P,autolinkEmail:P,atxHeading:c(vn),blockQuote:c(Tt),characterEscape:P,characterReference:P,codeFenced:c(wt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(wt,d),codeText:c(un,d),codeTextData:P,data:P,codeFlowValue:P,definition:c(bn),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(kt),hardBreakEscape:c(Oe),hardBreakTrailing:c(Oe),htmlFlow:c(Vt,d),htmlFlowData:P,htmlText:c(Vt,d),htmlTextData:P,image:c(Zn),label:d,link:c(In),listItem:c(yt),listItemValue:w,listOrdered:c(oi,x),listUnordered:c(oi),paragraph:c(Yt),reference:A,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(vn),strong:c(vi),thematicBreak:c(wi)},exit:{atxHeading:g(),atxHeadingSequence:de,autolink:g(),autolinkEmail:qe,autolinkProtocol:ze,blockQuote:g(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:fe,characterReference:xe,codeFenced:g(z),codeFencedFence:L,codeFencedFenceInfo:S,codeFencedFenceMeta:T,codeFlowValue:$,codeIndented:g(D),codeText:g(re),codeTextData:$,data:$,definition:g(),definitionDestinationString:K,definitionLabelString:W,definitionTitleString:Y,emphasis:g(),hardBreakEscape:g(ue),hardBreakTrailing:g(ue),htmlFlow:g(Te),htmlFlowData:$,htmlText:g(he),htmlTextData:$,image:g(le),label:Ce,labelText:ye,lineEnding:oe,link:g(H),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:ae,resourceDestinationString:N,resourceTitleString:C,resource:B,setextHeading:g(te),setextHeadingLineSequence:Z,setextHeadingText:_,strong:g(),thematicBreak:g()}};yb(i,(t||{}).mdastExtensions||[]);const a={};return r;function r(ee){let se={type:"root",children:[]};const De={stack:[se],tokenStack:[],config:i,enter:h,exit:m,buffer:d,resume:b,data:a},$e=[];let Qe=-1;for(;++Qe<ee.length;)if(ee[Qe][1].type==="listOrdered"||ee[Qe][1].type==="listUnordered")if(ee[Qe][0]==="enter")$e.push(Qe);else{const cn=$e.pop();Qe=u(ee,cn,Qe)}for(Qe=-1;++Qe<ee.length;){const cn=i[ee[Qe][0]];gb.call(cn,ee[Qe][1].type)&&cn[ee[Qe][1].type].call(Object.assign({sliceSerialize:ee[Qe][2].sliceSerialize},De),ee[Qe][1])}if(De.tokenStack.length>0){const cn=De.tokenStack[De.tokenStack.length-1];(cn[1]||zy).call(De,void 0,cn[0])}for(se.position={start:ca(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:ca(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},Qe=-1;++Qe<i.transforms.length;)se=i.transforms[Qe](se)||se;return se}function u(ee,se,De){let $e=se-1,Qe=-1,cn=!1,ui,Pt,St,Qt;for(;++$e<=De;){const tt=ee[$e];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?Qe++:Qe--,Qt=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&(ui&&!Qt&&!Qe&&!St&&(St=$e),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=void 0}if(!Qe&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Qe===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if(ui){let Rt=$e;for(Pt=void 0;Rt--;){const Ft=ee[Rt];if(Ft[1].type==="lineEnding"||Ft[1].type==="lineEndingBlank"){if(Ft[0]==="exit")continue;Pt&&(ee[Pt][1].type="lineEndingBlank",cn=!0),Ft[1].type="lineEnding",Pt=Rt}else if(!(Ft[1].type==="linePrefix"||Ft[1].type==="blockQuotePrefix"||Ft[1].type==="blockQuotePrefixWhitespace"||Ft[1].type==="blockQuoteMarker"||Ft[1].type==="listItemIndent"))break}St&&(!Pt||St<Pt)&&(ui._spread=!0),ui.end=Object.assign({},Pt?ee[Pt][1].start:tt[1].end),ee.splice(Pt||$e,0,["exit",ui,tt[2]]),$e++,De++}if(tt[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};ui=Rt,ee.splice($e,0,["enter",Rt,tt[2]]),$e++,De++,St=void 0,Qt=!0}}}return ee[se][1]._spread=cn,De}function c(ee,se){return De;function De($e){h.call(this,ee($e),$e),se&&se.call(this,$e)}}function d(){this.stack.push({type:"fragment",children:[]})}function h(ee,se,De){this.stack[this.stack.length-1].children.push(ee),this.stack.push(ee),this.tokenStack.push([se,De||void 0]),ee.position={start:ca(se.start),end:void 0}}function g(ee){return se;function se(De){ee&&ee.call(this,De),m.call(this,De)}}function m(ee,se){const De=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==ee.type&&(se?se.call(this,ee,$e[0]):($e[1]||zy).call(this,ee,$e[0]));else throw new Error("Cannot close `"+ee.type+"` ("+xo({start:ee.start,end:ee.end})+"): it’s not open");De.position.end=ca(ee.end)}function b(){return Yp(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function w(ee){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(ee),10),this.data.expectingFirstListItemValue=void 0}}function S(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.lang=ee}function T(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.meta=ee}function L(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function z(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.value=ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function D(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.value=ee.replace(/(\r?\n|\r)$/g,"")}function W(ee){const se=this.resume(),De=this.stack[this.stack.length-1];De.label=se,De.identifier=bi(this.sliceSerialize(ee)).toLowerCase()}function Y(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.title=ee}function K(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.url=ee}function de(ee){const se=this.stack[this.stack.length-1];if(!se.depth){const De=this.sliceSerialize(ee).length;se.depth=De}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function Z(ee){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(ee).codePointAt(0)===61?1:2}function te(){this.data.setextHeadingSlurpLineEnding=void 0}function P(ee){const De=this.stack[this.stack.length-1].children;let $e=De[De.length-1];(!$e||$e.type!=="text")&&($e=At(),$e.position={start:ca(ee.start),end:void 0},De.push($e)),this.stack.push($e)}function $(ee){const se=this.stack.pop();se.value+=this.sliceSerialize(ee),se.position.end=ca(ee.end)}function oe(ee){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=se.children[se.children.length-1];De.position.end=ca(ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(se.type)&&(P.call(this,ee),$.call(this,ee))}function ue(){this.data.atHardBreak=!0}function Te(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.value=ee}function he(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.value=ee}function re(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.value=ee}function H(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=se,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function le(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=se,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function ye(ee){const se=this.sliceSerialize(ee),De=this.stack[this.stack.length-2];De.label=J0(se),De.identifier=bi(se).toLowerCase()}function Ce(){const ee=this.stack[this.stack.length-1],se=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const $e=ee.children;De.children=$e}else De.alt=se}function N(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.url=ee}function C(){const ee=this.resume(),se=this.stack[this.stack.length-1];se.title=ee}function B(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ae(ee){const se=this.resume(),De=this.stack[this.stack.length-1];De.label=se,De.identifier=bi(this.sliceSerialize(ee)).toLowerCase(),this.data.referenceType="full"}function me(ee){this.data.characterReferenceType=ee.type}function fe(ee){const se=this.sliceSerialize(ee),De=this.data.characterReferenceType;let $e;De?($e=rb(se,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=Fp(se);const Qe=this.stack[this.stack.length-1];Qe.value+=$e}function xe(ee){const se=this.stack.pop();se.position.end=ca(ee.end)}function ze(ee){$.call(this,ee);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(ee)}function qe(ee){$.call(this,ee);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(ee)}function Tt(){return{type:"blockquote",children:[]}}function wt(){return{type:"code",lang:null,meta:null,value:""}}function un(){return{type:"inlineCode",value:""}}function bn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function kt(){return{type:"emphasis",children:[]}}function vn(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Vt(){return{type:"html",value:""}}function Zn(){return{type:"image",title:null,url:"",alt:null}}function In(){return{type:"link",title:null,url:"",children:[]}}function oi(ee){return{type:"list",ordered:ee.type==="listOrdered",start:null,spread:ee._spread,children:[]}}function yt(ee){return{type:"listItem",spread:ee._spread,checked:null,children:[]}}function Yt(){return{type:"paragraph",children:[]}}function vi(){return{type:"strong",children:[]}}function At(){return{type:"text",value:""}}function wi(){return{type:"thematicBreak"}}}function ca(t){return{line:t.line,column:t.column,offset:t.offset}}function yb(t,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?yb(t,r):iS(t,r)}}function iS(t,i){let a;for(a in i)if(gb.call(i,a))switch(a){case"canContainEols":{const r=i[a];r&&t[a].push(...r);break}case"transforms":{const r=i[a];r&&t[a].push(...r);break}case"enter":case"exit":{const r=i[a];r&&Object.assign(t[a],r);break}}}function zy(t,i){throw t?new Error("Cannot close `"+t.type+"` ("+xo({start:t.start,end:t.end})+"): a different token (`"+i.type+"`, "+xo({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+xo({start:i.start,end:i.end})+") is still open")}function lS(t){const i=this;i.parser=a;function a(r){return tS(r,{...i.data("settings"),...t,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function aS(t,i){const a={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(i),!0)};return t.patch(i,a),t.applyData(i,a)}function rS(t,i){const a={type:"element",tagName:"br",properties:{},children:[]};return t.patch(i,a),[t.applyData(i,a),{type:"text",value:`
|
|
54
|
+
`}]}function sS(t,i){const a=i.value?i.value+`
|
|
55
|
+
`:"",r={},u=i.lang?i.lang.split(/\s+/):[];u.length>0&&(r.className=["language-"+u[0]]);let c={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return i.meta&&(c.data={meta:i.meta}),t.patch(i,c),c=t.applyData(i,c),c={type:"element",tagName:"pre",properties:{},children:[c]},t.patch(i,c),c}function oS(t,i){const a={type:"element",tagName:"del",properties:{},children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function uS(t,i){const a={type:"element",tagName:"em",properties:{},children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function cS(t,i){const a=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=Zr(r.toLowerCase()),c=t.footnoteOrder.indexOf(r);let d,h=t.footnoteCounts.get(r);h===void 0?(h=0,t.footnoteOrder.push(r),d=t.footnoteOrder.length):d=c+1,h+=1,t.footnoteCounts.set(r,h);const g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+u,id:a+"fnref-"+u+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};t.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return t.patch(i,m),t.applyData(i,m)}function dS(t,i){const a={type:"element",tagName:"h"+i.depth,properties:{},children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function fS(t,i){if(t.options.allowDangerousHtml){const a={type:"raw",value:i.value};return t.patch(i,a),t.applyData(i,a)}}function xb(t,i){const a=i.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+r}];const u=t.all(i),c=u[0];c&&c.type==="text"?c.value="["+c.value:u.unshift({type:"text",value:"["});const d=u[u.length-1];return d&&d.type==="text"?d.value+=r:u.push({type:"text",value:r}),u}function pS(t,i){const a=String(i.identifier).toUpperCase(),r=t.definitionById.get(a);if(!r)return xb(t,i);const u={src:Zr(r.url||""),alt:i.alt};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"img",properties:u,children:[]};return t.patch(i,c),t.applyData(i,c)}function hS(t,i){const a={src:Zr(i.url)};i.alt!==null&&i.alt!==void 0&&(a.alt=i.alt),i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"img",properties:a,children:[]};return t.patch(i,r),t.applyData(i,r)}function mS(t,i){const a={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};t.patch(i,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return t.patch(i,r),t.applyData(i,r)}function gS(t,i){const a=String(i.identifier).toUpperCase(),r=t.definitionById.get(a);if(!r)return xb(t,i);const u={href:Zr(r.url||"")};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"a",properties:u,children:t.all(i)};return t.patch(i,c),t.applyData(i,c)}function yS(t,i){const a={href:Zr(i.url)};i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"a",properties:a,children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function xS(t,i,a){const r=t.all(i),u=a?bS(a):bb(i),c={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let x;b&&b.type==="element"&&b.tagName==="p"?x=b:(x={type:"element",tagName:"p",properties:{},children:[]},r.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let h=-1;for(;++h<r.length;){const b=r[h];(u||h!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
|
|
56
|
+
`}),b.type==="element"&&b.tagName==="p"&&!u?d.push(...b.children):d.push(b)}const g=r[r.length-1];g&&(u||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
|
|
57
|
+
`});const m={type:"element",tagName:"li",properties:c,children:d};return t.patch(i,m),t.applyData(i,m)}function bS(t){let i=!1;if(t.type==="list"){i=t.spread||!1;const a=t.children;let r=-1;for(;!i&&++r<a.length;)i=bb(a[r])}return i}function bb(t){const i=t.spread;return i??t.children.length>1}function vS(t,i){const a={},r=t.all(i);let u=-1;for(typeof i.start=="number"&&i.start!==1&&(a.start=i.start);++u<r.length;){const d=r[u];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:a,children:t.wrap(r,!0)};return t.patch(i,c),t.applyData(i,c)}function wS(t,i){const a={type:"element",tagName:"p",properties:{},children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function kS(t,i){const a={type:"root",children:t.wrap(t.all(i))};return t.patch(i,a),t.applyData(i,a)}function SS(t,i){const a={type:"element",tagName:"strong",properties:{},children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function jS(t,i){const a=t.all(i),r=a.shift(),u=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(i.children[0],d),u.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:t.wrap(a,!0)},h=Hp(i.children[1]),g=Zx(i.children[i.children.length-1]);h&&g&&(d.position={start:h,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:t.wrap(u,!0)};return t.patch(i,c),t.applyData(i,c)}function CS(t,i,a){const r=a?a.children:void 0,c=(r?r.indexOf(i):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,h=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<h;){const x=i.children[g],w={},S=d?d[g]:void 0;S&&(w.align=S);let T={type:"element",tagName:c,properties:w,children:[]};x&&(T.children=t.all(x),t.patch(x,T),T=t.applyData(x,T)),m.push(T)}const b={type:"element",tagName:"tr",properties:{},children:t.wrap(m,!0)};return t.patch(i,b),t.applyData(i,b)}function ES(t,i){const a={type:"element",tagName:"td",properties:{},children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}const Ly=9,Iy=32;function TS(t){const i=String(t),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(Uy(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(Uy(i.slice(u),u>0,!1)),c.join("")}function Uy(t,i,a){let r=0,u=t.length;if(i){let c=t.codePointAt(r);for(;c===Ly||c===Iy;)r++,c=t.codePointAt(r)}if(a){let c=t.codePointAt(u-1);for(;c===Ly||c===Iy;)u--,c=t.codePointAt(u-1)}return u>r?t.slice(r,u):""}function AS(t,i){const a={type:"text",value:TS(String(i.value))};return t.patch(i,a),t.applyData(i,a)}function NS(t,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(i,a),t.applyData(i,a)}const _S={blockquote:aS,break:rS,code:sS,delete:oS,emphasis:uS,footnoteReference:cS,heading:dS,html:fS,imageReference:pS,image:hS,inlineCode:mS,linkReference:gS,link:yS,listItem:xS,list:vS,paragraph:wS,root:kS,strong:SS,table:jS,tableCell:ES,tableRow:CS,text:AS,thematicBreak:NS,toml:rc,yaml:rc,definition:rc,footnoteDefinition:rc};function rc(){}const vb=-1,Nc=0,vo=1,vc=2,Xp=3,Pp=4,Qp=5,Wp=6,wb=7,kb=8,DS=typeof self=="object"?self:globalThis,By=(t,i)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new DS[t](i)},MS=(t,i)=>{const a=(u,c)=>(t.set(c,u),u),r=u=>{if(t.has(u))return t.get(u);const[c,d]=i[u];switch(c){case Nc:case vb:return a(d,u);case vo:{const h=a([],u);for(const g of d)h.push(r(g));return h}case vc:{const h=a({},u);for(const[g,m]of d)h[r(g)]=r(m);return h}case Xp:return a(new Date(d),u);case Pp:{const{source:h,flags:g}=d;return a(new RegExp(h,g),u)}case Qp:{const h=a(new Map,u);for(const[g,m]of d)h.set(r(g),r(m));return h}case Wp:{const h=a(new Set,u);for(const g of d)h.add(r(g));return h}case wb:{const{name:h,message:g}=d;return a(By(h,g),u)}case kb:return a(BigInt(d),u);case"BigInt":return a(Object(BigInt(d)),u);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:h}=new Uint8Array(d);return a(new DataView(h),d)}}return a(By(c,d),u)};return r},qy=t=>MS(new Map,t)(0),Za="",{toString:OS}={},{keys:RS}=Object,so=t=>{const i=typeof t;if(i!=="object"||!t)return[Nc,i];const a=OS.call(t).slice(8,-1);switch(a){case"Array":return[vo,Za];case"Object":return[vc,Za];case"Date":return[Xp,Za];case"RegExp":return[Pp,Za];case"Map":return[Qp,Za];case"Set":return[Wp,Za];case"DataView":return[vo,a]}return a.includes("Array")?[vo,a]:a.includes("Error")?[wb,a]:[vc,a]},sc=([t,i])=>t===Nc&&(i==="function"||i==="symbol"),zS=(t,i,a,r)=>{const u=(d,h)=>{const g=r.push(d)-1;return a.set(h,g),g},c=d=>{if(a.has(d))return a.get(d);let[h,g]=so(d);switch(h){case Nc:{let b=d;switch(g){case"bigint":h=kb,b=d.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([vb],d)}return u([h,b],d)}case vo:{if(g){let w=d;return g==="DataView"?w=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(w=new Uint8Array(d)),u([g,[...w]],d)}const b=[],x=u([h,b],d);for(const w of d)b.push(c(w));return x}case vc:{if(g)switch(g){case"BigInt":return u([g,d.toString()],d);case"Boolean":case"Number":case"String":return u([g,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const b=[],x=u([h,b],d);for(const w of RS(d))(t||!sc(so(d[w])))&&b.push([c(w),c(d[w])]);return x}case Xp:return u([h,isNaN(d.getTime())?Za:d.toISOString()],d);case Pp:{const{source:b,flags:x}=d;return u([h,{source:b,flags:x}],d)}case Qp:{const b=[],x=u([h,b],d);for(const[w,S]of d)(t||!(sc(so(w))||sc(so(S))))&&b.push([c(w),c(S)]);return x}case Wp:{const b=[],x=u([h,b],d);for(const w of d)(t||!sc(so(w)))&&b.push(c(w));return x}}const{message:m}=d;return u([h,{name:g,message:m}],d)};return c},Hy=(t,{json:i,lossy:a}={})=>{const r=[];return zS(!(i||a),!!i,new Map,r)(t),r},wc=typeof structuredClone=="function"?(t,i)=>i&&("json"in i||"lossy"in i)?qy(Hy(t,i)):structuredClone(t):(t,i)=>qy(Hy(t,i));function LS(t,i){const a=[{type:"text",value:"↩"}];return i>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),a}function IS(t,i){return"Back to reference "+(t+1)+(i>1?"-"+i:"")}function US(t){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",a=t.options.footnoteBackContent||LS,r=t.options.footnoteBackLabel||IS,u=t.options.footnoteLabel||"Footnotes",c=t.options.footnoteLabelTagName||"h2",d=t.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let g=-1;for(;++g<t.footnoteOrder.length;){const m=t.footnoteById.get(t.footnoteOrder[g]);if(!m)continue;const b=t.all(m),x=String(m.identifier).toUpperCase(),w=Zr(x.toLowerCase());let S=0;const T=[],L=t.footnoteCounts.get(x);for(;L!==void 0&&++S<=L;){T.length>0&&T.push({type:"text",value:" "});let W=typeof a=="string"?a:a(g,S);typeof W=="string"&&(W={type:"text",value:W}),T.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+w+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,S),className:["data-footnote-backref"]},children:Array.isArray(W)?W:[W]})}const z=b[b.length-1];if(z&&z.type==="element"&&z.tagName==="p"){const W=z.children[z.children.length-1];W&&W.type==="text"?W.value+=" ":z.children.push({type:"text",value:" "}),z.children.push(...T)}else b.push(...T);const D={type:"element",tagName:"li",properties:{id:i+"fn-"+w},children:t.wrap(b,!0)};t.patch(m,D),h.push(D)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...wc(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
|
|
58
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(h,!0)},{type:"text",value:`
|
|
59
|
+
`}]}}const _c=(function(t){if(t==null)return $S;if(typeof t=="function")return Dc(t);if(typeof t=="object")return Array.isArray(t)?BS(t):qS(t);if(typeof t=="string")return HS(t);throw new Error("Expected function, string, or object as test")});function BS(t){const i=[];let a=-1;for(;++a<t.length;)i[a]=_c(t[a]);return Dc(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function qS(t){const i=t;return Dc(a);function a(r){const u=r;let c;for(c in t)if(u[c]!==i[c])return!1;return!0}}function HS(t){return Dc(i);function i(a){return a&&a.type===t}}function Dc(t){return i;function i(a,r,u){return!!(GS(a)&&t.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function $S(){return!0}function GS(t){return t!==null&&typeof t=="object"&&"type"in t}const Sb=[],VS=!0,Sp=!1,YS="skip";function jb(t,i,a,r){let u;typeof i=="function"&&typeof a!="function"?(r=a,a=i):u=i;const c=_c(u),d=r?-1:1;h(t,void 0,[])();function h(g,m,b){const x=g&&typeof g=="object"?g:{};if(typeof x.type=="string"){const S=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(g.type+(S?"<"+S+">":""))+")"})}return w;function w(){let S=Sb,T,L,z;if((!i||c(g,m,b[b.length-1]||void 0))&&(S=FS(a(g,b)),S[0]===Sp))return S;if("children"in g&&g.children){const D=g;if(D.children&&S[0]!==YS)for(L=(r?D.children.length:-1)+d,z=b.concat(D);L>-1&&L<D.children.length;){const W=D.children[L];if(T=h(W,L,z)(),T[0]===Sp)return T;L=typeof T[1]=="number"?T[1]:L+d}}return S}}}function FS(t){return Array.isArray(t)?t:typeof t=="number"?[VS,t]:t==null?Sb:[t]}function Zp(t,i,a,r){let u,c,d;typeof i=="function"&&typeof a!="function"?(c=void 0,d=i,u=a):(c=i,d=a,u=r),jb(t,c,h,u);function h(g,m){const b=m[m.length-1],x=b?b.children.indexOf(g):void 0;return d(g,x,b)}}const jp={}.hasOwnProperty,KS={};function XS(t,i){const a=i||KS,r=new Map,u=new Map,c=new Map,d={..._S,...a.handlers},h={all:m,applyData:QS,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:a,patch:PS,wrap:ZS};return Zp(t,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,w=String(b.identifier).toUpperCase();x.has(w)||x.set(w,b)}}),h;function g(b,x){const w=b.type,S=h.handlers[w];if(jp.call(h.handlers,w)&&S)return S(h,b,x);if(h.options.passThrough&&h.options.passThrough.includes(w)){if("children"in b){const{children:L,...z}=b,D=wc(z);return D.children=h.all(b),D}return wc(b)}return(h.options.unknownHandler||WS)(h,b,x)}function m(b){const x=[];if("children"in b){const w=b.children;let S=-1;for(;++S<w.length;){const T=h.one(w[S],b);if(T){if(S&&w[S-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=$y(T.value)),!Array.isArray(T)&&T.type==="element")){const L=T.children[0];L&&L.type==="text"&&(L.value=$y(L.value))}Array.isArray(T)?x.push(...T):x.push(T)}}}return x}}function PS(t,i){t.position&&(i.position=L1(t))}function QS(t,i){let a=i;if(t&&t.data){const r=t.data.hName,u=t.data.hChildren,c=t.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const d="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:d}}a.type==="element"&&c&&Object.assign(a.properties,wc(c)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function WS(t,i){const a=i.data||{},r="value"in i&&!(jp.call(a,"hProperties")||jp.call(a,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function ZS(t,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
|
|
60
|
+
`});++r<t.length;)r&&a.push({type:"text",value:`
|
|
61
|
+
`}),a.push(t[r]);return i&&t.length>0&&a.push({type:"text",value:`
|
|
62
|
+
`}),a}function $y(t){let i=0,a=t.charCodeAt(i);for(;a===9||a===32;)i++,a=t.charCodeAt(i);return t.slice(i)}function Gy(t,i){const a=XS(t,i),r=a.one(t,void 0),u=US(a),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return u&&c.children.push({type:"text",value:`
|
|
63
|
+
`},u),c}function JS(t,i){return t&&"run"in t?async function(a,r){const u=Gy(a,{file:r,...i});await t.run(u,r)}:function(a,r){return Gy(a,{file:r,...t||i})}}function Vy(t){if(t)throw t}var Bf,Yy;function ej(){if(Yy)return Bf;Yy=1;var t=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=function(m){return typeof Array.isArray=="function"?Array.isArray(m):i.call(m)==="[object Array]"},c=function(m){if(!m||i.call(m)!=="[object Object]")return!1;var b=t.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&t.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!x)return!1;var w;for(w in m);return typeof w>"u"||t.call(m,w)},d=function(m,b){a&&b.name==="__proto__"?a(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},h=function(m,b){if(b==="__proto__")if(t.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return Bf=function g(){var m,b,x,w,S,T,L=arguments[0],z=1,D=arguments.length,W=!1;for(typeof L=="boolean"&&(W=L,L=arguments[1]||{},z=2),(L==null||typeof L!="object"&&typeof L!="function")&&(L={});z<D;++z)if(m=arguments[z],m!=null)for(b in m)x=h(L,b),w=h(m,b),L!==w&&(W&&w&&(c(w)||(S=u(w)))?(S?(S=!1,T=x&&u(x)?x:[]):T=x&&c(x)?x:{},d(L,{name:b,newValue:g(W,T,w)})):typeof w<"u"&&d(L,{name:b,newValue:w}));return L},Bf}var tj=ej();const qf=Vx(tj);function Cp(t){if(typeof t!="object"||t===null)return!1;const i=Object.getPrototypeOf(t);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function nj(){const t=[],i={run:a,use:r};return i;function a(...u){let c=-1;const d=u.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);h(null,...u);function h(g,...m){const b=t[++c];let x=-1;if(g){d(g);return}for(;++x<u.length;)(m[x]===null||m[x]===void 0)&&(m[x]=u[x]);u=m,b?ij(b,h)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return t.push(u),i}}function ij(t,i){let a;return r;function r(...d){const h=t.length>d.length;let g;h&&d.push(u);try{g=t.apply(this,d)}catch(m){const b=m;if(h&&a)throw b;return u(b)}h||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...h){a||(a=!0,i(d,...h))}function c(d){u(null,d)}}const Bi={basename:lj,dirname:aj,extname:rj,join:sj,sep:"/"};function lj(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');_o(t);let a=0,r=-1,u=t.length,c;if(i===void 0||i.length===0||i.length>t.length){for(;u--;)if(t.codePointAt(u)===47){if(c){a=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":t.slice(a,r)}if(i===t)return"";let d=-1,h=i.length-1;for(;u--;)if(t.codePointAt(u)===47){if(c){a=u+1;break}}else d<0&&(c=!0,d=u+1),h>-1&&(t.codePointAt(u)===i.codePointAt(h--)?h<0&&(r=u):(h=-1,r=d));return a===r?r=d:r<0&&(r=t.length),t.slice(a,r)}function aj(t){if(_o(t),t.length===0)return".";let i=-1,a=t.length,r;for(;--a;)if(t.codePointAt(a)===47){if(r){i=a;break}}else r||(r=!0);return i<0?t.codePointAt(0)===47?"/":".":i===1&&t.codePointAt(0)===47?"//":t.slice(0,i)}function rj(t){_o(t);let i=t.length,a=-1,r=0,u=-1,c=0,d;for(;i--;){const h=t.codePointAt(i);if(h===47){if(d){r=i+1;break}continue}a<0&&(d=!0,a=i+1),h===46?u<0?u=i:c!==1&&(c=1):u>-1&&(c=-1)}return u<0||a<0||c===0||c===1&&u===a-1&&u===r+1?"":t.slice(u,a)}function sj(...t){let i=-1,a;for(;++i<t.length;)_o(t[i]),t[i]&&(a=a===void 0?t[i]:a+"/"+t[i]);return a===void 0?".":oj(a)}function oj(t){_o(t);const i=t.codePointAt(0)===47;let a=uj(t,!i);return a.length===0&&!i&&(a="."),a.length>0&&t.codePointAt(t.length-1)===47&&(a+="/"),i?"/"+a:a}function uj(t,i){let a="",r=0,u=-1,c=0,d=-1,h,g;for(;++d<=t.length;){if(d<t.length)h=t.codePointAt(d);else{if(h===47)break;h=47}if(h===47){if(!(u===d-1||c===1))if(u!==d-1&&c===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(g=a.lastIndexOf("/"),g!==a.length-1){g<0?(a="",r=0):(a=a.slice(0,g),r=a.length-1-a.lastIndexOf("/")),u=d,c=0;continue}}else if(a.length>0){a="",r=0,u=d,c=0;continue}}i&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+t.slice(u+1,d):a=t.slice(u+1,d),r=d-u-1;u=d,c=0}else h===46&&c>-1?c++:c=-1}return a}function _o(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const cj={cwd:dj};function dj(){return"/"}function Ep(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function fj(t){if(typeof t=="string")t=new URL(t);else if(!Ep(t)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(t.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return pj(t)}function pj(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const i=t.pathname;let a=-1;for(;++a<i.length;)if(i.codePointAt(a)===37&&i.codePointAt(a+1)===50){const r=i.codePointAt(a+2);if(r===70||r===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(i)}const Hf=["history","path","basename","stem","extname","dirname"];class Cb{constructor(i){let a;i?Ep(i)?a={path:i}:typeof i=="string"||hj(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":cj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Hf.length;){const c=Hf[r];c in a&&a[c]!==void 0&&a[c]!==null&&(this[c]=c==="history"?[...a[c]]:a[c])}let u;for(u in a)Hf.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?Bi.basename(this.path):void 0}set basename(i){Gf(i,"basename"),$f(i,"basename"),this.path=Bi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Bi.dirname(this.path):void 0}set dirname(i){Fy(this.basename,"dirname"),this.path=Bi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Bi.extname(this.path):void 0}set extname(i){if($f(i,"extname"),Fy(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Bi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Ep(i)&&(i=fj(i)),Gf(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Bi.basename(this.path,this.extname):void 0}set stem(i){Gf(i,"stem"),$f(i,"stem"),this.path=Bi.join(this.dirname||"",i+(this.extname||""))}fail(i,a,r){const u=this.message(i,a,r);throw u.fatal=!0,u}info(i,a,r){const u=this.message(i,a,r);return u.fatal=void 0,u}message(i,a,r){const u=new on(i,a,r);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function $f(t,i){if(t&&t.includes(Bi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Bi.sep+"`")}function Gf(t,i){if(!t)throw new Error("`"+i+"` cannot be empty")}function Fy(t,i){if(!t)throw new Error("Setting `"+i+"` requires `path` to be set too")}function hj(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const mj=(function(t){const r=this.constructor.prototype,u=r[t],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),gj={}.hasOwnProperty;class Jp extends mj{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=nj()}copy(){const i=new Jp;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(qf(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(Ff("data",this.frozen),this.namespace[i]=a,this):gj.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Ff("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=a.call(i,...r);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const a=oc(i),r=this.parser||this.Parser;return Vf("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),Vf("process",this.parser||this.Parser),Yf("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const h=oc(i),g=r.parse(h);r.run(g,h,function(b,x,w){if(b||!x||!w)return m(b);const S=x,T=r.stringify(S,w);bj(T)?w.value=T:w.result=T,m(b,w)});function m(b,x){b||!x?d(b):c?c(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),Vf("processSync",this.parser||this.Parser),Yf("processSync",this.compiler||this.Compiler),this.process(i,u),Xy("processSync","process",a),r;function u(c,d){a=!0,Vy(c),r=d}}run(i,a,r){Ky(i),this.freeze();const u=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?c(void 0,r):new Promise(c);function c(d,h){const g=oc(a);u.run(i,g,m);function m(b,x,w){const S=x||i;b?h(b):d?d(S):r(void 0,S,w)}}}runSync(i,a){let r=!1,u;return this.run(i,a,c),Xy("runSync","run",r),u;function c(d,h){Vy(d),u=h,r=!0}}stringify(i,a){this.freeze();const r=oc(a),u=this.compiler||this.Compiler;return Yf("stringify",u),Ky(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(Ff("use",this.frozen),i!=null)if(typeof i=="function")g(i,a);else if(typeof i=="object")Array.isArray(i)?h(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;g(b,x)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))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(m.plugins),m.settings&&(u.settings=qf(!0,u.settings,m.settings))}function h(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const x=m[b];c(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function g(m,b){let x=-1,w=-1;for(;++x<r.length;)if(r[x][0]===m){w=x;break}if(w===-1)r.push([m,...b]);else if(b.length>0){let[S,...T]=b;const L=r[w][1];Cp(L)&&Cp(S)&&(S=qf(!0,L,S)),r[w]=[m,S,...T]}}}}const yj=new Jp().freeze();function Vf(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Yf(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Ff(t,i){if(i)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ky(t){if(!Cp(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Xy(t,i,a){if(!a)throw new Error("`"+t+"` finished async. Use `"+i+"` instead")}function oc(t){return xj(t)?t:new Cb(t)}function xj(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function bj(t){return typeof t=="string"||vj(t)}function vj(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const wj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Py=[],Qy={allowDangerousHtml:!0},kj=/^(https?|ircs?|mailto|xmpp)$/i,Sj=[{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 jj(t){const i=Cj(t),a=Ej(t);return Tj(i.runSync(i.parse(a),a),t)}function Cj(t){const i=t.rehypePlugins||Py,a=t.remarkPlugins||Py,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Qy}:Qy;return yj().use(lS).use(a).use(JS,r).use(i)}function Ej(t){const i=t.children||"",a=new Cb;return typeof i=="string"&&(a.value=i),a}function Tj(t,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,h=i.unwrapDisallowed,g=i.urlTransform||Aj;for(const b of Sj)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+wj+b.id,void 0);return Zp(t,m),H1(t,{Fragment:o.Fragment,components:u,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function m(b,x,w){if(b.type==="raw"&&w&&typeof x=="number")return d?w.children.splice(x,1):w.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let S;for(S in Lf)if(Object.hasOwn(Lf,S)&&Object.hasOwn(b.properties,S)){const T=b.properties[S],L=Lf[S];(L===null||L.includes(b.tagName))&&(b.properties[S]=g(String(T||""),S,b))}}if(b.type==="element"){let S=a?!a.includes(b.tagName):c?c.includes(b.tagName):!1;if(!S&&r&&typeof x=="number"&&(S=!r(b,x,w)),S&&w&&typeof x=="number")return h&&b.children?w.children.splice(x,1,...b.children):w.children.splice(x,1),x}}}function Aj(t){const i=t.indexOf(":"),a=t.indexOf("?"),r=t.indexOf("#"),u=t.indexOf("/");return i===-1||u!==-1&&i>u||a!==-1&&i>a||r!==-1&&i>r||kj.test(t.slice(0,i))?t:""}function Wy(t,i){const a=String(t);if(typeof i!="string")throw new TypeError("Expected character");let r=0,u=a.indexOf(i);for(;u!==-1;)r++,u=a.indexOf(i,u+i.length);return r}function Nj(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _j(t,i,a){const u=_c((a||{}).ignore||[]),c=Dj(i);let d=-1;for(;++d<c.length;)jb(t,"text",h);function h(m,b){let x=-1,w;for(;++x<b.length;){const S=b[x],T=w?w.children:void 0;if(u(S,T?T.indexOf(S):void 0,w))return;w=S}if(w)return g(m,b)}function g(m,b){const x=b[b.length-1],w=c[d][0],S=c[d][1];let T=0;const z=x.children.indexOf(m);let D=!1,W=[];w.lastIndex=0;let Y=w.exec(m.value);for(;Y;){const K=Y.index,de={index:Y.index,input:Y.input,stack:[...b,m]};let _=S(...Y,de);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?w.lastIndex=K+1:(T!==K&&W.push({type:"text",value:m.value.slice(T,K)}),Array.isArray(_)?W.push(..._):_&&W.push(_),T=K+Y[0].length,D=!0),!w.global)break;Y=w.exec(m.value)}return D?(T<m.value.length&&W.push({type:"text",value:m.value.slice(T)}),x.children.splice(z,1,...W)):W=[m],z+W.length}}function Dj(t){const i=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<a.length;){const u=a[r];i.push([Mj(u[0]),Oj(u[1])])}return i}function Mj(t){return typeof t=="string"?new RegExp(Nj(t),"g"):t}function Oj(t){return typeof t=="function"?t:function(){return t}}const Kf="phrasing",Xf=["autolink","link","image","label"];function Rj(){return{transforms:[Hj],enter:{literalAutolink:Lj,literalAutolinkEmail:Pf,literalAutolinkHttp:Pf,literalAutolinkWww:Pf},exit:{literalAutolink:qj,literalAutolinkEmail:Bj,literalAutolinkHttp:Ij,literalAutolinkWww:Uj}}}function zj(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Kf,notInConstruct:Xf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Kf,notInConstruct:Xf},{character:":",before:"[ps]",after:"\\/",inConstruct:Kf,notInConstruct:Xf}]}}function Lj(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Pf(t){this.config.enter.autolinkProtocol.call(this,t)}function Ij(t){this.config.exit.autolinkProtocol.call(this,t)}function Uj(t){this.config.exit.data.call(this,t);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(t)}function Bj(t){this.config.exit.autolinkEmail.call(this,t)}function qj(t){this.exit(t)}function Hj(t){_j(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$j],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Gj]],{ignore:["link","linkReference"]})}function $j(t,i,a,r,u){let c="";if(!Eb(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!Vj(a)))return!1;const d=Yj(a+r);if(!d[0])return!1;const h={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[h,{type:"text",value:d[1]}]:h}function Gj(t,i,a,r){return!Eb(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function Vj(t){const i=t.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function Yj(t){const i=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!i)return[t,void 0];t=t.slice(0,i.index);let a=i[0],r=a.indexOf(")");const u=Wy(t,"(");let c=Wy(t,")");for(;r!==-1&&u>c;)t+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),c++;return[t,a]}function Eb(t,i){const a=t.input.charCodeAt(t.index-1);return(t.index===0||nr(a)||Tc(a))&&(!i||a!==47)}Tb.peek=eC;function Fj(){this.buffer()}function Kj(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Xj(){this.buffer()}function Pj(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Qj(t){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=bi(this.sliceSerialize(t)).toLowerCase(),a.label=i}function Wj(t){this.exit(t)}function Zj(t){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=bi(this.sliceSerialize(t)).toLowerCase(),a.label=i}function Jj(t){this.exit(t)}function eC(){return"["}function Tb(t,i,a,r){const u=a.createTracker(r);let c=u.move("[^");const d=a.enter("footnoteReference"),h=a.enter("reference");return c+=u.move(a.safe(a.associationId(t),{after:"]",before:c})),h(),d(),c+=u.move("]"),c}function tC(){return{enter:{gfmFootnoteCallString:Fj,gfmFootnoteCall:Kj,gfmFootnoteDefinitionLabelString:Xj,gfmFootnoteDefinition:Pj},exit:{gfmFootnoteCallString:Qj,gfmFootnoteCall:Wj,gfmFootnoteDefinitionLabelString:Zj,gfmFootnoteDefinition:Jj}}}function nC(t){let i=!1;return t&&t.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:Tb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const h=c.createTracker(d);let g=h.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=h.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=h.move("]:"),r.children&&r.children.length>0&&(h.shift(4),g+=h.move((i?`
|
|
64
|
+
`:" ")+c.indentLines(c.containerFlow(r,h.current()),i?Ab:iC))),m(),g}}function iC(t,i,a){return i===0?t:Ab(t,i,a)}function Ab(t,i,a){return(a?"":" ")+t}const lC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Nb.peek=uC;function aC(){return{canContainEols:["delete"],enter:{strikethrough:sC},exit:{strikethrough:oC}}}function rC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:lC}],handlers:{delete:Nb}}}function sC(t){this.enter({type:"delete",children:[]},t)}function oC(t){this.exit(t)}function Nb(t,i,a,r){const u=a.createTracker(r),c=a.enter("strikethrough");let d=u.move("~~");return d+=a.containerPhrasing(t,{...u.current(),before:d,after:"~"}),d+=u.move("~~"),c(),d}function uC(){return"~"}function cC(t){return t.length}function dC(t,i){const a=i||{},r=(a.align||[]).concat(),u=a.stringLength||cC,c=[],d=[],h=[],g=[];let m=0,b=-1;for(;++b<t.length;){const L=[],z=[];let D=-1;for(t[b].length>m&&(m=t[b].length);++D<t[b].length;){const W=fC(t[b][D]);if(a.alignDelimiters!==!1){const Y=u(W);z[D]=Y,(g[D]===void 0||Y>g[D])&&(g[D]=Y)}L.push(W)}d[b]=L,h[b]=z}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=Zy(r[x]);else{const L=Zy(r);for(;++x<m;)c[x]=L}x=-1;const w=[],S=[];for(;++x<m;){const L=c[x];let z="",D="";L===99?(z=":",D=":"):L===108?z=":":L===114&&(D=":");let W=a.alignDelimiters===!1?1:Math.max(1,g[x]-z.length-D.length);const Y=z+"-".repeat(W)+D;a.alignDelimiters!==!1&&(W=z.length+W+D.length,W>g[x]&&(g[x]=W),S[x]=W),w[x]=Y}d.splice(1,0,w),h.splice(1,0,S),b=-1;const T=[];for(;++b<d.length;){const L=d[b],z=h[b];x=-1;const D=[];for(;++x<m;){const W=L[x]||"";let Y="",K="";if(a.alignDelimiters!==!1){const de=g[x]-(z[x]||0),_=c[x];_===114?Y=" ".repeat(de):_===99?de%2?(Y=" ".repeat(de/2+.5),K=" ".repeat(de/2-.5)):(Y=" ".repeat(de/2),K=Y):K=" ".repeat(de)}a.delimiterStart!==!1&&!x&&D.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&W==="")&&(a.delimiterStart!==!1||x)&&D.push(" "),a.alignDelimiters!==!1&&D.push(Y),D.push(W),a.alignDelimiters!==!1&&D.push(K),a.padding!==!1&&D.push(" "),(a.delimiterEnd!==!1||x!==m-1)&&D.push("|")}T.push(a.delimiterEnd===!1?D.join("").replace(/ +$/,""):D.join(""))}return T.join(`
|
|
65
|
+
`)}function fC(t){return t==null?"":String(t)}function Zy(t){const i=typeof t=="string"?t.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}function pC(t,i,a,r){const u=a.enter("blockquote"),c=a.createTracker(r);c.move("> "),c.shift(2);const d=a.indentLines(a.containerFlow(t,c.current()),hC);return u(),d}function hC(t,i,a){return">"+(a?"":" ")+t}function mC(t,i){return Jy(t,i.inConstruct,!0)&&!Jy(t,i.notInConstruct,!1)}function Jy(t,i,a){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return a;let r=-1;for(;++r<i.length;)if(t.includes(i[r]))return!0;return!1}function ex(t,i,a,r){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
|
|
66
|
+
`&&mC(a.stack,a.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
67
|
+
`}function gC(t,i){const a=String(t);let r=a.indexOf(i),u=r,c=0,d=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===u?++c>d&&(d=c):c=1,u=r+i.length,r=a.indexOf(i,u);return d}function yC(t,i){return!!(i.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function xC(t){const i=t.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function bC(t,i,a,r){const u=xC(a),c=t.value||"",d=u==="`"?"GraveAccent":"Tilde";if(yC(t,a)){const x=a.enter("codeIndented"),w=a.indentLines(c,vC);return x(),w}const h=a.createTracker(r),g=u.repeat(Math.max(gC(c,u)+1,3)),m=a.enter("codeFenced");let b=h.move(g);if(t.lang){const x=a.enter(`codeFencedLang${d}`);b+=h.move(a.safe(t.lang,{before:b,after:" ",encode:["`"],...h.current()})),x()}if(t.lang&&t.meta){const x=a.enter(`codeFencedMeta${d}`);b+=h.move(" "),b+=h.move(a.safe(t.meta,{before:b,after:`
|
|
68
|
+
`,encode:["`"],...h.current()})),x()}return b+=h.move(`
|
|
69
|
+
`),c&&(b+=h.move(c+`
|
|
70
|
+
`)),b+=h.move(g),m(),b}function vC(t,i,a){return(a?"":" ")+t}function eh(t){const i=t.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function wC(t,i,a,r){const u=eh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("definition");let h=a.enter("label");const g=a.createTracker(r);let m=g.move("[");return m+=g.move(a.safe(a.associationId(t),{before:m,after:"]",...g.current()})),m+=g.move("]: "),h(),!t.url||/[\0- \u007F]/.test(t.url)?(h=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(t.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(h=a.enter("destinationRaw"),m+=g.move(a.safe(t.url,{before:m,after:t.title?" ":`
|
|
71
|
+
`,...g.current()}))),h(),t.title&&(h=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(t.title,{before:m,after:u,...g.current()})),m+=g.move(u),h()),d(),m}function kC(t){const i=t.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function Eo(t){return"&#x"+t.toString(16).toUpperCase()+";"}function kc(t,i,a){const r=Qr(t),u=Qr(i);return r===void 0?u===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_b.peek=SC;function _b(t,i,a,r){const u=kC(a),c=a.enter("emphasis"),d=a.createTracker(r),h=d.move(u);let g=d.move(a.containerPhrasing(t,{after:u,before:h,...d.current()}));const m=g.charCodeAt(0),b=kc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Eo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),w=kc(r.after.charCodeAt(0),x,u);w.inside&&(g=g.slice(0,-1)+Eo(x));const S=d.move(u);return c(),a.attentionEncodeSurroundingInfo={after:w.outside,before:b.outside},h+g+S}function SC(t,i,a){return a.options.emphasis||"*"}function jC(t,i){let a=!1;return Zp(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,Sp}),!!((!t.depth||t.depth<3)&&Yp(t)&&(i.options.setext||a))}function CC(t,i,a,r){const u=Math.max(Math.min(6,t.depth||1),1),c=a.createTracker(r);if(jC(t,a)){const b=a.enter("headingSetext"),x=a.enter("phrasing"),w=a.containerPhrasing(t,{...c.current(),before:`
|
|
72
|
+
`,after:`
|
|
73
|
+
`});return x(),b(),w+`
|
|
74
|
+
`+(u===1?"=":"-").repeat(w.length-(Math.max(w.lastIndexOf("\r"),w.lastIndexOf(`
|
|
75
|
+
`))+1))}const d="#".repeat(u),h=a.enter("headingAtx"),g=a.enter("phrasing");c.move(d+" ");let m=a.containerPhrasing(t,{before:"# ",after:`
|
|
76
|
+
`,...c.current()});return/^[\t ]/.test(m)&&(m=Eo(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,a.options.closeAtx&&(m+=" "+d),g(),h(),m}Db.peek=EC;function Db(t){return t.value||""}function EC(){return"<"}Mb.peek=TC;function Mb(t,i,a,r){const u=eh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let h=a.enter("label");const g=a.createTracker(r);let m=g.move("![");return m+=g.move(a.safe(t.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),h(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(h=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(t.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(h=a.enter("destinationRaw"),m+=g.move(a.safe(t.url,{before:m,after:t.title?" ":")",...g.current()}))),h(),t.title&&(h=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(t.title,{before:m,after:u,...g.current()})),m+=g.move(u),h()),m+=g.move(")"),d(),m}function TC(){return"!"}Ob.peek=AC;function Ob(t,i,a,r){const u=t.referenceType,c=a.enter("imageReference");let d=a.enter("label");const h=a.createTracker(r);let g=h.move("![");const m=a.safe(t.alt,{before:g,after:"]",...h.current()});g+=h.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(t),{before:g,after:"]",...h.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=h.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function AC(){return"!"}Rb.peek=NC;function Rb(t,i,a){let r=t.value||"",u="`",c=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(r);)u+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++c<a.unsafe.length;){const d=a.unsafe[c],h=a.compilePattern(d);let g;if(d.atBreak)for(;g=h.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function NC(){return"`"}function zb(t,i){const a=Yp(t);return!!(!i.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(a===t.url||"mailto:"+a===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Lb.peek=_C;function Lb(t,i,a,r){const u=eh(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let h,g;if(zb(t,a)){const b=a.stack;a.stack=[],h=a.enter("autolink");let x=d.move("<");return x+=d.move(a.containerPhrasing(t,{before:x,after:">",...d.current()})),x+=d.move(">"),h(),a.stack=b,x}h=a.enter("link"),g=a.enter("label");let m=d.move("[");return m+=d.move(a.containerPhrasing(t,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(g=a.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(a.safe(t.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=a.enter("destinationRaw"),m+=d.move(a.safe(t.url,{before:m,after:t.title?" ":")",...d.current()}))),g(),t.title&&(g=a.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(a.safe(t.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),h(),m}function _C(t,i,a){return zb(t,a)?"<":"["}Ib.peek=DC;function Ib(t,i,a,r){const u=t.referenceType,c=a.enter("linkReference");let d=a.enter("label");const h=a.createTracker(r);let g=h.move("[");const m=a.containerPhrasing(t,{before:g,after:"]",...h.current()});g+=h.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(t),{before:g,after:"]",...h.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=h.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function DC(){return"["}function th(t){const i=t.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function MC(t){const i=th(t),a=t.options.bulletOther;if(!a)return i==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+a+"`) to be different");return a}function OC(t){const i=t.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function Ub(t){const i=t.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function RC(t,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=t.ordered?OC(a):th(a);const h=t.ordered?d==="."?")":".":MC(a);let g=i&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!t.ordered){const b=t.children?t.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(g=!0),Ub(a)===d&&b){let x=-1;for(;++x<t.children.length;){const w=t.children[x];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=h),a.bulletCurrent=d;const m=a.containerFlow(t,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),m}function zC(t){const i=t.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function LC(t,i,a,r){const u=zC(a);let c=a.bulletCurrent||th(a);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(t))+c);let d=c.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||t.spread))&&(d=Math.ceil(d/4)*4);const h=a.createTracker(r);h.move(c+" ".repeat(d-c.length)),h.shift(d);const g=a.enter("listItem"),m=a.indentLines(a.containerFlow(t,h.current()),b);return g(),m;function b(x,w,S){return w?(S?"":" ".repeat(d))+x:(S?c:c+" ".repeat(d-c.length))+x}}function IC(t,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(t,r);return c(),u(),d}const UC=_c(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function BC(t,i,a,r){return(t.children.some(function(d){return UC(d)})?a.containerPhrasing:a.containerFlow).call(a,t,r)}function qC(t){const i=t.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}Bb.peek=HC;function Bb(t,i,a,r){const u=qC(a),c=a.enter("strong"),d=a.createTracker(r),h=d.move(u+u);let g=d.move(a.containerPhrasing(t,{after:u,before:h,...d.current()}));const m=g.charCodeAt(0),b=kc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Eo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),w=kc(r.after.charCodeAt(0),x,u);w.inside&&(g=g.slice(0,-1)+Eo(x));const S=d.move(u+u);return c(),a.attentionEncodeSurroundingInfo={after:w.outside,before:b.outside},h+g+S}function HC(t,i,a){return a.options.strong||"*"}function $C(t,i,a,r){return a.safe(t.value,r)}function GC(t){const i=t.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function VC(t,i,a){const r=(Ub(a)+(a.options.ruleSpaces?" ":"")).repeat(GC(a));return a.options.ruleSpaces?r.slice(0,-1):r}const qb={blockquote:pC,break:ex,code:bC,definition:wC,emphasis:_b,hardBreak:ex,heading:CC,html:Db,image:Mb,imageReference:Ob,inlineCode:Rb,link:Lb,linkReference:Ib,list:RC,listItem:LC,paragraph:IC,root:BC,strong:Bb,text:$C,thematicBreak:VC};function YC(){return{enter:{table:FC,tableData:tx,tableHeader:tx,tableRow:XC},exit:{codeText:PC,table:KC,tableData:Qf,tableHeader:Qf,tableRow:Qf}}}function FC(t){const i=t._align;this.enter({type:"table",align:i.map(function(a){return a==="none"?null:a}),children:[]},t),this.data.inTable=!0}function KC(t){this.exit(t),this.data.inTable=void 0}function XC(t){this.enter({type:"tableRow",children:[]},t)}function Qf(t){this.exit(t)}function tx(t){this.enter({type:"tableCell",children:[]},t)}function PC(t){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,QC));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(t)}function QC(t,i){return i==="|"?i:t}function WC(t){const i=t||{},a=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
77
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:d,tableCell:g,tableRow:h}};function d(S,T,L,z){return m(b(S,L,z),S.align)}function h(S,T,L,z){const D=x(S,L,z),W=m([D]);return W.slice(0,W.indexOf(`
|
|
78
|
+
`))}function g(S,T,L,z){const D=L.enter("tableCell"),W=L.enter("phrasing"),Y=L.containerPhrasing(S,{...z,before:c,after:c});return W(),D(),Y}function m(S,T){return dC(S,{align:T,alignDelimiters:r,padding:a,stringLength:u})}function b(S,T,L){const z=S.children;let D=-1;const W=[],Y=T.enter("table");for(;++D<z.length;)W[D]=x(z[D],T,L);return Y(),W}function x(S,T,L){const z=S.children;let D=-1;const W=[],Y=T.enter("tableRow");for(;++D<z.length;)W[D]=g(z[D],S,T,L);return Y(),W}function w(S,T,L){let z=qb.inlineCode(S,T,L);return L.stack.includes("tableCell")&&(z=z.replace(/\|/g,"\\$&")),z}}function ZC(){return{exit:{taskListCheckValueChecked:nx,taskListCheckValueUnchecked:nx,paragraph:eE}}}function JC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:tE}}}function nx(t){const i=this.stack[this.stack.length-2];i.type,i.checked=t.type==="taskListCheckValueChecked"}function eE(t){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const u=i.children;let c=-1,d;for(;++c<u.length;){const h=u[c];if(h.type==="paragraph"){d=h;break}}d===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function tE(t,i,a,r){const u=t.children[0],c=typeof t.checked=="boolean"&&u&&u.type==="paragraph",d="["+(t.checked?"x":" ")+"] ",h=a.createTracker(r);c&&h.move(d);let g=qb.listItem(t,i,a,{...r,...h.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function nE(){return[Rj(),tC(),aC(),YC(),ZC()]}function iE(t){return{extensions:[zj(),nC(t),rC(),WC(t),JC()]}}const lE={tokenize:cE,partial:!0},Hb={tokenize:dE,partial:!0},$b={tokenize:fE,partial:!0},Gb={tokenize:pE,partial:!0},aE={tokenize:hE,partial:!0},Vb={name:"wwwAutolink",tokenize:oE,previous:Fb},Yb={name:"protocolAutolink",tokenize:uE,previous:Kb},Sl={name:"emailAutolink",tokenize:sE,previous:Xb},Hi={};function rE(){return{text:Hi}}let Qa=48;for(;Qa<123;)Hi[Qa]=Sl,Qa++,Qa===58?Qa=65:Qa===91&&(Qa=97);Hi[43]=Sl;Hi[45]=Sl;Hi[46]=Sl;Hi[95]=Sl;Hi[72]=[Sl,Yb];Hi[104]=[Sl,Yb];Hi[87]=[Sl,Vb];Hi[119]=[Sl,Vb];function sE(t,i,a){const r=this;let u,c;return d;function d(x){return!Tp(x)||!Xb.call(r,r.previous)||nh(r.events)?a(x):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),h(x))}function h(x){return Tp(x)?(t.consume(x),h):x===64?(t.consume(x),g):a(x)}function g(x){return x===46?t.check(aE,b,m)(x):x===45||x===95||sn(x)?(c=!0,t.consume(x),g):b(x)}function m(x){return t.consume(x),u=!0,g}function b(x){return c&&u&&xn(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),i(x)):a(x)}}function oE(t,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!Fb.call(r,r.previous)||nh(r.events)?a(d):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(lE,t.attempt(Hb,t.attempt($b,c),a),a)(d))}function c(d){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),i(d)}}function uE(t,i,a){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&Kb.call(r,r.previous)&&!nh(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),t.consume(x),h):a(x)}function h(x){if(xn(x)&&u.length<5)return u+=String.fromCodePoint(x),t.consume(x),h;if(x===58){const w=u.toLowerCase();if(w==="http"||w==="https")return t.consume(x),g}return a(x)}function g(x){return x===47?(t.consume(x),c?m:(c=!0,g)):a(x)}function m(x){return x===null||bc(x)||ht(x)||nr(x)||Tc(x)?a(x):t.attempt(Hb,t.attempt($b,b),a)(x)}function b(x){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),i(x)}}function cE(t,i,a){let r=0;return u;function u(d){return(d===87||d===119)&&r<3?(r++,t.consume(d),u):d===46&&r===3?(t.consume(d),c):a(d)}function c(d){return d===null?a(d):i(d)}}function dE(t,i,a){let r,u,c;return d;function d(m){return m===46||m===95?t.check(Gb,g,h)(m):m===null||ht(m)||nr(m)||m!==45&&Tc(m)?g(m):(c=!0,t.consume(m),d)}function h(m){return m===95?r=!0:(u=r,r=void 0),t.consume(m),d}function g(m){return u||r||!c?a(m):i(m)}}function fE(t,i){let a=0,r=0;return u;function u(d){return d===40?(a++,t.consume(d),u):d===41&&r<a?c(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?t.check(Gb,i,c)(d):d===null||ht(d)||nr(d)?i(d):(t.consume(d),u)}function c(d){return d===41&&r++,t.consume(d),u}}function pE(t,i,a){return r;function r(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),r):h===38?(t.consume(h),c):h===93?(t.consume(h),u):h===60||h===null||ht(h)||nr(h)?i(h):a(h)}function u(h){return h===null||h===40||h===91||ht(h)||nr(h)?i(h):r(h)}function c(h){return xn(h)?d(h):a(h)}function d(h){return h===59?(t.consume(h),r):xn(h)?(t.consume(h),d):a(h)}}function hE(t,i,a){return r;function r(c){return t.consume(c),u}function u(c){return sn(c)?a(c):i(c)}}function Fb(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ht(t)}function Kb(t){return!xn(t)}function Xb(t){return!(t===47||Tp(t))}function Tp(t){return t===43||t===45||t===46||t===95||sn(t)}function nh(t){let i=t.length,a=!1;for(;i--;){const r=t[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return t.length>0&&!a&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const mE={tokenize:SE,partial:!0};function gE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:vE,continuation:{tokenize:wE},exit:kE}},text:{91:{name:"gfmFootnoteCall",tokenize:bE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yE,resolveTo:xE}}}}function yE(t,i,a){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const g=r.events[u][1];if(g.type==="labelImage"){d=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(!d||!d._balanced)return a(g);const m=bi(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(g):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),i(g))}}function xE(t,i){let a=t.length;for(;a--;)if(t[a][1].type==="labelImage"&&t[a][0]==="enter"){t[a][1];break}t[a+1][1].type="data",t[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[a+3][1].start),end:Object.assign({},t[t.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},t[a+3][1].end),end:Object.assign({},t[a+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},t[t.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},h=[t[a+1],t[a+2],["enter",r,i],t[a+3],t[a+4],["enter",u,i],["exit",u,i],["enter",c,i],["enter",d,i],["exit",d,i],["exit",c,i],t[t.length-2],t[t.length-1],["exit",r,i]];return t.splice(a,t.length-a+1,...h),t}function bE(t,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return h;function h(x){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?a(x):(t.enter("gfmFootnoteCallMarker"),t.consume(x),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",m)}function m(x){if(c>999||x===93&&!d||x===null||x===91||ht(x))return a(x);if(x===93){t.exit("chunkString");const w=t.exit("gfmFootnoteCallString");return u.includes(bi(r.sliceSerialize(w)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),i):a(x)}return ht(x)||(d=!0),c++,t.consume(x),x===92?b:m}function b(x){return x===91||x===92||x===93?(t.consume(x),c++,m):m(x)}}function vE(t,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,h;return g;function g(T){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(T){return T===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",b):a(T)}function b(T){if(d>999||T===93&&!h||T===null||T===91||ht(T))return a(T);if(T===93){t.exit("chunkString");const L=t.exit("gfmFootnoteDefinitionLabelString");return c=bi(r.sliceSerialize(L)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),w}return ht(T)||(h=!0),d++,t.consume(T),T===92?x:b}function x(T){return T===91||T===92||T===93?(t.consume(T),d++,b):b(T)}function w(T){return T===58?(t.enter("definitionMarker"),t.consume(T),t.exit("definitionMarker"),u.includes(c)||u.push(c),Pe(t,S,"gfmFootnoteDefinitionWhitespace")):a(T)}function S(T){return i(T)}}function wE(t,i,a){return t.check(No,i,t.attempt(mE,i,a))}function kE(t){t.exit("gfmFootnoteDefinition")}function SE(t,i,a){const r=this;return Pe(t,u,"gfmFootnoteDefinitionIndent",5);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(c):a(c)}}function jE(t){let a=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:u};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(d,h){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},w=[["enter",b,h],["enter",d[m][1],h],["exit",d[m][1],h],["enter",x,h]],S=h.parser.constructs.insideSpan.null;S&&Wn(w,w.length,0,Ac(S,d.slice(m+1,g),h)),Wn(w,w.length,0,[["exit",x,h],["enter",d[g][1],h],["exit",d[g][1],h],["exit",b,h]]),Wn(d,m-1,g-m+3,w),g=m+w.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,h,g){const m=this.previous,b=this.events;let x=0;return w;function w(T){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(T):(d.enter("strikethroughSequenceTemporary"),S(T))}function S(T){const L=Qr(m);if(T===126)return x>1?g(T):(d.consume(T),x++,S);if(x<2&&!a)return g(T);const z=d.exit("strikethroughSequenceTemporary"),D=Qr(T);return z._open=!D||D===2&&!!L,z._close=!L||L===2&&!!D,h(T)}}}class CE{constructor(){this.map=[]}add(i,a,r){EE(this,i,a,r)}consume(i){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];r.push(i.slice()),i.length=0;let u=r.pop();for(;u;){for(const c of u)i.push(c);u=r.pop()}this.map.length=0}}function EE(t,i,a,r){let u=0;if(!(a===0&&r.length===0)){for(;u<t.map.length;){if(t.map[u][0]===i){t.map[u][1]+=a,t.map[u][2].push(...r);return}u+=1}t.map.push([i,a,r])}}function TE(t,i){let a=!1;const r=[];for(;i<t.length;){const u=t[i];if(a){if(u[0]==="enter")u[1].type==="tableContent"&&r.push(t[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(t[i-1][1].type==="tableDelimiterMarker"){const c=r.length-1;r[c]=r[c]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(a=!0);i+=1}return r}function AE(){return{flow:{null:{name:"table",tokenize:NE,resolveAll:_E}}}}function NE(t,i,a){const r=this;let u=0,c=0,d;return h;function h($){let oe=r.events.length-1;for(;oe>-1;){const he=r.events[oe][1].type;if(he==="lineEnding"||he==="linePrefix")oe--;else break}const ue=oe>-1?r.events[oe][1].type:null,Te=ue==="tableHead"||ue==="tableRow"?_:g;return Te===_&&r.parser.lazy[r.now().line]?a($):Te($)}function g($){return t.enter("tableHead"),t.enter("tableRow"),m($)}function m($){return $===124||(d=!0,c+=1),b($)}function b($){return $===null?a($):Ne($)?c>1?(c=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),S):a($):Fe($)?Pe(t,b,"whitespace")($):(c+=1,d&&(d=!1,u+=1),$===124?(t.enter("tableCellDivider"),t.consume($),t.exit("tableCellDivider"),d=!0,b):(t.enter("data"),x($)))}function x($){return $===null||$===124||ht($)?(t.exit("data"),b($)):(t.consume($),$===92?w:x)}function w($){return $===92||$===124?(t.consume($),x):x($)}function S($){return r.interrupt=!1,r.parser.lazy[r.now().line]?a($):(t.enter("tableDelimiterRow"),d=!1,Fe($)?Pe(t,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):T($))}function T($){return $===45||$===58?z($):$===124?(d=!0,t.enter("tableCellDivider"),t.consume($),t.exit("tableCellDivider"),L):de($)}function L($){return Fe($)?Pe(t,z,"whitespace")($):z($)}function z($){return $===58?(c+=1,d=!0,t.enter("tableDelimiterMarker"),t.consume($),t.exit("tableDelimiterMarker"),D):$===45?(c+=1,D($)):$===null||Ne($)?K($):de($)}function D($){return $===45?(t.enter("tableDelimiterFiller"),W($)):de($)}function W($){return $===45?(t.consume($),W):$===58?(d=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume($),t.exit("tableDelimiterMarker"),Y):(t.exit("tableDelimiterFiller"),Y($))}function Y($){return Fe($)?Pe(t,K,"whitespace")($):K($)}function K($){return $===124?T($):$===null||Ne($)?!d||u!==c?de($):(t.exit("tableDelimiterRow"),t.exit("tableHead"),i($)):de($)}function de($){return a($)}function _($){return t.enter("tableRow"),Z($)}function Z($){return $===124?(t.enter("tableCellDivider"),t.consume($),t.exit("tableCellDivider"),Z):$===null||Ne($)?(t.exit("tableRow"),i($)):Fe($)?Pe(t,Z,"whitespace")($):(t.enter("data"),te($))}function te($){return $===null||$===124||ht($)?(t.exit("data"),Z($)):(t.consume($),$===92?P:te)}function P($){return $===92||$===124?(t.consume($),te):te($)}}function _E(t,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],h=!1,g=0,m,b,x;const w=new CE;for(;++a<t.length;){const S=t[a],T=S[1];S[0]==="enter"?T.type==="tableHead"?(h=!1,g!==0&&(ix(w,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},w.add(a,0,[["enter",m,i]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,a+1,0,0],h&&(h=!1,b={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},w.add(a,0,[["enter",b,i]])),u=T.type==="tableDelimiterRow"?2:b?3:1):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=uc(w,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=a)):T.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=uc(w,i,c,u,void 0,x)),c=d,d=[c[1],a,0,0])):T.type==="tableHead"?(h=!0,g=a):T.type==="tableRow"||T.type==="tableDelimiterRow"?(g=a,c[1]!==0?(d[0]=d[1],x=uc(w,i,c,u,a,x)):d[1]!==0&&(x=uc(w,i,d,u,a,x)),u=0):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&ix(w,i,g,m,b),w.consume(i.events),a=-1;++a<i.events.length;){const S=i.events[a];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=TE(i.events,a))}return t}function uc(t,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",h="tableContent";a[0]!==0&&(c.end=Object.assign({},Kr(i.events,a[0])),t.add(a[0],0,[["exit",c,i]]));const g=Kr(i.events,a[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},t.add(a[1],0,[["enter",c,i]]),a[2]!==0){const m=Kr(i.events,a[2]),b=Kr(i.events,a[3]),x={type:h,start:Object.assign({},m),end:Object.assign({},b)};if(t.add(a[2],0,[["enter",x,i]]),r!==2){const w=i.events[a[2]],S=i.events[a[3]];if(w[1].end=Object.assign({},S[1].end),w[1].type="chunkText",w[1].contentType="text",a[3]>a[2]+1){const T=a[2]+1,L=a[3]-a[2]-1;t.add(T,L,[])}}t.add(a[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},Kr(i.events,u)),t.add(u,0,[["exit",c,i]]),c=void 0),c}function ix(t,i,a,r,u){const c=[],d=Kr(i.events,a);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),t.add(a+1,0,c)}function Kr(t,i){const a=t[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const DE={name:"tasklistCheck",tokenize:OE};function ME(){return{text:{91:DE}}}function OE(t,i,a){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(g):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),c)}function c(g){return ht(g)?(t.enter("taskListCheckValueUnchecked"),t.consume(g),t.exit("taskListCheckValueUnchecked"),d):g===88||g===120?(t.enter("taskListCheckValueChecked"),t.consume(g),t.exit("taskListCheckValueChecked"),d):a(g)}function d(g){return g===93?(t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),h):a(g)}function h(g){return Ne(g)?i(g):Fe(g)?t.check({tokenize:RE},i,a)(g):a(g)}}function RE(t,i,a){return Pe(t,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function zE(t){return ab([rE(),gE(),jE(t),AE(),ME()])}const LE={};function IE(t){const i=this,a=t||LE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(zE(a)),c.push(nE()),d.push(iE(a))}function UE(t){const i=new Map;for(const a of t){if(!a.turnId)continue;if(a.event==="server.wakeup.started"){i.set(a.turnId,"wakeup");continue}if(a.event!=="server.turn")continue;const r=BE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function wo(t,i){return!!(i&&t.includes(i))}function BE(t){return t&&typeof t=="object"?t:{}}const qE=["summary","message","status","instruction","description","reason","error","text"],lx=96,HE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),$E=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),GE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]);function VE(t){if($E.has(t.event))return null;if(t.event.startsWith("server.")||t.event.startsWith("runtime.")||HE.has(t.event))return t.event;if(t.event!=="codex.notification")return null;const i=ko(t.data),a=typeof i.method=="string"?i.method:"",r=ko(i.params),u=ko(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||a.endsWith("/delta")||a.endsWith("/outputDelta")||GE.has(c)?null:a}function Pb(t,i){const a=i.replace(/^input:/,""),r=(t==null?void 0:t.trim())??"";return!r||r===i||r===a?YE(a):r}function Mc(t,i=[]){const a=ko(t),u=[...i,...qE.map(c=>FE(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=lx?u:`${u.slice(0,lx-3)}...`:"查看详情"}function Ap(t,i=new Map){const a=ko(t),r=typeof a.unreadCount=="number"&&a.unreadCount>0?Math.floor(a.unreadCount):0,c=(Array.isArray(a.senderWorkspaceIds)?Array.from(new Set(a.senderWorkspaceIds.filter(g=>typeof g=="string").map(g=>g.trim()).filter(Boolean))):[]).map(g=>i.get(g)??g),d="Messages",h=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:Mc({},[h])}}function YE(t){const a=(t.split(/[./]/).filter(Boolean).pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function FE(t){if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t)}function ko(t){return t&&typeof t=="object"?t:{}}const Np="seele:authentication-required",Qb=12,KE=5e3,_p="seele.activeWorkspaceId",Wb="seele.workspaceOrder",Zb="seele.workspaceGroupOrder",Jb="seele.workspaceDrafts",ev="seele.collapsedWorkspaceGroups",tv="seele.sidebarWidth",ax=5,rx=275,XE=236,PE=420,sx="default",ox=300,QE=3,WE=10,ZE=2,JE=13,eT=1.65,tT=20,nT=900;class qi extends Error{constructor(a,r,u,c){super(a);ac(this,"detail");ac(this,"status");ac(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const iT=[{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium (default)"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],lT=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],oo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function ge(t){var a;return`${((a=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:a.content.replace(/\/?$/,"/"))??"/"}api/${t.replace(/^\/+/,"")}`}async function Xt(t,i){const a=await t.text().catch(()=>""),r=`Request failed with ${t.status}`,u=[`${i.method??"GET"} ${i.url}`,`HTTP ${t.status} ${t.statusText||""}`.trim(),a?`Response: ${a}`:"Response: <empty>"].join(`
|
|
79
|
+
`);return new qi(r,u,t.status,a)}function Et(t){return t instanceof qi?{message:t.message,detail:t.detail}:t instanceof Error?{message:t.message}:{message:String(t)}}function Wa(t){const i=Et(t);return i.detail?{message:i.message,detail:i.detail}:i.message}async function _e(t,i){if(!t.ok)throw await Xt(t,i)}function aT(t){return t instanceof qi&&t.status===410&&t.body.includes('"turn_not_active"')}function rT(t){return t instanceof qi&&t.status===409&&t.body.includes('"turn_not_running"')}function sT(t){return t instanceof qi&&t.status===409&&t.body.includes('"thread_capability_upgrade_required"')}function ux(t){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t})}}async function oT(t){if(t.status!==409)return null;try{const i=await t.json();if(i.error==="turn_already_running"&&typeof i.turnId=="string")return i.turnId}catch{return null}return null}function ih(t){return Math.max(XE,Math.min(PE,Math.round(t)))}function uT(){try{const t=window.localStorage.getItem(tv),i=t?Number.parseInt(t,10):Number.NaN;return Number.isFinite(i)?ih(i):rx}catch{return rx}}function cT(t){try{window.localStorage.setItem(tv,String(ih(t)))}catch{}}function Wf(t){nv(t,()=>{t.scrollTop=Math.max(0,t.scrollHeight-t.clientHeight)})}function dT(t,i=48){return t.scrollHeight-t.scrollTop-t.clientHeight<=i}function fT(t){if(!t)return;const i=window.getComputedStyle(t),a=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=a*QE+r+u,d=a*WE+r+u;t.style.height="auto";const h=Math.min(Math.max(t.scrollHeight,c),d);t.style.height=`${h}px`,t.style.overflowY=t.scrollHeight>d?"auto":"hidden"}function pT(t){const i=t.split(/\r\n|\r|\n/).length;return Math.min(ZE,Math.max(1,i+1))}function hT(t){return Math.ceil(pT(t)*JE*eT+tT)}function nv(t,i){const a=t.style.scrollBehavior;t.style.scrollBehavior="auto",i(),t.style.scrollBehavior=a}function mT(t){const i=t.getBoundingClientRect(),a=i.bottom-32,r=Array.from(t.querySelectorAll(".turn-group[data-turn-id]")),u=[...r].reverse().find(d=>{const h=d.getBoundingClientRect();return h.top<=a&&h.bottom>=i.top})??r[r.length-1]??null;if(!(u!=null&&u.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const c=u.getBoundingClientRect();return{anchorOffset:a-c.top,anchorTurnId:u.dataset.turnId}}function gT(t,i){return i?Array.from(t.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function cx(t,i){nv(t,()=>{const a=gT(t,i.anchorTurnId);if(a&&i.anchorOffset!==null){const u=t.getBoundingClientRect().bottom-32,d=a.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(t.scrollTop+=d);return}t.scrollTop=Math.max(0,t.scrollHeight-i.previousScrollHeight)})}function yT(t,i){let a=!1;const r=t.querySelector(".stream-inner")??t,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||cx(t,i)});cx(t,i),u==null||u.observe(r);const c=window.setTimeout(d,1200);function d(){a||(a=!0,u==null||u.disconnect(),window.clearTimeout(c))}return d}function xT(){try{return window.localStorage.getItem(_p)}catch{return null}}function Zf(t){try{t?window.localStorage.setItem(_p,t):window.localStorage.removeItem(_p)}catch{}}function iv(){try{const t=window.localStorage.getItem(Wb),i=t?JSON.parse(t):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function lv(){try{const t=window.localStorage.getItem(Zb),i=t?JSON.parse(t):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function av(t){try{window.localStorage.setItem(Zb,JSON.stringify(t))}catch{}}function mc(t){try{window.localStorage.setItem(Wb,JSON.stringify(t))}catch{}}function rv(){try{const t=window.localStorage.getItem(Jb),i=t?JSON.parse(t):{};return!i||typeof i!="object"||Array.isArray(i)?{}:Object.fromEntries(Object.entries(i).filter(a=>typeof a[0]=="string"&&typeof a[1]=="string"))}catch{return{}}}function bT(t){return t?rv()[t]??"":""}function Jf(t,i){if(t)try{const a=rv();i?a[t]=i:delete a[t],window.localStorage.setItem(Jb,JSON.stringify(a))}catch{}}function vT(){try{const t=window.localStorage.getItem(ev),i=t?JSON.parse(t):[];return new Set(Array.isArray(i)?i.filter(a=>typeof a=="string"):[])}catch{return new Set}}function ep(t){try{window.localStorage.setItem(ev,JSON.stringify(Array.from(t)))}catch{}}function uo(t){const i=iv();if(i.length===0)return t;const a=new Map(i.map((r,u)=>[r,u]));return[...t].sort((r,u)=>{const c=a.get(r.id),d=a.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:0})}function cc(t){const i=lv();if(i.length===0)return t;const a=new Map(i.map((r,u)=>[r,u]));return[...t].sort((r,u)=>{const c=a.get(r.id),d=a.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:r.createdAt.localeCompare(u.createdAt)})}function tp(t){const i=new Set(t.map(u=>u.id)),a=iv().filter(u=>i.has(u)),r=t.map(u=>u.id).filter(u=>!a.includes(u));mc([...a,...r])}function np(t){const i=new Set(t.map(u=>u.id)),a=lv().filter(u=>i.has(u)),r=t.map(u=>u.id).filter(u=>!a.includes(u));av([...a,...r])}function wT(t,i){const a=t.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function kT(t,i,a,r){if(i===a)return t;const u=t.findIndex(b=>b.id===i),c=t.findIndex(b=>b.id===a);if(u===-1||c===-1)return t;const d=[...t],[h]=d.splice(u,1),g=d.findIndex(b=>b.id===a),m=r==="before"?g:g+1;return d.splice(m,0,h),d}function ST(t,i,a){if(i===a)return t;const r=t.findIndex(g=>g.id===i),u=t.findIndex(g=>g.id===a);if(r===-1||u===-1)return t;const c=[...t],[d]=c.splice(r,1),h=c.findIndex(g=>g.id===a);return c.splice(h+1,0,d),c}function jT({authEnabled:t,currentUser:i,onLogout:a}){var ul,zi,jr,Yl;const[r,u]=R.useState(""),[c,d]=R.useState([]),[h,g]=R.useState([]),[m,b]=R.useState(null),[x,w]=R.useState(null),[S,T]=R.useState("simple"),[L,z]=R.useState(null),[D,W]=R.useState(null),[Y,K]=R.useState(null),[de,_]=R.useState(!1),[Z,te]=R.useState(!1),[P,$]=R.useState({}),[oe,ue]=R.useState({}),[Te,he]=R.useState(null),[re,H]=R.useState([]),[le,ye]=R.useState(null),[Ce,N]=R.useState("checking"),[C,B]=R.useState(null),[A,ae]=R.useState(!1),[me,fe]=R.useState(null),[xe,ze]=R.useState(!1),[qe,Tt]=R.useState(null),[wt,un]=R.useState(!1),[bn,kt]=R.useState([]),[vn,Oe]=R.useState([]),[Vt,Zn]=R.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[In,oi]=R.useState([]),[yt,Yt]=R.useState(null),[vi,At]=R.useState(null),[wi,ee]=R.useState(!1),[se,De]=R.useState(null),[$e,Qe]=R.useState(!1),[cn,ui]=R.useState(null),[Pt,St]=R.useState(!1),[Qt,tt]=R.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Rt,Ft]=R.useState("global"),[bt,ki]=R.useState(null),[ar,Si]=R.useState(null),[ji,Ci]=R.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[ma,Do]=R.useState({memory:"",items:[]}),[Mo,rr]=R.useState({memory:"",items:[]}),[ga,Oo]=R.useState({memory:"",items:[]}),[Ro,jl]=R.useState([]),[$i,Ei]=R.useState(oo),[Ti,Gi]=R.useState({description:"",key:"",value:""}),[sr,Un]=R.useState(null),[Ht,zt]=R.useState(()=>new Set),[Ai,ya]=R.useState(!1),[Jr,es]=R.useState(!1),[zo,Cl]=R.useState(!1),[Jn,Ni]=R.useState(null),[Vi,xa]=R.useState(!0),[El,Nt]=R.useState(!1),[Lo,ts]=R.useState(!1),[dn,Bn]=R.useState(null),[zc,Tl]=R.useState(null),[Al,Io]=R.useState(null),[wn,kn]=R.useState(null),[Wt,fn]=R.useState(null),[Nl,Lc]=R.useState(null),[Yi,Uo]=R.useState(()=>new Set),[Fi,ba]=R.useState(null),[nn,va]=R.useState(null),[ns,_l]=R.useState(null),[Zt,ci]=R.useState(null),[or,ei]=R.useState(null),[is,ur]=R.useState(()=>vT()),[Bo,wa]=R.useState(()=>uT()),[qo,Ic]=R.useState(230),[di,fi]=R.useState(()=>Date.now()),cr=R.useRef(null),Dl=R.useRef(null),Ki=R.useRef(null),Xi=R.useRef(null),ka=R.useRef(!0),dr=R.useRef(null),Ml=R.useRef(null),Pi=R.useRef(null),qn=R.useRef(new Set),Sa=R.useRef(!1),Ol=R.useRef([]),pi=R.useRef(null),ti=R.useRef(null),pn=R.useRef(new Map),Jt=R.useRef(new Map),Qi=R.useRef(new Set),Wi=R.useRef(new Map),Rl=R.useRef(new Map),_t=R.useRef(new Set),ni=R.useRef(null),Zi=R.useRef(null),Ji=R.useRef(!1),ls=R.useRef(!1),ke=c.find(y=>y.id===m),fr=(ke==null?void 0:ke.unreadTurnCount)??0,Hn=c.find(y=>y.id===Jn),Dt=c.find(y=>y.id===bt),pr=c.find(y=>y.id===Fi),ja=R.useMemo(()=>{const k=cc(h.length>0?h:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(I=>({id:I.id,title:I.title,conversations:[]})),E=new Map(k.map(I=>[I.id,I])),M=k[0];for(const I of c)(E.get(I.groupId)??M).conversations.push(I);return k.filter(I=>I.conversations.length>0||I.id!=="default")},[c,h]),nt=m!==null?P[m]:null,zl=(nt==null?void 0:nt.messages)??[],Ll=(nt==null?void 0:nt.events)??[],Ca=C2(j2(Ll),m?oe[m]:null),Ea=Iv(Ca),as=(nt==null?void 0:nt.status)??(ke==null?void 0:ke.status)??"idle",hr=mp(ke,as),Uc=Jn!==null?((ul=P[Jn])==null?void 0:ul.status)??(Hn==null?void 0:Hn.status)??"idle":"idle",Ho=mp(Hn,Uc),Ta=m?Jt.current.get(m)??null:null,$o=R.useMemo(()=>new Map(c.map(y=>[y.id,y.title])),[c]),rs=R.useMemo(()=>uA(zl,Ll,(nt==null?void 0:nt.turns)??[],(nt==null?void 0:nt.timelineNodes)??[],Ta,$o),[Ta,nt==null?void 0:nt.timelineNodes,nt==null?void 0:nt.turns,Ll,zl,$o]),ss=R.useMemo(()=>new Set(zl.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[zl]),Aa=m!==null&&Yi.has(m),os=Ta?(zi=rs.find(y=>wo(y.turnIds,Ta)))==null?void 0:zi.activity:null,mr=hr==="running"||Aa?os&&!d2(os)?os:{title:"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,Bc=!mr&&hr==="waiting"&&(ke!=null&&ke.nextWakeup)?{title:"Scheduled wakeup",detail:Ip(ke.nextWakeup,di),createdAt:ke.nextWakeup.wakeAt,tone:"waiting"}:null,Il=mr??Bc,qc=R.useMemo(()=>S2(Object.values(P)),[P]),Hc=zx(le,qc);R.useEffect(()=>{Gc(),_a()},[]),R.useEffect(()=>{cs(!1),cs(!0);const y=window.setInterval(()=>{cs(!0)},300*1e3);return()=>window.clearInterval(y)},[]),R.useEffect(()=>{const y=window.setInterval(()=>fi(Date.now()),1e3);return()=>window.clearInterval(y)},[]),R.useEffect(()=>{_t.current=Yi},[Yi]),R.useEffect(()=>{pi.current=m},[m]),R.useEffect(()=>{Ol.current=c},[c]),R.useEffect(()=>{m&&Zf(m)},[m]),R.useLayoutEffect(()=>{if(!m||fr<=0)return;let y=!1;const k=async()=>{if(document.visibilityState==="visible"){d(M=>M.map(I=>I.id===m?{...I,unreadTurnCount:0}:I));try{await yN(m)}catch(M){y||console.error(M)}}},E=()=>void k();return k(),document.addEventListener("visibilitychange",E),()=>{y=!0,document.removeEventListener("visibilitychange",E)}},[m,fr]),R.useEffect(()=>{T("simple"),w(null),m&&(_i(m),ys(m))},[m]),R.useEffect(()=>{const y=window.setInterval(()=>void us(),KE);return()=>window.clearInterval(y)},[]),R.useEffect(()=>{u(bT(m))},[m]),R.useEffect(()=>{!m||as!=="running"||_t.current.has(m)||js(m)},[m,as,Yi]),R.useEffect(()=>{if(!m)return;let y=!1;return zN(m).then(k=>{y||ue(E=>({...E,[m]:k}))}).catch(k=>console.error(k)),()=>{y=!0}},[m]),R.useEffect(()=>{!m&&Rt==="workspace"&&Ft("global")},[m,Rt]),R.useEffect(()=>{var y;if(wt){if(!bt&&m){ki(m);return}bt&&!c.some(k=>k.id===bt)&&ki(m??((y=c[0])==null?void 0:y.id)??null)}},[m,c,wt,bt]),R.useEffect(()=>{!wt||Rt!=="workspace"||Oo({memory:(Dt==null?void 0:Dt.memory)??"",items:(Dt==null?void 0:Dt.memoryItems)??[]})},[Rt,wt,Dt==null?void 0:Dt.id,Dt==null?void 0:Dt.memory,Dt==null?void 0:Dt.memoryItems]),R.useEffect(()=>{if(!Ai)return;m&&gr(m);const y=k=>{k.key==="Escape"&&ya(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m,Ai]),R.useEffect(()=>{if(!wt)return;const y=k=>{k.key==="Escape"&&un(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[wt]),R.useEffect(()=>{var k;if(!Jr)return;if(Jn&&!c.some(E=>E.id===Jn)){Ni(m??((k=c[0])==null?void 0:k.id)??null);return}const y=E=>{E.key==="Escape"&&(dn?Bn(null):es(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m,Jr,dn,Jn,c]),R.useEffect(()=>{if(!wn)return;fn(null);const y=k=>{k.key==="Escape"&&kn(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[wn]),R.useLayoutEffect(()=>{fT(Xi.current)},[r]),R.useLayoutEffect(()=>{const y=Ki.current;if(!y)return;const k=()=>{const M=y.getBoundingClientRect();Ic(Math.ceil(M.height+44))};k();const E=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return E==null||E.observe(y),window.addEventListener("resize",k),()=>{E==null||E.disconnect(),window.removeEventListener("resize",k)}},[]),R.useLayoutEffect(()=>{var Q,Ee;const y=Dl.current;if(!y)return;const k=dr.current!==m;dr.current=m,k&&((Q=ti.current)==null||Q.call(ti),ti.current=null);const E=Ml.current;if(E&&E.conversationId===m){(Ee=ti.current)==null||Ee.call(ti),ti.current=yT(y,E),Ml.current=null,ka.current=!1;return}if(!k&&!ka.current)return;ka.current=!0,Wf(y);const M=requestAnimationFrame(()=>Wf(y)),I=window.setTimeout(()=>Wf(y),120);return()=>{cancelAnimationFrame(M),window.clearTimeout(I)}},[m,Ll.length,zl.length]);async function $c(){var k;const y=Dl.current;y&&(ka.current=dT(y),!(!m||!((k=nt==null?void 0:nt.history)!=null&&k.hasMoreBefore))&&(nt.loadingOlder||qn.current.has(m)||y.scrollTop>96||await bs(m)))}function Go(y){var E,M;if(y.history)return y.history;const k=((E=y.timelineNodes)==null?void 0:E.filter(I=>I.parentId===null).reduce((I,Q)=>I===null||Q.timelineAt<I.timelineAt||Q.timelineAt===I.timelineAt&&Q.sequence<I.sequence?Q:I,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((M=y.messages[0])==null?void 0:M.createdAt)??null,oldestTimelineAt:(k==null?void 0:k.timelineAt)??null,oldestTimelineSequence:(k==null?void 0:k.sequence)??null,messageTotal:y.messages.length,eventTotal:y.events.length,loadedMessageCount:y.messages.length,loadedEventCount:y.events.length}}async function el(y){const k=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(k),fn(y.url)}async function Na(y,k){await navigator.clipboard.writeText(k),Lc(y)}function Ae(y,k,E){const M=Date.now();Io({id:M,tone:y,text:k,detail:E}),window.setTimeout(()=>{Io(I=>(I==null?void 0:I.id)===M?null:I)},E?8e3:2400)}async function Gc(){try{const[y,k]=await Promise.all([Ax(),_x()]);N("connected");const E=cc(k);if(g(E),np(E),y.length>0){const M=uo(y),I=xT(),Q=M.find(Ee=>Ee.id===I)??M[0];d(M),tp(M),b(Q.id);return}d([]),Zf(null),b(null)}catch(y){console.error(y),N("error")}}async function Sn(){const[y,k]=await Promise.all([Ax(),_x()]),E=uo(y),M=cc(k);g(M),np(M),d(E),tp(E)}async function us(){if(!Sa.current){Sa.current=!0;try{const y=await pN(),k=Ol.current,E=new Set(k.map(Re=>Re.id)),M=new Set(y.map(Re=>Re.id));if(E.size!==M.size||[...E].some(Re=>!M.has(Re))){await Sn(),N("connected");return}const I=pi.current,Q=I?y.find(Re=>Re.id===I)??null:null,Ee=new Map(y.map(Re=>[Re.id,Re])),Se=uo(k.map(Re=>{const be=Ee.get(Re.id);return be?{...Re,status:be.status,nextWakeup:be.nextWakeup,unreadTurnCount:be.unreadTurnCount,updatedAt:be.updatedAt}:Re}));d(Se),tp(Se),N("connected"),Q&&!_t.current.has(Q.id)&<(Q.id,Re=>({...Re,status:Q.status}))}catch(y){console.error(y),N("error")}finally{Sa.current=!1}}}async function _a(){try{const y=await t2();N("connected"),he(y.version)}catch(y){console.error(y),N("error")}}async function cs(y){try{const k=await n2(y);k&&ye(E=>zx(E,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function Vo(){try{const y=await wN();kt(y),N("connected")}catch(y){console.error(y),N("error")}}async function ds(y){try{const k=await kN(y);Oe(k),N("connected")}catch(k){console.error(k),Oe([]),N("error")}}async function gr(y){try{const k=await SN(y);jl(k),N("connected")}catch(k){console.error(k),jl([]),N("error")}}async function Yo(y){try{const k=await jN();Zn(k),tt(k),y||(Si(null),Ci(k)),N("connected")}catch(k){console.error(k),N("error")}}async function yr(y=!0){try{const k=await EN(y);oi(k.models),N("connected"),k.refreshing&&window.setTimeout(()=>void yr(!1),1e3)}catch(k){console.error(k),oi([]),N("error")}}async function tl(){try{const y=await CN();Yt(y.codexVersion),At(y.codexReleasedAt),N("connected")}catch(y){console.error(y),Yt(null),At(null),N("error")}}async function fs(y=!1){y&&St(!0);try{const k=await TN(y);De(k.job),ui(k.latest),N("connected"),k.job&&k.job.status!=="running"&&Pi.current===k.job.id&&(Pi.current=null,k.job.status==="succeeded"?(await Promise.all([yr(),tl()]),Ae("success",`Codex CLI updated to ${Rc(k.job.currentVersion)}`)):Ae("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),N("error")}finally{y&&St(!1)}}async function Vc(){Qe(!0);try{const y=await AN();Pi.current=y.id,De(y),N("connected")}catch(y){console.error(y);const k=Et(y);Ae("error","Unable to start Codex CLI update",k.detail??k.message)}finally{Qe(!1)}}R.useEffect(()=>{if(!wi||(se==null?void 0:se.status)!=="running")return;const y=window.setInterval(()=>void fs(),1e3);return()=>window.clearInterval(y)},[wi,se==null?void 0:se.id,se==null?void 0:se.status]);async function ps(y){try{const k=await NN(y);Si(k),Ci(k.effective),N("connected")}catch(k){console.error(k),Si(null),N("error")}}async function Fo(){try{const y=await _N();Do(y),rr(y),N("connected")}catch(y){console.error(y),N("error")}}async function Ko(){if(i.role!=="admin"){H([]);return}try{H(await Q2()),N("connected")}catch(y){console.error(y),N("error")}}async function Ul(y=bt){const k=[Vo(),Yo(y),tl(),yr(),Fo()];i.role==="admin"&&k.push(Ko()),y&&(k.push(ps(y)),k.push(ds(y)),k.push(gr(y))),await Promise.all(k)}function Da(){var k;const y=m??((k=c[0])==null?void 0:k.id)??null;te(!1),ki(y),Ft(i.role==="admin"?"global":y?"workspace":"global"),un(!0),Ul(y)}function Yc(){var k;const y=m??((k=c[0])==null?void 0:k.id)??null;ki(y),Ft(y?"workspace":"global"),un(!0),Ul(y)}function Ma(){var y;te(!1),Ni(m??((y=c[0])==null?void 0:y.id)??null),Tl(null),Bn(null),es(!0)}function Xo(y){ki(y),Ft("workspace"),ps(y),ds(y),gr(y),Ei(oo)}async function Po(y){y.preventDefault();try{if(Rt==="workspace"&&bt){const k=await Dx(bt,UN(ji,Vt));Si(k.settings),Ci(k.settings.effective),Gn(k.conversation),Ae("success","Workspace settings saved")}else{const k=await DN(Qt);Zn(k),tt(k),bt&&await ps(bt),Ae("success","Global settings saved")}N("connected")}catch(k){console.error(k),N("error");const E=Et(k);Ae("error","Failed to save runtime settings",E.detail??E.message)}}async function hs(){var E;const y=Hn;if(!y){Ae("error","No workspace selected");return}if((((E=P[y.id])==null?void 0:E.status)??y.status)==="running"){Ae("error","Stop the running turn before resetting runtime");return}ts(!0),Tl(null);try{const M=await ON(y.id);Bn(M),N("connected")}catch(M){console.error(M),N("error");const I=Et(M);Ae("error","Failed to preview runtime reset",I.detail??I.message)}finally{ts(!1)}}async function ms(){const y=Hn,k=dn;if(!y||!k||k.conversationId!==y.id){Ae("error","Reset preview is required");return}Nt(!0),Tl(null);try{const E=await MN(y.id,{warmup:Vi,previewFingerprint:k.fingerprint});Tl(E),Bn(null),N("connected"),await _i(y.id),await Sn(),E.warmupTurnId&&Ua(y.id,E.warmupTurnId),Ae("success","Runtime thread reset")}catch(E){console.error(E),N("error");const M=Et(E);Ae("error","Failed to reset runtime thread",M.detail??M.message)}finally{Nt(!1)}}async function Qo(y,k){try{const E=await Dx(y,{[k]:null});Si(E.settings),Ci(E.settings.effective),Gn(E.conversation),N("connected"),Ae("success","Workspace override reset")}catch(E){console.error(E),N("error"),Ae("error","Failed to reset workspace override")}}async function Wo(y){try{const k=await YN({memory:VN(y),items:y});return Do(k),rr(k),N("connected"),Ae("success","Base memory saved"),k.items}catch(k){throw console.error(k),N("error"),Ae("error","Failed to save memory"),k}}async function Zo(y,k){try{const E=await pc(y,{memoryItems:k});return Gn(E),Oo({memory:E.memory,items:E.memoryItems}),N("connected"),Ae("success","Workspace memory saved"),E.memoryItems}catch(E){throw console.error(E),N("error"),Ae("error","Failed to save memory"),E}}async function Fc(y){y.preventDefault();const k=Ti.key.trim();if(k)try{if(Rt==="workspace"&&bt){const E=await KN(bt,k,Ti.value,Ti.description);Oe(M=>[...M.filter(I=>I.key!==E.variable.key),E.variable].sort((I,Q)=>I.key.localeCompare(Q.key))),Gn(E.conversation)}else{const E=await FN(k,Ti.value,Ti.description);kt(M=>[...M.filter(I=>I.key!==E.key),E].sort((I,Q)=>I.key.localeCompare(Q.key)))}Ae("success",Rt==="workspace"?"Workspace environment saved":"Base environment saved"),Gi({description:"",key:"",value:""}),Un(null),zt(E=>{const M=new Set(E);return M.delete(k),M}),N("connected")}catch(E){console.error(E),N("error"),Ae("error","Failed to save environment")}}async function Kc(y){try{if(Rt==="workspace"&&bt){const k=await WN(bt,y);Oe(E=>E.filter(M=>M.key!==y)),Gn(k)}else await QN(y),kt(k=>k.filter(E=>E.key!==y));sr===y&&(Gi({description:"",key:"",value:""}),Un(null),zt(k=>{const E=new Set(k);return E.delete(y),E})),N("connected"),Ae("success",Rt==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),N("error"),Ae("error","Failed to delete environment")}}async function Xc(y,k){if(k.preventDefault(),!$i.name.trim()){Ae("error","Knowledge name is required");return}const E=BN($i);try{const M=$i.id?await JN(y,$i.id,E):await ZN(y,E);jl(I=>[...I.filter(Q=>Q.id!==M.id),M].sort(Mx)),Ei(oo),N("connected"),Ae("success","Workspace knowledge saved")}catch(M){console.error(M),N("error"),Ae("error","Failed to save workspace knowledge")}}async function Pc(y,k){try{await e2(y,k),jl(E=>E.filter(M=>M.id!==k)),$i.id===k&&Ei(oo),N("connected"),Ae("success","Workspace knowledge deleted")}catch(E){console.error(E),N("error"),Ae("error","Failed to delete workspace knowledge")}}function Qc(y){Ft("workspace"),Ei(qN(y))}function hn(y){Gi({description:y.description,key:y.key,value:""}),Un(y.key),zt(k=>{const E=new Set(k);return E.delete(y.key),E}),gs(y.key,{preserveTypedValue:!0})}function Oa(){const y=sr;Gi({description:"",key:"",value:""}),Un(null),y&&zt(k=>{const E=new Set(k);return E.delete(y),E})}async function Jo(y){await gs(y)}async function gs(y,k={}){try{const E=Rt==="workspace"&&bt?await PN(bt,y):await XN(y);Gi(M=>M.key===y&&(!k.preserveTypedValue||M.value.length===0)?{...M,value:E}:M),zt(M=>new Set(M).add(y)),N("connected")}catch(E){console.error(E),N("error")}}async function _i(y){const k=await Rx(y);gi(k)}async function ys(y){try{w(await l2(y))}catch(k){console.error(k)}}async function nl(y){if(m)try{const k=await r2(m,y);w(y==="end"?null:k),y==="end"&&T("simple"),Ae("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&js(m,{waitMs:15e3}),await Sn()}catch(k){Ae("error","Complex task control failed",Et(k).detail??Et(k).message)}}async function il(y){if(m)try{z(await a2(m,y))}catch(k){const E=Et(k);Ae("error","Failed to load complex task",E.detail??E.message)}}function Bl(){ke&&K({sourceId:ke.id,name:`${ke.title} - Clone`,groupId:ke.groupId})}async function xs(y){if(y.preventDefault(),!(!Y||!Y.name.trim())){_(!0);try{const k=await s2(Y.sourceId,Y.name.trim(),Y.groupId);d(E=>uo([k.conversation,...E])),b(k.conversation.id),K(null),te(!1),Ae(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){Ae("error","Clone failed",Et(k).detail??Et(k).message)}finally{_(!1)}}}async function Ra(){if(ke)try{const y=await o2(ke.id);Gn(y.conversation),Ae(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){Ae("error","Clone retry failed",Et(y).detail??Et(y).message)}}async function bs(y,k={}){var Re,be,mt;const E=P[y],M=(Re=E==null?void 0:E.history)==null?void 0:Re.oldestTimelineAt,I=(be=E==null?void 0:E.history)==null?void 0:be.oldestTimelineSequence,Q=M&&I!==null&&I!==void 0?`${M}|${I}`:I==null?(mt=E==null?void 0:E.history)==null?void 0:mt.oldestMessageCreatedAt:String(I),Ee=Dl.current;if(!Q||!Ee)return;if(k.preserveAnchor??!0){const dt=mT(Ee);Ml.current={anchorOffset:dt.anchorOffset,conversationId:y,previousScrollHeight:Ee.scrollHeight,anchorTurnId:dt.anchorTurnId}}else Ml.current=null;qn.current.add(y),lt(y,dt=>({...dt,loadingOlder:!0}));try{const dt=await Rx(y,{before:Q,limit:Qb});ou(dt)}catch(dt){console.error(dt),Ml.current=null}finally{qn.current.delete(y),lt(y,dt=>({...dt,loadingOlder:!1}))}}async function eu(y,k){const E=await i2(y,k||void 0);d(M=>{const I=[E,...M];return mc(I.map(Q=>Q.id)),I}),b(E.id),te(!1)}function ll(){te(!1),Tt({mode:"create",groupId:null,title:""})}function al(y){Tt({mode:"rename",groupId:y.id,title:y.title})}function xr(){var y;te(!1),B({mode:"create",conversationId:null,title:"",groupId:(ke==null?void 0:ke.groupId)??((y=h[0])==null?void 0:y.id)})}async function tu(y){var k;if(y.status!=="running"){ze(!0);try{await c2(y.id),$(M=>{const I={...M};return delete I[y.id],I});const E=c.filter(M=>M.id!==y.id);if(mc(E.map(M=>M.id)),Jf(y.id,""),d(E),m===y.id){const M=((k=E[0])==null?void 0:k.id)??null;Zf(M),b(M)}(C==null?void 0:C.conversationId)===y.id&&sl(),fe(null),Ae("success","Workspace moved to recycle")}catch(E){const M=Et(E);Ae("error","Failed to move workspace to recycle",M.detail??M.message)}finally{ze(!1)}}}async function rl(y){if(!(y.id===sx||!window.confirm(`Delete group "${y.title}"?
|
|
80
|
+
|
|
81
|
+
Workspaces in this group will move to Default.`)))try{const E=await vN(y.id),M=cc(E.groups);g(M),np(M),d(E.conversations),ur(I=>{const Q=new Set(I);return Q.delete(y.id),ep(Q),Q})}catch(E){console.error(E)}}function nu(y){B({mode:"rename",conversationId:y.id,title:y.title})}function sl(){ae(!1),B(null)}function za(){Tt(null)}async function Wc(y,k){const E=k.trim(),M=c.find(Q=>Q.id===y);if(!M||!E||E===M.title){sl();return}const I=await pc(y,{title:E});Gn(I),sl()}function Zc(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function iu(y){return y instanceof Element&&!!y.closest("input, button")}function lu(y,k){const E=document.elementFromPoint(y,k);return E instanceof HTMLElement?E.closest(".session-item[data-workspace-id]"):null}function vs(y,k){const E=document.elementFromPoint(y,k);return E instanceof HTMLElement?E.closest(".workspace-group[data-group-id]"):null}function ws(y,k,E){const M=lu(k,E),I=M==null?void 0:M.dataset.workspaceId;if(M&&I&&I!==y){ci({kind:"workspace",id:I,position:wT(M,E)});return}const Q=vs(k,E),Ee=Q==null?void 0:Q.dataset.groupId;if(!Ee){ci(null);return}ci({kind:"group",id:Ee})}function $n(y,k){iu(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),ni.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function br(y,k){const E=ni.current;if(!E||E.id!==k||E.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-E.startX,y.clientY-E.startY);if(Fi!==k){if(M<ax)return;ba(k),ci(null)}y.preventDefault(),ei({x:y.clientX,y:y.clientY}),ws(k,y.clientX,y.clientY)}async function jn(y,k){var Ee;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),ni.current=null;const E=Fi===k;E&&(Ji.current=!0);const M=Zt;if(!E||!M){ba(null),ci(null),ei(null);return}const I=c.find(Se=>Se.id===k),Q=M.kind==="group"?M.id:(Ee=c.find(Se=>Se.id===M.id))==null?void 0:Ee.groupId;if(!I||!Q){ba(null),ci(null),ei(null);return}if(d(Se=>{const Re=M.kind==="workspace"?kT(Se.map(be=>be.id===k?{...be,groupId:Q}:be),k,M.id,M.position):[...Se.filter(be=>be.id!==k),{...I,groupId:Q}];return mc(Re.map(be=>be.id)),Re}),I.groupId!==Q)try{const Se=await pc(k,{groupId:Q});Gn(Se)}catch(Se){console.error(Se),await Sn()}ba(null),ci(null),ei(null)}function ql(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),ni.current=null,ba(null),ci(null),ei(null)}function ks(y,k){y.currentTarget.setPointerCapture(y.pointerId),Zi.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function vr(y,k){const E=Zi.current;if(!E||E.id!==k||E.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-E.startX,y.clientY-E.startY);if(nn!==k){if(M<ax)return;va(k),_l(null)}y.preventDefault();const I=vs(y.clientX,y.clientY),Q=I==null?void 0:I.dataset.groupId;_l(Q&&Q!==k?Q:null)}function wr(y,k){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const E=nn===k;E&&(y.preventDefault(),ls.current=!0);const M=ns;E&&M&&g(I=>{const Q=ST(I,k,M);return av(Q.map(Ee=>Ee.id)),Q}),Zi.current=null,va(null),_l(null)}function Ss(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Zi.current=null,va(null),_l(null)}function ol(y){const k=y.target.value;B(E=>E&&{...E,title:k})}function au(y){const k=y.target.value;B(E=>E&&{...E,groupId:k})}function kr(y){const k=y.target.value;Tt(E=>E&&{...E,title:k})}async function Hl(y){if(y.preventDefault(),!C)return;const k=C.title.trim();if(k){ae(!0);try{if(C.mode==="create"){await eu(k,C.groupId),sl();return}C.conversationId&&await Wc(C.conversationId,k)}catch(E){console.error(E);const M=Et(E);Ae("error",C.mode==="create"?"Failed to create workspace":"Failed to rename workspace",M.detail??M.message)}finally{ae(!1)}}}function Sr(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),sl())}async function mn(y){if(y.preventDefault(),!qe)return;const k=qe.title.trim();if(k)try{if(qe.mode==="rename"){if(!qe.groupId)return;const M=await bN(qe.groupId,{title:k});g(I=>I.map(Q=>Q.id===M.id?M:Q)),za();return}const E=await xN(k);g(M=>[...M,E]),ur(M=>{const I=new Set(M);return I.delete(E.id),ep(I),I}),za()}catch(E){console.error(E)}}function La(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),za())}async function hi(y){y.preventDefault(),await Di()}function ru(y){u(y),Jf(m,y)}function $l(y){Jf(y,""),m===y&&u("")}async function Di(y={}){const k=r.trim();if(!k)return;if(!m){xr();return}const E=m,M=Jt.current.has(E),I=Qi.current.has(E);if(hr==="running"||Aa||M||I){if(y.forceNewTurn&&!x){await su(E,k);return}await Cn(E,k);return}Qi.current.add(E);const Q=`local-${Date.now()}`;lt(E,Se=>({...Se,messages:[...Se.messages,{id:Q,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),Mi(E,"running"),We(E,!0),$l(E),await Sn();const Ee=new AbortController;pn.current.set(E,Ee);try{let Se=null;const Re=ge(`conversations/${E}/turns`),be=await fetch(Re,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:S})});if(be.ok){const gn=await be.json();if(!gn.turnId)throw new Error("Turn did not return a turn id");Se=gn.turnId,(S==="complex"||x)&&(ys(E),T("simple")),gn.message&&mi(E,Q,gn.message,Se)}else{const gn=await oT(be);if(gn){Se=gn;const cl=await Ba(E,gn,k);if(!cl.ok)throw await Xt(cl,{method:"POST",url:ge(`conversations/${E}/turns/${gn}/steer`)});const Ha=await cl.json();Ha.message&&mi(E,Q,Ha.message,gn)}else throw await Xt(be,{method:"POST",url:Re})}if(!Se)throw await Xt(be,{method:"POST",url:Re});Jt.current.set(E,Se),await Vl(E,Se);const mt=ge(`conversations/${E}/turns/${Se}/events`),dt=await fetch(mt,{signal:Ee.signal});if(!dt.ok||!dt.body)throw await Xt(dt,{method:"GET",url:mt});await pp(dt.body,gn=>{const cl=sp(gn,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);lt(E,Cs=>({...Cs,status:Fr(cl)??Cs.status,events:rp(Cs.events,cl)}));const Ha=Fr(cl);Ha&&Mi(E,Ha)}),await _i(E),await Sn()}catch(Se){if(op(Se))return;const Re=sT(Se);Re&&Ae("error","Reset thread required",x?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),Jt.current.has(E)||Rl.current.delete(E),lt(E,be=>({...be,status:"error",events:[...be.events,{id:be.events.length+1,event:"client.error",data:Re?{message:"Reset thread required",detail:x?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:Wa(Se),createdAt:new Date().toISOString()}]})),Mi(E,"error"),await Sn()}finally{Qi.current.delete(E),Jt.current.delete(E),pn.current.get(E)===Ee&&pn.current.delete(E),We(E,!1),await Ia(E)}}async function Ia(y){const k=Wi.current.get(y)??[];if(k.length===0)return;const[E,...M]=k;Wi.current.set(y,M),await Ua(y,E)}async function js(y,k={}){if(_t.current.has(y))return;const E=new AbortController;pn.current.set(y,E),We(y,!0);try{const M=k.waitMs?`?waitMs=${k.waitMs}`:"",I=ge(`conversations/${y}/turns/current/events${M}`),Q=await fetch(I,{signal:E.signal});if(!Q.ok||!Q.body)throw await Xt(Q,{method:"GET",url:I});await pp(Q.body,Ee=>{const Se=sp(Ee,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Se.turnId&&!Jt.current.has(y)&&Jt.current.set(y,Se.turnId),lt(y,be=>({...be,status:Fr(Se)??be.status,events:rp(be.events,Se)}));const Re=Fr(Se);Re&&Mi(y,Re)}),await _i(y),await Sn()}catch(M){if(!op(M)){if(rT(M)){await _i(y),await Sn();return}lt(y,I=>({...I,status:"error",events:[...I.events,{id:I.events.length+1,event:"client.error",data:Wa(M),createdAt:new Date().toISOString()}]}))}}finally{Jt.current.delete(y),pn.current.get(y)===E&&pn.current.delete(y),We(y,!1),await Ia(y)}}async function Ua(y,k,E={}){if(Jt.current.has(y)){const I=Wi.current.get(y)??[];I.includes(k)||Wi.current.set(y,[...I,k]);return}const M=new AbortController;pn.current.set(y,M),Jt.current.set(y,k),We(y,!0);try{const I=ge(`conversations/${y}/turns/${k}/events`),Q=await fetch(I,{signal:M.signal});if(!Q.ok||!Q.body)throw await Xt(Q,{method:"GET",url:I});await pp(Q.body,Ee=>{const Se=sp(Ee,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);lt(y,be=>({...be,status:Fr(Se)??be.status,events:rp(be.events,Se)}));const Re=Fr(Se);Re&&Mi(y,Re)}),await _i(y),await Sn()}catch(I){if(!op(I)){if(E.recovered&&aT(I)){await _i(y),await Sn();return}lt(y,Q=>({...Q,status:"error",events:[...Q.events,{id:Q.events.length+1,event:"client.error",data:Wa(I),createdAt:new Date().toISOString()}]}))}}finally{Jt.current.delete(y),pn.current.get(y)===M&&pn.current.delete(y),We(y,!1),await Ia(y)}}async function su(y,k){const E=`local-queued-${Date.now()}`;lt(y,M=>({...M,messages:[...M.messages,{id:E,role:"user",content:k,createdAt:new Date().toISOString()}]})),$l(y);try{const M=ge(`conversations/${y}/turns`),I=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue"})});if(!I.ok)throw await Xt(I,{method:"POST",url:M});const Q=await I.json();if(!Q.turnId)throw new Error("Queued turn did not return a turn id");Q.message?mi(y,E,Q.message,Q.turnId):En(y,E,Q.turnId),Ua(y,Q.turnId),await Sn(),Ae("success",Q.queuePosition?`Queued as next turn (${Q.queuePosition})`:"Started new turn")}catch(M){lt(y,I=>({...I,events:[...I.events,{id:I.events.length+1,event:"client.error",data:Wa(M),createdAt:new Date().toISOString()}]}))}}async function Cn(y,k){const E=Jt.current.get(y),M=`local-steer-${Date.now()}`;if(lt(y,I=>({...I,messages:[...I.messages,{id:M,role:"user",content:k,createdAt:new Date().toISOString(),turnId:E??null}],status:"running"})),$l(y),!E&&Qi.current.has(y)){Gl(y,k,M);return}try{const I=ge(E?`conversations/${y}/turns/${E}/steer`:`conversations/${y}/turns/steer`),Q=await fetch(I,ux(k));if(!Q.ok)throw await Xt(Q,{method:"POST",url:I});const Ee=await Q.json();Ee.message&&mi(y,M,Ee.message,E)}catch(I){lt(y,Q=>({...Q,events:[...Q.events,{id:Q.events.length+1,event:"client.error",data:Wa(I),createdAt:new Date().toISOString()}]}))}}function Gl(y,k,E){const M=Rl.current.get(y)??[];Rl.current.set(y,[...M,{message:k,localMessageId:E}])}async function Vl(y,k){const E=Rl.current.get(y)??[];if(E.length!==0){Rl.current.delete(y);for(const M of E){const I=await Ba(y,k,M.message);if(!I.ok)throw await Xt(I,{method:"POST",url:ge(`conversations/${y}/turns/${k}/steer`)});const Q=await I.json();Q.message&&mi(y,M.localMessageId,Q.message,k)}}}async function Ba(y,k,E){return fetch(ge(`conversations/${y}/turns/${k}/steer`),ux(E))}function mi(y,k,E,M){lt(y,I=>({...I,messages:wx(I.messages.filter(Q=>Q.id!==k),[{...E,turnId:M??E.turnId??null}])}))}function En(y,k,E){lt(y,M=>({...M,messages:M.messages.map(I=>I.id===k?{...I,turnId:E}:I)}))}async function Tn(){var E;if(!m||hr!=="running"&&!Aa)return;const y=m,k=Jt.current.get(y);(E=pn.current.get(y))==null||E.abort(),We(y,!1),lt(y,M=>({...M,status:"done",events:[...M.events,{id:M.events.length+1,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),Mi(y,"done");try{const M=ge(k?`conversations/${y}/turns/${k}/stop`:`conversations/${y}/turns/interrupt`),I=await fetch(M,{method:"POST"});if(!I.ok&&I.status!==409)throw await Xt(I,{method:"POST",url:M})}catch(M){lt(y,I=>({...I,events:[...I.events,{id:I.events.length+1,event:"client.error",data:Wa(M),createdAt:new Date().toISOString()}]}))}Jt.current.delete(y)}async function An(y,k){if(!m||!y.approvalTurnId||y.approvalRequestId===void 0)return;const E=m;try{const M=ge(`conversations/${E}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),I=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!I.ok)throw await Xt(I,{method:"POST",url:M});lt(E,Q=>({...Q,events:[...Q.events,{id:Q.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(M){lt(E,Q=>({...Q,events:[...Q.events,{id:Q.events.length+1,event:"client.error",data:Wa(M),createdAt:new Date().toISOString()}]}));const I=Et(M);Ae("error","Failed to respond to approval",I.detail??I.message)}}async function ln(y,k,E){const M=m;if(!M||!y.responsibilityProposalId)return!1;try{const I=ge(`conversations/${M}/responsibility-proposals/${encodeURIComponent(y.responsibilityProposalId)}`),Q=await fetch(I,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,responsibility:E})});if(!Q.ok)throw await Xt(Q,{method:"POST",url:I});const Ee=await Q.json();return Gn(Ee.conversation),lt(M,Se=>({...Se,events:[...Se.events,{id:`${y.id}:${k}`,event:"server.responsibility.decision",data:{proposalId:y.responsibilityProposalId,decision:k,responsibility:k==="accept"?E??y.body:null},createdAt:new Date().toISOString()}]})),Ae("success",k==="accept"?"Workspace responsibility updated":"Responsibility proposal declined"),!0}catch(I){console.error(I);const Q=Et(I);return Ae("error","Failed to respond to responsibility proposal",Q.detail??Q.message),!1}}async function an(y,k,E){const M=m;if(!(!M||!y.knowledgeProposalId))try{let I;if(k==="accept")try{I=JSON.parse(E??y.body)}catch{Ae("error","Knowledge proposal JSON is invalid");return}const Q=ge(`conversations/${M}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),Ee=await fetch(Q,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:I})});if(!Ee.ok)throw await Xt(Ee,{method:"POST",url:Q});const Se=await Ee.json();jl([...Se.items??[]].sort(Mx)),lt(M,Re=>({...Re,events:[...Re.events,{id:`${y.id}:${k}`,event:"server.knowledge.decision",data:{proposalId:y.knowledgeProposalId,decision:k,knowledge:k==="accept"?Se.item:null},createdAt:new Date().toISOString()}]})),Ae("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(I){console.error(I);const Q=Et(I);Ae("error","Failed to respond to knowledge proposal",Q.detail??Q.message)}}function gi(y){$(k=>{const E=k[y.id],M=y.events.map(I=>({id:I.id,turnId:I.turnId,seq:I.seq,event:I.event,data:I.data,createdAt:I.createdAt}));return{...k,[y.id]:{messages:y.messages,events:ap(M,(E==null?void 0:E.events)??[]),timelineNodes:Sx(y.timelineNodes??[],(E==null?void 0:E.timelineNodes)??[]),turns:kx(y.turns??[],(E==null?void 0:E.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:Go(y),loadingOlder:!1,fullEventTurnIds:(E==null?void 0:E.fullEventTurnIds)??new Set,loadingEventTurnIds:(E==null?void 0:E.loadingEventTurnIds)??new Set}}})}function ou(y){const k=Go(y);lt(y.id,E=>{var M,I,Q;return{...E,messages:wx(y.messages,E.messages),timelineNodes:Sx(y.timelineNodes??[],E.timelineNodes),turns:kx(y.turns??[],E.turns),events:ap(y.events.map(Ee=>({id:Ee.id,turnId:Ee.turnId,seq:Ee.seq,event:Ee.event,data:Ee.data,createdAt:Ee.createdAt})),E.events),contextVersions:(((M=y.contextVersions)==null?void 0:M.length)??0)>0?y.contextVersions??[]:E.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((I=E.history)==null?void 0:I.loadedMessageCount)??E.messages.length),loadedEventCount:k.loadedEventCount+(((Q=E.history)==null?void 0:Q.loadedEventCount)??E.events.length)},loadingOlder:!1}})}function lt(y,k){$(E=>{const M=E[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...E,[y]:k(M)}})}function Mi(y,k){d(E=>E.map(M=>M.id===y?{...M,status:k,updatedAt:new Date().toISOString()}:M))}function Gn(y){d(k=>uo(k.map(E=>E.id===y.id?{...E,...y}:E)))}async function $t(y,k){const E=k.filter(M=>{const I=P[y];return I&&!I.fullEventTurnIds.has(M)&&!I.loadingEventTurnIds.has(M)});if(E.length!==0){lt(y,M=>{const I=new Set(M.loadingEventTurnIds);for(const Q of E)I.add(Q);return{...M,loadingEventTurnIds:I}});try{const M=await Promise.all(E.map(I=>u2(y,I)));lt(y,I=>{const Q=new Set(I.fullEventTurnIds),Ee=new Set(I.loadingEventTurnIds),Se=M.flatMap((Re,be)=>{const mt=E[be];return Q.add(mt),Ee.delete(mt),Re.map(dt=>({id:dt.id,turnId:dt.turnId,seq:dt.seq,event:dt.event,data:dt.data,createdAt:dt.createdAt}))});return{...I,events:ap(I.events,Se),fullEventTurnIds:Q,loadingEventTurnIds:Ee}})}catch(M){console.error(M),lt(y,I=>{const Q=new Set(I.loadingEventTurnIds);for(const Ee of E)Q.delete(Ee);return{...I,loadingEventTurnIds:Q}}),Ae("error","Failed to load process details")}}}function We(y,k){const E=new Set(_t.current);k?E.add(y):E.delete(y),_t.current=E,Uo(M=>{const I=new Set(M);return k?I.add(y):I.delete(y),I})}function Ge(y){y.key!=="Enter"||!y.metaKey&&!y.ctrlKey||y.nativeEvent.isComposing||(y.preventDefault(),Di({forceNewTurn:y.shiftKey}))}function Oi(y){ur(k=>{const E=new Set(k);return E.has(y)?E.delete(y):E.add(y),ep(E),E})}function Nn(y){var k;return Yi.has(y.id)?"running":mp(y,((k=P[y.id])==null?void 0:k.status)??y.status)}function qa(y){var M;const k=(M=cr.current)==null?void 0:M.getBoundingClientRect(),E=k?y-k.left:y;return ih(E)}function Ri(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),wa(qa(y.clientX))}function uu(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),wa(qa(y.clientX)))}function cu(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const k=qa(y.clientX);wa(k),cT(k)}return o.jsxs("main",{className:`shell${Z?" mobile-sidebar-open":""}`,ref:cr,style:{"--sidebar-width":`${Bo}px`},children:[o.jsxs("aside",{className:"sidebar",children:[o.jsxs("div",{className:"sidebar-header",children:[o.jsxs("div",{children:[o.jsxs("p",{className:"eyebrow brand-line",children:[o.jsx("span",{children:"Seele"}),Te?o.jsxs("span",{children:["v",Te]}):null,o.jsx("span",{"aria-label":$x(Ce),className:`backend-status ${Ce}`,"data-label":$x(Ce)})]}),o.jsxs("div",{className:"sidebar-title-row",children:[o.jsx("h2",{children:"Workspaces"}),t?o.jsx("button",{"aria-label":`Sign out ${i.username}`,className:"sign-out-button",onClick:a,title:`Sign out ${i.username}`,type:"button",children:"Sign out"}):null]})]}),o.jsxs("div",{className:"sidebar-header-actions",children:[o.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>te(!1),title:"Close workspace list",type:"button",children:"×"}),o.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:xr,children:"+"})]})]}),o.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:ja.map(y=>o.jsxs("section",{className:["workspace-group",nn===y.id?"dragging":"",ns===y.id?"drop-after":"",(Zt==null?void 0:Zt.kind)==="group"&&Zt.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[o.jsxs("div",{className:"workspace-group-header",children:[o.jsxs("button",{"aria-expanded":!is.has(y.id),className:"workspace-group-toggle",onClick:k=>{if(ls.current){k.preventDefault(),ls.current=!1;return}Oi(y.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),al(y)},onPointerCancel:Ss,onPointerDown:k=>ks(k,y.id),onPointerMove:k=>vr(k,y.id),onPointerUp:k=>wr(k,y.id),type:"button",children:[o.jsx("span",{className:is.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),o.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),al(y)},title:"Double-click to rename",children:y.title})]}),y.id!==sx?o.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),rl(y)},title:"Delete group",type:"button",children:"×"}):null]}),is.has(y.id)?null:o.jsx("div",{className:"workspace-group-items",children:y.conversations.map(k=>{const E=Nn(k);return o.jsxs("div",{className:["session-item",k.id===m?"active":"",k.id===Fi?"dragging":"",(Zt==null?void 0:Zt.kind)==="workspace"&&Zt.id===k.id?`drop-${Zt.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:M=>{if(Ji.current){M.preventDefault(),Ji.current=!1;return}b(k.id),te(!1)},onDoubleClick:M=>{iu(M.target)||(M.preventDefault(),nu(k))},onKeyDown:M=>{Zc(M.target)||M.key==="Enter"&&(b(k.id),te(!1))},onPointerCancel:ql,onPointerDown:M=>$n(M,k.id),onPointerMove:M=>br(M,k.id),onPointerUp:M=>jn(M,k.id),role:"button",tabIndex:0,children:[o.jsxs("span",{className:"session-heading",children:[o.jsx("span",{"aria-label":gp(E,k.nextWakeup,di),className:`session-status ${E}`,title:gp(E,k.nextWakeup,di)}),o.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),E==="waiting"&&k.nextWakeup?o.jsx("span",{className:"session-countdown",title:gp(E,k.nextWakeup,di),children:Ip(k.nextWakeup,di)}):null,k.unreadTurnCount>0?o.jsx("span",{"aria-label":`${k.unreadTurnCount} unread turns`,className:"session-unread",title:`${k.unreadTurnCount} unread turns`,children:k.unreadTurnCount>99?"99+":k.unreadTurnCount}):null,E!=="running"?o.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:M=>{M.stopPropagation(),fe(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),o.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",Pr(k.id)]})]},k.id)})})]},y.id))}),o.jsx("footer",{className:"sidebar-footer",children:o.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[o.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:Da,type:"button",children:o.jsx(Cx,{})}),o.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:ll,type:"button",children:o.jsx(aN,{})}),o.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{Cl(!0),te(!1)},type:"button",children:o.jsx(Op,{})}),o.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Ma,type:"button",children:o.jsx(rN,{})}),o.jsx(rA,{usage:Hc})]})})]}),o.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>te(!1),tabIndex:Z?0:-1,type:"button"}),o.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Ri,onPointerMove:uu,onPointerUp:cu,role:"separator",tabIndex:0}),pr&&or?o.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${or.x+12}px, ${or.y+10}px, 0)`},children:[o.jsx("span",{className:"workspace-drag-title",children:pr.title}),o.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",Pr(pr.id)]})]}):null,C?o.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Sr,role:"presentation",children:o.jsxs("form",{className:"workspace-editor",onKeyDown:Sr,onSubmit:y=>void Hl(y),children:[o.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),o.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:ol,onKeyDown:Sr,value:C.title}),C.mode==="create"?o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),o.jsx("select",{id:"workspace-group",onChange:au,onKeyDown:Sr,value:C.groupId??((jr=h[0])==null?void 0:jr.id)??"",children:h.map(y=>o.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,o.jsxs("div",{className:"workspace-editor-actions",children:[o.jsx("button",{type:"button",onClick:sl,children:"Cancel"}),o.jsx("button",{disabled:A,type:"submit",children:A?"Saving...":C.mode==="create"?"Create":"Save"})]})]})}):null,qe?o.jsx("div",{className:"workspace-editor-overlay",onKeyDown:La,role:"presentation",children:o.jsxs("form",{className:"workspace-editor",onKeyDown:La,onSubmit:y=>void mn(y),children:[o.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),o.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:kr,onKeyDown:La,value:qe.title}),o.jsxs("div",{className:"workspace-editor-actions",children:[o.jsx("button",{type:"button",onClick:za,children:"Cancel"}),o.jsx("button",{type:"submit",children:qe.mode==="create"?"Create":"Save"})]})]})}):null,wt?o.jsx(_T,{currentUser:i,conversations:c,editingEnvironmentKey:sr,environmentDraft:Ti,globalEnvironment:bn,workspaceEnvironment:vn,memorySettings:ma,memorySettingsDraft:Mo,workspaceMemoryDraft:ga,runtimeSettings:Vt,runtimeModels:In,runtimeCodexVersion:yt,runtimeCodexReleasedAt:vi,runtimeCodexUpdating:(se==null?void 0:se.status)==="running",runtimeSettingsDraft:Qt,runtimeSettingsScope:Rt,settingsWorkspace:Dt,settingsWorkspaceId:bt,workspaceGroups:ja,workspaceRuntimeSettings:ar,workspaceRuntimeSettingsDraft:ji,managedUsers:re,onCancelEnvironmentEdit:Oa,onClose:()=>un(!1),onCreateUser:async y=>{const k=await W2(y);H(E=>[...E,k]),Ae("success","User created")},onDeleteUser:async y=>{await J2(y),H(k=>k.filter(E=>E.id!==y)),Ae("success","User deleted")},onDeleteEnvironment:y=>void Kc(y),onDraftChange:Gi,onEditEnvironment:hn,onRevealEnvironmentValue:y=>void Jo(y),onSaveBaseMemoryItems:y=>Wo(y),onSaveResponsibility:async(y,k)=>{try{const E=await pc(y,{responsibility:k});return Gn(E),N("connected"),Ae("success","Workspace responsibility saved"),E.responsibility}catch(E){throw console.error(E),N("error"),Ae("error","Failed to save workspace responsibility"),E}},onSaveWorkspaceMemoryItems:y=>bt?Zo(bt,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:tt,onUpdateCodexCli:()=>{ee(!0),fs(!0)},onRuntimeScopeChange:Ft,onSettingsWorkspaceChange:Xo,onSubmitRuntimeSettings:y=>void Po(y),onWorkspaceRuntimeDraftChange:Ci,onWorkspaceRuntimeReset:y=>bt?void Qo(bt,y):void 0,revealedEnvironmentKeys:Ht,onSubmitEnvironment:y=>void Fc(y),onUpdateUser:async(y,k)=>{const E=await Z2(y,k);H(M=>M.map(I=>I.id===E.id?E:I)),Ae("success","User updated")}}):null,wi?o.jsx(NT,{currentReleasedAt:vi,currentVersion:yt,job:se,latest:cn,latestChecking:Pt,starting:$e,onClose:()=>ee(!1),onRefresh:()=>void fs(),onStart:()=>void Vc()}):null,Ai&&ke?o.jsx(CT,{conversation:ke,knowledgeDraft:$i,workspaceKnowledge:Ro,tokenUsage:Ca,onCancelKnowledgeEdit:()=>Ei(oo),onDeleteKnowledge:y=>void Pc(ke.id,y),onEditKnowledge:Qc,onKnowledgeDraftChange:Ei,onSubmitKnowledge:y=>void Xc(ke.id,y),onClose:()=>ya(!1)}):null,zo?o.jsx(ET,{conversations:c,onClose:()=>Cl(!1),workspaceGroups:ja}):null,Jr?o.jsx(TT,{busy:El,conversation:Hn??null,conversationId:Jn,preview:(dn==null?void 0:dn.conversationId)===Jn?dn:null,previewLoading:Lo,result:zc,status:Ho,warmup:Vi,workspaceGroups:ja,onClose:()=>es(!1),onCancelResetPreview:()=>Bn(null),onPreviewReset:()=>void hs(),onResetRuntime:()=>void ms(),onWorkspaceChange:y=>{Ni(y),Tl(null),Bn(null)},onWarmupChange:xa}):null,Y?o.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!de&&K(null),children:o.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:xs,onMouseDown:y=>y.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{children:"Clone workspace"}),o.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),o.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>K(null),type:"button",children:"×"})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Name"}),o.jsx("input",{autoFocus:!0,value:Y.name,onChange:y=>K(k=>k&&{...k,name:y.target.value})})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Group"}),o.jsx("select",{value:Y.groupId,onChange:y=>K(k=>k&&{...k,groupId:y.target.value}),children:ja.map(y=>o.jsx("option",{value:y.id,children:y.title},y.id))})]}),o.jsxs("footer",{children:[o.jsx("button",{className:"secondary",disabled:de,onClick:()=>K(null),type:"button",children:"Cancel"}),o.jsx("button",{disabled:de||!Y.name.trim(),type:"submit",children:de?"Cloning...":"Clone"})]})]})}):null,L?o.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>z(null),children:o.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"complex-task-detail-title",children:L.title}),o.jsxs("p",{children:[Hx(L.status),L.startedAt&&L.finishedAt?` · ${Y2(L.startedAt,L.finishedAt)}`:""]})]}),o.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>z(null),type:"button",children:"×"})]}),o.jsxs("div",{className:"complex-task-detail task-record-detail",children:[o.jsxs("div",{children:[o.jsx("small",{children:"Objective"}),o.jsx("p",{children:L.objective??"No objective recorded."})]}),o.jsxs("div",{children:[o.jsx("small",{children:L.status==="completed"?"Final plan":"Current plan"}),L.currentPlan?o.jsx("article",{className:"message assistant complex-task-plan-preview",children:o.jsx("div",{className:"message-main",children:o.jsx("div",{className:"message-body",children:da(L.currentPlan.planMarkdown,ke)})})}):o.jsx("p",{children:"No plan recorded."})]}),o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Goal"}),o.jsx("dd",{children:L.codexGoalStatus??"not started"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Plan versions"}),o.jsx("dd",{children:L.planVersions.length})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Started"}),o.jsx("dd",{children:L.startedAt?et(L.startedAt):"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Finished"}),o.jsx("dd",{children:L.finishedAt?et(L.finishedAt):"—"})]})]})]}),o.jsx("footer",{children:o.jsx("button",{className:"secondary",onClick:()=>z(null),type:"button",children:"Close"})})]})}):null,D?o.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>W(null),children:o.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"system-event-detail-title",children:D.title}),o.jsx("p",{children:et(D.createdAt)})]}),o.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>W(null),type:"button",children:"×"})]}),o.jsx("div",{className:"system-event-detail-content",children:o.jsx(gc,{content:D.fullDetail??D.detail??"No additional details.",conversation:ke,streaming:!1,onPreviewArtifact:kn,onCopyArtifactUrl:el,copiedArtifactUrl:Wt})}),o.jsxs("footer",{children:[D.linkedTaskId?o.jsx("button",{onClick:()=>{const y=D.linkedTaskId;W(null),il(y)},type:"button",children:"View task"}):null,o.jsx("button",{className:"secondary",onClick:()=>W(null),type:"button",children:"Close"})]})]})}):null,me?o.jsx("div",{className:"memory-editor-overlay",onClick:()=>{xe||fe(null)},role:"presentation",children:o.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[o.jsxs("header",{children:[o.jsx("strong",{children:"Move Workspace to Recycle"}),o.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:xe,onClick:()=>fe(null),title:"Close",type:"button",children:"×"})]}),o.jsxs("p",{children:["Move ",o.jsx("strong",{children:me.title})," to recycle?"]}),o.jsx("code",{children:me.workspacePath}),o.jsxs("div",{className:"memory-delete-actions",children:[o.jsx("button",{className:"memory-dialog-button",disabled:xe,onClick:()=>fe(null),type:"button",children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button danger",disabled:xe,onClick:()=>void tu(me),type:"button",children:xe?"Moving...":"Move to recycle"})]})]})}):null,Al?o.jsxs("div",{className:`app-toast ${Al.tone}`,role:"status",children:[o.jsx("strong",{children:Al.text}),Al.detail?o.jsx("pre",{children:Al.detail}):null]}):null,o.jsxs("section",{className:"conversation",children:[o.jsxs("header",{className:"topbar",children:[o.jsxs("div",{className:"topbar-main",children:[o.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>te(!0),title:"Workspaces",type:"button",children:o.jsx(lN,{})}),o.jsxs("div",{className:"topbar-heading",children:[o.jsx("div",{className:"topbar-title-row",children:o.jsx("h1",{children:(ke==null?void 0:ke.title)??"New workspace"})}),ke?o.jsxs("p",{className:"topbar-workspace",children:["workspaces/",Pr(ke.id)]}):null]})]}),o.jsx("div",{className:"topbar-actions",children:ke?o.jsxs(o.Fragment,{children:[ke.threadUpgradeRequired?o.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Ma,title:`当前 Thread 工具集已过期(${ke.threadCapabilityVersion} / ${ke.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:o.jsx(Cv,{})}):null,o.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:Bl,title:"Clone workspace",type:"button",children:o.jsx(iN,{})}),o.jsxs("button",{className:`context-button has-usage ${ch(Ea??0)}`,onClick:()=>ya(!0),style:{"--context-usage":`${uh(Ea??0)}%`},title:Ca&&Ea!==null?`Context ${Math.round(Ea)}% · ${Qn(Ca.totalTokens)} / ${xc(Ca.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[o.jsx("span",{children:"Context"}),o.jsxs("strong",{children:[Math.round(Ea??0),"%"]})]}),o.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:Yc,title:"Workspace settings",type:"button",children:o.jsx(Cx,{})})]}):null})]}),x?o.jsxs("section",{className:`complex-task-bar ${x.status}`,children:[o.jsxs("button",{className:"complex-task-summary",onClick:()=>void il(x.id),title:"View complex task details",type:"button",children:[o.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),o.jsx("strong",{children:x.title}),o.jsx("span",{className:"complex-task-state",children:Hx(x.status)}),o.jsx("span",{className:"complex-task-duration",children:V2(x,di)})]}),o.jsxs("div",{className:"complex-task-actions",children:[hp(x.status,"discussing","ready","replanning")?o.jsx("button",{disabled:!x.objective||!x.currentPlan,onClick:()=>void nl("start"),title:x.objective&&x.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,x.status==="active"?o.jsx("button",{onClick:()=>void nl("pause"),type:"button",children:"Pause"}):null,hp(x.status,"paused","waiting","blocked")?o.jsx("button",{onClick:()=>void nl("resume"),type:"button",children:"Resume"}):null,hp(x.status,"active","paused","waiting","blocked")?o.jsx("button",{className:"secondary",onClick:()=>void nl("replan"),type:"button",children:"Replan"}):null,o.jsx("button",{className:"quiet danger",onClick:()=>void nl("end"),type:"button",children:"End task"})]})]}):null,(ke==null?void 0:ke.status)==="initialization_failed"&&ke.cloneLineage?o.jsxs("div",{className:"clone-initialization-error",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Clone initialization failed"}),o.jsx("span",{children:ke.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),o.jsx("button",{onClick:()=>void Ra(),type:"button",children:"Retry with a clean thread"})]}):null,o.jsx("div",{className:"stream",onScroll:()=>void $c(),ref:Dl,style:{scrollPaddingBottom:qo},children:o.jsxs("div",{className:"stream-inner",style:{paddingBottom:qo},children:[zl.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("h2",{children:"Start a workspace"})}):null,o.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[ke!=null&&ke.cloneLineage&&ss.size>0?o.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[o.jsxs("strong",{children:["Inherited from ",ke.cloneLineage.sourceWorkspaceTitle]}),o.jsxs("span",{children:["through ",et(ke.cloneLineage.snapshotAt)," · ",ke.cloneLineage.importedMessageCount," messages"]})]}):null,(Yl=nt==null?void 0:nt.history)!=null&&Yl.hasMoreBefore?o.jsx("div",{className:"history-loader",children:nt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,rs.map((y,k)=>{var Ee,Se,Re;const E=((Ee=y.user)==null?void 0:Ee.type)==="system",M=y.turnIds.some(be=>ss.has(be)),I=rs[k+1],Q=M&&(!I||!I.turnIds.some(be=>ss.has(be)));return o.jsxs(R.Fragment,{children:[o.jsxs("section",{className:`turn-group${M?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?o.jsxs("div",{className:`turn-panel ${E?"system-turn":"user-turn"}`,children:[mo(y.user,ke,kn,el,Wt,An,ln,an,il,W),o.jsx(go,{copied:Nl===`${E?"system":"user"}-${y.id}-bottom`,content:yo(y.user),id:`${E?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:Na})]}):null,y.followupUsers.length>0?o.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(be=>o.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[o.jsx("span",{className:"followup-user-label",children:"Added while running"}),mo(be,ke,kn,el,Wt,An,ln,an,il,W),o.jsx(go,{copied:Nl===`user-${be.id}-bottom`,content:yo(be),id:`user-${be.id}-bottom`,timestamp:be.createdAt,variant:"outside",onCopy:Na})]},be.id))}):null,(Se=y.acceptedSystemInputs)==null?void 0:Se.map(be=>o.jsxs("div",{className:"turn-panel system-turn",children:[mo(be,ke,kn,el,Wt,An,ln,an,il,W),o.jsx(go,{copied:Nl===`system-${be.id}-bottom`,content:yo(be),id:`system-${be.id}-bottom`,timestamp:be.createdAt,variant:"outside",onCopy:Na})]},be.id)),y.agentItems.length>0?o.jsx(XT,{group:y,conversation:ke,allowProcessView:!M,copiedFooter:Nl===`agent-${y.id}-bottom`,copiedArtifactUrl:Wt,running:!M&&wo(y.turnIds,Ta),onCopyArtifactUrl:el,onCopyBubble:Na,onPreviewArtifact:kn,onLoadProcessDetails:be=>ke&&!M?$t(ke.id,be):void 0,onRespondApproval:An,onRespondResponsibilityProposal:ln,onRespondKnowledgeProposal:an,onOpenComplexTask:il,onOpenSystemEvent:W}):null,(Re=y.trailingSystemItems)==null?void 0:Re.map(be=>o.jsxs("div",{className:"turn-panel system-turn",children:[mo(be,ke,kn,el,Wt,An,ln,an,il,W),o.jsx(go,{copied:Nl===`system-${be.id}-bottom`,content:yo(be),id:`system-${be.id}-bottom`,timestamp:be.createdAt,variant:"outside",onCopy:Na})]},be.id))]}),Q?o.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),o.jsxs("form",{className:"composer",onSubmit:hi,ref:Ki,children:[Il?o.jsxs("div",{className:`global-activity ${Il.tone??"running"}`,children:[mr?o.jsx("button",{"aria-label":"Stop current agent run",className:"turn-stop activity-stop",onClick:()=>void Tn(),title:"Stop current agent run",type:"button",children:o.jsx(WT,{})}):o.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),o.jsxs("div",{className:"global-activity-text",children:[o.jsx("span",{children:Il.title}),Il.detail?o.jsx("small",{children:Il.detail}):null]}),mr?o.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,o.jsxs("div",{className:"composer-panel",children:[o.jsxs("button",{"aria-label":x?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!x||S==="complex",className:`complex-mode-button ${x||S==="complex"?"active":""}`,disabled:!!x,onClick:()=>T(y=>y==="complex"?"simple":"complex"),title:x?"End the current complex task before switching back":S==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[o.jsx(ov,{}),o.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:x?"Complex task active":S==="complex"?"Complex task mode on":"Complex task mode off"})]}),o.jsx("textarea",{onChange:y=>ru(y.target.value),onKeyDown:Ge,placeholder:"Cmd/Ctrl + Enter",ref:Xi,value:r}),o.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:!r.trim(),type:"submit",children:[o.jsx(ZT,{}),o.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[o.jsxs("span",{children:[o.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),o.jsxs("span",{children:[o.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),wn?o.jsx("div",{className:"artifact-lightbox",onClick:()=>kn(null),role:"presentation",children:o.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[o.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>kn(null),type:"button",children:"×"}),o.jsx("img",{alt:wn.name,src:wn.url}),o.jsxs("figcaption",{children:[o.jsx("span",{children:wn.name}),o.jsxs("div",{className:"artifact-lightbox-actions",children:[o.jsx("a",{href:wn.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),o.jsx("button",{onClick:()=>void el(wn),type:"button",children:Wt===wn.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function CT({conversation:t,knowledgeDraft:i,workspaceKnowledge:a,tokenUsage:r,onCancelKnowledgeEdit:u,onDeleteKnowledge:c,onEditKnowledge:d,onKnowledgeDraftChange:h,onSubmitKnowledge:g,onClose:m}){const[b,x]=R.useState("overview"),[w,S]=R.useState(!1),[T,L]=R.useState(!1),[z,D]=R.useState(null),[W,Y]=R.useState(null),[K,de]=R.useState(!1),[_,Z]=R.useState(null),[te,P]=R.useState(null),[$,oe]=R.useState(!1),[ue,Te]=R.useState(null),[he,re]=R.useState(null),H=Iv(r),le=z?N2(z):null;R.useEffect(()=>{S(!1),D(null),Y(null),Z(null),P(null),Te(null),re(null)},[t.id]),R.useEffect(()=>{b==="additionalContext"&&!_&&Ce()},[b,_]),R.useEffect(()=>{b==="compactions"&&!ue&&N()},[b,ue]);const ye=()=>{S(!0),L(!0),Y(null),RN(t.id).then(C=>D(C)).catch(C=>{const B=Et(C);Y(B.detail?`${B.message}
|
|
82
|
+
${B.detail}`:B.message)}).finally(()=>L(!1))},Ce=()=>{de(!0),P(null),LN(t.id).then(C=>Z(C)).catch(C=>{const B=Et(C);P(B.detail?`${B.message}
|
|
83
|
+
${B.detail}`:B.message)}).finally(()=>de(!1))},N=()=>{oe(!0),re(null),IN(t.id).then(C=>Te(C)).catch(C=>{const B=Et(C);re(B.detail?`${B.message}
|
|
84
|
+
${B.detail}`:B.message)}).finally(()=>oe(!1))};return o.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:m,role:"presentation",children:o.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:C=>C.stopPropagation(),children:[o.jsxs("header",{className:"context-panel-header workspace-context-header",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"Workspace Context"}),o.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),o.jsx("button",{"aria-label":"Close context panel",onClick:m,type:"button",children:"×"})]}),o.jsxs("div",{className:"workspace-context-body",children:[o.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[o.jsxs("button",{className:b==="overview"?"active":void 0,onClick:()=>x("overview"),type:"button",children:[o.jsx("span",{children:"Overview"}),o.jsx("small",{children:"Identity + state"})]}),o.jsxs("button",{className:b==="responsibility"?"active":void 0,onClick:()=>x("responsibility"),type:"button",children:[o.jsx("span",{children:"Responsibility"}),o.jsx("small",{children:"Long-lived role"})]}),o.jsxs("button",{className:b==="knowledge"?"active":void 0,onClick:()=>x("knowledge"),type:"button",children:[o.jsx("span",{children:"Knowledge"}),o.jsx("small",{children:"Sources + skills"})]}),o.jsxs("button",{className:b==="runtime"?"active":void 0,onClick:()=>x("runtime"),type:"button",children:[o.jsx("span",{children:"Runtime View"}),o.jsx("small",{children:"Thread + tokens"})]}),o.jsxs("button",{className:b==="compactions"?"active":void 0,onClick:()=>x("compactions"),type:"button",children:[o.jsx("span",{children:"Compactions"}),o.jsx("small",{children:"Context history"})]}),o.jsxs("button",{className:b==="additionalContext"?"active":void 0,onClick:()=>x("additionalContext"),type:"button",children:[o.jsx("span",{children:"Additional Context"}),o.jsx("small",{children:"Injected keys"})]})]}),o.jsx("div",{className:"workspace-context-content",children:b==="overview"?o.jsxs("div",{className:"workspace-context-grid",children:[o.jsxs("section",{className:"context-card",children:[o.jsx("h3",{children:"Workspace"}),o.jsx(at,{label:"Name",value:t.title}),o.jsx(at,{label:"ID",value:`workspaces/${Pr(t.id)}`,mono:!0}),o.jsx(at,{label:"Path",value:t.workspacePath,mono:!0})]}),o.jsxs("section",{className:"context-card",children:[o.jsx("h3",{children:"Context Assets"}),o.jsx(at,{label:"Responsibility",value:t.responsibility.trim()?"configured":"missing"}),o.jsx(at,{label:"Memory",value:t.memory.trim()?"configured":"empty"}),o.jsx(at,{label:"Knowledge",value:`${a.length} item${a.length===1?"":"s"}`})]}),o.jsxs("section",{className:"context-card wide",children:[o.jsx("h3",{children:"Current Responsibility"}),t.responsibility.trim()?o.jsx("div",{className:"context-markdown-preview",children:da(t.responsibility,t)}):o.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),o.jsxs("section",{className:"context-card wide",children:[o.jsx("h3",{children:"Knowledge Index"}),o.jsx(sv,{items:a,onDelete:c,onEdit:C=>{d(C),x("knowledge")}})]})]}):b==="responsibility"?o.jsxs("section",{className:"context-tab-surface",children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Workspace Responsibility"}),o.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),t.responsibility.trim()?o.jsx("div",{className:"context-card context-markdown-preview",children:da(t.responsibility,t)}):o.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):b==="knowledge"?o.jsx(UT,{draft:i,items:a,scope:"workspace",workspaceName:t.title,onCancel:u,onDelete:c,onDraftChange:h,onEdit:d,onSubmit:g}):b==="runtime"?o.jsxs("div",{className:"workspace-context-grid",children:[o.jsxs("section",{className:"context-card",children:[o.jsx("h3",{children:"Runtime"}),o.jsx(at,{label:"Runtime thread",value:t.codexThreadId??"not started",mono:!0}),o.jsxs("div",{className:"thread-read-actions",children:[o.jsx("button",{disabled:T,onClick:ye,type:"button",children:T?"Reading...":"Read Codex thread"}),w?o.jsx("button",{disabled:T,onClick:()=>S(!1),type:"button",children:"Hide"}):null]})]}),o.jsxs("section",{className:"context-card",children:[o.jsx("h3",{children:"Token Window"}),r?o.jsxs(o.Fragment,{children:[o.jsx(at,{label:"Used",value:H===null?"unknown":`${Math.round(H)}%`,mono:!0}),o.jsx(at,{label:"Latest usage",value:r.modelContextWindow?`${Qn(r.totalTokens)} / ${Qn(r.modelContextWindow)}`:Qn(r.totalTokens),mono:!0}),H!==null?o.jsx("div",{className:`context-token-bar ${ch(H)}`,children:o.jsx("span",{style:{width:`${uh(H)}%`}})}):null,o.jsx(at,{label:"Input / output",value:`${xc(r.inputTokens)} / ${xc(r.outputTokens)}`,mono:!0}),o.jsx(at,{label:"Reasoning",value:xc(r.reasoningOutputTokens),mono:!0}),o.jsxs("p",{className:"context-muted",children:["Updated ",et(r.createdAt),"."]})]}):o.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),w?o.jsxs("section",{className:"context-card wide thread-read-panel",children:[o.jsx("h3",{children:"Runtime thread profile"}),o.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),T?o.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):W?o.jsx("pre",{className:"thread-read-error",children:W}):z?o.jsxs(o.Fragment,{children:[le?o.jsx(YT,{summary:le}):null,o.jsxs("details",{className:"thread-read-raw",open:!0,children:[o.jsx("summary",{children:"Raw thread/read JSON"}),o.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(z,null,2)})]})]}):o.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):b==="compactions"?o.jsxs("section",{className:"context-tab-surface",children:[o.jsxs("header",{className:"settings-section-header",children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Context Compactions"}),o.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),o.jsx("button",{className:"context-refresh-button",disabled:$,onClick:N,type:"button",children:$?"Refreshing...":"Refresh"})]}),he?o.jsx("pre",{className:"thread-read-error",children:he}):$&&!ue?o.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):ue!=null&&ue.length?o.jsx("div",{className:"context-compaction-list",children:ue.map(C=>o.jsxs("article",{className:"context-compaction-item",children:[o.jsxs("div",{className:"context-compaction-heading",children:[o.jsx("time",{children:et(C.completedAt??C.usageObservedAt??C.startedAt??"")}),o.jsx("span",{className:`context-compaction-status ${C.status}`,children:C.status==="completed"?"Completed":"Running"})]}),o.jsx("dl",{className:"context-compaction-facts",children:k2(C).map(B=>o.jsxs("div",{children:[o.jsx("dt",{children:B.label}),o.jsx("dd",{children:B.value})]},B.label))}),o.jsxs("small",{children:[pa(C.id),C.turnId?` · turn ${pa(C.turnId)}`:""]})]},C.id))}):o.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):o.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Additional Context"}),o.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),K?o.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):te?o.jsx("pre",{className:"thread-read-error",children:te}):_?o.jsx(GT,{preview:_,refreshing:K,onRefresh:Ce}):o.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function ET({conversations:t,onClose:i,workspaceGroups:a}){var N;const[r,u]=R.useState([]),[c,d]=R.useState("active"),[h,g]=R.useState(null),[m,b]=R.useState([]),[x,w]=R.useState(!0),[S,T]=R.useState(null),[L,z]=R.useState(null),[D,W]=R.useState(!1),[Y,K]=R.useState(!1),[de,_]=R.useState(new Set),[Z,te]=R.useState({title:"",publicDescription:"",ownerWorkspaceId:((N=t[0])==null?void 0:N.id)??"",participantWorkspaceIds:[]}),P=r.find(C=>C.id===h)??null,$=R.useMemo(()=>new Map(t.map(C=>[C.id,C.title])),[t]),oe=r.filter(C=>c==="archived"?C.status==="archived":C.status!=="archived"),ue=a.map(C=>({...C,conversations:C.conversations.filter(B=>B.id!==Z.ownerWorkspaceId)})).filter(C=>C.conversations.length>0),Te=()=>{var C;te({title:"",publicDescription:"",ownerWorkspaceId:((C=t[0])==null?void 0:C.id)??"",participantWorkspaceIds:[]}),_(new Set),z("create")},he=()=>{!P||P.status!=="active"||(te({title:P.title,publicDescription:P.publicDescription,ownerWorkspaceId:P.ownerWorkspaceId,participantWorkspaceIds:P.members.filter(C=>C.role==="participant"&&C.status==="active").map(C=>C.workspaceId)}),_(new Set),z("edit"))},re=async(C,B=c)=>{var A;w(!0),T(null);try{const ae=await Nx();u(ae);const me=ae.filter(xe=>B==="archived"?xe.status==="archived":xe.status!=="archived"),fe=(C&&me.some(xe=>xe.id===C)?C:null)??(h&&me.some(xe=>xe.id===h)?h:((A=me[0])==null?void 0:A.id)??null);g(fe),b(fe?await fc(fe):[])}catch(ae){T(ae instanceof qi?ae.detail:ae instanceof Error?ae.message:String(ae))}finally{w(!1)}};R.useEffect(()=>{re()},[]),R.useEffect(()=>{const C=window.setInterval(()=>{(async()=>{try{const B=await Nx();u(B),h&&B.some(A=>A.id===h)&&b(await fc(h))}catch{}})()},1e4);return()=>window.clearInterval(C)},[h]);const H=async C=>{g(C),T(null);try{b(await fc(C))}catch(B){T(B instanceof qi?B.detail:B instanceof Error?B.message:String(B))}},le=async C=>{var A;if(C===c)return;d(C),T(null);const B=((A=r.find(ae=>C==="archived"?ae.status==="archived":ae.status!=="archived"))==null?void 0:A.id)??null;if(g(B),!B){b([]);return}try{b(await fc(B))}catch(ae){T(ae instanceof qi?ae.detail:ae instanceof Error?ae.message:String(ae))}},ye=async C=>{var B;if(C.preventDefault(),!(!Z.title.trim()||!Z.ownerWorkspaceId)){K(!0),T(null);try{const A=L==="edit"&&P?await mN(P.id,{expectedVersion:P.version,title:Z.title.trim(),publicDescription:Z.publicDescription.trim(),participantWorkspaceIds:Z.participantWorkspaceIds}):await hN({...Z,title:Z.title.trim(),publicDescription:Z.publicDescription.trim()});d("active"),z(null),te({title:"",publicDescription:"",ownerWorkspaceId:((B=t[0])==null?void 0:B.id)??"",participantWorkspaceIds:[]}),await re(A.id,"active")}catch(A){T(A instanceof qi?A.detail:A instanceof Error?A.message:String(A))}finally{K(!1)}}},Ce=async()=>{if(!(!P||P.status!=="active")){K(!0),T(null);try{const C=await gN(P.id,P.version);W(!1),d("active"),await re(void 0,"active")}catch(C){T(C instanceof qi?C.detail:C instanceof Error?C.message:String(C))}finally{K(!1)}}};return o.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:o.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:C=>C.stopPropagation(),children:[o.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"协作"}),o.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),o.jsxs("div",{className:"collaboration-header-actions",children:[o.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Te,title:"新建 Topic",type:"button",children:"+"}),o.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),S?o.jsx("div",{className:"collaboration-error",children:S}):null,o.jsxs("div",{className:"collaboration-body",children:[o.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[o.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[o.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void le("active"),role:"tab",type:"button",children:"当前"}),o.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void le("archived"),role:"tab",type:"button",children:"已归档"})]}),x?o.jsx("p",{children:"正在加载..."}):oe.length===0?o.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):oe.map(C=>o.jsxs("button",{className:`collaboration-topic-entry${C.id===h?" active":""}`,onClick:()=>void H(C.id),type:"button",children:[o.jsx("span",{children:C.title}),o.jsxs("small",{children:[C.members.length," 个工作空间 · ",C.status]})]},C.id))]}),o.jsx("main",{className:"collaboration-topic-detail",children:P?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h3",{children:P.title}),o.jsx("p",{children:P.publicDescription||"没有公开描述。"})]}),o.jsxs("div",{className:"collaboration-topic-actions",children:[o.jsx("span",{children:P.status}),P.status==="active"?o.jsxs(o.Fragment,{children:[o.jsx("button",{"aria-label":`编辑 Topic ${P.title}`,className:"memory-icon-button",onClick:he,title:"编辑",type:"button",children:o.jsx(Oc,{})}),o.jsx("button",{"aria-label":`归档 Topic ${P.title}`,className:"memory-icon-button",onClick:()=>W(!0),title:"归档",type:"button",children:o.jsx(sN,{})})]}):null]})]}),o.jsx("div",{className:"collaboration-members",children:P.members.filter(C=>C.status==="active").map(C=>o.jsxs("span",{children:[C.workspaceTitleSnapshot,o.jsx("small",{children:C.role})]},`${C.workspaceId}-${C.membershipVersion}`))}),o.jsx("div",{className:"collaboration-message-list",children:m.length===0?o.jsx("p",{children:"还没有消息。"}):m.map(C=>o.jsxs("article",{children:[o.jsxs("header",{children:[o.jsx("strong",{children:C.senderTitleSnapshot}),o.jsx("span",{children:C.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${Ev(C.recipientWorkspaceIds.map(B=>$.get(B)??pa(B)))}`}),o.jsx("time",{children:et(C.createdAt)})]}),o.jsx("div",{className:"markdown-body",children:da(C.contentMarkdown,void 0)})]},C.id))})]}):o.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),L?o.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!Y&&z(null),children:o.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:C=>C.stopPropagation(),onSubmit:ye,children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h3",{children:L==="edit"?"编辑 Topic":"新建 Topic"}),o.jsx("p",{children:L==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),o.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>z(null),type:"button",children:"×"})]}),o.jsxs("label",{children:["标题",o.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:Z.title,onChange:C=>te(B=>({...B,title:C.target.value}))})]}),o.jsxs("label",{children:["公开描述",o.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:Z.publicDescription,onChange:C=>te(B=>({...B,publicDescription:C.target.value}))})]}),o.jsxs("label",{children:["Owner 工作空间",o.jsx("select",{disabled:L==="edit",value:Z.ownerWorkspaceId,onChange:C=>te(B=>({...B,ownerWorkspaceId:C.target.value,participantWorkspaceIds:B.participantWorkspaceIds.filter(A=>A!==C.target.value)})),children:a.map(C=>o.jsx("optgroup",{label:C.title,children:C.conversations.map(B=>o.jsx("option",{value:B.id,children:B.title},B.id))},C.id))})]}),o.jsxs("fieldset",{className:"collaboration-participant-groups",children:[o.jsx("legend",{children:"参与工作空间"}),o.jsxs("div",{className:"collaboration-participant-toolbar",children:[o.jsxs("span",{children:[Z.participantWorkspaceIds.length," 个已选择"]}),o.jsxs("div",{children:[o.jsx("button",{onClick:()=>_(new Set),type:"button",children:"全部展开"}),o.jsx("button",{onClick:()=>_(new Set(ue.map(C=>C.id))),type:"button",children:"全部收起"})]})]}),ue.map(C=>{const B=C.conversations,A=B.filter(me=>Z.participantWorkspaceIds.includes(me.id)).length,ae=de.has(C.id);return o.jsxs("section",{className:"collaboration-participant-group",children:[o.jsxs("header",{children:[o.jsxs("button",{"aria-expanded":!ae,className:"collaboration-group-toggle",onClick:()=>_(me=>{const fe=new Set(me);return fe.has(C.id)?fe.delete(C.id):fe.add(C.id),fe}),type:"button",children:[o.jsx("span",{"aria-hidden":"true",className:ae?void 0:"expanded",children:"›"}),o.jsx("strong",{children:C.title}),o.jsxs("small",{children:[A,"/",B.length]})]}),o.jsxs("label",{title:`选择 ${C.title} 全部工作空间`,children:[o.jsx("input",{checked:A===B.length,onChange:()=>te(me=>{const fe=B.map(ze=>ze.id),xe=new Set(me.participantWorkspaceIds);return fe.every(ze=>xe.has(ze))?fe.forEach(ze=>xe.delete(ze)):fe.forEach(ze=>xe.add(ze)),{...me,participantWorkspaceIds:Array.from(xe)}}),type:"checkbox"}),o.jsx("span",{children:"全选"})]})]}),ae?null:o.jsx("div",{children:B.map(me=>o.jsxs("label",{className:"collaboration-participant-option",children:[o.jsx("input",{checked:Z.participantWorkspaceIds.includes(me.id),onChange:fe=>te(xe=>({...xe,participantWorkspaceIds:fe.target.checked?[...xe.participantWorkspaceIds,me.id]:xe.participantWorkspaceIds.filter(ze=>ze!==me.id)})),type:"checkbox"}),o.jsx("span",{children:me.title})]},me.id))})]},C.id)})]}),o.jsxs("footer",{children:[o.jsx("button",{className:"secondary",disabled:Y,onClick:()=>z(null),type:"button",children:"取消"}),o.jsx("button",{disabled:Y||!Z.title.trim()||!Z.ownerWorkspaceId,type:"submit",children:Y?"正在保存...":L==="edit"?"保存":"创建 Topic"})]})]})}):null,D&&P?o.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!Y&&W(!1),role:"presentation",children:o.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:C=>C.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h3",{children:"归档 Topic"}),o.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),o.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>W(!1),type:"button",children:"×"})]}),o.jsx("strong",{children:P.title}),o.jsxs("footer",{children:[o.jsx("button",{className:"secondary",disabled:Y,onClick:()=>W(!1),type:"button",children:"取消"}),o.jsx("button",{className:"danger",disabled:Y,onClick:()=>void Ce(),type:"button",children:Y?"正在归档...":"归档"})]})]})}):null]})})}function TT({busy:t,conversation:i,conversationId:a,preview:r,previewLoading:u,result:c,status:d,warmup:h,workspaceGroups:g,onCancelResetPreview:m,onClose:b,onPreviewReset:x,onResetRuntime:w,onWorkspaceChange:S,onWarmupChange:T}){const L=!i||t||d==="running";return o.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:b,role:"presentation",children:o.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:z=>z.stopPropagation(),children:[o.jsxs("header",{className:"context-panel-header console-panel-header",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"Console"}),o.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),o.jsxs("div",{className:"console-header-actions",children:[o.jsxs("label",{className:"console-workspace-picker",children:[o.jsx("span",{children:"Workspace"}),o.jsx("select",{disabled:t,onChange:z=>S(z.target.value),value:a??"",children:g.map(z=>o.jsx("optgroup",{label:z.title,children:z.conversations.map(D=>o.jsxs("option",{value:D.id,children:[D.title," · workspaces/",Pr(D.id)]},D.id))},z.id))})]}),o.jsx("button",{"aria-label":"Close console",onClick:b,type:"button",children:"×"})]})]}),o.jsx("div",{className:"console-body",children:o.jsxs("section",{className:"console-card",children:[o.jsxs("div",{className:"console-card-heading",children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Workspace Runtime"}),o.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),o.jsx("span",{className:`console-status ${d}`,children:d})]}),o.jsxs("dl",{className:"console-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Workspace"}),o.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"ID"}),o.jsx("dd",{children:i?`workspaces/${Pr(i.id)}`:"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Thread"}),o.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),o.jsxs("label",{className:"console-toggle",children:[o.jsx("input",{checked:h,onChange:z=>T(z.target.checked),type:"checkbox"}),o.jsxs("span",{children:["Run a warmup turn after reset",o.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),o.jsxs("div",{className:"console-actions",children:[o.jsx("button",{className:"danger",disabled:L||u,onClick:x,type:"button",children:u?"Preparing preview...":"Preview runtime reset"}),d==="running"?o.jsx("span",{children:"Stop the running turn before resetting."}):null]}),c?o.jsxs("div",{className:"console-result",children:[o.jsx("strong",{children:"Runtime reset completed"}),o.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),o.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?o.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),r?o.jsx(AT,{busy:t,preview:r,warmup:h,onCancel:m,onConfirm:w}):null]})})}function AT({busy:t,preview:i,warmup:a,onCancel:r,onConfirm:u}){return o.jsx("div",{className:"reset-preview-overlay",onClick:t?void 0:r,role:"presentation",children:o.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:"reset-preview-dialog",onClick:c=>c.stopPropagation(),role:"dialog",children:[o.jsxs("header",{className:"reset-preview-header",children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Confirm runtime reset"}),o.jsx("p",{children:"Visible history that will be restored, with each message's original time."})]}),o.jsx("button",{"aria-label":"Close reset preview",disabled:t,onClick:r,type:"button",children:"×"})]}),o.jsxs("div",{className:"reset-preview-summary",children:[o.jsxs("span",{children:[i.injectedItemCount," items"]}),o.jsxs("span",{children:[i.injectedUserMessageCount," user"]}),o.jsxs("span",{children:[i.injectedAssistantMessageCount," assistant"]}),o.jsx("span",{children:a?"Warmup enabled":"No warmup"})]}),o.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((c,d)=>o.jsxs("article",{className:`reset-preview-item ${c.role}`,children:[o.jsxs("header",{children:[o.jsx("span",{children:d+1}),o.jsx("strong",{children:c.role}),o.jsx("time",{dateTime:c.createdAt,children:et(c.createdAt)})]}),o.jsx("pre",{children:c.content})]},`${c.role}-${c.createdAt}-${d}`)):o.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),o.jsxs("footer",{className:"reset-preview-actions",children:[o.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),o.jsxs("div",{children:[o.jsx("button",{disabled:t,onClick:r,type:"button",children:"Cancel"}),o.jsx("button",{className:"danger",disabled:t,onClick:u,type:"button",children:t?"Resetting...":"Confirm reset"})]})]})]})})}function NT({currentReleasedAt:t,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:h,onStart:g}){const m=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&U2(r.version,m)?I2(r.version):null;return R.useEffect(()=>{const x=w=>{w.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),o.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:o.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Codex CLI update"}),o.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),o.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),o.jsxs("dl",{className:"codex-update-summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Status"}),o.jsx("dd",{className:a?`status-${a.status}`:void 0,children:(a==null?void 0:a.status)??"Not started"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Current"}),o.jsx("dd",{children:Lp(m,(a==null?void 0:a.codexReleasedAt)??t)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Latest"}),o.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?Lp(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?o.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),a?o.jsxs("div",{children:[o.jsx("dt",{children:"Started"}),o.jsx("dd",{children:et(a.startedAt)})]}):null]}),r!=null&&r.error?o.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",r.error]}):null,o.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:a!=null&&a.logs.length?a.logs.map((x,w)=>o.jsxs("div",{className:`log-${x.stream}`,children:[o.jsx("time",{children:L2(x.at)}),o.jsx("span",{children:x.text})]},`${x.at}-${w}`)):o.jsx("p",{children:"No update logs yet."})}),o.jsxs("footer",{children:[o.jsx("button",{className:"secondary",onClick:h,type:"button",children:"Refresh"}),o.jsx("button",{disabled:c||(a==null?void 0:a.status)==="running",onClick:g,type:"button",children:c?"Starting...":(a==null?void 0:a.status)==="running"?"Updating...":a?"Run again":"Start update"})]})]})})}function _T({currentUser:t,conversations:i,editingEnvironmentKey:a,environmentDraft:r,globalEnvironment:u,workspaceEnvironment:c,memorySettings:d,memorySettingsDraft:h,managedUsers:g,workspaceMemoryDraft:m,runtimeSettings:b,runtimeModels:x,runtimeCodexVersion:w,runtimeCodexReleasedAt:S,runtimeCodexUpdating:T,runtimeSettingsDraft:L,runtimeSettingsScope:z,settingsWorkspace:D,settingsWorkspaceId:W,workspaceGroups:Y,workspaceRuntimeSettings:K,workspaceRuntimeSettingsDraft:de,onCancelEnvironmentEdit:_,onClose:Z,onCreateUser:te,onDeleteUser:P,onDeleteEnvironment:$,onDraftChange:oe,onEditEnvironment:ue,onSaveBaseMemoryItems:Te,onSaveResponsibility:he,onSaveWorkspaceMemoryItems:re,onRevealEnvironmentValue:H,onRuntimeDraftChange:le,onUpdateCodexCli:ye,onRuntimeScopeChange:Ce,onSettingsWorkspaceChange:N,onSubmitRuntimeSettings:C,onSubmitEnvironment:B,onUpdateUser:A,onWorkspaceRuntimeDraftChange:ae,onWorkspaceRuntimeReset:me,revealedEnvironmentKeys:fe}){const[xe,ze]=R.useState("model"),[qe,Tt]=R.useState(!1),[wt,un]=R.useState(null),[bn,kt]=R.useState(!1),[vn,Oe]=R.useState((D==null?void 0:D.responsibility)??""),[Vt,Zn]=R.useState(!1),In=R.useRef(null),oi=z==="workspace"?Object.values((K==null?void 0:K.sources)??{}).filter(yt=>yt==="workspace").length:0;return R.useEffect(()=>{z==="global"&&kt(!1)},[z]),R.useEffect(()=>{Oe((D==null?void 0:D.responsibility)??"")},[D==null?void 0:D.id,D==null?void 0:D.responsibility]),R.useEffect(()=>{if(!bn)return;const yt=vi=>{var wi;const At=vi.target;At instanceof Node&&((wi=In.current)!=null&&wi.contains(At))||kt(!1)},Yt=vi=>{vi.key==="Escape"&&kt(!1)};return document.addEventListener("pointerdown",yt,!0),document.addEventListener("keydown",Yt,!0),()=>{document.removeEventListener("pointerdown",yt,!0),document.removeEventListener("keydown",Yt,!0)}},[bn]),o.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:Z,role:"presentation",children:o.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:yt=>yt.stopPropagation(),children:[o.jsxs("header",{className:"context-panel-header settings-panel-header",children:[o.jsxs("div",{className:"settings-panel-title",children:[o.jsx("h2",{children:"Settings"}),o.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[t.role==="admin"?o.jsx("button",{"aria-checked":z==="global",className:z==="global"?"active":void 0,onClick:()=>Ce("global"),role:"radio",type:"button",children:"Global"}):null,o.jsxs("div",{className:"settings-workspace-picker",ref:In,children:[o.jsx("button",{"aria-checked":z==="workspace","aria-expanded":z==="workspace"?bn:void 0,"aria-label":z==="workspace"?"Settings workspace target":void 0,className:z==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(z!=="workspace"){Ce("workspace");return}kt(yt=>!yt)},role:"radio",type:"button",children:z==="workspace"?o.jsxs(o.Fragment,{children:[o.jsxs("span",{children:["Workspace: ",(D==null?void 0:D.title)??"Select workspace"]}),o.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),z==="workspace"&&bn?o.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:Y.map(yt=>o.jsxs("div",{className:"settings-workspace-menu-group",children:[o.jsx("div",{className:"settings-workspace-menu-heading",children:yt.title}),yt.conversations.map(Yt=>o.jsxs("button",{"aria-selected":Yt.id===W,className:Yt.id===W?"selected":void 0,onClick:()=>{N(Yt.id),kt(!1)},role:"option",type:"button",children:[o.jsx("span",{children:Yt.title}),o.jsxs("small",{children:["workspaces/",Yt.id]})]},Yt.id))]},yt.id))}):null]})]})]}),o.jsx("div",{className:"settings-header-actions",children:o.jsx("button",{"aria-label":"Close settings panel",onClick:Z,type:"button",children:"×"})})]}),o.jsxs("div",{className:"settings-body",children:[o.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[o.jsxs("button",{className:xe==="model"?"active":void 0,onClick:()=>ze("model"),type:"button",children:[o.jsx("span",{children:"Runtime"}),o.jsx("small",{children:"Effective settings"})]}),o.jsxs("button",{className:xe==="responsibility"?"active":void 0,onClick:()=>ze("responsibility"),type:"button",children:[o.jsx("span",{children:"Responsibility"}),o.jsx("small",{children:"Workspace role"})]}),o.jsxs("button",{className:xe==="memory"?"active":void 0,onClick:()=>ze("memory"),type:"button",children:[o.jsx("span",{children:"Memory"}),o.jsx("small",{children:"Base + workspace context"})]}),o.jsxs("button",{className:xe==="environment"?"active":void 0,onClick:()=>ze("environment"),type:"button",children:[o.jsx("span",{children:"Environment"}),o.jsx("small",{children:"Base + workspace variables"})]}),t.role==="admin"?o.jsxs("button",{className:xe==="users"?"active":void 0,onClick:()=>ze("users"),type:"button",children:[o.jsx("span",{children:"Users"}),o.jsx("small",{children:"Access + roles"})]}):null]}),o.jsxs("section",{className:"settings-content",children:[o.jsxs("div",{className:`settings-scope-banner ${z==="workspace"?"workspace":"global"}`,children:[o.jsx("strong",{children:z==="workspace"?"Editing workspace custom settings":"Editing global settings"}),o.jsx("span",{children:z==="workspace"?`${(D==null?void 0:D.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}),xe==="users"?o.jsx(MT,{currentUser:t,users:g,onCreate:te,onDelete:P,onUpdate:A}):xe==="model"?o.jsx(OT,{draft:z==="workspace"?de:L,globalSettings:b,models:x,codexVersion:w,codexReleasedAt:S,codexUpdating:T,scope:z,workspaceOverrideCount:oi,settings:z==="workspace"?(K==null?void 0:K.effective)??de:b,workspaceSettings:K,onDraftChange:z==="workspace"?ae:le,onResetWorkspaceSetting:me,onSubmit:C,onUpdateCodexCli:ye}):xe==="responsibility"?o.jsx(DT,{draft:vn,saving:Vt,scope:z,workspace:D,onDraftChange:Oe,onSubmit:yt=>{yt.preventDefault(),yt.stopPropagation(),!(z!=="workspace"||!D)&&(Zn(!0),he(D.id,vn).then(Yt=>Oe(Yt)).finally(()=>Zn(!1)))}}):xe==="memory"?o.jsx(RT,{baseSettings:d,scope:z,workspaceSettings:m,workspaceName:D==null?void 0:D.title,onSaveBaseItems:Te,onSaveWorkspaceItems:re}):o.jsx(IT,{deleteConfirmKey:wt,editingEnvironmentKey:a,environmentDraft:r,globalEnvironment:u,scope:z,workspaceEnvironment:c,valueVisible:qe,onCancelEnvironmentEdit:_,onDeleteConfirmChange:un,onDeleteEnvironment:$,onDraftChange:oe,onEditEnvironment:ue,onRevealEnvironmentValue:H,onSubmitEnvironment:B,onValueVisibleChange:Tt,revealedEnvironmentKeys:fe})]})]})]})})}function DT({draft:t,saving:i,scope:a,workspace:r,onDraftChange:u,onSubmit:c}){const d=a==="workspace";return o.jsxs(o.Fragment,{children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Responsibility"}),o.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),d&&r?o.jsxs("form",{className:"settings-responsibility-form",onSubmit:c,children:[o.jsxs("label",{children:[o.jsx("span",{children:r.title}),o.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:h=>u(h.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:t})]}),o.jsx("div",{className:"settings-form-actions",children:o.jsx("button",{disabled:i,type:"submit",children:i?"Saving...":"Save responsibility"})})]}):o.jsx("section",{className:"settings-readonly-block",children:o.jsxs("div",{children:[o.jsx("strong",{children:"Workspace-only setting"}),o.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function MT({currentUser:t,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,h]=R.useState(null),[g,m]=R.useState(c),[b,x]=R.useState(!1),[w,S]=R.useState(null),[T,L]=R.useState("");function z(){m(c),L(""),h("new")}function D(K){m({username:K.username,password:"",role:K.role,active:K.active}),L(""),h(K)}function W(){b||(h(null),L(""))}async function Y(K){if(K.preventDefault(),!!d){x(!0),L("");try{d==="new"?await a({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),h(null)}catch(de){L(Et(de).message)}finally{x(!1)}}}return o.jsxs("section",{className:"settings-section user-management-section",children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Users"}),o.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),o.jsx("div",{className:"memory-items-editor-header actions-only",children:o.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:z,title:"Add user",type:"button",children:"+"})}),o.jsxs("div",{className:"user-list",children:[i.map(K=>o.jsxs("div",{className:"user-list-item",children:[o.jsxs("div",{className:"user-list-main",children:[o.jsxs("div",{children:[o.jsx("strong",{children:K.username}),K.id===t.id?o.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),o.jsxs("small",{children:["Created ",et(K.createdAt)]})]}),o.jsx("span",{className:`user-role-badge role-${K.role}`,children:K.role}),o.jsx("span",{className:`user-status ${K.active?"active":"disabled"}`,children:K.active?"Active":"Disabled"}),o.jsxs("div",{className:"user-row-actions",children:[o.jsx("button",{"aria-label":`Edit user ${K.username}`,className:"memory-icon-button",onClick:()=>D(K),title:"Edit",type:"button",children:o.jsx(Oc,{})}),o.jsx("button",{"aria-label":`Delete user ${K.username}`,className:"memory-icon-button memory-item-delete",disabled:K.id===t.id,onClick:()=>{L(""),S(K)},title:"Delete",type:"button",children:"×"})]})]},K.id)),i.length===0?o.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?o.jsx("div",{className:"memory-editor-overlay",onClick:W,role:"presentation",children:o.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:K=>K.stopPropagation(),onSubmit:K=>void Y(K),children:[o.jsxs("header",{children:[o.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),o.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:W,title:"Close",type:"button",children:"×"})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Username"}),o.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:K=>m(de=>({...de,username:K.target.value})),placeholder:"Sign-in username",value:g.username})]}),o.jsxs("label",{children:[o.jsx("span",{children:d==="new"?"Initial password":"New password"}),o.jsx("input",{autoComplete:"new-password",minLength:8,onChange:K=>m(de=>({...de,password:K.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Role"}),o.jsxs("select",{disabled:d!=="new"&&d.id===t.id,onChange:K=>m(de=>({...de,role:K.target.value==="admin"?"admin":"user"})),value:g.role,children:[o.jsx("option",{value:"user",children:"User"}),o.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?o.jsxs("label",{className:"user-editor-active",children:[o.jsx("input",{checked:g.active,disabled:d.id===t.id,onChange:K=>m(de=>({...de,active:K.target.checked})),type:"checkbox"}),o.jsx("span",{children:"Account active"})]}):null,T?o.jsx("p",{className:"memory-editor-error",children:T}):null,o.jsxs("div",{className:"memory-editor-actions",children:[o.jsx("button",{className:"memory-dialog-button",onClick:W,type:"button",children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button primary",disabled:b||!g.username.trim()||d==="new"&&g.password.length<8||d!=="new"&&g.password.length>0&&g.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,w?o.jsx("div",{className:"memory-editor-overlay",onClick:()=>S(null),role:"presentation",children:o.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:K=>K.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("strong",{children:"Delete User"}),o.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>S(null),title:"Close",type:"button",children:"×"})]}),o.jsxs("p",{children:["Delete ",o.jsx("strong",{children:w.username}),". Users that own workspaces must be disabled instead."]}),T?o.jsx("p",{className:"memory-editor-error",children:T}):null,o.jsxs("div",{className:"memory-delete-actions",children:[o.jsx("button",{className:"memory-dialog-button",onClick:()=>S(null),type:"button",children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(w.id).then(()=>S(null)).catch(K=>L(Et(K).message))},type:"button",children:"Delete"})]})]})}):null]})}function OT({codexReleasedAt:t,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:h,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:w,onUpdateCodexCli:S}){var L;const T=d==="workspace";return o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"settings-section-header",children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Runtime"}),o.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),T?o.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),o.jsxs("form",{className:"settings-form runtime-form",onSubmit:w,children:[o.jsxs("label",{className:fo(T,Ui(r.model,u.model,m==null?void 0:m.sources.model)),children:[o.jsx(co,{globalValue:Ux(u.model,c),isWorkspaceScope:T,label:"Model",settingKey:"model",source:Ui(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),o.jsx(ip,{"aria-label":"Runtime model",onChange:z=>b({...r,model:z}),options:B2(c,r.model),value:r.model||((L=c.find(z=>z.isDefault))==null?void 0:L.model)||""})]}),o.jsxs("label",{className:fo(T,Ui(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[o.jsx(co,{globalValue:Ix(u.reasoningEffort),isWorkspaceScope:T,label:"Reasoning effort",settingKey:"reasoningEffort",source:Ui(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),o.jsx(ip,{"aria-label":"Runtime reasoning effort",onChange:z=>b({...r,reasoningEffort:z}),options:iT,value:r.reasoningEffort})]}),o.jsxs("label",{className:fo(T,Ui(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[o.jsx(co,{globalValue:qx(u.sandbox),isWorkspaceScope:T,label:"Permission mode",settingKey:"sandbox",source:Ui(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),o.jsx(ip,{"aria-label":"Permission mode",onChange:z=>b({...r,sandbox:z}),options:lT,value:r.sandbox})]}),o.jsxs("label",{className:fo(T,Ui(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[o.jsxs("span",{children:[o.jsx(co,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:T,label:"Fast mode",settingKey:"fastMode",source:Ui(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:x}),o.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),o.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:z=>b({...r,fastMode:z.target.checked}),type:"checkbox"})]}),o.jsxs("label",{className:fo(T,Ui(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),"settings-toggle-field"),children:[o.jsxs("span",{children:[o.jsx(co,{globalValue:u.notifyEnabled?"On":"Off",isWorkspaceScope:T,label:"Profuse notification",settingKey:"notifyEnabled",source:Ui(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),onReset:x}),o.jsx("small",{children:"Send DingTalk notification when a turn finishes or fails"})]}),o.jsx("input",{"aria-label":"Enable Profuse notification",checked:r.notifyEnabled,onChange:z=>b({...r,notifyEnabled:z.target.checked}),type:"checkbox"})]}),o.jsxs("dl",{className:"runtime-summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Current"}),o.jsxs("dd",{children:["Model ",Ux(h.model,c),", reasoning"," ",Ix(h.reasoningEffort),", Fast mode"," ",h.fastMode?"on":"off",", permission"," ",qx(h.sandbox),", notification"," ",h.notifyEnabled?"on":"off","."]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Codex CLI"}),o.jsxs("dd",{className:"runtime-version-value",children:[o.jsx("span",{children:Lp(i,t)}),o.jsx("button",{className:"runtime-update-button",disabled:a,onClick:S,type:"button",children:a?"Updating...":"Check update"})]})]})]}),o.jsx("div",{className:"settings-form-actions",children:o.jsx("button",{type:"submit",children:T?"Save workspace overrides":"Save global runtime"})})]})]})}function co({globalValue:t,isWorkspaceScope:i,label:a,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return o.jsxs("span",{className:"runtime-field-label",children:[o.jsx("span",{children:a}),i?o.jsxs("span",{className:"runtime-field-meta",children:[o.jsx("span",{className:d?"override":"inherited",children:d?"Workspace override":`Inherited: ${t}`}),d?o.jsx("button",{type:"button",onClick:()=>c(r),children:"Reset"}):null]}):null]})}function ip({"aria-label":t,onChange:i,options:a,value:r}){const[u,c]=R.useState(!1),d=R.useRef(null),h=a.find(g=>g.value===r)??a[0]??null;return R.useEffect(()=>{if(!u)return;function g(b){var x;(x=d.current)!=null&&x.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),o.jsxs("div",{className:"runtime-select",ref:d,children:[o.jsxs("button",{"aria-expanded":u,"aria-label":t,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[o.jsx("span",{children:(h==null?void 0:h.label)??r}),o.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?o.jsx("div",{className:"runtime-select-menu",role:"listbox",children:a.map(g=>o.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Ui(t,i,a){return t!==i?"workspace":a}function fo(t,i,a="settings-wide-field"){return[a,t?"workspace-scoped":"",t&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function RT({baseSettings:t,scope:i,workspaceSettings:a,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",h=d?a.items:t.items,g=d?c:u;return o.jsxs(o.Fragment,{children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),o.jsx("p",{children:d?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),d?o.jsxs("section",{className:"settings-readonly-block",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Base Memory"}),o.jsx("span",{children:"Read-only in workspace scope"})]}),o.jsx(LT,{emptyText:"No base memory is configured.",items:t.items,readonly:!0})]}):null,o.jsx("div",{className:"memory-manager-shell",children:o.jsx(zT,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:h,onSaveItems:g,title:""})})]})}function zT({ariaLabel:t,emptyText:i,items:a,onSaveItems:r,title:u}){var Z;const[c,d]=R.useState(jo(a)),[h,g]=R.useState(null),[m,b]=R.useState({key:"",value:""}),[x,w]=R.useState(null),[S,T]=R.useState(null),[L,z]=R.useState(null);R.useEffect(()=>{d(jo(a))},[a]),R.useEffect(()=>{if(h===null)return;const te=P=>{P.key==="Escape"&&(K(),T(null))};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[h]);async function D(te,P){z(P);try{const $=await r(te);return d(jo($)),$}finally{z(null)}}function W(){T(null),w(null),b({key:"",value:""}),g("new")}function Y(te){const P=c[te];P&&(T(null),w(null),b({...P}),g(te))}function K(){g(null),w(null),b({key:"",value:""})}async function de(te){const P=c[te],$=(P==null?void 0:P.key)||`${te}`;await D(c.filter((oe,ue)=>ue!==te),`delete:${$}`),T(null)}async function _(te){te.preventDefault(),te.stopPropagation();const P=m.key.trim(),$=GN(P);if($){w($);return}const oe=m.value.trim();if(!oe){w("Value is required.");return}const ue=h==="new"?-1:h;if(c.some((he,re)=>re!==ue&&he.key.trim()===P)){w(`Key "${P}" already exists. Each memory key must be unique.`);return}const Te={...m,key:P,value:oe};h==="new"?await D([...c,Te],"add"):typeof h=="number"&&await D(c.map((he,re)=>re===h?Te:he),`save:${h}`),K()}return o.jsxs("section",{className:"memory-items-manager","aria-label":t,children:[o.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?o.jsx("span",{children:u}):null,o.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:W,children:"+"})]}),c.length?o.jsx("div",{className:"memory-items-grid",children:c.map((te,P)=>o.jsxs("div",{className:"memory-item-display",children:[o.jsxs("pre",{"aria-label":`Memory item ${te.key}`,children:[o.jsx("span",{className:"memory-tag",children:`<${te.key}>`}),`
|
|
85
|
+
`,o.jsx("span",{children:te.value}),`
|
|
86
|
+
`,o.jsx("span",{className:"memory-tag",children:`</${te.key}>`})]}),o.jsxs("div",{className:"memory-item-actions",children:[o.jsx("button",{"aria-label":`Edit memory item ${te.key||P+1}`,className:"memory-icon-button memory-item-edit",disabled:L!==null,title:"Edit",type:"button",onClick:()=>Y(P),children:"✎"}),o.jsx("button",{"aria-label":`Delete memory item ${te.key||P+1}`,className:"memory-icon-button memory-item-delete",disabled:L!==null,title:"Delete",type:"button",onClick:()=>T(P),children:"×"})]})]},`${P}-${te.key}`))}):o.jsx("p",{className:"settings-note",children:i}),h!==null?o.jsx("div",{className:"memory-editor-overlay",onClick:K,role:"presentation",children:o.jsxs("form",{"aria-label":h==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:te=>te.stopPropagation(),onSubmit:te=>void _(te),children:[o.jsxs("header",{children:[o.jsx("strong",{children:h==="new"?"Add Memory":"Edit Memory"}),o.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:K,children:"×"})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Key"}),o.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:te=>b(P=>({...P,key:te.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Value · up to 1000 tokens"}),o.jsx("textarea",{onChange:te=>b(P=>({...P,value:te.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),x?o.jsx("p",{className:"memory-editor-error",children:x}):null,o.jsxs("div",{className:"memory-editor-actions",children:[o.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:K,children:"Cancel"}),o.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:L!==null,type:"submit",children:L==="add"||L!=null&&L.startsWith("save:")?"Saving...":"Save"})]})]})}):null,S!==null?o.jsx("div",{className:"memory-editor-overlay",onClick:()=>T(null),role:"presentation",children:o.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:te=>te.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("strong",{children:"Delete Memory"}),o.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>T(null),children:"×"})]}),o.jsxs("p",{children:["Delete"," ",o.jsx("code",{children:((Z=c[S])==null?void 0:Z.key)||`item ${S+1}`}),"?"]}),o.jsxs("div",{className:"memory-delete-actions",children:[o.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:L!==null,type:"button",onClick:()=>T(null),children:"Cancel"}),o.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:L!==null,type:"button",onClick:()=>void de(S),children:"Delete"})]})]})}):null]})}function LT({emptyText:t,items:i}){const a=jo(i);return a.length?o.jsx("div",{className:"memory-items-list",children:a.map(r=>o.jsx("div",{className:"memory-item-display memory-item-readonly",children:o.jsxs("pre",{"aria-label":`Memory item ${r.key}`,children:[o.jsx("span",{className:"memory-tag",children:`<${r.key}>`}),`
|
|
87
|
+
`,o.jsx("span",{children:r.value}),`
|
|
88
|
+
`,o.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):o.jsx("p",{className:"settings-note",children:t})}function IT({deleteConfirmKey:t,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:h,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:w,onSubmitEnvironment:S,onValueVisibleChange:T,revealedEnvironmentKeys:L}){const z=i!==null&&L.has(i),D=u==="workspace",W=D?c:r,[Y,K]=R.useState(!1);function de(){h(),b({description:"",key:"",value:""}),T(!1),K(!0)}function _(P){x(P),T(!1),K(!0)}function Z(){K(!1),h(),T(!1)}function te(P){S(P),K(!1)}return o.jsxs(o.Fragment,{children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:D?"Workspace Environment":"Base Environment"}),o.jsx("p",{children:D?"Workspace variables are stored in this workspace and are merged with base variables for new runs.":"Base variables are injected into every new workspace run. Existing runs keep the environment they started with."})]})}),D?o.jsxs("section",{className:"settings-readonly-block",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Base Environment"}),o.jsx("span",{children:"Read-only in workspace scope"})]}),o.jsx(dx,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,o.jsxs("section",{className:"environment-manager",children:[o.jsx("div",{className:"memory-items-editor-header actions-only",children:o.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:de,children:"+"})}),o.jsx(dx,{emptyText:D?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:P=>g(P),onEdit:_,variables:W})]}),Y?o.jsx("div",{className:"memory-editor-overlay",onClick:Z,role:"presentation",children:o.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:P=>P.stopPropagation(),onSubmit:te,children:[o.jsxs("header",{children:[o.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),o.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:Z,children:"×"})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Key"}),o.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:P=>b({...a,key:P.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:a.key})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Value"}),o.jsxs("span",{className:"environment-value-field",children:[o.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:P=>b({...a,value:P.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:a.value}),o.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!z&&!a.value){w(i),T(!0);return}T(!d)},title:d?"Hide value":"Show value",type:"button",children:d?o.jsx(uN,{}):o.jsx(oN,{})})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Description"}),o.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:P=>b({...a,description:P.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:a.description})]}),o.jsxs("div",{className:"memory-editor-actions",children:[o.jsx("button",{className:"memory-dialog-button",type:"button",onClick:Z,children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button primary",disabled:!a.key.trim(),type:"submit",children:"Save"})]})]})}):null,t?o.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:o.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:P=>P.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("strong",{children:"Delete Environment"}),o.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),o.jsxs("p",{children:["Delete ",o.jsx("code",{children:t}),"?"]}),o.jsxs("div",{className:"memory-delete-actions",children:[o.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(t),g(null)},children:"Delete"})]})]})}):null]})}function dx({emptyText:t,onDelete:i,onEdit:a,readonly:r=!1,variables:u}){return u.length===0?o.jsx("p",{className:"settings-note",children:t}):o.jsx("div",{className:r?"environment-list readonly":"environment-list",children:u.map(c=>o.jsxs("div",{className:r?"environment-row readonly":"environment-row",children:[o.jsxs("div",{className:"environment-row-main",children:[o.jsxs("pre",{"aria-label":`Environment variable ${c.key}`,children:[o.jsx("span",{className:"memory-tag",children:c.key}),"=",c.hasValue?"••••••":"",c.description?o.jsx("span",{className:"environment-comment",children:` # ${c.description}`}):null]}),o.jsxs("span",{children:[c.hasValue?"configured":"empty"," · updated"," ",et(c.updatedAt)]})]}),r?o.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):o.jsxs("div",{className:"environment-row-actions",children:[o.jsx("button",{"aria-label":`Edit ${c.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>a==null?void 0:a(c),title:"Edit",type:"button",children:"✎"}),o.jsx("button",{"aria-label":`Delete ${c.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>i==null?void 0:i(c.key),title:"Delete",type:"button",children:"×"})]})]},c.key))})}function sv({items:t,onDelete:i,onEdit:a}){const[r,u]=R.useState(null),[c,d]=R.useState(null);return t.length===0?o.jsxs("section",{className:"knowledge-empty",children:[o.jsx("h4",{children:"No knowledge registered"}),o.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):o.jsx("div",{className:"knowledge-list",children:t.map(h=>o.jsxs("article",{className:"knowledge-row",children:[o.jsxs("div",{className:"knowledge-row-main",children:[o.jsxs("header",{children:[o.jsx("strong",{children:h.name}),o.jsx("span",{children:BT(h.kind)}),o.jsx("span",{className:$T(h.status),children:qT(h.status)})]}),o.jsx("p",{children:h.purpose||h.description||"No purpose set."}),o.jsxs("div",{className:"knowledge-paths",children:[o.jsx("code",{children:h.digestPath}),o.jsx("code",{children:h.skillPath}),o.jsx("code",{children:h.fetch.scriptPath})]}),h.fetch.requiredEnv.length>0?o.jsx("div",{className:"knowledge-envs",children:h.fetch.requiredEnv.map(g=>o.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===h.id?o.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,o.jsxs("small",{children:[h.attention," · ",HT(h.refreshPolicy)," · updated ",et(h.updatedAt)]})]}),o.jsx("div",{className:"environment-row-actions",children:r===h.id?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"danger",onClick:()=>{i(h.id),u(null)},type:"button",children:"Delete"}),o.jsx("button",{onClick:()=>u(null),type:"button",children:"Cancel"})]}):o.jsxs(o.Fragment,{children:[o.jsx("button",{"aria-label":`Check ${h.name}`,onClick:()=>d(h.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),o.jsx("button",{"aria-label":`Edit ${h.name}`,onClick:()=>a(h),title:"Edit knowledge",type:"button",children:o.jsx(Oc,{})}),o.jsx("button",{"aria-label":`Delete ${h.name}`,onClick:()=>u(h.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},h.id))})}function UT({draft:t,items:i,scope:a,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:h,onSubmit:g}){return a==="workspace"?o.jsxs(o.Fragment,{children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Workspace Knowledge"}),o.jsxs("p",{children:["Long-lived source-backed material for ",r??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),o.jsx(sv,{items:i,onDelete:c,onEdit:h}),t.id?o.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[o.jsxs("div",{className:"knowledge-form-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Edit metadata"}),o.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),o.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),o.jsxs("div",{className:"knowledge-form-grid",children:[o.jsxs("label",{children:[o.jsx("span",{children:"Name"}),o.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...t,name:b.target.value}),value:t.name})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Kind"}),o.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...t,kind:b.target.value}),value:t.kind,children:[o.jsx("option",{value:"source",children:"Source"}),o.jsx("option",{value:"skill",children:"Skill"}),o.jsx("option",{value:"reference",children:"Reference"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Status"}),o.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...t,status:b.target.value}),value:t.status,children:[o.jsx("option",{value:"draft",children:"Draft"}),o.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),o.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),o.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),o.jsx("option",{value:"ready",children:"Ready"}),o.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Attention"}),o.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...t,attention:b.target.value}),value:t.attention,children:[o.jsx("option",{value:"none",children:"None"}),o.jsx("option",{value:"tracked",children:"Tracked"}),o.jsx("option",{value:"watch",children:"Watch"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Refresh"}),o.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...t,refreshPolicy:b.target.value}),value:t.refreshPolicy,children:[o.jsx("option",{value:"manual",children:"Manual"}),o.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),o.jsxs("label",{className:"settings-wide-field",children:[o.jsx("span",{children:"Purpose"}),o.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...t,purpose:b.target.value}),rows:2,value:t.purpose})]}),o.jsxs("label",{className:"settings-wide-field",children:[o.jsx("span",{children:"Content"}),o.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...t,description:b.target.value}),rows:2,value:t.description})]}),o.jsxs("label",{className:"settings-wide-field",children:[o.jsx("span",{children:"Source clues"}),o.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...t,sourceCluesText:b.target.value}),rows:4,value:t.sourceCluesText})]}),o.jsxs("label",{className:"settings-wide-field",children:[o.jsx("span",{children:"Required environment"}),o.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...t,requiredEnvText:b.target.value}),rows:3,value:t.requiredEnvText})]}),o.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),o.jsx("div",{className:"settings-form-actions",children:o.jsx("button",{disabled:!t.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):o.jsxs("section",{className:"settings-empty-section",children:[o.jsx("h3",{children:"Workspace Knowledge"}),o.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function BT(t){return t==="skill"?"Skill":t==="reference"?"Reference":"Source"}function qT(t){return t.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function HT(t){return t==="low-frequency-check"?"low-frequency check":"manual refresh"}function $T(t){return t==="ready"?"knowledge-status ready":t==="needs_credentials"||t==="invalid_credentials"||t==="needs_fetch_method"?"knowledge-status warning":t==="stale_signal"?"knowledge-status stale":"knowledge-status"}function at({label:t,value:i,mono:a=!1}){return o.jsxs("div",{className:"context-field",children:[o.jsx("span",{children:t}),o.jsx("strong",{className:a?"mono":void 0,title:i,children:i})]})}function GT({onRefresh:t,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=R.useMemo(()=>Object.entries(i.context).map(([d,h])=>[d,VT(h)]).sort(([d],[h])=>{const g=r.indexOf(d),m=r.indexOf(h);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(h)}),[i.context]),c=d=>{var h;(h=document.getElementById(fx(d)))==null||h.scrollIntoView({behavior:"smooth",block:"start"})};return o.jsxs("div",{className:"additional-context-preview",children:[o.jsx("div",{className:"additional-context-header",children:o.jsxs("div",{className:"additional-context-meta",children:[o.jsxs("span",{children:["Generated ",et(i.generatedAt)]}),o.jsxs("span",{children:[Qn(u.length)," keys"]}),o.jsx("button",{disabled:a,onClick:t,type:"button",children:a?"Rendering...":"Refresh"})]})}),o.jsxs("div",{className:"additional-context-toc",children:[o.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),o.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>o.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),o.jsx("div",{className:"additional-context-list",children:u.map(([d,h])=>o.jsxs("section",{className:"additional-context-item",id:fx(d),children:[o.jsxs("header",{children:[o.jsxs("code",{children:["<",d,">"]}),o.jsxs("span",{children:[Qn(h.length)," chars"]})]}),o.jsx("pre",{children:h})]},d))})]})}function fx(t){return`additional-context-${t.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function VT(t){if(typeof t=="string")return t;if(t!==null&&typeof t=="object"&&"value"in t&&typeof t.value=="string")return t.value;if(t==null)return"";try{return JSON.stringify(t,null,2)}catch{return String(t)}}function YT({summary:t}){return o.jsxs("div",{className:"thread-read-summary",children:[o.jsxs("section",{className:"thread-read-summary-grid",children:[o.jsx(at,{label:"Thread",value:t.id,mono:!0}),o.jsx(at,{label:"Session",value:t.sessionId,mono:!0}),o.jsx(at,{label:"Status",value:t.status}),o.jsx(at,{label:"Source",value:t.source}),o.jsx(at,{label:"Created",value:ho(t.createdAt)}),o.jsx(at,{label:"Updated",value:ho(t.updatedAt)}),o.jsx(at,{label:"Recency",value:ho(t.recencyAt)}),o.jsx(at,{label:"Turns",value:Qn(t.turnCount),mono:!0}),o.jsx(at,{label:"Items",value:Qn(t.itemCount),mono:!0}),o.jsx(at,{label:"User / agent",value:`${Qn(t.userMessageCount)} / ${Qn(t.agentMessageCount)}`,mono:!0}),o.jsx(at,{label:"Compactions",value:`${Qn(t.compactionCount)} / ${Qn(t.contextCompactionCount)} context`,mono:!0}),o.jsx(at,{label:"CWD",value:t.cwd,mono:!0}),o.jsx(at,{label:"Path",value:t.path,mono:!0})]}),t.preview?o.jsxs("details",{className:"thread-read-preview",children:[o.jsx("summary",{children:"Preview"}),o.jsx("p",{children:t.preview})]}):null,o.jsxs("section",{className:"thread-read-turns",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Turns"}),o.jsxs("span",{children:[t.turns.length," turn",t.turns.length===1?"":"s"]})]}),o.jsx("div",{className:"thread-read-turn-list",children:t.turns.map((i,a)=>o.jsxs("details",{className:"thread-read-turn",children:[o.jsxs("summary",{children:[o.jsxs("code",{children:["turn ",a+1]}),o.jsx("span",{title:i.id,children:i.id}),o.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),o.jsxs("div",{className:"thread-read-turn-detail",children:[o.jsxs("div",{className:"thread-read-turn-fields",children:[o.jsx(at,{label:"Status",value:i.status}),o.jsx(at,{label:"Items view",value:i.itemsView}),o.jsx(at,{label:"Started",value:ho(i.startedAt)}),o.jsx(at,{label:"Completed",value:ho(i.completedAt)}),o.jsx(at,{label:"Duration",value:i.durationMs===null?"unknown":To(i.durationMs)}),o.jsx(at,{label:"Item types",value:i.itemTypes||"none"})]}),i.preview?o.jsx("p",{className:"thread-read-turn-preview",children:i.preview}):null,o.jsxs("details",{className:"thread-read-turn-raw",children:[o.jsx("summary",{children:"Turn raw JSON"}),o.jsx("pre",{children:JSON.stringify(i.raw,null,2)})]})]})]},i.id))})]})]})}function mo(t,i,a,r,u,c,d,h,g,m){var b,x;if(t.type==="assistantText")return o.jsx("article",{className:`message assistant${t.streaming?" streaming":""}`,"data-hover-time":et(t.createdAt),children:o.jsxs("div",{className:"message-main",children:[o.jsxs("header",{className:"message-header",children:[o.jsx("span",{children:"Seele"}),o.jsx("time",{dateTime:t.createdAt,children:t.streaming?"streaming":et(t.createdAt)})]}),o.jsx("div",{className:"message-body",children:o.jsx(gc,{content:t.content,conversation:i,streaming:t.streaming,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(t.type==="message")return o.jsx("article",{className:`message ${t.message.role}`,"data-hover-time":et(t.message.createdAt),children:o.jsxs("div",{className:"message-main",children:[o.jsxs("header",{className:"message-header",children:[o.jsx("span",{children:K2(t.message.role)}),o.jsx("time",{dateTime:t.message.createdAt,children:et(t.message.createdAt)})]}),o.jsx("div",{className:"message-body",children:o.jsx(gc,{content:t.message.content,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(t.type==="system"){if((b=t.topicMessages)!=null&&b.length)return o.jsx("div",{className:"topic-input-list",children:t.topicMessages.map(S=>o.jsx("article",{className:"message topic-input","data-hover-time":et(S.createdAt),children:o.jsxs("div",{className:"topic-input-bubble",children:[o.jsxs("header",{className:"topic-input-header",children:[o.jsxs("span",{className:"topic-input-sender",children:["From ",S.senderName]}),o.jsx("time",{dateTime:S.createdAt,children:et(S.createdAt)})]}),o.jsx("div",{className:"topic-input-content",children:o.jsx(gc,{content:S.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},S.id))});const w=Mc({},[t.detail]);return o.jsx("article",{className:"message system","data-hover-time":et(t.createdAt),children:o.jsx("div",{className:"message-main",children:o.jsxs("button",{className:`system-message-body system-message-link${t.visualKind?` ${t.visualKind}`:""}`,onClick:()=>m==null?void 0:m(t),type:"button",children:[t.visualKind==="topic"?o.jsx("span",{className:"system-message-icon",children:o.jsx(Op,{})}):null,o.jsx("span",{className:"system-message-title",children:t.title}),o.jsx("small",{children:w})]})})})}return t.type==="steerMarker"?o.jsxs("div",{className:"turn-steer-marker","data-message-id":t.messageId,title:t.content,children:[o.jsx("span",{children:"Added while running"}),o.jsx("strong",{children:t.content})]}):t.tool.linkedTaskId&&g?o.jsx(uv,{description:t.tool.body,icon:o.jsx(ov,{}),onClick:()=>void g(t.tool.linkedTaskId),timestamp:t.tool.createdAt,title:"View complex task details",trailing:t.tool.meta,visibleTitle:t.tool.title}):t.tool.kind==="command"?o.jsx(tA,{tool:t.tool,onRespondApproval:c}):t.tool.kind==="responsibility"?o.jsx(JT,{conversation:i,tool:t.tool,onRespond:d}):t.tool.kind==="knowledge"?o.jsx(eA,{tool:t.tool,onRespond:h}):o.jsxs("details",{className:`tool-card ${t.tool.kind}`,"data-hover-time":et(t.tool.createdAt),title:et(t.tool.createdAt),children:[o.jsxs("summary",{children:[o.jsxs("span",{className:"tool-card-summary-title",children:[t.tool.kind==="collaboration"?o.jsx("span",{className:"tool-card-kind-icon",children:o.jsx(Op,{})}):null,o.jsx("span",{children:t.tool.title})]}),t.tool.meta?o.jsx("small",{children:t.tool.meta}):null]}),o.jsx("code",{children:t.tool.body}),t.tool.output?o.jsx("pre",{children:t.tool.output}):null,(x=t.tool.rawEvents)!=null&&x.length?o.jsxs("details",{className:"tool-raw-details",children:[o.jsx("summary",{children:"Raw events"}),o.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(t.tool.rawEvents,null,2)})]}):null]})}function px(t){return t.type==="message"||t.type==="assistantText"&&t.pinnedToResult||t.type==="assistantText"&&t.phase==="final_answer"||t.type==="tool"&&FT(t.tool)}function FT(t){return t.kind==="responsibility"||t.kind==="knowledge"||t.kind==="collaboration"&&t.topicAction==="send"||!!t.linkedTaskId||t.meta==="approval"}function KT(t){const i=[],a=[];for(const r of t)r.type==="tool"&&r.tool.kind==="collaboration"&&r.tool.topicAction==="send"?a.push(r):i.push(r);return[...i,...a]}function XT({group:t,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:h,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondResponsibilityProposal:x,onRespondKnowledgeProposal:w,onOpenComplexTask:S,onOpenSystemEvent:T}){const L=KT(t.agentItems.filter(px)),z=t.agentItems.some($=>!px($)),D=a&&(z||t.turnIds.length>0),W=c?"process":"result",[Y,K]=R.useState(W),[de,_]=R.useState(!1),Z=Y==="result"?L:t.agentItems;R.useEffect(()=>{de||K(W)},[W,de]);const te=c||D||t.stopped,P=o.jsxs(o.Fragment,{children:[te?o.jsx("div",{className:"turn-panel-controls",children:c?o.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):D?o.jsx("button",{"aria-label":Y==="result"?"Show process":"Show result",className:"turn-view-toggle",title:Y==="result"?"Show process":"Show result",type:"button",onClick:()=>{_(!0),K($=>$==="result"?(g(t.turnIds),"process"):"result")},children:Y==="result"?o.jsx(PT,{}):o.jsx(QT,{})}):null}):null,Z.map($=>o.jsx(R.Fragment,{children:mo($,i,m,d,u,b,x,w,S,T)},$.id)),Y==="result"&&Z.length===0?o.jsx("div",{className:"turn-result-empty",children:t.stopped?"Run stopped by user":z?"No reliable final answer captured":"No result yet"}):null,o.jsx(go,{copied:r,content:lA(t.agentItems),id:`agent-${t.id}-bottom`,notice:t.notificationFailure,timestamp:aA(t.agentItems),variant:"outside",onCopy:h})]});return t.stopped?o.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[o.jsxs("summary",{children:[o.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),o.jsx("span",{children:"Run stopped by user"})]}),o.jsx("div",{className:te?"stopped-turn-body has-controls":"stopped-turn-body",children:P})]}):o.jsx("div",{className:["turn-panel","agent-turn",t.stopped?"stopped":"",te?"has-controls":""].filter(Boolean).join(" "),children:P})}function PT(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:o.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function QT(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:o.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function WT(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:o.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function ov(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"15",viewBox:"0 0 24 24",width:"15",children:[o.jsx("circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("circle",{cx:"18",cy:"7",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("circle",{cx:"12",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("path",{d:"m7.8 7 3.1 8.8M16.2 8.2l-3 7.8M8 6.2l8-.1",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function ZT(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:o.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function uv({className:t="",description:i,icon:a,onClick:r,timestamp:u,title:c,trailing:d,visibleTitle:h}){return o.jsxs("button",{className:`tool-card file compact-timeline-link ${t}`.trim(),"data-hover-time":et(u),onClick:r,title:c,type:"button",children:[o.jsx("span",{className:"compact-timeline-link-icon",children:a}),o.jsxs("span",{className:"compact-timeline-link-copy",children:[o.jsx("strong",{children:h}),o.jsx("small",{children:i})]}),d?o.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function JT({conversation:t,tool:i,onRespond:a}){const[r,u]=R.useState(i.body),[c,d]=R.useState(null),[h,g]=R.useState("source"),[m,b]=R.useState(!1),x=i.meta==="saved"||i.meta==="declined"?i.meta:"pending",w=x==="pending";R.useEffect(()=>{u(i.body)},[i.body]);async function S(T){d(T);try{await a(i,T,T==="accept"?r:void 0)&&b(!1)}finally{d(null)}}return o.jsxs(o.Fragment,{children:[o.jsx(uv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:o.jsx(Oc,{}),onClick:()=>b(!0),timestamp:i.createdAt,title:"View responsibility change request",trailing:o.jsx("span",{className:`responsibility-request-status ${x}`,children:x}),visibleTitle:i.title}),m?o.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!c&&b(!1),children:o.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:T=>T.stopPropagation(),role:"dialog",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),o.jsxs("p",{children:["Workspace responsibility · ",et(i.createdAt)]})]}),o.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!c,onClick:()=>b(!1),type:"button",children:"×"})]}),o.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[o.jsxs("div",{className:"responsibility-proposal-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Proposed responsibility"}),o.jsx("p",{children:"Review or edit the Markdown before applying it to future turns."})]}),o.jsx("span",{children:x})]}),i.responsibilityReason?o.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,w?o.jsxs("div",{className:"responsibility-proposal-editor",children:[o.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[o.jsx("button",{"aria-selected":h==="source",className:h==="source"?"active":"",role:"tab",type:"button",onClick:()=>g("source"),children:"Source"}),o.jsx("button",{"aria-selected":h==="preview",className:h==="preview"?"active":"",role:"tab",type:"button",onClick:()=>g("preview"),children:"Preview"})]}),h==="source"?o.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!c,onChange:T=>u(T.target.value),rows:12,value:r}):o.jsx("div",{className:"message-body responsibility-markdown-preview",children:da(r,t)})]}):o.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:da(r,t)})]}),o.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:w?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"secondary reject",disabled:!!c,type:"button",onClick:()=>void S("decline"),children:c==="decline"?"Rejecting...":"Reject"}),o.jsx("button",{className:"approve",disabled:!!c,type:"button",onClick:()=>void S("accept"),children:c==="accept"?"Saving...":"Save"})]}):o.jsx("button",{className:"secondary",onClick:()=>b(!1),type:"button",children:"Close"})})]})}):null]})}function eA({tool:t,onRespond:i}){const[a,r]=R.useState(t.body),[u,c]=R.useState(null),[d,h]=R.useState("source"),g=t.meta==="saved"||t.meta==="declined"?t.meta:"pending",m=g==="pending",b=hx(a);return R.useEffect(()=>{r(t.body)},[t.body]),o.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":et(t.createdAt),title:et(t.createdAt),children:[o.jsxs("div",{className:"responsibility-proposal-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.title}),o.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),o.jsx("span",{children:g})]}),m?o.jsxs("div",{className:"responsibility-proposal-editor",children:[o.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[o.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>h("source"),children:"JSON"}),o.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>h("preview"),children:"Preview"})]}),d==="source"?o.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:a}):b?o.jsx(mx,{value:b}):o.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?o.jsx(mx,{value:b,saved:!0}):o.jsx("pre",{className:"knowledge-proposal-raw",children:a}),m?o.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[o.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{hx(a)&&(c("accept"),Promise.resolve(i(t,"accept",a)).finally(()=>c(null)))},children:u==="accept"?"Saving...":"Save"}),o.jsx("button",{className:"reject",disabled:!!u,type:"button",onClick:()=>{c("decline"),Promise.resolve(i(t,"decline",a)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function hx(t){try{const i=JSON.parse(t);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function lp(t){return typeof t=="string"&&t.trim()?t.trim():typeof t=="number"||typeof t=="boolean"?String(t):"-"}function mx({value:t,saved:i}){return o.jsx("div",{className:`knowledge-proposal-preview${i?" saved":""}`,children:o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Name"}),o.jsx("dd",{children:lp(t.name)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Purpose"}),o.jsx("dd",{children:lp(t.purpose)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Content"}),o.jsx("dd",{children:lp(t.content??t.description)})]})]})})}function tA({tool:t,onRespondApproval:i}){var w;const a=g2(t),[r,u]=R.useState(!1),[c,d]=R.useState("script"),h=a==="approval"&&t.approvalRequestId!==void 0&&!!t.approvalTurnId,g=jc(t.body)?null:t.body,m=g?w2(g):null,b=m?`${nA(a)} · ${m}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",x=y2(t,a);return o.jsxs("article",{className:`tool-card command ${a}`,"data-hover-time":et(t.createdAt),title:et(t.createdAt),children:[o.jsxs("div",{className:"tool-command-bar",children:[o.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(S=>!S),children:[o.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),o.jsx("span",{children:b}),o.jsx("small",{className:"tool-command-badge",children:x})]}),r?o.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[o.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),o.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(w=t.rawEvents)!=null&&w.length?o.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,h?o.jsxs("div",{className:"tool-approval-actions",children:[o.jsx("button",{className:"approve",type:"button",onClick:()=>i(t,"accept"),children:"Approve"}),o.jsx("button",{className:"reject",type:"button",onClick:()=>i(t,"decline"),children:"Reject"})]}):null]}),r?c==="script"?o.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?o.jsx(gx,{content:g}):o.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?o.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[o.jsx("p",{className:"tool-command-result-meta",children:x2(t,a)}),t.output?o.jsx(gx,{content:t.output}):o.jsx("p",{className:"tool-output-pending",children:a==="running"?"Waiting for output...":a==="approval"?"Waiting for approval before running.":t.meta??"No output"})]}):o.jsx(iA,{events:t.rawEvents??[]}):null]})}function nA(t){return t==="running"?"Running":t==="approval"?"Approval required":"Command"}function gx({content:t}){const[i,a]=R.useState(!1),r=v2(t,ox);return o.jsxs("div",{className:"tool-content-block",children:[o.jsx("pre",{className:"tool-content-code",children:i?t:b2(t,ox)}),r?o.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function iA({events:t}){return o.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:o.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(t,null,2)})})}function go({copied:t,content:i,id:a,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?o.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?o.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:o.jsx(Cv,{})}):null,o.jsx("time",{dateTime:u,children:et(u)}),o.jsx("button",{"aria-label":t?"Copied markdown":"Copy markdown",onClick:()=>d(a,i),title:t?"Copied":"Copy",type:"button",children:t?o.jsx("span",{"aria-hidden":"true",children:"Copied"}):o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[o.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),o.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function yo(t){return t.type==="message"?ir(t.message.content):t.type==="assistantText"?ir(t.content):t.type==="system"?[t.title,t.fullDetail??t.detail].filter(i=>!!(i!=null&&i.trim())).join(`
|
|
89
|
+
|
|
90
|
+
`):""}function lA(t){return t.map(yo).filter(i=>i.trim()).join(`
|
|
91
|
+
|
|
92
|
+
`)}function aA(t){for(let i=t.length-1;i>=0;i-=1){const a=t[i];if(a.type!=="tool")return a.createdAt}return new Date().toISOString()}function rA({usage:t}){return t?o.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:t.windows.map(i=>o.jsx(oA,{label:sA(i.windowDurationMins),window:i},`${i.windowDurationMins}:${i.resetsAt}`))}):o.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:o.jsx("strong",{children:"--"})})}function sA(t){return t%10080===0?`${t/10080}w`:t%1440===0?`${t/1440}d`:t%60===0?`${t/60}h`:`${t}m`}function oA({label:t,window:i}){const a=uh(i.usedPercent),r=ch(a),u=`${t} usage ${R2(a)} · resets ${z2(i.resetsAt)}`;return o.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${a}%`},tabIndex:0,children:o.jsxs("strong",{children:[Math.round(a),"%"]})})}function uA(t,i,a,r,u,c){const d=[...t].sort(So),h=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.sequence])),g=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.timelineAt])),m=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.sequence])),b=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.timelineAt])),x=r.filter(_=>_.parentId===null&&_.nodeType==="system_event"),w=x.filter(_=>_.turnId!==null&&_.subtype.startsWith("input:")),S=x.filter(_=>!w.includes(_)),T=new Set(x.flatMap(_=>_.turnId?[_.turnId]:[])),L=UE(i),z=new Map(a.map(_=>[_.id,_])),D=r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>_.turnId),Y=[...new Set(r.length>0?[...D,...u?[u]:[]]:[...a.map(_=>_.id),...d.flatMap(_=>_.turnId?[_.turnId]:[]),...i.flatMap(_=>_.turnId?[_.turnId]:[])])].map(_=>{var un,bn,kt,vn;const Z=z.get(_),te=d.filter(Oe=>Oe.turnId===_),P=te.filter(Oe=>Oe.role==="user").sort((Oe,Vt)=>{const Zn=b.get(Oe.id)??Oe.createdAt,In=b.get(Vt.id)??Vt.createdAt;return Zn.localeCompare(In)||So(Oe,Vt)}),$=te.filter(Oe=>Oe.role==="assistant"),oe=i.filter(Oe=>Oe.turnId===_).sort(So),ue=`turn:${_}`,Te=r.filter(Oe=>Oe.parentId===ue).sort((Oe,Vt)=>Oe.sequence-Vt.sequence),he=(Z==null?void 0:Z.origin)??L.get(_),re=w.filter(Oe=>Oe.turnId===_).sort((Oe,Vt)=>Oe.timelineAt.localeCompare(Vt.timelineAt)||Oe.sequence-Vt.sequence).map(Oe=>yx(Oe,void 0,c)),H=he==="timeline_event"?[]:r.length>0?xA(Te,oe,wo([_],u),c):fv(oe,wo([_],u),c),le=$.map(po),ye=Te.find(Oe=>Oe.subtype==="server.complex_task.plan_updated"),Ce=oe.find(Oe=>Oe.event==="server.complex_task.plan_updated"),N=(ye==null?void 0:ye.detail)??(Ce==null?void 0:Ce.data),C=pe(pe(N).task),B=pe(C.currentPlan),A=Ie(B.planMarkdown),ae=pA(yA(H,le),A),me=oe.find(Oe=>Oe.event==="server.wakeup.started"),fe=pe(me==null?void 0:me.data),xe=typeof fe.instruction=="string"?fe.instruction.trim():"",ze=he==="timeline_event"?oe[0]:void 0,qe=T.has(_)?null:ze?cv(ze,(Z==null?void 0:Z.startedAt)??new Date(0).toISOString()):hA(he)?{id:`system-${_}`,type:"system",createdAt:(Z==null?void 0:Z.startedAt)??((un=oe[0])==null?void 0:un.createdAt)??new Date(0).toISOString(),title:mA(he??"system"),detail:gA(he??"system",xe),fullDetail:xe||void 0}:null,Tt=DA(oe),wt=(P[0]?b.get(P[0].id):(bn=w.find(Oe=>Oe.turnId===_))==null?void 0:bn.timelineAt)??g.get(_)??(Z==null?void 0:Z.startedAt)??((kt=te[0])==null?void 0:kt.createdAt)??((vn=oe[0])==null?void 0:vn.createdAt)??new Date(0).toISOString();return{id:`turn-${_}`,turnIds:[_],user:qe??(P[0]?po(P[0]):null),followupUsers:P.slice(1).map(po),acceptedSystemInputs:re,agentItems:ae,activity:Tt??(wo([_],u)?{id:-1,title:ae.some(Oe=>Oe.type==="assistantText"&&Oe.streaming)?"Writing response":"Working",createdAt:wt,tone:"running"}:null),notificationFailure:_A(oe),stopped:oe.some(hv),trailingSystemItems:[],sortAt:wt,sortSequence:h.get(_)??null}}),K=d.filter(_=>!_.turnId);Y.push(...K.map(_=>({id:`message-${_.id}`,turnIds:[],user:_.role==="user"?po(_):null,followupUsers:[],agentItems:_.role==="assistant"?[po(_)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(_.id)??_.createdAt,sortSequence:m.get(_.id)??null})));const de=new Map(i.map(_=>[String(_.id),_]));return Y.push(...S.map(_=>({id:_.id,turnIds:[],user:yx(_,_.entityType==="event"&&_.entityId?de.get(_.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:_.timelineAt,sortSequence:_.sequence}))),Y.sort((_,Z)=>{const te=_.sortAt.localeCompare(Z.sortAt);return te!==0?te:_.sortSequence!==null||Z.sortSequence!==null?(_.sortSequence??Number.MAX_SAFE_INTEGER)-(Z.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:_,...Z})=>Z)}function yx(t,i,a){var g,m;if(i||t.entityType==="event")return cv(i??Dp(t),t.createdAt);const r=pe(t.detail);if(t.subtype==="input:collaboration_notice"||t.subtype==="input:topic_message"){const b=Ap(r,a),x=cA(r.messages,a),w=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(T=>typeof T=="string"&&T.trim().length>0):[],S=typeof r.unreadCount=="number"?r.unreadCount:0;return{id:t.id,type:"system",createdAt:t.createdAt,title:b.title,detail:b.detail,visualKind:"topic",topicMessages:x,fullDetail:[`## ${b.title}`,"","**Unread**","",String(S),"","**From**","",w.length>0?w.map(T=>{const L=a.get(T)??T;return`${er(L)} (\`${T}\`)`}).join(", "):"Unknown"].join(`
|
|
93
|
+
`)}}const u=Ie(r.complexTaskId)||Ie(pe(r.task).id)||void 0,c=Pb(t.title,t.subtype),d=Mc(r,[t.summary,t.contentMarkdown]),h=[`## ${er(c)}`,"",((g=t.contentMarkdown)==null?void 0:g.trim())||((m=t.summary)==null?void 0:m.trim())||"",Object.keys(r).length>0?["","```json",JSON.stringify(r,null,2),"```"].join(`
|
|
94
|
+
`):""].filter(Boolean).join(`
|
|
95
|
+
`);return{id:t.id,type:"system",createdAt:t.createdAt,title:c,detail:d,fullDetail:h||void 0,linkedTaskId:u}}function cA(t,i){if(!Array.isArray(t))return[];const a=new Set,r=[];for(const u of t){const c=pe(u),d=Ie(c.id),h=Ie(c.senderWorkspaceId),g=Ie(c.contentMarkdown).trim(),m=Ie(c.createdAt);!d||a.has(d)||!h||!g||!m||(a.add(d),r.push({id:d,senderWorkspaceId:h,senderName:i.get(h)??(Ie(c.senderTitleSnapshot)||h),contentMarkdown:g,createdAt:m}))}return r}function cv(t,i){return t.event==="server.collaboration.topic_created"?dA(t,i):fA(t,i)}function dA(t,i){const a=pe(pe(t.data).topic),r=Ie(a.title).trim()||"Untitled Topic",u=Ie(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(pe):[],d=Ie(a.ownerWorkspaceId),h=c.find(x=>Ie(x.role)==="owner"||Ie(x.workspaceId)===d),g=Ie(h==null?void 0:h.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>Ie(x.role)!=="owner"&&Ie(x.status)==="active"),b=m.length?m.map(x=>{const w=Ie(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${er(w)} (\`${Ie(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${t.id}`,type:"system",createdAt:t.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",er(r),"","**描述**","",er(u),"","**Owner Workspace**","",`${er(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
|
|
96
|
+
`)}}function fA(t,i){const a=pe(t.data),r=Pb(void 0,t.event);return{id:`system-event-${t.id}`,type:"system",createdAt:t.createdAt??i,title:r,detail:Mc(a),visualKind:t.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${er(r)}`,"","**Event**","",`\`${t.event}\``,"","```json",JSON.stringify(t.data??null,null,2),"```"].join(`
|
|
97
|
+
`)}}function pA(t,i){const a=i.trim();return a?t.filter(r=>r.type==="assistantText"?ir(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?ir(r.message.content).trim()!==a:!0):t}function hA(t){return t==="system"||t==="wakeup"||t==="runtime-reset"||t==="clone_initialization"}function mA(t){return t==="runtime-reset"?"Runtime reset":t==="clone_initialization"?"Clone initialization":t==="system"?"System action":"Scheduled wakeup"}function gA(t,i){return t==="runtime-reset"?"Thread rebuilt":t==="clone_initialization"?"Activating inherited context":t==="system"?"Workspace runtime action":i?Ov(i,20):"Auto resumed"}function yA(t,i){if(t.some(u=>u.type==="assistantText"))return Sc(t);if(i.length===0)return t;const a=[...i],r=[];for(const u of t)u.type==="tool"&&ah(u.tool)&&lh(a,u.tool)||r.push(u);return Sc([...r,...a])}function xA(t,i,a,r){var g;const u=new Map(i.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),c=new Map,d=new Set;for(const m of t){const b=bA(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(kl(x),x)}if(a)for(const m of i)vA(t,m)||c.set(kl(m),m);else if(i.length>0&&!t.some(m=>m.phase==="process"))for(const m of i)c.set(kl(m),m);const h=fv([...c.values()].sort(So),a,r);for(const m of t)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){h.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:wA(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:a&&m.status==="running"});continue}m.nodeType==="operation"&&h.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:kA(m,r)})}return Sc(h)}function bA(t,i,a){if(t.entityType==="event"&&t.entityId){const r=a.get(t.entityId);return r&&t.phase==="process"&&t.status==="running"?[r]:[Dp(t)]}if(t.entityType==="codex_item"&&t.entityId){const r=i.filter(u=>dv(u)===t.entityId);return r.length>0?r:[Dp(t)]}return[]}function Dp(t){const i=pe(t.detail),a=t.subtype==="server.collaboration.message_staged"&&t.phase==="result"?t.status==="failed"?"server.collaboration.message_rejected":Ie(i.messageId)?"server.collaboration.message_sent":t.subtype:t.subtype;return{id:t.entityId??t.id,turnId:t.turnId,seq:t.sequence,event:t.entityType==="codex_item"?"codex.notification":a,data:t.detail,createdAt:t.updatedAt||t.createdAt}}function vA(t,i){const a=i.id===void 0?null:String(i.id),r=dv(i);return t.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function dv(t){if(t.event!=="codex.notification")return null;const i=pe(t.data),a=pe(i.params),r=pe(a.item);return Ie(r.id)||Ie(a.itemId)||null}function wA(t){return t.subtype==="final_answer"?"final_answer":t.phase==="process"?"commentary":"unknown"}function kA(t,i){var r,u;const a=pe(t.detail);return{id:t.id,kind:t.status==="failed"?"error":"activity",title:t.subtype==="input:collaboration_notice"?Ap(a,i).title:t.title||Rv(t.subtype),body:t.subtype==="input:collaboration_notice"?Ap(a,i).detail:((r=t.summary)==null?void 0:r.trim())||((u=t.contentMarkdown)==null?void 0:u.trim())||Av(a),createdAt:t.createdAt,itemId:t.entityType==="codex_item"?t.entityId??void 0:void 0,meta:t.status}}function fv(t,i,a){const r=[],u=new Map,c=new Map,d=new Map;for(const h of t){if(h.event==="server.responsibility.decision"){jA(r,h);continue}if(h.event==="server.knowledge.decision"){CA(r,h);continue}if(hv(h)){NA(r);continue}if(h.event==="server.steer"){const T=pe(h.data),L=typeof T.message=="string"?T.message.trim():"";r.push({id:`steer-${h.id}`,type:"steerMarker",createdAt:h.createdAt??new Date().toISOString(),content:L||"Additional input",messageId:typeof T.messageId=="string"?T.messageId:void 0});continue}const g=$2(h.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=H2(h.data);if(m!=null&&m.text){const T=m.itemId?d.get(m.itemId)??m.phase:m.phase,L=m.itemId??`phase:${T}`,z=`${u.get(L)??""}${m.text}`,D=vv(z),W=c.get(L)??"",Y=D.startsWith(W)?D.slice(W.length):D;if(u.set(L,z),c.set(L,D),Y){const K=r[r.length-1];(K==null?void 0:K.type)==="assistantText"&&TA(K,m.itemId,T)?(K.content+=Y,K.itemId=K.itemId??m.itemId,K.streamKey=K.streamKey??L,K.streaming=i):r.push({id:`assistant-event-${h.id}`,type:"assistantText",createdAt:h.createdAt??new Date().toISOString(),content:Y,phase:T,itemId:m.itemId,streamKey:L,streaming:i})}continue}const b=G2(h.data);if(b!=null&&b.text){const T=ir(b.text),L=b.itemId??`phase:${b.phase}`,z=AA(r,b.itemId,b.phase);if(z>=0){const D=r[z];D.type==="assistantText"&&(T?(D.content=T,D.phase=b.phase,D.itemId=D.itemId??b.itemId,D.streamKey=D.streamKey??L,D.streaming=!1,SA(r,z,b.itemId)):r.splice(z,1))}else T&&r.push({id:`assistant-completed-${h.id}`,type:"assistantText",createdAt:h.createdAt??new Date().toISOString(),content:T,phase:b.phase,itemId:b.itemId,streamKey:L,streaming:!1});continue}const x=f2(h,a);if(x){if(x.rawEvents=[h],ah(x)&&lh(r,x))continue;const T=bx(r,x);if(T>=0){vx(r[T],x);continue}if(x.kind==="command"&&x.meta==="running"&&jc(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const w=p2(h);if(w){w.rawEvents=[h];const T=bx(r,w);if(T>=0){vx(r[T],w);continue}r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w});continue}const S=h2(h);S&&(S.rawEvents=[h],r.push({id:`tool-${S.id}`,type:"tool",createdAt:S.createdAt,tool:S}))}return Sc(r)}function SA(t,i,a){if(a)for(let r=t.length-1;r>i;r-=1){const u=t[r];u.type==="assistantText"&&u.itemId===a&&t.splice(r,1)}}function jA(t,i){const a=pe(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=typeof a.responsibility=="string"?a.responsibility:void 0;if(!(!r||u!=="accept"&&u!=="decline"))for(let d=t.length-1;d>=0;d-=1){const h=t[d];if(h.type==="tool"&&h.tool.kind==="responsibility"&&h.tool.responsibilityProposalId===r){h.tool={...h.tool,title:u==="accept"?"Responsibility saved":"Responsibility proposal declined",meta:u==="accept"?"saved":"declined",body:c??h.tool.body};return}}}function CA(t,i){const a=pe(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=pe(a.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=t.length-1;d>=0;d-=1){const h=t[d];if(h.type==="tool"&&h.tool.kind==="knowledge"&&h.tool.knowledgeProposalId===r){h.tool={...h.tool,title:u==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:u==="accept"?"saved":"declined",body:u==="accept"&&Object.keys(c).length>0?JSON.stringify(c,null,2):h.tool.body};return}}}function lh(t,i){const a=pv(i);if(typeof a!="number")return!1;for(let c=0;c<t.length;c+=1){const d=t[c];if(d.type!=="assistantText"||!xx(d,i))continue;const h=ir(d.content);h!==d.content&&(t[c]={...d,content:h})}let r=0,u=-1;for(let c=0;c<t.length;c+=1){const d=t[c];if(d.type!=="assistantText"||!xx(d,i))continue;u=c;const h=r,g=h+d.content.length;if(r=g,a>=g)continue;const m=Math.max(0,Math.min(d.content.length,a-h)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),w=[];return b&&w.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),w.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&w.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),t.splice(c,1,...w),!0}if(u>=0&&a>=r){const c=t[u];return(c==null?void 0:c.type)==="assistantText"&&(t[u]={...c,pinnedToResult:!0}),t.splice(u+1,0,{id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),!0}return!1}function xx(t,i){return!i.anchorStreamKey||t.streamKey===i.anchorStreamKey}function Sc(t){const i=[],a=[];for(const c of t){if(c.type==="tool"&&ah(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)lh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return EA([...u,...r])}function ah(t){return typeof pv(t)=="number"}function pv(t){if(typeof t.anchorOffset=="number")return t.anchorOffset;if(t.kind==="responsibility")return t.responsibilityAnchorOffset;if(t.kind==="knowledge")return t.knowledgeAnchorOffset}function EA(t){const i=[];for(let a=0;a<t.length;a+=1){const r=t[a],u=t[a+1];if((r==null?void 0:r.type)==="tool"&&r.tool.kind==="responsibility"&&typeof r.tool.responsibilityAnchorOffset!="number"&&(u==null?void 0:u.type)==="assistantText"){i.push({...u,pinnedToResult:!0}),i.push(r),a+=1;continue}i.push(r)}return i}function TA(t,i,a){return t.type!=="assistantText"?!1:t.itemId&&i?t.itemId===i:t.itemId||i?!1:t.phase===a}function AA(t,i,a){if(i){const r=t.findIndex(u=>u.type==="assistantText"&&u.itemId===i);if(r>=0)return r}for(let r=t.length-1;r>=0;r-=1){const u=t[r];if(u.type==="assistantText"&&u.streaming&&(!i||!u.itemId)&&(u.phase===a||u.phase==="unknown"||a==="unknown"))return r}return-1}function hv(t){return t.event==="server.stop"||t.event==="server.stopped"}function NA(t){for(const i of t)i.type==="tool"&&i.tool.kind==="command"&&i.tool.meta==="running"&&(i.tool={...i.tool,title:"Command stopped",meta:"stopped"})}function _A(t){for(let i=t.length-1;i>=0;i-=1){const a=t[i];if(a.event!=="server.notification.failed")continue;const r=pe(a.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function DA(t){for(let i=t.length-1;i>=0;i-=1){const a=zv(t[i]);if(a)return a}return null}function bx(t,i){for(let a=t.length-1;a>=0;a-=1){const r=t[a];if(r.type==="tool"&&r.tool.kind===i.kind&&(i.itemId&&r.tool.itemId===i.itemId||r.tool.body===i.body&&r.tool.meta==="running"))return a}return-1}function vx(t,i){if(t.type!=="tool")return;const a=t.tool.kind==="command"&&t.tool.meta!=="running"&&i.meta==="running",r=t.tool.kind==="command"&&i.kind==="command"&&jc(i.body)&&!jc(t.tool.body);t.tool={...t.tool,...i,id:t.tool.id,createdAt:t.tool.createdAt,title:a?t.tool.title:i.title,body:r?t.tool.body:i.body,meta:a?t.tool.meta:i.meta,output:A2(t.tool.output,i.output),rawEvents:MA(t.tool.rawEvents,i.rawEvents)}}function MA(t,i){const a=[...t??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=kl(u);return r.has(c)?!1:(r.add(c),!0)})}function po(t){return{id:`message-${t.id}`,type:"message",createdAt:t.createdAt,message:t}}function wx(t,i){const a=new Set,r=[...t,...i].filter(u=>a.has(u.id)?!1:(a.add(u.id),!0));return r.filter(u=>mv(u)?!r.some(c=>OA(c,u)):!0)}function kx(t,i){const a=new Map;for(const r of[...t,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function Sx(t,i){const a=new Map;for(const r of[...t,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function mv(t){return t.id.startsWith("local-")}function OA(t,i){if(mv(t)||t.role!==i.role||t.content.trim()!==i.content.trim())return!1;const a=Date.parse(t.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(a)||Number.isNaN(r)?!1:Math.abs(a-r)<=12e4}function ap(t,i){const a=new Map,r=new Map;for(const c of[...t,...i]){const d=kl(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const h=gv(c,d);return h!==0?h:(r.get(kl(c))??0)-(r.get(kl(d))??0)})}function rp(t,i){const a=kl(i),r=t.findIndex(c=>kl(c)===a);if(r<0)return[...t,i];if(RA(t[r],i))return t;const u=[...t];return u[r]=i,u}function RA(t,i){return t.turnId===i.turnId&&t.event===i.event&&t.createdAt===i.createdAt&&t.seq===i.seq&&JSON.stringify(t.data)===JSON.stringify(i.data)}function kl(t){return t.id!==void 0?`${typeof t.id}:${t.id}`:`${t.event}:${t.createdAt??""}:${JSON.stringify(t.data)}`}function So(t,i){const a=gv(t,i);return a!==0?a:zA(t.id,i.id)}function gv(t,i){if(t.turnId&&i.turnId&&t.turnId===i.turnId&&typeof t.seq=="number"&&typeof i.seq=="number"&&t.seq!==i.seq)return t.seq-i.seq;const a=Date.parse(t.createdAt??""),r=Date.parse(i.createdAt??"");return!Number.isNaN(a)&&!Number.isNaN(r)&&a!==r?a-r:Number.isNaN(a)!==Number.isNaN(r)?Number.isNaN(a)?1:-1:0}function zA(t,i){return t===i?0:t===void 0?1:i===void 0?-1:typeof t=="number"&&typeof i=="number"?t-i:String(t).localeCompare(String(i))}function sp(t,i){const a=pe(t.data);return typeof a.__seq=="number"&&typeof a.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(a,"payload")?{id:typeof a.__eventId=="string"?a.__eventId:`stream:${a.__turnId??"unknown"}:${a.__seq}`,turnId:typeof a.__turnId=="string"?a.__turnId:null,seq:a.__seq,event:t.event,data:a.payload,createdAt:a.__createdAt}:{id:i,turnId:t.turnId??null,event:t.event,data:t.data,createdAt:t.createdAt??new Date().toISOString()}}const gc=R.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const h=r?vv(i):ir(i),g=a&&!r?GA(h,a):[];return o.jsxs(o.Fragment,{children:[r?o.jsx(UA,{content:h,conversation:a}):da(h,a),g.length>0?o.jsx("div",{className:"artifact-preview-list",children:g.map(m=>o.jsx($A,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},LA);function LA(t,i){var a,r,u,c;return t.content===i.content&&t.streaming===i.streaming&&t.copiedArtifactUrl===i.copiedArtifactUrl&&((a=t.conversation)==null?void 0:a.id)===((r=i.conversation)==null?void 0:r.id)&&((u=t.conversation)==null?void 0:u.workspacePath)===((c=i.conversation)==null?void 0:c.workspacePath)}const IA=2;function UA({content:t,conversation:i}){const a=R.useRef(null),[r,u]=R.useState(null),{committedBlocks:c,activeBlock:d}=BA(t);return R.useLayoutEffect(()=>{const h=a.current;if(!h)return;const g=parseFloat(window.getComputedStyle(h).lineHeight)||28,m=h.scrollHeight;u(b=>{const x=g*IA,w=Math.min(m,x);return b!==null&&w<=b?b:w})},[t]),o.jsxs("div",{className:"streaming-message-content",ref:a,style:r===null?void 0:{minHeight:r},children:[c.map((h,g)=>o.jsx(R.Fragment,{children:da(h,i)},`${g}:${h.length}`)),d?o.jsx("p",{className:"streaming-active-line",children:d}):null]})}function BA(t){const i=HA(t),a=i>0?t.slice(0,i):"",r=t.slice(i);return{committedBlocks:qA(a),activeBlock:r}}function qA(t){const i=[];let a=0,r=!1,u=!1;const c=t.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const h of c){if(!h)continue;const g=h.trim(),m=d;if(d+=h.length,/^\s*(```|~~~)/.test(h)){r=!r,r||(dc(i,t.slice(a,d)),a=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(h)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(h)){u=!0;continue}u&&(dc(i,t.slice(a,m)),a=m,u=!1),g===""&&(dc(i,t.slice(a,d)),a=d)}return a<t.length&&dc(i,t.slice(a)),i}function dc(t,i){i.trim()&&t.push(i)}function HA(t){const i=t.lastIndexOf(`
|
|
98
|
+
`);if(i<0)return 0;const a=[0];for(let u=0;u<t.length;u+=1)t[u]===`
|
|
99
|
+
`&&u+1<t.length&&a.push(u+1);let r=-1;for(const u of a){const c=t.indexOf(`
|
|
100
|
+
`,u),d=t.slice(u,c===-1?t.length:c);/^\s*(```|~~~)/.test(d)&&(r=r===-1?u:-1)}return r>=0?r:i+1}function $A({artifact:t,onPreview:i,onCopyUrl:a,copied:r}){return t?o.jsxs("figure",{className:"artifact-preview",children:[o.jsx("button",{className:"artifact-preview-media",onClick:()=>i(t),type:"button",children:o.jsx("img",{alt:t.name,src:t.url})}),o.jsxs("figcaption",{children:[o.jsx("span",{children:t.name}),o.jsxs("div",{className:"artifact-preview-actions",children:[o.jsx("button",{onClick:()=>i(t),type:"button",children:"Preview"}),o.jsx("a",{href:t.url,rel:"noreferrer",target:"_blank",children:"Open"}),o.jsx("button",{onClick:()=>a(t),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function GA(t,i){const a=new Map;for(const r of VA(t)){const u=yv(r);if(u){const c=xv(u).toLowerCase(),d=a.get(c);(!d||KA(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>YA(r,i)).filter(r=>r!==null)}function VA(t){const i=[],a=/!\[[^\]]*]\(([^)]+)\)/g,r=/\[[^\]]+]\(([^)]+)\)/g,u=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const c of[a,r,u]){let d;for(;(d=c.exec(t))!==null;)i.push(d[1])}return i}function YA(t,i){const a=yv(t);if(!a||!FA(a))return null;const r=bv(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:xv(r),url:ge(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function yv(t){const i=t.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function FA(t){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(t)}function xv(t){return t.replace(/\\/g,"/").split("/").filter(Boolean).pop()??t}function bv(t,i){const a=t.replace(/\\/g,"/"),r=i.replace(/\\/g,"/").replace(/\/+$/,"");return a===r||!a.startsWith(`${r}/`)?a:a.slice(r.length+1)}function KA(t,i){return t.startsWith("/")&&!i.startsWith("/")?!0:t.length>i.length}function ir(t){return t.trim()}function vv(t){return t.trim()}function op(t){return t instanceof DOMException&&t.name==="AbortError"||t instanceof Error&&t.name==="AbortError"}function XA(t){return{a({children:i,href:a}){if(!a)return o.jsx(o.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(a),u=!r&&t?PA(a,t):null,c=u??a,d=r||!!u;return o.jsx("a",{className:"markdown-link",href:c,rel:d?"noreferrer":void 0,target:d?"_blank":void 0,children:i})},img(){return null},pre({children:i}){const a=ZA(i);return a?rh(a.language)==="mermaid"?o.jsx(JA,{code:a.code}):o.jsx(nN,{code:a.code,language:a.language}):o.jsx("pre",{children:i})},table({children:i}){return o.jsx("div",{className:"markdown-table-wrap",children:o.jsx("table",{className:"markdown-table",children:i})})},td({align:i,children:a}){return o.jsx("td",{style:jx(i),children:a})},th({align:i,children:a}){return o.jsx("th",{style:jx(i),children:a})}}}function PA(t,i){if(!t||t.startsWith("#")||t.startsWith("/api/")||t.startsWith("?"))return null;const[a]=t.split("#",1),[r]=a.split("?",1),u=QA(r);if(!u)return null;const c=bv(u,i.workspacePath);return ge(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function QA(t){const i=t.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function jx(t){return t&&t!=="char"?{textAlign:t}:void 0}function da(t,i){const a=WA(t);return o.jsx(jj,{components:XA(i),remarkPlugins:[IE],skipHtml:!0,children:a})}function WA(t){return t.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
|
|
101
|
+
$2`)}function ZA(t){var c;const i=R.Children.toArray(t),a=i.length===1&&R.isValidElement(i[0])?i[0]:null;if(!a||a.type!=="code")return null;const u=((c=(a.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:c[1])??"";return{code:Mp(a.props.children).replace(/\n$/,""),language:u}}function Mp(t){return t==null||typeof t=="boolean"?"":typeof t=="string"||typeof t=="number"||typeof t=="bigint"?String(t):Array.isArray(t)?t.map(Mp).join(""):R.isValidElement(t)?Mp(t.props.children):""}const wv="github-light",up=new Map,cp=new Map;let dp=null,fp=null;const kv=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function rh(t){const i=t.trim().toLowerCase().replace(/^\./,"");return{bash:"bash",cjs:"javascript",console:"shellscript",htm:"html",js:"javascript",jsx:"jsx",md:"markdown",mjs:"javascript",py:"python",rb:"ruby",shell:"bash",ts:"typescript",tsx:"tsx",yml:"yaml",zsh:"bash"}[i]??i}function Sv(t){const i=rh(t);return!i||i==="text"||i==="txt"?"text":kv.has(i)?i:"text"}function JA({code:t}){const a=`seele-mermaid-${R.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=R.useState(!1),[c,d]=R.useState(()=>cp.get(t)??null),[h,g]=R.useState(null);R.useEffect(()=>{let b=!1,x;const w=cp.get(t);return w?(d(w),g(null),()=>{b=!0}):(g(null),d(null),eN(a,t).then(S=>{b||(x!==void 0&&window.clearTimeout(x),cp.set(t,S),d(S),g(null))},S=>{if(!b){const T=S instanceof Error?S.message:String(S);x=window.setTimeout(()=>{b||g(T)},nT)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[t,a]);async function m(){await navigator.clipboard.writeText(t),u(!0),window.setTimeout(()=>u(!1),1200)}return o.jsxs("figure",{className:`mermaid-block${h?" error":""}`,children:[o.jsx("span",{className:"code-block-kind",children:"mermaid"}),o.jsx("div",{className:"code-block-tools",children:o.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:o.jsx(jv,{})})}),c?o.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):h?o.jsxs("div",{className:"mermaid-error",children:[o.jsx("strong",{children:"Mermaid render failed"}),o.jsx("pre",{children:h}),o.jsx("code",{children:t})]}):o.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function eN(t,i){return(await(await tN()).render(t,i)).svg}function tN(){return fp||(fp=vt(()=>import("./mermaid.core-DFI7lMCr.js").then(t=>t.bp),[],import.meta.url).then(t=>{const i=t.default;return i.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#f9fafa",primaryBorderColor:"#d8d9e8",primaryTextColor:"#0b0f16",lineColor:"#7a8294",secondaryColor:"#f5f5fb",tertiaryColor:"#ffffff",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),i})),fp}function nN({code:t,language:i,reserveHeight:a=!1}){const[r,u]=R.useState(!1),[c,d]=R.useState(()=>{if(!Tx(i))return null;const m=Ex(t,i);return up.get(m)??null}),h=a?{"--code-block-min-height":`${hT(t)}px`}:void 0;R.useEffect(()=>{let m=!1;if(!Tx(i))return d(null),()=>{m=!0};const b=Ex(t,i),x=up.get(b);return x?(d(x),()=>{m=!0}):(d(null),cN(t,i).then(w=>{up.set(b,w),m||d(w)}).catch(w=>{console.warn("Failed to highlight code block",w),m||d(null)}),()=>{m=!0})},[t,i]);async function g(){await navigator.clipboard.writeText(t),u(!0),window.setTimeout(()=>u(!1),1200)}return o.jsxs("figure",{className:"code-block",style:h,children:[i?o.jsx("span",{className:"code-block-kind",children:i}):null,o.jsx("div",{className:"code-block-tools",children:o.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:o.jsx(jv,{})})}),c?o.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):o.jsx("pre",{children:o.jsx("code",{children:t})})]})}function jv(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[o.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),o.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function iN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[o.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),o.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),o.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Cv(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),o.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),o.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function lN(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:o.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function aN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),o.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),o.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),o.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function Cx(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function rN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),o.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Op(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[o.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function Oc(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[o.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),o.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function sN(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:o.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function oN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),o.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function uN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),o.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Ex(t,i){return`${wv}:${Sv(i)}:${t}`}function Tx(t){const i=rh(t);return!!i&&kv.has(i)}async function cN(t,i){return(await dN()).codeToHtml(t,{lang:Sv(i),theme:wv})}function dN(){return dp||(dp=fN()),dp}async function fN(){const[{createHighlighterCore:t},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:h},{default:g},{default:m},{default:b},{default:x},{default:w},{default:S},{default:T},{default:L},{default:z},{default:D},{default:W},{default:Y},{default:K},{default:de}]=await Promise.all([vt(()=>import("./core-DeEzFyeU.js"),[],import.meta.url),vt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),vt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),vt(()=>import("./bash-BELqPA7S.js").then(_=>_.b),[],import.meta.url),vt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),vt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),vt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),vt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),vt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),vt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),vt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),vt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),vt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),vt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),vt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),vt(()=>import("./bash-BELqPA7S.js").then(_=>_.s),[],import.meta.url),vt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),vt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),vt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),vt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),vt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),vt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return t({engine:i(),themes:[a],langs:[r,u,c,d,h,g,m,b,x,w,S,T,L,z,D,W,Y,K,de]})}async function Ax(){const t=ge("conversations"),i=await fetch(t);return await _e(i,{url:t}),(await i.json()).conversations}async function pN(){const t=ge("workspace-states"),i=await fetch(t);return await _e(i,{url:t}),(await i.json()).workspaces}async function Nx(){const t=ge("collaboration/topics"),i=await fetch(t);return await _e(i,{url:t}),(await i.json()).topics}async function fc(t){const i=ge(`collaboration/topics/${t}/messages?limit=100`),a=await fetch(i);return await _e(a,{url:i}),(await a.json()).messages}async function hN(t){const i=ge("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await _e(a,{method:"POST",url:i}),(await a.json()).topic}async function mN(t,i){const a=ge(`collaboration/topics/${t}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await _e(r,{method:"PATCH",url:a}),(await r.json()).topic}async function gN(t,i){const a=ge(`collaboration/topics/${t}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await _e(r,{method:"POST",url:a}),(await r.json()).topic}async function yN(t){const i=ge(`conversations/${t}/read`),a=await fetch(i,{method:"POST"});await _e(a,{method:"POST",url:i})}async function _x(){const t=ge("workspace-groups"),i=await fetch(t);return await _e(i,{url:t}),(await i.json()).groups}async function xN(t){const i=ge("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:t})});return await _e(a,{method:"POST",url:i}),(await a.json()).group}async function bN(t,i){const a=ge(`workspace-groups/${t}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await _e(r,{method:"PATCH",url:a}),(await r.json()).group}async function vN(t){const i=ge(`workspace-groups/${t}`),a=await fetch(i,{method:"DELETE"});return await _e(a,{method:"DELETE",url:i}),await a.json()}async function wN(){const t=ge("settings/environment"),i=await fetch(t);return await _e(i,{url:t}),(await i.json()).variables}async function kN(t){const i=ge(`conversations/${t}/settings/environment`),a=await fetch(i);return await _e(a,{url:i}),(await a.json()).variables}async function SN(t){const i=ge(`conversations/${t}/knowledge`),a=await fetch(i);return await _e(a,{url:i}),(await a.json()).items}async function jN(){const t=ge("settings/runtime"),i=await fetch(t);return await _e(i,{url:t}),(await i.json()).settings}async function CN(){const t=ge("settings/runtime/codex"),i=await fetch(t);return await _e(i,{url:t}),await i.json()}async function EN(t=!0){const i=ge(`settings/runtime/models?refresh=${t?"1":"0"}`),a=await fetch(i);return await _e(a,{url:i}),await a.json()}async function TN(t=!1){const i=ge(`settings/runtime/codex/update${t?"?refreshLatest=1":""}`),a=await fetch(i);return await _e(a,{url:i}),await a.json()}async function AN(){const t=ge("settings/runtime/codex/update"),i=await fetch(t,{method:"POST"});return await _e(i,{method:"POST",url:t}),(await i.json()).job}async function NN(t){const i=ge(`conversations/${t}/settings/runtime`),a=await fetch(i);return await _e(a,{url:i}),(await a.json()).settings}async function _N(){const t=ge("settings/memory"),i=await fetch(t);return await _e(i,{url:t}),await i.json()}async function DN(t){const i=ge("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await _e(a,{method:"PUT",url:i}),(await a.json()).settings}async function Dx(t,i){const a=ge(`conversations/${t}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await _e(r,{method:"PUT",url:a}),await r.json()}async function MN(t,i){const a=ge(`conversations/${t}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await _e(r,{method:"POST",url:a}),await r.json()}async function ON(t){const i=ge(`conversations/${t}/runtime/reset-preview`),a=await fetch(i);return await _e(a,{url:i}),await a.json()}async function RN(t){const i=ge(`conversations/${t}/runtime/thread-read`),a=await fetch(i);return await _e(a,{url:i}),(await a.json()).result}async function zN(t){const i=ge(`conversations/${t}/runtime/token-usage`),a=await fetch(i);await _e(a,{url:i});const r=await a.json();return r.event?Lv(r.event):null}async function LN(t){const i=ge(`conversations/${t}/runtime/additional-context`),a=await fetch(i);return await _e(a,{url:i}),await a.json()}async function IN(t){const i=ge(`conversations/${t}/runtime/compactions`),a=await fetch(i);return await _e(a,{url:i}),(await a.json()).compactions}function UN(t,i){return{model:t.model===i.model?null:t.model,reasoningEffort:t.reasoningEffort===i.reasoningEffort?null:t.reasoningEffort,fastMode:t.fastMode===i.fastMode?null:t.fastMode,sandbox:t.sandbox===i.sandbox?null:t.sandbox,notifyEnabled:t.notifyEnabled===i.notifyEnabled?null:t.notifyEnabled}}function BN(t){return{kind:t.kind,name:t.name,description:t.description,purpose:t.purpose,attention:t.attention,refreshPolicy:t.refreshPolicy,status:t.status,sourceClues:HN(t.sourceCluesText),requiredEnv:$N(t.requiredEnvText)}}function qN(t){return{id:t.id,kind:t.kind,name:t.name,description:t.description,purpose:t.purpose,attention:t.attention,refreshPolicy:t.refreshPolicy,status:t.status,sourceCluesText:t.sourceClues.map(i=>`${i.type}: ${i.value}`).join(`
|
|
102
|
+
`),requiredEnvText:t.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
|
|
103
|
+
`)}}function HN(t){const i=new Date().toISOString();return t.split(/\r?\n/).map(a=>a.trim()).filter(Boolean).map(a=>{const r=a.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:r?r[1].toLowerCase():"text",value:r?r[2].trim():a,providedBy:"user",providedAt:i}})}function $N(t){return t.split(/\r?\n/).map(i=>i.trim()).filter(Boolean).map(i=>{const[a,...r]=i.split(/\s+-\s+/);return{key:a.trim().toUpperCase(),description:r.join(" - ").trim()}}).filter(i=>/^[A-Z_][A-Z0-9_]*$/.test(i.key))}function Mx(t,i){const a=Ox(i.attention)-Ox(t.attention);return a!==0?a:i.updatedAt.localeCompare(t.updatedAt)}function Ox(t){return t==="watch"?2:t==="tracked"?1:0}function jo(t){return t.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function GN(t){return t?/^[a-z_][a-z0-9_.-]*$/.test(t)?null:"Key must start with a lowercase English letter or underscore, and may contain lowercase letters, numbers, dots, underscores, and hyphens.":"Key is required."}function VN(t){return jo(t).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
|
|
104
|
+
`)}async function YN(t){const i=ge("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await _e(a,{method:"PUT",url:i}),await a.json()}async function FN(t,i,a){const r=ge("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:t,value:i})});return await _e(u,{method:"PUT",url:r}),(await u.json()).variable}async function KN(t,i,a,r){const u=ge(`conversations/${t}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:a})});return await _e(c,{method:"PUT",url:u}),await c.json()}async function XN(t){const i=ge(`settings/environment/${encodeURIComponent(t)}/reveal`),a=await fetch(i);return await _e(a,{url:i}),(await a.json()).variable.value}async function PN(t,i){const a=ge(`conversations/${t}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await _e(r,{url:a}),(await r.json()).variable.value}async function QN(t){const i=ge(`settings/environment/${encodeURIComponent(t)}`),a=await fetch(i,{method:"DELETE"});await _e(a,{method:"DELETE",url:i})}async function WN(t,i){const a=ge(`conversations/${t}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await _e(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function ZN(t,i){const a=ge(`conversations/${t}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await _e(r,{method:"POST",url:a}),(await r.json()).item}async function JN(t,i,a){const r=ge(`conversations/${t}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await _e(u,{method:"PATCH",url:r}),(await u.json()).item}async function e2(t,i){const a=ge(`conversations/${t}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await _e(r,{method:"DELETE",url:a})}async function t2(){const t=ge("meta"),i=await fetch(t);return await _e(i,{url:t}),await i.json()}async function n2(t){const i=ge(`settings/runtime/rate-limits?refresh=${t?"1":"0"}`),a=await fetch(i);return await _e(a,{url:i}),(await a.json()).usage??null}async function i2(t,i){const a=ge("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:t,groupId:i})});return await _e(r,{method:"POST",url:a}),(await r.json()).conversation}async function l2(t){const i=ge(`conversations/${t}/complex-task`),a=await fetch(i);return await _e(a,{url:i}),(await a.json()).task}async function a2(t,i){const a=ge(`conversations/${t}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await _e(r,{url:a}),(await r.json()).task}async function r2(t,i){const a=ge(`conversations/${t}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await _e(r,{method:"POST",url:a}),(await r.json()).task}async function s2(t,i,a){const r=ge(`conversations/${t}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await _e(u,{method:"POST",url:r}),await u.json()}async function o2(t){const i=ge(`conversations/${t}/clone/retry`),a=await fetch(i,{method:"POST"});return await _e(a,{method:"POST",url:i}),await a.json()}async function Rx(t,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??Qb)),i.before&&a.set("before",i.before);const r=ge(`conversations/${t}?${a}`),u=await fetch(r);return await _e(u,{url:r}),(await u.json()).conversation}async function u2(t,i){const a=ge(`conversations/${t}/turns/${i}/history-events`),r=await fetch(a);return await _e(r,{url:a}),(await r.json()).events}async function pc(t,i){const a=ge(`conversations/${t}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await _e(r,{method:"PATCH",url:a}),(await r.json()).conversation}async function c2(t){const i=ge(`conversations/${t}`),a=await fetch(i,{method:"DELETE"});await _e(a,{method:"DELETE",url:i})}function d2(t){return t.title==="Phase boundary recommended"||t.title==="Long run in progress"}function Ev(t){return t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")} +${t.length-3}`}function f2(t,i){if(t.event==="server.error"||t.event==="client.error")return{id:t.id,kind:"error",title:"Error",body:O2(t.data),createdAt:t.createdAt??new Date().toISOString()};if(t.event==="server.collaboration.message_staged"||t.event==="server.collaboration.message_sent"||t.event==="server.collaboration.message_rejected"){const c=pe(t.data),d=Ie(c.toolCallId),h=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||h!==null){const g=t.event==="server.collaboration.message_staged",m=t.event==="server.collaboration.message_sent",b=Ie(c.audience),x=Ie(c.recipientWorkspaceId),w=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(z=>typeof z=="string"):Array.isArray(c.recipients)?c.recipients.filter(z=>typeof z=="string"):[],S=w.filter(z=>z!=="ALL").map(z=>i.get(z)).filter(z=>!!z);let T="Topic";S.length>0?T=Ev(S):w.length===1?T=w[0]==="ALL"?"Topic participants":pa(w[0]):w.length>1?T=`${w.length} workspaces`:b==="public"||b==="all"?T="Topic participants":b==="owner"&&(T="Topic owner");const L=Ie(c.topicId);return{id:t.id,kind:"collaboration",title:`Send to ${T}`,body:L?`Topic ${pa(L)}`:"Topic",createdAt:t.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${h}`,meta:g?"pending send":m?"done":"failed",output:g||m?Ie(c.contentMarkdown)||void 0:Ie(c.reason)||void 0,topicAction:"send"}}}if(t.event==="codex.input_request"||t.event==="codex.input_or_approval_request"){const c=pe(t.data);if(t.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=pe(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=pe(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",w=Array.isArray(b.options)?b.options.map(S=>{const T=pe(S);return typeof T.label=="string"?`- ${T.label}${typeof T.description=="string"?`: ${T.description}`:""}`:""}).filter(Boolean).join(`
|
|
105
|
+
`):"";return w?`${x}
|
|
106
|
+
|
|
107
|
+
${w}`:x}).join(`
|
|
108
|
+
|
|
109
|
+
`);return{id:t.id,kind:"activity",title:"Seele needs input",body:g||"Please answer in the main input box to continue.",createdAt:t.createdAt??new Date().toISOString(),meta:"waiting for reply"}}}if(t.event==="codex.dynamic_tool_request"){const c=pe(t.data),d=pe(c.params),h=Ie(d.tool)||"dynamic tool",g=pe(d.arguments);return{id:t.id,kind:h==="seele_topics"?"collaboration":"activity",title:_v(h,!1,g),body:Dv(h,g),createdAt:t.createdAt??new Date().toISOString(),itemId:Ie(d.callId)||void 0,meta:"running",topicAction:h==="seele_topics"?Tv(g.action):void 0}}if(t.event==="server.responsibility.proposed"){const c=pe(t.data),d=typeof c.responsibility=="string"?c.responsibility:"";return{id:t.id,kind:"responsibility",title:"Responsibility change proposed",body:d,createdAt:t.createdAt??new Date().toISOString(),meta:"pending",responsibilityProposalId:String(t.id),responsibilityReason:typeof c.reason=="string"?c.reason:void 0,responsibilityAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0}}if(t.event==="server.knowledge.proposed"){const c=pe(t.data),d=pe(c.knowledge);return{id:t.id,kind:"knowledge",title:c.action==="update"?"Knowledge update proposed":"Knowledge creation proposed",body:JSON.stringify(d,null,2),createdAt:t.createdAt??new Date().toISOString(),meta:"pending",knowledgeProposalId:String(t.id),knowledgeAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0}}if(t.event==="server.complex_task.plan_updated"){const c=pe(t.data),d=pe(c.task),h=pe(d.currentPlan),g=pe(c.update),m=Ie(g.operation),b=typeof h.version=="number"?`v${h.version}`:"updated",x=typeof g.changeCount=="number"?g.changeCount:1;return{id:t.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${x} change${x===1?"":"s"}`,createdAt:t.createdAt??new Date().toISOString(),linkedTaskId:Ie(d.id)||void 0,meta:b}}if(t.event==="server.complex_task.plan_update_failed"){const c=pe(t.data);return{id:t.id,kind:"error",title:"Plan update failed",body:Ie(c.reason)||"The proposed Plan change could not be applied.",createdAt:t.createdAt??new Date().toISOString(),meta:"not applied"}}if(t.event==="runtime.command.started"||t.event==="runtime.command.completed"){const c=pe(t.data),d=t.event==="runtime.command.completed",h=typeof c.exitCode=="number"?c.exitCode:null;return{id:t.id,kind:"command",title:d?h!==null&&h!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?yc(c.command):"command",createdAt:t.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?h!==null?`exit ${h}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(t.event==="runtime.compaction.started"||t.event==="runtime.compaction.completed"){const c=pe(t.data),d=t.event==="runtime.compaction.completed";return{id:t.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:Rp(c,d),createdAt:t.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?"done":"running"}}if(t.event==="codex.server_request"){const c=pe(t.data);if(c.method==="item/commandExecution/requestApproval"){const d=M2(c.requestId),h=pe(c.params),g=typeof h.command=="string"?h.command:"command";return{id:t.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:t.createdAt??new Date().toISOString(),itemId:typeof h.itemId=="string"?h.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof t.turnId=="string"?t.turnId:typeof h.turnId=="string"?h.turnId:void 0,approvalReason:typeof h.reason=="string"?h.reason:void 0}}}if(t.event!=="codex.notification")return null;const a=pe(t.data),r=a.method,u=pe(a.params);if(r==="item/started"){const c=pe(u.item);if(c.type==="commandExecution"){const h=c.status==="inProgress"&&c.processId===null;return{id:t.id,kind:"command",title:h?"Command waiting for approval":"Seele ran command",body:yc(c.command),createdAt:t.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:h?"approval":"running"}}const d=Ec(c);if(d)return{id:t.id,kind:"file",title:"Seele changed file",body:d,createdAt:t.createdAt??new Date().toISOString(),meta:"started"}}if(r==="item/completed"){const c=pe(u.item);if(c.type==="commandExecution"){const h=typeof c.exitCode=="number"?c.exitCode:null;return{id:t.id,kind:"command",title:h!==null&&h!==0?"Command failed":"Command completed",body:yc(c.command),createdAt:t.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:h!==null?`exit ${h}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=Ec(c);if(d)return{id:t.id,kind:"file",title:"File updated",body:d,createdAt:t.createdAt??new Date().toISOString(),meta:"done"}}return r==="item/commandExecution/outputDelta"?{id:t.id,kind:"command",title:"Command output",body:typeof u.itemId=="string"?u.itemId:"command",createdAt:t.createdAt??new Date().toISOString(),itemId:typeof u.itemId=="string"?u.itemId:void 0,meta:"running",output:typeof u.delta=="string"?u.delta:void 0}:null}function p2(t){if(t.event!=="codex.notification")return null;const i=pe(t.data),a=i.method;if(a!=="item/started"&&a!=="item/completed")return null;const r=pe(i.params),u=pe(r.item),c=typeof u.type=="string"?u.type:"item";if(Nv(c)||Ec(u))return null;const d=a==="item/completed",h=pe(u.arguments),g=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:t.id,kind:g==="seele_topics"?"collaboration":"activity",title:g?_v(g,d,h):d?`Finished ${fa(c)}`:`Working on ${fa(c)}`,body:g?Dv(g,h):Mv(u,c),createdAt:t.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:d?m2(u):"running",topicAction:g==="seele_topics"?Tv(h.action):void 0}}function Tv(t){return t==="read"||t==="history"||t==="send"?t:void 0}function h2(t){if(zv(t)||["server.turn","server.done","server.notification.sent","server.notification.failed","server.approval.decision","server.responsibility.decision","server.knowledge.decision","server.collaboration.topic_created"].includes(t.event))return null;const i=VE(t);return i?{id:t.id,kind:"activity",title:Rv(i),body:Av(t.data),createdAt:t.createdAt??new Date().toISOString(),meta:"event"}:null}function Av(t){const i=pe(t);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return Ov(i[a].trim(),180);return"Event details are available"}function Nv(t){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(t)}function m2(t){return t.status==="failed"||t.status==="error"?"failed":t.status==="cancelled"||t.status==="canceled"?"stopped":"done"}function fa(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function _v(t,i,a){if(t==="seele_topics")switch(Ie(a.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(t==="seele_wakeup")return i?"Wakeup change ready":"Updating workspace wakeup";if(t==="seele_workspace_change")return i?"Workspace change proposed":"Preparing workspace change";const r=fa(t);return i?`Finished ${r}`:`Running ${r}`}function Dv(t,i){if(t==="seele_topics"){const a=Ie(i.topicId);return a?`Topic ${pa(a)}`:"Topic"}return t==="seele_wakeup"?"Schedule, replace, or cancel the current wakeup":t==="seele_workspace_change"?"Create a governed workspace change proposal":fa(t)}function Mv(t,i){for(const a of["title","name","description","text","summary"])if(typeof t[a]=="string"&&t[a].trim())return Xr(t[a].trim(),160);return typeof t.id=="string"?`${fa(i)} ${pa(t.id)}`:fa(i)}function g2(t){var a;if(t.meta==="running")return"running";if(t.meta==="approval")return"approval";if(t.meta==="stopped")return"stopped";const i=(a=t.meta)==null?void 0:a.match(/^exit\s+(-?\d+)$/);return i?Number(i[1])===0?"done":"failed":"done"}function y2(t,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?t.meta??"failed":"ok"}function x2(t,i){var r;if(i==="running")return"Command is still running.";if(i==="approval")return"Waiting for approval before running.";if(i==="stopped")return"Command was stopped.";const a=(r=t.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return a?`Exit code: ${a[1]}`:i==="failed"?"Command failed.":"Command completed."}function b2(t,i){const a=t.split(/\r?\n/),u=a.slice(0,i).join(`
|
|
110
|
+
`);return a.length>i?`${u}
|
|
111
|
+
...`:u}function v2(t,i){return t?t.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function jc(t){return/^call_[A-Za-z0-9]+$/.test(t)||t==="command"}function w2(t){const i=t.trim();return!i||i.includes(`
|
|
112
|
+
`)?null:Xr(i,120)}function Xr(t,i){if(t.length<=i)return t;const a=Math.max(8,Math.floor((i-3)/2));return`${t.slice(0,a)}...${t.slice(-a)}`}function Ov(t,i){return t.length<=i?t:`${t.slice(0,Math.max(1,i-3))}...`}function Rv(t){const a=(t.split(/[./]/).filter(Boolean).pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function zv(t){const i=t.createdAt??new Date().toISOString();if(t.event==="server.status"){const c=pe(t.data);if(c.status==="initialized")return{id:t.id,title:"Connected to Seele runtime",createdAt:i,tone:"done"};if(c.status==="turn_started")return{id:t.id,title:"Turn started",createdAt:i,tone:"running"};if(c.status==="archived_thread_replaced")return{id:t.id,title:"Started a fresh runtime thread",detail:typeof c.archivedThreadId=="string"?`archived ${pa(c.archivedThreadId)}`:void 0,createdAt:i,tone:"warning"}}if(t.event==="server.stopped"||t.event==="server.stop")return{id:t.id,title:"Stopped current run",createdAt:i,tone:"error"};if(t.event==="runtime.worker_stale")return{id:t.id,title:"Runtime appears stalled",detail:"No runtime signal for a while",createdAt:i,tone:"warning"};if(t.event==="runtime.worker_recovered")return{id:t.id,title:"Runtime resumed",createdAt:i,tone:"running"};if(t.event==="runtime.compaction.started"){const c=pe(t.data);return{id:t.id,title:"Codex compacting context",detail:Rp(c,!1),createdAt:i,tone:"running"}}if(t.event==="runtime.compaction.completed"){const c=pe(t.data);return{id:t.id,title:"Codex context compacted",detail:Rp(c,!0),createdAt:i,tone:"done"}}if(t.event==="server.turn.long_running")return{id:t.id,title:"Long run in progress",detail:"Consider splitting into a wakeup phase",createdAt:i,tone:"warning"};if(t.event==="server.turn.phase_boundary_recommended"){const c=pe(t.data);return{id:t.id,title:"Phase boundary recommended",detail:typeof c.operationCount=="number"?`${c.operationCount} operations in this turn`:"Many operations in this turn",createdAt:i,tone:"warning"}}if(t.event==="server.wakeup.started"){const c=pe(t.data);return{id:t.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?Xr(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(t.event==="codex.server_request"){const c=pe(t.data);if(c.method==="item/commandExecution/requestApproval"){const d=pe(c.params);return{id:t.id,title:"Waiting for approval",detail:typeof d.command=="string"?Xr(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(t.event!=="codex.notification")return null;const a=pe(t.data),r=a.method,u=pe(a.params);if(r==="item/started"||r==="item/completed"){const c=pe(u.item),d=typeof c.type=="string"?c.type:"item",h=r==="item/completed";if(d==="commandExecution")return{id:t.id,title:h?"Command completed":"Running command",detail:Xr(yc(c.command),96),createdAt:i,tone:h?"done":"running"};if(d==="contextCompaction")return{id:t.id,title:h?"Codex context compacted":"Codex compacting context",detail:h?void 0:"Current runtime thread is being compacted",createdAt:i,tone:h?"done":"running"};const g=Ec(c);if(g)return{id:t.id,title:h?"File update finished":"Editing file",detail:Xr(g,96),createdAt:i,tone:h?"done":"running"};if(!Nv(d))return{id:t.id,title:h?`Finished ${fa(d)}`:`Working on ${fa(d)}`,detail:Mv(c,d),createdAt:i,tone:h?"done":"running"}}if(r==="thread/status/changed"){const c=pe(u.status),d=Array.isArray(c.activeFlags)?c.activeFlags:[];if(c.type==="active"&&d.some(h=>h==="waitingOnApproval"))return{id:t.id,title:"Waiting for approval",detail:"Command needs confirmation",createdAt:i,tone:"warning"}}if(r==="turn/started")return{id:t.id,title:"Seele started working",createdAt:i,tone:"running"};if(r==="turn/completed"){const c=pe(u.turn);return{id:t.id,title:"Turn completed",detail:typeof c.durationMs=="number"?To(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=pe(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:t.id,title:r==="hook/started"?`Running ${Lx(d)}`:`Finished ${Lx(d)}`,detail:typeof c.durationMs=="number"?To(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function Rp(t,i){const a=Cc(t.before),r=Cc(t.after),u=[];if(i){const c=typeof t.durationMs=="number"?t.durationMs:null;u.push(c===null?"Completed":`Completed in ${To(c)}`)}else u.push("Codex triggered");if(a&&r){u.push(`context ${Ja(a)} → ${Ja(r)}`);const c=a.totalTokens-r.totalTokens;c>0&&u.push(`released ~${sh(c)} tokens`)}else a&&u.push(`context ${Ja(a)}`);return u.join(" · ")}function k2(t){const i=Cc(t.before),a=Cc(t.after),r=i&&a?i.totalTokens-a.totalTokens:null;let u="Unavailable";return i&&a?u=`${Ja(i)} → ${Ja(a)}`:i?u=`${Ja(i)} → unavailable`:a&&(u=`unavailable → ${Ja(a)}`),[{label:"Trigger",value:t.trigger==="codex"?"Codex automatic":t.trigger??"Unavailable"},{label:"Duration",value:t.durationMs===null?"Unavailable":To(t.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${sh(r)} tokens`:"No decrease observed"}]}function Cc(t){const i=pe(t);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function Ja(t){return t.modelContextWindow&&t.modelContextWindow>0?`${Math.round(t.totalTokens/t.modelContextWindow*100)}%`:`${sh(t.totalTokens)} tokens`}function sh(t){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,t))}function S2(t){let i=null;for(const a of t)for(const r of a.events){const u=E2(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function zx(...t){return t.reduce((i,a)=>a&&(!i||Date.parse(a.updatedAt)>Date.parse(i.updatedAt))?a:i,null)}function j2(t){let i=null;for(const a of t){const r=Lv(a);r&&(!i||So(a,i)>0)&&(i=r)}return i}function Lv(t){if(t.event!=="codex.notification")return null;const i=pe(t.data);if(i.method!=="thread/tokenUsage/updated")return null;const a=pe(i.params),r=pe(a.tokenUsage),u=pe(r.last),c=pe(r.total),d=Object.keys(u).length>0?u:c,h=si(d.totalTokens);return h===null?null:{totalTokens:h,inputTokens:si(d.inputTokens),cachedInputTokens:si(d.cachedInputTokens),outputTokens:si(d.outputTokens),reasoningOutputTokens:si(d.reasoningOutputTokens),modelContextWindow:si(r.modelContextWindow),createdAt:t.createdAt??new Date().toISOString()}}function C2(...t){return t.reduce((i,a)=>a&&(!i||Date.parse(a.createdAt)>Date.parse(i.createdAt))?a:i,null)}function Iv(t){return t!=null&&t.modelContextWindow&&t.modelContextWindow>0?t.totalTokens/t.modelContextWindow*100:null}function E2(t){if(t.event!=="codex.notification")return null;const i=pe(t.data);if(i.method!=="account/rateLimits/updated")return null;const a=pe(i.params),r=pe(a.rateLimits),u=[r.primary,r.secondary].map(c=>T2(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:t.createdAt??new Date().toISOString()}}function T2(t){const i=pe(t);return typeof i.usedPercent!="number"||typeof i.resetsAt!="number"||typeof i.windowDurationMins!="number"?null:{usedPercent:i.usedPercent,resetsAt:i.resetsAt,windowDurationMins:i.windowDurationMins}}function A2(t,i){return t?!i||t===i?t:i.startsWith(t)?i:`${t}${i}`:i}function yc(t){return typeof t=="string"?t:Array.isArray(t)?t.map(i=>String(i)).join(" "):"command"}function Ec(t){const i=t.path??t.file??t.filename;return typeof i=="string"?i:null}function pe(t){return t&&typeof t=="object"?t:{}}function si(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function Ie(t){return typeof t=="string"?t:""}function er(t){return t.replace(/([\\`*_[\]<>])/g,"\\$1")}function N2(t){const i=pe(t),a=pe(i.thread);if(!Object.keys(a).length)return null;const r=Array.isArray(a.turns)?a.turns:[],u=[];let c=0,d=0,h=0,g=0,m=0;return r.forEach((b,x)=>{const w=pe(b),S=Ie(w.id)||`turn-${x+1}`,T=Array.isArray(w.items)?w.items:[];c+=T.length,u.push(_2(w,S)),T.forEach(L=>{const z=pe(L),D=Ie(z.type);D==="userMessage"?d+=1:D==="agentMessage"?h+=1:D==="compaction"?g+=1:D==="contextCompaction"&&(m+=1)})}),{id:Ie(a.id),sessionId:Ie(a.sessionId),status:Uv(a.status),source:oh(a.source),cwd:Ie(a.cwd),path:Ie(a.path),preview:Ie(a.preview),createdAt:si(a.createdAt),updatedAt:si(a.updatedAt),recencyAt:si(a.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:h,compactionCount:g,contextCompactionCount:m,turns:u}}function _2(t,i){const a=Array.isArray(t.items)?t.items:[],r=Array.from(new Set(a.map(c=>Ie(pe(c).type)).filter(c=>c.length>0))).join(", "),u=D2(a.map(c=>zp(c)).filter(Boolean).join(" "),220);return{id:i,status:Uv(t.status),itemsView:Ie(t.itemsView)||"unknown",itemCount:a.length,startedAt:si(t.startedAt),completedAt:si(t.completedAt),durationMs:si(t.durationMs),itemTypes:r,preview:u,raw:t}}function zp(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(zp).filter(Boolean).join(`
|
|
113
|
+
`);if(!t||typeof t!="object")return"";const i=t,a=Ie(i.text),r=zp(i.content);return[a,r].filter(Boolean).join(`
|
|
114
|
+
`)}function Uv(t){const i=pe(t);return Ie(i.type)||oh(t)}function D2(t,i){const a=t.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}...`:a}function ho(t){return t===null?"unknown":et(t*1e3)}function M2(t){return typeof t=="number"&&Number.isFinite(t)||typeof t=="string"&&t.trim()?t:null}function oh(t){if(typeof t=="string")return t;const i=JSON.stringify(t);return i.length>180?`${i.slice(0,180)}...`:i}function O2(t){if(typeof t=="string")return t;const i=pe(t),a=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return a&&r?`${a}
|
|
115
|
+
|
|
116
|
+
${r}`:a||r||oh(t)}function Lx(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function To(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(t<1e4?1:0)}s`}function R2(t){return`${Math.round(t)}%`}function Qn(t){return new Intl.NumberFormat("en-US").format(t)}function xc(t){return t===null?"unknown":Qn(t)}function uh(t){return Math.max(0,Math.min(100,Math.round(t)))}function ch(t){return t>=100?"exhausted":t>=90?"danger":t>=75?"warning":"healthy"}function z2(t){return et(t*1e3)}function et(t){const i=typeof t=="number"?new Date(t):new Date(t);if(Number.isNaN(i.getTime()))return"";const a={timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},r=new Intl.DateTimeFormat("en-CA",a).formatToParts(i),u=c=>{var d;return((d=r.find(h=>h.type===c))==null?void 0:d.value)??""};return`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`}function L2(t){const i=new Date(t);return Number.isNaN(i.getTime())?"--:--:--":new Intl.DateTimeFormat("en-GB",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(i)}function Ix(t){return t==="minimal"?"Minimal":t==="low"?"Low":t==="medium"?"Medium":t==="high"?"High":t==="xhigh"?"Extra high":"Medium"}function Ux(t,i){const a=t?i.find(r=>r.model===t):i.find(r=>r.isDefault);return a?`${a.displayName}${a.isDefault?" (default)":""}`:t||"Unavailable"}function Rc(t){return t?t.replace(/^codex-cli\s+/i,""):"Unavailable"}function Lp(t,i){const a=Rc(t);return i?`${a} (${et(i)})`:a}function I2(t){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(Rc(t))}`}function U2(t,i){const a=Bx(t),r=Bx(i);if(!a||!r)return!1;for(let u=0;u<a.core.length;u+=1)if(a.core[u]!==r.core[u])return a.core[u]>r.core[u];return a.prerelease===r.prerelease?!1:a.prerelease?r.prerelease?a.prerelease.localeCompare(r.prerelease,void 0,{numeric:!0})>0:!1:!0}function Bx(t){if(!t)return null;const i=Rc(t).match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);return i?{core:[Number(i[1]),Number(i[2]),Number(i[3])],prerelease:i[4]??null}:null}function B2(t,i){const a=t.map(r=>({value:r.model,label:`${r.displayName}${r.isDefault?" (default)":""}`}));return i&&!t.some(r=>r.model===i)&&a.push({value:i,label:`${i} (unavailable)`}),a.length===0&&a.push({value:"",label:"Models unavailable"}),a}async function pp(t,i){const a=t.getReader(),r=new TextDecoder;let u="";for(;;){const{done:c,value:d}=await a.read();if(c)break;u+=r.decode(d,{stream:!0});const h=u.split(`
|
|
117
|
+
|
|
118
|
+
`);u=h.pop()??"";for(const g of h){const m=q2(g);m&&i(m)}}}function q2(t){const i=t.split(`
|
|
119
|
+
`),a=i.find(d=>d.startsWith("event: ")),r=i.filter(d=>d.startsWith("data: ")).map(d=>d.slice(6));if(!a||r.length===0)return null;const u=a.slice(7),c=r.join(`
|
|
120
|
+
`);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function H2(t){var r,u,c,d,h;if(!t||typeof t!="object")return null;const i=t;if(i.method!=="item/agentMessage/delta"&&i.method!=="item/plan/delta")return null;const a=((r=i.params)==null?void 0:r.delta)??((u=i.params)==null?void 0:u.text)??"";return a?{text:a,phase:i.method==="item/plan/delta"?"final_answer":((c=i.params)==null?void 0:c.phase)==="commentary"||((d=i.params)==null?void 0:d.phase)==="final_answer"?i.params.phase:"unknown",itemId:(h=i.params)==null?void 0:h.itemId}:null}function $2(t){var r;if(!t||typeof t!="object")return null;const i=t;if(i.method!=="item/started")return null;const a=(r=i.params)==null?void 0:r.item;return(a==null?void 0:a.type)!=="agentMessage"&&(a==null?void 0:a.type)!=="plan"?null:{itemId:a.id,phase:a.type==="plan"?"final_answer":a.phase==="commentary"||a.phase==="final_answer"?a.phase:"unknown"}}function G2(t){var r;if(!t||typeof t!="object")return null;const i=t;if(i.method!=="item/completed")return null;const a=(r=i.params)==null?void 0:r.item;return(a==null?void 0:a.type)!=="agentMessage"&&(a==null?void 0:a.type)!=="plan"||!a.text?null:{itemId:a.id,text:a.text,phase:a.type==="plan"?"final_answer":a.phase==="commentary"||a.phase==="final_answer"?a.phase:"unknown"}}function Fr(t){var a,r,u,c;if(t.event==="server.error"||t.event==="client.error")return"error";if(!t.data||typeof t.data!="object")return null;const i=t.data;return i.method==="thread/status/changed"&&((r=(a=i.params)==null?void 0:a.status)==null?void 0:r.type)==="idle"?"done":i.method==="turn/completed"?(c=(u=i.params)==null?void 0:u.turn)!=null&&c.error?"error":"done":null}function Pr(t){return t.length<=6?t:t.slice(0,6)}function pa(t){return t.slice(0,8)}function qx(t){switch(t){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function Hx(t){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[t]}function hp(t,...i){return i.includes(t)}function V2(t,i){const a=Date.parse(t.startedAt??t.createdAt),r=t.finishedAt?Date.parse(t.finishedAt):i;if(!Number.isFinite(a)||!Number.isFinite(r))return"";const u=Math.max(0,Math.floor((r-a)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function Y2(t,i){const a=Date.parse(t),r=Date.parse(i);if(!Number.isFinite(a)||!Number.isFinite(r))return"Goal completed";const u=Math.max(0,Math.floor((r-a)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function mp(t,i){var a;return i==="running"||i==="error"?i:((a=t==null?void 0:t.nextWakeup)==null?void 0:a.status)==="scheduled"?"waiting":i}function F2(t,i){return`waiting ${Ip(t,i)}`}function Ip(t,i){const a=Date.parse(t.wakeAt);if(Number.isNaN(a))return"waiting";const r=Math.max(0,Math.ceil((a-i)/1e3));if(r<60)return`${r}s`;const u=Math.ceil(r/60);if(u<60)return`${u}m`;const c=Math.ceil(u/60);return c<24?`${c}h`:`${Math.ceil(c/24)}d`}function gp(t,i=null,a=Date.now()){if(t==="waiting")return i?F2(i,a):"waiting";switch(t){case"done":return"idle";case"running":return"running";case"error":return"error";case"initializing":return"initializing";case"initialization_failed":return"initialization failed";case"idle":return"idle"}}function $x(t){switch(t){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function K2(t){return t==="assistant"?"Seele":"You"}const X2=document.getElementById("root"),Bv=window.__seeleCodexRoot??f1.createRoot(X2);window.__seeleCodexRoot=Bv;e_();Bv.render(o.jsx(R.StrictMode,{children:o.jsx(P2,{})}));function P2(){const[t,i]=R.useState(null),[a,r]=R.useState("admin"),[u,c]=R.useState(""),[d,h]=R.useState(!1),[g,m]=R.useState("");R.useEffect(()=>{Gx().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),m("Unable to reach Seele.")})},[]),R.useEffect(()=>{const w=()=>{i({enabled:!0,authenticated:!1,user:null}),c(""),m("Your session has expired. Sign in again.")};return window.addEventListener(Np,w),()=>window.removeEventListener(Np,w)},[]);async function b(w){w.preventDefault(),h(!0),m("");try{const S=await fetch(ge("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a,password:u})});if(!S.ok){m(S.status===401?"Incorrect username or password.":S.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}c(""),i(await Gx())}catch{m("Unable to reach Seele.")}finally{h(!1)}}async function x(){await fetch(ge("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}if(!t)return o.jsx("main",{className:"auth-shell",children:o.jsx("span",{className:"auth-loading",children:"Loading Seele..."})});if(!t.enabled||t.authenticated){const w=t.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return o.jsx(jT,{authEnabled:t.enabled,currentUser:w,onLogout:x})}return o.jsx("main",{className:"auth-shell",children:o.jsxs("section",{className:"auth-panel",children:[o.jsxs("header",{children:[o.jsx("p",{children:"Seele"}),o.jsx("h1",{children:"Sign in"})]}),o.jsxs("form",{onSubmit:b,children:[o.jsxs("label",{children:[o.jsx("span",{children:"Username"}),o.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:w=>r(w.target.value),value:a})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Password"}),o.jsx("input",{autoComplete:"current-password",onChange:w=>c(w.target.value),type:"password",value:u})]}),g?o.jsx("p",{className:"auth-error",role:"alert",children:g}):null,o.jsx("button",{disabled:d||!a||!u,type:"submit",children:d?"Signing in...":"Sign in"})]})]})})}async function Gx(){const t=await fetch(ge("auth/session"));if(!t.ok)throw new Error(`Auth session request failed: ${t.status}`);return t.json()}async function Q2(){const t=ge("admin/users"),i=await fetch(t);if(!i.ok)throw await Xt(i,{url:t});return(await i.json()).users}async function W2(t){const i=ge("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw await Xt(a,{method:"POST",url:i});return(await a.json()).user}async function Z2(t,i){const a=ge(`admin/users/${encodeURIComponent(t)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Xt(r,{method:"PATCH",url:a});return(await r.json()).user}async function J2(t){const i=ge(`admin/users/${encodeURIComponent(t)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await Xt(a,{method:"DELETE",url:i})}function e_(){if(window.__seeleAuthFetchInstalled)return;const t=window.fetch.bind(window);window.fetch=async(...i)=>{const a=await t(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;return a.status===401&&!r.includes("/api/auth/")&&window.dispatchEvent(new Event(Np)),a},window.__seeleAuthFetchInstalled=!0}export{vt as _,p1 as a,N1 as b,Wy as c,C1 as f,Vx as g,A1 as h,qp as s,x1 as w};
|