@seele00/seele-work 0.1.111 → 0.1.113
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/release-manifest.json +127 -127
- package/web/dist/assets/{abnfDiagram-VRR7QNED-qvnK_m_e.js → abnfDiagram-VRR7QNED-CTFNTHtM.js} +1 -1
- package/web/dist/assets/{arc-BbReUH_0.js → arc-DS3EJOfQ.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-BwQrzjyW.js → architectureDiagram-ZJ3FMSHR-9BTL3Ju3.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-Bya9obRj.js → blockDiagram-677ZJIJ3-CxNwI3Xj.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-Bi7ZjeZ2.js → c4Diagram-LMCZKHZV-C5g2eUlL.js} +1 -1
- package/web/dist/assets/channel-C6DgvyR9.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-DXQ0tX08.js → chunk-2Q5K7J3B-DLiVoZwr.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-AzzSJ27B.js → chunk-32BRIVSS-BaP4nKH_.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-Bqg5-JqI.js → chunk-5VM5RSS4-CvQNZGgw.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-D6BZwof2.js → chunk-EX3LRPZG-DtrgZU5v.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-CrIm9cbH.js → chunk-JWPE2WC7-D4nWpDMu.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-CXj1xx9q.js → chunk-MOJQB5TN-BWEHq24P.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-DZQ0Z09Q.js → chunk-RYQCIY6F-vtxLm7z0.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-BtOj3IUF.js → chunk-V7JOEXUC-llCgx7fN.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-euDRT0ME.js → chunk-VR4S4FIN-6uhuz7-D.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-DhVUeW3M.js → chunk-XXDRQBXY-CsMCPwks.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-DgAdMh5n.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-DgAdMh5n.js +1 -0
- package/web/dist/assets/{core-DZdSXnTD.js → core-bqmd5bjk.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-BSI6vHZs.js → cose-bilkent-JH36ORCC-CeuPKvzZ.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-BxrIg9Na.js → cynefin-VYW2F7L2-Fo6bLIsl.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-MM1Ji7OO.js → cynefinDiagram-TSTJHNR4-CSawoxKX.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-BUTZfI14.js → dagre-VKFMJZFB-D9Xhs7On.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-DTWg5rjN.js → diagram-FQU43EPY-DB6cN00s.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-ByiMA0Ie.js → diagram-G47NLZAW-DNjwGU89.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-D-inMuDB.js → diagram-NH7WQ7WH-C3vQfyZ-.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-CPJyqVXm.js → diagram-OA4YK3LP-D0hZJ12O.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-CIdw4JIr.js → diagram-WEI45ONY-C0WVplc9.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-DSwRZWuJ.js → ebnfDiagram-CCIWWBDH-Cn3Px4hL.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-DPQUbv3X.js → erDiagram-Q63AITRT-BepZUHQn.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-CJCQdu9Y.js → flowDiagram-23GEKE2U-V3omTqUp.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-6IK9OvNc.js → ganttDiagram-NO4QXBWP-Cy_CoUKz.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-CpLiYp_r.js → gitGraphDiagram-IHSO6WYX-WhcXyRXe.js} +1 -1
- package/web/dist/assets/{index-DUH8ZuNo.js → index-CwPe0GUY.js} +39 -39
- package/web/dist/assets/{index-BAAV84l8.css → index-DxOW60R2.css} +1 -1
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-BvYI4rcw.js → infoDiagram-FWYZ7A6U-gZwwoFtB.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-DgB2kOg7.js → ishikawaDiagram-FXEZZL3T-J8gxmrVV.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-wH0iB-JA.js → journeyDiagram-5HDEW3XC-PAvt63QU.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-DpjDlb3W.js → kanban-definition-HUTT4EX6-BYxCMhgE.js} +1 -1
- package/web/dist/assets/{linear-DNIUzRDP.js → linear-AosVMPOw.js} +1 -1
- package/web/dist/assets/{mermaid.core-B0u2MJhc.js → mermaid.core-Ci_ONQ9q.js} +4 -4
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-D0NN-NUz.js → mindmap-definition-LN4V7U3C-Cz93df7q.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-BZ9qPG3I.js → pegDiagram-2B236MQR-BYDLv35r.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-DngbeHMQ.js → pieDiagram-ENE6RG2P-DWhhF7Hn.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-1cyy5M3T.js → quadrantDiagram-ABIIQ3AL-MMJJt6nx.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-Bg03_FP2.js → railroadDiagram-RFXS5EU6-DPlzTzo3.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-DwlKvkfq.js → requirementDiagram-TGXJPOKE-CQyfc0-y.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-BOextwnK.js → sankeyDiagram-HTMAVEWB-BcHtyC1S.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-np2yD92W.js → sequenceDiagram-DBY2YBRQ-DNYEIkZM.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-CfGofQi1.js → sizeCapture-X5ZJPWSS-CKIvFl0J.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-CG6i_koZ.js → stateDiagram-2N3HPSRC-Bj_EvZzb.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DEtbmzxr.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-DskAxe9W.js → swimlanes-5IMT3BWC-DcyNtdoo.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-DvBxqz5a.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-DO6mD1vO.js → timeline-definition-FHXFAJF6-BPciKKRW.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-D9BqGiKv.js → vennDiagram-L72KCM5P-DLI8MwWc.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-BvlSTrl1.js → wardleyDiagram-EHGQE667-CCQNQxnJ.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-DAW1JCAg.js → xychartDiagram-FW5EYKEG-BAiR6SbB.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/channel-W3zFHkdg.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-DMNViOFe.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-DMNViOFe.js +0 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-GXp4wpO_.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-TYuLB8wT.js +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
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 Bk=Object.defineProperty;var qk=(e,i,a)=>i in e?Bk(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var
|
|
2
|
+
var Bk=Object.defineProperty;var qk=(e,i,a)=>i in e?Bk(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var _c=(e,i,a)=>qk(e,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 Hk="modulepreload",$k=function(e,i){return new URL(e,i).href},wy={},Tt=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(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};const p=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=$k(b,r),b in wy)return;wy[b]=!0;const x=b.endsWith(".css"),S=x?'[rel="stylesheet"]':"";if(!!r)for(let M=p.length-1;M>=0;M--){const H=p[M];if(H.href===b&&(!x||H.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${S}`))return;const E=document.createElement("link");if(E.rel=x?"stylesheet":Hk,x||(E.as="script"),E.crossOrigin="",E.href=b,m&&E.setAttribute("nonce",m),document.head.appendChild(E),x)return new Promise((M,H)=>{E.addEventListener("load",M),E.addEventListener("error",()=>H(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return u.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return i().catch(c)})};function vb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kf={exports:{}},Bo={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
5
5
|
*
|
|
@@ -15,7 +15,7 @@ var Bk=Object.defineProperty;var qk=(e,i,a)=>i in e?Bk(e,i,{enumerable:!0,config
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var jy;function Fk(){if(jy)return Be;jy=1;var e=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"),p=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"),S=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,H={};function R(A,z,C){this.props=A,this.context=z,this.refs=H,this.updater=C||E}R.prototype.isReactComponent={},R.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,z,"setState")},R.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function q(){}q.prototype=R.prototype;function $(A,z,C){this.props=A,this.context=z,this.refs=H,this.updater=C||E}var V=$.prototype=new q;V.constructor=$,M(V,R.prototype),V.isPureReactComponent=!0;var ie=Array.isArray;function N(){}var Q={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function ee(A,z,C){var W=C.ref;return{$$typeof:e,type:A,key:z,ref:W!==void 0?W:null,props:C}}function L(A,z){return ee(A.type,z,A.props)}function te(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function de(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(C){return z[C]})}var Ne=/\/+/g;function ye(A,z){return typeof A=="object"&&A!==null&&A.key!=null?de(""+A.key):z.toString(36)}function ue(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(N,N):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function F(A,z,C,W,fe){var X=typeof A;(X==="undefined"||X==="boolean")&&(A=null);var xe=!1;if(A===null)xe=!0;else switch(X){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(A.$$typeof){case e:case i:xe=!0;break;case b:return xe=A._init,F(xe(A._payload),z,C,W,fe)}}if(xe)return fe=fe(A),xe=W===""?"."+ye(A,0):W,ie(fe)?(C="",xe!=null&&(C=xe.replace(Ne,"$&/")+"/"),F(fe,z,C,"",function(Ct){return Ct})):fe!=null&&(te(fe)&&(fe=L(fe,C+(fe.key==null||A&&A.key===fe.key?"":(""+fe.key).replace(Ne,"$&/")+"/")+xe)),z.push(fe)),1;xe=0;var Me=W===""?".":W+":";if(ie(A))for(var Ve=0;Ve<A.length;Ve++)W=A[Ve],X=Me+ye(W,Ve),xe+=F(W,z,C,X,fe);else if(Ve=w(A),typeof Ve=="function")for(A=Ve.call(A),Ve=0;!(W=A.next()).done;)W=W.value,X=Me+ye(W,Ve++),xe+=F(W,z,C,X,fe);else if(X==="object"){if(typeof A.then=="function")return F(ue(A),z,C,W,fe);throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return xe}function oe(A,z,C){if(A==null)return A;var W=[],fe=0;return F(A,W,"","",function(X){return z.call(C,X,fe++)}),W}function
|
|
18
|
+
*/var jy;function Fk(){if(jy)return Be;jy=1;var e=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"),p=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"),S=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,H={};function R(A,z,C){this.props=A,this.context=z,this.refs=H,this.updater=C||E}R.prototype.isReactComponent={},R.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,z,"setState")},R.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function q(){}q.prototype=R.prototype;function $(A,z,C){this.props=A,this.context=z,this.refs=H,this.updater=C||E}var V=$.prototype=new q;V.constructor=$,M(V,R.prototype),V.isPureReactComponent=!0;var ie=Array.isArray;function N(){}var Q={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function ee(A,z,C){var W=C.ref;return{$$typeof:e,type:A,key:z,ref:W!==void 0?W:null,props:C}}function L(A,z){return ee(A.type,z,A.props)}function te(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function de(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(C){return z[C]})}var Ne=/\/+/g;function ye(A,z){return typeof A=="object"&&A!==null&&A.key!=null?de(""+A.key):z.toString(36)}function ue(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(N,N):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function F(A,z,C,W,fe){var X=typeof A;(X==="undefined"||X==="boolean")&&(A=null);var xe=!1;if(A===null)xe=!0;else switch(X){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(A.$$typeof){case e:case i:xe=!0;break;case b:return xe=A._init,F(xe(A._payload),z,C,W,fe)}}if(xe)return fe=fe(A),xe=W===""?"."+ye(A,0):W,ie(fe)?(C="",xe!=null&&(C=xe.replace(Ne,"$&/")+"/"),F(fe,z,C,"",function(Ct){return Ct})):fe!=null&&(te(fe)&&(fe=L(fe,C+(fe.key==null||A&&A.key===fe.key?"":(""+fe.key).replace(Ne,"$&/")+"/")+xe)),z.push(fe)),1;xe=0;var Me=W===""?".":W+":";if(ie(A))for(var Ve=0;Ve<A.length;Ve++)W=A[Ve],X=Me+ye(W,Ve),xe+=F(W,z,C,X,fe);else if(Ve=w(A),typeof Ve=="function")for(A=Ve.call(A),Ve=0;!(W=A.next()).done;)W=W.value,X=Me+ye(W,Ve++),xe+=F(W,z,C,X,fe);else if(X==="object"){if(typeof A.then=="function")return F(ue(A),z,C,W,fe);throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return xe}function oe(A,z,C){if(A==null)return A;var W=[],fe=0;return F(A,W,"","",function(X){return z.call(C,X,fe++)}),W}function be(A){if(A._status===-1){var z=A._result;z=z(),z.then(function(C){(A._status===0||A._status===-1)&&(A._status=1,A._result=C)},function(C){(A._status===0||A._status===-1)&&(A._status=2,A._result=C)}),A._status===-1&&(A._status=0,A._result=z)}if(A._status===1)return A._result.default;throw A._result}var _e=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},O={map:oe,forEach:function(A,z,C){oe(A,function(){z.apply(this,arguments)},C)},count:function(A){var z=0;return oe(A,function(){z++}),z},toArray:function(A){return oe(A,function(z){return z})||[]},only:function(A){if(!te(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Be.Activity=x,Be.Children=O,Be.Component=R,Be.Fragment=a,Be.Profiler=u,Be.PureComponent=$,Be.StrictMode=r,Be.Suspense=g,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,Be.__COMPILER_RUNTIME={__proto__:null,c:function(A){return Q.H.useMemoCache(A)}},Be.cache=function(A){return function(){return A.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(A,z,C){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var W=M({},A.props),fe=A.key;if(z!=null)for(X in z.key!==void 0&&(fe=""+z.key),z)!re.call(z,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&z.ref===void 0||(W[X]=z[X]);var X=arguments.length-2;if(X===1)W.children=C;else if(1<X){for(var xe=Array(X),Me=0;Me<X;Me++)xe[Me]=arguments[Me+2];W.children=xe}return ee(A.type,fe,W)},Be.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:c,_context:A},A},Be.createElement=function(A,z,C){var W,fe={},X=null;if(z!=null)for(W in z.key!==void 0&&(X=""+z.key),z)re.call(z,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(fe[W]=z[W]);var xe=arguments.length-2;if(xe===1)fe.children=C;else if(1<xe){for(var Me=Array(xe),Ve=0;Ve<xe;Ve++)Me[Ve]=arguments[Ve+2];fe.children=Me}if(A&&A.defaultProps)for(W in xe=A.defaultProps,xe)fe[W]===void 0&&(fe[W]=xe[W]);return ee(A,X,fe)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(A){return{$$typeof:p,render:A}},Be.isValidElement=te,Be.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:be}},Be.memo=function(A,z){return{$$typeof:m,type:A,compare:z===void 0?null:z}},Be.startTransition=function(A){var z=Q.T,C={};Q.T=C;try{var W=A(),fe=Q.S;fe!==null&&fe(C,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(N,_e)}catch(X){_e(X)}finally{z!==null&&C.types!==null&&(z.types=C.types),Q.T=z}},Be.unstable_useCacheRefresh=function(){return Q.H.useCacheRefresh()},Be.use=function(A){return Q.H.use(A)},Be.useActionState=function(A,z,C){return Q.H.useActionState(A,z,C)},Be.useCallback=function(A,z){return Q.H.useCallback(A,z)},Be.useContext=function(A){return Q.H.useContext(A)},Be.useDebugValue=function(){},Be.useDeferredValue=function(A,z){return Q.H.useDeferredValue(A,z)},Be.useEffect=function(A,z){return Q.H.useEffect(A,z)},Be.useEffectEvent=function(A){return Q.H.useEffectEvent(A)},Be.useId=function(){return Q.H.useId()},Be.useImperativeHandle=function(A,z,C){return Q.H.useImperativeHandle(A,z,C)},Be.useInsertionEffect=function(A,z){return Q.H.useInsertionEffect(A,z)},Be.useLayoutEffect=function(A,z){return Q.H.useLayoutEffect(A,z)},Be.useMemo=function(A,z){return Q.H.useMemo(A,z)},Be.useOptimistic=function(A,z){return Q.H.useOptimistic(A,z)},Be.useReducer=function(A,z,C){return Q.H.useReducer(A,z,C)},Be.useRef=function(A){return Q.H.useRef(A)},Be.useState=function(A){return Q.H.useState(A)},Be.useSyncExternalStore=function(A,z,C){return Q.H.useSyncExternalStore(A,z,C)},Be.useTransition=function(){return Q.H.useTransition()},Be.version="19.2.7",Be}var Cy;function sh(){return Cy||(Cy=1,Xf.exports=Fk()),Xf.exports}var D=sh(),Qf={exports:{}},qo={},Zf={exports:{}},Jf={};/**
|
|
19
19
|
* @license React
|
|
20
20
|
* scheduler.production.js
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@ var Bk=Object.defineProperty;var qk=(e,i,a)=>i in e?Bk(e,i,{enumerable:!0,config
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the MIT license found in the
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Ty;function Yk(){return Ty||(Ty=1,(function(e){function i(F,oe){var
|
|
26
|
+
*/var Ty;function Yk(){return Ty||(Ty=1,(function(e){function i(F,oe){var be=F.length;F.push(oe);e:for(;0<be;){var _e=be-1>>>1,O=F[_e];if(0<u(O,oe))F[_e]=oe,F[be]=O,be=_e;else break e}}function a(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var oe=F[0],be=F.pop();if(be!==oe){F[0]=be;e:for(var _e=0,O=F.length,A=O>>>1;_e<A;){var z=2*(_e+1)-1,C=F[z],W=z+1,fe=F[W];if(0>u(C,be))W<O&&0>u(fe,C)?(F[_e]=fe,F[W]=be,_e=W):(F[_e]=C,F[z]=be,_e=z);else if(W<O&&0>u(fe,be))F[_e]=fe,F[W]=be,_e=W;else break e}}return oe}function u(F,oe){var be=F.sortIndex-oe.sortIndex;return be!==0?be:F.id-oe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var g=[],m=[],b=1,x=null,S=3,w=!1,E=!1,M=!1,H=!1,R=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function V(F){for(var oe=a(m);oe!==null;){if(oe.callback===null)r(m);else if(oe.startTime<=F)r(m),oe.sortIndex=oe.expirationTime,i(g,oe);else break;oe=a(m)}}function ie(F){if(M=!1,V(F),!E)if(a(g)!==null)E=!0,N||(N=!0,de());else{var oe=a(m);oe!==null&&ue(ie,oe.startTime-F)}}var N=!1,Q=-1,re=5,ee=-1;function L(){return H?!0:!(e.unstable_now()-ee<re)}function te(){if(H=!1,N){var F=e.unstable_now();ee=F;var oe=!0;try{e:{E=!1,M&&(M=!1,q(Q),Q=-1),w=!0;var be=S;try{t:{for(V(F),x=a(g);x!==null&&!(x.expirationTime>F&&L());){var _e=x.callback;if(typeof _e=="function"){x.callback=null,S=x.priorityLevel;var O=_e(x.expirationTime<=F);if(F=e.unstable_now(),typeof O=="function"){x.callback=O,V(F),oe=!0;break t}x===a(g)&&r(g),V(F)}else r(g);x=a(g)}if(x!==null)oe=!0;else{var A=a(m);A!==null&&ue(ie,A.startTime-F),oe=!1}}break e}finally{x=null,S=be,w=!1}oe=void 0}}finally{oe?de():N=!1}}}var de;if(typeof $=="function")de=function(){$(te)};else if(typeof MessageChannel<"u"){var Ne=new MessageChannel,ye=Ne.port2;Ne.port1.onmessage=te,de=function(){ye.postMessage(null)}}else de=function(){R(te,0)};function ue(F,oe){Q=R(function(){F(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(F){switch(S){case 1:case 2:case 3:var oe=3;break;default:oe=S}var be=S;S=oe;try{return F()}finally{S=be}},e.unstable_requestPaint=function(){H=!0},e.unstable_runWithPriority=function(F,oe){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var be=S;S=F;try{return oe()}finally{S=be}},e.unstable_scheduleCallback=function(F,oe,be){var _e=e.unstable_now();switch(typeof be=="object"&&be!==null?(be=be.delay,be=typeof be=="number"&&0<be?_e+be:_e):be=_e,F){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=be+O,F={id:b++,callback:oe,priorityLevel:F,startTime:be,expirationTime:O,sortIndex:-1},be>_e?(F.sortIndex=be,i(m,F),a(g)===null&&F===a(m)&&(M?(q(Q),Q=-1):M=!0,ue(ie,be-_e))):(F.sortIndex=O,i(g,F),E||w||(E=!0,N||(N=!0,de()))),F},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(F){var oe=S;return function(){var be=S;S=oe;try{return F.apply(this,arguments)}finally{S=be}}}})(Jf)),Jf}var Ey;function Pk(){return Ey||(Ey=1,Zf.exports=Yk()),Zf.exports}var ep={exports:{}},dn={};/**
|
|
27
27
|
* @license React
|
|
28
28
|
* react-dom.production.js
|
|
29
29
|
*
|
|
@@ -31,7 +31,7 @@ var Bk=Object.defineProperty;var qk=(e,i,a)=>i in e?Bk(e,i,{enumerable:!0,config
|
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the MIT license found in the
|
|
33
33
|
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var Ay;function Wk(){if(Ay)return
|
|
34
|
+
*/var Ay;function Wk(){if(Ay)return dn;Ay=1;var e=sh();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=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,dn.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)},dn.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()}},dn.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))},dn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},dn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin),S=typeof m.integrity=="string"?m.integrity:void 0,w=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:S,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:S,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},dn.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(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)},dn.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=p(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})}},dn.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(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)},dn.requestFormReset=function(g){r.d.r(g)},dn.unstable_batchedUpdates=function(g,m){return g(m)},dn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},dn.useFormStatus=function(){return d.H.useHostTransitionStatus()},dn.version="19.2.7",dn}var Ny;function Kk(){if(Ny)return ep.exports;Ny=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),ep.exports=Wk(),ep.exports}/**
|
|
35
35
|
* @license React
|
|
36
36
|
* react-dom-client.production.js
|
|
37
37
|
*
|
|
@@ -39,28 +39,28 @@ var Bk=Object.defineProperty;var qk=(e,i,a)=>i in e?Bk(e,i,{enumerable:!0,config
|
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license found in the
|
|
41
41
|
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var Dy;function Xk(){if(Dy)return qo;Dy=1;var e=Pk(),i=sh(),a=Kk();function r(t){var n="https://react.dev/errors/"+t;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 #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var l=t,o=n;;){var f=l.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===l)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(l.return!==o.return)l=f,o=h;else{for(var v=!1,T=f.child;T;){if(T===l){v=!0,l=f,o=h;break}if(T===o){v=!0,o=f,l=h;break}T=T.sibling}if(!v){for(T=h.child;T;){if(T===l){v=!0,l=h,o=f;break}if(T===o){v=!0,o=h,l=f;break}T=T.sibling}if(!v)throw Error(r(189))}}if(l.alternate!==o)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),$=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function de(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Ne=Symbol.for("react.client.reference");function ye(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ne?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case R:return"Profiler";case H:return"StrictMode";case ie:return"Suspense";case N:return"SuspenseList";case ee:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case $:return t.displayName||"Context";case q:return(t._context.displayName||"Context")+".Consumer";case V:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q:return n=t.displayName||null,n!==null?n:ye(t.type)||"Memo";case re:n=t._payload,t=t._init;try{return ye(t(n))}catch{}}return null}var ue=Array.isArray,F=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
42
|
+
*/var Dy;function Xk(){if(Dy)return qo;Dy=1;var e=Pk(),i=sh(),a=Kk();function r(t){var n="https://react.dev/errors/"+t;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 #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var l=t,o=n;;){var f=l.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===l)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(l.return!==o.return)l=f,o=h;else{for(var v=!1,T=f.child;T;){if(T===l){v=!0,l=f,o=h;break}if(T===o){v=!0,o=f,l=h;break}T=T.sibling}if(!v){for(T=h.child;T;){if(T===l){v=!0,l=h,o=f;break}if(T===o){v=!0,o=h,l=f;break}T=T.sibling}if(!v)throw Error(r(189))}}if(l.alternate!==o)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),$=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function de(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Ne=Symbol.for("react.client.reference");function ye(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ne?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case R:return"Profiler";case H:return"StrictMode";case ie:return"Suspense";case N:return"SuspenseList";case ee:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case $:return t.displayName||"Context";case q:return(t._context.displayName||"Context")+".Consumer";case V:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q:return n=t.displayName||null,n!==null?n:ye(t.type)||"Memo";case re:n=t._payload,t=t._init;try{return ye(t(n))}catch{}}return null}var ue=Array.isArray,F=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},_e=[],O=-1;function A(t){return{current:t}}function z(t){0>O||(t.current=_e[O],_e[O]=null,O--)}function C(t,n){O++,_e[O]=t.current,t.current=n}var W=A(null),fe=A(null),X=A(null),xe=A(null);function Me(t,n){switch(C(X,n),C(fe,t),C(W,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Vg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Vg(n),t=Fg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(W),C(W,t)}function Ve(){z(W),z(fe),z(X)}function Ct(t){t.memoizedState!==null&&C(xe,t);var n=W.current,l=Fg(n,t.type);n!==l&&(C(fe,t),C(W,l))}function vt(t){fe.current===t&&(z(W),z(fe)),xe.current===t&&(z(xe),zo._currentValue=be)}var rn,Ye;function St(t){if(rn===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);rn=n&&n[1]||"",Ye=-1<l.stack.indexOf(`
|
|
43
43
|
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+rn+t+
|
|
44
|
+
`+rn+t+Ye}var It=!1;function sn(t,n){if(!t||It)return"";It=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(J){var K=J}Reflect.construct(t,[],se)}else{try{se.call()}catch(J){K=J}t.call(se.prototype)}}else{try{throw Error()}catch(J){K=J}(se=t())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(J){if(J&&K&&typeof J.stack=="string")return[J.stack,K.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),v=h[0],T=h[1];if(v&&T){var I=v.split(`
|
|
45
45
|
`),P=T.split(`
|
|
46
46
|
`);for(f=o=0;o<I.length&&!I[o].includes("DetermineComponentFrameRoot");)o++;for(;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;if(o===I.length||f===P.length)for(o=I.length-1,f=P.length-1;1<=o&&0<=f&&I[o]!==P[f];)f--;for(;1<=o&&0<=f;o--,f--)if(I[o]!==P[f]){if(o!==1||f!==1)do if(o--,f--,0>f||I[o]!==P[f]){var ne=`
|
|
47
|
-
`+I[o].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=o&&0<=f);break}}}finally{
|
|
47
|
+
`+I[o].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=o&&0<=f);break}}}finally{It=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?St(l):""}function Le(t,n){switch(t.tag){case 26:case 27:case 5:return St(t.type);case 16:return St("Lazy");case 13:return t.child!==n&&n!==null?St("Suspense Fallback"):St("Suspense");case 19:return St("SuspenseList");case 0:case 15:return sn(t.type,!1);case 11:return sn(t.type.render,!1);case 1:return sn(t.type,!0);case 31:return St("Activity");default:return""}}function Ut(t){try{var n="",l=null;do n+=Le(t,l),l=t,t=t.return;while(t);return n}catch(o){return`
|
|
48
48
|
Error generating stack: `+o.message+`
|
|
49
|
-
`+o.stack}}var hn=Object.prototype.hasOwnProperty,Xt=e.unstable_scheduleCallback,ji=e.unstable_cancelCallback,Jn=e.unstable_shouldYield,La=e.unstable_requestPaint,Mt=e.unstable_now,Ia=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Ue=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Ft=e.log,ei=e.unstable_setDisableYieldValue,Yt=null,Et=null;function dt(t){if(typeof Ft=="function"&&ei(t),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Yt,t)}catch{}}var ot=Math.clz32?Math.clz32:hd,Ci=Math.log,wn=Math.LN2;function hd(t){return t>>>=0,t===0?32:31-(Ci(t)/wn|0)|0}var Cr=256,Tr=262144,Dl=4194304;function Ti(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ua(t,n,l){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var T=o&134217727;return T!==0?(o=T&~h,o!==0?f=Ti(o):(v&=T,v!==0?f=Ti(v):l||(l=T&~t,l!==0&&(f=Ti(l))))):(T=o&~h,T!==0?f=Ti(T):v!==0?f=Ti(v):l||(l=o&~t,l!==0&&(f=Ti(l)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,l=n&-n,h>=l||h===32&&(l&4194048)!==0)?n:f}function Jt(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Ba(t,n){switch(t){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 wt(){var t=Dl;return Dl<<=1,(Dl&62914560)===0&&(Dl=4194304),t}function na(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function qa(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Rl(t,n,l,o,f,h){var v=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var T=t.entanglements,I=t.expirationTimes,P=t.hiddenUpdates;for(l=v&~l;0<l;){var ne=31-ot(l),se=1<<ne;T[ne]=0,I[ne]=-1;var K=P[ne];if(K!==null)for(P[ne]=null,ne=0;ne<K.length;ne++){var J=K[ne];J!==null&&(J.lane&=-536870913)}l&=~se}o!==0&&Rs(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function Rs(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-ot(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|l&261930}function Ha(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var o=31-ot(l),f=1<<o;f&n|t[o]&n&&(t[o]|=n),l&=~f}}function pu(t,n){var l=n&-n;return l=(l&42)!==0?1:Er(l),(l&(t.suspendedLanes|n))!==0?0:l}function Er(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function _s(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ms(){var t=oe.p;return t!==0?t:(t=window.event,t===void 0?32:hy(t.type))}function hu(t,n){var l=oe.p;try{return oe.p=t,n()}finally{oe.p=l}}var ti=Math.random().toString(36).slice(2),Pt="__reactFiber$"+ti,qt="__reactProps$"+ti,Un="__reactContainer$"+ti,Ei="__reactEvents$"+ti,$a="__reactListeners$"+ti,Ga="__reactHandles$"+ti,Ar="__reactResources$"+ti,Ai="__reactMarker$"+ti;function Os(t){delete t[Pt],delete t[qt],delete t[Ei],delete t[$a],delete t[Ga]}function ni(t){var n=t[Pt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[Un]||l[Pt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=Zg(t);t!==null;){if(l=t[Pt])return l;t=Zg(t)}return n}t=l,l=t.parentNode}return null}function Ni(t){if(t=t[Pt]||t[Un]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ia(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function Di(t){var n=t[Ar];return n||(n=t[Ar]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function At(t){t[Ai]=!0}var mu=new Set,zs={};function on(t,n){Ri(t,n),Ri(t+"Capture",n)}function Ri(t,n){for(zs[t]=n,t=0;t<n.length;t++)mu.add(n[t])}var gu=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]*$"),yu={},xu={};function Nr(t){return hn.call(xu,t)?!0:hn.call(yu,t)?!1:gu.test(t)?xu[t]=!0:(yu[t]=!0,!1)}function _l(t,n,l){if(Nr(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function aa(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+l)}}function pi(t,n,l,o){if(o===null)t.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,""+o)}}function mn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function hi(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function la(t,n,l){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,h=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Ls(t){if(!t._valueTracker){var n=hi(t)?"checked":"value";t._valueTracker=la(t,n,""+t[n])}}function mi(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return t&&(o=hi(t)?t.checked?"true":"false":t.value),t=o,t!==l?(n.setValue(t),!0):!1}function _i(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var bu=/[\n"\\]/g;function Nt(t){return t.replace(bu,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Bn(t,n,l,o,f,h,v,T){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+mn(n)):t.value!==""+mn(n)&&(t.value=""+mn(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?Dr(t,v,mn(n)):l!=null?Dr(t,v,mn(l)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+mn(T):t.removeAttribute("name")}function Mi(t,n,l,o,f,h,v,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Ls(t);return}l=l!=null?""+mn(l):"",n=n!=null?""+mn(n):l,T||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=T?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),Ls(t)}function Dr(t,n,l){n==="number"&&_i(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function ii(t,n,l,o){if(t=t.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=n.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&o&&(t[l].defaultSelected=!0)}else{for(l=""+mn(l),n=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function Is(t,n,l){if(n!=null&&(n=""+mn(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+mn(l):""}function Ml(t,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(r(92));if(ue(o)){if(1<o.length)throw Error(r(93));o=o[0]}l=o}l==null&&(l=""),n=l}l=mn(n),t.defaultValue=l,o=t.textContent,o===l&&o!==""&&o!==null&&(t.value=o),Ls(t)}function Va(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var Rr=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 Fa(t,n,l){var o=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,l):typeof l!="number"||l===0||Rr.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function _r(t,n,l){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,l!=null){for(var o in l)!l.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&l[f]!==o&&Fa(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&Fa(t,h,n[h])}function Ol(t){if(t.indexOf("-")===-1)return!1;switch(t){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 vu=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"]]),Mr=/^[\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 gn(t){return Mr.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Qt(){}var zl=null;function ra(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Oi=null,zi=null;function wu(t){var n=Ni(t);if(n&&(t=n.stateNode)){var l=t[qt]||null;e:switch(t=n.stateNode,n.type){case"input":if(Bn(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Nt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==t&&o.form===t.form){var f=o[qt]||null;if(!f)throw Error(r(90));Bn(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)o=l[n],o.form===t.form&&mi(o)}break e;case"textarea":Is(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&ii(t,!!l.multiple,n,!1)}}}var Ll=!1;function Us(t,n,l){if(Ll)return t(n,l);Ll=!0;try{var o=t(n);return o}finally{if(Ll=!1,(Oi!==null||zi!==null)&&(dc(),Oi&&(n=Oi,t=zi,zi=Oi=null,wu(n),t)))for(n=0;n<t.length;n++)wu(t[n])}}function Il(t,n){var l=t.stateNode;if(l===null)return null;var o=l[qt]||null;if(o===null)return null;l=o[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":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,n,typeof l));return l}var en=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bs=!1;if(en)try{var Ul={};Object.defineProperty(Ul,"passive",{get:function(){Bs=!0}}),window.addEventListener("test",Ul,Ul),window.removeEventListener("test",Ul,Ul)}catch{Bs=!1}var Li=null,Or=null,sa=null;function qs(){if(sa)return sa;var t,n=Or,l=n.length,o,f="value"in Li?Li.value:Li.textContent,h=f.length;for(t=0;t<l&&n[t]===f[t];t++);var v=l-t;for(o=1;o<=v&&n[l-o]===f[h-o];o++);return sa=f.slice(t,1<o?1-o:void 0)}function Ya(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function gi(){return!0}function Bl(){return!1}function tn(t){function n(l,o,f,h,v){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var T in t)t.hasOwnProperty(T)&&(l=t[T],this[T]=l?l(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?gi:Bl,this.isPropagationStopped=Bl,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=gi)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=gi)},persist:function(){},isPersistent:gi}),n}var qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pa=tn(qn),oa=x({},qn,{view:0,detail:0}),Hs=tn(oa),zr,ql,Wa,Ii=x({},oa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:De,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Wa&&(Wa&&t.type==="mousemove"?(zr=t.screenX-Wa.screenX,ql=t.screenY-Wa.screenY):ql=zr=0,Wa=t),zr)},movementY:function(t){return"movementY"in t?t.movementY:ql}}),Ka=tn(Ii),Lr=x({},Ii,{dataTransfer:0}),Ir=tn(Lr),Hl=x({},oa,{relatedTarget:0}),Ui=tn(Hl),Xa=x({},qn,{animationName:0,elapsedTime:0,pseudoElement:0}),Bi=tn(Xa),kn=x({},qn,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Sn=tn(kn),Qa=x({},qn,{data:0}),Za=tn(Qa),Ur={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Br={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"},$s={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gs(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=$s[t])?!!n[t]:!1}function De(){return Gs}var ku=x({},oa,{key:function(t){if(t.key){var n=Ur[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Ya(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Br[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:De,charCode:function(t){return t.type==="keypress"?Ya(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ya(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ai=tn(ku),Ot=x({},Ii,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qr=tn(Ot),$l=x({},oa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:De}),lt=tn($l),Ja=x({},qn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hr=tn(Ja),Gl=x({},Ii,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Vl=tn(Gl),Vs=x({},qn,{newState:0,oldState:0}),ua=tn(Vs),md=[9,13,27,32],Fs=en&&"CompositionEvent"in window,yi=null;en&&"documentMode"in document&&(yi=document.documentMode);var Su=en&&"TextEvent"in window&&!yi,$r=en&&(!Fs||yi&&8<yi&&11>=yi),Gr=" ",Fl=!1;function ju(t,n){switch(t){case"keyup":return md.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ys(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qi=!1;function Vr(t,n){switch(t){case"compositionend":return Ys(n);case"keypress":return n.which!==32?null:(Fl=!0,Gr);case"textInput":return t=n.data,t===Gr&&Fl?null:t;default:return null}}function gd(t,n){if(qi)return t==="compositionend"||!Fs&&ju(t,n)?(t=qs(),sa=Or=Li=null,qi=!1,t):null;switch(t){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 $r&&n.locale!=="ko"?null:n.data;default:return null}}var Yl={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 Cu(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Yl[t.type]:n==="textarea"}function Tu(t,n,l,o){Oi?zi?zi.push(o):zi=[o]:Oi=o,n=xc(n,"onChange"),0<n.length&&(l=new Pa("onChange","change",null,l,o),t.push({event:l,listeners:n}))}var Pl=null,ca=null;function da(t){Ug(t,0)}function Hi(t){var n=ia(t);if(mi(n))return t}function ke(t,n){if(t==="change")return n}var Wl=!1;if(en){var fa;if(en){var Fr="oninput"in document;if(!Fr){var Yr=document.createElement("div");Yr.setAttribute("oninput","return;"),Fr=typeof Yr.oninput=="function"}fa=Fr}else fa=!1;Wl=fa&&(!document.documentMode||9<document.documentMode)}function Pr(){Pl&&(Pl.detachEvent("onpropertychange",Eu),ca=Pl=null)}function Eu(t){if(t.propertyName==="value"&&Hi(ca)){var n=[];Tu(n,ca,t,ra(t)),Us(da,n)}}function nn(t,n,l){t==="focusin"?(Pr(),Pl=n,ca=l,Pl.attachEvent("onpropertychange",Eu)):t==="focusout"&&Pr()}function yd(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Hi(ca)}function xd(t,n){if(t==="click")return Hi(n)}function Wr(t,n){if(t==="input"||t==="change")return Hi(n)}function bd(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var un=typeof Object.is=="function"?Object.is:bd;function pa(t,n){if(un(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),o=Object.keys(n);if(l.length!==o.length)return!1;for(o=0;o<l.length;o++){var f=l[o];if(!hn.call(n,f)||!un(t[f],n[f]))return!1}return!0}function Au(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Nu(t,n){var l=Au(t);t=0;for(var o;l;){if(l.nodeType===3){if(o=t+l.textContent.length,t<=n&&o>=n)return{node:l,offset:n-t};t=o}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Au(l)}}function Kl(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Kl(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Kr(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=_i(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=_i(t.document)}return n}function Xl(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var vd=en&&"documentMode"in document&&11>=document.documentMode,$i=null,Ps=null,Ql=null,Zl=!1;function Ws(t,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Zl||$i==null||$i!==_i(o)||(o=$i,"selectionStart"in o&&Xl(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ql&&pa(Ql,o)||(Ql=o,o=xc(Ps,"onSelect"),0<o.length&&(n=new Pa("onSelect","select",null,n,l),t.push({event:n,listeners:o}),n.target=$i)))}function ha(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var el={animationend:ha("Animation","AnimationEnd"),animationiteration:ha("Animation","AnimationIteration"),animationstart:ha("Animation","AnimationStart"),transitionrun:ha("Transition","TransitionRun"),transitionstart:ha("Transition","TransitionStart"),transitioncancel:ha("Transition","TransitionCancel"),transitionend:ha("Transition","TransitionEnd")},Xr={},Du={};en&&(Du=document.createElement("div").style,"AnimationEvent"in window||(delete el.animationend.animation,delete el.animationiteration.animation,delete el.animationstart.animation),"TransitionEvent"in window||delete el.transitionend.transition);function ma(t){if(Xr[t])return Xr[t];if(!el[t])return t;var n=el[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Du)return Xr[t]=n[l];return t}var Ru=ma("animationend"),_u=ma("animationiteration"),Mu=ma("animationstart"),wd=ma("transitionrun"),kd=ma("transitionstart"),Sd=ma("transitioncancel"),Ou=ma("transitionend"),zu=new Map,Ks="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(" ");Ks.push("scrollEnd");function Hn(t,n){zu.set(t,n),on(n,[t])}var Qr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},jn=[],tl=0,Xs=0;function Zr(){for(var t=tl,n=Xs=tl=0;n<t;){var l=jn[n];jn[n++]=null;var o=jn[n];jn[n++]=null;var f=jn[n];jn[n++]=null;var h=jn[n];if(jn[n++]=null,o!==null&&f!==null){var v=o.pending;v===null?f.next=f:(f.next=v.next,v.next=f),o.pending=f}h!==0&&Cn(l,f,h)}}function Jr(t,n,l,o){jn[tl++]=t,jn[tl++]=n,jn[tl++]=l,jn[tl++]=o,Xs|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Qs(t,n,l,o){return Jr(t,n,l,o),Jl(t)}function Gi(t,n){return Jr(t,null,null,n),Jl(t)}function Cn(t,n,l){t.lanes|=l;var o=t.alternate;o!==null&&(o.lanes|=l);for(var f=!1,h=t.return;h!==null;)h.childLanes|=l,o=h.alternate,o!==null&&(o.childLanes|=l),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-ot(l),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=l|536870912),h):null}function Jl(t){if(50<Ao)throw Ao=0,bf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ga={};function er(t,n,l,o){this.tag=t,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zt(t,n,l,o){return new er(t,n,l,o)}function Zs(t){return t=t.prototype,!(!t||!t.isReactComponent)}function xi(t,n){var l=t.alternate;return l===null?(l=zt(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Lu(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function es(t,n,l,o,f,h){var v=0;if(o=t,typeof t=="function")Zs(t)&&(v=1);else if(typeof t=="string")v=Ek(t,l,W.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ee:return t=zt(31,l,n,f),t.elementType=ee,t.lanes=h,t;case M:return ya(l.children,f,h,n);case H:v=8,f|=24;break;case R:return t=zt(12,l,n,f|2),t.elementType=R,t.lanes=h,t;case ie:return t=zt(13,l,n,f),t.elementType=ie,t.lanes=h,t;case N:return t=zt(19,l,n,f),t.elementType=N,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:v=10;break e;case q:v=9;break e;case V:v=11;break e;case Q:v=14;break e;case re:v=16,o=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=zt(v,l,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function ya(t,n,l,o){return t=zt(7,t,o,n),t.lanes=l,t}function Js(t,n,l){return t=zt(6,t,null,n),t.lanes=l,t}function eo(t){var n=zt(18,null,null,0);return n.stateNode=t,n}function ts(t,n,l){return n=zt(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Iu=new WeakMap;function Tn(t,n){if(typeof t=="object"&&t!==null){var l=Iu.get(t);return l!==void 0?l:(n={value:t,source:n,stack:Bt(n)},Iu.set(t,n),n)}return{value:t,source:n,stack:Bt(n)}}var nl=[],$n=0,xa=null,tr=0,En=[],yn=0,Vi=null,Gn=1,li="";function bi(t,n){nl[$n++]=tr,nl[$n++]=xa,xa=t,tr=n}function Uu(t,n,l){En[yn++]=Gn,En[yn++]=li,En[yn++]=Vi,Vi=t;var o=Gn;t=li;var f=32-ot(o)-1;o&=~(1<<f),l+=1;var h=32-ot(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,Gn=1<<32-ot(n)+f|l<<f|o,li=h+t}else Gn=1<<h|l<<f|o,li=t}function to(t){t.return!==null&&(bi(t,1),Uu(t,1,0))}function no(t){for(;t===xa;)xa=nl[--$n],nl[$n]=null,tr=nl[--$n],nl[$n]=null;for(;t===Vi;)Vi=En[--yn],En[yn]=null,li=En[--yn],En[yn]=null,Gn=En[--yn],En[yn]=null}function Bu(t,n){En[yn++]=Gn,En[yn++]=li,En[yn++]=Vi,Gn=n.id,li=n.overflow,Vi=t}var Wt=null,mt=null,Ye=!1,Fi=null,An=!1,io=Error(r(519));function Yi(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wi(Tn(n,t)),io}function nr(t){var n=t.stateNode,l=t.type,o=t.memoizedProps;switch(n[Pt]=t,n[qt]=o,l){case"dialog":We("cancel",n),We("close",n);break;case"iframe":case"object":case"embed":We("load",n);break;case"video":case"audio":for(l=0;l<Do.length;l++)We(Do[l],n);break;case"source":We("error",n);break;case"img":case"image":case"link":We("error",n),We("load",n);break;case"details":We("toggle",n);break;case"input":We("invalid",n),Mi(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":We("invalid",n);break;case"textarea":We("invalid",n),Ml(n,o.value,o.defaultValue,o.children)}l=o.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||o.suppressHydrationWarning===!0||$g(n.textContent,l)?(o.popover!=null&&(We("beforetoggle",n),We("toggle",n)),o.onScroll!=null&&We("scroll",n),o.onScrollEnd!=null&&We("scrollend",n),o.onClick!=null&&(n.onclick=Qt),n=!0):n=!1,n||Yi(t,!0)}function qu(t){for(Wt=t.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:An=!1;return;case 27:case 3:An=!0;return;default:Wt=Wt.return}}function Pi(t){if(t!==Wt)return!1;if(!Ye)return qu(t),Ye=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Of(t.type,t.memoizedProps)),l=!l),l&&mt&&Yi(t),qu(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));mt=Qg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));mt=Qg(t)}else n===27?(n=mt,xl(t.type)?(t=Bf,Bf=null,mt=t):mt=n):mt=Wt?ui(t.stateNode.nextSibling):null;return!0}function ba(){mt=Wt=null,Ye=!1}function ao(){var t=Fi;return t!==null&&(Mn===null?Mn=t:Mn.push.apply(Mn,t),Fi=null),t}function Wi(t){Fi===null?Fi=[t]:Fi.push(t)}var lo=A(null),Nn=null,Vn=null;function vi(t,n,l){C(lo,n._currentValue),n._currentValue=l}function ri(t){t._currentValue=lo.current,z(lo)}function ns(t,n,l){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===l)break;t=t.return}}function va(t,n,l,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=f;for(var I=0;I<n.length;I++)if(T.context===n[I]){h.lanes|=l,T=h.alternate,T!==null&&(T.lanes|=l),ns(h.return,l,t),o||(v=null);break e}h=T.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=l,h=v.alternate,h!==null&&(h.lanes|=l),ns(v,l,t),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===t){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function il(t,n,l,o){t=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!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 T=f.type;un(f.pendingProps.value,v.value)||(t!==null?t.push(T):t=[T])}}else if(f===xe.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(zo):t=[zo])}f=f.return}t!==null&&va(n,t,l,o),n.flags|=262144}function is(t){for(t=t.firstContext;t!==null;){if(!un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function wa(t){Nn=t,Vn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Dt(t){return ro(Nn,t)}function as(t,n){return Nn===null&&wa(t),ro(t,n)}function ro(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Vn===null){if(t===null)throw Error(r(308));Vn=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Vn=Vn.next=n;return l}var jd=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},ir=e.unstable_scheduleCallback,ar=e.unstable_NormalPriority,bt={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function so(){return{controller:new jd,data:new Map,refCount:0}}function lr(t){t.refCount--,t.refCount===0&&ir(ar,function(){t.controller.abort()})}var rr=null,rt=0,xn=0,al=null;function Fn(t,n){if(rr===null){var l=rr=[];rt=0,xn=Cf(),al={status:"pending",value:void 0,then:function(o){l.push(o)}}}return rt++,n.then(Hu,Hu),n}function Hu(){if(--rt===0&&rr!==null){al!==null&&(al.status="fulfilled");var t=rr;rr=null,xn=0,al=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Ki(t,n){var l=[],o={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),o}var $u=F.S;F.S=function(t,n){fg=Mt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Fn(t,n),$u!==null&&$u(t,n)};var ka=A(null);function oo(){var t=ka.current;return t!==null?t:gt.pooledCache}function ll(t,n){n===null?C(ka,ka.current):C(ka,n.pool)}function Gu(){var t=oo();return t===null?null:{parent:bt._currentValue,pool:t}}var rl=Error(r(460)),uo=Error(r(474)),sr=Error(r(542)),or={then:function(){}};function co(t){return t=t.status,t==="fulfilled"||t==="rejected"}function fo(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(Qt,Qt),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,_(t),t;default:if(typeof n.status=="string")n.then(Qt,Qt);else{if(t=gt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,_(t),t}throw k=n,rl}}function y(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(k=l,rl):l}}var k=null;function j(){if(k===null)throw Error(r(459));var t=k;return k=null,t}function _(t){if(t===rl||t===sr)throw Error(r(483))}var U=null,Z=0;function pe(t){var n=Z;return Z+=1,U===null&&(U=[]),fo(U,t,n)}function Se(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function be(t,n){throw n.$$typeof===S?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function we(t){function n(G,B){if(t){var Y=G.deletions;Y===null?(G.deletions=[B],G.flags|=16):Y.push(B)}}function l(G,B){if(!t)return null;for(;B!==null;)n(G,B),B=B.sibling;return null}function o(G){for(var B=new Map;G!==null;)G.key!==null?B.set(G.key,G):B.set(G.index,G),G=G.sibling;return B}function f(G,B){return G=xi(G,B),G.index=0,G.sibling=null,G}function h(G,B,Y){return G.index=Y,t?(Y=G.alternate,Y!==null?(Y=Y.index,Y<B?(G.flags|=67108866,B):Y):(G.flags|=67108866,B)):(G.flags|=1048576,B)}function v(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function T(G,B,Y,le){return B===null||B.tag!==6?(B=Js(Y,G.mode,le),B.return=G,B):(B=f(B,Y),B.return=G,B)}function I(G,B,Y,le){var Re=Y.type;return Re===M?ne(G,B,Y.props.children,le,Y.key):B!==null&&(B.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===re&&y(Re)===B.type)?(B=f(B,Y.props),Se(B,Y),B.return=G,B):(B=es(Y.type,Y.key,Y.props,null,G.mode,le),Se(B,Y),B.return=G,B)}function P(G,B,Y,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==Y.containerInfo||B.stateNode.implementation!==Y.implementation?(B=ts(Y,G.mode,le),B.return=G,B):(B=f(B,Y.children||[]),B.return=G,B)}function ne(G,B,Y,le,Re){return B===null||B.tag!==7?(B=ya(Y,G.mode,le,Re),B.return=G,B):(B=f(B,Y),B.return=G,B)}function se(G,B,Y){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Js(""+B,G.mode,Y),B.return=G,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return Y=es(B.type,B.key,B.props,null,G.mode,Y),Se(Y,B),Y.return=G,Y;case E:return B=ts(B,G.mode,Y),B.return=G,B;case re:return B=y(B),se(G,B,Y)}if(ue(B)||de(B))return B=ya(B,G.mode,Y,null),B.return=G,B;if(typeof B.then=="function")return se(G,pe(B),Y);if(B.$$typeof===$)return se(G,as(G,B),Y);be(G,B)}return null}function K(G,B,Y,le){var Re=B!==null?B.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Re!==null?null:T(G,B,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===Re?I(G,B,Y,le):null;case E:return Y.key===Re?P(G,B,Y,le):null;case re:return Y=y(Y),K(G,B,Y,le)}if(ue(Y)||de(Y))return Re!==null?null:ne(G,B,Y,le,null);if(typeof Y.then=="function")return K(G,B,pe(Y),le);if(Y.$$typeof===$)return K(G,B,as(G,Y),le);be(G,Y)}return null}function J(G,B,Y,le,Re){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return G=G.get(Y)||null,T(B,G,""+le,Re);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return G=G.get(le.key===null?Y:le.key)||null,I(B,G,le,Re);case E:return G=G.get(le.key===null?Y:le.key)||null,P(B,G,le,Re);case re:return le=y(le),J(G,B,Y,le,Re)}if(ue(le)||de(le))return G=G.get(Y)||null,ne(B,G,le,Re,null);if(typeof le.then=="function")return J(G,B,Y,pe(le),Re);if(le.$$typeof===$)return J(G,B,Y,as(B,le),Re);be(B,le)}return null}function je(G,B,Y,le){for(var Re=null,it=null,Ae=B,$e=B=0,Ze=null;Ae!==null&&$e<Y.length;$e++){Ae.index>$e?(Ze=Ae,Ae=null):Ze=Ae.sibling;var at=K(G,Ae,Y[$e],le);if(at===null){Ae===null&&(Ae=Ze);break}t&&Ae&&at.alternate===null&&n(G,Ae),B=h(at,B,$e),it===null?Re=at:it.sibling=at,it=at,Ae=Ze}if($e===Y.length)return l(G,Ae),Ye&&bi(G,$e),Re;if(Ae===null){for(;$e<Y.length;$e++)Ae=se(G,Y[$e],le),Ae!==null&&(B=h(Ae,B,$e),it===null?Re=Ae:it.sibling=Ae,it=Ae);return Ye&&bi(G,$e),Re}for(Ae=o(Ae);$e<Y.length;$e++)Ze=J(Ae,G,$e,Y[$e],le),Ze!==null&&(t&&Ze.alternate!==null&&Ae.delete(Ze.key===null?$e:Ze.key),B=h(Ze,B,$e),it===null?Re=Ze:it.sibling=Ze,it=Ze);return t&&Ae.forEach(function(Sl){return n(G,Sl)}),Ye&&bi(G,$e),Re}function ze(G,B,Y,le){if(Y==null)throw Error(r(151));for(var Re=null,it=null,Ae=B,$e=B=0,Ze=null,at=Y.next();Ae!==null&&!at.done;$e++,at=Y.next()){Ae.index>$e?(Ze=Ae,Ae=null):Ze=Ae.sibling;var Sl=K(G,Ae,at.value,le);if(Sl===null){Ae===null&&(Ae=Ze);break}t&&Ae&&Sl.alternate===null&&n(G,Ae),B=h(Sl,B,$e),it===null?Re=Sl:it.sibling=Sl,it=Sl,Ae=Ze}if(at.done)return l(G,Ae),Ye&&bi(G,$e),Re;if(Ae===null){for(;!at.done;$e++,at=Y.next())at=se(G,at.value,le),at!==null&&(B=h(at,B,$e),it===null?Re=at:it.sibling=at,it=at);return Ye&&bi(G,$e),Re}for(Ae=o(Ae);!at.done;$e++,at=Y.next())at=J(Ae,G,$e,at.value,le),at!==null&&(t&&at.alternate!==null&&Ae.delete(at.key===null?$e:at.key),B=h(at,B,$e),it===null?Re=at:it.sibling=at,it=at);return t&&Ae.forEach(function(Uk){return n(G,Uk)}),Ye&&bi(G,$e),Re}function ht(G,B,Y,le){if(typeof Y=="object"&&Y!==null&&Y.type===M&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var Re=Y.key;B!==null;){if(B.key===Re){if(Re=Y.type,Re===M){if(B.tag===7){l(G,B.sibling),le=f(B,Y.props.children),le.return=G,G=le;break e}}else if(B.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===re&&y(Re)===B.type){l(G,B.sibling),le=f(B,Y.props),Se(le,Y),le.return=G,G=le;break e}l(G,B);break}else n(G,B);B=B.sibling}Y.type===M?(le=ya(Y.props.children,G.mode,le,Y.key),le.return=G,G=le):(le=es(Y.type,Y.key,Y.props,null,G.mode,le),Se(le,Y),le.return=G,G=le)}return v(G);case E:e:{for(Re=Y.key;B!==null;){if(B.key===Re)if(B.tag===4&&B.stateNode.containerInfo===Y.containerInfo&&B.stateNode.implementation===Y.implementation){l(G,B.sibling),le=f(B,Y.children||[]),le.return=G,G=le;break e}else{l(G,B);break}else n(G,B);B=B.sibling}le=ts(Y,G.mode,le),le.return=G,G=le}return v(G);case re:return Y=y(Y),ht(G,B,Y,le)}if(ue(Y))return je(G,B,Y,le);if(de(Y)){if(Re=de(Y),typeof Re!="function")throw Error(r(150));return Y=Re.call(Y),ze(G,B,Y,le)}if(typeof Y.then=="function")return ht(G,B,pe(Y),le);if(Y.$$typeof===$)return ht(G,B,as(G,Y),le);be(G,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,B!==null&&B.tag===6?(l(G,B.sibling),le=f(B,Y),le.return=G,G=le):(l(G,B),le=Js(Y,G.mode,le),le.return=G,G=le),v(G)):l(G,B)}return function(G,B,Y,le){try{Z=0;var Re=ht(G,B,Y,le);return U=null,Re}catch(Ae){if(Ae===rl||Ae===sr)throw Ae;var it=zt(29,Ae,null,G.mode);return it.lanes=le,it.return=G,it}finally{}}}var nt=we(!0),tt=we(!1),si=!1;function ls(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function sl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ol(t,n,l){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(st&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=Jl(t),Cn(t,null,l),n}return Jr(t,o,n,l),Jl(t)}function po(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,Ha(t,l)}}function Td(t,n){var l=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,l=l.next}while(l!==null);h===null?f=h=n:h=h.next=n}else f=h=n;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var Ed=!1;function ho(){if(Ed){var t=al;if(t!==null)throw t}}function mo(t,n,l,o){Ed=!1;var f=t.updateQueue;si=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var I=T,P=I.next;I.next=null,v===null?h=P:v.next=P,v=I;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,T=ne.lastBaseUpdate,T!==v&&(T===null?ne.firstBaseUpdate=P:T.next=P,ne.lastBaseUpdate=I))}if(h!==null){var se=f.baseState;v=0,ne=P=I=null,T=h;do{var K=T.lane&-536870913,J=K!==T.lane;if(J?(Qe&K)===K:(o&K)===K){K!==0&&K===xn&&(Ed=!0),ne!==null&&(ne=ne.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var je=t,ze=T;K=n;var ht=l;switch(ze.tag){case 1:if(je=ze.payload,typeof je=="function"){se=je.call(ht,se,K);break e}se=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=ze.payload,K=typeof je=="function"?je.call(ht,se,K):je,K==null)break e;se=x({},se,K);break e;case 2:si=!0}}K=T.callback,K!==null&&(t.flags|=64,J&&(t.flags|=8192),J=f.callbacks,J===null?f.callbacks=[K]:J.push(K))}else J={lane:K,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ne===null?(P=ne=J,I=se):ne=ne.next=J,v|=K;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;J=T,T=J.next,J.next=null,f.lastBaseUpdate=J,f.shared.pending=null}}while(!0);ne===null&&(I=se),f.baseState=I,f.firstBaseUpdate=P,f.lastBaseUpdate=ne,h===null&&(f.shared.lanes=0),pl|=v,t.lanes=v,t.memoizedState=se}}function Ih(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Uh(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Ih(l[t],n)}var rs=A(null),Vu=A(0);function Bh(t,n){t=Ra,C(Vu,t),C(rs,n),Ra=t|n.baseLanes}function Ad(){C(Vu,Ra),C(rs,rs.current)}function Nd(){Ra=Vu.current,z(rs),z(Vu)}var Yn=A(null),oi=null;function ul(t){var n=t.alternate;C(Lt,Lt.current&1),C(Yn,t),oi===null&&(n===null||rs.current!==null||n.memoizedState!==null)&&(oi=t)}function Dd(t){C(Lt,Lt.current),C(Yn,t),oi===null&&(oi=t)}function qh(t){t.tag===22?(C(Lt,Lt.current),C(Yn,t),oi===null&&(oi=t)):cl()}function cl(){C(Lt,Lt.current),C(Yn,Yn.current)}function Pn(t){z(Yn),oi===t&&(oi=null),z(Lt)}var Lt=A(0);function Fu(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||If(l)||Uf(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===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Sa=0,qe=null,ft=null,Ht=null,Yu=!1,ss=!1,ur=!1,Pu=0,go=0,os=null,Aw=0;function Rt(){throw Error(r(321))}function Rd(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!un(t[l],n[l]))return!1;return!0}function _d(t,n,l,o,f,h){return Sa=h,qe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,F.H=t===null||t.memoizedState===null?Sm:Pd,ur=!1,h=l(o,f),ur=!1,ss&&(h=$h(n,l,o,f)),Hh(t),h}function Hh(t){F.H=bo;var n=ft!==null&&ft.next!==null;if(Sa=0,Ht=ft=qe=null,Yu=!1,go=0,os=null,n)throw Error(r(300));t===null||$t||(t=t.dependencies,t!==null&&is(t)&&($t=!0))}function $h(t,n,l,o){qe=t;var f=0;do{if(ss&&(os=null),go=0,ss=!1,25<=f)throw Error(r(301));if(f+=1,Ht=ft=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}F.H=jm,h=n(l,o)}while(ss);return h}function Nw(){var t=F.H,n=t.useState()[0];return n=typeof n.then=="function"?yo(n):n,t=t.useState()[0],(ft!==null?ft.memoizedState:null)!==t&&(qe.flags|=1024),n}function Md(){var t=Pu!==0;return Pu=0,t}function Od(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function zd(t){if(Yu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Yu=!1}Sa=0,Ht=ft=qe=null,ss=!1,go=Pu=0,os=null}function bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?qe.memoizedState=Ht=t:Ht=Ht.next=t,Ht}function It(){if(ft===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=ft.next;var n=Ht===null?qe.memoizedState:Ht.next;if(n!==null)Ht=n,ft=t;else{if(t===null)throw qe.alternate===null?Error(r(467)):Error(r(310));ft=t,t={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Ht===null?qe.memoizedState=Ht=t:Ht=Ht.next=t}return Ht}function Wu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yo(t){var n=go;return go+=1,os===null&&(os=[]),t=fo(os,t,n),n=qe,(Ht===null?n.memoizedState:Ht.next)===null&&(n=n.alternate,F.H=n===null||n.memoizedState===null?Sm:Pd),t}function Ku(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return yo(t);if(t.$$typeof===$)return Dt(t)}throw Error(r(438,String(t)))}function Ld(t){var n=null,l=qe.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=qe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=Wu(),qe.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),o=0;o<t;o++)l[o]=L;return n.index++,l}function ja(t,n){return typeof n=="function"?n(t):n}function Xu(t){var n=It();return Id(n,ft,t)}function Id(t,n,l){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=l;var f=t.baseQueue,h=o.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}n.baseQueue=f=h,o.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{n=f.next;var T=v=null,I=null,P=n,ne=!1;do{var se=P.lane&-536870913;if(se!==P.lane?(Qe&se)===se:(Sa&se)===se){var K=P.revertLane;if(K===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),se===xn&&(ne=!0);else if((Sa&K)===K){P=P.next,K===xn&&(ne=!0);continue}else se={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(T=I=se,v=h):I=I.next=se,qe.lanes|=K,pl|=K;se=P.action,ur&&l(h,se),h=P.hasEagerState?P.eagerState:l(h,se)}else K={lane:se,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(T=I=K,v=h):I=I.next=K,qe.lanes|=se,pl|=se;P=P.next}while(P!==null&&P!==n);if(I===null?v=h:I.next=T,!un(h,t.memoizedState)&&($t=!0,ne&&(l=al,l!==null)))throw l;t.memoizedState=h,t.baseState=v,t.baseQueue=I,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Ud(t){var n=It(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var o=l.dispatch,f=l.pending,h=n.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);un(h,n.memoizedState)||($t=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),l.lastRenderedState=h}return[h,o]}function Gh(t,n,l){var o=qe,f=It(),h=Ye;if(h){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!un((ft||f).memoizedState,l);if(v&&(f.memoizedState=l,$t=!0),f=f.queue,Hd(Yh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||Ht!==null&&Ht.memoizedState.tag&1){if(o.flags|=2048,us(9,{destroy:void 0},Fh.bind(null,o,f,l,n),null),gt===null)throw Error(r(349));h||(Sa&127)!==0||Vh(o,n,l)}return l}function Vh(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=qe.updateQueue,n===null?(n=Wu(),qe.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Fh(t,n,l,o){n.value=l,n.getSnapshot=o,Ph(n)&&Wh(t)}function Yh(t,n,l){return l(function(){Ph(n)&&Wh(t)})}function Ph(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!un(t,l)}catch{return!0}}function Wh(t){var n=Gi(t,2);n!==null&&On(n,t,2)}function Bd(t){var n=bn();if(typeof t=="function"){var l=t;if(t=l(),ur){dt(!0);try{l()}finally{dt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:t},n}function Kh(t,n,l,o){return t.baseState=l,Id(t,ft,typeof o=="function"?o:ja)}function Dw(t,n,l,o,f){if(Ju(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};F.T!==null?l(!0):h.isTransition=!1,o(h),l=n.pending,l===null?(h.next=n.pending=h,Xh(n,h)):(h.next=l.next,n.pending=l.next=h)}}function Xh(t,n){var l=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=F.T,v={};F.T=v;try{var T=l(f,o),I=F.S;I!==null&&I(v,T),Qh(t,n,T)}catch(P){qd(t,n,P)}finally{h!==null&&v.types!==null&&(h.types=v.types),F.T=h}}else try{h=l(f,o),Qh(t,n,h)}catch(P){qd(t,n,P)}}function Qh(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){Zh(t,n,o)},function(o){return qd(t,n,o)}):Zh(t,n,l)}function Zh(t,n,l){n.status="fulfilled",n.value=l,Jh(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Xh(t,l)))}function qd(t,n,l){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,Jh(n),n=n.next;while(n!==o)}t.action=null}function Jh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function em(t,n){return n}function tm(t,n){if(Ye){var l=gt.formState;if(l!==null){e:{var o=qe;if(Ye){if(mt){t:{for(var f=mt,h=An;f.nodeType!==8;){if(!h){f=null;break t}if(f=ui(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){mt=ui(f.nextSibling),o=f.data==="F!";break e}}Yi(o)}o=!1}o&&(n=l[0])}}return l=bn(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:em,lastRenderedState:n},l.queue=o,l=vm.bind(null,qe,o),o.dispatch=l,o=Bd(!1),h=Yd.bind(null,qe,!1,o.queue),o=bn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,l=Dw.bind(null,qe,f,h,l),f.dispatch=l,o.memoizedState=t,[n,l,!1]}function nm(t){var n=It();return im(n,ft,t)}function im(t,n,l){if(n=Id(t,n,em)[0],t=Xu(ja)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=yo(n)}catch(v){throw v===rl?sr:v}else o=n;n=It();var f=n.queue,h=f.dispatch;return l!==n.memoizedState&&(qe.flags|=2048,us(9,{destroy:void 0},Rw.bind(null,f,l),null)),[o,h,t]}function Rw(t,n){t.action=n}function am(t){var n=It(),l=ft;if(l!==null)return im(n,l,t);It(),n=n.memoizedState,l=It();var o=l.queue.dispatch;return l.memoizedState=t,[n,o,!1]}function us(t,n,l,o){return t={tag:t,create:l,deps:o,inst:n,next:null},n=qe.updateQueue,n===null&&(n=Wu(),qe.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(o=l.next,l.next=t,t.next=o,n.lastEffect=t),t}function lm(){return It().memoizedState}function Qu(t,n,l,o){var f=bn();qe.flags|=t,f.memoizedState=us(1|n,{destroy:void 0},l,o===void 0?null:o)}function Zu(t,n,l,o){var f=It();o=o===void 0?null:o;var h=f.memoizedState.inst;ft!==null&&o!==null&&Rd(o,ft.memoizedState.deps)?f.memoizedState=us(n,h,l,o):(qe.flags|=t,f.memoizedState=us(1|n,h,l,o))}function rm(t,n){Qu(8390656,8,t,n)}function Hd(t,n){Zu(2048,8,t,n)}function _w(t){qe.flags|=4;var n=qe.updateQueue;if(n===null)n=Wu(),qe.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function sm(t){var n=It().memoizedState;return _w({ref:n,nextImpl:t}),function(){if((st&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function om(t,n){return Zu(4,2,t,n)}function um(t,n){return Zu(4,4,t,n)}function cm(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function dm(t,n,l){l=l!=null?l.concat([t]):null,Zu(4,4,cm.bind(null,n,t),l)}function $d(){}function fm(t,n){var l=It();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&Rd(n,o[1])?o[0]:(l.memoizedState=[t,n],t)}function pm(t,n){var l=It();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&Rd(n,o[1]))return o[0];if(o=t(),ur){dt(!0);try{t()}finally{dt(!1)}}return l.memoizedState=[o,n],o}function Gd(t,n,l){return l===void 0||(Sa&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=hg(),qe.lanes|=t,pl|=t,l)}function hm(t,n,l,o){return un(l,n)?l:rs.current!==null?(t=Gd(t,l,o),un(t,n)||($t=!0),t):(Sa&42)===0||(Sa&1073741824)!==0&&(Qe&261930)===0?($t=!0,t.memoizedState=l):(t=hg(),qe.lanes|=t,pl|=t,n)}function mm(t,n,l,o,f){var h=oe.p;oe.p=h!==0&&8>h?h:8;var v=F.T,T={};F.T=T,Yd(t,!1,n,l);try{var I=f(),P=F.S;if(P!==null&&P(T,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=Ki(I,o);xo(t,n,ne,Xn(t))}else xo(t,n,o,Xn(t))}catch(se){xo(t,n,{then:function(){},status:"rejected",reason:se},Xn())}finally{oe.p=h,v!==null&&T.types!==null&&(v.types=T.types),F.T=v}}function Mw(){}function Vd(t,n,l,o){if(t.tag!==5)throw Error(r(476));var f=gm(t).queue;mm(t,f,n,ve,l===null?Mw:function(){return ym(t),l(o)})}function gm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:ve},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ym(t){var n=gm(t);n.next===null&&(n=t.alternate.memoizedState),xo(t,n.next.queue,{},Xn())}function Fd(){return Dt(zo)}function xm(){return It().memoizedState}function bm(){return It().memoizedState}function Ow(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Xn();t=sl(l);var o=ol(n,t,l);o!==null&&(On(o,n,l),po(o,n,l)),n={cache:so()},t.payload=n;return}n=n.return}}function zw(t,n,l){var o=Xn();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ju(t)?wm(n,l):(l=Qs(t,n,l,o),l!==null&&(On(l,t,o),km(l,n,o)))}function vm(t,n,l){var o=Xn();xo(t,n,l,o)}function xo(t,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ju(t))wm(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,T=h(v,l);if(f.hasEagerState=!0,f.eagerState=T,un(T,v))return Jr(t,n,f,0),gt===null&&Zr(),!1}catch{}finally{}if(l=Qs(t,n,f,o),l!==null)return On(l,t,o),km(l,n,o),!0}return!1}function Yd(t,n,l,o){if(o={lane:2,revertLane:Cf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ju(t)){if(n)throw Error(r(479))}else n=Qs(t,l,o,2),n!==null&&On(n,t,2)}function Ju(t){var n=t.alternate;return t===qe||n!==null&&n===qe}function wm(t,n){ss=Yu=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function km(t,n,l){if((l&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,Ha(t,l)}}var bo={readContext:Dt,use:Ku,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};bo.useEffectEvent=Rt;var Sm={readContext:Dt,use:Ku,useCallback:function(t,n){return bn().memoizedState=[t,n===void 0?null:n],t},useContext:Dt,useEffect:rm,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,Qu(4194308,4,cm.bind(null,n,t),l)},useLayoutEffect:function(t,n){return Qu(4194308,4,t,n)},useInsertionEffect:function(t,n){Qu(4,2,t,n)},useMemo:function(t,n){var l=bn();n=n===void 0?null:n;var o=t();if(ur){dt(!0);try{t()}finally{dt(!1)}}return l.memoizedState=[o,n],o},useReducer:function(t,n,l){var o=bn();if(l!==void 0){var f=l(n);if(ur){dt(!0);try{l(n)}finally{dt(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=zw.bind(null,qe,t),[o.memoizedState,t]},useRef:function(t){var n=bn();return t={current:t},n.memoizedState=t},useState:function(t){t=Bd(t);var n=t.queue,l=vm.bind(null,qe,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:$d,useDeferredValue:function(t,n){var l=bn();return Gd(l,t,n)},useTransition:function(){var t=Bd(!1);return t=mm.bind(null,qe,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var o=qe,f=bn();if(Ye){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),gt===null)throw Error(r(349));(Qe&127)!==0||Vh(o,n,l)}f.memoizedState=l;var h={value:l,getSnapshot:n};return f.queue=h,rm(Yh.bind(null,o,h,t),[t]),o.flags|=2048,us(9,{destroy:void 0},Fh.bind(null,o,h,l,n),null),l},useId:function(){var t=bn(),n=gt.identifierPrefix;if(Ye){var l=li,o=Gn;l=(o&~(1<<32-ot(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=Pu++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=Aw++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Fd,useFormState:tm,useActionState:tm,useOptimistic:function(t){var n=bn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Yd.bind(null,qe,!0,l),l.dispatch=n,[t,n]},useMemoCache:Ld,useCacheRefresh:function(){return bn().memoizedState=Ow.bind(null,qe)},useEffectEvent:function(t){var n=bn(),l={impl:t};return n.memoizedState=l,function(){if((st&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Pd={readContext:Dt,use:Ku,useCallback:fm,useContext:Dt,useEffect:Hd,useImperativeHandle:dm,useInsertionEffect:om,useLayoutEffect:um,useMemo:pm,useReducer:Xu,useRef:lm,useState:function(){return Xu(ja)},useDebugValue:$d,useDeferredValue:function(t,n){var l=It();return hm(l,ft.memoizedState,t,n)},useTransition:function(){var t=Xu(ja)[0],n=It().memoizedState;return[typeof t=="boolean"?t:yo(t),n]},useSyncExternalStore:Gh,useId:xm,useHostTransitionStatus:Fd,useFormState:nm,useActionState:nm,useOptimistic:function(t,n){var l=It();return Kh(l,ft,t,n)},useMemoCache:Ld,useCacheRefresh:bm};Pd.useEffectEvent=sm;var jm={readContext:Dt,use:Ku,useCallback:fm,useContext:Dt,useEffect:Hd,useImperativeHandle:dm,useInsertionEffect:om,useLayoutEffect:um,useMemo:pm,useReducer:Ud,useRef:lm,useState:function(){return Ud(ja)},useDebugValue:$d,useDeferredValue:function(t,n){var l=It();return ft===null?Gd(l,t,n):hm(l,ft.memoizedState,t,n)},useTransition:function(){var t=Ud(ja)[0],n=It().memoizedState;return[typeof t=="boolean"?t:yo(t),n]},useSyncExternalStore:Gh,useId:xm,useHostTransitionStatus:Fd,useFormState:am,useActionState:am,useOptimistic:function(t,n){var l=It();return ft!==null?Kh(l,ft,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Ld,useCacheRefresh:bm};jm.useEffectEvent=sm;function Wd(t,n,l,o){n=t.memoizedState,l=l(o,n),l=l==null?n:x({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Kd={enqueueSetState:function(t,n,l){t=t._reactInternals;var o=Xn(),f=sl(o);f.payload=n,l!=null&&(f.callback=l),n=ol(t,f,o),n!==null&&(On(n,t,o),po(n,t,o))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var o=Xn(),f=sl(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=ol(t,f,o),n!==null&&(On(n,t,o),po(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Xn(),o=sl(l);o.tag=2,n!=null&&(o.callback=n),n=ol(t,o,l),n!==null&&(On(n,t,l),po(n,t,l))}};function Cm(t,n,l,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!pa(l,o)||!pa(f,h):!0}function Tm(t,n,l,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,o),n.state!==t&&Kd.enqueueReplaceState(n,n.state,null)}function cr(t,n){var l=n;if("ref"in n){l={};for(var o in n)o!=="ref"&&(l[o]=n[o])}if(t=t.defaultProps){l===n&&(l=x({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Em(t){Qr(t)}function Am(t){console.error(t)}function Nm(t){Qr(t)}function ec(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Dm(t,n,l){try{var o=t.onCaughtError;o(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Xd(t,n,l){return l=sl(l),l.tag=3,l.payload={element:null},l.callback=function(){ec(t,n)},l}function Rm(t){return t=sl(t),t.tag=3,t}function _m(t,n,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){Dm(n,l,o)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Dm(n,l,o),typeof f!="function"&&(hl===null?hl=new Set([this]):hl.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function Lw(t,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&il(n,l,f,!0),l=Yn.current,l!==null){switch(l.tag){case 31:case 13:return oi===null?fc():l.alternate===null&&_t===0&&(_t=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===or?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),kf(t,o,f)),!1;case 22:return l.flags|=65536,o===or?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([o]):l.add(o)),kf(t,o,f)),!1}throw Error(r(435,l.tag))}return kf(t,o,f),fc(),!1}if(Ye)return n=Yn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==io&&(t=Error(r(422),{cause:o}),Wi(Tn(t,l)))):(o!==io&&(n=Error(r(423),{cause:o}),Wi(Tn(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Tn(o,l),f=Xd(t.stateNode,o,f),Td(t,f),_t!==4&&(_t=2)),!1;var h=Error(r(520),{cause:o});if(h=Tn(h,l),Eo===null?Eo=[h]:Eo.push(h),_t!==4&&(_t=2),n===null)return!0;o=Tn(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Xd(l.stateNode,o,t),Td(l,t),!1;case 1:if(n=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(hl===null||!hl.has(h))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Rm(f),_m(f,t,l,o),Td(l,f),!1}l=l.return}while(l!==null);return!1}var Qd=Error(r(461)),$t=!1;function an(t,n,l,o){n.child=t===null?tt(n,null,l,o):nt(n,t.child,l,o)}function Mm(t,n,l,o,f){l=l.render;var h=n.ref;if("ref"in o){var v={};for(var T in o)T!=="ref"&&(v[T]=o[T])}else v=o;return wa(n),o=_d(t,n,l,v,h,f),T=Md(),t!==null&&!$t?(Od(t,n,f),Ca(t,n,f)):(Ye&&T&&to(n),n.flags|=1,an(t,n,o,f),n.child)}function Om(t,n,l,o,f){if(t===null){var h=l.type;return typeof h=="function"&&!Zs(h)&&h.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=h,zm(t,n,h,o,f)):(t=es(l.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!rf(t,f)){var v=h.memoizedProps;if(l=l.compare,l=l!==null?l:pa,l(v,o)&&t.ref===n.ref)return Ca(t,n,f)}return n.flags|=1,t=xi(h,o),t.ref=n.ref,t.return=n,n.child=t}function zm(t,n,l,o,f){if(t!==null){var h=t.memoizedProps;if(pa(h,o)&&t.ref===n.ref)if($t=!1,n.pendingProps=o=h,rf(t,f))(t.flags&131072)!==0&&($t=!0);else return n.lanes=t.lanes,Ca(t,n,f)}return Zd(t,n,l,o,f)}function Lm(t,n,l,o){var f=o.children,h=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|l:l,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~h}else o=0,n.child=null;return Im(t,n,h,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&ll(n,h!==null?h.cachePool:null),h!==null?Bh(n,h):Ad(),qh(n);else return o=n.lanes=536870912,Im(t,n,h!==null?h.baseLanes|l:l,l,o)}else h!==null?(ll(n,h.cachePool),Bh(n,h),cl(),n.memoizedState=null):(t!==null&&ll(n,null),Ad(),cl());return an(t,n,f,l),n.child}function vo(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Im(t,n,l,o,f){var h=oo();return h=h===null?null:{parent:bt._currentValue,pool:h},n.memoizedState={baseLanes:l,cachePool:h},t!==null&&ll(n,null),Ad(),qh(n),t!==null&&il(t,n,o,!0),n.childLanes=f,null}function tc(t,n){return n=ic({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Um(t,n,l){return nt(n,t.child,null,l),t=tc(n,n.pendingProps),t.flags|=2,Pn(n),n.memoizedState=null,t}function Iw(t,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ye){if(o.mode==="hidden")return t=tc(n,o),n.lanes=536870912,vo(null,t);if(Dd(n),(t=mt)?(t=Xg(t,An),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Vi!==null?{id:Gn,overflow:li}:null,retryLane:536870912,hydrationErrors:null},l=eo(t),l.return=n,n.child=l,Wt=n,mt=null)):t=null,t===null)throw Yi(n);return n.lanes=536870912,null}return tc(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(Dd(n),f)if(n.flags&256)n.flags&=-257,n=Um(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if($t||il(t,n,l,!1),f=(l&t.childLanes)!==0,$t||f){if(o=gt,o!==null&&(v=pu(o,l),v!==0&&v!==h.retryLane))throw h.retryLane=v,Gi(t,v),On(o,t,v),Qd;fc(),n=Um(t,n,l)}else t=h.treeContext,mt=ui(v.nextSibling),Wt=n,Ye=!0,Fi=null,An=!1,t!==null&&Bu(n,t),n=tc(n,o),n.flags|=4096;return n}return t=xi(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function nc(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function Zd(t,n,l,o,f){return wa(n),l=_d(t,n,l,o,void 0,f),o=Md(),t!==null&&!$t?(Od(t,n,f),Ca(t,n,f)):(Ye&&o&&to(n),n.flags|=1,an(t,n,l,f),n.child)}function Bm(t,n,l,o,f,h){return wa(n),n.updateQueue=null,l=$h(n,o,l,f),Hh(t),o=Md(),t!==null&&!$t?(Od(t,n,h),Ca(t,n,h)):(Ye&&o&&to(n),n.flags|=1,an(t,n,l,h),n.child)}function qm(t,n,l,o,f){if(wa(n),n.stateNode===null){var h=ga,v=l.contextType;typeof v=="object"&&v!==null&&(h=Dt(v)),h=new l(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Kd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},ls(n),v=l.contextType,h.context=typeof v=="object"&&v!==null?Dt(v):ga,h.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Wd(n,l,v,o),h.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&Kd.enqueueReplaceState(h,h.state,null),mo(n,o,h,f),ho(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var T=n.memoizedProps,I=cr(l,T);h.props=I;var P=h.context,ne=l.contextType;v=ga,typeof ne=="object"&&ne!==null&&(v=Dt(ne));var se=l.getDerivedStateFromProps;ne=typeof se=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=n.pendingProps!==T,ne||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||P!==v)&&Tm(n,h,o,v),si=!1;var K=n.memoizedState;h.state=K,mo(n,o,h,f),ho(),P=n.memoizedState,T||K!==P||si?(typeof se=="function"&&(Wd(n,l,se,o),P=n.memoizedState),(I=si||Cm(n,l,I,o,K,P,v))?(ne||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=P),h.props=o,h.state=P,h.context=v,o=I):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,Cd(t,n),v=n.memoizedProps,ne=cr(l,v),h.props=ne,se=n.pendingProps,K=h.context,P=l.contextType,I=ga,typeof P=="object"&&P!==null&&(I=Dt(P)),T=l.getDerivedStateFromProps,(P=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==se||K!==I)&&Tm(n,h,o,I),si=!1,K=n.memoizedState,h.state=K,mo(n,o,h,f),ho();var J=n.memoizedState;v!==se||K!==J||si||t!==null&&t.dependencies!==null&&is(t.dependencies)?(typeof T=="function"&&(Wd(n,l,T,o),J=n.memoizedState),(ne=si||Cm(n,l,ne,o,K,J,I)||t!==null&&t.dependencies!==null&&is(t.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,J,I),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,J,I)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=J),h.props=o,h.state=J,h.context=I,o=ne):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,nc(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=nt(n,t.child,null,f),n.child=nt(n,null,l,f)):an(t,n,l,f),n.memoizedState=h.state,t=n.child):t=Ca(t,n,f),t}function Hm(t,n,l,o){return ba(),n.flags|=256,an(t,n,l,o),n.child}var Jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ef(t){return{baseLanes:t,cachePool:Gu()}}function tf(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Kn),t}function $m(t,n,l){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(Lt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ye){if(f?ul(n):cl(),(t=mt)?(t=Xg(t,An),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Vi!==null?{id:Gn,overflow:li}:null,retryLane:536870912,hydrationErrors:null},l=eo(t),l.return=n,n.child=l,Wt=n,mt=null)):t=null,t===null)throw Yi(n);return Uf(t)?n.lanes=32:n.lanes=536870912,null}var T=o.children;return o=o.fallback,f?(cl(),f=n.mode,T=ic({mode:"hidden",children:T},f),o=ya(o,f,l,null),T.return=n,o.return=n,T.sibling=o,n.child=T,o=n.child,o.memoizedState=ef(l),o.childLanes=tf(t,v,l),n.memoizedState=Jd,vo(null,o)):(ul(n),nf(n,T))}var I=t.memoizedState;if(I!==null&&(T=I.dehydrated,T!==null)){if(h)n.flags&256?(ul(n),n.flags&=-257,n=af(t,n,l)):n.memoizedState!==null?(cl(),n.child=t.child,n.flags|=128,n=null):(cl(),T=o.fallback,f=n.mode,o=ic({mode:"visible",children:o.children},f),T=ya(T,f,l,null),T.flags|=2,o.return=n,T.return=n,o.sibling=T,n.child=o,nt(n,t.child,null,l),o=n.child,o.memoizedState=ef(l),o.childLanes=tf(t,v,l),n.memoizedState=Jd,n=vo(null,o));else if(ul(n),Uf(T)){if(v=T.nextSibling&&T.nextSibling.dataset,v)var P=v.dgst;v=P,o=Error(r(419)),o.stack="",o.digest=v,Wi({value:o,source:null,stack:null}),n=af(t,n,l)}else if($t||il(t,n,l,!1),v=(l&t.childLanes)!==0,$t||v){if(v=gt,v!==null&&(o=pu(v,l),o!==0&&o!==I.retryLane))throw I.retryLane=o,Gi(t,o),On(v,t,o),Qd;If(T)||fc(),n=af(t,n,l)}else If(T)?(n.flags|=192,n.child=t.child,n=null):(t=I.treeContext,mt=ui(T.nextSibling),Wt=n,Ye=!0,Fi=null,An=!1,t!==null&&Bu(n,t),n=nf(n,o.children),n.flags|=4096);return n}return f?(cl(),T=o.fallback,f=n.mode,I=t.child,P=I.sibling,o=xi(I,{mode:"hidden",children:o.children}),o.subtreeFlags=I.subtreeFlags&65011712,P!==null?T=xi(P,T):(T=ya(T,f,l,null),T.flags|=2),T.return=n,o.return=n,o.sibling=T,n.child=o,vo(null,o),o=n.child,T=t.child.memoizedState,T===null?T=ef(l):(f=T.cachePool,f!==null?(I=bt._currentValue,f=f.parent!==I?{parent:I,pool:I}:f):f=Gu(),T={baseLanes:T.baseLanes|l,cachePool:f}),o.memoizedState=T,o.childLanes=tf(t,v,l),n.memoizedState=Jd,vo(t.child,o)):(ul(n),l=t.child,t=l.sibling,l=xi(l,{mode:"visible",children:o.children}),l.return=n,l.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=l,n.memoizedState=null,l)}function nf(t,n){return n=ic({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function ic(t,n){return t=zt(22,t,null,n),t.lanes=0,t}function af(t,n,l){return nt(n,t.child,null,l),t=nf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Gm(t,n,l){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),ns(t.return,n,l)}function lf(t,n,l,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=l,v.tailMode=f,v.treeForkCount=h)}function Vm(t,n,l){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=Lt.current,T=(v&2)!==0;if(T?(v=v&1|2,n.flags|=128):v&=1,C(Lt,v),an(t,n,o,l),o=Ye?tr:0,!T&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Gm(t,l,n);else if(t.tag===19)Gm(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(l=n.child,f=null;l!==null;)t=l.alternate,t!==null&&Fu(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),lf(n,!1,f,l,h,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Fu(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}lf(n,!0,l,null,h,o);break;case"together":lf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Ca(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),pl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(il(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(r(153));if(n.child!==null){for(t=n.child,l=xi(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=xi(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function rf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&is(t)))}function Uw(t,n,l){switch(n.tag){case 3:Me(n,n.stateNode.containerInfo),vi(n,bt,t.memoizedState.cache),ba();break;case 27:case 5:Ct(n);break;case 4:Me(n,n.stateNode.containerInfo);break;case 10:vi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Dd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(ul(n),n.flags|=128,null):(l&n.child.childLanes)!==0?$m(t,n,l):(ul(n),t=Ca(t,n,l),t!==null?t.sibling:null);ul(n);break;case 19:var f=(t.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(il(t,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return Vm(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(Lt,Lt.current),o)break;return null;case 22:return n.lanes=0,Lm(t,n,l,n.pendingProps);case 24:vi(n,bt,t.memoizedState.cache)}return Ca(t,n,l)}function Fm(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)$t=!0;else{if(!rf(t,l)&&(n.flags&128)===0)return $t=!1,Uw(t,n,l);$t=(t.flags&131072)!==0}else $t=!1,Ye&&(n.flags&1048576)!==0&&Uu(n,tr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=y(n.elementType),n.type=t,typeof t=="function")Zs(t)?(o=cr(t,o),n.tag=1,n=qm(null,n,t,o,l)):(n.tag=0,n=Zd(null,n,t,o,l));else{if(t!=null){var f=t.$$typeof;if(f===V){n.tag=11,n=Mm(null,n,t,o,l);break e}else if(f===Q){n.tag=14,n=Om(null,n,t,o,l);break e}}throw n=ye(t)||t,Error(r(306,n,""))}}return n;case 0:return Zd(t,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=cr(o,n.pendingProps),qm(t,n,o,f,l);case 3:e:{if(Me(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,Cd(t,n),mo(n,o,null,l);var v=n.memoizedState;if(o=v.cache,vi(n,bt,o),o!==h.cache&&va(n,[bt],l,!0),ho(),o=v.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=Hm(t,n,o,l);break e}else if(o!==f){f=Tn(Error(r(424)),n),Wi(f),n=Hm(t,n,o,l);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(mt=ui(t.firstChild),Wt=n,Ye=!0,Fi=null,An=!0,l=tt(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(ba(),o===f){n=Ca(t,n,l);break e}an(t,n,o,l)}n=n.child}return n;case 26:return nc(t,n),t===null?(l=ny(n.type,null,n.pendingProps,null))?n.memoizedState=l:Ye||(l=n.type,t=n.pendingProps,o=bc(X.current).createElement(l),o[Pt]=n,o[qt]=t,ln(o,l,t),At(o),n.stateNode=o):n.memoizedState=ny(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ct(n),t===null&&Ye&&(o=n.stateNode=Jg(n.type,n.pendingProps,X.current),Wt=n,An=!0,f=mt,xl(n.type)?(Bf=f,mt=ui(o.firstChild)):mt=f),an(t,n,n.pendingProps.children,l),nc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ye&&((f=o=mt)&&(o=hk(o,n.type,n.pendingProps,An),o!==null?(n.stateNode=o,Wt=n,mt=ui(o.firstChild),An=!1,f=!0):f=!1),f||Yi(n)),Ct(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,Of(f,h)?o=null:v!==null&&Of(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=_d(t,n,Nw,null,null,l),zo._currentValue=f),nc(t,n),an(t,n,o,l),n.child;case 6:return t===null&&Ye&&((t=l=mt)&&(l=mk(l,n.pendingProps,An),l!==null?(n.stateNode=l,Wt=n,mt=null,t=!0):t=!1),t||Yi(n)),null;case 13:return $m(t,n,l);case 4:return Me(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=nt(n,null,o,l):an(t,n,o,l),n.child;case 11:return Mm(t,n,n.type,n.pendingProps,l);case 7:return an(t,n,n.pendingProps,l),n.child;case 8:return an(t,n,n.pendingProps.children,l),n.child;case 12:return an(t,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,vi(n,n.type,o.value),an(t,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,wa(n),f=Dt(f),o=o(f),n.flags|=1,an(t,n,o,l),n.child;case 14:return Om(t,n,n.type,n.pendingProps,l);case 15:return zm(t,n,n.type,n.pendingProps,l);case 19:return Vm(t,n,l);case 31:return Iw(t,n,l);case 22:return Lm(t,n,l,n.pendingProps);case 24:return wa(n),o=Dt(bt),t===null?(f=oo(),f===null&&(f=gt,h=so(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=l),f=h),n.memoizedState={parent:o,cache:f},ls(n),vi(n,bt,f)):((t.lanes&l)!==0&&(Cd(t,n),mo(n,null,null,l),ho()),f=t.memoizedState,h=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),vi(n,bt,o)):(o=h.cache,vi(n,bt,o),o!==f.cache&&va(n,[bt],l,!0))),an(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Ta(t){t.flags|=4}function sf(t,n,l,o,f){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(xg())t.flags|=8192;else throw k=or,uo}else t.flags&=-16777217}function Ym(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!sy(n))if(xg())t.flags|=8192;else throw k=or,uo}function ac(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?wt():536870912,t.lanes|=n,ps|=n)}function wo(t,n){if(!Ye)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function kt(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,o=0;if(n)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=l,n}function Bw(t,n,l){var o=n.pendingProps;switch(no(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(n),null;case 1:return kt(n),null;case 3:return l=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),ri(bt),Ve(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Pi(n)?Ta(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ao())),kt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(Ta(n),h!==null?(kt(n),Ym(n,h)):(kt(n),sf(n,f,null,o,l))):h?h!==t.memoizedState?(Ta(n),kt(n),Ym(n,h)):(kt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&Ta(n),kt(n),sf(n,f,t,o,l)),null;case 27:if(vt(n),l=X.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ta(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return kt(n),null}t=W.current,Pi(n)?nr(n):(t=Jg(f,o,l),n.stateNode=t,Ta(n))}return kt(n),null;case 5:if(vt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ta(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return kt(n),null}if(h=W.current,Pi(n))nr(n);else{var v=bc(X.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}h[Pt]=n,h[qt]=o;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.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=h;e:switch(ln(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ta(n)}}return kt(n),sf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Ta(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=X.current,Pi(n)){if(t=n.stateNode,l=n.memoizedProps,o=null,f=Wt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Pt]=n,t=!!(t.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||$g(t.nodeValue,l)),t||Yi(n,!0)}else t=bc(t).createTextNode(o),t[Pt]=n,n.stateNode=t}return kt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(o=Pi(n),l!==null){if(t===null){if(!o)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Pt]=n}else ba(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),t=!1}else l=ao(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Pn(n),n):(Pn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return kt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Pi(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Pt]=n}else ba(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),f=!1}else f=ao(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Pn(n),n):(Pn(n),null)}return Pn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=o!==null,t=t!==null&&t.memoizedState!==null,l&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),ac(n,n.updateQueue),kt(n),null);case 4:return Ve(),t===null&&Nf(n.stateNode.containerInfo),kt(n),null;case 10:return ri(n.type),kt(n),null;case 19:if(z(Lt),o=n.memoizedState,o===null)return kt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)wo(o,!1);else{if(_t!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Fu(t),h!==null){for(n.flags|=128,wo(o,!1),t=h.updateQueue,n.updateQueue=t,ac(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)Lu(l,t),l=l.sibling;return C(Lt,Lt.current&1|2),Ye&&bi(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Mt()>uc&&(n.flags|=128,f=!0,wo(o,!1),n.lanes=4194304)}else{if(!f)if(t=Fu(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,ac(n,t),wo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ye)return kt(n),null}else 2*Mt()-o.renderingStartTime>uc&&l!==536870912&&(n.flags|=128,f=!0,wo(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Mt(),t.sibling=null,l=Lt.current,C(Lt,f?l&1|2:l&1),Ye&&bi(n,o.treeForkCount),t):(kt(n),null);case 22:case 23:return Pn(n),Nd(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(l&536870912)!==0&&(n.flags&128)===0&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),l=n.updateQueue,l!==null&&ac(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==l&&(n.flags|=2048),t!==null&&z(ka),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),ri(bt),kt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function qw(t,n){switch(no(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ri(bt),Ve(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return vt(n),null;case 31:if(n.memoizedState!==null){if(Pn(n),n.alternate===null)throw Error(r(340));ba()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Pn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));ba()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return z(Lt),null;case 4:return Ve(),null;case 10:return ri(n.type),null;case 22:case 23:return Pn(n),Nd(),t!==null&&z(ka),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ri(bt),null;case 25:return null;default:return null}}function Pm(t,n){switch(no(n),n.tag){case 3:ri(bt),Ve();break;case 26:case 27:case 5:vt(n);break;case 4:Ve();break;case 31:n.memoizedState!==null&&Pn(n);break;case 13:Pn(n);break;case 19:z(Lt);break;case 10:ri(n.type);break;case 22:case 23:Pn(n),Nd(),t!==null&&z(ka);break;case 24:ri(bt)}}function ko(t,n){try{var l=n.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&t)===t){o=void 0;var h=l.create,v=l.inst;o=h(),v.destroy=o}l=l.next}while(l!==f)}}catch(T){ct(n,n.return,T)}}function dl(t,n,l){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var v=o.inst,T=v.destroy;if(T!==void 0){v.destroy=void 0,f=n;var I=l,P=T;try{P()}catch(ne){ct(f,I,ne)}}}o=o.next}while(o!==h)}}catch(ne){ct(n,n.return,ne)}}function Wm(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{Uh(n,l)}catch(o){ct(t,t.return,o)}}}function Km(t,n,l){l.props=cr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(o){ct(t,n,o)}}function So(t,n){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof l=="function"?t.refCleanup=l(o):l.current=o}}catch(f){ct(t,n,f)}}function Xi(t,n){var l=t.ref,o=t.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){ct(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){ct(t,n,f)}else l.current=null}function Xm(t){var n=t.type,l=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&o.focus();break e;case"img":l.src?o.src=l.src:l.srcSet&&(o.srcset=l.srcSet)}}catch(f){ct(t,t.return,f)}}function of(t,n,l){try{var o=t.stateNode;ok(o,t.type,l,n),o[qt]=n}catch(f){ct(t,t.return,f)}}function Qm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&xl(t.type)||t.tag===4}function uf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Qm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&xl(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function cf(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Qt));else if(o!==4&&(o===27&&xl(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(cf(t,n,l),t=t.sibling;t!==null;)cf(t,n,l),t=t.sibling}function lc(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(o!==4&&(o===27&&xl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(lc(t,n,l),t=t.sibling;t!==null;)lc(t,n,l),t=t.sibling}function Zm(t){var n=t.stateNode,l=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);ln(n,o,l),n[Pt]=t,n[qt]=l}catch(h){ct(t,t.return,h)}}var Ea=!1,Gt=!1,df=!1,Jm=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function Hw(t,n){if(t=t.containerInfo,_f=Tc,t=Kr(t),Xl(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{l.nodeType,h.nodeType}catch{l=null;break e}var v=0,T=-1,I=-1,P=0,ne=0,se=t,K=null;t:for(;;){for(var J;se!==l||f!==0&&se.nodeType!==3||(T=v+f),se!==h||o!==0&&se.nodeType!==3||(I=v+o),se.nodeType===3&&(v+=se.nodeValue.length),(J=se.firstChild)!==null;)K=se,se=J;for(;;){if(se===t)break t;if(K===l&&++P===f&&(T=v),K===h&&++ne===o&&(I=v),(J=se.nextSibling)!==null)break;se=K,K=se.parentNode}se=J}l=T===-1||I===-1?null:{start:T,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(Mf={focusedElem:t,selectionRange:l},Tc=!1,Zt=n;Zt!==null;)if(n=Zt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Zt=t;else for(;Zt!==null;){switch(n=Zt,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,l=n,f=h.memoizedProps,h=h.memoizedState,o=l.stateNode;try{var je=cr(l.type,f);t=o.getSnapshotBeforeUpdate(je,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(ze){ct(l,l.return,ze)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)Lf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Lf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=n.sibling,t!==null){t.return=n.return,Zt=t;break}Zt=n.return}}function eg(t,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:Na(t,l),o&4&&ko(5,l);break;case 1:if(Na(t,l),o&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(v){ct(l,l.return,v)}else{var f=cr(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ct(l,l.return,v)}}o&64&&Wm(l),o&512&&So(l,l.return);break;case 3:if(Na(t,l),o&64&&(t=l.updateQueue,t!==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{Uh(t,n)}catch(v){ct(l,l.return,v)}}break;case 27:n===null&&o&4&&Zm(l);case 26:case 5:Na(t,l),n===null&&o&4&&Xm(l),o&512&&So(l,l.return);break;case 12:Na(t,l);break;case 31:Na(t,l),o&4&&ig(t,l);break;case 13:Na(t,l),o&4&&ag(t,l),o&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Xw.bind(null,l),gk(t,l))));break;case 22:if(o=l.memoizedState!==null||Ea,!o){n=n!==null&&n.memoizedState!==null||Gt,f=Ea;var h=Gt;Ea=o,(Gt=n)&&!h?Da(t,l,(l.subtreeFlags&8772)!==0):Na(t,l),Ea=f,Gt=h}break;case 30:break;default:Na(t,l)}}function tg(t){var n=t.alternate;n!==null&&(t.alternate=null,tg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Os(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var jt=null,Dn=!1;function Aa(t,n,l){for(l=l.child;l!==null;)ng(t,n,l),l=l.sibling}function ng(t,n,l){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Yt,l)}catch{}switch(l.tag){case 26:Gt||Xi(l,n),Aa(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Gt||Xi(l,n);var o=jt,f=Dn;xl(l.type)&&(jt=l.stateNode,Dn=!1),Aa(t,n,l),_o(l.stateNode),jt=o,Dn=f;break;case 5:Gt||Xi(l,n);case 6:if(o=jt,f=Dn,jt=null,Aa(t,n,l),jt=o,Dn=f,jt!==null)if(Dn)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(l.stateNode)}catch(h){ct(l,n,h)}else try{jt.removeChild(l.stateNode)}catch(h){ct(l,n,h)}break;case 18:jt!==null&&(Dn?(t=jt,Wg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),ws(t)):Wg(jt,l.stateNode));break;case 4:o=jt,f=Dn,jt=l.stateNode.containerInfo,Dn=!0,Aa(t,n,l),jt=o,Dn=f;break;case 0:case 11:case 14:case 15:dl(2,l,n),Gt||dl(4,l,n),Aa(t,n,l);break;case 1:Gt||(Xi(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&Km(l,n,o)),Aa(t,n,l);break;case 21:Aa(t,n,l);break;case 22:Gt=(o=Gt)||l.memoizedState!==null,Aa(t,n,l),Gt=o;break;default:Aa(t,n,l)}}function ig(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(l){ct(n,n.return,l)}}}function ag(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ws(t)}catch(l){ct(n,n.return,l)}}function $w(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Jm),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Jm),n;default:throw Error(r(435,t.tag))}}function rc(t,n){var l=$w(t);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=Qw.bind(null,t,o);o.then(f,f)}})}function Rn(t,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],h=t,v=n,T=v;e:for(;T!==null;){switch(T.tag){case 27:if(xl(T.type)){jt=T.stateNode,Dn=!1;break e}break;case 5:jt=T.stateNode,Dn=!1;break e;case 3:case 4:jt=T.stateNode.containerInfo,Dn=!0;break e}T=T.return}if(jt===null)throw Error(r(160));ng(h,v,f),jt=null,Dn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)lg(n,t),n=n.sibling}var wi=null;function lg(t,n){var l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Rn(n,t),_n(t),o&4&&(dl(3,t,t.return),ko(3,t),dl(5,t,t.return));break;case 1:Rn(n,t),_n(t),o&512&&(Gt||l===null||Xi(l,l.return)),o&64&&Ea&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?o:l.concat(o))));break;case 26:var f=wi;if(Rn(n,t),_n(t),o&512&&(Gt||l===null||Xi(l,l.return)),o&4){var h=l!==null?l.memoizedState:null;if(o=t.memoizedState,l===null)if(o===null)if(t.stateNode===null){e:{o=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Ai]||h[Pt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),ln(h,o,l),h[Pt]=t,At(h),o=h;break e;case"link":var v=ly("link","href",f).get(o+(l.href||""));if(v){for(var T=0;T<v.length;T++)if(h=v[T],h.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&h.getAttribute("rel")===(l.rel==null?null:l.rel)&&h.getAttribute("title")===(l.title==null?null:l.title)&&h.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(T,1);break t}}h=f.createElement(o),ln(h,o,l),f.head.appendChild(h);break;case"meta":if(v=ly("meta","content",f).get(o+(l.content||""))){for(T=0;T<v.length;T++)if(h=v[T],h.getAttribute("content")===(l.content==null?null:""+l.content)&&h.getAttribute("name")===(l.name==null?null:l.name)&&h.getAttribute("property")===(l.property==null?null:l.property)&&h.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&h.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(T,1);break t}}h=f.createElement(o),ln(h,o,l),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[Pt]=t,At(h),o=h}t.stateNode=o}else ry(f,t.type,t.stateNode);else t.stateNode=ay(f,o,t.memoizedProps);else h!==o?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,o===null?ry(f,t.type,t.stateNode):ay(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&of(t,t.memoizedProps,l.memoizedProps)}break;case 27:Rn(n,t),_n(t),o&512&&(Gt||l===null||Xi(l,l.return)),l!==null&&o&4&&of(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Rn(n,t),_n(t),o&512&&(Gt||l===null||Xi(l,l.return)),t.flags&32){f=t.stateNode;try{Va(f,"")}catch(je){ct(t,t.return,je)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,of(t,f,l!==null?l.memoizedProps:f)),o&1024&&(df=!0);break;case 6:if(Rn(n,t),_n(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,l=t.stateNode;try{l.nodeValue=o}catch(je){ct(t,t.return,je)}}break;case 3:if(kc=null,f=wi,wi=vc(n.containerInfo),Rn(n,t),wi=f,_n(t),o&4&&l!==null&&l.memoizedState.isDehydrated)try{ws(n.containerInfo)}catch(je){ct(t,t.return,je)}df&&(df=!1,rg(t));break;case 4:o=wi,wi=vc(t.stateNode.containerInfo),Rn(n,t),_n(t),wi=o;break;case 12:Rn(n,t),_n(t);break;case 31:Rn(n,t),_n(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,rc(t,o)));break;case 13:Rn(n,t),_n(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(oc=Mt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,rc(t,o)));break;case 22:f=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,P=Ea,ne=Gt;if(Ea=P||f,Gt=ne||I,Rn(n,t),Gt=ne,Ea=P,_n(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||I||Ea||Gt||dr(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){I=l=n;try{if(h=I.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{T=I.stateNode;var se=I.memoizedProps.style,K=se!=null&&se.hasOwnProperty("display")?se.display:null;T.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(je){ct(I,I.return,je)}}}else if(n.tag===6){if(l===null){I=n;try{I.stateNode.nodeValue=f?"":I.memoizedProps}catch(je){ct(I,I.return,je)}}}else if(n.tag===18){if(l===null){I=n;try{var J=I.stateNode;f?Kg(J,!0):Kg(I.stateNode,!1)}catch(je){ct(I,I.return,je)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(l=o.retryQueue,l!==null&&(o.retryQueue=null,rc(t,l))));break;case 19:Rn(n,t),_n(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,rc(t,o)));break;case 30:break;case 21:break;default:Rn(n,t),_n(t)}}function _n(t){var n=t.flags;if(n&2){try{for(var l,o=t.return;o!==null;){if(Qm(o)){l=o;break}o=o.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,h=uf(t);lc(t,h,f);break;case 5:var v=l.stateNode;l.flags&32&&(Va(v,""),l.flags&=-33);var T=uf(t);lc(t,T,v);break;case 3:case 4:var I=l.stateNode.containerInfo,P=uf(t);cf(t,P,I);break;default:throw Error(r(161))}}catch(ne){ct(t,t.return,ne)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function rg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;rg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Na(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)eg(t,n.alternate,n),n=n.sibling}function dr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:dl(4,n,n.return),dr(n);break;case 1:Xi(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Km(n,n.return,l),dr(n);break;case 27:_o(n.stateNode);case 26:case 5:Xi(n,n.return),dr(n);break;case 22:n.memoizedState===null&&dr(n);break;case 30:dr(n);break;default:dr(n)}t=t.sibling}}function Da(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,h=n,v=h.flags;switch(h.tag){case 0:case 11:case 15:Da(f,h,l),ko(4,h);break;case 1:if(Da(f,h,l),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){ct(o,o.return,P)}if(o=h,f=o.updateQueue,f!==null){var T=o.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)Ih(I[f],T)}catch(P){ct(o,o.return,P)}}l&&v&64&&Wm(h),So(h,h.return);break;case 27:Zm(h);case 26:case 5:Da(f,h,l),l&&o===null&&v&4&&Xm(h),So(h,h.return);break;case 12:Da(f,h,l);break;case 31:Da(f,h,l),l&&v&4&&ig(f,h);break;case 13:Da(f,h,l),l&&v&4&&ag(f,h);break;case 22:h.memoizedState===null&&Da(f,h,l),So(h,h.return);break;case 30:break;default:Da(f,h,l)}n=n.sibling}}function ff(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&lr(l))}function pf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&lr(t))}function ki(t,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)sg(t,n,l,o),n=n.sibling}function sg(t,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:ki(t,n,l,o),f&2048&&ko(9,n);break;case 1:ki(t,n,l,o);break;case 3:ki(t,n,l,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&lr(t)));break;case 12:if(f&2048){ki(t,n,l,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,T=h.onPostCommit;typeof T=="function"&&T(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){ct(n,n.return,I)}}else ki(t,n,l,o);break;case 31:ki(t,n,l,o);break;case 13:ki(t,n,l,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?ki(t,n,l,o):jo(t,n):h._visibility&2?ki(t,n,l,o):(h._visibility|=2,cs(t,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&ff(v,n);break;case 24:ki(t,n,l,o),f&2048&&pf(n.alternate,n);break;default:ki(t,n,l,o)}}function cs(t,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,T=l,I=o,P=v.flags;switch(v.tag){case 0:case 11:case 15:cs(h,v,T,I,f),ko(8,v);break;case 23:break;case 22:var ne=v.stateNode;v.memoizedState!==null?ne._visibility&2?cs(h,v,T,I,f):jo(h,v):(ne._visibility|=2,cs(h,v,T,I,f)),f&&P&2048&&ff(v.alternate,v);break;case 24:cs(h,v,T,I,f),f&&P&2048&&pf(v.alternate,v);break;default:cs(h,v,T,I,f)}n=n.sibling}}function jo(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,o=n,f=o.flags;switch(o.tag){case 22:jo(l,o),f&2048&&ff(o.alternate,o);break;case 24:jo(l,o),f&2048&&pf(o.alternate,o);break;default:jo(l,o)}n=n.sibling}}var Co=8192;function ds(t,n,l){if(t.subtreeFlags&Co)for(t=t.child;t!==null;)og(t,n,l),t=t.sibling}function og(t,n,l){switch(t.tag){case 26:ds(t,n,l),t.flags&Co&&t.memoizedState!==null&&Ak(l,wi,t.memoizedState,t.memoizedProps);break;case 5:ds(t,n,l);break;case 3:case 4:var o=wi;wi=vc(t.stateNode.containerInfo),ds(t,n,l),wi=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Co,Co=16777216,ds(t,n,l),Co=o):ds(t,n,l));break;default:ds(t,n,l)}}function ug(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function To(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];Zt=o,dg(o,t)}ug(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)cg(t),t=t.sibling}function cg(t){switch(t.tag){case 0:case 11:case 15:To(t),t.flags&2048&&dl(9,t,t.return);break;case 3:To(t);break;case 12:To(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,sc(t)):To(t);break;default:To(t)}}function sc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];Zt=o,dg(o,t)}ug(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:dl(8,n,n.return),sc(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,sc(n));break;default:sc(n)}t=t.sibling}}function dg(t,n){for(;Zt!==null;){var l=Zt;switch(l.tag){case 0:case 11:case 15:dl(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var o=l.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:lr(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,Zt=o;else e:for(l=t;Zt!==null;){o=Zt;var f=o.sibling,h=o.return;if(tg(o),o===l){Zt=null;break e}if(f!==null){f.return=h,Zt=f;break e}Zt=h}}}var Gw={getCacheForType:function(t){var n=Dt(bt),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Dt(bt).controller.signal}},Vw=typeof WeakMap=="function"?WeakMap:Map,st=0,gt=null,Pe=null,Qe=0,ut=0,Wn=null,fl=!1,fs=!1,hf=!1,Ra=0,_t=0,pl=0,fr=0,mf=0,Kn=0,ps=0,Eo=null,Mn=null,gf=!1,oc=0,fg=0,uc=1/0,cc=null,hl=null,Kt=0,ml=null,hs=null,_a=0,yf=0,xf=null,pg=null,Ao=0,bf=null;function Xn(){return(st&2)!==0&&Qe!==0?Qe&-Qe:F.T!==null?Cf():Ms()}function hg(){if(Kn===0)if((Qe&536870912)===0||Ye){var t=Tr;Tr<<=1,(Tr&3932160)===0&&(Tr=262144),Kn=t}else Kn=536870912;return t=Yn.current,t!==null&&(t.flags|=32),Kn}function On(t,n,l){(t===gt&&(ut===2||ut===9)||t.cancelPendingCommit!==null)&&(ms(t,0),gl(t,Qe,Kn,!1)),qa(t,l),((st&2)===0||t!==gt)&&(t===gt&&((st&2)===0&&(fr|=l),_t===4&&gl(t,Qe,Kn,!1)),Qi(t))}function mg(t,n,l){if((st&6)!==0)throw Error(r(327));var o=!l&&(n&127)===0&&(n&t.expiredLanes)===0||Jt(t,n),f=o?Pw(t,n):wf(t,n,!0),h=o;do{if(f===0){fs&&!o&&gl(t,n,0,!1);break}else{if(l=t.current.alternate,h&&!Fw(l)){f=wf(t,n,!1),h=!1;continue}if(f===2){if(h=n,t.errorRecoveryDisabledLanes&h)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var T=t;f=Eo;var I=T.current.memoizedState.isDehydrated;if(I&&(ms(T,v).flags|=256),v=wf(T,v,!1),v!==2){if(hf&&!I){T.errorRecoveryDisabledLanes|=h,fr|=h,f=4;break e}h=Mn,Mn=f,h!==null&&(Mn===null?Mn=h:Mn.push.apply(Mn,h))}f=v}if(h=!1,f!==2)continue}}if(f===1){ms(t,0),gl(t,n,0,!0);break}e:{switch(o=t,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:gl(o,n,Kn,!fl);break e;case 2:Mn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=oc+300-Mt(),10<f)){if(gl(o,n,Kn,!fl),Ua(o,0,!0)!==0)break e;_a=n,o.timeoutHandle=Yg(gg.bind(null,o,l,Mn,cc,gf,n,Kn,fr,ps,fl,h,"Throttled",-0,0),f);break e}gg(o,l,Mn,cc,gf,n,Kn,fr,ps,fl,h,null,-0,0)}}break}while(!0);Qi(t)}function gg(t,n,l,o,f,h,v,T,I,P,ne,se,K,J){if(t.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qt},og(n,h,se);var je=(h&62914560)===h?oc-Mt():(h&4194048)===h?fg-Mt():0;if(je=Nk(se,je),je!==null){_a=h,t.cancelPendingCommit=je(jg.bind(null,t,n,h,l,o,f,v,T,I,ne,se,null,K,J)),gl(t,h,v,!P);return}}jg(t,n,h,l,o,f,v,T,I)}function Fw(t){for(var n=t;;){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 o=0;o<l.length;o++){var f=l[o],h=f.getSnapshot;f=f.value;try{if(!un(h(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function gl(t,n,l,o){n&=~mf,n&=~fr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-ot(f),v=1<<h;o[h]=-1,f&=~v}l!==0&&Rs(t,l,n)}function dc(){return(st&6)===0?(No(0),!1):!0}function vf(){if(Pe!==null){if(ut===0)var t=Pe.return;else t=Pe,Vn=Nn=null,zd(t),U=null,Z=0,t=Pe;for(;t!==null;)Pm(t.alternate,t),t=t.return;Pe=null}}function ms(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,dk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),_a=0,vf(),gt=t,Pe=l=xi(t.current,null),Qe=n,ut=0,Wn=null,fl=!1,fs=Jt(t,n),hf=!1,ps=Kn=mf=fr=pl=_t=0,Mn=Eo=null,gf=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var f=31-ot(o),h=1<<f;n|=t[f],o&=~h}return Ra=n,Zr(),l}function yg(t,n){qe=null,F.H=bo,n===rl||n===sr?(n=j(),ut=3):n===uo?(n=j(),ut=4):ut=n===Qd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Wn=n,Pe===null&&(_t=1,ec(t,Tn(n,t.current)))}function xg(){var t=Yn.current;return t===null?!0:(Qe&4194048)===Qe?oi===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===oi:!1}function bg(){var t=F.H;return F.H=bo,t===null?bo:t}function vg(){var t=F.A;return F.A=Gw,t}function fc(){_t=4,fl||(Qe&4194048)!==Qe&&Yn.current!==null||(fs=!0),(pl&134217727)===0&&(fr&134217727)===0||gt===null||gl(gt,Qe,Kn,!1)}function wf(t,n,l){var o=st;st|=2;var f=bg(),h=vg();(gt!==t||Qe!==n)&&(cc=null,ms(t,n)),n=!1;var v=_t;e:do try{if(ut!==0&&Pe!==null){var T=Pe,I=Wn;switch(ut){case 8:vf(),v=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(n=!0);var P=ut;if(ut=0,Wn=null,gs(t,T,I,P),l&&fs){v=0;break e}break;default:P=ut,ut=0,Wn=null,gs(t,T,I,P)}}Yw(),v=_t;break}catch(ne){yg(t,ne)}while(!0);return n&&t.shellSuspendCounter++,Vn=Nn=null,st=o,F.H=f,F.A=h,Pe===null&&(gt=null,Qe=0,Zr()),v}function Yw(){for(;Pe!==null;)wg(Pe)}function Pw(t,n){var l=st;st|=2;var o=bg(),f=vg();gt!==t||Qe!==n?(cc=null,uc=Mt()+500,ms(t,n)):fs=Jt(t,n);e:do try{if(ut!==0&&Pe!==null){n=Pe;var h=Wn;t:switch(ut){case 1:ut=0,Wn=null,gs(t,n,h,1);break;case 2:case 9:if(co(h)){ut=0,Wn=null,kg(n);break}n=function(){ut!==2&&ut!==9||gt!==t||(ut=7),Qi(t)},h.then(n,n);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:co(h)?(ut=0,Wn=null,kg(n)):(ut=0,Wn=null,gs(t,n,h,7));break;case 5:var v=null;switch(Pe.tag){case 26:v=Pe.memoizedState;case 5:case 27:var T=Pe;if(v?sy(v):T.stateNode.complete){ut=0,Wn=null;var I=T.sibling;if(I!==null)Pe=I;else{var P=T.return;P!==null?(Pe=P,pc(P)):Pe=null}break t}}ut=0,Wn=null,gs(t,n,h,5);break;case 6:ut=0,Wn=null,gs(t,n,h,6);break;case 8:vf(),_t=6;break e;default:throw Error(r(462))}}Ww();break}catch(ne){yg(t,ne)}while(!0);return Vn=Nn=null,F.H=o,F.A=f,st=l,Pe!==null?0:(gt=null,Qe=0,Zr(),_t)}function Ww(){for(;Pe!==null&&!Jn();)wg(Pe)}function wg(t){var n=Fm(t.alternate,t,Ra);t.memoizedProps=t.pendingProps,n===null?pc(t):Pe=n}function kg(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=Bm(l,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=Bm(l,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:zd(n);default:Pm(l,n),n=Pe=Lu(n,Ra),n=Fm(l,n,Ra)}t.memoizedProps=t.pendingProps,n===null?pc(t):Pe=n}function gs(t,n,l,o){Vn=Nn=null,zd(n),U=null,Z=0;var f=n.return;try{if(Lw(t,f,n,l,Qe)){_t=1,ec(t,Tn(l,t.current)),Pe=null;return}}catch(h){if(f!==null)throw Pe=f,h;_t=1,ec(t,Tn(l,t.current)),Pe=null;return}n.flags&32768?(Ye||o===1?t=!0:fs||(Qe&536870912)!==0?t=!1:(fl=t=!0,(o===2||o===9||o===3||o===6)&&(o=Yn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Sg(n,t)):pc(n)}function pc(t){var n=t;do{if((n.flags&32768)!==0){Sg(n,fl);return}t=n.return;var l=Bw(n.alternate,n,Ra);if(l!==null){Pe=l;return}if(n=n.sibling,n!==null){Pe=n;return}Pe=n=t}while(n!==null);_t===0&&(_t=5)}function Sg(t,n){do{var l=qw(t.alternate,t);if(l!==null){l.flags&=32767,Pe=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Pe=t;return}Pe=t=l}while(t!==null);_t=6,Pe=null}function jg(t,n,l,o,f,h,v,T,I){t.cancelPendingCommit=null;do hc();while(Kt!==0);if((st&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Xs,Rl(t,l,h,v,T,I),t===gt&&(Pe=gt=null,Qe=0),hs=n,ml=t,_a=l,yf=h,xf=f,pg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Zw(Ee,function(){return Ng(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=F.T,F.T=null,f=oe.p,oe.p=2,v=st,st|=4;try{Hw(t,n,l)}finally{st=v,oe.p=f,F.T=o}}Kt=1,Cg(),Tg(),Eg()}}function Cg(){if(Kt===1){Kt=0;var t=ml,n=hs,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=F.T,F.T=null;var o=oe.p;oe.p=2;var f=st;st|=4;try{lg(n,t);var h=Mf,v=Kr(t.containerInfo),T=h.focusedElem,I=h.selectionRange;if(v!==T&&T&&T.ownerDocument&&Kl(T.ownerDocument.documentElement,T)){if(I!==null&&Xl(T)){var P=I.start,ne=I.end;if(ne===void 0&&(ne=P),"selectionStart"in T)T.selectionStart=P,T.selectionEnd=Math.min(ne,T.value.length);else{var se=T.ownerDocument||document,K=se&&se.defaultView||window;if(K.getSelection){var J=K.getSelection(),je=T.textContent.length,ze=Math.min(I.start,je),ht=I.end===void 0?ze:Math.min(I.end,je);!J.extend&&ze>ht&&(v=ht,ht=ze,ze=v);var G=Nu(T,ze),B=Nu(T,ht);if(G&&B&&(J.rangeCount!==1||J.anchorNode!==G.node||J.anchorOffset!==G.offset||J.focusNode!==B.node||J.focusOffset!==B.offset)){var Y=se.createRange();Y.setStart(G.node,G.offset),J.removeAllRanges(),ze>ht?(J.addRange(Y),J.extend(B.node,B.offset)):(Y.setEnd(B.node,B.offset),J.addRange(Y))}}}}for(se=[],J=T;J=J.parentNode;)J.nodeType===1&&se.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<se.length;T++){var le=se[T];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Tc=!!_f,Mf=_f=null}finally{st=f,oe.p=o,F.T=l}}t.current=n,Kt=2}}function Tg(){if(Kt===2){Kt=0;var t=ml,n=hs,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=F.T,F.T=null;var o=oe.p;oe.p=2;var f=st;st|=4;try{eg(t,n.alternate,n)}finally{st=f,oe.p=o,F.T=l}}Kt=3}}function Eg(){if(Kt===4||Kt===3){Kt=0,La();var t=ml,n=hs,l=_a,o=pg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Kt=5:(Kt=0,hs=ml=null,Ag(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(hl=null),_s(l),n=n.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Yt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=F.T,f=oe.p,oe.p=2,F.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var T=o[v];h(T.value,{componentStack:T.stack})}}finally{F.T=n,oe.p=f}}(_a&3)!==0&&hc(),Qi(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===bf?Ao++:(Ao=0,bf=t):Ao=0,No(0)}}function Ag(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,lr(n)))}function hc(){return Cg(),Tg(),Eg(),Ng()}function Ng(){if(Kt!==5)return!1;var t=ml,n=yf;yf=0;var l=_s(_a),o=F.T,f=oe.p;try{oe.p=32>l?32:l,F.T=null,l=xf,xf=null;var h=ml,v=_a;if(Kt=0,hs=ml=null,_a=0,(st&6)!==0)throw Error(r(331));var T=st;if(st|=4,cg(h.current),sg(h,h.current,v,l),st=T,No(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Yt,h)}catch{}return!0}finally{oe.p=f,F.T=o,Ag(t,n)}}function Dg(t,n,l){n=Tn(l,n),n=Xd(t.stateNode,n,2),t=ol(t,n,2),t!==null&&(qa(t,2),Qi(t))}function ct(t,n,l){if(t.tag===3)Dg(t,t,l);else for(;n!==null;){if(n.tag===3){Dg(n,t,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(hl===null||!hl.has(o))){t=Tn(l,t),l=Rm(2),o=ol(n,l,2),o!==null&&(_m(l,o,n,t),qa(o,2),Qi(o));break}}n=n.return}}function kf(t,n,l){var o=t.pingCache;if(o===null){o=t.pingCache=new Vw;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(l)||(hf=!0,f.add(l),t=Kw.bind(null,t,n,l),n.then(t,t))}function Kw(t,n,l){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,gt===t&&(Qe&l)===l&&(_t===4||_t===3&&(Qe&62914560)===Qe&&300>Mt()-oc?(st&2)===0&&ms(t,0):mf|=l,ps===Qe&&(ps=0)),Qi(t)}function Rg(t,n){n===0&&(n=wt()),t=Gi(t,n),t!==null&&(qa(t,n),Qi(t))}function Xw(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),Rg(t,l)}function Qw(t,n){var l=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),Rg(t,l)}function Zw(t,n){return Xt(t,n)}var mc=null,ys=null,Sf=!1,gc=!1,jf=!1,yl=0;function Qi(t){t!==ys&&t.next===null&&(ys===null?mc=ys=t:ys=ys.next=t),gc=!0,Sf||(Sf=!0,ek())}function No(t,n){if(!jf&&gc){jf=!0;do for(var l=!1,o=mc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-ot(42|t)+1)-1,h&=f&~(v&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,zg(o,h))}else h=Qe,h=Ua(o,o===gt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Jt(o,h)||(l=!0,zg(o,h));o=o.next}while(l);jf=!1}}function Jw(){_g()}function _g(){gc=Sf=!1;var t=0;yl!==0&&ck()&&(t=yl);for(var n=Mt(),l=null,o=mc;o!==null;){var f=o.next,h=Mg(o,n);h===0?(o.next=null,l===null?mc=f:l.next=f,f===null&&(ys=l)):(l=o,(t!==0||(h&3)!==0)&&(gc=!0)),o=f}Kt!==0&&Kt!==5||No(t),yl!==0&&(yl=0)}function Mg(t,n){for(var l=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-ot(h),T=1<<v,I=f[v];I===-1?((T&l)===0||(T&o)!==0)&&(f[v]=Ba(T,n)):I<=n&&(t.expiredLanes|=T),h&=~T}if(n=gt,l=Qe,l=Ua(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,l===0||t===n&&(ut===2||ut===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&ji(o),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Jt(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(o!==null&&ji(o),_s(l)){case 2:case 8:l=ce;break;case 32:l=Ee;break;case 268435456:l=Xe;break;default:l=Ee}return o=Og.bind(null,t),l=Xt(l,o),t.callbackPriority=n,t.callbackNode=l,n}return o!==null&&o!==null&&ji(o),t.callbackPriority=2,t.callbackNode=null,2}function Og(t,n){if(Kt!==0&&Kt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(hc()&&t.callbackNode!==l)return null;var o=Qe;return o=Ua(t,t===gt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(mg(t,o,n),Mg(t,Mt()),t.callbackNode!=null&&t.callbackNode===l?Og.bind(null,t):null)}function zg(t,n){if(hc())return null;mg(t,n,!0)}function ek(){fk(function(){(st&6)!==0?Xt(ae,Jw):_g()})}function Cf(){if(yl===0){var t=xn;t===0&&(t=Cr,Cr<<=1,(Cr&261888)===0&&(Cr=256)),yl=t}return yl}function Lg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:gn(""+t)}function Ig(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function tk(t,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var h=Lg((f[qt]||null).action),v=o.submitter;v&&(n=(n=v[qt]||null)?Lg(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var T=new Pa("action","action",null,o,f);t.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(yl!==0){var I=v?Ig(f,v):new FormData(f);Vd(l,{pending:!0,data:I,method:f.method,action:h},null,I)}}else typeof h=="function"&&(T.preventDefault(),I=v?Ig(f,v):new FormData(f),Vd(l,{pending:!0,data:I,method:f.method,action:h},h,I))},currentTarget:f}]})}}for(var Tf=0;Tf<Ks.length;Tf++){var Ef=Ks[Tf],nk=Ef.toLowerCase(),ik=Ef[0].toUpperCase()+Ef.slice(1);Hn(nk,"on"+ik)}Hn(Ru,"onAnimationEnd"),Hn(_u,"onAnimationIteration"),Hn(Mu,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(wd,"onTransitionRun"),Hn(kd,"onTransitionStart"),Hn(Sd,"onTransitionCancel"),Hn(Ou,"onTransitionEnd"),Ri("onMouseEnter",["mouseout","mouseover"]),Ri("onMouseLeave",["mouseout","mouseover"]),Ri("onPointerEnter",["pointerout","pointerover"]),Ri("onPointerLeave",["pointerout","pointerover"]),on("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),on("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),on("onBeforeInput",["compositionend","keypress","textInput","paste"]),on("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),on("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),on("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="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(" "),ak=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Do));function Ug(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var o=t[l],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var T=o[v],I=T.instance,P=T.currentTarget;if(T=T.listener,I!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=P;try{h(f)}catch(ne){Qr(ne)}f.currentTarget=null,h=I}else for(v=0;v<o.length;v++){if(T=o[v],I=T.instance,P=T.currentTarget,T=T.listener,I!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=P;try{h(f)}catch(ne){Qr(ne)}f.currentTarget=null,h=I}}}}function We(t,n){var l=n[Ei];l===void 0&&(l=n[Ei]=new Set);var o=t+"__bubble";l.has(o)||(Bg(n,t,2,!1),l.add(o))}function Af(t,n,l){var o=0;n&&(o|=4),Bg(l,t,o,n)}var yc="_reactListening"+Math.random().toString(36).slice(2);function Nf(t){if(!t[yc]){t[yc]=!0,mu.forEach(function(l){l!=="selectionchange"&&(ak.has(l)||Af(l,!1,t),Af(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[yc]||(n[yc]=!0,Af("selectionchange",!1,n))}}function Bg(t,n,l,o){switch(hy(n)){case 2:var f=_k;break;case 8:f=Mk;break;default:f=Vf}l=f.bind(null,n,l,t),f=void 0,!Bs||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,l,{capture:!0,passive:f}):t.addEventListener(n,l,!0):f!==void 0?t.addEventListener(n,l,{passive:f}):t.addEventListener(n,l,!1)}function Df(t,n,l,o,f){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var T=o.stateNode.containerInfo;if(T===f)break;if(v===4)for(v=o.return;v!==null;){var I=v.tag;if((I===3||I===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;T!==null;){if(v=ni(T),v===null)return;if(I=v.tag,I===5||I===6||I===26||I===27){o=h=v;continue e}T=T.parentNode}}o=o.return}Us(function(){var P=h,ne=ra(l),se=[];e:{var K=zu.get(t);if(K!==void 0){var J=Pa,je=t;switch(t){case"keypress":if(Ya(l)===0)break e;case"keydown":case"keyup":J=ai;break;case"focusin":je="focus",J=Ui;break;case"focusout":je="blur",J=Ui;break;case"beforeblur":case"afterblur":J=Ui;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":J=Ka;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=Ir;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=lt;break;case Ru:case _u:case Mu:J=Bi;break;case Ou:J=Hr;break;case"scroll":case"scrollend":J=Hs;break;case"wheel":J=Vl;break;case"copy":case"cut":case"paste":J=Sn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=qr;break;case"toggle":case"beforetoggle":J=ua}var ze=(n&4)!==0,ht=!ze&&(t==="scroll"||t==="scrollend"),G=ze?K!==null?K+"Capture":null:K;ze=[];for(var B=P,Y;B!==null;){var le=B;if(Y=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Y===null||G===null||(le=Il(B,G),le!=null&&ze.push(Ro(B,le,Y))),ht)break;B=B.return}0<ze.length&&(K=new J(K,je,null,l,ne),se.push({event:K,listeners:ze}))}}if((n&7)===0){e:{if(K=t==="mouseover"||t==="pointerover",J=t==="mouseout"||t==="pointerout",K&&l!==zl&&(je=l.relatedTarget||l.fromElement)&&(ni(je)||je[Un]))break e;if((J||K)&&(K=ne.window===ne?ne:(K=ne.ownerDocument)?K.defaultView||K.parentWindow:window,J?(je=l.relatedTarget||l.toElement,J=P,je=je?ni(je):null,je!==null&&(ht=c(je),ze=je.tag,je!==ht||ze!==5&&ze!==27&&ze!==6)&&(je=null)):(J=null,je=P),J!==je)){if(ze=Ka,le="onMouseLeave",G="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(ze=qr,le="onPointerLeave",G="onPointerEnter",B="pointer"),ht=J==null?K:ia(J),Y=je==null?K:ia(je),K=new ze(le,B+"leave",J,l,ne),K.target=ht,K.relatedTarget=Y,le=null,ni(ne)===P&&(ze=new ze(G,B+"enter",je,l,ne),ze.target=Y,ze.relatedTarget=ht,le=ze),ht=le,J&&je)t:{for(ze=lk,G=J,B=je,Y=0,le=G;le;le=ze(le))Y++;le=0;for(var Re=B;Re;Re=ze(Re))le++;for(;0<Y-le;)G=ze(G),Y--;for(;0<le-Y;)B=ze(B),le--;for(;Y--;){if(G===B||B!==null&&G===B.alternate){ze=G;break t}G=ze(G),B=ze(B)}ze=null}else ze=null;J!==null&&qg(se,K,J,ze,!1),je!==null&&ht!==null&&qg(se,ht,je,ze,!0)}}e:{if(K=P?ia(P):window,J=K.nodeName&&K.nodeName.toLowerCase(),J==="select"||J==="input"&&K.type==="file")var it=ke;else if(Cu(K))if(Wl)it=Wr;else{it=yd;var Ae=nn}else J=K.nodeName,!J||J.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?P&&Ol(P.elementType)&&(it=ke):it=xd;if(it&&(it=it(t,P))){Tu(se,it,l,ne);break e}Ae&&Ae(t,K,P),t==="focusout"&&P&&K.type==="number"&&P.memoizedProps.value!=null&&Dr(K,"number",K.value)}switch(Ae=P?ia(P):window,t){case"focusin":(Cu(Ae)||Ae.contentEditable==="true")&&($i=Ae,Ps=P,Ql=null);break;case"focusout":Ql=Ps=$i=null;break;case"mousedown":Zl=!0;break;case"contextmenu":case"mouseup":case"dragend":Zl=!1,Ws(se,l,ne);break;case"selectionchange":if(vd)break;case"keydown":case"keyup":Ws(se,l,ne)}var $e;if(Fs)e:{switch(t){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else qi?ju(t,l)&&(Ze="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ze="onCompositionStart");Ze&&($r&&l.locale!=="ko"&&(qi||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&qi&&($e=qs()):(Li=ne,Or="value"in Li?Li.value:Li.textContent,qi=!0)),Ae=xc(P,Ze),0<Ae.length&&(Ze=new Za(Ze,t,null,l,ne),se.push({event:Ze,listeners:Ae}),$e?Ze.data=$e:($e=Ys(l),$e!==null&&(Ze.data=$e)))),($e=Su?Vr(t,l):gd(t,l))&&(Ze=xc(P,"onBeforeInput"),0<Ze.length&&(Ae=new Za("onBeforeInput","beforeinput",null,l,ne),se.push({event:Ae,listeners:Ze}),Ae.data=$e)),tk(se,t,P,l,ne)}Ug(se,n)})}function Ro(t,n,l){return{instance:t,listener:n,currentTarget:l}}function xc(t,n){for(var l=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Il(t,l),f!=null&&o.unshift(Ro(t,f,h)),f=Il(t,n),f!=null&&o.push(Ro(t,f,h))),t.tag===3)return o;t=t.return}return[]}function lk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function qg(t,n,l,o,f){for(var h=n._reactName,v=[];l!==null&&l!==o;){var T=l,I=T.alternate,P=T.stateNode;if(T=T.tag,I!==null&&I===o)break;T!==5&&T!==26&&T!==27||P===null||(I=P,f?(P=Il(l,h),P!=null&&v.unshift(Ro(l,P,I))):f||(P=Il(l,h),P!=null&&v.push(Ro(l,P,I)))),l=l.return}v.length!==0&&t.push({event:n,listeners:v})}var rk=/\r\n?/g,sk=/\u0000|\uFFFD/g;function Hg(t){return(typeof t=="string"?t:""+t).replace(rk,`
|
|
50
|
-
`).replace(sk,"")}function $g(t,n){return n=Hg(n),Hg(t)===n}function pt(t,n,l,o,f,h){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Va(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Va(t,""+o);break;case"className":aa(t,"class",o);break;case"tabIndex":aa(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":aa(t,l,o);break;case"style":_r(t,o,h);break;case"data":if(n!=="object"){aa(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=gn(""+o),t.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(l==="formAction"?(n!=="input"&&pt(t,n,"name",f.name,f,null),pt(t,n,"formEncType",f.formEncType,f,null),pt(t,n,"formMethod",f.formMethod,f,null),pt(t,n,"formTarget",f.formTarget,f,null)):(pt(t,n,"encType",f.encType,f,null),pt(t,n,"method",f.method,f,null),pt(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=gn(""+o),t.setAttribute(l,o);break;case"onClick":o!=null&&(t.onclick=Qt);break;case"onScroll":o!=null&&We("scroll",t);break;case"onScrollEnd":o!=null&&We("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}l=gn(""+o),t.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":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""+o):t.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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":o===!0?t.setAttribute(l,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,o):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(l,o):t.removeAttribute(l);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(l):t.setAttribute(l,o);break;case"popover":We("beforetoggle",t),We("toggle",t),_l(t,"popover",o);break;case"xlinkActuate":pi(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":pi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":pi(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":pi(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":pi(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":pi(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":pi(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":pi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":pi(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":_l(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=vu.get(l)||l,_l(t,l,o))}}function Rf(t,n,l,o,f,h){switch(l){case"style":_r(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof o=="string"?Va(t,o):(typeof o=="number"||typeof o=="bigint")&&Va(t,""+o);break;case"onScroll":o!=null&&We("scroll",t);break;case"onScrollEnd":o!=null&&We("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Qt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zs.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),h=t[qt]||null,h=h!=null?h[l]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,o,f);break e}l in t?t[l]=o:o===!0?t.setAttribute(l,""):_l(t,l,o)}}}function ln(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",t),We("load",t);var o=!1,f=!1,h;for(h in l)if(l.hasOwnProperty(h)){var v=l[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(t,n,h,v,l,null)}}f&&pt(t,n,"srcSet",l.srcSet,l,null),o&&pt(t,n,"src",l.src,l,null);return;case"input":We("invalid",t);var T=h=v=f=null,I=null,P=null;for(o in l)if(l.hasOwnProperty(o)){var ne=l[o];if(ne!=null)switch(o){case"name":f=ne;break;case"type":v=ne;break;case"checked":I=ne;break;case"defaultChecked":P=ne;break;case"value":h=ne;break;case"defaultValue":T=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,n));break;default:pt(t,n,o,ne,l,null)}}Mi(t,h,T,I,P,v,f,!1);return;case"select":We("invalid",t),o=v=h=null;for(f in l)if(l.hasOwnProperty(f)&&(T=l[f],T!=null))switch(f){case"value":h=T;break;case"defaultValue":v=T;break;case"multiple":o=T;default:pt(t,n,f,T,l,null)}n=h,l=v,t.multiple=!!o,n!=null?ii(t,!!o,n,!1):l!=null&&ii(t,!!o,l,!0);return;case"textarea":We("invalid",t),h=f=o=null;for(v in l)if(l.hasOwnProperty(v)&&(T=l[v],T!=null))switch(v){case"value":o=T;break;case"defaultValue":f=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:pt(t,n,v,T,l,null)}Ml(t,o,f,h);return;case"option":for(I in l)if(l.hasOwnProperty(I)&&(o=l[I],o!=null))switch(I){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:pt(t,n,I,o,l,null)}return;case"dialog":We("beforetoggle",t),We("toggle",t),We("cancel",t),We("close",t);break;case"iframe":case"object":We("load",t);break;case"video":case"audio":for(o=0;o<Do.length;o++)We(Do[o],t);break;case"image":We("error",t),We("load",t);break;case"details":We("toggle",t);break;case"embed":case"source":case"link":We("error",t),We("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in l)if(l.hasOwnProperty(P)&&(o=l[P],o!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(t,n,P,o,l,null)}return;default:if(Ol(n)){for(ne in l)l.hasOwnProperty(ne)&&(o=l[ne],o!==void 0&&Rf(t,n,ne,o,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(o=l[T],o!=null&&pt(t,n,T,o,l,null))}function ok(t,n,l,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,T=null,I=null,P=null,ne=null;for(J in l){var se=l[J];if(l.hasOwnProperty(J)&&se!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":I=se;default:o.hasOwnProperty(J)||pt(t,n,J,null,o,se)}}for(var K in o){var J=o[K];if(se=l[K],o.hasOwnProperty(K)&&(J!=null||se!=null))switch(K){case"type":h=J;break;case"name":f=J;break;case"checked":P=J;break;case"defaultChecked":ne=J;break;case"value":v=J;break;case"defaultValue":T=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,n));break;default:J!==se&&pt(t,n,K,J,o,se)}}Bn(t,v,T,I,P,ne,h,f);return;case"select":J=v=T=K=null;for(h in l)if(I=l[h],l.hasOwnProperty(h)&&I!=null)switch(h){case"value":break;case"multiple":J=I;default:o.hasOwnProperty(h)||pt(t,n,h,null,o,I)}for(f in o)if(h=o[f],I=l[f],o.hasOwnProperty(f)&&(h!=null||I!=null))switch(f){case"value":K=h;break;case"defaultValue":T=h;break;case"multiple":v=h;default:h!==I&&pt(t,n,f,h,o,I)}n=T,l=v,o=J,K!=null?ii(t,!!l,K,!1):!!o!=!!l&&(n!=null?ii(t,!!l,n,!0):ii(t,!!l,l?[]:"",!1));return;case"textarea":J=K=null;for(T in l)if(f=l[T],l.hasOwnProperty(T)&&f!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:pt(t,n,T,null,o,f)}for(v in o)if(f=o[v],h=l[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":K=f;break;case"defaultValue":J=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&pt(t,n,v,f,o,h)}Is(t,K,J);return;case"option":for(var je in l)if(K=l[je],l.hasOwnProperty(je)&&K!=null&&!o.hasOwnProperty(je))switch(je){case"selected":t.selected=!1;break;default:pt(t,n,je,null,o,K)}for(I in o)if(K=o[I],J=l[I],o.hasOwnProperty(I)&&K!==J&&(K!=null||J!=null))switch(I){case"selected":t.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:pt(t,n,I,K,o,J)}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 ze in l)K=l[ze],l.hasOwnProperty(ze)&&K!=null&&!o.hasOwnProperty(ze)&&pt(t,n,ze,null,o,K);for(P in o)if(K=o[P],J=l[P],o.hasOwnProperty(P)&&K!==J&&(K!=null||J!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,n));break;default:pt(t,n,P,K,o,J)}return;default:if(Ol(n)){for(var ht in l)K=l[ht],l.hasOwnProperty(ht)&&K!==void 0&&!o.hasOwnProperty(ht)&&Rf(t,n,ht,void 0,o,K);for(ne in o)K=o[ne],J=l[ne],!o.hasOwnProperty(ne)||K===J||K===void 0&&J===void 0||Rf(t,n,ne,K,o,J);return}}for(var G in l)K=l[G],l.hasOwnProperty(G)&&K!=null&&!o.hasOwnProperty(G)&&pt(t,n,G,null,o,K);for(se in o)K=o[se],J=l[se],!o.hasOwnProperty(se)||K===J||K==null&&J==null||pt(t,n,se,K,o,J)}function Gg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],h=f.transferSize,v=f.initiatorType,T=f.duration;if(h&&T&&Gg(v)){for(v=0,T=f.responseEnd,o+=1;o<l.length;o++){var I=l[o],P=I.startTime;if(P>T)break;var ne=I.transferSize,se=I.initiatorType;ne&&Gg(se)&&(I=I.responseEnd,v+=ne*(I<T?1:(T-P)/(I-P)))}if(--o,n+=8*(h+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var _f=null,Mf=null;function bc(t){return t.nodeType===9?t:t.ownerDocument}function Vg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Fg(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Of(t,n){return t==="textarea"||t==="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 zf=null;function ck(){var t=window.event;return t&&t.type==="popstate"?t===zf?!1:(zf=t,!0):(zf=null,!1)}var Yg=typeof setTimeout=="function"?setTimeout:void 0,dk=typeof clearTimeout=="function"?clearTimeout:void 0,Pg=typeof Promise=="function"?Promise:void 0,fk=typeof queueMicrotask=="function"?queueMicrotask:typeof Pg<"u"?function(t){return Pg.resolve(null).then(t).catch(pk)}:Yg;function pk(t){setTimeout(function(){throw t})}function xl(t){return t==="head"}function Wg(t,n){var l=n,o=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(o===0){t.removeChild(f),ws(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")_o(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,_o(l);for(var h=l.firstChild;h;){var v=h.nextSibling,T=h.nodeName;h[Ai]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=v}}else l==="body"&&_o(t.ownerDocument.body);l=f}while(l);ws(n)}function Kg(t,n){var l=t;t=0;do{var o=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||""),o&&o.nodeType===8)if(l=o.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=o}while(l)}function Lf(t){var n=t.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":Lf(l),Os(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function hk(t,n,l,o){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Ai])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=ui(t.nextSibling),t===null)break}return null}function mk(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=ui(t.nextSibling),t===null))return null;return t}function Xg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ui(t.nextSibling),t===null))return null;return t}function If(t){return t.data==="$?"||t.data==="$~"}function Uf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function gk(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var o=function(){n(),l.removeEventListener("DOMContentLoaded",o)};l.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function ui(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Bf=null;function Qg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return ui(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function Zg(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function Jg(t,n,l){switch(n=bc(l),t){case"html":if(t=n.documentElement,!t)throw Error(r(452));return t;case"head":if(t=n.head,!t)throw Error(r(453));return t;case"body":if(t=n.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function _o(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Os(t)}var ci=new Map,ey=new Set;function vc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ma=oe.d;oe.d={f:yk,r:xk,D:bk,C:vk,L:wk,m:kk,X:jk,S:Sk,M:Ck};function yk(){var t=Ma.f(),n=dc();return t||n}function xk(t){var n=Ni(t);n!==null&&n.tag===5&&n.type==="form"?ym(n):Ma.r(t)}var xs=typeof document>"u"?null:document;function ty(t,n,l){var o=xs;if(o&&typeof n=="string"&&n){var f=Nt(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),ey.has(f)||(ey.add(f),t={rel:t,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),ln(n,"link",t),At(n),o.head.appendChild(n)))}}function bk(t){Ma.D(t),ty("dns-prefetch",t,null)}function vk(t,n){Ma.C(t,n),ty("preconnect",t,n)}function wk(t,n,l){Ma.L(t,n,l);var o=xs;if(o&&t&&n){var f='link[rel="preload"][as="'+Nt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Nt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Nt(l.imageSizes)+'"]')):f+='[href="'+Nt(t)+'"]';var h=f;switch(n){case"style":h=bs(t);break;case"script":h=vs(t)}ci.has(h)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),ci.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(Mo(h))||n==="script"&&o.querySelector(Oo(h))||(n=o.createElement("link"),ln(n,"link",t),At(n),o.head.appendChild(n)))}}function kk(t,n){Ma.m(t,n);var l=xs;if(l&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Nt(o)+'"][href="'+Nt(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=vs(t)}if(!ci.has(h)&&(t=x({rel:"modulepreload",href:t},n),ci.set(h,t),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Oo(h)))return}o=l.createElement("link"),ln(o,"link",t),At(o),l.head.appendChild(o)}}}function Sk(t,n,l){Ma.S(t,n,l);var o=xs;if(o&&t){var f=Di(o).hoistableStyles,h=bs(t);n=n||"default";var v=f.get(h);if(!v){var T={loading:0,preload:null};if(v=o.querySelector(Mo(h)))T.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=ci.get(h))&&qf(t,l);var I=v=o.createElement("link");At(I),ln(I,"link",t),I._p=new Promise(function(P,ne){I.onload=P,I.onerror=ne}),I.addEventListener("load",function(){T.loading|=1}),I.addEventListener("error",function(){T.loading|=2}),T.loading|=4,wc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:T},f.set(h,v)}}}function jk(t,n){Ma.X(t,n);var l=xs;if(l&&t){var o=Di(l).hoistableScripts,f=vs(t),h=o.get(f);h||(h=l.querySelector(Oo(f)),h||(t=x({src:t,async:!0},n),(n=ci.get(f))&&Hf(t,n),h=l.createElement("script"),At(h),ln(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Ck(t,n){Ma.M(t,n);var l=xs;if(l&&t){var o=Di(l).hoistableScripts,f=vs(t),h=o.get(f);h||(h=l.querySelector(Oo(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=ci.get(f))&&Hf(t,n),h=l.createElement("script"),At(h),ln(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function ny(t,n,l,o){var f=(f=X.current)?vc(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=bs(l.href),l=Di(f).hoistableStyles,o=l.get(n),o||(o={type:"style",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=bs(l.href);var h=Di(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(Mo(t)))&&!h._p&&(v.instance=h,v.state.loading=5),ci.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ci.set(t,l),h||Tk(f,t,l,v.state))),n&&o===null)throw Error(r(528,""));return v}if(n&&o!==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=vs(l),l=Di(f).hoistableScripts,o=l.get(n),o||(o={type:"script",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function bs(t){return'href="'+Nt(t)+'"'}function Mo(t){return'link[rel="stylesheet"]['+t+"]"}function iy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Tk(t,n,l,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),ln(n,"link",l),At(n),t.head.appendChild(n))}function vs(t){return'[src="'+Nt(t)+'"]'}function Oo(t){return"script[async]"+t}function ay(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Nt(l.href)+'"]');if(o)return n.instance=o,At(o),o;var f=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),At(o),ln(o,"style",f),wc(o,l.precedence,t),n.instance=o;case"stylesheet":f=bs(l.href);var h=t.querySelector(Mo(f));if(h)return n.state.loading|=4,n.instance=h,At(h),h;o=iy(l),(f=ci.get(f))&&qf(o,f),h=(t.ownerDocument||t).createElement("link"),At(h);var v=h;return v._p=new Promise(function(T,I){v.onload=T,v.onerror=I}),ln(h,"link",o),n.state.loading|=4,wc(h,l.precedence,t),n.instance=h;case"script":return h=vs(l.src),(f=t.querySelector(Oo(h)))?(n.instance=f,At(f),f):(o=l,(f=ci.get(h))&&(o=x({},l),Hf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),At(f),ln(f,"link",o),t.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&&(o=n.instance,n.state.loading|=4,wc(o,l.precedence,t));return n.instance}function wc(t,n,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,v=0;v<o.length;v++){var T=o[v];if(T.dataset.precedence===n)h=T;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function qf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Hf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var kc=null;function ly(t,n,l){if(kc===null){var o=new Map,f=kc=new Map;f.set(l,o)}else f=kc,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(t))return o;for(o.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var h=l[f];if(!(h[Ai]||h[Pt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var T=o.get(v);T?T.push(h):o.set(v,[h])}}return o}function ry(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function Ek(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){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 t=n.disabled,typeof n.precedence=="string"&&t==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 sy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ak(t,n,l,o){if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=bs(o.href),h=n.querySelector(Mo(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Sc.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=h,At(h);return}h=n.ownerDocument||n,o=iy(o),(f=ci.get(f))&&qf(o,f),h=h.createElement("link"),At(h);var v=h;v._p=new Promise(function(T,I){v.onload=T,v.onerror=I}),ln(h,"link",o),l.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Sc.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var $f=0;function Nk(t,n){return t.stylesheets&&t.count===0&&Cc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var o=setTimeout(function(){if(t.stylesheets&&Cc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&$f===0&&($f=62500*uk());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Cc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>$f?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Sc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var jc=null;function Cc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,jc=new Map,n.forEach(Dk,t),jc=null,Sc.call(t))}function Dk(t,n){if(!(n.state.loading&4)){var l=jc.get(t);if(l)var o=l.get(null);else{l=new Map,jc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var v=f[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),o=v)}o&&l.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=l.get(v)||o,h===o&&l.set(null,f),l.set(v,f),this.count++,o=Sc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),h?h.parentNode.insertBefore(f,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var zo={$$typeof:$,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function Rk(t,n,l,o,f,h,v,T,I){this.tag=1,this.containerInfo=t,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=na(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=na(0),this.hiddenUpdates=na(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function oy(t,n,l,o,f,h,v,T,I,P,ne,se){return t=new Rk(t,n,l,v,I,P,ne,se,T),n=1,h===!0&&(n|=24),h=zt(3,null,null,n),t.current=h,h.stateNode=t,n=so(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:l,cache:n},ls(h),t}function uy(t){return t?(t=ga,t):ga}function cy(t,n,l,o,f,h){f=uy(f),o.context===null?o.context=f:o.pendingContext=f,o=sl(n),o.payload={element:l},h=h===void 0?null:h,h!==null&&(o.callback=h),l=ol(t,o,n),l!==null&&(On(l,t,n),po(l,t,n))}function dy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Gf(t,n){dy(t,n),(t=t.alternate)&&dy(t,n)}function fy(t){if(t.tag===13||t.tag===31){var n=Gi(t,67108864);n!==null&&On(n,t,67108864),Gf(t,67108864)}}function py(t){if(t.tag===13||t.tag===31){var n=Xn();n=Er(n);var l=Gi(t,n);l!==null&&On(l,t,n),Gf(t,n)}}var Tc=!0;function _k(t,n,l,o){var f=F.T;F.T=null;var h=oe.p;try{oe.p=2,Vf(t,n,l,o)}finally{oe.p=h,F.T=f}}function Mk(t,n,l,o){var f=F.T;F.T=null;var h=oe.p;try{oe.p=8,Vf(t,n,l,o)}finally{oe.p=h,F.T=f}}function Vf(t,n,l,o){if(Tc){var f=Ff(o);if(f===null)Df(t,n,o,Ec,l),my(t,o);else if(zk(f,t,n,l,o))o.stopPropagation();else if(my(t,o),n&4&&-1<Ok.indexOf(t)){for(;f!==null;){var h=Ni(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=Ti(h.pendingLanes);if(v!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;v;){var I=1<<31-ot(v);T.entanglements[1]|=I,v&=~I}Qi(h),(st&6)===0&&(uc=Mt()+500,No(0))}}break;case 31:case 13:T=Gi(h,2),T!==null&&On(T,h,2),dc(),Gf(h,2)}if(h=Ff(o),h===null&&Df(t,n,o,Ec,l),h===f)break;f=h}f!==null&&o.stopPropagation()}else Df(t,n,o,null,l)}}function Ff(t){return t=ra(t),Yf(t)}var Ec=null;function Yf(t){if(Ec=null,t=ni(t),t!==null){var n=c(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=d(n),t!==null)return t;t=null}else if(l===31){if(t=p(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Ec=t,null}function hy(t){switch(t){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(Ia()){case ae:return 2;case ce:return 8;case Ee:case Ue:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Pf=!1,bl=null,vl=null,wl=null,Lo=new Map,Io=new Map,kl=[],Ok="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 my(t,n){switch(t){case"focusin":case"focusout":bl=null;break;case"dragenter":case"dragleave":vl=null;break;case"mouseover":case"mouseout":wl=null;break;case"pointerover":case"pointerout":Lo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(n.pointerId)}}function Uo(t,n,l,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:l,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ni(n),n!==null&&fy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function zk(t,n,l,o,f){switch(n){case"focusin":return bl=Uo(bl,t,n,l,o,f),!0;case"dragenter":return vl=Uo(vl,t,n,l,o,f),!0;case"mouseover":return wl=Uo(wl,t,n,l,o,f),!0;case"pointerover":var h=f.pointerId;return Lo.set(h,Uo(Lo.get(h)||null,t,n,l,o,f)),!0;case"gotpointercapture":return h=f.pointerId,Io.set(h,Uo(Io.get(h)||null,t,n,l,o,f)),!0}return!1}function gy(t){var n=ni(t.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=d(l),n!==null){t.blockedOn=n,hu(t.priority,function(){py(l)});return}}else if(n===31){if(n=p(l),n!==null){t.blockedOn=n,hu(t.priority,function(){py(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ac(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Ff(t.nativeEvent);if(l===null){l=t.nativeEvent;var o=new l.constructor(l.type,l);zl=o,l.target.dispatchEvent(o),zl=null}else return n=Ni(l),n!==null&&fy(n),t.blockedOn=l,!1;n.shift()}return!0}function yy(t,n,l){Ac(t)&&l.delete(n)}function Lk(){Pf=!1,bl!==null&&Ac(bl)&&(bl=null),vl!==null&&Ac(vl)&&(vl=null),wl!==null&&Ac(wl)&&(wl=null),Lo.forEach(yy),Io.forEach(yy)}function Nc(t,n){t.blockedOn===n&&(t.blockedOn=null,Pf||(Pf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Lk)))}var Dc=null;function xy(t){Dc!==t&&(Dc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Dc===t&&(Dc=null);for(var n=0;n<t.length;n+=3){var l=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(Yf(o||l)===null)continue;break}var h=Ni(l);h!==null&&(t.splice(n,3),n-=3,Vd(h,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function ws(t){function n(I){return Nc(I,t)}bl!==null&&Nc(bl,t),vl!==null&&Nc(vl,t),wl!==null&&Nc(wl,t),Lo.forEach(n),Io.forEach(n);for(var l=0;l<kl.length;l++){var o=kl[l];o.blockedOn===t&&(o.blockedOn=null)}for(;0<kl.length&&(l=kl[0],l.blockedOn===null);)gy(l),l.blockedOn===null&&kl.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],h=l[o+1],v=f[qt]||null;if(typeof h=="function")v||xy(l);else if(v){var T=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[qt]||null)T=v.formAction;else if(Yf(f)!==null)continue}else T=v.action;typeof T=="function"?l[o+1]=T:(l.splice(o,3),o-=3),xy(l)}}}function by(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Wf(t){this._internalRoot=t}Rc.prototype.render=Wf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,o=Xn();cy(l,o,t,n,null,null)},Rc.prototype.unmount=Wf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;cy(t.current,2,null,t,null,null),dc(),n[Un]=null}};function Rc(t){this._internalRoot=t}Rc.prototype.unstable_scheduleHydration=function(t){if(t){var n=Ms();t={blockedOn:null,target:t,priority:n};for(var l=0;l<kl.length&&n!==0&&n<kl[l].priority;l++);kl.splice(l,0,t),l===0&&gy(t)}};var vy=i.version;if(vy!=="19.2.7")throw Error(r(527,vy,"19.2.7"));oe.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=m(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var Ik={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_c.isDisabled&&_c.supportsFiber)try{Yt=_c.inject(Ik),Et=_c}catch{}}return qo.createRoot=function(t,n){if(!u(t))throw Error(r(299));var l=!1,o="",f=Em,h=Am,v=Nm;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=oy(t,1,!1,null,null,l,o,null,f,h,v,by),t[Un]=n.current,Nf(t),new Wf(n)},qo.hydrateRoot=function(t,n,l){if(!u(t))throw Error(r(299));var o=!1,f="",h=Em,v=Am,T=Nm,I=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),n=oy(t,1,!0,n,l??null,o,f,I,h,v,T,by),n.context=uy(null),l=n.current,o=Xn(),o=Er(o),f=sl(o),f.callback=null,ol(l,f,o),l=o,n.current.lanes=l,qa(n,l),Qi(n),t[Un]=n.current,Nf(t),new Rc(n)},qo.version="19.2.7",qo}var Ry;function Qk(){if(Ry)return Qf.exports;Ry=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Qf.exports=Xk(),Qf.exports}var Zk=Qk();function Jk(e,i){const a=i||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const eS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nS={};function _y(e,i){return(nS.jsx?tS:eS).test(e)}const iS=/[ \t\n\f\r]/g;function aS(e){return typeof e=="object"?e.type==="text"?My(e.value):!1:My(e)}function My(e){return e.replace(iS,"")===""}class cu{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}cu.prototype.normal={};cu.prototype.property={};cu.prototype.space=void 0;function wb(e,i){const a={},r={};for(const u of e)Object.assign(a,u.property),Object.assign(r,u.normal);return new cu(a,r,i)}function Lp(e){return e.toLowerCase()}class In{constructor(i,a){this.attribute=a,this.property=i}}In.prototype.attribute="";In.prototype.booleanish=!1;In.prototype.boolean=!1;In.prototype.commaOrSpaceSeparated=!1;In.prototype.commaSeparated=!1;In.prototype.defined=!1;In.prototype.mustUseProperty=!1;In.prototype.number=!1;In.prototype.overloadedBoolean=!1;In.prototype.property="";In.prototype.spaceSeparated=!1;In.prototype.space=void 0;let lS=0;const Ie=Sr(),Vt=Sr(),Ip=Sr(),he=Sr(),yt=Sr(),xr=Sr(),Qn=Sr();function Sr(){return 2**++lS}const Up=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Vt,commaOrSpaceSeparated:Qn,commaSeparated:xr,number:he,overloadedBoolean:Ip,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),tp=Object.keys(Up);class oh extends In{constructor(i,a,r,u){let c=-1;if(super(i,a),Oy(this,"space",u),typeof r=="number")for(;++c<tp.length;){const d=tp[c];Oy(this,tp[c],(r&Up[d])===Up[d])}}}oh.prototype.defined=!0;function Oy(e,i,a){a&&(e[i]=a)}function Ns(e){const i={},a={};for(const[r,u]of Object.entries(e.properties)){const c=new oh(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[Lp(r)]=r,a[Lp(c.attribute)]=r}return new cu(i,a,e.space)}const kb=Ns({properties:{ariaActiveDescendant:null,ariaAtomic:Vt,ariaAutoComplete:null,ariaBusy:Vt,ariaChecked:Vt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Vt,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Vt,ariaFlowTo:yt,ariaGrabbed:Vt,ariaHasPopup:null,ariaHidden:Vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:he,ariaLive:null,ariaModal:Vt,ariaMultiLine:Vt,ariaMultiSelectable:Vt,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Vt,ariaReadOnly:Vt,ariaRelevant:null,ariaRequired:Vt,ariaRoleDescription:yt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Vt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Sb(e,i){return i in e?e[i]:i}function jb(e,i){return Sb(e,i.toLowerCase())}const rS=Ns({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xr,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:yt,autoFocus:Ie,autoPlay:Ie,blocking:yt,capture:null,charSet:null,checked:Ie,cite:null,className:yt,closedBy:null,colorSpace:null,cols:he,colSpan:he,command:null,commandFor:null,content:null,contentEditable:Vt,controls:Ie,controlsList:yt,coords:he|xr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:Ip,draggable:Vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:yt,height:he,hidden:Ip,high:he,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:yt,itemRef:yt,itemScope:Ie,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:he,pattern:null,ping:yt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:yt,required:Ie,reversed:Ie,rows:he,rowSpan:he,sandbox:yt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Vt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Vt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:xr,part:yt,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:jb}),sS=Ns({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:Qn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xr,g2:xr,glyphName:xr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:Qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qn,rev:Qn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qn,requiredFeatures:Qn,requiredFonts:Qn,requiredFormats:Qn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:Qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sb}),Cb=Ns({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),Tb=Ns({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jb}),Eb=Ns({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),oS={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"},uS=/[A-Z]/g,zy=/-[a-z]/g,cS=/^data[-\w.:]+$/i;function dS(e,i){const a=Lp(i);let r=i,u=In;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&cS.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(zy,pS);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!zy.test(c)){let d=c.replace(uS,fS);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=oh}return new u(r,i)}function fS(e){return"-"+e.toLowerCase()}function pS(e){return e.charAt(1).toUpperCase()}const hS=wb([kb,rS,Cb,Tb,Eb],"html"),uh=wb([kb,sS,Cb,Tb,Eb],"svg");function mS(e){return e.join(" ").trim()}var ks={},np,Ly;function gS(){if(Ly)return np;Ly=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
|
|
51
|
-
`,m="/",b="*",x="",S="comment",w="declaration";function E(H,R){if(typeof H!="string")throw new TypeError("First argument must be a string");if(!H)return[];R=R||{};var q=1,$=1;function V(ye){var ue=ye.match(i);ue&&(q+=ue.length);var F=ye.lastIndexOf(g);$=~F?ye.length-F:$+ye.length}function ie(){var ye={line:q,column:$};return function(ue){return ue.position=new N(ye),ee(),ue}}function N(ye){this.start=ye,this.end={line:q,column:$},this.source=R.source}N.prototype.content=H;function Q(ye){var ue=new Error(R.source+":"+q+":"+$+": "+ye);if(ue.reason=ye,ue.filename=R.source,ue.line=q,ue.column=$,ue.source=H,!R.silent)throw ue}function re(ye){var ue=ye.exec(H);if(ue){var F=ue[0];return V(F),H=H.slice(F.length),ue}}function ee(){re(a)}function L(ye){var ue;for(ye=ye||[];ue=te();)ue!==!1&&ye.push(ue);return ye}function te(){var ye=ie();if(!(m!=H.charAt(0)||b!=H.charAt(1))){for(var ue=2;x!=H.charAt(ue)&&(b!=H.charAt(ue)||m!=H.charAt(ue+1));)++ue;if(ue+=2,x===H.charAt(ue-1))return Q("End of comment missing");var F=H.slice(2,ue-2);return $+=2,V(F),H=H.slice(ue),$+=2,ye({type:S,comment:F})}}function de(){var ye=ie(),ue=re(r);if(ue){if(te(),!re(u))return Q("property missing ':'");var F=re(c),oe=ye({type:w,property:M(ue[0].replace(e,x)),value:F?M(F[0].replace(e,x)):x});return re(d),oe}}function Ne(){var ye=[];L(ye);for(var ue;ue=de();)ue!==!1&&(ye.push(ue),L(ye));return ye}return ee(),Ne()}function M(H){return H?H.replace(p,x):x}return np=E,np}var Iy;function yS(){if(Iy)return ks;Iy=1;var e=ks&&ks.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=a;const i=e(gS());function a(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return ks}var Ho={},Uy;function xS(){if(Uy)return Ho;Uy=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.camelCase=void 0;var e=/^--[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)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=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,p):m=m.replace(r,p),m.replace(i,d))};return Ho.camelCase=g,Ho}var $o,By;function bS(){if(By)return $o;By=1;var e=$o&&$o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(yS()),a=xS();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,g){p&&g&&(d[(0,a.camelCase)(p,c)]=g)}),d}return r.default=r,$o=r,$o}var vS=bS();const wS=vb(vS),Ab=Nb("end"),ch=Nb("start");function Nb(e){return i;function i(a){const r=a&&a.position&&a.position[e]||{};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 kS(e){const i=ch(e),a=Ab(e);if(i&&a)return{start:i,end:a}}function eu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qy(e.position):"start"in e||"end"in e?qy(e):"line"in e||"column"in e?Bp(e):""}function Bp(e){return Hy(e&&e.line)+":"+Hy(e&&e.column)}function qy(e){return Bp(e&&e.start)+"-"+Bp(e&&e.end)}function Hy(e){return e&&typeof e=="number"?e:1}class pn 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 p=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=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=p?p.line:void 0,this.name=eu(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}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const dh={}.hasOwnProperty,SS=new Map,jS=/[A-Z]/g,CS=new Set(["table","tbody","thead","tfoot","tr"]),TS=new Set(["td","th"]),Db="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ES(e,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=zS(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=OS(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"?uh:hS,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=Rb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function Rb(e,i,a){if(i.type==="element")return AS(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return NS(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return RS(e,i,a);if(i.type==="mdxjsEsm")return DS(e,i);if(i.type==="root")return _S(e,i,a);if(i.type==="text")return MS(e,i)}function AS(e,i,a){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=uh,e.schema=u),e.ancestors.push(i);const c=Mb(e,i.tagName,!1),d=LS(e,i);let p=ph(e,i);return CS.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!aS(g):!0})),_b(e,d,c,i),fh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function NS(e,i){if(i.data&&i.data.estree&&e.evaluater){const r=i.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ou(e,i.position)}function DS(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);ou(e,i.position)}function RS(e,i,a){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=uh,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:Mb(e,i.name,!0),d=IS(e,i),p=ph(e,i);return _b(e,d,c,i),fh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function _S(e,i,a){const r={};return fh(r,ph(e,i)),e.create(i,e.Fragment,r,a)}function MS(e,i){return i.value}function _b(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function fh(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function OS(e,i,a){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?a:i;return p?m(c,d,p):m(c,d)}}function zS(e,i){return a;function a(r,u,c,d){const p=Array.isArray(c.children),g=ch(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function LS(e,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&dh.call(i.properties,u)){const c=US(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&TS.has(i.tagName)?r=p:a[d]=p}}if(r){const c=a.style||(a.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function IS(e,i){const a={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const p=d.properties[0];p.type,Object.assign(a,e.evaluater.evaluateExpression(p.argument))}else ou(e,i.position);else{const u=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const p=r.value.data.estree.body[0];p.type,c=e.evaluater.evaluateExpression(p.expression)}else ou(e,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function ph(e,i){const a=[];let r=-1;const u=e.passKeys?new Map:SS;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.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 p=Rb(e,c,d);p!==void 0&&a.push(p)}return a}function US(e,i,a){const r=dS(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?Jk(a):mS(a)),r.property==="style"){let u=typeof a=="object"?a:BS(e,String(a));return e.stylePropertyNameCase==="css"&&(u=qS(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?oS[r.property]||r.property:r.attribute,a]}}function BS(e,i){try{return wS(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,u=new pn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=e.filePath||void 0,u.url=Db+"#cannot-parse-style-attribute",u}}function Mb(e,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 p=_y(u[c])?{type:"Identifier",name:u[c]}:{type:"Literal",value:u[c]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(c&&p.type==="Literal"),optional:!1}:p}r=d}else r=_y(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return dh.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);ou(e)}function ou(e,i){const a=new pn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Db+"#cannot-handle-mdx-estrees-without-createevaluater",a}function qS(e){const i={};let a;for(a in e)dh.call(e,a)&&(i[HS(a)]=e[a]);return i}function HS(e){let i=e.replace(jS,$S);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function $S(e){return"-"+e.toLowerCase()}const ip={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"]},GS={};function hh(e,i){const a=GS,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Ob(e,r,u)}function Ob(e,i,a){if(VS(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return $y(e.children,i,a)}return Array.isArray(e)?$y(e,i,a):""}function $y(e,i,a){const r=[];let u=-1;for(;++u<e.length;)r[u]=Ob(e[u],i,a);return r.join("")}function VS(e){return!!(e&&typeof e=="object")}const Gy=document.createElement("i");function mh(e){const i="&"+e+";";Gy.innerHTML=i;const a=Gy.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Zn(e,i,a,r){const u=e.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),e.splice(...d);else for(a&&e.splice(i,a);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function di(e,i){return e.length>0?(Zn(e,e.length,0,i),e):i}const Vy={}.hasOwnProperty;function zb(e){const i={};let a=-1;for(;++a<e.length;)FS(i,e[a]);return i}function FS(e,i){let a;for(a in i){const u=(Vy.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){Vy.call(u,d)||(u[d]=[]);const p=c[d];YS(u[d],Array.isArray(p)?p:p?[p]:[])}}}function YS(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Zn(e,0,0,r)}function Lb(e,i){const a=Number.parseInt(e,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 Si(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vn=Nl(/[A-Za-z]/),fn=Nl(/[\dA-Za-z]/),PS=Nl(/[#-'*+\--9=?A-Z^-~]/);function Zc(e){return e!==null&&(e<32||e===127)}const qp=Nl(/\d/),WS=Nl(/[\dA-Fa-f]/),KS=Nl(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const rd=Nl(new RegExp("\\p{P}|\\p{S}","u")),br=Nl(/\s/);function Nl(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Ds(e){const i=[];let a=-1,r=0,u=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&fn(e.charCodeAt(a+1))&&fn(e.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 p=e.charCodeAt(a+1);c<56320&&p>56319&&p<57344?(d=String.fromCharCode(c,p),u=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(e.slice(r,a),encodeURIComponent(d)),r=a+u+1,d=""),u&&(a+=u,u=0)}return i.join("")+e.slice(r)}function et(e,i,a,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return Ke(g)?(e.enter(a),p(g)):i(g)}function p(g){return Ke(g)&&c++<u?(e.consume(g),p):(e.exit(a),i(g))}}const XS={tokenize:QS};function QS(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let a;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),et(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const g=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=g),a=g,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return Oe(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const ZS={tokenize:JS},Fy={tokenize:ej};function JS(e){const i=this,a=[];let r=0,u,c,d;return p;function p($){if(r<a.length){const V=a[r];return i.containerState=V[1],e.attempt(V[0].continuation,g,m)($)}return m($)}function g($){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&q();const V=i.events.length;let ie=V,N;for(;ie--;)if(i.events[ie][0]==="exit"&&i.events[ie][1].type==="chunkFlow"){N=i.events[ie][1].end;break}R(r);let Q=V;for(;Q<i.events.length;)i.events[Q][1].end={...N},Q++;return Zn(i.events,ie+1,0,i.events.slice(V)),i.events.length=Q,m($)}return p($)}function m($){if(r===a.length){if(!u)return S($);if(u.currentConstruct&&u.currentConstruct.concrete)return E($);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Fy,b,x)($)}function b($){return u&&q(),R(r),S($)}function x($){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,E($)}function S($){return i.containerState={},e.attempt(Fy,w,E)($)}function w($){return r++,a.push([i.currentConstruct,i.containerState]),S($)}function E($){if($===null){u&&q(),R(0),e.consume($);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),M($)}function M($){if($===null){H(e.exit("chunkFlow"),!0),R(0),e.consume($);return}return Oe($)?(e.consume($),H(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume($),M)}function H($,V){const ie=i.sliceStream($);if(V&&ie.push(null),$.previous=c,c&&(c.next=$),c=$,u.defineSkip($.start),u.write(ie),i.parser.lazy[$.start.line]){let N=u.events.length;for(;N--;)if(u.events[N][1].start.offset<d&&(!u.events[N][1].end||u.events[N][1].end.offset>d))return;const Q=i.events.length;let re=Q,ee,L;for(;re--;)if(i.events[re][0]==="exit"&&i.events[re][1].type==="chunkFlow"){if(ee){L=i.events[re][1].end;break}ee=!0}for(R(r),N=Q;N<i.events.length;)i.events[N][1].end={...L},N++;Zn(i.events,re+1,0,i.events.slice(Q)),i.events.length=N}}function R($){let V=a.length;for(;V-- >$;){const ie=a[V];i.containerState=ie[1],ie[0].exit.call(i,e)}a.length=$}function q(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function ej(e,i,a){return et(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Es(e){if(e===null||xt(e)||br(e))return 1;if(rd(e))return 2}function sd(e,i,a){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,a),r.push(c))}return i}const Hp={name:"attention",resolveAll:tj,tokenize:nj};function tj(e,i){let a=-1,r,u,c,d,p,g,m,b;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const x={...e[r][1].end},S={...e[a][1].start};Yy(x,-g),Yy(S,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:S},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[a][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=di(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=di(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=di(m,sd(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),m=di(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,m=di(m,[["enter",e[a][1],i],["exit",e[a][1],i]])):b=0,Zn(e,r-1,a-r+3,m),a=r+m.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function nj(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=Es(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=Es(g),x=!b||b===2&&u||a.includes(g),S=!u||u===2&&b||a.includes(r);return m._open=!!(c===42?x:x&&(u||!S)),m._close=!!(c===42?S:S&&(b||!x)),i(g)}}function Yy(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const ij={name:"autolink",tokenize:aj};function aj(e,i,a){let r=0;return u;function u(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(w){return vn(w)?(e.consume(w),d):w===64?a(w):m(w)}function d(w){return w===43||w===45||w===46||fn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||fn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||Zc(w)?a(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):PS(w)?(e.consume(w),m):a(w)}function b(w){return fn(w)?x(w):a(w)}function x(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):S(w)}function S(w){if((w===45||fn(w))&&r++<63){const E=w===45?S:x;return e.consume(w),E}return a(w)}}const du={partial:!0,tokenize:lj};function lj(e,i,a){return r;function r(c){return Ke(c)?et(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Oe(c)?i(c):a(c)}}const Ib={continuation:{tokenize:sj},exit:oj,name:"blockQuote",tokenize:rj};function rj(e,i,a){const r=this;return u;function u(d){if(d===62){const p=r.containerState;return p.open||(e.enter("blockQuote",{_container:!0}),p.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return a(d)}function c(d){return Ke(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function sj(e,i,a){const r=this;return u;function u(d){return Ke(d)?et(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(Ib,i,a)(d)}}function oj(e){e.exit("blockQuote")}const Ub={name:"characterEscape",tokenize:uj};function uj(e,i,a){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return KS(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const Bb={name:"characterReference",tokenize:cj};function cj(e,i,a){const r=this;let u=0,c,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),g}function g(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=fn,b(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=WS,b):(e.enter("characterReferenceValue"),c=7,d=qp,b(x))}function b(x){if(x===59&&u){const S=e.exit("characterReferenceValue");return d===fn&&!mh(r.sliceSerialize(S))?a(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&u++<c?(e.consume(x),b):a(x)}}const Py={partial:!0,tokenize:fj},Wy={concrete:!0,name:"codeFenced",tokenize:dj};function dj(e,i,a){const r=this,u={partial:!0,tokenize:ie};let c=0,d=0,p;return g;function g(N){return m(N)}function m(N){const Q=r.events[r.events.length-1];return c=Q&&Q[1].type==="linePrefix"?Q[2].sliceSerialize(Q[1],!0).length:0,p=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(N)}function b(N){return N===p?(d++,e.consume(N),b):d<3?a(N):(e.exit("codeFencedFenceSequence"),Ke(N)?et(e,x,"whitespace")(N):x(N))}function x(N){return N===null||Oe(N)?(e.exit("codeFencedFence"),r.interrupt?i(N):e.check(Py,M,V)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),S(N))}function S(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(N)):Ke(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,w,"whitespace")(N)):N===96&&N===p?a(N):(e.consume(N),S)}function w(N){return N===null||Oe(N)?x(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(N))}function E(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(N)):N===96&&N===p?a(N):(e.consume(N),E)}function M(N){return e.attempt(u,V,H)(N)}function H(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),R}function R(N){return c>0&&Ke(N)?et(e,q,"linePrefix",c+1)(N):q(N)}function q(N){return N===null||Oe(N)?e.check(Py,M,V)(N):(e.enter("codeFlowValue"),$(N))}function $(N){return N===null||Oe(N)?(e.exit("codeFlowValue"),q(N)):(e.consume(N),$)}function V(N){return e.exit("codeFenced"),i(N)}function ie(N,Q,re){let ee=0;return L;function L(ue){return N.enter("lineEnding"),N.consume(ue),N.exit("lineEnding"),te}function te(ue){return N.enter("codeFencedFence"),Ke(ue)?et(N,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):de(ue)}function de(ue){return ue===p?(N.enter("codeFencedFenceSequence"),Ne(ue)):re(ue)}function Ne(ue){return ue===p?(ee++,N.consume(ue),Ne):ee>=d?(N.exit("codeFencedFenceSequence"),Ke(ue)?et(N,ye,"whitespace")(ue):ye(ue)):re(ue)}function ye(ue){return ue===null||Oe(ue)?(N.exit("codeFencedFence"),Q(ue)):re(ue)}}}function fj(e,i,a){const r=this;return u;function u(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}const ap={name:"codeIndented",tokenize:hj},pj={partial:!0,tokenize:mj};function hj(e,i,a){const r=this;return u;function u(m){return e.enter("codeIndented"),et(e,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):Oe(m)?e.attempt(pj,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||Oe(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function mj(e,i,a){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?a(d):Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):et(e,c,"linePrefix",5)(d)}function c(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):Oe(d)?u(d):a(d)}}const gj={name:"codeText",previous:xj,resolve:yj,tokenize:bj};function yj(e){let i=e.length-4,a=3,r,u;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=a;++r<i;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(r=a-1,i++;++r<=i;)u===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(u=r):(r===i||e[r][1].type==="lineEnding")&&(e[u][1].type="codeTextData",r!==u+2&&(e[u][1].end=e[r-1][1].end,e.splice(u+2,r-u-2),i-=r-u-2,r=u+2),u=void 0);return e}function xj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bj(e,i,a){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),g(x))}function g(x){return x===null?a(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),g):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):Oe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Oe(x)?(e.exit("codeTextData"),g(x)):(e.consume(x),m)}function b(x){return x===96?(e.consume(x),u++,b):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(x)):(c.type="codeTextData",m(x))}}class vj{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&&Go(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),Go(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Go(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);Go(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Go(this.left,a.reverse())}}}function Go(e,i){let a=0;if(i.length<1e4)e.push(...i);else for(;a<i.length;)e.push(...i.slice(a,a+1e4)),a+=1e4}function qb(e){const i={};let a=-1,r,u,c,d,p,g,m;const b=new vj(e);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,wj(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},p=b.slice(u,a),p.unshift(r),b.splice(u,a-u+1,p))}}return Zn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function wj(e,i){const a=e.get(i)[1],r=e.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 p=d.events,g=[],m={};let b,x,S=-1,w=a,E=0,M=0;const H=[M];for(;w;){for(;e.get(++u)[1]!==w;);c.push(u),w._tokenizer||(b=r.sliceStream(w),w.next||b.push(null),x&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=w,w=w.next}for(w=a;++S<p.length;)p[S][0]==="exit"&&p[S-1][0]==="enter"&&p[S][1].type===p[S-1][1].type&&p[S][1].start.line!==p[S][1].end.line&&(M=S+1,H.push(M),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):H.pop(),S=H.length;S--;){const R=p.slice(H[S],H[S+1]),q=c.pop();g.push([q,q+R.length-1]),e.splice(q,2,R)}for(g.reverse(),S=-1;++S<g.length;)m[E+g[S][0]]=E+g[S][1],E+=g[S][1]-g[S][0]-1;return m}const kj={resolve:jj,tokenize:Cj},Sj={partial:!0,tokenize:Tj};function jj(e){return qb(e),e}function Cj(e,i){let a;return r;function r(p){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),u(p)}function u(p){return p===null?c(p):Oe(p)?e.check(Sj,d,c)(p):(e.consume(p),u)}function c(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function Tj(e,i,a){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),et(e,c,"linePrefix")}function c(d){if(d===null||Oe(d))return a(d);const p=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):e.interrupt(r.parser.constructs.flow,a,i)(d)}}function Hb(e,i,a,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(R){return R===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(R),e.exit(c),S):R===null||R===32||R===41||Zc(R)?a(R):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),M(R))}function S(R){return R===62?(e.enter(c),e.consume(R),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(R))}function w(R){return R===62?(e.exit("chunkString"),e.exit(p),S(R)):R===null||R===60||Oe(R)?a(R):(e.consume(R),R===92?E:w)}function E(R){return R===60||R===62||R===92?(e.consume(R),w):w(R)}function M(R){return!b&&(R===null||R===41||xt(R))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(R)):b<m&&R===40?(e.consume(R),b++,M):R===41?(e.consume(R),b--,M):R===null||R===32||R===40||Zc(R)?a(R):(e.consume(R),R===92?H:M)}function H(R){return R===40||R===41||R===92?(e.consume(R),M):M(R)}}function $b(e,i,a,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?a(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):Oe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||w===91||w===93||Oe(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!Ke(w)),w===92?S:x)}function S(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Gb(e,i,a,r,u,c){let d;return p;function p(S){return S===34||S===39||S===40?(e.enter(r),e.enter(u),e.consume(S),e.exit(u),d=S===40?41:S,g):a(S)}function g(S){return S===d?(e.enter(u),e.consume(S),e.exit(u),e.exit(r),i):(e.enter(c),m(S))}function m(S){return S===d?(e.exit(c),g(d)):S===null?a(S):Oe(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),et(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===d||S===null||Oe(S)?(e.exit("chunkString"),m(S)):(e.consume(S),S===92?x:b)}function x(S){return S===d||S===92?(e.consume(S),b):b(S)}}function tu(e,i){let a;return r;function r(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a=!0,r):Ke(u)?et(e,r,a?"linePrefix":"lineSuffix")(u):i(u)}}const Ej={name:"definition",tokenize:Nj},Aj={partial:!0,tokenize:Dj};function Nj(e,i,a){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return $b.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=Si(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),g):a(w)}function g(w){return xt(w)?tu(e,m)(w):m(w)}function m(w){return Hb(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(Aj,x,x)(w)}function x(w){return Ke(w)?et(e,S,"whitespace")(w):S(w)}function S(w){return w===null||Oe(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):a(w)}}function Dj(e,i,a){return r;function r(p){return xt(p)?tu(e,u)(p):a(p)}function u(p){return Gb(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return Ke(p)?et(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Oe(p)?i(p):a(p)}}const Rj={name:"hardBreakEscape",tokenize:_j};function _j(e,i,a){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Oe(c)?(e.exit("hardBreakEscape"),i(c)):a(c)}}const Mj={name:"headingAtx",resolve:Oj,tokenize:zj};function Oj(e,i){let a=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},c={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},Zn(e,r,a-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function zj(e,i,a){let r=0;return u;function u(b){return e.enter("atxHeading"),c(b)}function c(b){return e.enter("atxHeadingSequence"),d(b)}function d(b){return b===35&&r++<6?(e.consume(b),d):b===null||xt(b)?(e.exit("atxHeadingSequence"),p(b)):a(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Oe(b)?(e.exit("atxHeading"),i(b)):Ke(b)?et(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||xt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const Lj=["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"],Ky=["pre","script","style","textarea"],Ij={concrete:!0,name:"htmlFlow",resolveTo:qj,tokenize:Hj},Uj={partial:!0,tokenize:Gj},Bj={partial:!0,tokenize:$j};function qj(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function Hj(e,i,a){const r=this;let u,c,d,p,g;return m;function m(C){return b(C)}function b(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),x}function x(C){return C===33?(e.consume(C),S):C===47?(e.consume(C),c=!0,M):C===63?(e.consume(C),u=3,r.interrupt?i:O):vn(C)?(e.consume(C),d=String.fromCharCode(C),H):a(C)}function S(C){return C===45?(e.consume(C),u=2,w):C===91?(e.consume(C),u=5,p=0,E):vn(C)?(e.consume(C),u=4,r.interrupt?i:O):a(C)}function w(C){return C===45?(e.consume(C),r.interrupt?i:O):a(C)}function E(C){const W="CDATA[";return C===W.charCodeAt(p++)?(e.consume(C),p===W.length?r.interrupt?i:de:E):a(C)}function M(C){return vn(C)?(e.consume(C),d=String.fromCharCode(C),H):a(C)}function H(C){if(C===null||C===47||C===62||xt(C)){const W=C===47,fe=d.toLowerCase();return!W&&!c&&Ky.includes(fe)?(u=1,r.interrupt?i(C):de(C)):Lj.includes(d.toLowerCase())?(u=6,W?(e.consume(C),R):r.interrupt?i(C):de(C)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(C):c?q(C):$(C))}return C===45||fn(C)?(e.consume(C),d+=String.fromCharCode(C),H):a(C)}function R(C){return C===62?(e.consume(C),r.interrupt?i:de):a(C)}function q(C){return Ke(C)?(e.consume(C),q):L(C)}function $(C){return C===47?(e.consume(C),L):C===58||C===95||vn(C)?(e.consume(C),V):Ke(C)?(e.consume(C),$):L(C)}function V(C){return C===45||C===46||C===58||C===95||fn(C)?(e.consume(C),V):ie(C)}function ie(C){return C===61?(e.consume(C),N):Ke(C)?(e.consume(C),ie):$(C)}function N(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),g=C,Q):Ke(C)?(e.consume(C),N):re(C)}function Q(C){return C===g?(e.consume(C),g=null,ee):C===null||Oe(C)?a(C):(e.consume(C),Q)}function re(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||xt(C)?ie(C):(e.consume(C),re)}function ee(C){return C===47||C===62||Ke(C)?$(C):a(C)}function L(C){return C===62?(e.consume(C),te):a(C)}function te(C){return C===null||Oe(C)?de(C):Ke(C)?(e.consume(C),te):a(C)}function de(C){return C===45&&u===2?(e.consume(C),F):C===60&&u===1?(e.consume(C),oe):C===62&&u===4?(e.consume(C),A):C===63&&u===3?(e.consume(C),O):C===93&&u===5?(e.consume(C),_e):Oe(C)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(Uj,z,Ne)(C)):C===null||Oe(C)?(e.exit("htmlFlowData"),Ne(C)):(e.consume(C),de)}function Ne(C){return e.check(Bj,ye,z)(C)}function ye(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ue}function ue(C){return C===null||Oe(C)?Ne(C):(e.enter("htmlFlowData"),de(C))}function F(C){return C===45?(e.consume(C),O):de(C)}function oe(C){return C===47?(e.consume(C),d="",ve):de(C)}function ve(C){if(C===62){const W=d.toLowerCase();return Ky.includes(W)?(e.consume(C),A):de(C)}return vn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),ve):de(C)}function _e(C){return C===93?(e.consume(C),O):de(C)}function O(C){return C===62?(e.consume(C),A):C===45&&u===2?(e.consume(C),O):de(C)}function A(C){return C===null||Oe(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),A)}function z(C){return e.exit("htmlFlow"),i(C)}}function $j(e,i,a){const r=this;return u;function u(d){return Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):a(d)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}function Gj(e,i,a){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(du,i,a)}}const Vj={name:"htmlText",tokenize:Fj};function Fj(e,i,a){const r=this;let u,c,d;return p;function p(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),ie):O===63?(e.consume(O),$):vn(O)?(e.consume(O),re):a(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,E):vn(O)?(e.consume(O),q):a(O)}function b(O){return O===45?(e.consume(O),w):a(O)}function x(O){return O===null?a(O):O===45?(e.consume(O),S):Oe(O)?(d=x,oe(O)):(e.consume(O),x)}function S(O){return O===45?(e.consume(O),w):x(O)}function w(O){return O===62?F(O):O===45?S(O):x(O)}function E(O){const A="CDATA[";return O===A.charCodeAt(c++)?(e.consume(O),c===A.length?M:E):a(O)}function M(O){return O===null?a(O):O===93?(e.consume(O),H):Oe(O)?(d=M,oe(O)):(e.consume(O),M)}function H(O){return O===93?(e.consume(O),R):M(O)}function R(O){return O===62?F(O):O===93?(e.consume(O),R):M(O)}function q(O){return O===null||O===62?F(O):Oe(O)?(d=q,oe(O)):(e.consume(O),q)}function $(O){return O===null?a(O):O===63?(e.consume(O),V):Oe(O)?(d=$,oe(O)):(e.consume(O),$)}function V(O){return O===62?F(O):$(O)}function ie(O){return vn(O)?(e.consume(O),N):a(O)}function N(O){return O===45||fn(O)?(e.consume(O),N):Q(O)}function Q(O){return Oe(O)?(d=Q,oe(O)):Ke(O)?(e.consume(O),Q):F(O)}function re(O){return O===45||fn(O)?(e.consume(O),re):O===47||O===62||xt(O)?ee(O):a(O)}function ee(O){return O===47?(e.consume(O),F):O===58||O===95||vn(O)?(e.consume(O),L):Oe(O)?(d=ee,oe(O)):Ke(O)?(e.consume(O),ee):F(O)}function L(O){return O===45||O===46||O===58||O===95||fn(O)?(e.consume(O),L):te(O)}function te(O){return O===61?(e.consume(O),de):Oe(O)?(d=te,oe(O)):Ke(O)?(e.consume(O),te):ee(O)}function de(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),u=O,Ne):Oe(O)?(d=de,oe(O)):Ke(O)?(e.consume(O),de):(e.consume(O),ye)}function Ne(O){return O===u?(e.consume(O),u=void 0,ue):O===null?a(O):Oe(O)?(d=Ne,oe(O)):(e.consume(O),Ne)}function ye(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||xt(O)?ee(O):(e.consume(O),ye)}function ue(O){return O===47||O===62||xt(O)?ee(O):a(O)}function F(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):a(O)}function oe(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ve}function ve(O){return Ke(O)?et(e,_e,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):_e(O)}function _e(O){return e.enter("htmlTextData"),d(O)}}const gh={name:"labelEnd",resolveAll:Kj,resolveTo:Xj,tokenize:Qj},Yj={tokenize:Zj},Pj={tokenize:Jj},Wj={tokenize:e0};function Kj(e){let i=-1;const a=[];for(;++i<e.length;){const r=e[i][1];if(a.push(e[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",i+=u}}return e.length!==a.length&&Zn(e,0,e.length,a),e}function Xj(e,i){let a=e.length,r=0,u,c,d,p;for(;a--;)if(u=e[a][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[a][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[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:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=di(p,e.slice(c+1,c+r+3)),p=di(p,[["enter",b,i]]),p=di(p,sd(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=di(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=di(p,e.slice(d+1)),p=di(p,[["exit",g,i]]),Zn(e,c,e.length,p),e}function Qj(e,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 p;function p(S){return c?c._inactive?x(S):(d=r.parser.defined.includes(Si(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(S),e.exit("labelMarker"),e.exit("labelEnd"),g):a(S)}function g(S){return S===40?e.attempt(Yj,b,d?b:x)(S):S===91?e.attempt(Pj,b,d?m:x)(S):d?b(S):x(S)}function m(S){return e.attempt(Wj,b,x)(S)}function b(S){return i(S)}function x(S){return c._balanced=!0,a(S)}}function Zj(e,i,a){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),u}function u(x){return xt(x)?tu(e,c)(x):c(x)}function c(x){return x===41?b(x):Hb(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return xt(x)?tu(e,g)(x):b(x)}function p(x){return a(x)}function g(x){return x===34||x===39||x===40?Gb(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return xt(x)?tu(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):a(x)}}function Jj(e,i,a){const r=this;return u;function u(p){return $b.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(Si(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function e0(e,i,a){return r;function r(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),u}function u(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),i):a(c)}}const t0={name:"labelStartImage",resolveAll:gh.resolveAll,tokenize:n0};function n0(e,i,a){const r=this;return u;function u(p){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(p),e.exit("labelImageMarker"),c}function c(p){return p===91?(e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelImage"),d):a(p)}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(p):i(p)}}const i0={name:"labelStartLink",resolveAll:gh.resolveAll,tokenize:a0};function a0(e,i,a){const r=this;return u;function u(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(d):i(d)}}const lp={name:"lineEnding",tokenize:l0};function l0(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,i,"linePrefix")}}const Yc={name:"thematicBreak",tokenize:r0};function r0(e,i,a){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Oe(m))?(e.exit("thematicBreak"),i(m)):a(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),Ke(m)?et(e,p,"whitespace")(m):p(m))}}const zn={continuation:{tokenize:c0},exit:f0,name:"list",tokenize:u0},s0={partial:!0,tokenize:p0},o0={partial:!0,tokenize:d0};function u0(e,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 p;function p(w){const E=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:qp(w)){if(r.containerState.type||(r.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Yc,a,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return a(w)}function g(w){return qp(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):a(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(du,r.interrupt?a:b,e.attempt(s0,S,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,S(w)}function x(w){return Ke(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),S):a(w)}function S(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function c0(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(du,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(e,i,"listItemIndent",r.containerState.size+1)(p)}function c(p){return r.containerState.furtherBlankLines||!Ke(p)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(p)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(o0,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(zn,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function d0(e,i,a){const r=this;return et(e,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 f0(e){e.exit(this.containerState.type)}function p0(e,i,a){const r=this;return et(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!Ke(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):a(c)}}const Xy={name:"setextUnderline",resolveTo:h0,tokenize:m0};function h0(e,i){let a=e.length,r,u,c;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(u=a)}else e[a][1].type==="content"&&e.splice(a,1),!c&&e[a][1].type==="definition"&&(c=a);const d={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[u][1].type="setextHeadingText",c?(e.splice(u,0,["enter",d,i]),e.splice(c+1,0,["exit",e[r][1],i]),e[r][1].end={...e[c][1].end}):e[r][1]=d,e.push(["exit",d,i]),e}function m0(e,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)?(e.enter("setextHeadingLine"),u=m,d(m)):a(m)}function d(m){return e.enter("setextHeadingLineSequence"),p(m)}function p(m){return m===u?(e.consume(m),p):(e.exit("setextHeadingLineSequence"),Ke(m)?et(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Oe(m)?(e.exit("setextHeadingLine"),i(m)):a(m)}}const g0={tokenize:y0};function y0(e){const i=this,a=e.attempt(du,r,e.attempt(this.parser.constructs.flowInitial,u,et(e,e.attempt(this.parser.constructs.flow,u,e.attempt(kj,u)),"linePrefix")));return a;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const x0={resolveAll:Fb()},b0=Vb("string"),v0=Vb("text");function Vb(e){return{resolveAll:Fb(e==="text"?w0:void 0),tokenize:i};function i(a){const r=this,u=this.parser.constructs[e],c=a.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(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 S=-1;if(x)for(;++S<x.length;){const w=x[S];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Fb(e){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 e?e(a,r):a}}function w0(e,i){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(p=0),p){const m={type:a===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(a,0,["enter",m,i],["exit",m,i]),a+=2)}a++}return e}const k0={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:Ib},S0={91:Ej},j0={[-2]:ap,[-1]:ap,32:ap},C0={35:Mj,42:Yc,45:[Xy,Yc],60:Ij,61:Xy,95:Yc,96:Wy,126:Wy},T0={38:Bb,92:Ub},E0={[-5]:lp,[-4]:lp,[-3]:lp,33:t0,38:Bb,42:Hp,60:[ij,Vj],91:i0,92:[Rj,Ub],93:gh,95:Hp,96:gj},A0={null:[Hp,x0]},N0={null:[42,95]},D0={null:[]},R0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:N0,contentInitial:S0,disable:D0,document:k0,flow:C0,flowInitial:j0,insideSpan:A0,string:T0,text:E0},Symbol.toStringTag,{value:"Module"}));function _0(e,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=[],p=[];const g={attempt:Q(ie),check:Q(N),consume:q,enter:$,exit:V,interrupt:Q(N,{interrupt:!0})},m={code:null,containerState:{},defineSkip:M,events:[],now:E,parser:e,previous:null,sliceSerialize:S,sliceStream:w,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(te){return d=di(d,te),H(),d[d.length-1]!==null?[]:(re(i,0),m.events=sd(c,m.events,m),m.events)}function S(te,de){return O0(w(te),de)}function w(te){return M0(d,te)}function E(){const{_bufferIndex:te,_index:de,line:Ne,column:ye,offset:ue}=r;return{_bufferIndex:te,_index:de,line:Ne,column:ye,offset:ue}}function M(te){u[te.line]=te.column,L()}function H(){let te;for(;r._index<d.length;){const de=d[r._index];if(typeof de=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<de.length;)R(de.charCodeAt(r._bufferIndex));else R(de)}}function R(te){b=b(te)}function q(te){Oe(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,L()):te!==-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=te}function $(te,de){const Ne=de||{};return Ne.type=te,Ne.start=E(),m.events.push(["enter",Ne,m]),p.push(Ne),Ne}function V(te){const de=p.pop();return de.end=E(),m.events.push(["exit",de,m]),de}function ie(te,de){re(te,de.from)}function N(te,de){de.restore()}function Q(te,de){return Ne;function Ne(ye,ue,F){let oe,ve,_e,O;return Array.isArray(ye)?z(ye):"tokenize"in ye?z([ye]):A(ye);function A(X){return xe;function xe(Me){const Ve=Me!==null&&X[Me],Ct=Me!==null&&X.null,vt=[...Array.isArray(Ve)?Ve:Ve?[Ve]:[],...Array.isArray(Ct)?Ct:Ct?[Ct]:[]];return z(vt)(Me)}}function z(X){return oe=X,ve=0,X.length===0?F:C(X[ve])}function C(X){return xe;function xe(Me){return O=ee(),_e=X,X.partial||(m.currentConstruct=X),X.name&&m.parser.constructs.disable.null.includes(X.name)?fe():X.tokenize.call(de?Object.assign(Object.create(m),de):m,g,W,fe)(Me)}}function W(X){return te(_e,O),ue}function fe(X){return O.restore(),++ve<oe.length?C(oe[ve]):F}}}function re(te,de){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Zn(m.events,de,m.events.length-de,te.resolve(m.events.slice(de),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function ee(){const te=E(),de=m.previous,Ne=m.currentConstruct,ye=m.events.length,ue=Array.from(p);return{from:ye,restore:F};function F(){r=te,m.previous=de,m.currentConstruct=Ne,m.events.length=ye,p=ue,L()}}function L(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function M0(e,i){const a=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(a===u)d=[e[a].slice(r,c)];else{if(d=e.slice(a,u),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}c>0&&d.push(e[u].slice(0,c))}return d}function O0(e,i){let a=-1;const r=[];let u;for(;++a<e.length;){const c=e[a];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
|
|
49
|
+
`+o.stack}}var mn=Object.prototype.hasOwnProperty,Xt=e.unstable_scheduleCallback,Ti=e.unstable_cancelCallback,Qn=e.unstable_shouldYield,La=e.unstable_requestPaint,_t=e.unstable_now,Ia=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Ue=e.unstable_LowPriority,Qe=e.unstable_IdlePriority,Vt=e.log,Zn=e.unstable_setDisableYieldValue,Ft=null,Et=null;function ct(t){if(typeof Vt=="function"&&Zn(t),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Ft,t)}catch{}}var st=Math.clz32?Math.clz32:pd,Ei=Math.log,wn=Math.LN2;function pd(t){return t>>>=0,t===0?32:31-(Ei(t)/wn|0)|0}var jr=256,Cr=262144,Rl=4194304;function Ai(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ua(t,n,l){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var T=o&134217727;return T!==0?(o=T&~h,o!==0?f=Ai(o):(v&=T,v!==0?f=Ai(v):l||(l=T&~t,l!==0&&(f=Ai(l))))):(T=o&~h,T!==0?f=Ai(T):v!==0?f=Ai(v):l||(l=o&~t,l!==0&&(f=Ai(l)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,l=n&-n,h>=l||h===32&&(l&4194048)!==0)?n:f}function Jt(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Ba(t,n){switch(t){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 wt(){var t=Rl;return Rl<<=1,(Rl&62914560)===0&&(Rl=4194304),t}function na(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function qa(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function _l(t,n,l,o,f,h){var v=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var T=t.entanglements,I=t.expirationTimes,P=t.hiddenUpdates;for(l=v&~l;0<l;){var ne=31-st(l),se=1<<ne;T[ne]=0,I[ne]=-1;var K=P[ne];if(K!==null)for(P[ne]=null,ne=0;ne<K.length;ne++){var J=K[ne];J!==null&&(J.lane&=-536870913)}l&=~se}o!==0&&Os(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function Os(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-st(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|l&261930}function Ha(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var o=31-st(l),f=1<<o;f&n|t[o]&n&&(t[o]|=n),l&=~f}}function pu(t,n){var l=n&-n;return l=(l&42)!==0?1:Tr(l),(l&(t.suspendedLanes|n))!==0?0:l}function Tr(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function zs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ls(){var t=oe.p;return t!==0?t:(t=window.event,t===void 0?32:hy(t.type))}function hu(t,n){var l=oe.p;try{return oe.p=t,n()}finally{oe.p=l}}var Jn=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Jn,Bt="__reactProps$"+Jn,Bn="__reactContainer$"+Jn,Ni="__reactEvents$"+Jn,$a="__reactListeners$"+Jn,Ga="__reactHandles$"+Jn,Er="__reactResources$"+Jn,Di="__reactMarker$"+Jn;function Is(t){delete t[Yt],delete t[Bt],delete t[Ni],delete t[$a],delete t[Ga]}function ei(t){var n=t[Yt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[Bn]||l[Yt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=Zg(t);t!==null;){if(l=t[Yt])return l;t=Zg(t)}return n}t=l,l=t.parentNode}return null}function Ri(t){if(t=t[Yt]||t[Bn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ia(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function _i(t){var n=t[Er];return n||(n=t[Er]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function At(t){t[Di]=!0}var mu=new Set,Us={};function on(t,n){Mi(t,n),Mi(t+"Capture",n)}function Mi(t,n){for(Us[t]=n,t=0;t<n.length;t++)mu.add(n[t])}var gu=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]*$"),yu={},xu={};function Ar(t){return mn.call(xu,t)?!0:mn.call(yu,t)?!1:gu.test(t)?xu[t]=!0:(yu[t]=!0,!1)}function Ml(t,n,l){if(Ar(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function aa(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+l)}}function fi(t,n,l,o){if(o===null)t.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,""+o)}}function gn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function pi(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function la(t,n,l){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,h=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Bs(t){if(!t._valueTracker){var n=pi(t)?"checked":"value";t._valueTracker=la(t,n,""+t[n])}}function hi(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return t&&(o=pi(t)?t.checked?"true":"false":t.value),t=o,t!==l?(n.setValue(t),!0):!1}function Oi(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var bu=/[\n"\\]/g;function Nt(t){return t.replace(bu,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function qn(t,n,l,o,f,h,v,T){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+gn(n)):t.value!==""+gn(n)&&(t.value=""+gn(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?Nr(t,v,gn(n)):l!=null?Nr(t,v,gn(l)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+gn(T):t.removeAttribute("name")}function zi(t,n,l,o,f,h,v,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Bs(t);return}l=l!=null?""+gn(l):"",n=n!=null?""+gn(n):l,T||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=T?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),Bs(t)}function Nr(t,n,l){n==="number"&&Oi(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function ti(t,n,l,o){if(t=t.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=n.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&o&&(t[l].defaultSelected=!0)}else{for(l=""+gn(l),n=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function qs(t,n,l){if(n!=null&&(n=""+gn(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+gn(l):""}function Ol(t,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(r(92));if(ue(o)){if(1<o.length)throw Error(r(93));o=o[0]}l=o}l==null&&(l=""),n=l}l=gn(n),t.defaultValue=l,o=t.textContent,o===l&&o!==""&&o!==null&&(t.value=o),Bs(t)}function Va(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var Dr=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 Fa(t,n,l){var o=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,l):typeof l!="number"||l===0||Dr.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function Rr(t,n,l){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,l!=null){for(var o in l)!l.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&l[f]!==o&&Fa(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&Fa(t,h,n[h])}function zl(t){if(t.indexOf("-")===-1)return!1;switch(t){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 vu=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"]]),_r=/^[\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 yn(t){return _r.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Qt(){}var Ll=null;function ra(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Li=null,Ii=null;function wu(t){var n=Ri(t);if(n&&(t=n.stateNode)){var l=t[Bt]||null;e:switch(t=n.stateNode,n.type){case"input":if(qn(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Nt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==t&&o.form===t.form){var f=o[Bt]||null;if(!f)throw Error(r(90));qn(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)o=l[n],o.form===t.form&&hi(o)}break e;case"textarea":qs(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&ti(t,!!l.multiple,n,!1)}}}var Il=!1;function Hs(t,n,l){if(Il)return t(n,l);Il=!0;try{var o=t(n);return o}finally{if(Il=!1,(Li!==null||Ii!==null)&&(cc(),Li&&(n=Li,t=Ii,Ii=Li=null,wu(n),t)))for(n=0;n<t.length;n++)wu(t[n])}}function Ul(t,n){var l=t.stateNode;if(l===null)return null;var o=l[Bt]||null;if(o===null)return null;l=o[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":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,n,typeof l));return l}var en=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$s=!1;if(en)try{var Bl={};Object.defineProperty(Bl,"passive",{get:function(){$s=!0}}),window.addEventListener("test",Bl,Bl),window.removeEventListener("test",Bl,Bl)}catch{$s=!1}var Ui=null,Mr=null,sa=null;function Gs(){if(sa)return sa;var t,n=Mr,l=n.length,o,f="value"in Ui?Ui.value:Ui.textContent,h=f.length;for(t=0;t<l&&n[t]===f[t];t++);var v=l-t;for(o=1;o<=v&&n[l-o]===f[h-o];o++);return sa=f.slice(t,1<o?1-o:void 0)}function Ya(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function mi(){return!0}function ql(){return!1}function tn(t){function n(l,o,f,h,v){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var T in t)t.hasOwnProperty(T)&&(l=t[T],this[T]=l?l(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?mi:ql,this.isPropagationStopped=ql,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=mi)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),n}var Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pa=tn(Hn),oa=x({},Hn,{view:0,detail:0}),Vs=tn(oa),Or,Wa,Ka,Bi=x({},oa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:De,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ka&&(Ka&&t.type==="mousemove"?(Or=t.screenX-Ka.screenX,Wa=t.screenY-Ka.screenY):Wa=Or=0,Ka=t),Or)},movementY:function(t){return"movementY"in t?t.movementY:Wa}}),Xa=tn(Bi),zr=x({},Bi,{dataTransfer:0}),Lr=tn(zr),Hl=x({},oa,{relatedTarget:0}),qi=tn(Hl),Qa=x({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0}),Hi=tn(Qa),kn=x({},Hn,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Sn=tn(kn),Za=x({},Hn,{data:0}),Ja=tn(Za),Ir={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ur={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"},Fs={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ys(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Fs[t])?!!n[t]:!1}function De(){return Ys}var ku=x({},oa,{key:function(t){if(t.key){var n=Ir[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Ya(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Ur[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:De,charCode:function(t){return t.type==="keypress"?Ya(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ya(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ni=tn(ku),Mt=x({},Bi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Br=tn(Mt),$l=x({},oa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:De}),lt=tn($l),el=x({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0}),qr=tn(el),Gl=x({},Bi,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Vl=tn(Gl),Ps=x({},Hn,{newState:0,oldState:0}),ua=tn(Ps),hd=[9,13,27,32],Ws=en&&"CompositionEvent"in window,gi=null;en&&"documentMode"in document&&(gi=document.documentMode);var Su=en&&"TextEvent"in window&&!gi,Hr=en&&(!Ws||gi&&8<gi&&11>=gi),$r=" ",Fl=!1;function ju(t,n){switch(t){case"keyup":return hd.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ks(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $i=!1;function Gr(t,n){switch(t){case"compositionend":return Ks(n);case"keypress":return n.which!==32?null:(Fl=!0,$r);case"textInput":return t=n.data,t===$r&&Fl?null:t;default:return null}}function md(t,n){if($i)return t==="compositionend"||!Ws&&ju(t,n)?(t=Gs(),sa=Mr=Ui=null,$i=!1,t):null;switch(t){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 Hr&&n.locale!=="ko"?null:n.data;default:return null}}var Yl={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 Cu(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Yl[t.type]:n==="textarea"}function Tu(t,n,l,o){Li?Ii?Ii.push(o):Ii=[o]:Li=o,n=yc(n,"onChange"),0<n.length&&(l=new Pa("onChange","change",null,l,o),t.push({event:l,listeners:n}))}var Pl=null,ca=null;function da(t){Ug(t,0)}function Gi(t){var n=ia(t);if(hi(n))return t}function ke(t,n){if(t==="change")return n}var Wl=!1;if(en){var fa;if(en){var Vr="oninput"in document;if(!Vr){var Fr=document.createElement("div");Fr.setAttribute("oninput","return;"),Vr=typeof Fr.oninput=="function"}fa=Vr}else fa=!1;Wl=fa&&(!document.documentMode||9<document.documentMode)}function Yr(){Pl&&(Pl.detachEvent("onpropertychange",Eu),ca=Pl=null)}function Eu(t){if(t.propertyName==="value"&&Gi(ca)){var n=[];Tu(n,ca,t,ra(t)),Hs(da,n)}}function nn(t,n,l){t==="focusin"?(Yr(),Pl=n,ca=l,Pl.attachEvent("onpropertychange",Eu)):t==="focusout"&&Yr()}function gd(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Gi(ca)}function yd(t,n){if(t==="click")return Gi(n)}function Pr(t,n){if(t==="input"||t==="change")return Gi(n)}function xd(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var un=typeof Object.is=="function"?Object.is:xd;function pa(t,n){if(un(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),o=Object.keys(n);if(l.length!==o.length)return!1;for(o=0;o<l.length;o++){var f=l[o];if(!mn.call(n,f)||!un(t[f],n[f]))return!1}return!0}function Au(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Nu(t,n){var l=Au(t);t=0;for(var o;l;){if(l.nodeType===3){if(o=t+l.textContent.length,t<=n&&o>=n)return{node:l,offset:n-t};t=o}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Au(l)}}function Kl(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Kl(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Wr(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Oi(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=Oi(t.document)}return n}function Xl(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var bd=en&&"documentMode"in document&&11>=document.documentMode,Vi=null,Xs=null,Ql=null,Zl=!1;function Qs(t,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Zl||Vi==null||Vi!==Oi(o)||(o=Vi,"selectionStart"in o&&Xl(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ql&&pa(Ql,o)||(Ql=o,o=yc(Xs,"onSelect"),0<o.length&&(n=new Pa("onSelect","select",null,n,l),t.push({event:n,listeners:o}),n.target=Vi)))}function ha(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var tl={animationend:ha("Animation","AnimationEnd"),animationiteration:ha("Animation","AnimationIteration"),animationstart:ha("Animation","AnimationStart"),transitionrun:ha("Transition","TransitionRun"),transitionstart:ha("Transition","TransitionStart"),transitioncancel:ha("Transition","TransitionCancel"),transitionend:ha("Transition","TransitionEnd")},Kr={},Du={};en&&(Du=document.createElement("div").style,"AnimationEvent"in window||(delete tl.animationend.animation,delete tl.animationiteration.animation,delete tl.animationstart.animation),"TransitionEvent"in window||delete tl.transitionend.transition);function ma(t){if(Kr[t])return Kr[t];if(!tl[t])return t;var n=tl[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Du)return Kr[t]=n[l];return t}var Ru=ma("animationend"),_u=ma("animationiteration"),Mu=ma("animationstart"),vd=ma("transitionrun"),wd=ma("transitionstart"),kd=ma("transitioncancel"),Ou=ma("transitionend"),zu=new Map,Zs="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(" ");Zs.push("scrollEnd");function $n(t,n){zu.set(t,n),on(n,[t])}var Xr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},jn=[],nl=0,Js=0;function Qr(){for(var t=nl,n=Js=nl=0;n<t;){var l=jn[n];jn[n++]=null;var o=jn[n];jn[n++]=null;var f=jn[n];jn[n++]=null;var h=jn[n];if(jn[n++]=null,o!==null&&f!==null){var v=o.pending;v===null?f.next=f:(f.next=v.next,v.next=f),o.pending=f}h!==0&&Cn(l,f,h)}}function Zr(t,n,l,o){jn[nl++]=t,jn[nl++]=n,jn[nl++]=l,jn[nl++]=o,Js|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function eo(t,n,l,o){return Zr(t,n,l,o),Jl(t)}function Fi(t,n){return Zr(t,null,null,n),Jl(t)}function Cn(t,n,l){t.lanes|=l;var o=t.alternate;o!==null&&(o.lanes|=l);for(var f=!1,h=t.return;h!==null;)h.childLanes|=l,o=h.alternate,o!==null&&(o.childLanes|=l),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-st(l),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=l|536870912),h):null}function Jl(t){if(50<Ao)throw Ao=0,bf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ga={};function er(t,n,l,o){this.tag=t,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ot(t,n,l,o){return new er(t,n,l,o)}function to(t){return t=t.prototype,!(!t||!t.isReactComponent)}function yi(t,n){var l=t.alternate;return l===null?(l=Ot(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Lu(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Jr(t,n,l,o,f,h){var v=0;if(o=t,typeof t=="function")to(t)&&(v=1);else if(typeof t=="string")v=Ek(t,l,W.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ee:return t=Ot(31,l,n,f),t.elementType=ee,t.lanes=h,t;case M:return ya(l.children,f,h,n);case H:v=8,f|=24;break;case R:return t=Ot(12,l,n,f|2),t.elementType=R,t.lanes=h,t;case ie:return t=Ot(13,l,n,f),t.elementType=ie,t.lanes=h,t;case N:return t=Ot(19,l,n,f),t.elementType=N,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:v=10;break e;case q:v=9;break e;case V:v=11;break e;case Q:v=14;break e;case re:v=16,o=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=Ot(v,l,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function ya(t,n,l,o){return t=Ot(7,t,o,n),t.lanes=l,t}function es(t,n,l){return t=Ot(6,t,null,n),t.lanes=l,t}function Iu(t){var n=Ot(18,null,null,0);return n.stateNode=t,n}function ts(t,n,l){return n=Ot(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var no=new WeakMap;function Tn(t,n){if(typeof t=="object"&&t!==null){var l=no.get(t);return l!==void 0?l:(n={value:t,source:n,stack:Ut(n)},no.set(t,n),n)}return{value:t,source:n,stack:Ut(n)}}var il=[],al=0,xi=null,Yi=0,En=[],An=0,bi=null,ii=1,Gn="";function vi(t,n){il[al++]=Yi,il[al++]=xi,xi=t,Yi=n}function Uu(t,n,l){En[An++]=ii,En[An++]=Gn,En[An++]=bi,bi=t;var o=ii;t=Gn;var f=32-st(o)-1;o&=~(1<<f),l+=1;var h=32-st(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,ii=1<<32-st(n)+f|l<<f|o,Gn=h+t}else ii=1<<h|l<<f|o,Gn=t}function io(t){t.return!==null&&(vi(t,1),Uu(t,1,0))}function ao(t){for(;t===xi;)xi=il[--al],il[al]=null,Yi=il[--al],il[al]=null;for(;t===bi;)bi=En[--An],En[An]=null,Gn=En[--An],En[An]=null,ii=En[--An],En[An]=null}function Bu(t,n){En[An++]=ii,En[An++]=Gn,En[An++]=bi,ii=n.id,Gn=n.overflow,bi=t}var Pt=null,ht=null,Pe=!1,Pi=null,Nn=!1,lo=Error(r(519));function Wi(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nr(Tn(n,t)),lo}function qu(t){var n=t.stateNode,l=t.type,o=t.memoizedProps;switch(n[Yt]=t,n[Bt]=o,l){case"dialog":Ke("cancel",n),Ke("close",n);break;case"iframe":case"object":case"embed":Ke("load",n);break;case"video":case"audio":for(l=0;l<Do.length;l++)Ke(Do[l],n);break;case"source":Ke("error",n);break;case"img":case"image":case"link":Ke("error",n),Ke("load",n);break;case"details":Ke("toggle",n);break;case"input":Ke("invalid",n),zi(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ke("invalid",n);break;case"textarea":Ke("invalid",n),Ol(n,o.value,o.defaultValue,o.children)}l=o.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||o.suppressHydrationWarning===!0||$g(n.textContent,l)?(o.popover!=null&&(Ke("beforetoggle",n),Ke("toggle",n)),o.onScroll!=null&&Ke("scroll",n),o.onScrollEnd!=null&&Ke("scrollend",n),o.onClick!=null&&(n.onclick=Qt),n=!0):n=!1,n||Wi(t,!0)}function tr(t){for(Pt=t.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:Pt=Pt.return}}function ll(t){if(t!==Pt)return!1;if(!Pe)return tr(t),Pe=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Of(t.type,t.memoizedProps)),l=!l),l&&ht&&Wi(t),tr(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ht=Qg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ht=Qg(t)}else n===27?(n=ht,bl(t.type)?(t=Bf,Bf=null,ht=t):ht=n):ht=Pt?oi(t.stateNode.nextSibling):null;return!0}function wi(){ht=Pt=null,Pe=!1}function ro(){var t=Pi;return t!==null&&(On===null?On=t:On.push.apply(On,t),Pi=null),t}function nr(t){Pi===null?Pi=[t]:Pi.push(t)}var rl=A(null),xa=null,cn=null;function ai(t,n,l){C(rl,n._currentValue),n._currentValue=l}function li(t){t._currentValue=rl.current,z(rl)}function ns(t,n,l){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===l)break;t=t.return}}function is(t,n,l,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=f;for(var I=0;I<n.length;I++)if(T.context===n[I]){h.lanes|=l,T=h.alternate,T!==null&&(T.lanes|=l),ns(h.return,l,t),o||(v=null);break e}h=T.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=l,h=v.alternate,h!==null&&(h.lanes|=l),ns(v,l,t),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===t){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function ri(t,n,l,o){t=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!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 T=f.type;un(f.pendingProps.value,v.value)||(t!==null?t.push(T):t=[T])}}else if(f===xe.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(zo):t=[zo])}f=f.return}t!==null&&is(n,t,l,o),n.flags|=262144}function as(t){for(t=t.firstContext;t!==null;){if(!un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ba(t){xa=t,cn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Wt(t){return Hu(xa,t)}function va(t,n){return xa===null&&ba(t),Hu(t,n)}function Hu(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},cn===null){if(t===null)throw Error(r(308));cn=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else cn=cn.next=n;return l}var $u=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},Sd=e.unstable_scheduleCallback,ir=e.unstable_NormalPriority,bt={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wa(){return{controller:new $u,data:new Map,refCount:0}}function ar(t){t.refCount--,t.refCount===0&&Sd(ir,function(){t.controller.abort()})}var lr=null,so=0,tt=0,xn=null;function jd(t,n){if(lr===null){var l=lr=[];so=0,tt=Cf(),xn={status:"pending",value:void 0,then:function(o){l.push(o)}}}return so++,n.then(Dn,Dn),n}function Dn(){if(--so===0&&lr!==null){xn!==null&&(xn.status="fulfilled");var t=lr;lr=null,tt=0,xn=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Cd(t,n){var l=[],o={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),o}var ki=F.S;F.S=function(t,n){fg=_t(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&jd(t,n),ki!==null&&ki(t,n)};var ka=A(null);function oo(){var t=ka.current;return t!==null?t:gt.pooledCache}function ls(t,n){n===null?C(ka,ka.current):C(ka,n.pool)}function rs(){var t=oo();return t===null?null:{parent:bt._currentValue,pool:t}}var sl=Error(r(460)),uo=Error(r(474)),ss=Error(r(542)),rr={then:function(){}};function co(t){return t=t.status,t==="fulfilled"||t==="rejected"}function fo(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(Qt,Qt),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,j(t),t;default:if(typeof n.status=="string")n.then(Qt,Qt);else{if(t=gt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,j(t),t}throw y=n,sl}}function Ki(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(y=l,sl):l}}var y=null;function k(){if(y===null)throw Error(r(459));var t=y;return y=null,t}function j(t){if(t===sl||t===ss)throw Error(r(483))}var _=null,U=0;function Z(t){var n=U;return U+=1,_===null&&(_=[]),fo(_,t,n)}function pe(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Se(t,n){throw n.$$typeof===S?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function ve(t){function n(G,B){if(t){var Y=G.deletions;Y===null?(G.deletions=[B],G.flags|=16):Y.push(B)}}function l(G,B){if(!t)return null;for(;B!==null;)n(G,B),B=B.sibling;return null}function o(G){for(var B=new Map;G!==null;)G.key!==null?B.set(G.key,G):B.set(G.index,G),G=G.sibling;return B}function f(G,B){return G=yi(G,B),G.index=0,G.sibling=null,G}function h(G,B,Y){return G.index=Y,t?(Y=G.alternate,Y!==null?(Y=Y.index,Y<B?(G.flags|=67108866,B):Y):(G.flags|=67108866,B)):(G.flags|=1048576,B)}function v(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function T(G,B,Y,le){return B===null||B.tag!==6?(B=es(Y,G.mode,le),B.return=G,B):(B=f(B,Y),B.return=G,B)}function I(G,B,Y,le){var Re=Y.type;return Re===M?ne(G,B,Y.props.children,le,Y.key):B!==null&&(B.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===re&&Ki(Re)===B.type)?(B=f(B,Y.props),pe(B,Y),B.return=G,B):(B=Jr(Y.type,Y.key,Y.props,null,G.mode,le),pe(B,Y),B.return=G,B)}function P(G,B,Y,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==Y.containerInfo||B.stateNode.implementation!==Y.implementation?(B=ts(Y,G.mode,le),B.return=G,B):(B=f(B,Y.children||[]),B.return=G,B)}function ne(G,B,Y,le,Re){return B===null||B.tag!==7?(B=ya(Y,G.mode,le,Re),B.return=G,B):(B=f(B,Y),B.return=G,B)}function se(G,B,Y){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=es(""+B,G.mode,Y),B.return=G,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return Y=Jr(B.type,B.key,B.props,null,G.mode,Y),pe(Y,B),Y.return=G,Y;case E:return B=ts(B,G.mode,Y),B.return=G,B;case re:return B=Ki(B),se(G,B,Y)}if(ue(B)||de(B))return B=ya(B,G.mode,Y,null),B.return=G,B;if(typeof B.then=="function")return se(G,Z(B),Y);if(B.$$typeof===$)return se(G,va(G,B),Y);Se(G,B)}return null}function K(G,B,Y,le){var Re=B!==null?B.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Re!==null?null:T(G,B,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===Re?I(G,B,Y,le):null;case E:return Y.key===Re?P(G,B,Y,le):null;case re:return Y=Ki(Y),K(G,B,Y,le)}if(ue(Y)||de(Y))return Re!==null?null:ne(G,B,Y,le,null);if(typeof Y.then=="function")return K(G,B,Z(Y),le);if(Y.$$typeof===$)return K(G,B,va(G,Y),le);Se(G,Y)}return null}function J(G,B,Y,le,Re){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return G=G.get(Y)||null,T(B,G,""+le,Re);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return G=G.get(le.key===null?Y:le.key)||null,I(B,G,le,Re);case E:return G=G.get(le.key===null?Y:le.key)||null,P(B,G,le,Re);case re:return le=Ki(le),J(G,B,Y,le,Re)}if(ue(le)||de(le))return G=G.get(Y)||null,ne(B,G,le,Re,null);if(typeof le.then=="function")return J(G,B,Y,Z(le),Re);if(le.$$typeof===$)return J(G,B,Y,va(B,le),Re);Se(B,le)}return null}function je(G,B,Y,le){for(var Re=null,it=null,Ae=B,$e=B=0,Je=null;Ae!==null&&$e<Y.length;$e++){Ae.index>$e?(Je=Ae,Ae=null):Je=Ae.sibling;var at=K(G,Ae,Y[$e],le);if(at===null){Ae===null&&(Ae=Je);break}t&&Ae&&at.alternate===null&&n(G,Ae),B=h(at,B,$e),it===null?Re=at:it.sibling=at,it=at,Ae=Je}if($e===Y.length)return l(G,Ae),Pe&&vi(G,$e),Re;if(Ae===null){for(;$e<Y.length;$e++)Ae=se(G,Y[$e],le),Ae!==null&&(B=h(Ae,B,$e),it===null?Re=Ae:it.sibling=Ae,it=Ae);return Pe&&vi(G,$e),Re}for(Ae=o(Ae);$e<Y.length;$e++)Je=J(Ae,G,$e,Y[$e],le),Je!==null&&(t&&Je.alternate!==null&&Ae.delete(Je.key===null?$e:Je.key),B=h(Je,B,$e),it===null?Re=Je:it.sibling=Je,it=Je);return t&&Ae.forEach(function(jl){return n(G,jl)}),Pe&&vi(G,$e),Re}function ze(G,B,Y,le){if(Y==null)throw Error(r(151));for(var Re=null,it=null,Ae=B,$e=B=0,Je=null,at=Y.next();Ae!==null&&!at.done;$e++,at=Y.next()){Ae.index>$e?(Je=Ae,Ae=null):Je=Ae.sibling;var jl=K(G,Ae,at.value,le);if(jl===null){Ae===null&&(Ae=Je);break}t&&Ae&&jl.alternate===null&&n(G,Ae),B=h(jl,B,$e),it===null?Re=jl:it.sibling=jl,it=jl,Ae=Je}if(at.done)return l(G,Ae),Pe&&vi(G,$e),Re;if(Ae===null){for(;!at.done;$e++,at=Y.next())at=se(G,at.value,le),at!==null&&(B=h(at,B,$e),it===null?Re=at:it.sibling=at,it=at);return Pe&&vi(G,$e),Re}for(Ae=o(Ae);!at.done;$e++,at=Y.next())at=J(Ae,G,$e,at.value,le),at!==null&&(t&&at.alternate!==null&&Ae.delete(at.key===null?$e:at.key),B=h(at,B,$e),it===null?Re=at:it.sibling=at,it=at);return t&&Ae.forEach(function(Uk){return n(G,Uk)}),Pe&&vi(G,$e),Re}function pt(G,B,Y,le){if(typeof Y=="object"&&Y!==null&&Y.type===M&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var Re=Y.key;B!==null;){if(B.key===Re){if(Re=Y.type,Re===M){if(B.tag===7){l(G,B.sibling),le=f(B,Y.props.children),le.return=G,G=le;break e}}else if(B.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===re&&Ki(Re)===B.type){l(G,B.sibling),le=f(B,Y.props),pe(le,Y),le.return=G,G=le;break e}l(G,B);break}else n(G,B);B=B.sibling}Y.type===M?(le=ya(Y.props.children,G.mode,le,Y.key),le.return=G,G=le):(le=Jr(Y.type,Y.key,Y.props,null,G.mode,le),pe(le,Y),le.return=G,G=le)}return v(G);case E:e:{for(Re=Y.key;B!==null;){if(B.key===Re)if(B.tag===4&&B.stateNode.containerInfo===Y.containerInfo&&B.stateNode.implementation===Y.implementation){l(G,B.sibling),le=f(B,Y.children||[]),le.return=G,G=le;break e}else{l(G,B);break}else n(G,B);B=B.sibling}le=ts(Y,G.mode,le),le.return=G,G=le}return v(G);case re:return Y=Ki(Y),pt(G,B,Y,le)}if(ue(Y))return je(G,B,Y,le);if(de(Y)){if(Re=de(Y),typeof Re!="function")throw Error(r(150));return Y=Re.call(Y),ze(G,B,Y,le)}if(typeof Y.then=="function")return pt(G,B,Z(Y),le);if(Y.$$typeof===$)return pt(G,B,va(G,Y),le);Se(G,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,B!==null&&B.tag===6?(l(G,B.sibling),le=f(B,Y),le.return=G,G=le):(l(G,B),le=es(Y,G.mode,le),le.return=G,G=le),v(G)):l(G,B)}return function(G,B,Y,le){try{U=0;var Re=pt(G,B,Y,le);return _=null,Re}catch(Ae){if(Ae===sl||Ae===ss)throw Ae;var it=Ot(29,Ae,null,G.mode);return it.lanes=le,it.return=G,it}finally{}}}var we=ve(!0),mt=ve(!1),Fe=!1;function sr(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function os(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ol(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ul(t,n,l){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(rt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=Jl(t),Cn(t,null,l),n}return Zr(t,o,n,l),Jl(t)}function po(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,Ha(t,l)}}function Td(t,n){var l=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,l=l.next}while(l!==null);h===null?f=h=n:h=h.next=n}else f=h=n;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var Ed=!1;function ho(){if(Ed){var t=xn;if(t!==null)throw t}}function mo(t,n,l,o){Ed=!1;var f=t.updateQueue;Fe=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var I=T,P=I.next;I.next=null,v===null?h=P:v.next=P,v=I;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,T=ne.lastBaseUpdate,T!==v&&(T===null?ne.firstBaseUpdate=P:T.next=P,ne.lastBaseUpdate=I))}if(h!==null){var se=f.baseState;v=0,ne=P=I=null,T=h;do{var K=T.lane&-536870913,J=K!==T.lane;if(J?(Ze&K)===K:(o&K)===K){K!==0&&K===tt&&(Ed=!0),ne!==null&&(ne=ne.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var je=t,ze=T;K=n;var pt=l;switch(ze.tag){case 1:if(je=ze.payload,typeof je=="function"){se=je.call(pt,se,K);break e}se=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=ze.payload,K=typeof je=="function"?je.call(pt,se,K):je,K==null)break e;se=x({},se,K);break e;case 2:Fe=!0}}K=T.callback,K!==null&&(t.flags|=64,J&&(t.flags|=8192),J=f.callbacks,J===null?f.callbacks=[K]:J.push(K))}else J={lane:K,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ne===null?(P=ne=J,I=se):ne=ne.next=J,v|=K;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;J=T,T=J.next,J.next=null,f.lastBaseUpdate=J,f.shared.pending=null}}while(!0);ne===null&&(I=se),f.baseState=I,f.firstBaseUpdate=P,f.lastBaseUpdate=ne,h===null&&(f.shared.lanes=0),hl|=v,t.lanes=v,t.memoizedState=se}}function Ih(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Uh(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Ih(l[t],n)}var us=A(null),Gu=A(0);function Bh(t,n){t=Ra,C(Gu,t),C(us,n),Ra=t|n.baseLanes}function Ad(){C(Gu,Ra),C(us,us.current)}function Nd(){Ra=Gu.current,z(us),z(Gu)}var Vn=A(null),si=null;function cl(t){var n=t.alternate;C(zt,zt.current&1),C(Vn,t),si===null&&(n===null||us.current!==null||n.memoizedState!==null)&&(si=t)}function Dd(t){C(zt,zt.current),C(Vn,t),si===null&&(si=t)}function qh(t){t.tag===22?(C(zt,zt.current),C(Vn,t),si===null&&(si=t)):dl()}function dl(){C(zt,zt.current),C(Vn,Vn.current)}function Fn(t){z(Vn),si===t&&(si=null),z(zt)}var zt=A(0);function Vu(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||If(l)||Uf(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===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Sa=0,qe=null,dt=null,qt=null,Fu=!1,cs=!1,or=!1,Yu=0,go=0,ds=null,Aw=0;function Dt(){throw Error(r(321))}function Rd(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!un(t[l],n[l]))return!1;return!0}function _d(t,n,l,o,f,h){return Sa=h,qe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,F.H=t===null||t.memoizedState===null?Sm:Pd,or=!1,h=l(o,f),or=!1,cs&&(h=$h(n,l,o,f)),Hh(t),h}function Hh(t){F.H=bo;var n=dt!==null&&dt.next!==null;if(Sa=0,qt=dt=qe=null,Fu=!1,go=0,ds=null,n)throw Error(r(300));t===null||Ht||(t=t.dependencies,t!==null&&as(t)&&(Ht=!0))}function $h(t,n,l,o){qe=t;var f=0;do{if(cs&&(ds=null),go=0,cs=!1,25<=f)throw Error(r(301));if(f+=1,qt=dt=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}F.H=jm,h=n(l,o)}while(cs);return h}function Nw(){var t=F.H,n=t.useState()[0];return n=typeof n.then=="function"?yo(n):n,t=t.useState()[0],(dt!==null?dt.memoizedState:null)!==t&&(qe.flags|=1024),n}function Md(){var t=Yu!==0;return Yu=0,t}function Od(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function zd(t){if(Fu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Fu=!1}Sa=0,qt=dt=qe=null,cs=!1,go=Yu=0,ds=null}function bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?qe.memoizedState=qt=t:qt=qt.next=t,qt}function Lt(){if(dt===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=dt.next;var n=qt===null?qe.memoizedState:qt.next;if(n!==null)qt=n,dt=t;else{if(t===null)throw qe.alternate===null?Error(r(467)):Error(r(310));dt=t,t={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},qt===null?qe.memoizedState=qt=t:qt=qt.next=t}return qt}function Pu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yo(t){var n=go;return go+=1,ds===null&&(ds=[]),t=fo(ds,t,n),n=qe,(qt===null?n.memoizedState:qt.next)===null&&(n=n.alternate,F.H=n===null||n.memoizedState===null?Sm:Pd),t}function Wu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return yo(t);if(t.$$typeof===$)return Wt(t)}throw Error(r(438,String(t)))}function Ld(t){var n=null,l=qe.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=qe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=Pu(),qe.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),o=0;o<t;o++)l[o]=L;return n.index++,l}function ja(t,n){return typeof n=="function"?n(t):n}function Ku(t){var n=Lt();return Id(n,dt,t)}function Id(t,n,l){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=l;var f=t.baseQueue,h=o.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}n.baseQueue=f=h,o.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{n=f.next;var T=v=null,I=null,P=n,ne=!1;do{var se=P.lane&-536870913;if(se!==P.lane?(Ze&se)===se:(Sa&se)===se){var K=P.revertLane;if(K===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),se===tt&&(ne=!0);else if((Sa&K)===K){P=P.next,K===tt&&(ne=!0);continue}else se={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(T=I=se,v=h):I=I.next=se,qe.lanes|=K,hl|=K;se=P.action,or&&l(h,se),h=P.hasEagerState?P.eagerState:l(h,se)}else K={lane:se,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(T=I=K,v=h):I=I.next=K,qe.lanes|=se,hl|=se;P=P.next}while(P!==null&&P!==n);if(I===null?v=h:I.next=T,!un(h,t.memoizedState)&&(Ht=!0,ne&&(l=xn,l!==null)))throw l;t.memoizedState=h,t.baseState=v,t.baseQueue=I,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Ud(t){var n=Lt(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var o=l.dispatch,f=l.pending,h=n.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);un(h,n.memoizedState)||(Ht=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),l.lastRenderedState=h}return[h,o]}function Gh(t,n,l){var o=qe,f=Lt(),h=Pe;if(h){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!un((dt||f).memoizedState,l);if(v&&(f.memoizedState=l,Ht=!0),f=f.queue,Hd(Yh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||qt!==null&&qt.memoizedState.tag&1){if(o.flags|=2048,fs(9,{destroy:void 0},Fh.bind(null,o,f,l,n),null),gt===null)throw Error(r(349));h||(Sa&127)!==0||Vh(o,n,l)}return l}function Vh(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=qe.updateQueue,n===null?(n=Pu(),qe.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Fh(t,n,l,o){n.value=l,n.getSnapshot=o,Ph(n)&&Wh(t)}function Yh(t,n,l){return l(function(){Ph(n)&&Wh(t)})}function Ph(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!un(t,l)}catch{return!0}}function Wh(t){var n=Fi(t,2);n!==null&&zn(n,t,2)}function Bd(t){var n=bn();if(typeof t=="function"){var l=t;if(t=l(),or){ct(!0);try{l()}finally{ct(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:t},n}function Kh(t,n,l,o){return t.baseState=l,Id(t,dt,typeof o=="function"?o:ja)}function Dw(t,n,l,o,f){if(Zu(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};F.T!==null?l(!0):h.isTransition=!1,o(h),l=n.pending,l===null?(h.next=n.pending=h,Xh(n,h)):(h.next=l.next,n.pending=l.next=h)}}function Xh(t,n){var l=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=F.T,v={};F.T=v;try{var T=l(f,o),I=F.S;I!==null&&I(v,T),Qh(t,n,T)}catch(P){qd(t,n,P)}finally{h!==null&&v.types!==null&&(h.types=v.types),F.T=h}}else try{h=l(f,o),Qh(t,n,h)}catch(P){qd(t,n,P)}}function Qh(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){Zh(t,n,o)},function(o){return qd(t,n,o)}):Zh(t,n,l)}function Zh(t,n,l){n.status="fulfilled",n.value=l,Jh(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Xh(t,l)))}function qd(t,n,l){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,Jh(n),n=n.next;while(n!==o)}t.action=null}function Jh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function em(t,n){return n}function tm(t,n){if(Pe){var l=gt.formState;if(l!==null){e:{var o=qe;if(Pe){if(ht){t:{for(var f=ht,h=Nn;f.nodeType!==8;){if(!h){f=null;break t}if(f=oi(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){ht=oi(f.nextSibling),o=f.data==="F!";break e}}Wi(o)}o=!1}o&&(n=l[0])}}return l=bn(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:em,lastRenderedState:n},l.queue=o,l=vm.bind(null,qe,o),o.dispatch=l,o=Bd(!1),h=Yd.bind(null,qe,!1,o.queue),o=bn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,l=Dw.bind(null,qe,f,h,l),f.dispatch=l,o.memoizedState=t,[n,l,!1]}function nm(t){var n=Lt();return im(n,dt,t)}function im(t,n,l){if(n=Id(t,n,em)[0],t=Ku(ja)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=yo(n)}catch(v){throw v===sl?ss:v}else o=n;n=Lt();var f=n.queue,h=f.dispatch;return l!==n.memoizedState&&(qe.flags|=2048,fs(9,{destroy:void 0},Rw.bind(null,f,l),null)),[o,h,t]}function Rw(t,n){t.action=n}function am(t){var n=Lt(),l=dt;if(l!==null)return im(n,l,t);Lt(),n=n.memoizedState,l=Lt();var o=l.queue.dispatch;return l.memoizedState=t,[n,o,!1]}function fs(t,n,l,o){return t={tag:t,create:l,deps:o,inst:n,next:null},n=qe.updateQueue,n===null&&(n=Pu(),qe.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(o=l.next,l.next=t,t.next=o,n.lastEffect=t),t}function lm(){return Lt().memoizedState}function Xu(t,n,l,o){var f=bn();qe.flags|=t,f.memoizedState=fs(1|n,{destroy:void 0},l,o===void 0?null:o)}function Qu(t,n,l,o){var f=Lt();o=o===void 0?null:o;var h=f.memoizedState.inst;dt!==null&&o!==null&&Rd(o,dt.memoizedState.deps)?f.memoizedState=fs(n,h,l,o):(qe.flags|=t,f.memoizedState=fs(1|n,h,l,o))}function rm(t,n){Xu(8390656,8,t,n)}function Hd(t,n){Qu(2048,8,t,n)}function _w(t){qe.flags|=4;var n=qe.updateQueue;if(n===null)n=Pu(),qe.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function sm(t){var n=Lt().memoizedState;return _w({ref:n,nextImpl:t}),function(){if((rt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function om(t,n){return Qu(4,2,t,n)}function um(t,n){return Qu(4,4,t,n)}function cm(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function dm(t,n,l){l=l!=null?l.concat([t]):null,Qu(4,4,cm.bind(null,n,t),l)}function $d(){}function fm(t,n){var l=Lt();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&Rd(n,o[1])?o[0]:(l.memoizedState=[t,n],t)}function pm(t,n){var l=Lt();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&Rd(n,o[1]))return o[0];if(o=t(),or){ct(!0);try{t()}finally{ct(!1)}}return l.memoizedState=[o,n],o}function Gd(t,n,l){return l===void 0||(Sa&1073741824)!==0&&(Ze&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=hg(),qe.lanes|=t,hl|=t,l)}function hm(t,n,l,o){return un(l,n)?l:us.current!==null?(t=Gd(t,l,o),un(t,n)||(Ht=!0),t):(Sa&42)===0||(Sa&1073741824)!==0&&(Ze&261930)===0?(Ht=!0,t.memoizedState=l):(t=hg(),qe.lanes|=t,hl|=t,n)}function mm(t,n,l,o,f){var h=oe.p;oe.p=h!==0&&8>h?h:8;var v=F.T,T={};F.T=T,Yd(t,!1,n,l);try{var I=f(),P=F.S;if(P!==null&&P(T,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=Cd(I,o);xo(t,n,ne,Wn(t))}else xo(t,n,o,Wn(t))}catch(se){xo(t,n,{then:function(){},status:"rejected",reason:se},Wn())}finally{oe.p=h,v!==null&&T.types!==null&&(v.types=T.types),F.T=v}}function Mw(){}function Vd(t,n,l,o){if(t.tag!==5)throw Error(r(476));var f=gm(t).queue;mm(t,f,n,be,l===null?Mw:function(){return ym(t),l(o)})}function gm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:be},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ym(t){var n=gm(t);n.next===null&&(n=t.alternate.memoizedState),xo(t,n.next.queue,{},Wn())}function Fd(){return Wt(zo)}function xm(){return Lt().memoizedState}function bm(){return Lt().memoizedState}function Ow(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Wn();t=ol(l);var o=ul(n,t,l);o!==null&&(zn(o,n,l),po(o,n,l)),n={cache:wa()},t.payload=n;return}n=n.return}}function zw(t,n,l){var o=Wn();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Zu(t)?wm(n,l):(l=eo(t,n,l,o),l!==null&&(zn(l,t,o),km(l,n,o)))}function vm(t,n,l){var o=Wn();xo(t,n,l,o)}function xo(t,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Zu(t))wm(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,T=h(v,l);if(f.hasEagerState=!0,f.eagerState=T,un(T,v))return Zr(t,n,f,0),gt===null&&Qr(),!1}catch{}finally{}if(l=eo(t,n,f,o),l!==null)return zn(l,t,o),km(l,n,o),!0}return!1}function Yd(t,n,l,o){if(o={lane:2,revertLane:Cf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Zu(t)){if(n)throw Error(r(479))}else n=eo(t,l,o,2),n!==null&&zn(n,t,2)}function Zu(t){var n=t.alternate;return t===qe||n!==null&&n===qe}function wm(t,n){cs=Fu=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function km(t,n,l){if((l&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,Ha(t,l)}}var bo={readContext:Wt,use:Wu,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt,useHostTransitionStatus:Dt,useFormState:Dt,useActionState:Dt,useOptimistic:Dt,useMemoCache:Dt,useCacheRefresh:Dt};bo.useEffectEvent=Dt;var Sm={readContext:Wt,use:Wu,useCallback:function(t,n){return bn().memoizedState=[t,n===void 0?null:n],t},useContext:Wt,useEffect:rm,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,Xu(4194308,4,cm.bind(null,n,t),l)},useLayoutEffect:function(t,n){return Xu(4194308,4,t,n)},useInsertionEffect:function(t,n){Xu(4,2,t,n)},useMemo:function(t,n){var l=bn();n=n===void 0?null:n;var o=t();if(or){ct(!0);try{t()}finally{ct(!1)}}return l.memoizedState=[o,n],o},useReducer:function(t,n,l){var o=bn();if(l!==void 0){var f=l(n);if(or){ct(!0);try{l(n)}finally{ct(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=zw.bind(null,qe,t),[o.memoizedState,t]},useRef:function(t){var n=bn();return t={current:t},n.memoizedState=t},useState:function(t){t=Bd(t);var n=t.queue,l=vm.bind(null,qe,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:$d,useDeferredValue:function(t,n){var l=bn();return Gd(l,t,n)},useTransition:function(){var t=Bd(!1);return t=mm.bind(null,qe,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var o=qe,f=bn();if(Pe){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),gt===null)throw Error(r(349));(Ze&127)!==0||Vh(o,n,l)}f.memoizedState=l;var h={value:l,getSnapshot:n};return f.queue=h,rm(Yh.bind(null,o,h,t),[t]),o.flags|=2048,fs(9,{destroy:void 0},Fh.bind(null,o,h,l,n),null),l},useId:function(){var t=bn(),n=gt.identifierPrefix;if(Pe){var l=Gn,o=ii;l=(o&~(1<<32-st(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=Yu++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=Aw++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Fd,useFormState:tm,useActionState:tm,useOptimistic:function(t){var n=bn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Yd.bind(null,qe,!0,l),l.dispatch=n,[t,n]},useMemoCache:Ld,useCacheRefresh:function(){return bn().memoizedState=Ow.bind(null,qe)},useEffectEvent:function(t){var n=bn(),l={impl:t};return n.memoizedState=l,function(){if((rt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Pd={readContext:Wt,use:Wu,useCallback:fm,useContext:Wt,useEffect:Hd,useImperativeHandle:dm,useInsertionEffect:om,useLayoutEffect:um,useMemo:pm,useReducer:Ku,useRef:lm,useState:function(){return Ku(ja)},useDebugValue:$d,useDeferredValue:function(t,n){var l=Lt();return hm(l,dt.memoizedState,t,n)},useTransition:function(){var t=Ku(ja)[0],n=Lt().memoizedState;return[typeof t=="boolean"?t:yo(t),n]},useSyncExternalStore:Gh,useId:xm,useHostTransitionStatus:Fd,useFormState:nm,useActionState:nm,useOptimistic:function(t,n){var l=Lt();return Kh(l,dt,t,n)},useMemoCache:Ld,useCacheRefresh:bm};Pd.useEffectEvent=sm;var jm={readContext:Wt,use:Wu,useCallback:fm,useContext:Wt,useEffect:Hd,useImperativeHandle:dm,useInsertionEffect:om,useLayoutEffect:um,useMemo:pm,useReducer:Ud,useRef:lm,useState:function(){return Ud(ja)},useDebugValue:$d,useDeferredValue:function(t,n){var l=Lt();return dt===null?Gd(l,t,n):hm(l,dt.memoizedState,t,n)},useTransition:function(){var t=Ud(ja)[0],n=Lt().memoizedState;return[typeof t=="boolean"?t:yo(t),n]},useSyncExternalStore:Gh,useId:xm,useHostTransitionStatus:Fd,useFormState:am,useActionState:am,useOptimistic:function(t,n){var l=Lt();return dt!==null?Kh(l,dt,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Ld,useCacheRefresh:bm};jm.useEffectEvent=sm;function Wd(t,n,l,o){n=t.memoizedState,l=l(o,n),l=l==null?n:x({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Kd={enqueueSetState:function(t,n,l){t=t._reactInternals;var o=Wn(),f=ol(o);f.payload=n,l!=null&&(f.callback=l),n=ul(t,f,o),n!==null&&(zn(n,t,o),po(n,t,o))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var o=Wn(),f=ol(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=ul(t,f,o),n!==null&&(zn(n,t,o),po(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Wn(),o=ol(l);o.tag=2,n!=null&&(o.callback=n),n=ul(t,o,l),n!==null&&(zn(n,t,l),po(n,t,l))}};function Cm(t,n,l,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!pa(l,o)||!pa(f,h):!0}function Tm(t,n,l,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,o),n.state!==t&&Kd.enqueueReplaceState(n,n.state,null)}function ur(t,n){var l=n;if("ref"in n){l={};for(var o in n)o!=="ref"&&(l[o]=n[o])}if(t=t.defaultProps){l===n&&(l=x({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Em(t){Xr(t)}function Am(t){console.error(t)}function Nm(t){Xr(t)}function Ju(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Dm(t,n,l){try{var o=t.onCaughtError;o(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Xd(t,n,l){return l=ol(l),l.tag=3,l.payload={element:null},l.callback=function(){Ju(t,n)},l}function Rm(t){return t=ol(t),t.tag=3,t}function _m(t,n,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){Dm(n,l,o)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Dm(n,l,o),typeof f!="function"&&(ml===null?ml=new Set([this]):ml.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function Lw(t,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&ri(n,l,f,!0),l=Vn.current,l!==null){switch(l.tag){case 31:case 13:return si===null?dc():l.alternate===null&&Rt===0&&(Rt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===rr?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),kf(t,o,f)),!1;case 22:return l.flags|=65536,o===rr?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([o]):l.add(o)),kf(t,o,f)),!1}throw Error(r(435,l.tag))}return kf(t,o,f),dc(),!1}if(Pe)return n=Vn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==lo&&(t=Error(r(422),{cause:o}),nr(Tn(t,l)))):(o!==lo&&(n=Error(r(423),{cause:o}),nr(Tn(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Tn(o,l),f=Xd(t.stateNode,o,f),Td(t,f),Rt!==4&&(Rt=2)),!1;var h=Error(r(520),{cause:o});if(h=Tn(h,l),Eo===null?Eo=[h]:Eo.push(h),Rt!==4&&(Rt=2),n===null)return!0;o=Tn(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Xd(l.stateNode,o,t),Td(l,t),!1;case 1:if(n=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(ml===null||!ml.has(h))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Rm(f),_m(f,t,l,o),Td(l,f),!1}l=l.return}while(l!==null);return!1}var Qd=Error(r(461)),Ht=!1;function an(t,n,l,o){n.child=t===null?mt(n,null,l,o):we(n,t.child,l,o)}function Mm(t,n,l,o,f){l=l.render;var h=n.ref;if("ref"in o){var v={};for(var T in o)T!=="ref"&&(v[T]=o[T])}else v=o;return ba(n),o=_d(t,n,l,v,h,f),T=Md(),t!==null&&!Ht?(Od(t,n,f),Ca(t,n,f)):(Pe&&T&&io(n),n.flags|=1,an(t,n,o,f),n.child)}function Om(t,n,l,o,f){if(t===null){var h=l.type;return typeof h=="function"&&!to(h)&&h.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=h,zm(t,n,h,o,f)):(t=Jr(l.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!rf(t,f)){var v=h.memoizedProps;if(l=l.compare,l=l!==null?l:pa,l(v,o)&&t.ref===n.ref)return Ca(t,n,f)}return n.flags|=1,t=yi(h,o),t.ref=n.ref,t.return=n,n.child=t}function zm(t,n,l,o,f){if(t!==null){var h=t.memoizedProps;if(pa(h,o)&&t.ref===n.ref)if(Ht=!1,n.pendingProps=o=h,rf(t,f))(t.flags&131072)!==0&&(Ht=!0);else return n.lanes=t.lanes,Ca(t,n,f)}return Zd(t,n,l,o,f)}function Lm(t,n,l,o){var f=o.children,h=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|l:l,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~h}else o=0,n.child=null;return Im(t,n,h,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&ls(n,h!==null?h.cachePool:null),h!==null?Bh(n,h):Ad(),qh(n);else return o=n.lanes=536870912,Im(t,n,h!==null?h.baseLanes|l:l,l,o)}else h!==null?(ls(n,h.cachePool),Bh(n,h),dl(),n.memoizedState=null):(t!==null&&ls(n,null),Ad(),dl());return an(t,n,f,l),n.child}function vo(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Im(t,n,l,o,f){var h=oo();return h=h===null?null:{parent:bt._currentValue,pool:h},n.memoizedState={baseLanes:l,cachePool:h},t!==null&&ls(n,null),Ad(),qh(n),t!==null&&ri(t,n,o,!0),n.childLanes=f,null}function ec(t,n){return n=nc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Um(t,n,l){return we(n,t.child,null,l),t=ec(n,n.pendingProps),t.flags|=2,Fn(n),n.memoizedState=null,t}function Iw(t,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Pe){if(o.mode==="hidden")return t=ec(n,o),n.lanes=536870912,vo(null,t);if(Dd(n),(t=ht)?(t=Xg(t,Nn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:bi!==null?{id:ii,overflow:Gn}:null,retryLane:536870912,hydrationErrors:null},l=Iu(t),l.return=n,n.child=l,Pt=n,ht=null)):t=null,t===null)throw Wi(n);return n.lanes=536870912,null}return ec(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(Dd(n),f)if(n.flags&256)n.flags&=-257,n=Um(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ht||ri(t,n,l,!1),f=(l&t.childLanes)!==0,Ht||f){if(o=gt,o!==null&&(v=pu(o,l),v!==0&&v!==h.retryLane))throw h.retryLane=v,Fi(t,v),zn(o,t,v),Qd;dc(),n=Um(t,n,l)}else t=h.treeContext,ht=oi(v.nextSibling),Pt=n,Pe=!0,Pi=null,Nn=!1,t!==null&&Bu(n,t),n=ec(n,o),n.flags|=4096;return n}return t=yi(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function tc(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function Zd(t,n,l,o,f){return ba(n),l=_d(t,n,l,o,void 0,f),o=Md(),t!==null&&!Ht?(Od(t,n,f),Ca(t,n,f)):(Pe&&o&&io(n),n.flags|=1,an(t,n,l,f),n.child)}function Bm(t,n,l,o,f,h){return ba(n),n.updateQueue=null,l=$h(n,o,l,f),Hh(t),o=Md(),t!==null&&!Ht?(Od(t,n,h),Ca(t,n,h)):(Pe&&o&&io(n),n.flags|=1,an(t,n,l,h),n.child)}function qm(t,n,l,o,f){if(ba(n),n.stateNode===null){var h=ga,v=l.contextType;typeof v=="object"&&v!==null&&(h=Wt(v)),h=new l(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Kd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},sr(n),v=l.contextType,h.context=typeof v=="object"&&v!==null?Wt(v):ga,h.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Wd(n,l,v,o),h.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&Kd.enqueueReplaceState(h,h.state,null),mo(n,o,h,f),ho(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var T=n.memoizedProps,I=ur(l,T);h.props=I;var P=h.context,ne=l.contextType;v=ga,typeof ne=="object"&&ne!==null&&(v=Wt(ne));var se=l.getDerivedStateFromProps;ne=typeof se=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=n.pendingProps!==T,ne||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||P!==v)&&Tm(n,h,o,v),Fe=!1;var K=n.memoizedState;h.state=K,mo(n,o,h,f),ho(),P=n.memoizedState,T||K!==P||Fe?(typeof se=="function"&&(Wd(n,l,se,o),P=n.memoizedState),(I=Fe||Cm(n,l,I,o,K,P,v))?(ne||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=P),h.props=o,h.state=P,h.context=v,o=I):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,os(t,n),v=n.memoizedProps,ne=ur(l,v),h.props=ne,se=n.pendingProps,K=h.context,P=l.contextType,I=ga,typeof P=="object"&&P!==null&&(I=Wt(P)),T=l.getDerivedStateFromProps,(P=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==se||K!==I)&&Tm(n,h,o,I),Fe=!1,K=n.memoizedState,h.state=K,mo(n,o,h,f),ho();var J=n.memoizedState;v!==se||K!==J||Fe||t!==null&&t.dependencies!==null&&as(t.dependencies)?(typeof T=="function"&&(Wd(n,l,T,o),J=n.memoizedState),(ne=Fe||Cm(n,l,ne,o,K,J,I)||t!==null&&t.dependencies!==null&&as(t.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,J,I),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,J,I)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=J),h.props=o,h.state=J,h.context=I,o=ne):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,tc(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=we(n,t.child,null,f),n.child=we(n,null,l,f)):an(t,n,l,f),n.memoizedState=h.state,t=n.child):t=Ca(t,n,f),t}function Hm(t,n,l,o){return wi(),n.flags|=256,an(t,n,l,o),n.child}var Jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ef(t){return{baseLanes:t,cachePool:rs()}}function tf(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Pn),t}function $m(t,n,l){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(zt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Pe){if(f?cl(n):dl(),(t=ht)?(t=Xg(t,Nn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:bi!==null?{id:ii,overflow:Gn}:null,retryLane:536870912,hydrationErrors:null},l=Iu(t),l.return=n,n.child=l,Pt=n,ht=null)):t=null,t===null)throw Wi(n);return Uf(t)?n.lanes=32:n.lanes=536870912,null}var T=o.children;return o=o.fallback,f?(dl(),f=n.mode,T=nc({mode:"hidden",children:T},f),o=ya(o,f,l,null),T.return=n,o.return=n,T.sibling=o,n.child=T,o=n.child,o.memoizedState=ef(l),o.childLanes=tf(t,v,l),n.memoizedState=Jd,vo(null,o)):(cl(n),nf(n,T))}var I=t.memoizedState;if(I!==null&&(T=I.dehydrated,T!==null)){if(h)n.flags&256?(cl(n),n.flags&=-257,n=af(t,n,l)):n.memoizedState!==null?(dl(),n.child=t.child,n.flags|=128,n=null):(dl(),T=o.fallback,f=n.mode,o=nc({mode:"visible",children:o.children},f),T=ya(T,f,l,null),T.flags|=2,o.return=n,T.return=n,o.sibling=T,n.child=o,we(n,t.child,null,l),o=n.child,o.memoizedState=ef(l),o.childLanes=tf(t,v,l),n.memoizedState=Jd,n=vo(null,o));else if(cl(n),Uf(T)){if(v=T.nextSibling&&T.nextSibling.dataset,v)var P=v.dgst;v=P,o=Error(r(419)),o.stack="",o.digest=v,nr({value:o,source:null,stack:null}),n=af(t,n,l)}else if(Ht||ri(t,n,l,!1),v=(l&t.childLanes)!==0,Ht||v){if(v=gt,v!==null&&(o=pu(v,l),o!==0&&o!==I.retryLane))throw I.retryLane=o,Fi(t,o),zn(v,t,o),Qd;If(T)||dc(),n=af(t,n,l)}else If(T)?(n.flags|=192,n.child=t.child,n=null):(t=I.treeContext,ht=oi(T.nextSibling),Pt=n,Pe=!0,Pi=null,Nn=!1,t!==null&&Bu(n,t),n=nf(n,o.children),n.flags|=4096);return n}return f?(dl(),T=o.fallback,f=n.mode,I=t.child,P=I.sibling,o=yi(I,{mode:"hidden",children:o.children}),o.subtreeFlags=I.subtreeFlags&65011712,P!==null?T=yi(P,T):(T=ya(T,f,l,null),T.flags|=2),T.return=n,o.return=n,o.sibling=T,n.child=o,vo(null,o),o=n.child,T=t.child.memoizedState,T===null?T=ef(l):(f=T.cachePool,f!==null?(I=bt._currentValue,f=f.parent!==I?{parent:I,pool:I}:f):f=rs(),T={baseLanes:T.baseLanes|l,cachePool:f}),o.memoizedState=T,o.childLanes=tf(t,v,l),n.memoizedState=Jd,vo(t.child,o)):(cl(n),l=t.child,t=l.sibling,l=yi(l,{mode:"visible",children:o.children}),l.return=n,l.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=l,n.memoizedState=null,l)}function nf(t,n){return n=nc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function nc(t,n){return t=Ot(22,t,null,n),t.lanes=0,t}function af(t,n,l){return we(n,t.child,null,l),t=nf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Gm(t,n,l){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),ns(t.return,n,l)}function lf(t,n,l,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=l,v.tailMode=f,v.treeForkCount=h)}function Vm(t,n,l){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=zt.current,T=(v&2)!==0;if(T?(v=v&1|2,n.flags|=128):v&=1,C(zt,v),an(t,n,o,l),o=Pe?Yi:0,!T&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Gm(t,l,n);else if(t.tag===19)Gm(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(l=n.child,f=null;l!==null;)t=l.alternate,t!==null&&Vu(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),lf(n,!1,f,l,h,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Vu(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}lf(n,!0,l,null,h,o);break;case"together":lf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Ca(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),hl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(ri(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(r(153));if(n.child!==null){for(t=n.child,l=yi(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=yi(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function rf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&as(t)))}function Uw(t,n,l){switch(n.tag){case 3:Me(n,n.stateNode.containerInfo),ai(n,bt,t.memoizedState.cache),wi();break;case 27:case 5:Ct(n);break;case 4:Me(n,n.stateNode.containerInfo);break;case 10:ai(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Dd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(cl(n),n.flags|=128,null):(l&n.child.childLanes)!==0?$m(t,n,l):(cl(n),t=Ca(t,n,l),t!==null?t.sibling:null);cl(n);break;case 19:var f=(t.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(ri(t,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return Vm(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(zt,zt.current),o)break;return null;case 22:return n.lanes=0,Lm(t,n,l,n.pendingProps);case 24:ai(n,bt,t.memoizedState.cache)}return Ca(t,n,l)}function Fm(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ht=!0;else{if(!rf(t,l)&&(n.flags&128)===0)return Ht=!1,Uw(t,n,l);Ht=(t.flags&131072)!==0}else Ht=!1,Pe&&(n.flags&1048576)!==0&&Uu(n,Yi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Ki(n.elementType),n.type=t,typeof t=="function")to(t)?(o=ur(t,o),n.tag=1,n=qm(null,n,t,o,l)):(n.tag=0,n=Zd(null,n,t,o,l));else{if(t!=null){var f=t.$$typeof;if(f===V){n.tag=11,n=Mm(null,n,t,o,l);break e}else if(f===Q){n.tag=14,n=Om(null,n,t,o,l);break e}}throw n=ye(t)||t,Error(r(306,n,""))}}return n;case 0:return Zd(t,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=ur(o,n.pendingProps),qm(t,n,o,f,l);case 3:e:{if(Me(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,os(t,n),mo(n,o,null,l);var v=n.memoizedState;if(o=v.cache,ai(n,bt,o),o!==h.cache&&is(n,[bt],l,!0),ho(),o=v.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=Hm(t,n,o,l);break e}else if(o!==f){f=Tn(Error(r(424)),n),nr(f),n=Hm(t,n,o,l);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ht=oi(t.firstChild),Pt=n,Pe=!0,Pi=null,Nn=!0,l=mt(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(wi(),o===f){n=Ca(t,n,l);break e}an(t,n,o,l)}n=n.child}return n;case 26:return tc(t,n),t===null?(l=ny(n.type,null,n.pendingProps,null))?n.memoizedState=l:Pe||(l=n.type,t=n.pendingProps,o=xc(X.current).createElement(l),o[Yt]=n,o[Bt]=t,ln(o,l,t),At(o),n.stateNode=o):n.memoizedState=ny(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ct(n),t===null&&Pe&&(o=n.stateNode=Jg(n.type,n.pendingProps,X.current),Pt=n,Nn=!0,f=ht,bl(n.type)?(Bf=f,ht=oi(o.firstChild)):ht=f),an(t,n,n.pendingProps.children,l),tc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Pe&&((f=o=ht)&&(o=hk(o,n.type,n.pendingProps,Nn),o!==null?(n.stateNode=o,Pt=n,ht=oi(o.firstChild),Nn=!1,f=!0):f=!1),f||Wi(n)),Ct(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,Of(f,h)?o=null:v!==null&&Of(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=_d(t,n,Nw,null,null,l),zo._currentValue=f),tc(t,n),an(t,n,o,l),n.child;case 6:return t===null&&Pe&&((t=l=ht)&&(l=mk(l,n.pendingProps,Nn),l!==null?(n.stateNode=l,Pt=n,ht=null,t=!0):t=!1),t||Wi(n)),null;case 13:return $m(t,n,l);case 4:return Me(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=we(n,null,o,l):an(t,n,o,l),n.child;case 11:return Mm(t,n,n.type,n.pendingProps,l);case 7:return an(t,n,n.pendingProps,l),n.child;case 8:return an(t,n,n.pendingProps.children,l),n.child;case 12:return an(t,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,ai(n,n.type,o.value),an(t,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,ba(n),f=Wt(f),o=o(f),n.flags|=1,an(t,n,o,l),n.child;case 14:return Om(t,n,n.type,n.pendingProps,l);case 15:return zm(t,n,n.type,n.pendingProps,l);case 19:return Vm(t,n,l);case 31:return Iw(t,n,l);case 22:return Lm(t,n,l,n.pendingProps);case 24:return ba(n),o=Wt(bt),t===null?(f=oo(),f===null&&(f=gt,h=wa(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=l),f=h),n.memoizedState={parent:o,cache:f},sr(n),ai(n,bt,f)):((t.lanes&l)!==0&&(os(t,n),mo(n,null,null,l),ho()),f=t.memoizedState,h=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),ai(n,bt,o)):(o=h.cache,ai(n,bt,o),o!==f.cache&&is(n,[bt],l,!0))),an(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Ta(t){t.flags|=4}function sf(t,n,l,o,f){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(xg())t.flags|=8192;else throw y=rr,uo}else t.flags&=-16777217}function Ym(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!sy(n))if(xg())t.flags|=8192;else throw y=rr,uo}function ic(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?wt():536870912,t.lanes|=n,gs|=n)}function wo(t,n){if(!Pe)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function kt(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,o=0;if(n)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=l,n}function Bw(t,n,l){var o=n.pendingProps;switch(ao(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(n),null;case 1:return kt(n),null;case 3:return l=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),li(bt),Ve(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(ll(n)?Ta(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ro())),kt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(Ta(n),h!==null?(kt(n),Ym(n,h)):(kt(n),sf(n,f,null,o,l))):h?h!==t.memoizedState?(Ta(n),kt(n),Ym(n,h)):(kt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&Ta(n),kt(n),sf(n,f,t,o,l)),null;case 27:if(vt(n),l=X.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ta(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return kt(n),null}t=W.current,ll(n)?qu(n):(t=Jg(f,o,l),n.stateNode=t,Ta(n))}return kt(n),null;case 5:if(vt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ta(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return kt(n),null}if(h=W.current,ll(n))qu(n);else{var v=xc(X.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}h[Yt]=n,h[Bt]=o;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.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=h;e:switch(ln(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ta(n)}}return kt(n),sf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Ta(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=X.current,ll(n)){if(t=n.stateNode,l=n.memoizedProps,o=null,f=Pt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Yt]=n,t=!!(t.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||$g(t.nodeValue,l)),t||Wi(n,!0)}else t=xc(t).createTextNode(o),t[Yt]=n,n.stateNode=t}return kt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(o=ll(n),l!==null){if(t===null){if(!o)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Yt]=n}else wi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),t=!1}else l=ro(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Fn(n),n):(Fn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return kt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=ll(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Yt]=n}else wi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),f=!1}else f=ro(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Fn(n),n):(Fn(n),null)}return Fn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=o!==null,t=t!==null&&t.memoizedState!==null,l&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),ic(n,n.updateQueue),kt(n),null);case 4:return Ve(),t===null&&Nf(n.stateNode.containerInfo),kt(n),null;case 10:return li(n.type),kt(n),null;case 19:if(z(zt),o=n.memoizedState,o===null)return kt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)wo(o,!1);else{if(Rt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Vu(t),h!==null){for(n.flags|=128,wo(o,!1),t=h.updateQueue,n.updateQueue=t,ic(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)Lu(l,t),l=l.sibling;return C(zt,zt.current&1|2),Pe&&vi(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&_t()>oc&&(n.flags|=128,f=!0,wo(o,!1),n.lanes=4194304)}else{if(!f)if(t=Vu(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,ic(n,t),wo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Pe)return kt(n),null}else 2*_t()-o.renderingStartTime>oc&&l!==536870912&&(n.flags|=128,f=!0,wo(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_t(),t.sibling=null,l=zt.current,C(zt,f?l&1|2:l&1),Pe&&vi(n,o.treeForkCount),t):(kt(n),null);case 22:case 23:return Fn(n),Nd(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(l&536870912)!==0&&(n.flags&128)===0&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),l=n.updateQueue,l!==null&&ic(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==l&&(n.flags|=2048),t!==null&&z(ka),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),li(bt),kt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function qw(t,n){switch(ao(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return li(bt),Ve(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return vt(n),null;case 31:if(n.memoizedState!==null){if(Fn(n),n.alternate===null)throw Error(r(340));wi()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Fn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));wi()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return z(zt),null;case 4:return Ve(),null;case 10:return li(n.type),null;case 22:case 23:return Fn(n),Nd(),t!==null&&z(ka),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return li(bt),null;case 25:return null;default:return null}}function Pm(t,n){switch(ao(n),n.tag){case 3:li(bt),Ve();break;case 26:case 27:case 5:vt(n);break;case 4:Ve();break;case 31:n.memoizedState!==null&&Fn(n);break;case 13:Fn(n);break;case 19:z(zt);break;case 10:li(n.type);break;case 22:case 23:Fn(n),Nd(),t!==null&&z(ka);break;case 24:li(bt)}}function ko(t,n){try{var l=n.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&t)===t){o=void 0;var h=l.create,v=l.inst;o=h(),v.destroy=o}l=l.next}while(l!==f)}}catch(T){ut(n,n.return,T)}}function fl(t,n,l){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var v=o.inst,T=v.destroy;if(T!==void 0){v.destroy=void 0,f=n;var I=l,P=T;try{P()}catch(ne){ut(f,I,ne)}}}o=o.next}while(o!==h)}}catch(ne){ut(n,n.return,ne)}}function Wm(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{Uh(n,l)}catch(o){ut(t,t.return,o)}}}function Km(t,n,l){l.props=ur(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(o){ut(t,n,o)}}function So(t,n){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof l=="function"?t.refCleanup=l(o):l.current=o}}catch(f){ut(t,n,f)}}function Xi(t,n){var l=t.ref,o=t.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){ut(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){ut(t,n,f)}else l.current=null}function Xm(t){var n=t.type,l=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&o.focus();break e;case"img":l.src?o.src=l.src:l.srcSet&&(o.srcset=l.srcSet)}}catch(f){ut(t,t.return,f)}}function of(t,n,l){try{var o=t.stateNode;ok(o,t.type,l,n),o[Bt]=n}catch(f){ut(t,t.return,f)}}function Qm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&bl(t.type)||t.tag===4}function uf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Qm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&bl(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function cf(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Qt));else if(o!==4&&(o===27&&bl(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(cf(t,n,l),t=t.sibling;t!==null;)cf(t,n,l),t=t.sibling}function ac(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(o!==4&&(o===27&&bl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(ac(t,n,l),t=t.sibling;t!==null;)ac(t,n,l),t=t.sibling}function Zm(t){var n=t.stateNode,l=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);ln(n,o,l),n[Yt]=t,n[Bt]=l}catch(h){ut(t,t.return,h)}}var Ea=!1,$t=!1,df=!1,Jm=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function Hw(t,n){if(t=t.containerInfo,_f=Cc,t=Wr(t),Xl(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{l.nodeType,h.nodeType}catch{l=null;break e}var v=0,T=-1,I=-1,P=0,ne=0,se=t,K=null;t:for(;;){for(var J;se!==l||f!==0&&se.nodeType!==3||(T=v+f),se!==h||o!==0&&se.nodeType!==3||(I=v+o),se.nodeType===3&&(v+=se.nodeValue.length),(J=se.firstChild)!==null;)K=se,se=J;for(;;){if(se===t)break t;if(K===l&&++P===f&&(T=v),K===h&&++ne===o&&(I=v),(J=se.nextSibling)!==null)break;se=K,K=se.parentNode}se=J}l=T===-1||I===-1?null:{start:T,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(Mf={focusedElem:t,selectionRange:l},Cc=!1,Zt=n;Zt!==null;)if(n=Zt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Zt=t;else for(;Zt!==null;){switch(n=Zt,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,l=n,f=h.memoizedProps,h=h.memoizedState,o=l.stateNode;try{var je=ur(l.type,f);t=o.getSnapshotBeforeUpdate(je,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(ze){ut(l,l.return,ze)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)Lf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Lf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=n.sibling,t!==null){t.return=n.return,Zt=t;break}Zt=n.return}}function eg(t,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:Na(t,l),o&4&&ko(5,l);break;case 1:if(Na(t,l),o&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(v){ut(l,l.return,v)}else{var f=ur(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ut(l,l.return,v)}}o&64&&Wm(l),o&512&&So(l,l.return);break;case 3:if(Na(t,l),o&64&&(t=l.updateQueue,t!==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{Uh(t,n)}catch(v){ut(l,l.return,v)}}break;case 27:n===null&&o&4&&Zm(l);case 26:case 5:Na(t,l),n===null&&o&4&&Xm(l),o&512&&So(l,l.return);break;case 12:Na(t,l);break;case 31:Na(t,l),o&4&&ig(t,l);break;case 13:Na(t,l),o&4&&ag(t,l),o&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Xw.bind(null,l),gk(t,l))));break;case 22:if(o=l.memoizedState!==null||Ea,!o){n=n!==null&&n.memoizedState!==null||$t,f=Ea;var h=$t;Ea=o,($t=n)&&!h?Da(t,l,(l.subtreeFlags&8772)!==0):Na(t,l),Ea=f,$t=h}break;case 30:break;default:Na(t,l)}}function tg(t){var n=t.alternate;n!==null&&(t.alternate=null,tg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Is(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var jt=null,Rn=!1;function Aa(t,n,l){for(l=l.child;l!==null;)ng(t,n,l),l=l.sibling}function ng(t,n,l){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Ft,l)}catch{}switch(l.tag){case 26:$t||Xi(l,n),Aa(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:$t||Xi(l,n);var o=jt,f=Rn;bl(l.type)&&(jt=l.stateNode,Rn=!1),Aa(t,n,l),_o(l.stateNode),jt=o,Rn=f;break;case 5:$t||Xi(l,n);case 6:if(o=jt,f=Rn,jt=null,Aa(t,n,l),jt=o,Rn=f,jt!==null)if(Rn)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(l.stateNode)}catch(h){ut(l,n,h)}else try{jt.removeChild(l.stateNode)}catch(h){ut(l,n,h)}break;case 18:jt!==null&&(Rn?(t=jt,Wg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),js(t)):Wg(jt,l.stateNode));break;case 4:o=jt,f=Rn,jt=l.stateNode.containerInfo,Rn=!0,Aa(t,n,l),jt=o,Rn=f;break;case 0:case 11:case 14:case 15:fl(2,l,n),$t||fl(4,l,n),Aa(t,n,l);break;case 1:$t||(Xi(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&Km(l,n,o)),Aa(t,n,l);break;case 21:Aa(t,n,l);break;case 22:$t=(o=$t)||l.memoizedState!==null,Aa(t,n,l),$t=o;break;default:Aa(t,n,l)}}function ig(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{js(t)}catch(l){ut(n,n.return,l)}}}function ag(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{js(t)}catch(l){ut(n,n.return,l)}}function $w(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Jm),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Jm),n;default:throw Error(r(435,t.tag))}}function lc(t,n){var l=$w(t);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=Qw.bind(null,t,o);o.then(f,f)}})}function _n(t,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],h=t,v=n,T=v;e:for(;T!==null;){switch(T.tag){case 27:if(bl(T.type)){jt=T.stateNode,Rn=!1;break e}break;case 5:jt=T.stateNode,Rn=!1;break e;case 3:case 4:jt=T.stateNode.containerInfo,Rn=!0;break e}T=T.return}if(jt===null)throw Error(r(160));ng(h,v,f),jt=null,Rn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)lg(n,t),n=n.sibling}var Si=null;function lg(t,n){var l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:_n(n,t),Mn(t),o&4&&(fl(3,t,t.return),ko(3,t),fl(5,t,t.return));break;case 1:_n(n,t),Mn(t),o&512&&($t||l===null||Xi(l,l.return)),o&64&&Ea&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?o:l.concat(o))));break;case 26:var f=Si;if(_n(n,t),Mn(t),o&512&&($t||l===null||Xi(l,l.return)),o&4){var h=l!==null?l.memoizedState:null;if(o=t.memoizedState,l===null)if(o===null)if(t.stateNode===null){e:{o=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Di]||h[Yt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),ln(h,o,l),h[Yt]=t,At(h),o=h;break e;case"link":var v=ly("link","href",f).get(o+(l.href||""));if(v){for(var T=0;T<v.length;T++)if(h=v[T],h.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&h.getAttribute("rel")===(l.rel==null?null:l.rel)&&h.getAttribute("title")===(l.title==null?null:l.title)&&h.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(T,1);break t}}h=f.createElement(o),ln(h,o,l),f.head.appendChild(h);break;case"meta":if(v=ly("meta","content",f).get(o+(l.content||""))){for(T=0;T<v.length;T++)if(h=v[T],h.getAttribute("content")===(l.content==null?null:""+l.content)&&h.getAttribute("name")===(l.name==null?null:l.name)&&h.getAttribute("property")===(l.property==null?null:l.property)&&h.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&h.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(T,1);break t}}h=f.createElement(o),ln(h,o,l),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[Yt]=t,At(h),o=h}t.stateNode=o}else ry(f,t.type,t.stateNode);else t.stateNode=ay(f,o,t.memoizedProps);else h!==o?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,o===null?ry(f,t.type,t.stateNode):ay(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&of(t,t.memoizedProps,l.memoizedProps)}break;case 27:_n(n,t),Mn(t),o&512&&($t||l===null||Xi(l,l.return)),l!==null&&o&4&&of(t,t.memoizedProps,l.memoizedProps);break;case 5:if(_n(n,t),Mn(t),o&512&&($t||l===null||Xi(l,l.return)),t.flags&32){f=t.stateNode;try{Va(f,"")}catch(je){ut(t,t.return,je)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,of(t,f,l!==null?l.memoizedProps:f)),o&1024&&(df=!0);break;case 6:if(_n(n,t),Mn(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,l=t.stateNode;try{l.nodeValue=o}catch(je){ut(t,t.return,je)}}break;case 3:if(wc=null,f=Si,Si=bc(n.containerInfo),_n(n,t),Si=f,Mn(t),o&4&&l!==null&&l.memoizedState.isDehydrated)try{js(n.containerInfo)}catch(je){ut(t,t.return,je)}df&&(df=!1,rg(t));break;case 4:o=Si,Si=bc(t.stateNode.containerInfo),_n(n,t),Mn(t),Si=o;break;case 12:_n(n,t),Mn(t);break;case 31:_n(n,t),Mn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,lc(t,o)));break;case 13:_n(n,t),Mn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(sc=_t()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,lc(t,o)));break;case 22:f=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,P=Ea,ne=$t;if(Ea=P||f,$t=ne||I,_n(n,t),$t=ne,Ea=P,Mn(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||I||Ea||$t||cr(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){I=l=n;try{if(h=I.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{T=I.stateNode;var se=I.memoizedProps.style,K=se!=null&&se.hasOwnProperty("display")?se.display:null;T.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(je){ut(I,I.return,je)}}}else if(n.tag===6){if(l===null){I=n;try{I.stateNode.nodeValue=f?"":I.memoizedProps}catch(je){ut(I,I.return,je)}}}else if(n.tag===18){if(l===null){I=n;try{var J=I.stateNode;f?Kg(J,!0):Kg(I.stateNode,!1)}catch(je){ut(I,I.return,je)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(l=o.retryQueue,l!==null&&(o.retryQueue=null,lc(t,l))));break;case 19:_n(n,t),Mn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,lc(t,o)));break;case 30:break;case 21:break;default:_n(n,t),Mn(t)}}function Mn(t){var n=t.flags;if(n&2){try{for(var l,o=t.return;o!==null;){if(Qm(o)){l=o;break}o=o.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,h=uf(t);ac(t,h,f);break;case 5:var v=l.stateNode;l.flags&32&&(Va(v,""),l.flags&=-33);var T=uf(t);ac(t,T,v);break;case 3:case 4:var I=l.stateNode.containerInfo,P=uf(t);cf(t,P,I);break;default:throw Error(r(161))}}catch(ne){ut(t,t.return,ne)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function rg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;rg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Na(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)eg(t,n.alternate,n),n=n.sibling}function cr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:fl(4,n,n.return),cr(n);break;case 1:Xi(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Km(n,n.return,l),cr(n);break;case 27:_o(n.stateNode);case 26:case 5:Xi(n,n.return),cr(n);break;case 22:n.memoizedState===null&&cr(n);break;case 30:cr(n);break;default:cr(n)}t=t.sibling}}function Da(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,h=n,v=h.flags;switch(h.tag){case 0:case 11:case 15:Da(f,h,l),ko(4,h);break;case 1:if(Da(f,h,l),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){ut(o,o.return,P)}if(o=h,f=o.updateQueue,f!==null){var T=o.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)Ih(I[f],T)}catch(P){ut(o,o.return,P)}}l&&v&64&&Wm(h),So(h,h.return);break;case 27:Zm(h);case 26:case 5:Da(f,h,l),l&&o===null&&v&4&&Xm(h),So(h,h.return);break;case 12:Da(f,h,l);break;case 31:Da(f,h,l),l&&v&4&&ig(f,h);break;case 13:Da(f,h,l),l&&v&4&&ag(f,h);break;case 22:h.memoizedState===null&&Da(f,h,l),So(h,h.return);break;case 30:break;default:Da(f,h,l)}n=n.sibling}}function ff(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&ar(l))}function pf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ar(t))}function ji(t,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)sg(t,n,l,o),n=n.sibling}function sg(t,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:ji(t,n,l,o),f&2048&&ko(9,n);break;case 1:ji(t,n,l,o);break;case 3:ji(t,n,l,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ar(t)));break;case 12:if(f&2048){ji(t,n,l,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,T=h.onPostCommit;typeof T=="function"&&T(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){ut(n,n.return,I)}}else ji(t,n,l,o);break;case 31:ji(t,n,l,o);break;case 13:ji(t,n,l,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?ji(t,n,l,o):jo(t,n):h._visibility&2?ji(t,n,l,o):(h._visibility|=2,ps(t,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&ff(v,n);break;case 24:ji(t,n,l,o),f&2048&&pf(n.alternate,n);break;default:ji(t,n,l,o)}}function ps(t,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,T=l,I=o,P=v.flags;switch(v.tag){case 0:case 11:case 15:ps(h,v,T,I,f),ko(8,v);break;case 23:break;case 22:var ne=v.stateNode;v.memoizedState!==null?ne._visibility&2?ps(h,v,T,I,f):jo(h,v):(ne._visibility|=2,ps(h,v,T,I,f)),f&&P&2048&&ff(v.alternate,v);break;case 24:ps(h,v,T,I,f),f&&P&2048&&pf(v.alternate,v);break;default:ps(h,v,T,I,f)}n=n.sibling}}function jo(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,o=n,f=o.flags;switch(o.tag){case 22:jo(l,o),f&2048&&ff(o.alternate,o);break;case 24:jo(l,o),f&2048&&pf(o.alternate,o);break;default:jo(l,o)}n=n.sibling}}var Co=8192;function hs(t,n,l){if(t.subtreeFlags&Co)for(t=t.child;t!==null;)og(t,n,l),t=t.sibling}function og(t,n,l){switch(t.tag){case 26:hs(t,n,l),t.flags&Co&&t.memoizedState!==null&&Ak(l,Si,t.memoizedState,t.memoizedProps);break;case 5:hs(t,n,l);break;case 3:case 4:var o=Si;Si=bc(t.stateNode.containerInfo),hs(t,n,l),Si=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Co,Co=16777216,hs(t,n,l),Co=o):hs(t,n,l));break;default:hs(t,n,l)}}function ug(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function To(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];Zt=o,dg(o,t)}ug(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)cg(t),t=t.sibling}function cg(t){switch(t.tag){case 0:case 11:case 15:To(t),t.flags&2048&&fl(9,t,t.return);break;case 3:To(t);break;case 12:To(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,rc(t)):To(t);break;default:To(t)}}function rc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];Zt=o,dg(o,t)}ug(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:fl(8,n,n.return),rc(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,rc(n));break;default:rc(n)}t=t.sibling}}function dg(t,n){for(;Zt!==null;){var l=Zt;switch(l.tag){case 0:case 11:case 15:fl(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var o=l.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ar(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,Zt=o;else e:for(l=t;Zt!==null;){o=Zt;var f=o.sibling,h=o.return;if(tg(o),o===l){Zt=null;break e}if(f!==null){f.return=h,Zt=f;break e}Zt=h}}}var Gw={getCacheForType:function(t){var n=Wt(bt),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Wt(bt).controller.signal}},Vw=typeof WeakMap=="function"?WeakMap:Map,rt=0,gt=null,We=null,Ze=0,ot=0,Yn=null,pl=!1,ms=!1,hf=!1,Ra=0,Rt=0,hl=0,dr=0,mf=0,Pn=0,gs=0,Eo=null,On=null,gf=!1,sc=0,fg=0,oc=1/0,uc=null,ml=null,Kt=0,gl=null,ys=null,_a=0,yf=0,xf=null,pg=null,Ao=0,bf=null;function Wn(){return(rt&2)!==0&&Ze!==0?Ze&-Ze:F.T!==null?Cf():Ls()}function hg(){if(Pn===0)if((Ze&536870912)===0||Pe){var t=Cr;Cr<<=1,(Cr&3932160)===0&&(Cr=262144),Pn=t}else Pn=536870912;return t=Vn.current,t!==null&&(t.flags|=32),Pn}function zn(t,n,l){(t===gt&&(ot===2||ot===9)||t.cancelPendingCommit!==null)&&(xs(t,0),yl(t,Ze,Pn,!1)),qa(t,l),((rt&2)===0||t!==gt)&&(t===gt&&((rt&2)===0&&(dr|=l),Rt===4&&yl(t,Ze,Pn,!1)),Qi(t))}function mg(t,n,l){if((rt&6)!==0)throw Error(r(327));var o=!l&&(n&127)===0&&(n&t.expiredLanes)===0||Jt(t,n),f=o?Pw(t,n):wf(t,n,!0),h=o;do{if(f===0){ms&&!o&&yl(t,n,0,!1);break}else{if(l=t.current.alternate,h&&!Fw(l)){f=wf(t,n,!1),h=!1;continue}if(f===2){if(h=n,t.errorRecoveryDisabledLanes&h)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var T=t;f=Eo;var I=T.current.memoizedState.isDehydrated;if(I&&(xs(T,v).flags|=256),v=wf(T,v,!1),v!==2){if(hf&&!I){T.errorRecoveryDisabledLanes|=h,dr|=h,f=4;break e}h=On,On=f,h!==null&&(On===null?On=h:On.push.apply(On,h))}f=v}if(h=!1,f!==2)continue}}if(f===1){xs(t,0),yl(t,n,0,!0);break}e:{switch(o=t,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:yl(o,n,Pn,!pl);break e;case 2:On=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=sc+300-_t(),10<f)){if(yl(o,n,Pn,!pl),Ua(o,0,!0)!==0)break e;_a=n,o.timeoutHandle=Yg(gg.bind(null,o,l,On,uc,gf,n,Pn,dr,gs,pl,h,"Throttled",-0,0),f);break e}gg(o,l,On,uc,gf,n,Pn,dr,gs,pl,h,null,-0,0)}}break}while(!0);Qi(t)}function gg(t,n,l,o,f,h,v,T,I,P,ne,se,K,J){if(t.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qt},og(n,h,se);var je=(h&62914560)===h?sc-_t():(h&4194048)===h?fg-_t():0;if(je=Nk(se,je),je!==null){_a=h,t.cancelPendingCommit=je(jg.bind(null,t,n,h,l,o,f,v,T,I,ne,se,null,K,J)),yl(t,h,v,!P);return}}jg(t,n,h,l,o,f,v,T,I)}function Fw(t){for(var n=t;;){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 o=0;o<l.length;o++){var f=l[o],h=f.getSnapshot;f=f.value;try{if(!un(h(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function yl(t,n,l,o){n&=~mf,n&=~dr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-st(f),v=1<<h;o[h]=-1,f&=~v}l!==0&&Os(t,l,n)}function cc(){return(rt&6)===0?(No(0),!1):!0}function vf(){if(We!==null){if(ot===0)var t=We.return;else t=We,cn=xa=null,zd(t),_=null,U=0,t=We;for(;t!==null;)Pm(t.alternate,t),t=t.return;We=null}}function xs(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,dk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),_a=0,vf(),gt=t,We=l=yi(t.current,null),Ze=n,ot=0,Yn=null,pl=!1,ms=Jt(t,n),hf=!1,gs=Pn=mf=dr=hl=Rt=0,On=Eo=null,gf=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var f=31-st(o),h=1<<f;n|=t[f],o&=~h}return Ra=n,Qr(),l}function yg(t,n){qe=null,F.H=bo,n===sl||n===ss?(n=k(),ot=3):n===uo?(n=k(),ot=4):ot=n===Qd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Yn=n,We===null&&(Rt=1,Ju(t,Tn(n,t.current)))}function xg(){var t=Vn.current;return t===null?!0:(Ze&4194048)===Ze?si===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?t===si:!1}function bg(){var t=F.H;return F.H=bo,t===null?bo:t}function vg(){var t=F.A;return F.A=Gw,t}function dc(){Rt=4,pl||(Ze&4194048)!==Ze&&Vn.current!==null||(ms=!0),(hl&134217727)===0&&(dr&134217727)===0||gt===null||yl(gt,Ze,Pn,!1)}function wf(t,n,l){var o=rt;rt|=2;var f=bg(),h=vg();(gt!==t||Ze!==n)&&(uc=null,xs(t,n)),n=!1;var v=Rt;e:do try{if(ot!==0&&We!==null){var T=We,I=Yn;switch(ot){case 8:vf(),v=6;break e;case 3:case 2:case 9:case 6:Vn.current===null&&(n=!0);var P=ot;if(ot=0,Yn=null,bs(t,T,I,P),l&&ms){v=0;break e}break;default:P=ot,ot=0,Yn=null,bs(t,T,I,P)}}Yw(),v=Rt;break}catch(ne){yg(t,ne)}while(!0);return n&&t.shellSuspendCounter++,cn=xa=null,rt=o,F.H=f,F.A=h,We===null&&(gt=null,Ze=0,Qr()),v}function Yw(){for(;We!==null;)wg(We)}function Pw(t,n){var l=rt;rt|=2;var o=bg(),f=vg();gt!==t||Ze!==n?(uc=null,oc=_t()+500,xs(t,n)):ms=Jt(t,n);e:do try{if(ot!==0&&We!==null){n=We;var h=Yn;t:switch(ot){case 1:ot=0,Yn=null,bs(t,n,h,1);break;case 2:case 9:if(co(h)){ot=0,Yn=null,kg(n);break}n=function(){ot!==2&&ot!==9||gt!==t||(ot=7),Qi(t)},h.then(n,n);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:co(h)?(ot=0,Yn=null,kg(n)):(ot=0,Yn=null,bs(t,n,h,7));break;case 5:var v=null;switch(We.tag){case 26:v=We.memoizedState;case 5:case 27:var T=We;if(v?sy(v):T.stateNode.complete){ot=0,Yn=null;var I=T.sibling;if(I!==null)We=I;else{var P=T.return;P!==null?(We=P,fc(P)):We=null}break t}}ot=0,Yn=null,bs(t,n,h,5);break;case 6:ot=0,Yn=null,bs(t,n,h,6);break;case 8:vf(),Rt=6;break e;default:throw Error(r(462))}}Ww();break}catch(ne){yg(t,ne)}while(!0);return cn=xa=null,F.H=o,F.A=f,rt=l,We!==null?0:(gt=null,Ze=0,Qr(),Rt)}function Ww(){for(;We!==null&&!Qn();)wg(We)}function wg(t){var n=Fm(t.alternate,t,Ra);t.memoizedProps=t.pendingProps,n===null?fc(t):We=n}function kg(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=Bm(l,n,n.pendingProps,n.type,void 0,Ze);break;case 11:n=Bm(l,n,n.pendingProps,n.type.render,n.ref,Ze);break;case 5:zd(n);default:Pm(l,n),n=We=Lu(n,Ra),n=Fm(l,n,Ra)}t.memoizedProps=t.pendingProps,n===null?fc(t):We=n}function bs(t,n,l,o){cn=xa=null,zd(n),_=null,U=0;var f=n.return;try{if(Lw(t,f,n,l,Ze)){Rt=1,Ju(t,Tn(l,t.current)),We=null;return}}catch(h){if(f!==null)throw We=f,h;Rt=1,Ju(t,Tn(l,t.current)),We=null;return}n.flags&32768?(Pe||o===1?t=!0:ms||(Ze&536870912)!==0?t=!1:(pl=t=!0,(o===2||o===9||o===3||o===6)&&(o=Vn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Sg(n,t)):fc(n)}function fc(t){var n=t;do{if((n.flags&32768)!==0){Sg(n,pl);return}t=n.return;var l=Bw(n.alternate,n,Ra);if(l!==null){We=l;return}if(n=n.sibling,n!==null){We=n;return}We=n=t}while(n!==null);Rt===0&&(Rt=5)}function Sg(t,n){do{var l=qw(t.alternate,t);if(l!==null){l.flags&=32767,We=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){We=t;return}We=t=l}while(t!==null);Rt=6,We=null}function jg(t,n,l,o,f,h,v,T,I){t.cancelPendingCommit=null;do pc();while(Kt!==0);if((rt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Js,_l(t,l,h,v,T,I),t===gt&&(We=gt=null,Ze=0),ys=n,gl=t,_a=l,yf=h,xf=f,pg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Zw(Ee,function(){return Ng(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=F.T,F.T=null,f=oe.p,oe.p=2,v=rt,rt|=4;try{Hw(t,n,l)}finally{rt=v,oe.p=f,F.T=o}}Kt=1,Cg(),Tg(),Eg()}}function Cg(){if(Kt===1){Kt=0;var t=gl,n=ys,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=F.T,F.T=null;var o=oe.p;oe.p=2;var f=rt;rt|=4;try{lg(n,t);var h=Mf,v=Wr(t.containerInfo),T=h.focusedElem,I=h.selectionRange;if(v!==T&&T&&T.ownerDocument&&Kl(T.ownerDocument.documentElement,T)){if(I!==null&&Xl(T)){var P=I.start,ne=I.end;if(ne===void 0&&(ne=P),"selectionStart"in T)T.selectionStart=P,T.selectionEnd=Math.min(ne,T.value.length);else{var se=T.ownerDocument||document,K=se&&se.defaultView||window;if(K.getSelection){var J=K.getSelection(),je=T.textContent.length,ze=Math.min(I.start,je),pt=I.end===void 0?ze:Math.min(I.end,je);!J.extend&&ze>pt&&(v=pt,pt=ze,ze=v);var G=Nu(T,ze),B=Nu(T,pt);if(G&&B&&(J.rangeCount!==1||J.anchorNode!==G.node||J.anchorOffset!==G.offset||J.focusNode!==B.node||J.focusOffset!==B.offset)){var Y=se.createRange();Y.setStart(G.node,G.offset),J.removeAllRanges(),ze>pt?(J.addRange(Y),J.extend(B.node,B.offset)):(Y.setEnd(B.node,B.offset),J.addRange(Y))}}}}for(se=[],J=T;J=J.parentNode;)J.nodeType===1&&se.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<se.length;T++){var le=se[T];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Cc=!!_f,Mf=_f=null}finally{rt=f,oe.p=o,F.T=l}}t.current=n,Kt=2}}function Tg(){if(Kt===2){Kt=0;var t=gl,n=ys,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=F.T,F.T=null;var o=oe.p;oe.p=2;var f=rt;rt|=4;try{eg(t,n.alternate,n)}finally{rt=f,oe.p=o,F.T=l}}Kt=3}}function Eg(){if(Kt===4||Kt===3){Kt=0,La();var t=gl,n=ys,l=_a,o=pg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Kt=5:(Kt=0,ys=gl=null,Ag(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(ml=null),zs(l),n=n.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Ft,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=F.T,f=oe.p,oe.p=2,F.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var T=o[v];h(T.value,{componentStack:T.stack})}}finally{F.T=n,oe.p=f}}(_a&3)!==0&&pc(),Qi(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===bf?Ao++:(Ao=0,bf=t):Ao=0,No(0)}}function Ag(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,ar(n)))}function pc(){return Cg(),Tg(),Eg(),Ng()}function Ng(){if(Kt!==5)return!1;var t=gl,n=yf;yf=0;var l=zs(_a),o=F.T,f=oe.p;try{oe.p=32>l?32:l,F.T=null,l=xf,xf=null;var h=gl,v=_a;if(Kt=0,ys=gl=null,_a=0,(rt&6)!==0)throw Error(r(331));var T=rt;if(rt|=4,cg(h.current),sg(h,h.current,v,l),rt=T,No(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Ft,h)}catch{}return!0}finally{oe.p=f,F.T=o,Ag(t,n)}}function Dg(t,n,l){n=Tn(l,n),n=Xd(t.stateNode,n,2),t=ul(t,n,2),t!==null&&(qa(t,2),Qi(t))}function ut(t,n,l){if(t.tag===3)Dg(t,t,l);else for(;n!==null;){if(n.tag===3){Dg(n,t,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(ml===null||!ml.has(o))){t=Tn(l,t),l=Rm(2),o=ul(n,l,2),o!==null&&(_m(l,o,n,t),qa(o,2),Qi(o));break}}n=n.return}}function kf(t,n,l){var o=t.pingCache;if(o===null){o=t.pingCache=new Vw;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(l)||(hf=!0,f.add(l),t=Kw.bind(null,t,n,l),n.then(t,t))}function Kw(t,n,l){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,gt===t&&(Ze&l)===l&&(Rt===4||Rt===3&&(Ze&62914560)===Ze&&300>_t()-sc?(rt&2)===0&&xs(t,0):mf|=l,gs===Ze&&(gs=0)),Qi(t)}function Rg(t,n){n===0&&(n=wt()),t=Fi(t,n),t!==null&&(qa(t,n),Qi(t))}function Xw(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),Rg(t,l)}function Qw(t,n){var l=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),Rg(t,l)}function Zw(t,n){return Xt(t,n)}var hc=null,vs=null,Sf=!1,mc=!1,jf=!1,xl=0;function Qi(t){t!==vs&&t.next===null&&(vs===null?hc=vs=t:vs=vs.next=t),mc=!0,Sf||(Sf=!0,ek())}function No(t,n){if(!jf&&mc){jf=!0;do for(var l=!1,o=hc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-st(42|t)+1)-1,h&=f&~(v&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,zg(o,h))}else h=Ze,h=Ua(o,o===gt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Jt(o,h)||(l=!0,zg(o,h));o=o.next}while(l);jf=!1}}function Jw(){_g()}function _g(){mc=Sf=!1;var t=0;xl!==0&&ck()&&(t=xl);for(var n=_t(),l=null,o=hc;o!==null;){var f=o.next,h=Mg(o,n);h===0?(o.next=null,l===null?hc=f:l.next=f,f===null&&(vs=l)):(l=o,(t!==0||(h&3)!==0)&&(mc=!0)),o=f}Kt!==0&&Kt!==5||No(t),xl!==0&&(xl=0)}function Mg(t,n){for(var l=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-st(h),T=1<<v,I=f[v];I===-1?((T&l)===0||(T&o)!==0)&&(f[v]=Ba(T,n)):I<=n&&(t.expiredLanes|=T),h&=~T}if(n=gt,l=Ze,l=Ua(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,l===0||t===n&&(ot===2||ot===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Ti(o),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Jt(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(o!==null&&Ti(o),zs(l)){case 2:case 8:l=ce;break;case 32:l=Ee;break;case 268435456:l=Qe;break;default:l=Ee}return o=Og.bind(null,t),l=Xt(l,o),t.callbackPriority=n,t.callbackNode=l,n}return o!==null&&o!==null&&Ti(o),t.callbackPriority=2,t.callbackNode=null,2}function Og(t,n){if(Kt!==0&&Kt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(pc()&&t.callbackNode!==l)return null;var o=Ze;return o=Ua(t,t===gt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(mg(t,o,n),Mg(t,_t()),t.callbackNode!=null&&t.callbackNode===l?Og.bind(null,t):null)}function zg(t,n){if(pc())return null;mg(t,n,!0)}function ek(){fk(function(){(rt&6)!==0?Xt(ae,Jw):_g()})}function Cf(){if(xl===0){var t=tt;t===0&&(t=jr,jr<<=1,(jr&261888)===0&&(jr=256)),xl=t}return xl}function Lg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:yn(""+t)}function Ig(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function tk(t,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var h=Lg((f[Bt]||null).action),v=o.submitter;v&&(n=(n=v[Bt]||null)?Lg(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var T=new Pa("action","action",null,o,f);t.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(xl!==0){var I=v?Ig(f,v):new FormData(f);Vd(l,{pending:!0,data:I,method:f.method,action:h},null,I)}}else typeof h=="function"&&(T.preventDefault(),I=v?Ig(f,v):new FormData(f),Vd(l,{pending:!0,data:I,method:f.method,action:h},h,I))},currentTarget:f}]})}}for(var Tf=0;Tf<Zs.length;Tf++){var Ef=Zs[Tf],nk=Ef.toLowerCase(),ik=Ef[0].toUpperCase()+Ef.slice(1);$n(nk,"on"+ik)}$n(Ru,"onAnimationEnd"),$n(_u,"onAnimationIteration"),$n(Mu,"onAnimationStart"),$n("dblclick","onDoubleClick"),$n("focusin","onFocus"),$n("focusout","onBlur"),$n(vd,"onTransitionRun"),$n(wd,"onTransitionStart"),$n(kd,"onTransitionCancel"),$n(Ou,"onTransitionEnd"),Mi("onMouseEnter",["mouseout","mouseover"]),Mi("onMouseLeave",["mouseout","mouseover"]),Mi("onPointerEnter",["pointerout","pointerover"]),Mi("onPointerLeave",["pointerout","pointerover"]),on("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),on("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),on("onBeforeInput",["compositionend","keypress","textInput","paste"]),on("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),on("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),on("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="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(" "),ak=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Do));function Ug(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var o=t[l],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var T=o[v],I=T.instance,P=T.currentTarget;if(T=T.listener,I!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=P;try{h(f)}catch(ne){Xr(ne)}f.currentTarget=null,h=I}else for(v=0;v<o.length;v++){if(T=o[v],I=T.instance,P=T.currentTarget,T=T.listener,I!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=P;try{h(f)}catch(ne){Xr(ne)}f.currentTarget=null,h=I}}}}function Ke(t,n){var l=n[Ni];l===void 0&&(l=n[Ni]=new Set);var o=t+"__bubble";l.has(o)||(Bg(n,t,2,!1),l.add(o))}function Af(t,n,l){var o=0;n&&(o|=4),Bg(l,t,o,n)}var gc="_reactListening"+Math.random().toString(36).slice(2);function Nf(t){if(!t[gc]){t[gc]=!0,mu.forEach(function(l){l!=="selectionchange"&&(ak.has(l)||Af(l,!1,t),Af(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[gc]||(n[gc]=!0,Af("selectionchange",!1,n))}}function Bg(t,n,l,o){switch(hy(n)){case 2:var f=_k;break;case 8:f=Mk;break;default:f=Vf}l=f.bind(null,n,l,t),f=void 0,!$s||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,l,{capture:!0,passive:f}):t.addEventListener(n,l,!0):f!==void 0?t.addEventListener(n,l,{passive:f}):t.addEventListener(n,l,!1)}function Df(t,n,l,o,f){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var T=o.stateNode.containerInfo;if(T===f)break;if(v===4)for(v=o.return;v!==null;){var I=v.tag;if((I===3||I===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;T!==null;){if(v=ei(T),v===null)return;if(I=v.tag,I===5||I===6||I===26||I===27){o=h=v;continue e}T=T.parentNode}}o=o.return}Hs(function(){var P=h,ne=ra(l),se=[];e:{var K=zu.get(t);if(K!==void 0){var J=Pa,je=t;switch(t){case"keypress":if(Ya(l)===0)break e;case"keydown":case"keyup":J=ni;break;case"focusin":je="focus",J=qi;break;case"focusout":je="blur",J=qi;break;case"beforeblur":case"afterblur":J=qi;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":J=Xa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=Lr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=lt;break;case Ru:case _u:case Mu:J=Hi;break;case Ou:J=qr;break;case"scroll":case"scrollend":J=Vs;break;case"wheel":J=Vl;break;case"copy":case"cut":case"paste":J=Sn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=Br;break;case"toggle":case"beforetoggle":J=ua}var ze=(n&4)!==0,pt=!ze&&(t==="scroll"||t==="scrollend"),G=ze?K!==null?K+"Capture":null:K;ze=[];for(var B=P,Y;B!==null;){var le=B;if(Y=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Y===null||G===null||(le=Ul(B,G),le!=null&&ze.push(Ro(B,le,Y))),pt)break;B=B.return}0<ze.length&&(K=new J(K,je,null,l,ne),se.push({event:K,listeners:ze}))}}if((n&7)===0){e:{if(K=t==="mouseover"||t==="pointerover",J=t==="mouseout"||t==="pointerout",K&&l!==Ll&&(je=l.relatedTarget||l.fromElement)&&(ei(je)||je[Bn]))break e;if((J||K)&&(K=ne.window===ne?ne:(K=ne.ownerDocument)?K.defaultView||K.parentWindow:window,J?(je=l.relatedTarget||l.toElement,J=P,je=je?ei(je):null,je!==null&&(pt=c(je),ze=je.tag,je!==pt||ze!==5&&ze!==27&&ze!==6)&&(je=null)):(J=null,je=P),J!==je)){if(ze=Xa,le="onMouseLeave",G="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(ze=Br,le="onPointerLeave",G="onPointerEnter",B="pointer"),pt=J==null?K:ia(J),Y=je==null?K:ia(je),K=new ze(le,B+"leave",J,l,ne),K.target=pt,K.relatedTarget=Y,le=null,ei(ne)===P&&(ze=new ze(G,B+"enter",je,l,ne),ze.target=Y,ze.relatedTarget=pt,le=ze),pt=le,J&&je)t:{for(ze=lk,G=J,B=je,Y=0,le=G;le;le=ze(le))Y++;le=0;for(var Re=B;Re;Re=ze(Re))le++;for(;0<Y-le;)G=ze(G),Y--;for(;0<le-Y;)B=ze(B),le--;for(;Y--;){if(G===B||B!==null&&G===B.alternate){ze=G;break t}G=ze(G),B=ze(B)}ze=null}else ze=null;J!==null&&qg(se,K,J,ze,!1),je!==null&&pt!==null&&qg(se,pt,je,ze,!0)}}e:{if(K=P?ia(P):window,J=K.nodeName&&K.nodeName.toLowerCase(),J==="select"||J==="input"&&K.type==="file")var it=ke;else if(Cu(K))if(Wl)it=Pr;else{it=gd;var Ae=nn}else J=K.nodeName,!J||J.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?P&&zl(P.elementType)&&(it=ke):it=yd;if(it&&(it=it(t,P))){Tu(se,it,l,ne);break e}Ae&&Ae(t,K,P),t==="focusout"&&P&&K.type==="number"&&P.memoizedProps.value!=null&&Nr(K,"number",K.value)}switch(Ae=P?ia(P):window,t){case"focusin":(Cu(Ae)||Ae.contentEditable==="true")&&(Vi=Ae,Xs=P,Ql=null);break;case"focusout":Ql=Xs=Vi=null;break;case"mousedown":Zl=!0;break;case"contextmenu":case"mouseup":case"dragend":Zl=!1,Qs(se,l,ne);break;case"selectionchange":if(bd)break;case"keydown":case"keyup":Qs(se,l,ne)}var $e;if(Ws)e:{switch(t){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else $i?ju(t,l)&&(Je="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Je="onCompositionStart");Je&&(Hr&&l.locale!=="ko"&&($i||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&$i&&($e=Gs()):(Ui=ne,Mr="value"in Ui?Ui.value:Ui.textContent,$i=!0)),Ae=yc(P,Je),0<Ae.length&&(Je=new Ja(Je,t,null,l,ne),se.push({event:Je,listeners:Ae}),$e?Je.data=$e:($e=Ks(l),$e!==null&&(Je.data=$e)))),($e=Su?Gr(t,l):md(t,l))&&(Je=yc(P,"onBeforeInput"),0<Je.length&&(Ae=new Ja("onBeforeInput","beforeinput",null,l,ne),se.push({event:Ae,listeners:Je}),Ae.data=$e)),tk(se,t,P,l,ne)}Ug(se,n)})}function Ro(t,n,l){return{instance:t,listener:n,currentTarget:l}}function yc(t,n){for(var l=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Ul(t,l),f!=null&&o.unshift(Ro(t,f,h)),f=Ul(t,n),f!=null&&o.push(Ro(t,f,h))),t.tag===3)return o;t=t.return}return[]}function lk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function qg(t,n,l,o,f){for(var h=n._reactName,v=[];l!==null&&l!==o;){var T=l,I=T.alternate,P=T.stateNode;if(T=T.tag,I!==null&&I===o)break;T!==5&&T!==26&&T!==27||P===null||(I=P,f?(P=Ul(l,h),P!=null&&v.unshift(Ro(l,P,I))):f||(P=Ul(l,h),P!=null&&v.push(Ro(l,P,I)))),l=l.return}v.length!==0&&t.push({event:n,listeners:v})}var rk=/\r\n?/g,sk=/\u0000|\uFFFD/g;function Hg(t){return(typeof t=="string"?t:""+t).replace(rk,`
|
|
50
|
+
`).replace(sk,"")}function $g(t,n){return n=Hg(n),Hg(t)===n}function ft(t,n,l,o,f,h){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Va(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Va(t,""+o);break;case"className":aa(t,"class",o);break;case"tabIndex":aa(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":aa(t,l,o);break;case"style":Rr(t,o,h);break;case"data":if(n!=="object"){aa(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=yn(""+o),t.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(l==="formAction"?(n!=="input"&&ft(t,n,"name",f.name,f,null),ft(t,n,"formEncType",f.formEncType,f,null),ft(t,n,"formMethod",f.formMethod,f,null),ft(t,n,"formTarget",f.formTarget,f,null)):(ft(t,n,"encType",f.encType,f,null),ft(t,n,"method",f.method,f,null),ft(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=yn(""+o),t.setAttribute(l,o);break;case"onClick":o!=null&&(t.onclick=Qt);break;case"onScroll":o!=null&&Ke("scroll",t);break;case"onScrollEnd":o!=null&&Ke("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}l=yn(""+o),t.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":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""+o):t.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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":o===!0?t.setAttribute(l,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,o):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(l,o):t.removeAttribute(l);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(l):t.setAttribute(l,o);break;case"popover":Ke("beforetoggle",t),Ke("toggle",t),Ml(t,"popover",o);break;case"xlinkActuate":fi(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":fi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":fi(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":fi(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":fi(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":fi(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":fi(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":fi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":fi(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Ml(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=vu.get(l)||l,Ml(t,l,o))}}function Rf(t,n,l,o,f,h){switch(l){case"style":Rr(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof o=="string"?Va(t,o):(typeof o=="number"||typeof o=="bigint")&&Va(t,""+o);break;case"onScroll":o!=null&&Ke("scroll",t);break;case"onScrollEnd":o!=null&&Ke("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Qt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Us.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),h=t[Bt]||null,h=h!=null?h[l]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,o,f);break e}l in t?t[l]=o:o===!0?t.setAttribute(l,""):Ml(t,l,o)}}}function ln(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",t),Ke("load",t);var o=!1,f=!1,h;for(h in l)if(l.hasOwnProperty(h)){var v=l[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,h,v,l,null)}}f&&ft(t,n,"srcSet",l.srcSet,l,null),o&&ft(t,n,"src",l.src,l,null);return;case"input":Ke("invalid",t);var T=h=v=f=null,I=null,P=null;for(o in l)if(l.hasOwnProperty(o)){var ne=l[o];if(ne!=null)switch(o){case"name":f=ne;break;case"type":v=ne;break;case"checked":I=ne;break;case"defaultChecked":P=ne;break;case"value":h=ne;break;case"defaultValue":T=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,n));break;default:ft(t,n,o,ne,l,null)}}zi(t,h,T,I,P,v,f,!1);return;case"select":Ke("invalid",t),o=v=h=null;for(f in l)if(l.hasOwnProperty(f)&&(T=l[f],T!=null))switch(f){case"value":h=T;break;case"defaultValue":v=T;break;case"multiple":o=T;default:ft(t,n,f,T,l,null)}n=h,l=v,t.multiple=!!o,n!=null?ti(t,!!o,n,!1):l!=null&&ti(t,!!o,l,!0);return;case"textarea":Ke("invalid",t),h=f=o=null;for(v in l)if(l.hasOwnProperty(v)&&(T=l[v],T!=null))switch(v){case"value":o=T;break;case"defaultValue":f=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:ft(t,n,v,T,l,null)}Ol(t,o,f,h);return;case"option":for(I in l)if(l.hasOwnProperty(I)&&(o=l[I],o!=null))switch(I){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ft(t,n,I,o,l,null)}return;case"dialog":Ke("beforetoggle",t),Ke("toggle",t),Ke("cancel",t),Ke("close",t);break;case"iframe":case"object":Ke("load",t);break;case"video":case"audio":for(o=0;o<Do.length;o++)Ke(Do[o],t);break;case"image":Ke("error",t),Ke("load",t);break;case"details":Ke("toggle",t);break;case"embed":case"source":case"link":Ke("error",t),Ke("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in l)if(l.hasOwnProperty(P)&&(o=l[P],o!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,P,o,l,null)}return;default:if(zl(n)){for(ne in l)l.hasOwnProperty(ne)&&(o=l[ne],o!==void 0&&Rf(t,n,ne,o,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(o=l[T],o!=null&&ft(t,n,T,o,l,null))}function ok(t,n,l,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,T=null,I=null,P=null,ne=null;for(J in l){var se=l[J];if(l.hasOwnProperty(J)&&se!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":I=se;default:o.hasOwnProperty(J)||ft(t,n,J,null,o,se)}}for(var K in o){var J=o[K];if(se=l[K],o.hasOwnProperty(K)&&(J!=null||se!=null))switch(K){case"type":h=J;break;case"name":f=J;break;case"checked":P=J;break;case"defaultChecked":ne=J;break;case"value":v=J;break;case"defaultValue":T=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,n));break;default:J!==se&&ft(t,n,K,J,o,se)}}qn(t,v,T,I,P,ne,h,f);return;case"select":J=v=T=K=null;for(h in l)if(I=l[h],l.hasOwnProperty(h)&&I!=null)switch(h){case"value":break;case"multiple":J=I;default:o.hasOwnProperty(h)||ft(t,n,h,null,o,I)}for(f in o)if(h=o[f],I=l[f],o.hasOwnProperty(f)&&(h!=null||I!=null))switch(f){case"value":K=h;break;case"defaultValue":T=h;break;case"multiple":v=h;default:h!==I&&ft(t,n,f,h,o,I)}n=T,l=v,o=J,K!=null?ti(t,!!l,K,!1):!!o!=!!l&&(n!=null?ti(t,!!l,n,!0):ti(t,!!l,l?[]:"",!1));return;case"textarea":J=K=null;for(T in l)if(f=l[T],l.hasOwnProperty(T)&&f!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ft(t,n,T,null,o,f)}for(v in o)if(f=o[v],h=l[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":K=f;break;case"defaultValue":J=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&ft(t,n,v,f,o,h)}qs(t,K,J);return;case"option":for(var je in l)if(K=l[je],l.hasOwnProperty(je)&&K!=null&&!o.hasOwnProperty(je))switch(je){case"selected":t.selected=!1;break;default:ft(t,n,je,null,o,K)}for(I in o)if(K=o[I],J=l[I],o.hasOwnProperty(I)&&K!==J&&(K!=null||J!=null))switch(I){case"selected":t.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:ft(t,n,I,K,o,J)}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 ze in l)K=l[ze],l.hasOwnProperty(ze)&&K!=null&&!o.hasOwnProperty(ze)&&ft(t,n,ze,null,o,K);for(P in o)if(K=o[P],J=l[P],o.hasOwnProperty(P)&&K!==J&&(K!=null||J!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,n));break;default:ft(t,n,P,K,o,J)}return;default:if(zl(n)){for(var pt in l)K=l[pt],l.hasOwnProperty(pt)&&K!==void 0&&!o.hasOwnProperty(pt)&&Rf(t,n,pt,void 0,o,K);for(ne in o)K=o[ne],J=l[ne],!o.hasOwnProperty(ne)||K===J||K===void 0&&J===void 0||Rf(t,n,ne,K,o,J);return}}for(var G in l)K=l[G],l.hasOwnProperty(G)&&K!=null&&!o.hasOwnProperty(G)&&ft(t,n,G,null,o,K);for(se in o)K=o[se],J=l[se],!o.hasOwnProperty(se)||K===J||K==null&&J==null||ft(t,n,se,K,o,J)}function Gg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],h=f.transferSize,v=f.initiatorType,T=f.duration;if(h&&T&&Gg(v)){for(v=0,T=f.responseEnd,o+=1;o<l.length;o++){var I=l[o],P=I.startTime;if(P>T)break;var ne=I.transferSize,se=I.initiatorType;ne&&Gg(se)&&(I=I.responseEnd,v+=ne*(I<T?1:(T-P)/(I-P)))}if(--o,n+=8*(h+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var _f=null,Mf=null;function xc(t){return t.nodeType===9?t:t.ownerDocument}function Vg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Fg(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Of(t,n){return t==="textarea"||t==="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 zf=null;function ck(){var t=window.event;return t&&t.type==="popstate"?t===zf?!1:(zf=t,!0):(zf=null,!1)}var Yg=typeof setTimeout=="function"?setTimeout:void 0,dk=typeof clearTimeout=="function"?clearTimeout:void 0,Pg=typeof Promise=="function"?Promise:void 0,fk=typeof queueMicrotask=="function"?queueMicrotask:typeof Pg<"u"?function(t){return Pg.resolve(null).then(t).catch(pk)}:Yg;function pk(t){setTimeout(function(){throw t})}function bl(t){return t==="head"}function Wg(t,n){var l=n,o=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(o===0){t.removeChild(f),js(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")_o(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,_o(l);for(var h=l.firstChild;h;){var v=h.nextSibling,T=h.nodeName;h[Di]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=v}}else l==="body"&&_o(t.ownerDocument.body);l=f}while(l);js(n)}function Kg(t,n){var l=t;t=0;do{var o=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||""),o&&o.nodeType===8)if(l=o.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=o}while(l)}function Lf(t){var n=t.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":Lf(l),Is(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function hk(t,n,l,o){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Di])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=oi(t.nextSibling),t===null)break}return null}function mk(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=oi(t.nextSibling),t===null))return null;return t}function Xg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=oi(t.nextSibling),t===null))return null;return t}function If(t){return t.data==="$?"||t.data==="$~"}function Uf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function gk(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var o=function(){n(),l.removeEventListener("DOMContentLoaded",o)};l.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function oi(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Bf=null;function Qg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return oi(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function Zg(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function Jg(t,n,l){switch(n=xc(l),t){case"html":if(t=n.documentElement,!t)throw Error(r(452));return t;case"head":if(t=n.head,!t)throw Error(r(453));return t;case"body":if(t=n.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function _o(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Is(t)}var ui=new Map,ey=new Set;function bc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ma=oe.d;oe.d={f:yk,r:xk,D:bk,C:vk,L:wk,m:kk,X:jk,S:Sk,M:Ck};function yk(){var t=Ma.f(),n=cc();return t||n}function xk(t){var n=Ri(t);n!==null&&n.tag===5&&n.type==="form"?ym(n):Ma.r(t)}var ws=typeof document>"u"?null:document;function ty(t,n,l){var o=ws;if(o&&typeof n=="string"&&n){var f=Nt(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),ey.has(f)||(ey.add(f),t={rel:t,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),ln(n,"link",t),At(n),o.head.appendChild(n)))}}function bk(t){Ma.D(t),ty("dns-prefetch",t,null)}function vk(t,n){Ma.C(t,n),ty("preconnect",t,n)}function wk(t,n,l){Ma.L(t,n,l);var o=ws;if(o&&t&&n){var f='link[rel="preload"][as="'+Nt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Nt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Nt(l.imageSizes)+'"]')):f+='[href="'+Nt(t)+'"]';var h=f;switch(n){case"style":h=ks(t);break;case"script":h=Ss(t)}ui.has(h)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),ui.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(Mo(h))||n==="script"&&o.querySelector(Oo(h))||(n=o.createElement("link"),ln(n,"link",t),At(n),o.head.appendChild(n)))}}function kk(t,n){Ma.m(t,n);var l=ws;if(l&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Nt(o)+'"][href="'+Nt(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ss(t)}if(!ui.has(h)&&(t=x({rel:"modulepreload",href:t},n),ui.set(h,t),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Oo(h)))return}o=l.createElement("link"),ln(o,"link",t),At(o),l.head.appendChild(o)}}}function Sk(t,n,l){Ma.S(t,n,l);var o=ws;if(o&&t){var f=_i(o).hoistableStyles,h=ks(t);n=n||"default";var v=f.get(h);if(!v){var T={loading:0,preload:null};if(v=o.querySelector(Mo(h)))T.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=ui.get(h))&&qf(t,l);var I=v=o.createElement("link");At(I),ln(I,"link",t),I._p=new Promise(function(P,ne){I.onload=P,I.onerror=ne}),I.addEventListener("load",function(){T.loading|=1}),I.addEventListener("error",function(){T.loading|=2}),T.loading|=4,vc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:T},f.set(h,v)}}}function jk(t,n){Ma.X(t,n);var l=ws;if(l&&t){var o=_i(l).hoistableScripts,f=Ss(t),h=o.get(f);h||(h=l.querySelector(Oo(f)),h||(t=x({src:t,async:!0},n),(n=ui.get(f))&&Hf(t,n),h=l.createElement("script"),At(h),ln(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Ck(t,n){Ma.M(t,n);var l=ws;if(l&&t){var o=_i(l).hoistableScripts,f=Ss(t),h=o.get(f);h||(h=l.querySelector(Oo(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=ui.get(f))&&Hf(t,n),h=l.createElement("script"),At(h),ln(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function ny(t,n,l,o){var f=(f=X.current)?bc(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=ks(l.href),l=_i(f).hoistableStyles,o=l.get(n),o||(o={type:"style",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=ks(l.href);var h=_i(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(Mo(t)))&&!h._p&&(v.instance=h,v.state.loading=5),ui.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ui.set(t,l),h||Tk(f,t,l,v.state))),n&&o===null)throw Error(r(528,""));return v}if(n&&o!==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=Ss(l),l=_i(f).hoistableScripts,o=l.get(n),o||(o={type:"script",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function ks(t){return'href="'+Nt(t)+'"'}function Mo(t){return'link[rel="stylesheet"]['+t+"]"}function iy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Tk(t,n,l,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),ln(n,"link",l),At(n),t.head.appendChild(n))}function Ss(t){return'[src="'+Nt(t)+'"]'}function Oo(t){return"script[async]"+t}function ay(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Nt(l.href)+'"]');if(o)return n.instance=o,At(o),o;var f=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),At(o),ln(o,"style",f),vc(o,l.precedence,t),n.instance=o;case"stylesheet":f=ks(l.href);var h=t.querySelector(Mo(f));if(h)return n.state.loading|=4,n.instance=h,At(h),h;o=iy(l),(f=ui.get(f))&&qf(o,f),h=(t.ownerDocument||t).createElement("link"),At(h);var v=h;return v._p=new Promise(function(T,I){v.onload=T,v.onerror=I}),ln(h,"link",o),n.state.loading|=4,vc(h,l.precedence,t),n.instance=h;case"script":return h=Ss(l.src),(f=t.querySelector(Oo(h)))?(n.instance=f,At(f),f):(o=l,(f=ui.get(h))&&(o=x({},l),Hf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),At(f),ln(f,"link",o),t.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&&(o=n.instance,n.state.loading|=4,vc(o,l.precedence,t));return n.instance}function vc(t,n,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,v=0;v<o.length;v++){var T=o[v];if(T.dataset.precedence===n)h=T;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function qf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Hf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var wc=null;function ly(t,n,l){if(wc===null){var o=new Map,f=wc=new Map;f.set(l,o)}else f=wc,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(t))return o;for(o.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var h=l[f];if(!(h[Di]||h[Yt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var T=o.get(v);T?T.push(h):o.set(v,[h])}}return o}function ry(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function Ek(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){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 t=n.disabled,typeof n.precedence=="string"&&t==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 sy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ak(t,n,l,o){if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=ks(o.href),h=n.querySelector(Mo(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=kc.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=h,At(h);return}h=n.ownerDocument||n,o=iy(o),(f=ui.get(f))&&qf(o,f),h=h.createElement("link"),At(h);var v=h;v._p=new Promise(function(T,I){v.onload=T,v.onerror=I}),ln(h,"link",o),l.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=kc.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var $f=0;function Nk(t,n){return t.stylesheets&&t.count===0&&jc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var o=setTimeout(function(){if(t.stylesheets&&jc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&$f===0&&($f=62500*uk());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&jc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>$f?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function kc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Sc=null;function jc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Sc=new Map,n.forEach(Dk,t),Sc=null,kc.call(t))}function Dk(t,n){if(!(n.state.loading&4)){var l=Sc.get(t);if(l)var o=l.get(null);else{l=new Map,Sc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var v=f[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),o=v)}o&&l.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=l.get(v)||o,h===o&&l.set(null,f),l.set(v,f),this.count++,o=kc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),h?h.parentNode.insertBefore(f,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var zo={$$typeof:$,Provider:null,Consumer:null,_currentValue:be,_currentValue2:be,_threadCount:0};function Rk(t,n,l,o,f,h,v,T,I){this.tag=1,this.containerInfo=t,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=na(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=na(0),this.hiddenUpdates=na(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function oy(t,n,l,o,f,h,v,T,I,P,ne,se){return t=new Rk(t,n,l,v,I,P,ne,se,T),n=1,h===!0&&(n|=24),h=Ot(3,null,null,n),t.current=h,h.stateNode=t,n=wa(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:l,cache:n},sr(h),t}function uy(t){return t?(t=ga,t):ga}function cy(t,n,l,o,f,h){f=uy(f),o.context===null?o.context=f:o.pendingContext=f,o=ol(n),o.payload={element:l},h=h===void 0?null:h,h!==null&&(o.callback=h),l=ul(t,o,n),l!==null&&(zn(l,t,n),po(l,t,n))}function dy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Gf(t,n){dy(t,n),(t=t.alternate)&&dy(t,n)}function fy(t){if(t.tag===13||t.tag===31){var n=Fi(t,67108864);n!==null&&zn(n,t,67108864),Gf(t,67108864)}}function py(t){if(t.tag===13||t.tag===31){var n=Wn();n=Tr(n);var l=Fi(t,n);l!==null&&zn(l,t,n),Gf(t,n)}}var Cc=!0;function _k(t,n,l,o){var f=F.T;F.T=null;var h=oe.p;try{oe.p=2,Vf(t,n,l,o)}finally{oe.p=h,F.T=f}}function Mk(t,n,l,o){var f=F.T;F.T=null;var h=oe.p;try{oe.p=8,Vf(t,n,l,o)}finally{oe.p=h,F.T=f}}function Vf(t,n,l,o){if(Cc){var f=Ff(o);if(f===null)Df(t,n,o,Tc,l),my(t,o);else if(zk(f,t,n,l,o))o.stopPropagation();else if(my(t,o),n&4&&-1<Ok.indexOf(t)){for(;f!==null;){var h=Ri(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=Ai(h.pendingLanes);if(v!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;v;){var I=1<<31-st(v);T.entanglements[1]|=I,v&=~I}Qi(h),(rt&6)===0&&(oc=_t()+500,No(0))}}break;case 31:case 13:T=Fi(h,2),T!==null&&zn(T,h,2),cc(),Gf(h,2)}if(h=Ff(o),h===null&&Df(t,n,o,Tc,l),h===f)break;f=h}f!==null&&o.stopPropagation()}else Df(t,n,o,null,l)}}function Ff(t){return t=ra(t),Yf(t)}var Tc=null;function Yf(t){if(Tc=null,t=ei(t),t!==null){var n=c(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=d(n),t!==null)return t;t=null}else if(l===31){if(t=p(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Tc=t,null}function hy(t){switch(t){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(Ia()){case ae:return 2;case ce:return 8;case Ee:case Ue:return 32;case Qe:return 268435456;default:return 32}default:return 32}}var Pf=!1,vl=null,wl=null,kl=null,Lo=new Map,Io=new Map,Sl=[],Ok="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 my(t,n){switch(t){case"focusin":case"focusout":vl=null;break;case"dragenter":case"dragleave":wl=null;break;case"mouseover":case"mouseout":kl=null;break;case"pointerover":case"pointerout":Lo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(n.pointerId)}}function Uo(t,n,l,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:l,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ri(n),n!==null&&fy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function zk(t,n,l,o,f){switch(n){case"focusin":return vl=Uo(vl,t,n,l,o,f),!0;case"dragenter":return wl=Uo(wl,t,n,l,o,f),!0;case"mouseover":return kl=Uo(kl,t,n,l,o,f),!0;case"pointerover":var h=f.pointerId;return Lo.set(h,Uo(Lo.get(h)||null,t,n,l,o,f)),!0;case"gotpointercapture":return h=f.pointerId,Io.set(h,Uo(Io.get(h)||null,t,n,l,o,f)),!0}return!1}function gy(t){var n=ei(t.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=d(l),n!==null){t.blockedOn=n,hu(t.priority,function(){py(l)});return}}else if(n===31){if(n=p(l),n!==null){t.blockedOn=n,hu(t.priority,function(){py(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ec(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Ff(t.nativeEvent);if(l===null){l=t.nativeEvent;var o=new l.constructor(l.type,l);Ll=o,l.target.dispatchEvent(o),Ll=null}else return n=Ri(l),n!==null&&fy(n),t.blockedOn=l,!1;n.shift()}return!0}function yy(t,n,l){Ec(t)&&l.delete(n)}function Lk(){Pf=!1,vl!==null&&Ec(vl)&&(vl=null),wl!==null&&Ec(wl)&&(wl=null),kl!==null&&Ec(kl)&&(kl=null),Lo.forEach(yy),Io.forEach(yy)}function Ac(t,n){t.blockedOn===n&&(t.blockedOn=null,Pf||(Pf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Lk)))}var Nc=null;function xy(t){Nc!==t&&(Nc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Nc===t&&(Nc=null);for(var n=0;n<t.length;n+=3){var l=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(Yf(o||l)===null)continue;break}var h=Ri(l);h!==null&&(t.splice(n,3),n-=3,Vd(h,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function js(t){function n(I){return Ac(I,t)}vl!==null&&Ac(vl,t),wl!==null&&Ac(wl,t),kl!==null&&Ac(kl,t),Lo.forEach(n),Io.forEach(n);for(var l=0;l<Sl.length;l++){var o=Sl[l];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Sl.length&&(l=Sl[0],l.blockedOn===null);)gy(l),l.blockedOn===null&&Sl.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],h=l[o+1],v=f[Bt]||null;if(typeof h=="function")v||xy(l);else if(v){var T=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[Bt]||null)T=v.formAction;else if(Yf(f)!==null)continue}else T=v.action;typeof T=="function"?l[o+1]=T:(l.splice(o,3),o-=3),xy(l)}}}function by(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Wf(t){this._internalRoot=t}Dc.prototype.render=Wf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,o=Wn();cy(l,o,t,n,null,null)},Dc.prototype.unmount=Wf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;cy(t.current,2,null,t,null,null),cc(),n[Bn]=null}};function Dc(t){this._internalRoot=t}Dc.prototype.unstable_scheduleHydration=function(t){if(t){var n=Ls();t={blockedOn:null,target:t,priority:n};for(var l=0;l<Sl.length&&n!==0&&n<Sl[l].priority;l++);Sl.splice(l,0,t),l===0&&gy(t)}};var vy=i.version;if(vy!=="19.2.7")throw Error(r(527,vy,"19.2.7"));oe.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=m(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var Ik={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rc.isDisabled&&Rc.supportsFiber)try{Ft=Rc.inject(Ik),Et=Rc}catch{}}return qo.createRoot=function(t,n){if(!u(t))throw Error(r(299));var l=!1,o="",f=Em,h=Am,v=Nm;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=oy(t,1,!1,null,null,l,o,null,f,h,v,by),t[Bn]=n.current,Nf(t),new Wf(n)},qo.hydrateRoot=function(t,n,l){if(!u(t))throw Error(r(299));var o=!1,f="",h=Em,v=Am,T=Nm,I=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),n=oy(t,1,!0,n,l??null,o,f,I,h,v,T,by),n.context=uy(null),l=n.current,o=Wn(),o=Tr(o),f=ol(o),f.callback=null,ul(l,f,o),l=o,n.current.lanes=l,qa(n,l),Qi(n),t[Bn]=n.current,Nf(t),new Dc(n)},qo.version="19.2.7",qo}var Ry;function Qk(){if(Ry)return Qf.exports;Ry=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Qf.exports=Xk(),Qf.exports}var Zk=Qk();function Jk(e,i){const a=i||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const eS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nS={};function _y(e,i){return(nS.jsx?tS:eS).test(e)}const iS=/[ \t\n\f\r]/g;function aS(e){return typeof e=="object"?e.type==="text"?My(e.value):!1:My(e)}function My(e){return e.replace(iS,"")===""}class cu{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}cu.prototype.normal={};cu.prototype.property={};cu.prototype.space=void 0;function wb(e,i){const a={},r={};for(const u of e)Object.assign(a,u.property),Object.assign(r,u.normal);return new cu(a,r,i)}function Lp(e){return e.toLowerCase()}class Un{constructor(i,a){this.attribute=a,this.property=i}}Un.prototype.attribute="";Un.prototype.booleanish=!1;Un.prototype.boolean=!1;Un.prototype.commaOrSpaceSeparated=!1;Un.prototype.commaSeparated=!1;Un.prototype.defined=!1;Un.prototype.mustUseProperty=!1;Un.prototype.number=!1;Un.prototype.overloadedBoolean=!1;Un.prototype.property="";Un.prototype.spaceSeparated=!1;Un.prototype.space=void 0;let lS=0;const Ie=kr(),Gt=kr(),Ip=kr(),he=kr(),yt=kr(),yr=kr(),Kn=kr();function kr(){return 2**++lS}const Up=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Gt,commaOrSpaceSeparated:Kn,commaSeparated:yr,number:he,overloadedBoolean:Ip,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),tp=Object.keys(Up);class oh extends Un{constructor(i,a,r,u){let c=-1;if(super(i,a),Oy(this,"space",u),typeof r=="number")for(;++c<tp.length;){const d=tp[c];Oy(this,tp[c],(r&Up[d])===Up[d])}}}oh.prototype.defined=!0;function Oy(e,i,a){a&&(e[i]=a)}function _s(e){const i={},a={};for(const[r,u]of Object.entries(e.properties)){const c=new oh(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[Lp(r)]=r,a[Lp(c.attribute)]=r}return new cu(i,a,e.space)}const kb=_s({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:yt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:he,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:yt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Gt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Sb(e,i){return i in e?e[i]:i}function jb(e,i){return Sb(e,i.toLowerCase())}const rS=_s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:yr,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:yt,autoFocus:Ie,autoPlay:Ie,blocking:yt,capture:null,charSet:null,checked:Ie,cite:null,className:yt,closedBy:null,colorSpace:null,cols:he,colSpan:he,command:null,commandFor:null,content:null,contentEditable:Gt,controls:Ie,controlsList:yt,coords:he|yr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:Ip,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:yt,height:he,hidden:Ip,high:he,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:yt,itemRef:yt,itemScope:Ie,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:he,pattern:null,ping:yt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:yt,required:Ie,reversed:Ie,rows:he,rowSpan:he,sandbox:yt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Gt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:yr,part:yt,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:jb}),sS=_s({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:Kn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:yr,g2:yr,glyphName:yr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:Kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kn,rev:Kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kn,requiredFeatures:Kn,requiredFonts:Kn,requiredFormats:Kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:Kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sb}),Cb=_s({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),Tb=_s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jb}),Eb=_s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),oS={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"},uS=/[A-Z]/g,zy=/-[a-z]/g,cS=/^data[-\w.:]+$/i;function dS(e,i){const a=Lp(i);let r=i,u=Un;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&cS.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(zy,pS);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!zy.test(c)){let d=c.replace(uS,fS);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=oh}return new u(r,i)}function fS(e){return"-"+e.toLowerCase()}function pS(e){return e.charAt(1).toUpperCase()}const hS=wb([kb,rS,Cb,Tb,Eb],"html"),uh=wb([kb,sS,Cb,Tb,Eb],"svg");function mS(e){return e.join(" ").trim()}var Cs={},np,Ly;function gS(){if(Ly)return np;Ly=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
|
|
51
|
+
`,m="/",b="*",x="",S="comment",w="declaration";function E(H,R){if(typeof H!="string")throw new TypeError("First argument must be a string");if(!H)return[];R=R||{};var q=1,$=1;function V(ye){var ue=ye.match(i);ue&&(q+=ue.length);var F=ye.lastIndexOf(g);$=~F?ye.length-F:$+ye.length}function ie(){var ye={line:q,column:$};return function(ue){return ue.position=new N(ye),ee(),ue}}function N(ye){this.start=ye,this.end={line:q,column:$},this.source=R.source}N.prototype.content=H;function Q(ye){var ue=new Error(R.source+":"+q+":"+$+": "+ye);if(ue.reason=ye,ue.filename=R.source,ue.line=q,ue.column=$,ue.source=H,!R.silent)throw ue}function re(ye){var ue=ye.exec(H);if(ue){var F=ue[0];return V(F),H=H.slice(F.length),ue}}function ee(){re(a)}function L(ye){var ue;for(ye=ye||[];ue=te();)ue!==!1&&ye.push(ue);return ye}function te(){var ye=ie();if(!(m!=H.charAt(0)||b!=H.charAt(1))){for(var ue=2;x!=H.charAt(ue)&&(b!=H.charAt(ue)||m!=H.charAt(ue+1));)++ue;if(ue+=2,x===H.charAt(ue-1))return Q("End of comment missing");var F=H.slice(2,ue-2);return $+=2,V(F),H=H.slice(ue),$+=2,ye({type:S,comment:F})}}function de(){var ye=ie(),ue=re(r);if(ue){if(te(),!re(u))return Q("property missing ':'");var F=re(c),oe=ye({type:w,property:M(ue[0].replace(e,x)),value:F?M(F[0].replace(e,x)):x});return re(d),oe}}function Ne(){var ye=[];L(ye);for(var ue;ue=de();)ue!==!1&&(ye.push(ue),L(ye));return ye}return ee(),Ne()}function M(H){return H?H.replace(p,x):x}return np=E,np}var Iy;function yS(){if(Iy)return Cs;Iy=1;var e=Cs&&Cs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.default=a;const i=e(gS());function a(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return Cs}var Ho={},Uy;function xS(){if(Uy)return Ho;Uy=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.camelCase=void 0;var e=/^--[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)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=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,p):m=m.replace(r,p),m.replace(i,d))};return Ho.camelCase=g,Ho}var $o,By;function bS(){if(By)return $o;By=1;var e=$o&&$o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(yS()),a=xS();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,g){p&&g&&(d[(0,a.camelCase)(p,c)]=g)}),d}return r.default=r,$o=r,$o}var vS=bS();const wS=vb(vS),Ab=Nb("end"),ch=Nb("start");function Nb(e){return i;function i(a){const r=a&&a.position&&a.position[e]||{};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 kS(e){const i=ch(e),a=Ab(e);if(i&&a)return{start:i,end:a}}function eu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qy(e.position):"start"in e||"end"in e?qy(e):"line"in e||"column"in e?Bp(e):""}function Bp(e){return Hy(e&&e.line)+":"+Hy(e&&e.column)}function qy(e){return Bp(e&&e.start)+"-"+Bp(e&&e.end)}function Hy(e){return e&&typeof e=="number"?e:1}class hn 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 p=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=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=p?p.line:void 0,this.name=eu(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}}hn.prototype.file="";hn.prototype.name="";hn.prototype.reason="";hn.prototype.message="";hn.prototype.stack="";hn.prototype.column=void 0;hn.prototype.line=void 0;hn.prototype.ancestors=void 0;hn.prototype.cause=void 0;hn.prototype.fatal=void 0;hn.prototype.place=void 0;hn.prototype.ruleId=void 0;hn.prototype.source=void 0;const dh={}.hasOwnProperty,SS=new Map,jS=/[A-Z]/g,CS=new Set(["table","tbody","thead","tfoot","tr"]),TS=new Set(["td","th"]),Db="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ES(e,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=zS(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=OS(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"?uh:hS,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=Rb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function Rb(e,i,a){if(i.type==="element")return AS(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return NS(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return RS(e,i,a);if(i.type==="mdxjsEsm")return DS(e,i);if(i.type==="root")return _S(e,i,a);if(i.type==="text")return MS(e,i)}function AS(e,i,a){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=uh,e.schema=u),e.ancestors.push(i);const c=Mb(e,i.tagName,!1),d=LS(e,i);let p=ph(e,i);return CS.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!aS(g):!0})),_b(e,d,c,i),fh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function NS(e,i){if(i.data&&i.data.estree&&e.evaluater){const r=i.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ou(e,i.position)}function DS(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);ou(e,i.position)}function RS(e,i,a){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=uh,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:Mb(e,i.name,!0),d=IS(e,i),p=ph(e,i);return _b(e,d,c,i),fh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function _S(e,i,a){const r={};return fh(r,ph(e,i)),e.create(i,e.Fragment,r,a)}function MS(e,i){return i.value}function _b(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function fh(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function OS(e,i,a){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?a:i;return p?m(c,d,p):m(c,d)}}function zS(e,i){return a;function a(r,u,c,d){const p=Array.isArray(c.children),g=ch(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function LS(e,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&dh.call(i.properties,u)){const c=US(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&TS.has(i.tagName)?r=p:a[d]=p}}if(r){const c=a.style||(a.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function IS(e,i){const a={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const p=d.properties[0];p.type,Object.assign(a,e.evaluater.evaluateExpression(p.argument))}else ou(e,i.position);else{const u=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const p=r.value.data.estree.body[0];p.type,c=e.evaluater.evaluateExpression(p.expression)}else ou(e,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function ph(e,i){const a=[];let r=-1;const u=e.passKeys?new Map:SS;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.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 p=Rb(e,c,d);p!==void 0&&a.push(p)}return a}function US(e,i,a){const r=dS(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?Jk(a):mS(a)),r.property==="style"){let u=typeof a=="object"?a:BS(e,String(a));return e.stylePropertyNameCase==="css"&&(u=qS(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?oS[r.property]||r.property:r.attribute,a]}}function BS(e,i){try{return wS(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,u=new hn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=e.filePath||void 0,u.url=Db+"#cannot-parse-style-attribute",u}}function Mb(e,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 p=_y(u[c])?{type:"Identifier",name:u[c]}:{type:"Literal",value:u[c]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(c&&p.type==="Literal"),optional:!1}:p}r=d}else r=_y(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return dh.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);ou(e)}function ou(e,i){const a=new hn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Db+"#cannot-handle-mdx-estrees-without-createevaluater",a}function qS(e){const i={};let a;for(a in e)dh.call(e,a)&&(i[HS(a)]=e[a]);return i}function HS(e){let i=e.replace(jS,$S);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function $S(e){return"-"+e.toLowerCase()}const ip={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"]},GS={};function hh(e,i){const a=GS,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Ob(e,r,u)}function Ob(e,i,a){if(VS(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return $y(e.children,i,a)}return Array.isArray(e)?$y(e,i,a):""}function $y(e,i,a){const r=[];let u=-1;for(;++u<e.length;)r[u]=Ob(e[u],i,a);return r.join("")}function VS(e){return!!(e&&typeof e=="object")}const Gy=document.createElement("i");function mh(e){const i="&"+e+";";Gy.innerHTML=i;const a=Gy.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Xn(e,i,a,r){const u=e.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),e.splice(...d);else for(a&&e.splice(i,a);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function ci(e,i){return e.length>0?(Xn(e,e.length,0,i),e):i}const Vy={}.hasOwnProperty;function zb(e){const i={};let a=-1;for(;++a<e.length;)FS(i,e[a]);return i}function FS(e,i){let a;for(a in i){const u=(Vy.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){Vy.call(u,d)||(u[d]=[]);const p=c[d];YS(u[d],Array.isArray(p)?p:p?[p]:[])}}}function YS(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Xn(e,0,0,r)}function Lb(e,i){const a=Number.parseInt(e,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 Ci(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vn=Dl(/[A-Za-z]/),pn=Dl(/[\dA-Za-z]/),PS=Dl(/[#-'*+\--9=?A-Z^-~]/);function Qc(e){return e!==null&&(e<32||e===127)}const qp=Dl(/\d/),WS=Dl(/[\dA-Fa-f]/),KS=Dl(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const ld=Dl(new RegExp("\\p{P}|\\p{S}","u")),xr=Dl(/\s/);function Dl(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Ms(e){const i=[];let a=-1,r=0,u=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&pn(e.charCodeAt(a+1))&&pn(e.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 p=e.charCodeAt(a+1);c<56320&&p>56319&&p<57344?(d=String.fromCharCode(c,p),u=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(e.slice(r,a),encodeURIComponent(d)),r=a+u+1,d=""),u&&(a+=u,u=0)}return i.join("")+e.slice(r)}function nt(e,i,a,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return Xe(g)?(e.enter(a),p(g)):i(g)}function p(g){return Xe(g)&&c++<u?(e.consume(g),p):(e.exit(a),i(g))}}const XS={tokenize:QS};function QS(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let a;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),nt(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const g=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=g),a=g,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return Oe(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const ZS={tokenize:JS},Fy={tokenize:ej};function JS(e){const i=this,a=[];let r=0,u,c,d;return p;function p($){if(r<a.length){const V=a[r];return i.containerState=V[1],e.attempt(V[0].continuation,g,m)($)}return m($)}function g($){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&q();const V=i.events.length;let ie=V,N;for(;ie--;)if(i.events[ie][0]==="exit"&&i.events[ie][1].type==="chunkFlow"){N=i.events[ie][1].end;break}R(r);let Q=V;for(;Q<i.events.length;)i.events[Q][1].end={...N},Q++;return Xn(i.events,ie+1,0,i.events.slice(V)),i.events.length=Q,m($)}return p($)}function m($){if(r===a.length){if(!u)return S($);if(u.currentConstruct&&u.currentConstruct.concrete)return E($);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Fy,b,x)($)}function b($){return u&&q(),R(r),S($)}function x($){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,E($)}function S($){return i.containerState={},e.attempt(Fy,w,E)($)}function w($){return r++,a.push([i.currentConstruct,i.containerState]),S($)}function E($){if($===null){u&&q(),R(0),e.consume($);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),M($)}function M($){if($===null){H(e.exit("chunkFlow"),!0),R(0),e.consume($);return}return Oe($)?(e.consume($),H(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume($),M)}function H($,V){const ie=i.sliceStream($);if(V&&ie.push(null),$.previous=c,c&&(c.next=$),c=$,u.defineSkip($.start),u.write(ie),i.parser.lazy[$.start.line]){let N=u.events.length;for(;N--;)if(u.events[N][1].start.offset<d&&(!u.events[N][1].end||u.events[N][1].end.offset>d))return;const Q=i.events.length;let re=Q,ee,L;for(;re--;)if(i.events[re][0]==="exit"&&i.events[re][1].type==="chunkFlow"){if(ee){L=i.events[re][1].end;break}ee=!0}for(R(r),N=Q;N<i.events.length;)i.events[N][1].end={...L},N++;Xn(i.events,re+1,0,i.events.slice(Q)),i.events.length=N}}function R($){let V=a.length;for(;V-- >$;){const ie=a[V];i.containerState=ie[1],ie[0].exit.call(i,e)}a.length=$}function q(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function ej(e,i,a){return nt(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ds(e){if(e===null||xt(e)||xr(e))return 1;if(ld(e))return 2}function rd(e,i,a){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,a),r.push(c))}return i}const Hp={name:"attention",resolveAll:tj,tokenize:nj};function tj(e,i){let a=-1,r,u,c,d,p,g,m,b;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const x={...e[r][1].end},S={...e[a][1].start};Yy(x,-g),Yy(S,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:S},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[a][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=ci(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=ci(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=ci(m,rd(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),m=ci(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,m=ci(m,[["enter",e[a][1],i],["exit",e[a][1],i]])):b=0,Xn(e,r-1,a-r+3,m),a=r+m.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function nj(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=Ds(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=Ds(g),x=!b||b===2&&u||a.includes(g),S=!u||u===2&&b||a.includes(r);return m._open=!!(c===42?x:x&&(u||!S)),m._close=!!(c===42?S:S&&(b||!x)),i(g)}}function Yy(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const ij={name:"autolink",tokenize:aj};function aj(e,i,a){let r=0;return u;function u(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(w){return vn(w)?(e.consume(w),d):w===64?a(w):m(w)}function d(w){return w===43||w===45||w===46||pn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||pn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||Qc(w)?a(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):PS(w)?(e.consume(w),m):a(w)}function b(w){return pn(w)?x(w):a(w)}function x(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):S(w)}function S(w){if((w===45||pn(w))&&r++<63){const E=w===45?S:x;return e.consume(w),E}return a(w)}}const du={partial:!0,tokenize:lj};function lj(e,i,a){return r;function r(c){return Xe(c)?nt(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Oe(c)?i(c):a(c)}}const Ib={continuation:{tokenize:sj},exit:oj,name:"blockQuote",tokenize:rj};function rj(e,i,a){const r=this;return u;function u(d){if(d===62){const p=r.containerState;return p.open||(e.enter("blockQuote",{_container:!0}),p.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return a(d)}function c(d){return Xe(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function sj(e,i,a){const r=this;return u;function u(d){return Xe(d)?nt(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(Ib,i,a)(d)}}function oj(e){e.exit("blockQuote")}const Ub={name:"characterEscape",tokenize:uj};function uj(e,i,a){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return KS(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const Bb={name:"characterReference",tokenize:cj};function cj(e,i,a){const r=this;let u=0,c,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),g}function g(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=pn,b(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=WS,b):(e.enter("characterReferenceValue"),c=7,d=qp,b(x))}function b(x){if(x===59&&u){const S=e.exit("characterReferenceValue");return d===pn&&!mh(r.sliceSerialize(S))?a(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&u++<c?(e.consume(x),b):a(x)}}const Py={partial:!0,tokenize:fj},Wy={concrete:!0,name:"codeFenced",tokenize:dj};function dj(e,i,a){const r=this,u={partial:!0,tokenize:ie};let c=0,d=0,p;return g;function g(N){return m(N)}function m(N){const Q=r.events[r.events.length-1];return c=Q&&Q[1].type==="linePrefix"?Q[2].sliceSerialize(Q[1],!0).length:0,p=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(N)}function b(N){return N===p?(d++,e.consume(N),b):d<3?a(N):(e.exit("codeFencedFenceSequence"),Xe(N)?nt(e,x,"whitespace")(N):x(N))}function x(N){return N===null||Oe(N)?(e.exit("codeFencedFence"),r.interrupt?i(N):e.check(Py,M,V)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),S(N))}function S(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(N)):Xe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),nt(e,w,"whitespace")(N)):N===96&&N===p?a(N):(e.consume(N),S)}function w(N){return N===null||Oe(N)?x(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(N))}function E(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(N)):N===96&&N===p?a(N):(e.consume(N),E)}function M(N){return e.attempt(u,V,H)(N)}function H(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),R}function R(N){return c>0&&Xe(N)?nt(e,q,"linePrefix",c+1)(N):q(N)}function q(N){return N===null||Oe(N)?e.check(Py,M,V)(N):(e.enter("codeFlowValue"),$(N))}function $(N){return N===null||Oe(N)?(e.exit("codeFlowValue"),q(N)):(e.consume(N),$)}function V(N){return e.exit("codeFenced"),i(N)}function ie(N,Q,re){let ee=0;return L;function L(ue){return N.enter("lineEnding"),N.consume(ue),N.exit("lineEnding"),te}function te(ue){return N.enter("codeFencedFence"),Xe(ue)?nt(N,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):de(ue)}function de(ue){return ue===p?(N.enter("codeFencedFenceSequence"),Ne(ue)):re(ue)}function Ne(ue){return ue===p?(ee++,N.consume(ue),Ne):ee>=d?(N.exit("codeFencedFenceSequence"),Xe(ue)?nt(N,ye,"whitespace")(ue):ye(ue)):re(ue)}function ye(ue){return ue===null||Oe(ue)?(N.exit("codeFencedFence"),Q(ue)):re(ue)}}}function fj(e,i,a){const r=this;return u;function u(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}const ap={name:"codeIndented",tokenize:hj},pj={partial:!0,tokenize:mj};function hj(e,i,a){const r=this;return u;function u(m){return e.enter("codeIndented"),nt(e,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):Oe(m)?e.attempt(pj,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||Oe(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function mj(e,i,a){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?a(d):Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):nt(e,c,"linePrefix",5)(d)}function c(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):Oe(d)?u(d):a(d)}}const gj={name:"codeText",previous:xj,resolve:yj,tokenize:bj};function yj(e){let i=e.length-4,a=3,r,u;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=a;++r<i;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(r=a-1,i++;++r<=i;)u===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(u=r):(r===i||e[r][1].type==="lineEnding")&&(e[u][1].type="codeTextData",r!==u+2&&(e[u][1].end=e[r-1][1].end,e.splice(u+2,r-u-2),i-=r-u-2,r=u+2),u=void 0);return e}function xj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bj(e,i,a){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),g(x))}function g(x){return x===null?a(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),g):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):Oe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Oe(x)?(e.exit("codeTextData"),g(x)):(e.consume(x),m)}function b(x){return x===96?(e.consume(x),u++,b):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(x)):(c.type="codeTextData",m(x))}}class vj{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&&Go(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),Go(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Go(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);Go(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Go(this.left,a.reverse())}}}function Go(e,i){let a=0;if(i.length<1e4)e.push(...i);else for(;a<i.length;)e.push(...i.slice(a,a+1e4)),a+=1e4}function qb(e){const i={};let a=-1,r,u,c,d,p,g,m;const b=new vj(e);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,wj(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},p=b.slice(u,a),p.unshift(r),b.splice(u,a-u+1,p))}}return Xn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function wj(e,i){const a=e.get(i)[1],r=e.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 p=d.events,g=[],m={};let b,x,S=-1,w=a,E=0,M=0;const H=[M];for(;w;){for(;e.get(++u)[1]!==w;);c.push(u),w._tokenizer||(b=r.sliceStream(w),w.next||b.push(null),x&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=w,w=w.next}for(w=a;++S<p.length;)p[S][0]==="exit"&&p[S-1][0]==="enter"&&p[S][1].type===p[S-1][1].type&&p[S][1].start.line!==p[S][1].end.line&&(M=S+1,H.push(M),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):H.pop(),S=H.length;S--;){const R=p.slice(H[S],H[S+1]),q=c.pop();g.push([q,q+R.length-1]),e.splice(q,2,R)}for(g.reverse(),S=-1;++S<g.length;)m[E+g[S][0]]=E+g[S][1],E+=g[S][1]-g[S][0]-1;return m}const kj={resolve:jj,tokenize:Cj},Sj={partial:!0,tokenize:Tj};function jj(e){return qb(e),e}function Cj(e,i){let a;return r;function r(p){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),u(p)}function u(p){return p===null?c(p):Oe(p)?e.check(Sj,d,c)(p):(e.consume(p),u)}function c(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function Tj(e,i,a){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),nt(e,c,"linePrefix")}function c(d){if(d===null||Oe(d))return a(d);const p=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):e.interrupt(r.parser.constructs.flow,a,i)(d)}}function Hb(e,i,a,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(R){return R===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(R),e.exit(c),S):R===null||R===32||R===41||Qc(R)?a(R):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),M(R))}function S(R){return R===62?(e.enter(c),e.consume(R),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(R))}function w(R){return R===62?(e.exit("chunkString"),e.exit(p),S(R)):R===null||R===60||Oe(R)?a(R):(e.consume(R),R===92?E:w)}function E(R){return R===60||R===62||R===92?(e.consume(R),w):w(R)}function M(R){return!b&&(R===null||R===41||xt(R))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(R)):b<m&&R===40?(e.consume(R),b++,M):R===41?(e.consume(R),b--,M):R===null||R===32||R===40||Qc(R)?a(R):(e.consume(R),R===92?H:M)}function H(R){return R===40||R===41||R===92?(e.consume(R),M):M(R)}}function $b(e,i,a,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?a(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):Oe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||w===91||w===93||Oe(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!Xe(w)),w===92?S:x)}function S(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Gb(e,i,a,r,u,c){let d;return p;function p(S){return S===34||S===39||S===40?(e.enter(r),e.enter(u),e.consume(S),e.exit(u),d=S===40?41:S,g):a(S)}function g(S){return S===d?(e.enter(u),e.consume(S),e.exit(u),e.exit(r),i):(e.enter(c),m(S))}function m(S){return S===d?(e.exit(c),g(d)):S===null?a(S):Oe(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),nt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===d||S===null||Oe(S)?(e.exit("chunkString"),m(S)):(e.consume(S),S===92?x:b)}function x(S){return S===d||S===92?(e.consume(S),b):b(S)}}function tu(e,i){let a;return r;function r(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a=!0,r):Xe(u)?nt(e,r,a?"linePrefix":"lineSuffix")(u):i(u)}}const Ej={name:"definition",tokenize:Nj},Aj={partial:!0,tokenize:Dj};function Nj(e,i,a){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return $b.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=Ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),g):a(w)}function g(w){return xt(w)?tu(e,m)(w):m(w)}function m(w){return Hb(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(Aj,x,x)(w)}function x(w){return Xe(w)?nt(e,S,"whitespace")(w):S(w)}function S(w){return w===null||Oe(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):a(w)}}function Dj(e,i,a){return r;function r(p){return xt(p)?tu(e,u)(p):a(p)}function u(p){return Gb(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return Xe(p)?nt(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Oe(p)?i(p):a(p)}}const Rj={name:"hardBreakEscape",tokenize:_j};function _j(e,i,a){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Oe(c)?(e.exit("hardBreakEscape"),i(c)):a(c)}}const Mj={name:"headingAtx",resolve:Oj,tokenize:zj};function Oj(e,i){let a=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},c={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},Xn(e,r,a-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function zj(e,i,a){let r=0;return u;function u(b){return e.enter("atxHeading"),c(b)}function c(b){return e.enter("atxHeadingSequence"),d(b)}function d(b){return b===35&&r++<6?(e.consume(b),d):b===null||xt(b)?(e.exit("atxHeadingSequence"),p(b)):a(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Oe(b)?(e.exit("atxHeading"),i(b)):Xe(b)?nt(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||xt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const Lj=["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"],Ky=["pre","script","style","textarea"],Ij={concrete:!0,name:"htmlFlow",resolveTo:qj,tokenize:Hj},Uj={partial:!0,tokenize:Gj},Bj={partial:!0,tokenize:$j};function qj(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function Hj(e,i,a){const r=this;let u,c,d,p,g;return m;function m(C){return b(C)}function b(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),x}function x(C){return C===33?(e.consume(C),S):C===47?(e.consume(C),c=!0,M):C===63?(e.consume(C),u=3,r.interrupt?i:O):vn(C)?(e.consume(C),d=String.fromCharCode(C),H):a(C)}function S(C){return C===45?(e.consume(C),u=2,w):C===91?(e.consume(C),u=5,p=0,E):vn(C)?(e.consume(C),u=4,r.interrupt?i:O):a(C)}function w(C){return C===45?(e.consume(C),r.interrupt?i:O):a(C)}function E(C){const W="CDATA[";return C===W.charCodeAt(p++)?(e.consume(C),p===W.length?r.interrupt?i:de:E):a(C)}function M(C){return vn(C)?(e.consume(C),d=String.fromCharCode(C),H):a(C)}function H(C){if(C===null||C===47||C===62||xt(C)){const W=C===47,fe=d.toLowerCase();return!W&&!c&&Ky.includes(fe)?(u=1,r.interrupt?i(C):de(C)):Lj.includes(d.toLowerCase())?(u=6,W?(e.consume(C),R):r.interrupt?i(C):de(C)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(C):c?q(C):$(C))}return C===45||pn(C)?(e.consume(C),d+=String.fromCharCode(C),H):a(C)}function R(C){return C===62?(e.consume(C),r.interrupt?i:de):a(C)}function q(C){return Xe(C)?(e.consume(C),q):L(C)}function $(C){return C===47?(e.consume(C),L):C===58||C===95||vn(C)?(e.consume(C),V):Xe(C)?(e.consume(C),$):L(C)}function V(C){return C===45||C===46||C===58||C===95||pn(C)?(e.consume(C),V):ie(C)}function ie(C){return C===61?(e.consume(C),N):Xe(C)?(e.consume(C),ie):$(C)}function N(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),g=C,Q):Xe(C)?(e.consume(C),N):re(C)}function Q(C){return C===g?(e.consume(C),g=null,ee):C===null||Oe(C)?a(C):(e.consume(C),Q)}function re(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||xt(C)?ie(C):(e.consume(C),re)}function ee(C){return C===47||C===62||Xe(C)?$(C):a(C)}function L(C){return C===62?(e.consume(C),te):a(C)}function te(C){return C===null||Oe(C)?de(C):Xe(C)?(e.consume(C),te):a(C)}function de(C){return C===45&&u===2?(e.consume(C),F):C===60&&u===1?(e.consume(C),oe):C===62&&u===4?(e.consume(C),A):C===63&&u===3?(e.consume(C),O):C===93&&u===5?(e.consume(C),_e):Oe(C)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(Uj,z,Ne)(C)):C===null||Oe(C)?(e.exit("htmlFlowData"),Ne(C)):(e.consume(C),de)}function Ne(C){return e.check(Bj,ye,z)(C)}function ye(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ue}function ue(C){return C===null||Oe(C)?Ne(C):(e.enter("htmlFlowData"),de(C))}function F(C){return C===45?(e.consume(C),O):de(C)}function oe(C){return C===47?(e.consume(C),d="",be):de(C)}function be(C){if(C===62){const W=d.toLowerCase();return Ky.includes(W)?(e.consume(C),A):de(C)}return vn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),be):de(C)}function _e(C){return C===93?(e.consume(C),O):de(C)}function O(C){return C===62?(e.consume(C),A):C===45&&u===2?(e.consume(C),O):de(C)}function A(C){return C===null||Oe(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),A)}function z(C){return e.exit("htmlFlow"),i(C)}}function $j(e,i,a){const r=this;return u;function u(d){return Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):a(d)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}function Gj(e,i,a){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(du,i,a)}}const Vj={name:"htmlText",tokenize:Fj};function Fj(e,i,a){const r=this;let u,c,d;return p;function p(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),ie):O===63?(e.consume(O),$):vn(O)?(e.consume(O),re):a(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,E):vn(O)?(e.consume(O),q):a(O)}function b(O){return O===45?(e.consume(O),w):a(O)}function x(O){return O===null?a(O):O===45?(e.consume(O),S):Oe(O)?(d=x,oe(O)):(e.consume(O),x)}function S(O){return O===45?(e.consume(O),w):x(O)}function w(O){return O===62?F(O):O===45?S(O):x(O)}function E(O){const A="CDATA[";return O===A.charCodeAt(c++)?(e.consume(O),c===A.length?M:E):a(O)}function M(O){return O===null?a(O):O===93?(e.consume(O),H):Oe(O)?(d=M,oe(O)):(e.consume(O),M)}function H(O){return O===93?(e.consume(O),R):M(O)}function R(O){return O===62?F(O):O===93?(e.consume(O),R):M(O)}function q(O){return O===null||O===62?F(O):Oe(O)?(d=q,oe(O)):(e.consume(O),q)}function $(O){return O===null?a(O):O===63?(e.consume(O),V):Oe(O)?(d=$,oe(O)):(e.consume(O),$)}function V(O){return O===62?F(O):$(O)}function ie(O){return vn(O)?(e.consume(O),N):a(O)}function N(O){return O===45||pn(O)?(e.consume(O),N):Q(O)}function Q(O){return Oe(O)?(d=Q,oe(O)):Xe(O)?(e.consume(O),Q):F(O)}function re(O){return O===45||pn(O)?(e.consume(O),re):O===47||O===62||xt(O)?ee(O):a(O)}function ee(O){return O===47?(e.consume(O),F):O===58||O===95||vn(O)?(e.consume(O),L):Oe(O)?(d=ee,oe(O)):Xe(O)?(e.consume(O),ee):F(O)}function L(O){return O===45||O===46||O===58||O===95||pn(O)?(e.consume(O),L):te(O)}function te(O){return O===61?(e.consume(O),de):Oe(O)?(d=te,oe(O)):Xe(O)?(e.consume(O),te):ee(O)}function de(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),u=O,Ne):Oe(O)?(d=de,oe(O)):Xe(O)?(e.consume(O),de):(e.consume(O),ye)}function Ne(O){return O===u?(e.consume(O),u=void 0,ue):O===null?a(O):Oe(O)?(d=Ne,oe(O)):(e.consume(O),Ne)}function ye(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||xt(O)?ee(O):(e.consume(O),ye)}function ue(O){return O===47||O===62||xt(O)?ee(O):a(O)}function F(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):a(O)}function oe(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),be}function be(O){return Xe(O)?nt(e,_e,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):_e(O)}function _e(O){return e.enter("htmlTextData"),d(O)}}const gh={name:"labelEnd",resolveAll:Kj,resolveTo:Xj,tokenize:Qj},Yj={tokenize:Zj},Pj={tokenize:Jj},Wj={tokenize:e0};function Kj(e){let i=-1;const a=[];for(;++i<e.length;){const r=e[i][1];if(a.push(e[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",i+=u}}return e.length!==a.length&&Xn(e,0,e.length,a),e}function Xj(e,i){let a=e.length,r=0,u,c,d,p;for(;a--;)if(u=e[a][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[a][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[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:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=ci(p,e.slice(c+1,c+r+3)),p=ci(p,[["enter",b,i]]),p=ci(p,rd(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=ci(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=ci(p,e.slice(d+1)),p=ci(p,[["exit",g,i]]),Xn(e,c,e.length,p),e}function Qj(e,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 p;function p(S){return c?c._inactive?x(S):(d=r.parser.defined.includes(Ci(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(S),e.exit("labelMarker"),e.exit("labelEnd"),g):a(S)}function g(S){return S===40?e.attempt(Yj,b,d?b:x)(S):S===91?e.attempt(Pj,b,d?m:x)(S):d?b(S):x(S)}function m(S){return e.attempt(Wj,b,x)(S)}function b(S){return i(S)}function x(S){return c._balanced=!0,a(S)}}function Zj(e,i,a){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),u}function u(x){return xt(x)?tu(e,c)(x):c(x)}function c(x){return x===41?b(x):Hb(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return xt(x)?tu(e,g)(x):b(x)}function p(x){return a(x)}function g(x){return x===34||x===39||x===40?Gb(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return xt(x)?tu(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):a(x)}}function Jj(e,i,a){const r=this;return u;function u(p){return $b.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(Ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function e0(e,i,a){return r;function r(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),u}function u(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),i):a(c)}}const t0={name:"labelStartImage",resolveAll:gh.resolveAll,tokenize:n0};function n0(e,i,a){const r=this;return u;function u(p){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(p),e.exit("labelImageMarker"),c}function c(p){return p===91?(e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelImage"),d):a(p)}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(p):i(p)}}const i0={name:"labelStartLink",resolveAll:gh.resolveAll,tokenize:a0};function a0(e,i,a){const r=this;return u;function u(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(d):i(d)}}const lp={name:"lineEnding",tokenize:l0};function l0(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),nt(e,i,"linePrefix")}}const Fc={name:"thematicBreak",tokenize:r0};function r0(e,i,a){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Oe(m))?(e.exit("thematicBreak"),i(m)):a(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),Xe(m)?nt(e,p,"whitespace")(m):p(m))}}const Ln={continuation:{tokenize:c0},exit:f0,name:"list",tokenize:u0},s0={partial:!0,tokenize:p0},o0={partial:!0,tokenize:d0};function u0(e,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 p;function p(w){const E=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:qp(w)){if(r.containerState.type||(r.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Fc,a,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return a(w)}function g(w){return qp(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):a(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(du,r.interrupt?a:b,e.attempt(s0,S,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,S(w)}function x(w){return Xe(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),S):a(w)}function S(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function c0(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(du,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,nt(e,i,"listItemIndent",r.containerState.size+1)(p)}function c(p){return r.containerState.furtherBlankLines||!Xe(p)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(p)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(o0,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,nt(e,e.attempt(Ln,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function d0(e,i,a){const r=this;return nt(e,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 f0(e){e.exit(this.containerState.type)}function p0(e,i,a){const r=this;return nt(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!Xe(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):a(c)}}const Xy={name:"setextUnderline",resolveTo:h0,tokenize:m0};function h0(e,i){let a=e.length,r,u,c;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(u=a)}else e[a][1].type==="content"&&e.splice(a,1),!c&&e[a][1].type==="definition"&&(c=a);const d={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[u][1].type="setextHeadingText",c?(e.splice(u,0,["enter",d,i]),e.splice(c+1,0,["exit",e[r][1],i]),e[r][1].end={...e[c][1].end}):e[r][1]=d,e.push(["exit",d,i]),e}function m0(e,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)?(e.enter("setextHeadingLine"),u=m,d(m)):a(m)}function d(m){return e.enter("setextHeadingLineSequence"),p(m)}function p(m){return m===u?(e.consume(m),p):(e.exit("setextHeadingLineSequence"),Xe(m)?nt(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Oe(m)?(e.exit("setextHeadingLine"),i(m)):a(m)}}const g0={tokenize:y0};function y0(e){const i=this,a=e.attempt(du,r,e.attempt(this.parser.constructs.flowInitial,u,nt(e,e.attempt(this.parser.constructs.flow,u,e.attempt(kj,u)),"linePrefix")));return a;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const x0={resolveAll:Fb()},b0=Vb("string"),v0=Vb("text");function Vb(e){return{resolveAll:Fb(e==="text"?w0:void 0),tokenize:i};function i(a){const r=this,u=this.parser.constructs[e],c=a.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(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 S=-1;if(x)for(;++S<x.length;){const w=x[S];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Fb(e){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 e?e(a,r):a}}function w0(e,i){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(p=0),p){const m={type:a===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(a,0,["enter",m,i],["exit",m,i]),a+=2)}a++}return e}const k0={42:Ln,43:Ln,45:Ln,48:Ln,49:Ln,50:Ln,51:Ln,52:Ln,53:Ln,54:Ln,55:Ln,56:Ln,57:Ln,62:Ib},S0={91:Ej},j0={[-2]:ap,[-1]:ap,32:ap},C0={35:Mj,42:Fc,45:[Xy,Fc],60:Ij,61:Xy,95:Fc,96:Wy,126:Wy},T0={38:Bb,92:Ub},E0={[-5]:lp,[-4]:lp,[-3]:lp,33:t0,38:Bb,42:Hp,60:[ij,Vj],91:i0,92:[Rj,Ub],93:gh,95:Hp,96:gj},A0={null:[Hp,x0]},N0={null:[42,95]},D0={null:[]},R0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:N0,contentInitial:S0,disable:D0,document:k0,flow:C0,flowInitial:j0,insideSpan:A0,string:T0,text:E0},Symbol.toStringTag,{value:"Module"}));function _0(e,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=[],p=[];const g={attempt:Q(ie),check:Q(N),consume:q,enter:$,exit:V,interrupt:Q(N,{interrupt:!0})},m={code:null,containerState:{},defineSkip:M,events:[],now:E,parser:e,previous:null,sliceSerialize:S,sliceStream:w,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(te){return d=ci(d,te),H(),d[d.length-1]!==null?[]:(re(i,0),m.events=rd(c,m.events,m),m.events)}function S(te,de){return O0(w(te),de)}function w(te){return M0(d,te)}function E(){const{_bufferIndex:te,_index:de,line:Ne,column:ye,offset:ue}=r;return{_bufferIndex:te,_index:de,line:Ne,column:ye,offset:ue}}function M(te){u[te.line]=te.column,L()}function H(){let te;for(;r._index<d.length;){const de=d[r._index];if(typeof de=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<de.length;)R(de.charCodeAt(r._bufferIndex));else R(de)}}function R(te){b=b(te)}function q(te){Oe(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,L()):te!==-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=te}function $(te,de){const Ne=de||{};return Ne.type=te,Ne.start=E(),m.events.push(["enter",Ne,m]),p.push(Ne),Ne}function V(te){const de=p.pop();return de.end=E(),m.events.push(["exit",de,m]),de}function ie(te,de){re(te,de.from)}function N(te,de){de.restore()}function Q(te,de){return Ne;function Ne(ye,ue,F){let oe,be,_e,O;return Array.isArray(ye)?z(ye):"tokenize"in ye?z([ye]):A(ye);function A(X){return xe;function xe(Me){const Ve=Me!==null&&X[Me],Ct=Me!==null&&X.null,vt=[...Array.isArray(Ve)?Ve:Ve?[Ve]:[],...Array.isArray(Ct)?Ct:Ct?[Ct]:[]];return z(vt)(Me)}}function z(X){return oe=X,be=0,X.length===0?F:C(X[be])}function C(X){return xe;function xe(Me){return O=ee(),_e=X,X.partial||(m.currentConstruct=X),X.name&&m.parser.constructs.disable.null.includes(X.name)?fe():X.tokenize.call(de?Object.assign(Object.create(m),de):m,g,W,fe)(Me)}}function W(X){return te(_e,O),ue}function fe(X){return O.restore(),++be<oe.length?C(oe[be]):F}}}function re(te,de){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Xn(m.events,de,m.events.length-de,te.resolve(m.events.slice(de),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function ee(){const te=E(),de=m.previous,Ne=m.currentConstruct,ye=m.events.length,ue=Array.from(p);return{from:ye,restore:F};function F(){r=te,m.previous=de,m.currentConstruct=Ne,m.events.length=ye,p=ue,L()}}function L(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function M0(e,i){const a=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(a===u)d=[e[a].slice(r,c)];else{if(d=e.slice(a,u),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}c>0&&d.push(e[u].slice(0,c))}return d}function O0(e,i){let a=-1;const r=[];let u;for(;++a<e.length;){const c=e[a];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
|
|
52
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 z0(e){const r={constructs:zb([R0,...(e||{}).extensions||[]]),content:u(XS),defined:[],document:u(ZS),flow:u(g0),lazy:{},string:u(b0),text:u(v0)};return r;function u(c){return d;function d(p){return _0(r,c,p)}}}function L0(e){for(;!qb(e););return e}const Qy=/[\0\t\n\r]/g;function I0(){let e=1,i="",a=!0,r;return u;function u(c,d,p){const g=[];let m,b,x,S,w;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(Qy.lastIndex=x,m=Qy.exec(c),S=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(S),!m){i=c.slice(x);break}if(w===10&&x===S&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<S&&(g.push(c.slice(x,S)),e+=S-x),w){case 0:{g.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,g.push(-2);e++<b;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}x=S+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const U0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function B0(e){return e.replace(U0,q0)}function q0(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),c=u===120||u===88;return Lb(a.slice(c?2:1),c?16:10)}return mh(a)||e}const Yb={}.hasOwnProperty;function H0(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),$0(a)(L0(z0(a).document().write(I0()(e,i,!0))))}function $0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(hn),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:c(Ut),blockQuote:c(Ct),characterEscape:ee,characterReference:ee,codeFenced:c(vt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(vt,d),codeText:c(rn,d),codeTextData:ee,data:ee,codeFlowValue:ee,definition:c(Fe),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(St),hardBreakEscape:c(sn),hardBreakTrailing:c(sn),htmlFlow:c(Le,d),htmlFlowData:ee,htmlText:c(Le,d),htmlTextData:ee,image:c(Bt),label:d,link:c(hn),listItem:c(ji),listItemValue:S,listOrdered:c(Xt,x),listUnordered:c(Xt),paragraph:c(Jn),reference:C,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Ut),strong:c(La),thematicBreak:c(Ia)},exit:{atxHeading:g(),atxHeadingSequence:ie,autolink:g(),autolinkEmail:Ve,autolinkProtocol:Me,blockQuote:g(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:X,characterReference:xe,codeFenced:g(H),codeFencedFence:M,codeFencedFenceInfo:w,codeFencedFenceMeta:E,codeFlowValue:L,codeIndented:g(R),codeText:g(ue),codeTextData:L,data:L,definition:g(),definitionDestinationString:V,definitionLabelString:q,definitionTitleString:$,emphasis:g(),hardBreakEscape:g(de),hardBreakTrailing:g(de),htmlFlow:g(Ne),htmlFlowData:L,htmlText:g(ye),htmlTextData:L,image:g(oe),label:_e,labelText:ve,lineEnding:te,link:g(F),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:W,resourceDestinationString:O,resourceTitleString:A,resource:z,setextHeading:g(re),setextHeadingLineSequence:Q,setextHeadingText:N,strong:g(),thematicBreak:g()}};Pb(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ae){let ce={type:"root",children:[]};const Ee={stack:[ce],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:a},Ue=[];let Xe=-1;for(;++Xe<ae.length;)if(ae[Xe][1].type==="listOrdered"||ae[Xe][1].type==="listUnordered")if(ae[Xe][0]==="enter")Ue.push(Xe);else{const Ft=Ue.pop();Xe=u(ae,Ft,Xe)}for(Xe=-1;++Xe<ae.length;){const Ft=i[ae[Xe][0]];Yb.call(Ft,ae[Xe][1].type)&&Ft[ae[Xe][1].type].call(Object.assign({sliceSerialize:ae[Xe][2].sliceSerialize},Ee),ae[Xe][1])}if(Ee.tokenStack.length>0){const Ft=Ee.tokenStack[Ee.tokenStack.length-1];(Ft[1]||Zy).call(Ee,void 0,Ft[0])}for(ce.position={start:jl(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:jl(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<i.transforms.length;)ce=i.transforms[Xe](ce)||ce;return ce}function u(ae,ce,Ee){let Ue=ce-1,Xe=-1,Ft=!1,ei,Yt,Et,dt;for(;++Ue<=Ee;){const ot=ae[Ue];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?Xe++:Xe--,dt=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(ei&&!dt&&!Xe&&!Et&&(Et=Ue),dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dt=void 0}if(!Xe&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||Xe===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(ei){let Ci=Ue;for(Yt=void 0;Ci--;){const wn=ae[Ci];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Yt&&(ae[Yt][1].type="lineEndingBlank",Ft=!0),wn[1].type="lineEnding",Yt=Ci}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}Et&&(!Yt||Et<Yt)&&(ei._spread=!0),ei.end=Object.assign({},Yt?ae[Yt][1].start:ot[1].end),ae.splice(Yt||Ue,0,["exit",ei,ot[2]]),Ue++,Ee++}if(ot[1].type==="listItemPrefix"){const Ci={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};ei=Ci,ae.splice(Ue,0,["enter",Ci,ot[2]]),Ue++,Ee++,Et=void 0,dt=!0}}}return ae[ce][1]._spread=Ft,Ee}function c(ae,ce){return Ee;function Ee(Ue){p.call(this,ae(Ue),Ue),ce&&ce.call(this,Ue)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ae,ce,Ee){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([ce,Ee||void 0]),ae.position={start:jl(ce.start),end:void 0}}function g(ae){return ce;function ce(Ee){ae&&ae.call(this,Ee),m.call(this,Ee)}}function m(ae,ce){const Ee=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==ae.type&&(ce?ce.call(this,ae,Ue[0]):(Ue[1]||Zy).call(this,ae,Ue[0]));else throw new Error("Cannot close `"+ae.type+"` ("+eu({start:ae.start,end:ae.end})+"): it’s not open");Ee.position.end=jl(ae.end)}function b(){return hh(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function S(ae){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=ae}function E(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=ae}function M(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function H(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function R(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae.replace(/(\r?\n|\r)$/g,"")}function q(ae){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ce,Ee.identifier=Si(this.sliceSerialize(ae)).toLowerCase()}function $(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ae}function V(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ae}function ie(ae){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Ee=this.sliceSerialize(ae).length;ce.depth=Ee}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function Q(ae){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function re(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ae){const Ee=this.stack[this.stack.length-1].children;let Ue=Ee[Ee.length-1];(!Ue||Ue.type!=="text")&&(Ue=Mt(),Ue.position={start:jl(ae.start),end:void 0},Ee.push(Ue)),this.stack.push(Ue)}function L(ae){const ce=this.stack.pop();ce.value+=this.sliceSerialize(ae),ce.position.end=jl(ae.end)}function te(ae){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=ce.children[ce.children.length-1];Ee.position.end=jl(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ce.type)&&(ee.call(this,ae),L.call(this,ae))}function de(){this.data.atHardBreak=!0}function Ne(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae}function ye(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae}function ue(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae}function F(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ce,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function oe(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ce,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function ve(ae){const ce=this.sliceSerialize(ae),Ee=this.stack[this.stack.length-2];Ee.label=B0(ce),Ee.identifier=Si(ce).toLowerCase()}function _e(){const ae=this.stack[this.stack.length-1],ce=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ue=ae.children;Ee.children=Ue}else Ee.alt=ce}function O(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ae}function A(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ae}function z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function W(ae){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ce,Ee.identifier=Si(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function fe(ae){this.data.characterReferenceType=ae.type}function X(ae){const ce=this.sliceSerialize(ae),Ee=this.data.characterReferenceType;let Ue;Ee?(Ue=Lb(ce,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=mh(ce);const Xe=this.stack[this.stack.length-1];Xe.value+=Ue}function xe(ae){const ce=this.stack.pop();ce.position.end=jl(ae.end)}function Me(ae){L.call(this,ae);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(ae)}function Ve(ae){L.call(this,ae);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(ae)}function Ct(){return{type:"blockquote",children:[]}}function vt(){return{type:"code",lang:null,meta:null,value:""}}function rn(){return{type:"inlineCode",value:""}}function Fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function St(){return{type:"emphasis",children:[]}}function Ut(){return{type:"heading",depth:0,children:[]}}function sn(){return{type:"break"}}function Le(){return{type:"html",value:""}}function Bt(){return{type:"image",title:null,url:"",alt:null}}function hn(){return{type:"link",title:null,url:"",children:[]}}function Xt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function ji(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function Jn(){return{type:"paragraph",children:[]}}function La(){return{type:"strong",children:[]}}function Mt(){return{type:"text",value:""}}function Ia(){return{type:"thematicBreak"}}}function jl(e){return{line:e.line,column:e.column,offset:e.offset}}function Pb(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Pb(e,r):G0(e,r)}}function G0(e,i){let a;for(a in i)if(Yb.call(i,a))switch(a){case"canContainEols":{const r=i[a];r&&e[a].push(...r);break}case"transforms":{const r=i[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=i[a];r&&Object.assign(e[a],r);break}}}function Zy(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+eu({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+eu({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+eu({start:i.start,end:i.end})+") is still open")}function V0(e){const i=this;i.parser=a;function a(r){return H0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function F0(e,i){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,a),e.applyData(i,a)}function Y0(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
|
|
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 z0(e){const r={constructs:zb([R0,...(e||{}).extensions||[]]),content:u(XS),defined:[],document:u(ZS),flow:u(g0),lazy:{},string:u(b0),text:u(v0)};return r;function u(c){return d;function d(p){return _0(r,c,p)}}}function L0(e){for(;!qb(e););return e}const Qy=/[\0\t\n\r]/g;function I0(){let e=1,i="",a=!0,r;return u;function u(c,d,p){const g=[];let m,b,x,S,w;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(Qy.lastIndex=x,m=Qy.exec(c),S=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(S),!m){i=c.slice(x);break}if(w===10&&x===S&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<S&&(g.push(c.slice(x,S)),e+=S-x),w){case 0:{g.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,g.push(-2);e++<b;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}x=S+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const U0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function B0(e){return e.replace(U0,q0)}function q0(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),c=u===120||u===88;return Lb(a.slice(c?2:1),c?16:10)}return mh(a)||e}const Yb={}.hasOwnProperty;function H0(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),$0(a)(L0(z0(a).document().write(I0()(e,i,!0))))}function $0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(mn),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:c(It),blockQuote:c(Ct),characterEscape:ee,characterReference:ee,codeFenced:c(vt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(vt,d),codeText:c(rn,d),codeTextData:ee,data:ee,codeFlowValue:ee,definition:c(Ye),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(St),hardBreakEscape:c(sn),hardBreakTrailing:c(sn),htmlFlow:c(Le,d),htmlFlowData:ee,htmlText:c(Le,d),htmlTextData:ee,image:c(Ut),label:d,link:c(mn),listItem:c(Ti),listItemValue:S,listOrdered:c(Xt,x),listUnordered:c(Xt),paragraph:c(Qn),reference:C,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(It),strong:c(La),thematicBreak:c(Ia)},exit:{atxHeading:g(),atxHeadingSequence:ie,autolink:g(),autolinkEmail:Ve,autolinkProtocol:Me,blockQuote:g(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:X,characterReference:xe,codeFenced:g(H),codeFencedFence:M,codeFencedFenceInfo:w,codeFencedFenceMeta:E,codeFlowValue:L,codeIndented:g(R),codeText:g(ue),codeTextData:L,data:L,definition:g(),definitionDestinationString:V,definitionLabelString:q,definitionTitleString:$,emphasis:g(),hardBreakEscape:g(de),hardBreakTrailing:g(de),htmlFlow:g(Ne),htmlFlowData:L,htmlText:g(ye),htmlTextData:L,image:g(oe),label:_e,labelText:be,lineEnding:te,link:g(F),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:W,resourceDestinationString:O,resourceTitleString:A,resource:z,setextHeading:g(re),setextHeadingLineSequence:Q,setextHeadingText:N,strong:g(),thematicBreak:g()}};Pb(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ae){let ce={type:"root",children:[]};const Ee={stack:[ce],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:a},Ue=[];let Qe=-1;for(;++Qe<ae.length;)if(ae[Qe][1].type==="listOrdered"||ae[Qe][1].type==="listUnordered")if(ae[Qe][0]==="enter")Ue.push(Qe);else{const Vt=Ue.pop();Qe=u(ae,Vt,Qe)}for(Qe=-1;++Qe<ae.length;){const Vt=i[ae[Qe][0]];Yb.call(Vt,ae[Qe][1].type)&&Vt[ae[Qe][1].type].call(Object.assign({sliceSerialize:ae[Qe][2].sliceSerialize},Ee),ae[Qe][1])}if(Ee.tokenStack.length>0){const Vt=Ee.tokenStack[Ee.tokenStack.length-1];(Vt[1]||Zy).call(Ee,void 0,Vt[0])}for(ce.position={start:Cl(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:Cl(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},Qe=-1;++Qe<i.transforms.length;)ce=i.transforms[Qe](ce)||ce;return ce}function u(ae,ce,Ee){let Ue=ce-1,Qe=-1,Vt=!1,Zn,Ft,Et,ct;for(;++Ue<=Ee;){const st=ae[Ue];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?Qe++:Qe--,ct=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(Zn&&!ct&&!Qe&&!Et&&(Et=Ue),ct=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ct=void 0}if(!Qe&&st[0]==="enter"&&st[1].type==="listItemPrefix"||Qe===-1&&st[0]==="exit"&&(st[1].type==="listUnordered"||st[1].type==="listOrdered")){if(Zn){let Ei=Ue;for(Ft=void 0;Ei--;){const wn=ae[Ei];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Ft&&(ae[Ft][1].type="lineEndingBlank",Vt=!0),wn[1].type="lineEnding",Ft=Ei}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}Et&&(!Ft||Et<Ft)&&(Zn._spread=!0),Zn.end=Object.assign({},Ft?ae[Ft][1].start:st[1].end),ae.splice(Ft||Ue,0,["exit",Zn,st[2]]),Ue++,Ee++}if(st[1].type==="listItemPrefix"){const Ei={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};Zn=Ei,ae.splice(Ue,0,["enter",Ei,st[2]]),Ue++,Ee++,Et=void 0,ct=!0}}}return ae[ce][1]._spread=Vt,Ee}function c(ae,ce){return Ee;function Ee(Ue){p.call(this,ae(Ue),Ue),ce&&ce.call(this,Ue)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ae,ce,Ee){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([ce,Ee||void 0]),ae.position={start:Cl(ce.start),end:void 0}}function g(ae){return ce;function ce(Ee){ae&&ae.call(this,Ee),m.call(this,Ee)}}function m(ae,ce){const Ee=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==ae.type&&(ce?ce.call(this,ae,Ue[0]):(Ue[1]||Zy).call(this,ae,Ue[0]));else throw new Error("Cannot close `"+ae.type+"` ("+eu({start:ae.start,end:ae.end})+"): it’s not open");Ee.position.end=Cl(ae.end)}function b(){return hh(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function S(ae){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=ae}function E(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=ae}function M(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function H(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function R(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae.replace(/(\r?\n|\r)$/g,"")}function q(ae){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ce,Ee.identifier=Ci(this.sliceSerialize(ae)).toLowerCase()}function $(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ae}function V(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ae}function ie(ae){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Ee=this.sliceSerialize(ae).length;ce.depth=Ee}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function Q(ae){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function re(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ae){const Ee=this.stack[this.stack.length-1].children;let Ue=Ee[Ee.length-1];(!Ue||Ue.type!=="text")&&(Ue=_t(),Ue.position={start:Cl(ae.start),end:void 0},Ee.push(Ue)),this.stack.push(Ue)}function L(ae){const ce=this.stack.pop();ce.value+=this.sliceSerialize(ae),ce.position.end=Cl(ae.end)}function te(ae){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=ce.children[ce.children.length-1];Ee.position.end=Cl(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ce.type)&&(ee.call(this,ae),L.call(this,ae))}function de(){this.data.atHardBreak=!0}function Ne(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae}function ye(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae}function ue(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae}function F(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ce,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function oe(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ce,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function be(ae){const ce=this.sliceSerialize(ae),Ee=this.stack[this.stack.length-2];Ee.label=B0(ce),Ee.identifier=Ci(ce).toLowerCase()}function _e(){const ae=this.stack[this.stack.length-1],ce=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ue=ae.children;Ee.children=Ue}else Ee.alt=ce}function O(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ae}function A(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ae}function z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function W(ae){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ce,Ee.identifier=Ci(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function fe(ae){this.data.characterReferenceType=ae.type}function X(ae){const ce=this.sliceSerialize(ae),Ee=this.data.characterReferenceType;let Ue;Ee?(Ue=Lb(ce,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=mh(ce);const Qe=this.stack[this.stack.length-1];Qe.value+=Ue}function xe(ae){const ce=this.stack.pop();ce.position.end=Cl(ae.end)}function Me(ae){L.call(this,ae);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(ae)}function Ve(ae){L.call(this,ae);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(ae)}function Ct(){return{type:"blockquote",children:[]}}function vt(){return{type:"code",lang:null,meta:null,value:""}}function rn(){return{type:"inlineCode",value:""}}function Ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function St(){return{type:"emphasis",children:[]}}function It(){return{type:"heading",depth:0,children:[]}}function sn(){return{type:"break"}}function Le(){return{type:"html",value:""}}function Ut(){return{type:"image",title:null,url:"",alt:null}}function mn(){return{type:"link",title:null,url:"",children:[]}}function Xt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Ti(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function Qn(){return{type:"paragraph",children:[]}}function La(){return{type:"strong",children:[]}}function _t(){return{type:"text",value:""}}function Ia(){return{type:"thematicBreak"}}}function Cl(e){return{line:e.line,column:e.column,offset:e.offset}}function Pb(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Pb(e,r):G0(e,r)}}function G0(e,i){let a;for(a in i)if(Yb.call(i,a))switch(a){case"canContainEols":{const r=i[a];r&&e[a].push(...r);break}case"transforms":{const r=i[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=i[a];r&&Object.assign(e[a],r);break}}}function Zy(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+eu({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+eu({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+eu({start:i.start,end:i.end})+") is still open")}function V0(e){const i=this;i.parser=a;function a(r){return H0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function F0(e,i){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,a),e.applyData(i,a)}function Y0(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
|
|
54
54
|
`}]}function P0(e,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}),e.patch(i,c),c=e.applyData(i,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(i,c),c}function W0(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function K0(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function X0(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=
|
|
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}),e.patch(i,c),c=e.applyData(i,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(i,c),c}function W0(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function K0(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function X0(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=Ms(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,p+=1,e.footnoteCounts.set(r,p);const g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+u,id:a+"fnref-"+u+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function Q0(e,i){const a={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Z0(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function Wb(e,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=e.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 J0(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Wb(e,i);const u={src:Ms(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 e.patch(i,c),e.applyData(i,c)}function e1(e,i){const a={src:Ms(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 e.patch(i,r),e.applyData(i,r)}function t1(e,i){const a={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(i,r),e.applyData(i,r)}function n1(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Wb(e,i);const u={href:Ms(r.url||"")};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"a",properties:u,children:e.all(i)};return e.patch(i,c),e.applyData(i,c)}function i1(e,i){const a={href:Ms(i.url)};i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"a",properties:a,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function a1(e,i,a){const r=e.all(i),u=a?l1(a):Kb(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 p=-1;for(;++p<r.length;){const b=r[p];(u||p!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
|
|
56
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 e.patch(i,m),e.applyData(i,m)}function l1(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const a=e.children;let r=-1;for(;!i&&++r<a.length;)i=Kb(a[r])}return i}function Kb(e){const i=e.spread;return i??e.children.length>1}function r1(e,i){const a={},r=e.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:e.wrap(r,!0)};return e.patch(i,c),e.applyData(i,c)}function s1(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function o1(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function u1(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function c1(e,i){const a=e.all(i),r=a.shift(),u=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],d),u.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},p=ch(i.children[1]),g=Ab(i.children[i.children.length-1]);p&&g&&(d.position={start:p,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(u,!0)};return e.patch(i,c),e.applyData(i,c)}function d1(e,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,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const x=i.children[g],S={},w=d?d[g]:void 0;w&&(S.align=w);let E={type:"element",tagName:c,properties:S,children:[]};x&&(E.children=e.all(x),e.patch(x,E),E=e.applyData(x,E)),m.push(E)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function f1(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const Jy=9,ex=32;function p1(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(tx(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(tx(i.slice(u),u>0,!1)),c.join("")}function tx(e,i,a){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===Jy||c===ex;)r++,c=e.codePointAt(r)}if(a){let c=e.codePointAt(u-1);for(;c===Jy||c===ex;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function h1(e,i){const a={type:"text",value:p1(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function m1(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const g1={blockquote:F0,break:Y0,code:P0,delete:W0,emphasis:K0,footnoteReference:X0,heading:Q0,html:Z0,imageReference:J0,image:e1,inlineCode:t1,linkReference:n1,link:i1,listItem:a1,list:r1,paragraph:s1,root:o1,strong:u1,table:c1,tableCell:f1,tableRow:d1,text:h1,thematicBreak:m1,toml:
|
|
57
|
+
`});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function l1(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const a=e.children;let r=-1;for(;!i&&++r<a.length;)i=Kb(a[r])}return i}function Kb(e){const i=e.spread;return i??e.children.length>1}function r1(e,i){const a={},r=e.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:e.wrap(r,!0)};return e.patch(i,c),e.applyData(i,c)}function s1(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function o1(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function u1(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function c1(e,i){const a=e.all(i),r=a.shift(),u=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],d),u.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},p=ch(i.children[1]),g=Ab(i.children[i.children.length-1]);p&&g&&(d.position={start:p,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(u,!0)};return e.patch(i,c),e.applyData(i,c)}function d1(e,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,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const x=i.children[g],S={},w=d?d[g]:void 0;w&&(S.align=w);let E={type:"element",tagName:c,properties:S,children:[]};x&&(E.children=e.all(x),e.patch(x,E),E=e.applyData(x,E)),m.push(E)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function f1(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const Jy=9,ex=32;function p1(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(tx(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(tx(i.slice(u),u>0,!1)),c.join("")}function tx(e,i,a){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===Jy||c===ex;)r++,c=e.codePointAt(r)}if(a){let c=e.codePointAt(u-1);for(;c===Jy||c===ex;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function h1(e,i){const a={type:"text",value:p1(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function m1(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const g1={blockquote:F0,break:Y0,code:P0,delete:W0,emphasis:K0,footnoteReference:X0,heading:Q0,html:Z0,imageReference:J0,image:e1,inlineCode:t1,linkReference:n1,link:i1,listItem:a1,list:r1,paragraph:s1,root:o1,strong:u1,table:c1,tableCell:f1,tableRow:d1,text:h1,thematicBreak:m1,toml:Mc,yaml:Mc,definition:Mc,footnoteDefinition:Mc};function Mc(){}const Xb=-1,sd=0,nu=1,Zc=2,yh=3,xh=4,bh=5,vh=6,Qb=7,Zb=8,y1=typeof self=="object"?self:globalThis,nx=(e,i)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new y1[e](i)},x1=(e,i)=>{const a=(u,c)=>(e.set(c,u),u),r=u=>{if(e.has(u))return e.get(u);const[c,d]=i[u];switch(c){case sd:case Xb:return a(d,u);case nu:{const p=a([],u);for(const g of d)p.push(r(g));return p}case Zc:{const p=a({},u);for(const[g,m]of d)p[r(g)]=r(m);return p}case yh:return a(new Date(d),u);case xh:{const{source:p,flags:g}=d;return a(new RegExp(p,g),u)}case bh:{const p=a(new Map,u);for(const[g,m]of d)p.set(r(g),r(m));return p}case vh:{const p=a(new Set,u);for(const g of d)p.add(r(g));return p}case Qb:{const{name:p,message:g}=d;return a(nx(p,g),u)}case Zb: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:p}=new Uint8Array(d);return a(new DataView(p),d)}}return a(nx(c,d),u)};return r},ix=e=>x1(new Map,e)(0),hr="",{toString:b1}={},{keys:v1}=Object,Vo=e=>{const i=typeof e;if(i!=="object"||!e)return[sd,i];const a=b1.call(e).slice(8,-1);switch(a){case"Array":return[nu,hr];case"Object":return[Zc,hr];case"Date":return[yh,hr];case"RegExp":return[xh,hr];case"Map":return[bh,hr];case"Set":return[vh,hr];case"DataView":return[nu,a]}return a.includes("Array")?[nu,a]:a.includes("Error")?[Qb,a]:[Zc,a]},Oc=([e,i])=>e===sd&&(i==="function"||i==="symbol"),w1=(e,i,a,r)=>{const u=(d,p)=>{const g=r.push(d)-1;return a.set(p,g),g},c=d=>{if(a.has(d))return a.get(d);let[p,g]=Vo(d);switch(p){case sd:{let b=d;switch(g){case"bigint":p=Zb,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([Xb],d)}return u([p,b],d)}case nu:{if(g){let S=d;return g==="DataView"?S=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(S=new Uint8Array(d)),u([g,[...S]],d)}const b=[],x=u([p,b],d);for(const S of d)b.push(c(S));return x}case Zc:{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([p,b],d);for(const S of v1(d))(e||!Oc(Vo(d[S])))&&b.push([c(S),c(d[S])]);return x}case yh:return u([p,isNaN(d.getTime())?hr:d.toISOString()],d);case xh:{const{source:b,flags:x}=d;return u([p,{source:b,flags:x}],d)}case bh:{const b=[],x=u([p,b],d);for(const[S,w]of d)(e||!(Oc(Vo(S))||Oc(Vo(w))))&&b.push([c(S),c(w)]);return x}case vh:{const b=[],x=u([p,b],d);for(const S of d)(e||!Oc(Vo(S)))&&b.push(c(S));return x}}const{message:m}=d;return u([p,{name:g,message:m}],d)};return c},ax=(e,{json:i,lossy:a}={})=>{const r=[];return w1(!(i||a),!!i,new Map,r)(e),r},Jc=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?ix(ax(e,i)):structuredClone(e):(e,i)=>ix(ax(e,i));function k1(e,i){const a=[{type:"text",value:"↩"}];return i>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),a}function S1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function j1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||k1,r=e.options.footnoteBackLabel||S1,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let g=-1;for(;++g<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[g]);if(!m)continue;const b=e.all(m),x=String(m.identifier).toUpperCase(),S=Ms(x.toLowerCase());let w=0;const E=[],M=e.footnoteCounts.get(x);for(;M!==void 0&&++w<=M;){E.length>0&&E.push({type:"text",value:" "});let q=typeof a=="string"?a:a(g,w);typeof q=="string"&&(q={type:"text",value:q}),E.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+S+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,w),className:["data-footnote-backref"]},children:Array.isArray(q)?q:[q]})}const H=b[b.length-1];if(H&&H.type==="element"&&H.tagName==="p"){const q=H.children[H.children.length-1];q&&q.type==="text"?q.value+=" ":H.children.push({type:"text",value:" "}),H.children.push(...E)}else b.push(...E);const R={type:"element",tagName:"li",properties:{id:i+"fn-"+S},children:e.wrap(b,!0)};e.patch(m,R),p.push(R)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Jc(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
|
|
58
58
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(p,!0)},{type:"text",value:`
|
|
59
|
-
`}]}}const
|
|
59
|
+
`}]}}const od=(function(e){if(e==null)return A1;if(typeof e=="function")return ud(e);if(typeof e=="object")return Array.isArray(e)?C1(e):T1(e);if(typeof e=="string")return E1(e);throw new Error("Expected function, string, or object as test")});function C1(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=od(e[a]);return ud(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function T1(e){const i=e;return ud(a);function a(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function E1(e){return ud(i);function i(a){return a&&a.type===e}}function ud(e){return i;function i(a,r,u){return!!(N1(a)&&e.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function A1(){return!0}function N1(e){return e!==null&&typeof e=="object"&&"type"in e}const Jb=[],D1=!0,$p=!1,R1="skip";function ev(e,i,a,r){let u;typeof i=="function"&&typeof a!="function"?(r=a,a=i):u=i;const c=od(u),d=r?-1:1;p(e,void 0,[])();function p(g,m,b){const x=g&&typeof g=="object"?g:{};if(typeof x.type=="string"){const w=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=Jb,E,M,H;if((!i||c(g,m,b[b.length-1]||void 0))&&(w=_1(a(g,b)),w[0]===$p))return w;if("children"in g&&g.children){const R=g;if(R.children&&w[0]!==R1)for(M=(r?R.children.length:-1)+d,H=b.concat(R);M>-1&&M<R.children.length;){const q=R.children[M];if(E=p(q,M,H)(),E[0]===$p)return E;M=typeof E[1]=="number"?E[1]:M+d}}return w}}}function _1(e){return Array.isArray(e)?e:typeof e=="number"?[D1,e]:e==null?Jb:[e]}function wh(e,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),ev(e,c,p,u);function p(g,m){const b=m[m.length-1],x=b?b.children.indexOf(g):void 0;return d(g,x,b)}}const Gp={}.hasOwnProperty,M1={};function O1(e,i){const a=i||M1,r=new Map,u=new Map,c=new Map,d={...g1,...a.handlers},p={all:m,applyData:L1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:a,patch:z1,wrap:U1};return wh(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,S=String(b.identifier).toUpperCase();x.has(S)||x.set(S,b)}}),p;function g(b,x){const S=b.type,w=p.handlers[S];if(Gp.call(p.handlers,S)&&w)return w(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(S)){if("children"in b){const{children:M,...H}=b,R=Jc(H);return R.children=p.all(b),R}return Jc(b)}return(p.options.unknownHandler||I1)(p,b,x)}function m(b){const x=[];if("children"in b){const S=b.children;let w=-1;for(;++w<S.length;){const E=p.one(S[w],b);if(E){if(w&&S[w-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=lx(E.value)),!Array.isArray(E)&&E.type==="element")){const M=E.children[0];M&&M.type==="text"&&(M.value=lx(M.value))}Array.isArray(E)?x.push(...E):x.push(E)}}}return x}}function z1(e,i){e.position&&(i.position=kS(e))}function L1(e,i){let a=i;if(e&&e.data){const r=e.data.hName,u=e.data.hChildren,c=e.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,Jc(c)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function I1(e,i){const a=i.data||{},r="value"in i&&!(Gp.call(a,"hProperties")||Gp.call(a,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function U1(e,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
|
|
60
60
|
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
61
61
|
`}),a.push(e[r]);return i&&e.length>0&&a.push({type:"text",value:`
|
|
62
62
|
`}),a}function lx(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function rx(e,i){const a=O1(e,i),r=a.one(e,void 0),u=j1(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 B1(e,i){return e&&"run"in e?async function(a,r){const u=rx(a,{file:r,...i});await e.run(u,r)}:function(a,r){return rx(a,{file:r,...e||i})}}function sx(e){if(e)throw e}var rp,ox;function q1(){if(ox)return rp;ox=1;var e=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=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!x)return!1;var S;for(S in m);return typeof S>"u"||e.call(m,S)},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},p=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return rp=function g(){var m,b,x,S,w,E,M=arguments[0],H=1,R=arguments.length,q=!1;for(typeof M=="boolean"&&(q=M,M=arguments[1]||{},H=2),(M==null||typeof M!="object"&&typeof M!="function")&&(M={});H<R;++H)if(m=arguments[H],m!=null)for(b in m)x=p(M,b),S=p(m,b),M!==S&&(q&&S&&(c(S)||(w=u(S)))?(w?(w=!1,E=x&&u(x)?x:[]):E=x&&c(x)?x:{},d(M,{name:b,newValue:g(q,E,S)})):typeof S<"u"&&d(M,{name:b,newValue:S}));return M},rp}var H1=q1();const sp=vb(H1);function Vp(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $1(){const e=[],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);p(null,...u);function p(g,...m){const b=e[++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?G1(b,p)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function G1(e,i){let a;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&a)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){a||(a=!0,i(d,...p))}function c(d){u(null,d)}}const Zi={basename:V1,dirname:F1,extname:Y1,join:P1,sep:"/"};function V1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');fu(e);let a=0,r=-1,u=e.length,c;if(i===void 0||i.length===0||i.length>e.length){for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":e.slice(a,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else d<0&&(c=!0,d=u+1),p>-1&&(e.codePointAt(u)===i.codePointAt(p--)?p<0&&(r=u):(p=-1,r=d));return a===r?r=d:r<0&&(r=e.length),e.slice(a,r)}function F1(e){if(fu(e),e.length===0)return".";let i=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){i=a;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function Y1(e){fu(e);let i=e.length,a=-1,r=0,u=-1,c=0,d;for(;i--;){const p=e.codePointAt(i);if(p===47){if(d){r=i+1;break}continue}a<0&&(d=!0,a=i+1),p===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?"":e.slice(u,a)}function P1(...e){let i=-1,a;for(;++i<e.length;)fu(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":W1(a)}function W1(e){fu(e);const i=e.codePointAt(0)===47;let a=K1(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function K1(e,i){let a="",r=0,u=-1,c=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===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+="/"+e.slice(u+1,d):a=e.slice(u+1,d),r=d-u-1;u=d,c=0}else p===46&&c>-1?c++:c=-1}return a}function fu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const X1={cwd:Q1};function Q1(){return"/"}function Fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Z1(e){if(typeof e=="string")e=new URL(e);else if(!Fp(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return J1(e)}function J1(e){if(e.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=e.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 op=["history","path","basename","stem","extname","dirname"];class tv{constructor(i){let a;i?Fp(i)?a={path:i}:typeof i=="string"||eC(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":X1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<op.length;){const c=op[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)op.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?Zi.basename(this.path):void 0}set basename(i){cp(i,"basename"),up(i,"basename"),this.path=Zi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Zi.dirname(this.path):void 0}set dirname(i){ux(this.basename,"dirname"),this.path=Zi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Zi.extname(this.path):void 0}set extname(i){if(up(i,"extname"),ux(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=Zi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Fp(i)&&(i=Z1(i)),cp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Zi.basename(this.path,this.extname):void 0}set stem(i){cp(i,"stem"),up(i,"stem"),this.path=Zi.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 pn(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 up(e,i){if(e&&e.includes(Zi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Zi.sep+"`")}function cp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function ux(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function eC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tC=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),nC={}.hasOwnProperty;class kh extends tC{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=$1()}copy(){const i=new kh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(sp(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(pp("data",this.frozen),this.namespace[i]=a,this):nC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(pp("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=Lc(i),r=this.parser||this.Parser;return dp("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),dp("process",this.parser||this.Parser),fp("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const p=Lc(i),g=r.parse(p);r.run(g,p,function(b,x,S){if(b||!x||!S)return m(b);const w=x,E=r.stringify(w,S);lC(E)?S.value=E:S.result=E,m(b,S)});function m(b,x){b||!x?d(b):c?c(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),dp("processSync",this.parser||this.Parser),fp("processSync",this.compiler||this.Compiler),this.process(i,u),dx("processSync","process",a),r;function u(c,d){a=!0,sx(c),r=d}}run(i,a,r){cx(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,p){const g=Lc(a);u.run(i,g,m);function m(b,x,S){const w=x||i;b?p(b):d?d(w):r(void 0,w,S)}}}runSync(i,a){let r=!1,u;return this.run(i,a,c),dx("runSync","run",r),u;function c(d,p){sx(d),u=p,r=!0}}stringify(i,a){this.freeze();const r=Lc(a),u=this.compiler||this.Compiler;return fp("stringify",u),cx(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(pp("use",this.frozen),i!=null)if(typeof i=="function")g(i,a);else if(typeof i=="object")Array.isArray(i)?p(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");p(m.plugins),m.settings&&(u.settings=sp(!0,u.settings,m.settings))}function p(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,S=-1;for(;++x<r.length;)if(r[x][0]===m){S=x;break}if(S===-1)r.push([m,...b]);else if(b.length>0){let[w,...E]=b;const M=r[S][1];Vp(M)&&Vp(w)&&(w=sp(!0,M,w)),r[S]=[m,w,...E]}}}}const iC=new kh().freeze();function dp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pp(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cx(e){if(!Vp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dx(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Lc(e){return aC(e)?e:new tv(e)}function aC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lC(e){return typeof e=="string"||rC(e)}function rC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",fx=[],px={allowDangerousHtml:!0},oC=/^(https?|ircs?|mailto|xmpp)$/i,uC=[{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 cC(e){const i=dC(e),a=fC(e);return pC(i.runSync(i.parse(a),a),e)}function dC(e){const i=e.rehypePlugins||fx,a=e.remarkPlugins||fx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...px}:px;return iC().use(V0).use(a).use(B1,r).use(i)}function fC(e){const i=e.children||"",a=new tv;return typeof i=="string"&&(a.value=i),a}function pC(e,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||hC;for(const b of uC)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+sC+b.id,void 0);return wh(e,m),ES(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,S){if(b.type==="raw"&&S&&typeof x=="number")return d?S.children.splice(x,1):S.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in ip)if(Object.hasOwn(ip,w)&&Object.hasOwn(b.properties,w)){const E=b.properties[w],M=ip[w];(M===null||M.includes(b.tagName))&&(b.properties[w]=g(String(E||""),w,b))}}if(b.type==="element"){let w=a?!a.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof x=="number"&&(w=!r(b,x,S)),w&&S&&typeof x=="number")return p&&b.children?S.children.splice(x,1,...b.children):S.children.splice(x,1),x}}}function hC(e){const i=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),u=e.indexOf("/");return i===-1||u!==-1&&i>u||a!==-1&&i>a||r!==-1&&i>r||oC.test(e.slice(0,i))?e:""}function hx(e,i){const a=String(e);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 mC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function gC(e,i,a){const u=ud((a||{}).ignore||[]),c=yC(i);let d=-1;for(;++d<c.length;)ev(e,"text",p);function p(m,b){let x=-1,S;for(;++x<b.length;){const w=b[x],E=S?S.children:void 0;if(u(w,E?E.indexOf(w):void 0,S))return;S=w}if(S)return g(m,b)}function g(m,b){const x=b[b.length-1],S=c[d][0],w=c[d][1];let E=0;const H=x.children.indexOf(m);let R=!1,q=[];S.lastIndex=0;let $=S.exec(m.value);for(;$;){const V=$.index,ie={index:$.index,input:$.input,stack:[...b,m]};let N=w(...$,ie);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?S.lastIndex=V+1:(E!==V&&q.push({type:"text",value:m.value.slice(E,V)}),Array.isArray(N)?q.push(...N):N&&q.push(N),E=V+$[0].length,R=!0),!S.global)break;$=S.exec(m.value)}return R?(E<m.value.length&&q.push({type:"text",value:m.value.slice(E)}),x.children.splice(H,1,...q)):q=[m],H+q.length}}function yC(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const u=a[r];i.push([xC(u[0]),bC(u[1])])}return i}function xC(e){return typeof e=="string"?new RegExp(mC(e),"g"):e}function bC(e){return typeof e=="function"?e:function(){return e}}const hp="phrasing",mp=["autolink","link","image","label"];function vC(){return{transforms:[EC],enter:{literalAutolink:kC,literalAutolinkEmail:gp,literalAutolinkHttp:gp,literalAutolinkWww:gp},exit:{literalAutolink:TC,literalAutolinkEmail:CC,literalAutolinkHttp:SC,literalAutolinkWww:jC}}}function wC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:mp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:mp},{character:":",before:"[ps]",after:"\\/",inConstruct:hp,notInConstruct:mp}]}}function kC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gp(e){this.config.enter.autolinkProtocol.call(this,e)}function SC(e){this.config.exit.autolinkProtocol.call(this,e)}function jC(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function CC(e){this.config.exit.autolinkEmail.call(this,e)}function TC(e){this.exit(e)}function EC(e){gC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,AC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),NC]],{ignore:["link","linkReference"]})}function AC(e,i,a,r,u){let c="";if(!nv(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!DC(a)))return!1;const d=RC(a+r);if(!d[0])return!1;const p={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[p,{type:"text",value:d[1]}]:p}function NC(e,i,a,r){return!nv(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function DC(e){const i=e.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 RC(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let a=i[0],r=a.indexOf(")");const u=hx(e,"(");let c=hx(e,")");for(;r!==-1&&u>c;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),c++;return[e,a]}function nv(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||br(a)||rd(a))&&(!i||a!==47)}iv.peek=qC;function _C(){this.buffer()}function MC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function OC(){this.buffer()}function zC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function LC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Si(this.sliceSerialize(e)).toLowerCase(),a.label=i}function IC(e){this.exit(e)}function UC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Si(this.sliceSerialize(e)).toLowerCase(),a.label=i}function BC(e){this.exit(e)}function qC(){return"["}function iv(e,i,a,r){const u=a.createTracker(r);let c=u.move("[^");const d=a.enter("footnoteReference"),p=a.enter("reference");return c+=u.move(a.safe(a.associationId(e),{after:"]",before:c})),p(),d(),c+=u.move("]"),c}function HC(){return{enter:{gfmFootnoteCallString:_C,gfmFootnoteCall:MC,gfmFootnoteDefinitionLabelString:OC,gfmFootnoteDefinition:zC},exit:{gfmFootnoteCallString:LC,gfmFootnoteCall:IC,gfmFootnoteDefinitionLabelString:UC,gfmFootnoteDefinition:BC}}}function $C(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:iv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
|
|
63
|
+
`},u),c}function B1(e,i){return e&&"run"in e?async function(a,r){const u=rx(a,{file:r,...i});await e.run(u,r)}:function(a,r){return rx(a,{file:r,...e||i})}}function sx(e){if(e)throw e}var rp,ox;function q1(){if(ox)return rp;ox=1;var e=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=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!x)return!1;var S;for(S in m);return typeof S>"u"||e.call(m,S)},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},p=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return rp=function g(){var m,b,x,S,w,E,M=arguments[0],H=1,R=arguments.length,q=!1;for(typeof M=="boolean"&&(q=M,M=arguments[1]||{},H=2),(M==null||typeof M!="object"&&typeof M!="function")&&(M={});H<R;++H)if(m=arguments[H],m!=null)for(b in m)x=p(M,b),S=p(m,b),M!==S&&(q&&S&&(c(S)||(w=u(S)))?(w?(w=!1,E=x&&u(x)?x:[]):E=x&&c(x)?x:{},d(M,{name:b,newValue:g(q,E,S)})):typeof S<"u"&&d(M,{name:b,newValue:S}));return M},rp}var H1=q1();const sp=vb(H1);function Vp(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $1(){const e=[],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);p(null,...u);function p(g,...m){const b=e[++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?G1(b,p)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function G1(e,i){let a;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&a)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){a||(a=!0,i(d,...p))}function c(d){u(null,d)}}const Zi={basename:V1,dirname:F1,extname:Y1,join:P1,sep:"/"};function V1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');fu(e);let a=0,r=-1,u=e.length,c;if(i===void 0||i.length===0||i.length>e.length){for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":e.slice(a,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else d<0&&(c=!0,d=u+1),p>-1&&(e.codePointAt(u)===i.codePointAt(p--)?p<0&&(r=u):(p=-1,r=d));return a===r?r=d:r<0&&(r=e.length),e.slice(a,r)}function F1(e){if(fu(e),e.length===0)return".";let i=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){i=a;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function Y1(e){fu(e);let i=e.length,a=-1,r=0,u=-1,c=0,d;for(;i--;){const p=e.codePointAt(i);if(p===47){if(d){r=i+1;break}continue}a<0&&(d=!0,a=i+1),p===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?"":e.slice(u,a)}function P1(...e){let i=-1,a;for(;++i<e.length;)fu(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":W1(a)}function W1(e){fu(e);const i=e.codePointAt(0)===47;let a=K1(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function K1(e,i){let a="",r=0,u=-1,c=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===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+="/"+e.slice(u+1,d):a=e.slice(u+1,d),r=d-u-1;u=d,c=0}else p===46&&c>-1?c++:c=-1}return a}function fu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const X1={cwd:Q1};function Q1(){return"/"}function Fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Z1(e){if(typeof e=="string")e=new URL(e);else if(!Fp(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return J1(e)}function J1(e){if(e.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=e.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 op=["history","path","basename","stem","extname","dirname"];class tv{constructor(i){let a;i?Fp(i)?a={path:i}:typeof i=="string"||eC(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":X1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<op.length;){const c=op[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)op.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?Zi.basename(this.path):void 0}set basename(i){cp(i,"basename"),up(i,"basename"),this.path=Zi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Zi.dirname(this.path):void 0}set dirname(i){ux(this.basename,"dirname"),this.path=Zi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Zi.extname(this.path):void 0}set extname(i){if(up(i,"extname"),ux(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=Zi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Fp(i)&&(i=Z1(i)),cp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Zi.basename(this.path,this.extname):void 0}set stem(i){cp(i,"stem"),up(i,"stem"),this.path=Zi.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 hn(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 up(e,i){if(e&&e.includes(Zi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Zi.sep+"`")}function cp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function ux(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function eC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tC=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),nC={}.hasOwnProperty;class kh extends tC{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=$1()}copy(){const i=new kh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(sp(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(pp("data",this.frozen),this.namespace[i]=a,this):nC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(pp("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=zc(i),r=this.parser||this.Parser;return dp("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),dp("process",this.parser||this.Parser),fp("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const p=zc(i),g=r.parse(p);r.run(g,p,function(b,x,S){if(b||!x||!S)return m(b);const w=x,E=r.stringify(w,S);lC(E)?S.value=E:S.result=E,m(b,S)});function m(b,x){b||!x?d(b):c?c(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),dp("processSync",this.parser||this.Parser),fp("processSync",this.compiler||this.Compiler),this.process(i,u),dx("processSync","process",a),r;function u(c,d){a=!0,sx(c),r=d}}run(i,a,r){cx(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,p){const g=zc(a);u.run(i,g,m);function m(b,x,S){const w=x||i;b?p(b):d?d(w):r(void 0,w,S)}}}runSync(i,a){let r=!1,u;return this.run(i,a,c),dx("runSync","run",r),u;function c(d,p){sx(d),u=p,r=!0}}stringify(i,a){this.freeze();const r=zc(a),u=this.compiler||this.Compiler;return fp("stringify",u),cx(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(pp("use",this.frozen),i!=null)if(typeof i=="function")g(i,a);else if(typeof i=="object")Array.isArray(i)?p(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");p(m.plugins),m.settings&&(u.settings=sp(!0,u.settings,m.settings))}function p(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,S=-1;for(;++x<r.length;)if(r[x][0]===m){S=x;break}if(S===-1)r.push([m,...b]);else if(b.length>0){let[w,...E]=b;const M=r[S][1];Vp(M)&&Vp(w)&&(w=sp(!0,M,w)),r[S]=[m,w,...E]}}}}const iC=new kh().freeze();function dp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pp(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cx(e){if(!Vp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dx(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function zc(e){return aC(e)?e:new tv(e)}function aC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lC(e){return typeof e=="string"||rC(e)}function rC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",fx=[],px={allowDangerousHtml:!0},oC=/^(https?|ircs?|mailto|xmpp)$/i,uC=[{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 cC(e){const i=dC(e),a=fC(e);return pC(i.runSync(i.parse(a),a),e)}function dC(e){const i=e.rehypePlugins||fx,a=e.remarkPlugins||fx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...px}:px;return iC().use(V0).use(a).use(B1,r).use(i)}function fC(e){const i=e.children||"",a=new tv;return typeof i=="string"&&(a.value=i),a}function pC(e,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||hC;for(const b of uC)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+sC+b.id,void 0);return wh(e,m),ES(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,S){if(b.type==="raw"&&S&&typeof x=="number")return d?S.children.splice(x,1):S.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in ip)if(Object.hasOwn(ip,w)&&Object.hasOwn(b.properties,w)){const E=b.properties[w],M=ip[w];(M===null||M.includes(b.tagName))&&(b.properties[w]=g(String(E||""),w,b))}}if(b.type==="element"){let w=a?!a.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof x=="number"&&(w=!r(b,x,S)),w&&S&&typeof x=="number")return p&&b.children?S.children.splice(x,1,...b.children):S.children.splice(x,1),x}}}function hC(e){const i=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),u=e.indexOf("/");return i===-1||u!==-1&&i>u||a!==-1&&i>a||r!==-1&&i>r||oC.test(e.slice(0,i))?e:""}function hx(e,i){const a=String(e);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 mC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function gC(e,i,a){const u=od((a||{}).ignore||[]),c=yC(i);let d=-1;for(;++d<c.length;)ev(e,"text",p);function p(m,b){let x=-1,S;for(;++x<b.length;){const w=b[x],E=S?S.children:void 0;if(u(w,E?E.indexOf(w):void 0,S))return;S=w}if(S)return g(m,b)}function g(m,b){const x=b[b.length-1],S=c[d][0],w=c[d][1];let E=0;const H=x.children.indexOf(m);let R=!1,q=[];S.lastIndex=0;let $=S.exec(m.value);for(;$;){const V=$.index,ie={index:$.index,input:$.input,stack:[...b,m]};let N=w(...$,ie);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?S.lastIndex=V+1:(E!==V&&q.push({type:"text",value:m.value.slice(E,V)}),Array.isArray(N)?q.push(...N):N&&q.push(N),E=V+$[0].length,R=!0),!S.global)break;$=S.exec(m.value)}return R?(E<m.value.length&&q.push({type:"text",value:m.value.slice(E)}),x.children.splice(H,1,...q)):q=[m],H+q.length}}function yC(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const u=a[r];i.push([xC(u[0]),bC(u[1])])}return i}function xC(e){return typeof e=="string"?new RegExp(mC(e),"g"):e}function bC(e){return typeof e=="function"?e:function(){return e}}const hp="phrasing",mp=["autolink","link","image","label"];function vC(){return{transforms:[EC],enter:{literalAutolink:kC,literalAutolinkEmail:gp,literalAutolinkHttp:gp,literalAutolinkWww:gp},exit:{literalAutolink:TC,literalAutolinkEmail:CC,literalAutolinkHttp:SC,literalAutolinkWww:jC}}}function wC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:mp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:mp},{character:":",before:"[ps]",after:"\\/",inConstruct:hp,notInConstruct:mp}]}}function kC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gp(e){this.config.enter.autolinkProtocol.call(this,e)}function SC(e){this.config.exit.autolinkProtocol.call(this,e)}function jC(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function CC(e){this.config.exit.autolinkEmail.call(this,e)}function TC(e){this.exit(e)}function EC(e){gC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,AC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),NC]],{ignore:["link","linkReference"]})}function AC(e,i,a,r,u){let c="";if(!nv(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!DC(a)))return!1;const d=RC(a+r);if(!d[0])return!1;const p={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[p,{type:"text",value:d[1]}]:p}function NC(e,i,a,r){return!nv(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function DC(e){const i=e.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 RC(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let a=i[0],r=a.indexOf(")");const u=hx(e,"(");let c=hx(e,")");for(;r!==-1&&u>c;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),c++;return[e,a]}function nv(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||xr(a)||ld(a))&&(!i||a!==47)}iv.peek=qC;function _C(){this.buffer()}function MC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function OC(){this.buffer()}function zC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function LC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ci(this.sliceSerialize(e)).toLowerCase(),a.label=i}function IC(e){this.exit(e)}function UC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ci(this.sliceSerialize(e)).toLowerCase(),a.label=i}function BC(e){this.exit(e)}function qC(){return"["}function iv(e,i,a,r){const u=a.createTracker(r);let c=u.move("[^");const d=a.enter("footnoteReference"),p=a.enter("reference");return c+=u.move(a.safe(a.associationId(e),{after:"]",before:c})),p(),d(),c+=u.move("]"),c}function HC(){return{enter:{gfmFootnoteCallString:_C,gfmFootnoteCall:MC,gfmFootnoteDefinitionLabelString:OC,gfmFootnoteDefinition:zC},exit:{gfmFootnoteCallString:LC,gfmFootnoteCall:IC,gfmFootnoteDefinitionLabelString:UC,gfmFootnoteDefinition:BC}}}function $C(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:iv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
|
|
64
64
|
`:" ")+c.indentLines(c.containerFlow(r,p.current()),i?av:GC))),m(),g}}function GC(e,i,a){return i===0?e:av(e,i,a)}function av(e,i,a){return(a?"":" ")+e}const VC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];lv.peek=KC;function FC(){return{canContainEols:["delete"],enter:{strikethrough:PC},exit:{strikethrough:WC}}}function YC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VC}],handlers:{delete:lv}}}function PC(e){this.enter({type:"delete",children:[]},e)}function WC(e){this.exit(e)}function lv(e,i,a,r){const u=a.createTracker(r),c=a.enter("strikethrough");let d=u.move("~~");return d+=a.containerPhrasing(e,{...u.current(),before:d,after:"~"}),d+=u.move("~~"),c(),d}function KC(){return"~"}function XC(e){return e.length}function QC(e,i){const a=i||{},r=(a.align||[]).concat(),u=a.stringLength||XC,c=[],d=[],p=[],g=[];let m=0,b=-1;for(;++b<e.length;){const M=[],H=[];let R=-1;for(e[b].length>m&&(m=e[b].length);++R<e[b].length;){const q=ZC(e[b][R]);if(a.alignDelimiters!==!1){const $=u(q);H[R]=$,(g[R]===void 0||$>g[R])&&(g[R]=$)}M.push(q)}d[b]=M,p[b]=H}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=mx(r[x]);else{const M=mx(r);for(;++x<m;)c[x]=M}x=-1;const S=[],w=[];for(;++x<m;){const M=c[x];let H="",R="";M===99?(H=":",R=":"):M===108?H=":":M===114&&(R=":");let q=a.alignDelimiters===!1?1:Math.max(1,g[x]-H.length-R.length);const $=H+"-".repeat(q)+R;a.alignDelimiters!==!1&&(q=H.length+q+R.length,q>g[x]&&(g[x]=q),w[x]=q),S[x]=$}d.splice(1,0,S),p.splice(1,0,w),b=-1;const E=[];for(;++b<d.length;){const M=d[b],H=p[b];x=-1;const R=[];for(;++x<m;){const q=M[x]||"";let $="",V="";if(a.alignDelimiters!==!1){const ie=g[x]-(H[x]||0),N=c[x];N===114?$=" ".repeat(ie):N===99?ie%2?($=" ".repeat(ie/2+.5),V=" ".repeat(ie/2-.5)):($=" ".repeat(ie/2),V=$):V=" ".repeat(ie)}a.delimiterStart!==!1&&!x&&R.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&q==="")&&(a.delimiterStart!==!1||x)&&R.push(" "),a.alignDelimiters!==!1&&R.push($),R.push(q),a.alignDelimiters!==!1&&R.push(V),a.padding!==!1&&R.push(" "),(a.delimiterEnd!==!1||x!==m-1)&&R.push("|")}E.push(a.delimiterEnd===!1?R.join("").replace(/ +$/,""):R.join(""))}return E.join(`
|
|
65
65
|
`)}function ZC(e){return e==null?"":String(e)}function mx(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}function JC(e,i,a,r){const u=a.enter("blockquote"),c=a.createTracker(r);c.move("> "),c.shift(2);const d=a.indentLines(a.containerFlow(e,c.current()),eT);return u(),d}function eT(e,i,a){return">"+(a?"":" ")+e}function tT(e,i){return gx(e,i.inConstruct,!0)&&!gx(e,i.notInConstruct,!1)}function gx(e,i,a){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return a;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function yx(e,i,a,r){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
|
|
66
66
|
`&&tT(a.stack,a.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
@@ -68,64 +68,64 @@ Error generating stack: `+o.message+`
|
|
|
68
68
|
`,encode:["`"],...p.current()})),x()}return b+=p.move(`
|
|
69
69
|
`),c&&(b+=p.move(c+`
|
|
70
70
|
`)),b+=p.move(g),m(),b}function rT(e,i,a){return(a?"":" ")+e}function Sh(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function sT(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("definition");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("[");return m+=g.move(a.safe(a.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":`
|
|
71
|
-
`,...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function oT(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function uu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function
|
|
71
|
+
`,...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function oT(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function uu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ed(e,i,a){const r=Ds(e),u=Ds(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}}rv.peek=uT;function rv(e,i,a,r){const u=oT(a),c=a.enter("emphasis"),d=a.createTracker(r),p=d.move(u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=ed(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=uu(m)+g.slice(1));const x=g.charCodeAt(g.length-1),S=ed(r.after.charCodeAt(0),x,u);S.inside&&(g=g.slice(0,-1)+uu(x));const w=d.move(u);return c(),a.attentionEncodeSurroundingInfo={after:S.outside,before:b.outside},p+g+w}function uT(e,i,a){return a.options.emphasis||"*"}function cT(e,i){let a=!1;return wh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,$p}),!!((!e.depth||e.depth<3)&&hh(e)&&(i.options.setext||a))}function dT(e,i,a,r){const u=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(r);if(cT(e,a)){const b=a.enter("headingSetext"),x=a.enter("phrasing"),S=a.containerPhrasing(e,{...c.current(),before:`
|
|
72
72
|
`,after:`
|
|
73
73
|
`});return x(),b(),S+`
|
|
74
74
|
`+(u===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
|
|
75
75
|
`))+1))}const d="#".repeat(u),p=a.enter("headingAtx"),g=a.enter("phrasing");c.move(d+" ");let m=a.containerPhrasing(e,{before:"# ",after:`
|
|
76
|
-
`,...c.current()});return/^[\t ]/.test(m)&&(m=uu(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,a.options.closeAtx&&(m+=" "+d),g(),p(),m}sv.peek=fT;function sv(e){return e.value||""}function fT(){return"<"}ov.peek=pT;function ov(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("![");return m+=g.move(a.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function pT(){return"!"}uv.peek=hT;function uv(e,i,a,r){const u=e.referenceType,c=a.enter("imageReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("![");const m=a.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function hT(){return"!"}cv.peek=mT;function cv(e,i,a){let r=e.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],p=a.compilePattern(d);let g;if(d.atBreak)for(;g=p.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 mT(){return"`"}function dv(e,i){const a=hh(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}fv.peek=gT;function fv(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let p,g;if(dv(e,a)){const b=a.stack;a.stack=[],p=a.enter("autolink");let x=d.move("<");return x+=d.move(a.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),p(),a.stack=b,x}p=a.enter("link"),g=a.enter("label");let m=d.move("[");return m+=d.move(a.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=a.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(a.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=a.enter("destinationRaw"),m+=d.move(a.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=a.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(a.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function gT(e,i,a){return dv(e,a)?"<":"["}pv.peek=yT;function pv(e,i,a,r){const u=e.referenceType,c=a.enter("linkReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("[");const m=a.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function yT(){return"["}function jh(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function xT(e){const i=jh(e),a=e.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 bT(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function hv(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function vT(e,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?bT(a):jh(a);const p=e.ordered?d==="."?")":".":xT(a);let g=i&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.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),hv(a)===d&&b){let x=-1;for(;++x<e.children.length;){const S=e.children[x];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),a.bulletCurrent=d;const m=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),m}function wT(e){const i=e.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 kT(e,i,a,r){const u=wT(a);let c=a.bulletCurrent||jh(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(e))+c);let d=c.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=a.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,p.current()),b);return g(),m;function b(x,S,w){return S?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function ST(e,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,r);return c(),u(),d}const jT=
|
|
76
|
+
`,...c.current()});return/^[\t ]/.test(m)&&(m=uu(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,a.options.closeAtx&&(m+=" "+d),g(),p(),m}sv.peek=fT;function sv(e){return e.value||""}function fT(){return"<"}ov.peek=pT;function ov(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("![");return m+=g.move(a.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function pT(){return"!"}uv.peek=hT;function uv(e,i,a,r){const u=e.referenceType,c=a.enter("imageReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("![");const m=a.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function hT(){return"!"}cv.peek=mT;function cv(e,i,a){let r=e.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],p=a.compilePattern(d);let g;if(d.atBreak)for(;g=p.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 mT(){return"`"}function dv(e,i){const a=hh(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}fv.peek=gT;function fv(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let p,g;if(dv(e,a)){const b=a.stack;a.stack=[],p=a.enter("autolink");let x=d.move("<");return x+=d.move(a.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),p(),a.stack=b,x}p=a.enter("link"),g=a.enter("label");let m=d.move("[");return m+=d.move(a.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=a.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(a.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=a.enter("destinationRaw"),m+=d.move(a.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=a.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(a.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function gT(e,i,a){return dv(e,a)?"<":"["}pv.peek=yT;function pv(e,i,a,r){const u=e.referenceType,c=a.enter("linkReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("[");const m=a.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function yT(){return"["}function jh(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function xT(e){const i=jh(e),a=e.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 bT(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function hv(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function vT(e,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?bT(a):jh(a);const p=e.ordered?d==="."?")":".":xT(a);let g=i&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.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),hv(a)===d&&b){let x=-1;for(;++x<e.children.length;){const S=e.children[x];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),a.bulletCurrent=d;const m=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),m}function wT(e){const i=e.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 kT(e,i,a,r){const u=wT(a);let c=a.bulletCurrent||jh(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(e))+c);let d=c.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=a.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,p.current()),b);return g(),m;function b(x,S,w){return S?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function ST(e,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,r);return c(),u(),d}const jT=od(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function CT(e,i,a,r){return(e.children.some(function(d){return jT(d)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function TT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}mv.peek=ET;function mv(e,i,a,r){const u=TT(a),c=a.enter("strong"),d=a.createTracker(r),p=d.move(u+u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=ed(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=uu(m)+g.slice(1));const x=g.charCodeAt(g.length-1),S=ed(r.after.charCodeAt(0),x,u);S.inside&&(g=g.slice(0,-1)+uu(x));const w=d.move(u+u);return c(),a.attentionEncodeSurroundingInfo={after:S.outside,before:b.outside},p+g+w}function ET(e,i,a){return a.options.strong||"*"}function AT(e,i,a,r){return a.safe(e.value,r)}function NT(e){const i=e.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 DT(e,i,a){const r=(hv(a)+(a.options.ruleSpaces?" ":"")).repeat(NT(a));return a.options.ruleSpaces?r.slice(0,-1):r}const gv={blockquote:JC,break:yx,code:lT,definition:sT,emphasis:rv,hardBreak:yx,heading:dT,html:sv,image:ov,imageReference:uv,inlineCode:cv,link:fv,linkReference:pv,list:vT,listItem:kT,paragraph:ST,root:CT,strong:mv,text:AT,thematicBreak:DT};function RT(){return{enter:{table:_T,tableData:xx,tableHeader:xx,tableRow:OT},exit:{codeText:zT,table:MT,tableData:yp,tableHeader:yp,tableRow:yp}}}function _T(e){const i=e._align;this.enter({type:"table",align:i.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function MT(e){this.exit(e),this.data.inTable=void 0}function OT(e){this.enter({type:"tableRow",children:[]},e)}function yp(e){this.exit(e)}function xx(e){this.enter({type:"tableCell",children:[]},e)}function zT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,LT));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function LT(e,i){return i==="|"?i:e}function IT(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
77
77
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:d,tableCell:g,tableRow:p}};function d(w,E,M,H){return m(b(w,M,H),w.align)}function p(w,E,M,H){const R=x(w,M,H),q=m([R]);return q.slice(0,q.indexOf(`
|
|
78
|
-
`))}function g(w,E,M,H){const R=M.enter("tableCell"),q=M.enter("phrasing"),$=M.containerPhrasing(w,{...H,before:c,after:c});return q(),R(),$}function m(w,E){return QC(w,{align:E,alignDelimiters:r,padding:a,stringLength:u})}function b(w,E,M){const H=w.children;let R=-1;const q=[],$=E.enter("table");for(;++R<H.length;)q[R]=x(H[R],E,M);return $(),q}function x(w,E,M){const H=w.children;let R=-1;const q=[],$=E.enter("tableRow");for(;++R<H.length;)q[R]=g(H[R],w,E,M);return $(),q}function S(w,E,M){let H=gv.inlineCode(w,E,M);return M.stack.includes("tableCell")&&(H=H.replace(/\|/g,"\\$&")),H}}function UT(){return{exit:{taskListCheckValueChecked:bx,taskListCheckValueUnchecked:bx,paragraph:qT}}}function BT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:HT}}}function bx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function qT(e){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 p=u[c];if(p.type==="paragraph"){d=p;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(e)}function HT(e,i,a,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=a.createTracker(r);c&&p.move(d);let g=gv.listItem(e,i,a,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function $T(){return[vC(),HC(),FC(),RT(),UT()]}function GT(e){return{extensions:[wC(),$C(e),YC(),IT(e),BT()]}}const VT={tokenize:XT,partial:!0},yv={tokenize:QT,partial:!0},xv={tokenize:ZT,partial:!0},bv={tokenize:JT,partial:!0},FT={tokenize:eE,partial:!0},vv={name:"wwwAutolink",tokenize:WT,previous:kv},wv={name:"protocolAutolink",tokenize:KT,previous:Sv},za={name:"emailAutolink",tokenize:PT,previous:jv},ta={};function YT(){return{text:ta}}let pr=48;for(;pr<123;)ta[pr]=za,pr++,pr===58?pr=65:pr===91&&(pr=97);ta[43]=za;ta[45]=za;ta[46]=za;ta[95]=za;ta[72]=[za,wv];ta[104]=[za,wv];ta[87]=[za,vv];ta[119]=[za,vv];function PT(e,i,a){const r=this;let u,c;return d;function d(x){return!Yp(x)||!jv.call(r,r.previous)||Ch(r.events)?a(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return Yp(x)?(e.consume(x),p):x===64?(e.consume(x),g):a(x)}function g(x){return x===46?e.check(FT,b,m)(x):x===45||x===95||fn(x)?(c=!0,e.consume(x),g):b(x)}function m(x){return e.consume(x),u=!0,g}function b(x){return c&&u&&vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):a(x)}}function WT(e,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!kv.call(r,r.previous)||Ch(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VT,e.attempt(yv,e.attempt(xv,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function KT(e,i,a){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&Sv.call(r,r.previous)&&!Ch(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):a(x)}function p(x){if(vn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const S=u.toLowerCase();if(S==="http"||S==="https")return e.consume(x),g}return a(x)}function g(x){return x===47?(e.consume(x),c?m:(c=!0,g)):a(x)}function m(x){return x===null||Zc(x)||xt(x)||br(x)||rd(x)?a(x):e.attempt(yv,e.attempt(xv,b),a)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function XT(e,i,a){let r=0;return u;function u(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),u):d===46&&r===3?(e.consume(d),c):a(d)}function c(d){return d===null?a(d):i(d)}}function QT(e,i,a){let r,u,c;return d;function d(m){return m===46||m===95?e.check(bv,g,p)(m):m===null||xt(m)||br(m)||m!==45&&rd(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?a(m):i(m)}}function ZT(e,i){let a=0,r=0;return u;function u(d){return d===40?(a++,e.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?e.check(bv,i,c)(d):d===null||xt(d)||br(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function JT(e,i,a){return r;function r(p){return p===33||p===34||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===63||p===95||p===126?(e.consume(p),r):p===38?(e.consume(p),c):p===93?(e.consume(p),u):p===60||p===null||xt(p)||br(p)?i(p):a(p)}function u(p){return p===null||p===40||p===91||xt(p)||br(p)?i(p):r(p)}function c(p){return vn(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):vn(p)?(e.consume(p),d):a(p)}}function eE(e,i,a){return r;function r(c){return e.consume(c),u}function u(c){return fn(c)?a(c):i(c)}}function kv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xt(e)}function Sv(e){return!vn(e)}function jv(e){return!(e===47||Yp(e))}function Yp(e){return e===43||e===45||e===46||e===95||fn(e)}function Ch(e){let i=e.length,a=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const tE={tokenize:uE,partial:!0};function nE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rE,continuation:{tokenize:sE},exit:oE}},text:{91:{name:"gfmFootnoteCall",tokenize:lE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iE,resolveTo:aE}}}}function iE(e,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 p;function p(g){if(!d||!d._balanced)return a(g);const m=Si(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function aE(e,i){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[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({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},p=[e[a+1],e[a+2],["enter",r,i],e[a+3],e[a+4],["enter",u,i],["exit",u,i],["enter",c,i],["enter",d,i],["exit",d,i],["exit",c,i],e[e.length-2],e[e.length-1],["exit",r,i]];return e.splice(a,e.length-a+1,...p),e}function lE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?a(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(x){if(c>999||x===93&&!d||x===null||x===91||xt(x))return a(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteCallString");return u.includes(Si(r.sliceSerialize(S)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(x)}return xt(x)||(d=!0),c++,e.consume(x),x===92?b:m}function b(x){return x===91||x===92||x===93?(e.consume(x),c++,m):m(x)}}function rE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return g;function g(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):a(E)}function b(E){if(d>999||E===93&&!p||E===null||E===91||xt(E))return a(E);if(E===93){e.exit("chunkString");const M=e.exit("gfmFootnoteDefinitionLabelString");return c=Si(r.sliceSerialize(M)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),S}return xt(E)||(p=!0),d++,e.consume(E),E===92?x:b}function x(E){return E===91||E===92||E===93?(e.consume(E),d++,b):b(E)}function S(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),u.includes(c)||u.push(c),et(e,w,"gfmFootnoteDefinitionWhitespace")):a(E)}function w(E){return i(E)}}function sE(e,i,a){return e.check(du,i,e.attempt(tE,i,a))}function oE(e){e.exit("gfmFootnoteDefinition")}function uE(e,i,a){const r=this;return et(e,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 cE(e){let a=(e||{}).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,p){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)},S=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&Zn(S,S.length,0,sd(w,d.slice(m+1,g),p)),Zn(S,S.length,0,[["exit",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),Zn(d,m-1,g-m+3,S),g=m+S.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,p,g){const m=this.previous,b=this.events;let x=0;return S;function S(E){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(E):(d.enter("strikethroughSequenceTemporary"),w(E))}function w(E){const M=Es(m);if(E===126)return x>1?g(E):(d.consume(E),x++,w);if(x<2&&!a)return g(E);const H=d.exit("strikethroughSequenceTemporary"),R=Es(E);return H._open=!R||R===2&&!!M,H._close=!M||M===2&&!!R,p(E)}}}class dE{constructor(){this.map=[]}add(i,a,r){fE(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 fE(e,i,a,r){let u=0;if(!(a===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===i){e.map[u][1]+=a,e.map[u][2].push(...r);return}u+=1}e.map.push([i,a,r])}}function pE(e,i){let a=!1;const r=[];for(;i<e.length;){const u=e[i];if(a){if(u[0]==="enter")u[1].type==="tableContent"&&r.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(e[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 hE(){return{flow:{null:{name:"table",tokenize:mE,resolveAll:gE}}}}function mE(e,i,a){const r=this;let u=0,c=0,d;return p;function p(L){let te=r.events.length-1;for(;te>-1;){const ye=r.events[te][1].type;if(ye==="lineEnding"||ye==="linePrefix")te--;else break}const de=te>-1?r.events[te][1].type:null,Ne=de==="tableHead"||de==="tableRow"?N:g;return Ne===N&&r.parser.lazy[r.now().line]?a(L):Ne(L)}function g(L){return e.enter("tableHead"),e.enter("tableRow"),m(L)}function m(L){return L===124||(d=!0,c+=1),b(L)}function b(L){return L===null?a(L):Oe(L)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),w):a(L):Ke(L)?et(e,b,"whitespace")(L):(c+=1,d&&(d=!1,u+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(L)))}function x(L){return L===null||L===124||xt(L)?(e.exit("data"),b(L)):(e.consume(L),L===92?S:x)}function S(L){return L===92||L===124?(e.consume(L),x):x(L)}function w(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(L):(e.enter("tableDelimiterRow"),d=!1,Ke(L)?et(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):E(L))}function E(L){return L===45||L===58?H(L):L===124?(d=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),M):ie(L)}function M(L){return Ke(L)?et(e,H,"whitespace")(L):H(L)}function H(L){return L===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),R):L===45?(c+=1,R(L)):L===null||Oe(L)?V(L):ie(L)}function R(L){return L===45?(e.enter("tableDelimiterFiller"),q(L)):ie(L)}function q(L){return L===45?(e.consume(L),q):L===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),$):(e.exit("tableDelimiterFiller"),$(L))}function $(L){return Ke(L)?et(e,V,"whitespace")(L):V(L)}function V(L){return L===124?E(L):L===null||Oe(L)?!d||u!==c?ie(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(L)):ie(L)}function ie(L){return a(L)}function N(L){return e.enter("tableRow"),Q(L)}function Q(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),Q):L===null||Oe(L)?(e.exit("tableRow"),i(L)):Ke(L)?et(e,Q,"whitespace")(L):(e.enter("data"),re(L))}function re(L){return L===null||L===124||xt(L)?(e.exit("data"),Q(L)):(e.consume(L),L===92?ee:re)}function ee(L){return L===92||L===124?(e.consume(L),re):re(L)}}function gE(e,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,x;const S=new dE;for(;++a<e.length;){const w=e[a],E=w[1];w[0]==="enter"?E.type==="tableHead"?(p=!1,g!==0&&(vx(S,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},S.add(a,0,[["enter",m,i]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,a+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},S.add(a,0,[["enter",b,i]])),u=E.type==="tableDelimiterRow"?2:b?3:1):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=Ic(S,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=a)):E.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=Ic(S,i,c,u,void 0,x)),c=d,d=[c[1],a,0,0])):E.type==="tableHead"?(p=!0,g=a):E.type==="tableRow"||E.type==="tableDelimiterRow"?(g=a,c[1]!==0?(d[0]=d[1],x=Ic(S,i,c,u,a,x)):d[1]!==0&&(x=Ic(S,i,d,u,a,x)),u=0):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&vx(S,i,g,m,b),S.consume(i.events),a=-1;++a<i.events.length;){const w=i.events[a];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=pE(i.events,a))}return e}function Ic(e,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(c.end=Object.assign({},Ss(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const g=Ss(i.events,a[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(a[1],0,[["enter",c,i]]),a[2]!==0){const m=Ss(i.events,a[2]),b=Ss(i.events,a[3]),x={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",x,i]]),r!==2){const S=i.events[a[2]],w=i.events[a[3]];if(S[1].end=Object.assign({},w[1].end),S[1].type="chunkText",S[1].contentType="text",a[3]>a[2]+1){const E=a[2]+1,M=a[3]-a[2]-1;e.add(E,M,[])}}e.add(a[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},Ss(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function vx(e,i,a,r,u){const c=[],d=Ss(i.events,a);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),e.add(a+1,0,c)}function Ss(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const yE={name:"tasklistCheck",tokenize:bE};function xE(){return{text:{91:yE}}}function bE(e,i,a){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),c)}function c(g){return xt(g)?(e.enter("taskListCheckValueUnchecked"),e.consume(g),e.exit("taskListCheckValueUnchecked"),d):g===88||g===120?(e.enter("taskListCheckValueChecked"),e.consume(g),e.exit("taskListCheckValueChecked"),d):a(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):a(g)}function p(g){return Oe(g)?i(g):Ke(g)?e.check({tokenize:vE},i,a)(g):a(g)}}function vE(e,i,a){return et(e,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function wE(e){return zb([YT(),nE(),cE(e),hE(),xE()])}const kE={};function SE(e){const i=this,a=e||kE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(wE(a)),c.push($T()),d.push(GT(a))}function jE(e){const i=new Map;for(const a of e){if(!a.turnId)continue;if(a.event==="server.wakeup.started"){i.set(a.turnId,"wakeup");continue}if(a.event!=="server.turn")continue;const r=TE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function iu(e,i){return!!(i&&e.includes(i))}function CE(e){var a;if((e==null?void 0:e.status)!=="failed")return null;const i=(a=e.error)==null?void 0:a.trim();return i?{turnId:e.id,content:i,createdAt:e.finishedAt??e.startedAt}:null}function TE(e){return e&&typeof e=="object"?e:{}}const EE=["summary","message","status","instruction","description","reason","error","text"],wx=96,AE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),NE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),DE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),Cv=new Set(["item/commandExecution/terminalInteraction"]),RE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function _E(e){if(e.event!=="codex.notification")return!1;const i=ea(e.data);return typeof i.method=="string"&&Cv.has(i.method)}function ME(e){if(NE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||AE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=ea(e.data),a=typeof i.method=="string"?i.method:"",r=ea(i.params),u=ea(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||Cv.has(a)||a.endsWith("/delta")||a.endsWith("/outputDelta")||DE.has(c)?null:a}function Tv(e,i){const a=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===a?RE.get(a)??Ev(a):r}function vr(e,i=[]){const a=ea(e),u=[...i,...EE.map(c=>au(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=wx?u:`${u.slice(0,wx-3)}...`:"查看详情"}function Pp(e,i=new Map){const a=ea(e),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",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:vr({},[p])}}function OE(e){const i=ea(e),a=Array.isArray(i.offers)?i.offers.map(ea).filter(c=>Object.keys(c).length>0):[],r=a.map(c=>{var d;return(d=au(c.previewText))==null?void 0:d.trim()}).filter(c=>!!c),u=a.length;return{title:u===1?"New input available":`${u} new inputs available`,detail:vr({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function zE(e){const i=ea(e),a=au(i.actionType)??"",r=ea(i.payload);return a==="seele_wakeup"||a==="seele_workspace_schedule_wakeup"?{title:(au(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:vr(r,[au(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:vr(r,[Ev(a||"agent action")]),meta:"after turn"}}function Ev(e){const a=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function au(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function ea(e){return e&&typeof e=="object"?e:{}}function Wp(e){const i=Kp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Kp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=BE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=UE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function Av(e,i){const a=Sx(e),r=Sx(i??"").replace(/\/+$/,"");return r&&(a===r||a.startsWith(`${r}/`))?a.slice(r.length+1)||".":a}function LE(e,i){if(e.length===0)return"File changed";const a=Av(e[0].path,i);return e.length===1?a:`${a} +${e.length-1}`}function IE(e){return e.reduce((i,a)=>({additions:i.additions+a.additions,deletions:i.deletions+a.deletions}),{additions:0,deletions:0})}function UE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:kx(e),deletions:0};if(i==="delete")return{additions:0,deletions:kx(e)};let a=0,r=0;for(const u of e.split(`
|
|
78
|
+
`))}function g(w,E,M,H){const R=M.enter("tableCell"),q=M.enter("phrasing"),$=M.containerPhrasing(w,{...H,before:c,after:c});return q(),R(),$}function m(w,E){return QC(w,{align:E,alignDelimiters:r,padding:a,stringLength:u})}function b(w,E,M){const H=w.children;let R=-1;const q=[],$=E.enter("table");for(;++R<H.length;)q[R]=x(H[R],E,M);return $(),q}function x(w,E,M){const H=w.children;let R=-1;const q=[],$=E.enter("tableRow");for(;++R<H.length;)q[R]=g(H[R],w,E,M);return $(),q}function S(w,E,M){let H=gv.inlineCode(w,E,M);return M.stack.includes("tableCell")&&(H=H.replace(/\|/g,"\\$&")),H}}function UT(){return{exit:{taskListCheckValueChecked:bx,taskListCheckValueUnchecked:bx,paragraph:qT}}}function BT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:HT}}}function bx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function qT(e){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 p=u[c];if(p.type==="paragraph"){d=p;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(e)}function HT(e,i,a,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=a.createTracker(r);c&&p.move(d);let g=gv.listItem(e,i,a,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function $T(){return[vC(),HC(),FC(),RT(),UT()]}function GT(e){return{extensions:[wC(),$C(e),YC(),IT(e),BT()]}}const VT={tokenize:XT,partial:!0},yv={tokenize:QT,partial:!0},xv={tokenize:ZT,partial:!0},bv={tokenize:JT,partial:!0},FT={tokenize:eE,partial:!0},vv={name:"wwwAutolink",tokenize:WT,previous:kv},wv={name:"protocolAutolink",tokenize:KT,previous:Sv},za={name:"emailAutolink",tokenize:PT,previous:jv},ta={};function YT(){return{text:ta}}let fr=48;for(;fr<123;)ta[fr]=za,fr++,fr===58?fr=65:fr===91&&(fr=97);ta[43]=za;ta[45]=za;ta[46]=za;ta[95]=za;ta[72]=[za,wv];ta[104]=[za,wv];ta[87]=[za,vv];ta[119]=[za,vv];function PT(e,i,a){const r=this;let u,c;return d;function d(x){return!Yp(x)||!jv.call(r,r.previous)||Ch(r.events)?a(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return Yp(x)?(e.consume(x),p):x===64?(e.consume(x),g):a(x)}function g(x){return x===46?e.check(FT,b,m)(x):x===45||x===95||pn(x)?(c=!0,e.consume(x),g):b(x)}function m(x){return e.consume(x),u=!0,g}function b(x){return c&&u&&vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):a(x)}}function WT(e,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!kv.call(r,r.previous)||Ch(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VT,e.attempt(yv,e.attempt(xv,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function KT(e,i,a){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&Sv.call(r,r.previous)&&!Ch(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):a(x)}function p(x){if(vn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const S=u.toLowerCase();if(S==="http"||S==="https")return e.consume(x),g}return a(x)}function g(x){return x===47?(e.consume(x),c?m:(c=!0,g)):a(x)}function m(x){return x===null||Qc(x)||xt(x)||xr(x)||ld(x)?a(x):e.attempt(yv,e.attempt(xv,b),a)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function XT(e,i,a){let r=0;return u;function u(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),u):d===46&&r===3?(e.consume(d),c):a(d)}function c(d){return d===null?a(d):i(d)}}function QT(e,i,a){let r,u,c;return d;function d(m){return m===46||m===95?e.check(bv,g,p)(m):m===null||xt(m)||xr(m)||m!==45&&ld(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?a(m):i(m)}}function ZT(e,i){let a=0,r=0;return u;function u(d){return d===40?(a++,e.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?e.check(bv,i,c)(d):d===null||xt(d)||xr(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function JT(e,i,a){return r;function r(p){return p===33||p===34||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===63||p===95||p===126?(e.consume(p),r):p===38?(e.consume(p),c):p===93?(e.consume(p),u):p===60||p===null||xt(p)||xr(p)?i(p):a(p)}function u(p){return p===null||p===40||p===91||xt(p)||xr(p)?i(p):r(p)}function c(p){return vn(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):vn(p)?(e.consume(p),d):a(p)}}function eE(e,i,a){return r;function r(c){return e.consume(c),u}function u(c){return pn(c)?a(c):i(c)}}function kv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xt(e)}function Sv(e){return!vn(e)}function jv(e){return!(e===47||Yp(e))}function Yp(e){return e===43||e===45||e===46||e===95||pn(e)}function Ch(e){let i=e.length,a=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const tE={tokenize:uE,partial:!0};function nE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rE,continuation:{tokenize:sE},exit:oE}},text:{91:{name:"gfmFootnoteCall",tokenize:lE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iE,resolveTo:aE}}}}function iE(e,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 p;function p(g){if(!d||!d._balanced)return a(g);const m=Ci(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function aE(e,i){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[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({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},p=[e[a+1],e[a+2],["enter",r,i],e[a+3],e[a+4],["enter",u,i],["exit",u,i],["enter",c,i],["enter",d,i],["exit",d,i],["exit",c,i],e[e.length-2],e[e.length-1],["exit",r,i]];return e.splice(a,e.length-a+1,...p),e}function lE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?a(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(x){if(c>999||x===93&&!d||x===null||x===91||xt(x))return a(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteCallString");return u.includes(Ci(r.sliceSerialize(S)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(x)}return xt(x)||(d=!0),c++,e.consume(x),x===92?b:m}function b(x){return x===91||x===92||x===93?(e.consume(x),c++,m):m(x)}}function rE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return g;function g(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):a(E)}function b(E){if(d>999||E===93&&!p||E===null||E===91||xt(E))return a(E);if(E===93){e.exit("chunkString");const M=e.exit("gfmFootnoteDefinitionLabelString");return c=Ci(r.sliceSerialize(M)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),S}return xt(E)||(p=!0),d++,e.consume(E),E===92?x:b}function x(E){return E===91||E===92||E===93?(e.consume(E),d++,b):b(E)}function S(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),u.includes(c)||u.push(c),nt(e,w,"gfmFootnoteDefinitionWhitespace")):a(E)}function w(E){return i(E)}}function sE(e,i,a){return e.check(du,i,e.attempt(tE,i,a))}function oE(e){e.exit("gfmFootnoteDefinition")}function uE(e,i,a){const r=this;return nt(e,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 cE(e){let a=(e||{}).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,p){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)},S=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&Xn(S,S.length,0,rd(w,d.slice(m+1,g),p)),Xn(S,S.length,0,[["exit",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),Xn(d,m-1,g-m+3,S),g=m+S.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,p,g){const m=this.previous,b=this.events;let x=0;return S;function S(E){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(E):(d.enter("strikethroughSequenceTemporary"),w(E))}function w(E){const M=Ds(m);if(E===126)return x>1?g(E):(d.consume(E),x++,w);if(x<2&&!a)return g(E);const H=d.exit("strikethroughSequenceTemporary"),R=Ds(E);return H._open=!R||R===2&&!!M,H._close=!M||M===2&&!!R,p(E)}}}class dE{constructor(){this.map=[]}add(i,a,r){fE(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 fE(e,i,a,r){let u=0;if(!(a===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===i){e.map[u][1]+=a,e.map[u][2].push(...r);return}u+=1}e.map.push([i,a,r])}}function pE(e,i){let a=!1;const r=[];for(;i<e.length;){const u=e[i];if(a){if(u[0]==="enter")u[1].type==="tableContent"&&r.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(e[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 hE(){return{flow:{null:{name:"table",tokenize:mE,resolveAll:gE}}}}function mE(e,i,a){const r=this;let u=0,c=0,d;return p;function p(L){let te=r.events.length-1;for(;te>-1;){const ye=r.events[te][1].type;if(ye==="lineEnding"||ye==="linePrefix")te--;else break}const de=te>-1?r.events[te][1].type:null,Ne=de==="tableHead"||de==="tableRow"?N:g;return Ne===N&&r.parser.lazy[r.now().line]?a(L):Ne(L)}function g(L){return e.enter("tableHead"),e.enter("tableRow"),m(L)}function m(L){return L===124||(d=!0,c+=1),b(L)}function b(L){return L===null?a(L):Oe(L)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),w):a(L):Xe(L)?nt(e,b,"whitespace")(L):(c+=1,d&&(d=!1,u+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(L)))}function x(L){return L===null||L===124||xt(L)?(e.exit("data"),b(L)):(e.consume(L),L===92?S:x)}function S(L){return L===92||L===124?(e.consume(L),x):x(L)}function w(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(L):(e.enter("tableDelimiterRow"),d=!1,Xe(L)?nt(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):E(L))}function E(L){return L===45||L===58?H(L):L===124?(d=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),M):ie(L)}function M(L){return Xe(L)?nt(e,H,"whitespace")(L):H(L)}function H(L){return L===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),R):L===45?(c+=1,R(L)):L===null||Oe(L)?V(L):ie(L)}function R(L){return L===45?(e.enter("tableDelimiterFiller"),q(L)):ie(L)}function q(L){return L===45?(e.consume(L),q):L===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),$):(e.exit("tableDelimiterFiller"),$(L))}function $(L){return Xe(L)?nt(e,V,"whitespace")(L):V(L)}function V(L){return L===124?E(L):L===null||Oe(L)?!d||u!==c?ie(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(L)):ie(L)}function ie(L){return a(L)}function N(L){return e.enter("tableRow"),Q(L)}function Q(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),Q):L===null||Oe(L)?(e.exit("tableRow"),i(L)):Xe(L)?nt(e,Q,"whitespace")(L):(e.enter("data"),re(L))}function re(L){return L===null||L===124||xt(L)?(e.exit("data"),Q(L)):(e.consume(L),L===92?ee:re)}function ee(L){return L===92||L===124?(e.consume(L),re):re(L)}}function gE(e,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,x;const S=new dE;for(;++a<e.length;){const w=e[a],E=w[1];w[0]==="enter"?E.type==="tableHead"?(p=!1,g!==0&&(vx(S,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},S.add(a,0,[["enter",m,i]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,a+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},S.add(a,0,[["enter",b,i]])),u=E.type==="tableDelimiterRow"?2:b?3:1):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=Lc(S,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=a)):E.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=Lc(S,i,c,u,void 0,x)),c=d,d=[c[1],a,0,0])):E.type==="tableHead"?(p=!0,g=a):E.type==="tableRow"||E.type==="tableDelimiterRow"?(g=a,c[1]!==0?(d[0]=d[1],x=Lc(S,i,c,u,a,x)):d[1]!==0&&(x=Lc(S,i,d,u,a,x)),u=0):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&vx(S,i,g,m,b),S.consume(i.events),a=-1;++a<i.events.length;){const w=i.events[a];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=pE(i.events,a))}return e}function Lc(e,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(c.end=Object.assign({},Ts(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const g=Ts(i.events,a[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(a[1],0,[["enter",c,i]]),a[2]!==0){const m=Ts(i.events,a[2]),b=Ts(i.events,a[3]),x={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",x,i]]),r!==2){const S=i.events[a[2]],w=i.events[a[3]];if(S[1].end=Object.assign({},w[1].end),S[1].type="chunkText",S[1].contentType="text",a[3]>a[2]+1){const E=a[2]+1,M=a[3]-a[2]-1;e.add(E,M,[])}}e.add(a[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},Ts(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function vx(e,i,a,r,u){const c=[],d=Ts(i.events,a);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),e.add(a+1,0,c)}function Ts(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const yE={name:"tasklistCheck",tokenize:bE};function xE(){return{text:{91:yE}}}function bE(e,i,a){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),c)}function c(g){return xt(g)?(e.enter("taskListCheckValueUnchecked"),e.consume(g),e.exit("taskListCheckValueUnchecked"),d):g===88||g===120?(e.enter("taskListCheckValueChecked"),e.consume(g),e.exit("taskListCheckValueChecked"),d):a(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):a(g)}function p(g){return Oe(g)?i(g):Xe(g)?e.check({tokenize:vE},i,a)(g):a(g)}}function vE(e,i,a){return nt(e,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function wE(e){return zb([YT(),nE(),cE(e),hE(),xE()])}const kE={};function SE(e){const i=this,a=e||kE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(wE(a)),c.push($T()),d.push(GT(a))}function jE(e){const i=new Map;for(const a of e){if(!a.turnId)continue;if(a.event==="server.wakeup.started"){i.set(a.turnId,"wakeup");continue}if(a.event!=="server.turn")continue;const r=TE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function iu(e,i){return!!(i&&e.includes(i))}function CE(e){var a;if((e==null?void 0:e.status)!=="failed")return null;const i=(a=e.error)==null?void 0:a.trim();return i?{turnId:e.id,content:i,createdAt:e.finishedAt??e.startedAt}:null}function TE(e){return e&&typeof e=="object"?e:{}}const EE=["summary","message","status","instruction","description","reason","error","text"],wx=96,AE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),NE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),DE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),Cv=new Set(["item/commandExecution/terminalInteraction"]),RE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function _E(e){if(e.event!=="codex.notification")return!1;const i=ea(e.data);return typeof i.method=="string"&&Cv.has(i.method)}function ME(e){if(NE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||AE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=ea(e.data),a=typeof i.method=="string"?i.method:"",r=ea(i.params),u=ea(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||Cv.has(a)||a.endsWith("/delta")||a.endsWith("/outputDelta")||DE.has(c)?null:a}function Tv(e,i){const a=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===a?RE.get(a)??Ev(a):r}function br(e,i=[]){const a=ea(e),u=[...i,...EE.map(c=>au(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=wx?u:`${u.slice(0,wx-3)}...`:"查看详情"}function Pp(e,i=new Map){const a=ea(e),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",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:br({},[p])}}function OE(e){const i=ea(e),a=Array.isArray(i.offers)?i.offers.map(ea).filter(c=>Object.keys(c).length>0):[],r=a.map(c=>{var d;return(d=au(c.previewText))==null?void 0:d.trim()}).filter(c=>!!c),u=a.length;return{title:u===1?"New input available":`${u} new inputs available`,detail:br({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function zE(e){const i=ea(e),a=au(i.actionType)??"",r=ea(i.payload);return a==="seele_wakeup"||a==="seele_workspace_schedule_wakeup"?{title:(au(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:br(r,[au(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:br(r,[Ev(a||"agent action")]),meta:"after turn"}}function Ev(e){const a=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function au(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function ea(e){return e&&typeof e=="object"?e:{}}function Wp(e){const i=Kp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Kp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=BE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=UE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function Av(e,i){const a=Sx(e),r=Sx(i??"").replace(/\/+$/,"");return r&&(a===r||a.startsWith(`${r}/`))?a.slice(r.length+1)||".":a}function LE(e,i){if(e.length===0)return"File changed";const a=Av(e[0].path,i);return e.length===1?a:`${a} +${e.length-1}`}function IE(e){return e.reduce((i,a)=>({additions:i.additions+a.additions,deletions:i.deletions+a.deletions}),{additions:0,deletions:0})}function UE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:kx(e),deletions:0};if(i==="delete")return{additions:0,deletions:kx(e)};let a=0,r=0;for(const u of e.split(`
|
|
79
79
|
`))u.startsWith("+")&&!u.startsWith("+++")?a+=1:u.startsWith("-")&&!u.startsWith("---")&&(r+=1);return{additions:a,deletions:r}}function kx(e){const i=e.split(`
|
|
80
80
|
`).length;return e.endsWith(`
|
|
81
|
-
`)?Math.max(0,i-1):i}function BE(e){const i=Kp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function Sx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Kp(e){return e&&typeof e=="object"?e:{}}const Th=["low","medium","high","xhigh"],qE=["none","minimal",...Th,"max"];function
|
|
82
|
-
`);return new Ji(r,u,e.status,a)}function Ge(e){return e instanceof Ji?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function hr(e){const i=Ge(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function Te(e,i){if(!e.ok)throw await dn(e,i)}function hA(e){return e instanceof Ji&&e.status===410&&e.body.includes('"turn_not_active"')}function mA(e){return e instanceof Ji&&e.status===409&&e.body.includes('"turn_not_running"')}function gA(e){return e instanceof Ji&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Ox(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function yA(e){if(e.status!==409)return null;try{const i=await e.json();if(i.error==="turn_already_running"&&typeof i.turnId=="string")return i.turnId}catch{return null}return null}function Ah(e){return Math.max(aA,Math.min(lA,Math.round(e)))}function xA(){try{const e=window.localStorage.getItem(Iv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?Ah(i):Rx}catch{return Rx}}function bA(e){try{window.localStorage.setItem(Iv,String(Ah(e)))}catch{}}function xp(e){Uv(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function vA(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function wA(e){if(!e)return;const i=window.getComputedStyle(e),a=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=a*rA+r+u,d=a*sA+r+u;e.style.height="auto";const p=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${p}px`,e.style.overflowY=e.scrollHeight>d?"auto":"hidden"}function kA(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(oA,Math.max(1,i+1))}function SA(e){return Math.ceil(kA(e)*uA*cA+dA)}function Uv(e,i){const a=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=a}function jA(e){const i=e.getBoundingClientRect(),a=i.bottom-32,r=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),u=[...r].reverse().find(d=>{const p=d.getBoundingClientRect();return p.top<=a&&p.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 CA(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function zx(e,i){Uv(e,()=>{const a=CA(e,i.anchorTurnId);if(a&&i.anchorOffset!==null){const u=e.getBoundingClientRect().bottom-32,d=a.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(e.scrollTop+=d);return}e.scrollTop=Math.max(0,e.scrollHeight-i.previousScrollHeight)})}function TA(e,i){let a=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||zx(e,i)});zx(e,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 EA(){try{return window.localStorage.getItem(Jp)}catch{return null}}function bp(e){try{e?window.localStorage.setItem(Jp,e):window.localStorage.removeItem(Jp)}catch{}}function Bv(){try{const e=window.localStorage.getItem(Mv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function qv(){try{const e=window.localStorage.getItem(Ov),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function Hv(e){try{window.localStorage.setItem(Ov,JSON.stringify(e))}catch{}}function Pc(e){try{window.localStorage.setItem(Mv,JSON.stringify(e))}catch{}}function $v(){try{const e=window.localStorage.getItem(zv),i=e?JSON.parse(e):{};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 AA(e){return e?$v()[e]??"":""}function vp(e,i){if(e)try{const a=$v();i?a[e]=i:delete a[e],window.localStorage.setItem(zv,JSON.stringify(a))}catch{}}function NA(){try{const e=window.localStorage.getItem(Lv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(a=>typeof a=="string"):[])}catch{return new Set}}function wp(e){try{window.localStorage.setItem(Lv,JSON.stringify(Array.from(e)))}catch{}}function Yo(e){const i=Bv();if(i.length===0)return e;const a=new Map(i.map((r,u)=>[r,u]));return[...e].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 Uc(e){const i=qv();if(i.length===0)return e;const a=new Map(i.map((r,u)=>[r,u]));return[...e].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 kp(e){const i=new Set(e.map(u=>u.id)),a=Bv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));Pc([...a,...r])}function Sp(e){const i=new Set(e.map(u=>u.id)),a=qv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));Hv([...a,...r])}function DA(e,i){const a=e.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function RA(e,i,a,r){if(i===a)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===a);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===a),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function _A(e,i,a){if(i===a)return e;const r=e.findIndex(g=>g.id===i),u=e.findIndex(g=>g.id===a);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(g=>g.id===a);return c.splice(p+1,0,d),c}function MA({authEnabled:e,currentUser:i,onLogout:a}){var sr,or,co,fo;const[r,u]=D.useState(""),[c,d]=D.useState(new Set),[p,g]=D.useState([]),[m,b]=D.useState([]),[x,S]=D.useState(null),[w,E]=D.useState(null),[M,H]=D.useState("simple"),[R,q]=D.useState(null),[$,V]=D.useState(null),[ie,N]=D.useState(null),[Q,re]=D.useState(!1),[ee,L]=D.useState(!1),[te,de]=D.useState({}),[Ne,ye]=D.useState({}),[ue,F]=D.useState(null),[oe,ve]=D.useState([]),[_e,O]=D.useState(null),[A,z]=D.useState(!1),[C,W]=D.useState(null),[fe,X]=D.useState("checking"),[xe,Me]=D.useState(null),[Ve,Ct]=D.useState(!1),[vt,rn]=D.useState(null),[Fe,St]=D.useState(!1),[Ut,sn]=D.useState(null),[Le,Bt]=D.useState(!1),[hn,Xt]=D.useState([]),[ji,Jn]=D.useState([]),[La,Mt]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[Ia,ae]=D.useState({profuseNotificationEnabled:!0,publicUrl:null}),[ce,Ee]=D.useState([]),[Ue,Xe]=D.useState(null),[Ft,ei]=D.useState(null),[Yt,Et]=D.useState(!1),[dt,ot]=D.useState(null),[Ci,wn]=D.useState(!1),[hd,Cr]=D.useState(null),[Tr,Dl]=D.useState(!1),[Ti,Ua]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[Jt,Ba]=D.useState("global"),[wt,na]=D.useState(null),[qa,Rl]=D.useState(null),[Rs,Ha]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[pu,Er]=D.useState({memory:"",items:[]}),[_s,Ms]=D.useState({memory:"",items:[]}),[hu,ti]=D.useState({memory:"",items:[]}),[Pt,qt]=D.useState([]),[Un,Ei]=D.useState(Fo),[$a,Ga]=D.useState({description:"",key:"",value:""}),[Ar,Ai]=D.useState(null),[Os,ni]=D.useState(()=>new Set),[Ni,ia]=D.useState(!1),[Di,At]=D.useState(!1),[mu,zs]=D.useState(!1),[on,Ri]=D.useState(null),[gu,yu]=D.useState(!0),[xu,Nr]=D.useState(!1),[_l,aa]=D.useState(!1),[pi,mn]=D.useState(!1),[hi,la]=D.useState(null),[Ls,mi]=D.useState(null),[_i,bu]=D.useState(null),[Nt,Bn]=D.useState(null),[Mi,Dr]=D.useState(null),[ii,Is]=D.useState(null),[Ml,Va]=D.useState(()=>new Set),[Rr,Fa]=D.useState(null),[_r,Ol]=D.useState(null),[vu,Mr]=D.useState(null),[gn,Qt]=D.useState(null),[zl,ra]=D.useState(null),[Oi,zi]=D.useState(()=>NA()),[wu,Ll]=D.useState(()=>xA()),[Us,Il]=D.useState(230),[en,Bs]=D.useState(()=>Date.now()),[Ul,Li]=D.useState(0),Or=D.useRef(null),sa=D.useRef(null),qs=D.useRef(null),Ya=D.useRef(null),gi=D.useRef(null),Bl=D.useRef(!0),tn=D.useRef(null),qn=D.useRef(null),Pa=D.useRef(null),oa=D.useRef(new Set),Hs=D.useRef(!1),zr=D.useRef([]),ql=D.useRef(null),Wa=D.useRef(null),Ii=D.useRef(new Map),Ka=D.useRef(new Map),Lr=D.useRef(new Set),Ir=D.useRef(new Map),Hl=D.useRef(new Map),Ui=D.useRef(new Map),Xa=D.useRef(new Set),Bi=D.useRef(null),kn=D.useRef(new Map),Sn=D.useRef(new Map),Qa=D.useRef(new Map),Za=D.useRef(new Set),Ur=D.useRef(null),Br=D.useRef(null),$s=D.useRef(!1),Gs=D.useRef(!1),De=p.find(y=>y.id===x),ku=(De==null?void 0:De.unreadTurnCount)??0,ai=p.find(y=>y.id===on),Ot=p.find(y=>y.id===wt),qr=p.find(y=>y.id===Rr),$l=D.useMemo(()=>{const k=Uc(m.length>0?m:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(U=>({id:U.id,title:U.title,conversations:[]})),j=new Map(k.map(U=>[U.id,U])),_=k[0];for(const U of p)(j.get(U.groupId)??_).conversations.push(U);return k.filter(U=>U.conversations.length>0||U.id!=="default")},[p,m]),lt=x!==null?te[x]:null,Ja=(lt==null?void 0:lt.messages)??[],Hr=(lt==null?void 0:lt.events)??[],Gl=XD(KD(Hr),x?Ne[x]:null),Vl=ww(Gl),Vs=(lt==null?void 0:lt.status)??(De==null?void 0:De.status)??"idle",ua=rh(De,Vs),md=on!==null?((sr=te[on])==null?void 0:sr.status)??(ai==null?void 0:ai.status)??"idle":"idle",Fs=rh(ai,md),yi=x?Sn.current.get(x)??null:null,Su=D.useMemo(()=>new Map(p.map(y=>[y.id,y.title])),[p]),$r=D.useMemo(()=>EN(Ja,Hr,(lt==null?void 0:lt.turns)??[],(lt==null?void 0:lt.timelineNodes)??[],yi,Su),[yi,lt==null?void 0:lt.timelineNodes,lt==null?void 0:lt.turns,Hr,Ja,Su]),Gr=D.useMemo(()=>new Set(Ja.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[Ja]),Fl=x!==null&&Ml.has(x),ju=x!==null&&c.has(x),Ys=GE(r,ju),qi=yi?(or=$r.find(y=>iu(y.turnIds,yi)))==null?void 0:or.activity:null,Vr=ua==="running"||ua==="initializing"||Fl?qi&&!LD(qi)?qi:{title:ua==="initializing"?"Initializing clone":"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,gd=!Vr&&ua==="waiting"&&(De!=null&&De.nextWakeup)?{title:"Scheduled wakeup",detail:ld(De.nextWakeup,en),createdAt:De.nextWakeup.wakeAt,tone:"waiting"}:null,Yl=Vr??gd,Cu=D.useMemo(()=>WD(Object.values(te)),[te]),Tu=db(C,Cu);D.useEffect(()=>{Eu(),xd()},[]),D.useEffect(()=>()=>{gi.current!==null&&window.clearTimeout(gi.current)},[]),D.useEffect(()=>{Wr(!1),Wr(!0);const y=window.setInterval(()=>{Wr(!0)},300*1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{const y=window.setInterval(()=>Bs(Date.now()),1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{Za.current=Ml},[Ml]),D.useEffect(()=>{ql.current=x},[x]),D.useLayoutEffect(()=>{const y=Wa.current;if(Wa.current=x,!x||y===x)return;const k=window.requestAnimationFrame(()=>{const j=Ya.current;j&&!j.disabled&&!document.querySelector('[aria-modal="true"]')&&j.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(k)},[x]),D.useEffect(()=>{zr.current=p},[p]),D.useEffect(()=>{x&&bp(x)},[x]),D.useLayoutEffect(()=>{if(!x||ku<=0)return;let y=!1;const k=async()=>{if(document.visibilityState==="visible"){g(_=>_.map(U=>U.id===x?{...U,unreadTurnCount:0}:U));try{await O2(x)}catch(_){y||console.error(_)}}},j=()=>void k();return k(),document.addEventListener("visibilitychange",j),()=>{y=!0,document.removeEventListener("visibilitychange",j)}},[x,ku]),D.useEffect(()=>{H("simple"),E(null),x&&(Cn(x),ga(x))},[x]),D.useEffect(()=>{const y=window.setInterval(()=>void yd(),iA);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{u(AA(x))},[x]),D.useEffect(()=>{if(!x)return;const y=PE({workspaceRunning:Vs==="running",streamLeaseActive:Fl,controllerActive:kn.current.has(x),currentTurnAbsent:Lr.current.has(x),retryAt:Hl.current.get(x)??null,now:Date.now()});y.kind==="probe"&&ns(x,{waitMs:y.waitMs})},[x,Fl,Ul,Vs]),D.useEffect(()=>()=>{for(const y of Ui.current.values())window.clearTimeout(y);Ui.current.clear()},[]),D.useEffect(()=>{if(!x)return;let y=!1;return rD(x).then(k=>{y||ye(j=>({...j,[x]:k}))}).catch(k=>console.error(k)),()=>{y=!0}},[x]),D.useEffect(()=>{!x&&Jt==="workspace"&&Ba("global")},[x,Jt]),D.useEffect(()=>{var y;if(Le){if(!wt&&x){na(x);return}wt&&!p.some(k=>k.id===wt)&&na(x??((y=p[0])==null?void 0:y.id)??null)}},[x,p,Le,wt]),D.useEffect(()=>{if(!Le||i.role!=="admin")return;const y=window.setInterval(()=>void Zl(),5e3);return()=>window.clearInterval(y)},[i.role,Le]),D.useEffect(()=>{!Le||Jt!=="workspace"||ti({memory:(Ot==null?void 0:Ot.memory)??"",items:(Ot==null?void 0:Ot.memoryItems)??[]})},[Jt,Le,Ot==null?void 0:Ot.id,Ot==null?void 0:Ot.memory,Ot==null?void 0:Ot.memoryItems]),D.useEffect(()=>{if(!Ni)return;x&&pa(x);const y=k=>{k.key==="Escape"&&ia(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Ni]),D.useEffect(()=>{if(!Le)return;const y=k=>{k.key==="Escape"&&Bt(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Le]),D.useEffect(()=>{var k;if(!Di)return;if(on&&!p.some(j=>j.id===on)){Ri(x??((k=p[0])==null?void 0:k.id)??null);return}const y=j=>{j.key==="Escape"&&(hi?la(null):At(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Di,hi,on,p]),D.useEffect(()=>{if(!Nt)return;Dr(null);const y=k=>{k.key==="Escape"&&Bn(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Nt]),D.useLayoutEffect(()=>{wA(Ya.current)},[r]),D.useLayoutEffect(()=>{const y=qs.current;if(!y)return;const k=()=>{const _=y.getBoundingClientRect();Il(Math.ceil(_.height+44))};k();const j=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return j==null||j.observe(y),window.addEventListener("resize",k),()=>{j==null||j.disconnect(),window.removeEventListener("resize",k)}},[]),D.useLayoutEffect(()=>{var Z,pe;const y=sa.current;if(!y)return;const k=tn.current!==x;tn.current=x,k&&((Z=Bi.current)==null||Z.call(Bi),Bi.current=null);const j=qn.current;if(j&&j.conversationId===x){(pe=Bi.current)==null||pe.call(Bi),Bi.current=TA(y,j),qn.current=null,Bl.current=!1;return}if(!k&&!Bl.current)return;Bl.current=!0,xp(y);const _=requestAnimationFrame(()=>xp(y)),U=window.setTimeout(()=>xp(y),120);return()=>{cancelAnimationFrame(_),window.clearTimeout(U)}},[x,Hr.length,Ja.length]);async function Pl(){var k;const y=sa.current;y&&(Bl.current=vA(y),!(!x||!((k=lt==null?void 0:lt.history)!=null&&k.hasMoreBefore))&&(lt.loadingOlder||oa.current.has(x)||y.scrollTop>96||await es(x)))}function ca(y){var j,_;if(y.history)return y.history;const k=((j=y.timelineNodes)==null?void 0:j.filter(U=>U.parentId===null).reduce((U,Z)=>U===null||Z.timelineAt<U.timelineAt||Z.timelineAt===U.timelineAt&&Z.sequence<U.sequence?Z:U,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((_=y.messages[0])==null?void 0:_.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 da(y){const k=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(k),Dr(y.url)}async function Hi(y,k){await navigator.clipboard.writeText(k),Is(y),gi.current!==null&&window.clearTimeout(gi.current),gi.current=window.setTimeout(()=>{Is(null),gi.current=null},1800)}function ke(y,k,j){const _=Date.now();bu({id:_,tone:y,text:k,detail:j}),window.setTimeout(()=>{bu(U=>(U==null?void 0:U.id)===_?null:U)},j?8e3:2400)}function Wl(y){const k=Ui.current.get(y);k!==void 0&&(window.clearTimeout(k),Ui.current.delete(y))}function fa(y){Lr.current.delete(y),Ir.current.delete(y),Hl.current.delete(y),Xa.current.delete(y),Wl(y)}function Fr(y){Lr.current.add(y),Ir.current.delete(y),Hl.current.delete(y),Xa.current.delete(y),Wl(y)}function Yr(y){Lr.current.add(y),Xa.current.delete(y);const k=(Ir.current.get(y)??0)+1;Ir.current.set(y,k);const j=WE(k);Hl.current.set(y,Date.now()+j),Wl(y);const _=window.setTimeout(()=>{Ui.current.delete(y),Li(U=>U+1)},j);Ui.current.set(y,_)}function Pr(y,k){k!=="running"&&fa(y)}async function Eu(){try{const[y,k]=await Promise.all([tb(),ib()]);X("connected");const j=Uc(k);if(b(j),Sp(j),y.length>0){const _=Yo(y),U=EA(),Z=_.find(pe=>pe.id===U)??_[0];g(_),kp(_),S(Z.id);return}g([]),bp(null),S(null)}catch(y){console.error(y),X("error")}}async function nn(){const[y,k]=await Promise.all([tb(),ib()]);for(const U of y)Pr(U.id,U.status);const j=Yo(y),_=Uc(k);b(_),Sp(_),g(j),kp(j)}async function yd(){if(!Hs.current){Hs.current=!0;try{const y=await D2(),k=zr.current,j=new Set(k.map(be=>be.id)),_=new Set(y.map(be=>be.id));if(j.size!==_.size||[...j].some(be=>!_.has(be))){await nn(),X("connected");return}const U=ql.current;for(const be of y)Pr(be.id,be.status);const Z=new Map(y.map(be=>[be.id,be])),pe=U?Z.get(U)??null:null,Se=Yo(k.map(be=>{const we=Z.get(be.id);return we?{...be,status:we.status,statusError:we.statusError,nextWakeup:we.nextWakeup,unreadTurnCount:we.unreadTurnCount,updatedAt:we.updatedAt}:be}));g(Se),kp(Se),X("connected"),pe&&!Za.current.has(pe.id)&&rt(pe.id,be=>({...be,status:pe.status}))}catch(y){console.error(y),X("error")}finally{Hs.current=!1}}}async function xd(){try{const y=await TD();X("connected"),F(y.version)}catch(y){console.error(y),X("error")}}async function Wr(y){try{const k=await ED(y);k&&W(j=>db(j,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function bd(){try{const y=await U2();Xt(y),X("connected")}catch(y){console.error(y),X("error")}}async function un(y){try{const k=await B2(y);Jn(k),X("connected")}catch(k){console.error(k),Jn([]),X("error")}}async function pa(y){try{const k=await q2(y);qt(k),X("connected")}catch(k){console.error(k),qt([]),X("error")}}async function Au(y){try{const k=await H2();Mt(k),Ua(k),y||(Rl(null),Ha(k)),X("connected")}catch(k){console.error(k),X("error")}}async function Nu(){if(i.role==="admin")try{ae(await $2()),X("connected")}catch(y){console.error(y),X("error")}}async function Kl(y=!0){try{const k=await Q2(y);Ee(k.models),X("connected"),k.refreshing&&window.setTimeout(()=>void Kl(!1),1e3)}catch(k){console.error(k),Ee([]),X("error")}}async function Kr(){try{const y=await V2();Xe(y.codexVersion),ei(y.codexReleasedAt),X("connected")}catch(y){console.error(y),Xe(null),ei(null),X("error")}}async function Xl(y=!1){y&&Dl(!0);try{const k=await Z2(y);ot(k.job),Cr(k.latest),X("connected"),k.job&&k.job.status!=="running"&&Pa.current===k.job.id&&(Pa.current=null,k.job.status==="succeeded"?(await Promise.all([Kl(),Kr()]),ke("success",`Codex CLI updated to ${pd(k.job.currentVersion)}`)):ke("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),X("error")}finally{y&&Dl(!1)}}async function vd(){wn(!0);try{const y=await J2();Pa.current=y.id,ot(y),X("connected")}catch(y){console.error(y);const k=Ge(y);ke("error","Unable to start Codex CLI update",k.detail??k.message)}finally{wn(!1)}}D.useEffect(()=>{if(!Yt||(dt==null?void 0:dt.status)!=="running")return;const y=window.setInterval(()=>void Xl(),1e3);return()=>window.clearInterval(y)},[Yt,dt==null?void 0:dt.id,dt==null?void 0:dt.status]);async function $i(y){try{const k=await eD(y);Rl(k),Ha(k.effective),X("connected")}catch(k){console.error(k),Rl(null),X("error")}}async function Ps(){try{const y=await tD();Er(y),Ms(y),X("connected")}catch(y){console.error(y),X("error")}}async function Ql(){if(i.role!=="admin"){ve([]);return}try{ve(await kR()),X("connected")}catch(y){console.error(y),X("error")}}async function Zl(){if(i.role!=="admin"){O(null);return}z(!0);try{O(await G2()),X("connected")}catch(y){console.error(y),X("error")}finally{z(!1)}}async function Ws(y=wt){const k=[bd(),Au(y),Kr(),Kl(),Ps()];i.role==="admin"&&(k.push(Ql()),k.push(Zl()),k.push(Nu())),y&&(k.push(Cn(y)),k.push($i(y)),k.push(un(y)),k.push(pa(y))),await Promise.all(k)}function ha(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;L(!1),na(y),Ba(i.role==="admin"?"global":y?"workspace":"global"),Bt(!0),Ws(y)}function el(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;na(y),Ba(y?"workspace":"global"),Bt(!0),Ws(y)}function Xr(){var k;L(!1);const y=x??((k=p[0])==null?void 0:k.id)??null;Ri(y),mi(null),la(null),At(!0),y&&Du(y)}async function Du(y){try{const k=await sw(y);if(!k||k.status!=="running")return;Nr(!0);const j=await ow(y,k);mi(j),await Cn(y),await nn(),j.warmupTurnId&&va(y,j.warmupTurnId),ke("success","Full-history runtime reset completed")}catch(k){const j=Ge(k);ke("error","Full-history runtime reset failed",j.message)}finally{Nr(!1)}}function ma(y){na(y),Ba("workspace"),Cn(y),$i(y),un(y),pa(y),Ei(Fo)}async function Ru(y){y.preventDefault();try{if(Jt==="workspace"&&wt){const k=(Ot==null?void 0:Ot.status)==="running",j=await rb(wt,uD(Rs,La,qa));Rl(j.settings),Ha(j.settings.effective),Fn(j.conversation),ke("success","Workspace settings saved",k?"The current turn keeps its existing settings. Changes apply from the next turn.":void 0)}else{const k=await nD(Ti);Mt(k),Ua(k),wt&&await $i(wt),ke("success","Global settings saved")}X("connected")}catch(k){console.error(k),X("error");const j=Ge(k);ke("error","Failed to save runtime settings",j.detail??j.message)}}async function _u(y){try{const k=await iD(y);ae(k),X("connected"),ke("success","Deployment settings saved")}catch(k){console.error(k),X("error");const j=Ge(k);throw ke("error","Failed to save deployment settings",j.detail??j.message),k}}async function Mu(){var j;const y=ai;if(!y){ke("error","No workspace selected");return}const k=((j=te[y.id])==null?void 0:j.status)??y.status;if(k==="running"||k==="initializing"){ke("error","Stop the running turn before resetting runtime");return}mn(!0),mi(null);try{const _=await ob(y.id);la(_),X("connected")}catch(_){console.error(_),X("error");const U=Ge(_);ke("error","Failed to preview runtime reset",U.detail??U.message)}finally{mn(!1)}}async function wd(y){const k=ai,j=hi;if(!k||!j||j.conversationId!==k.id){ke("error","Reset preview is required");return}aa(!0),mi(null);try{const _=await sb(k.id,{warmup:gu,previewFingerprint:j.fingerprint,selectedEntryIds:y});mi(_),la(null),X("connected"),await Cn(k.id),await nn(),_.warmupTurnId&&va(k.id,_.warmupTurnId),ke("success","Runtime thread reset")}catch(_){console.error(_),X("error");const U=Ge(_);ke("error","Failed to reset runtime thread",U.detail??U.message)}finally{aa(!1)}}async function kd(){var _;const y=ai;if(!y){ke("error","No workspace selected");return}const k=((_=te[y.id])==null?void 0:_.status)??y.status;if(k==="running"||k==="initializing"){ke("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${y.title}" from a blank context?
|
|
81
|
+
`)?Math.max(0,i-1):i}function BE(e){const i=Kp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function Sx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Kp(e){return e&&typeof e=="object"?e:{}}const Th=["low","medium","high","xhigh"],qE=["none","minimal",...Th,"max"];function As(e){const i=e.trim();return i?{minimal:"Minimal",none:"None",low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Max",ultra:"Ultra"}[i]??i:"Use model default"}function jx(e,i){const a=vr(e),r=vr(i==null?void 0:i.defaultReasoningEffort);return a?a===r?`${As(a)} (model default)`:As(a):r?`Auto (model default: ${As(r)})`:"Auto (follow model default)"}function HE(e,i=""){const a=vr(e==null?void 0:e.defaultReasoningEffort),r=[];if(!e){r.push({value:"",label:"Use model default"});const p=vr(i);return p&&Dv(p)&&r.push({value:p,label:`${As(p)} (configured)`}),r}const c=(Nv(e)??Th).filter(p=>!Xp(p));a&&!Xp(a)&&!c.includes(a)&&c.unshift(a),a&&c.includes(a)||r.push({value:"",label:"Use model default"});for(const p of c)r.push({value:p===a?"":p,label:p===a?`${As(p)} (model default)`:As(p)});return r}function Cx(e,i){const a=vr(e);if(!a||Xp(a))return"";const r=vr(i==null?void 0:i.defaultReasoningEffort);if(r&&a===r)return"";if(!i)return Dv(a)?a:"";const u=Nv(i);return u!==null?u.includes(a)?a:"":Th.includes(a)?a:""}function $E(e,i,a){return a||e!==i?e:null}function Nv(e){if(!Array.isArray(e==null?void 0:e.supportedReasoningEfforts))return null;const i=[];for(const a of e.supportedReasoningEfforts){const r=vr(a==null?void 0:a.reasoningEffort);r&&!i.includes(r)&&i.push(r)}return i}function vr(e){return typeof e=="string"?e.trim():""}function Xp(e){return e.toLowerCase()==="ultra"}function Dv(e){return qE.includes(e)}function GE(e,i){return{textareaDisabled:!1,sendDisabled:i||!e.trim()}}function VE(e,i){return e.hasConversation?e.messageSubmitting?"blocked":e.hasActiveTurn||e.hasConfirmedCurrentTurn?i&&!e.complexTaskActive?"queue-turn":"steer-turn":"start-turn":"create-workspace"}function FE(e){return e.key!=="Enter"||!e.metaKey&&!e.ctrlKey||e.isComposing?null:{forceNewTurn:e.shiftKey}}function Tx(e,i){return e.conversationId===i.conversationId&&e.version===i.version}function YE(e,i,a){return e===401&&!a&&i==="authentication_required"?"reauthenticate":"ignore"}const Ex=15e3,Ax=[1e3,2e3,5e3,1e4,15e3];function PE(e){return!e.workspaceRunning||e.streamLeaseActive||e.controllerActive?{kind:"none"}:e.currentTurnAbsent?e.retryAt!==null&&e.now>=e.retryAt?{kind:"probe",waitMs:Ex}:{kind:"none"}:{kind:"probe",waitMs:Ex}}function WE(e){const i=Math.min(Math.max(1,Math.floor(e))-1,Ax.length-1);return Ax[i]}function KE(e){const i=Nx(e),a=Nx(i.conversation),r=i.workspaceStatus??i.status??a.status;return r==="idle"||r==="error"||r==="done"||r==="initialization_failed"?r:"done"}function Nx(e){return e&&typeof e=="object"?e:{}}function XE(e,i,a){return a?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}function QE(e,i){return i??e}function ZE(e,i){return e==="saved"||i==="accept"?"saved":"declined"}const JE=/^[a-z][a-z\d+.-]*:/i,eA=/^L([1-9]\d*)(?:C([1-9]\d*))?$/i;function tA(e,i){const a=e.trim();if(!a||a.startsWith("#")||a.startsWith("?")||a.startsWith("/api/")||JE.test(a))return null;const r=a.indexOf("#"),u=r>=0?a.slice(0,r):a,c=r>=0?a.slice(r+1):"",d=u.indexOf("?"),p=d>=0?u.slice(0,d):u,g=nA(p);if(!g)return null;const m=c.match(eA);return{path:Rv(g,i),...m?{line:Number(m[1])}:{},...m!=null&&m[2]?{column:Number(m[2])}:{}}}function Rv(e,i){const a=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/").replace(/\/+$/,"");return a===r||!a.startsWith(`${r}/`)?a:a.slice(r.length+1)}function nA(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}const Qp="seele:authentication-required",Zp="seele:deployment-status-required",_v=12,iA=3e3,Jp="seele.activeWorkspaceId",Mv="seele.workspaceOrder",Ov="seele.workspaceGroupOrder",zv="seele.workspaceDrafts",Lv="seele.collapsedWorkspaceGroups",Iv="seele.sidebarWidth",Dx=5,Rx=275,aA=236,lA=420,_x="default",Mx=300,rA=3,sA=10,oA=2,uA=13,cA=1.65,dA=20,fA=900;class Ji extends Error{constructor(a,r,u,c){super(a);_c(this,"detail");_c(this,"status");_c(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const pA=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Fo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function Eh(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function ge(e){return`${Eh()}api/${e.replace(/^\/+/,"")}`}async function fn(e,i){const a=await e.text().catch(()=>""),r=`Request failed with ${e.status}`,u=[`${i.method??"GET"} ${i.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),a?`Response: ${a}`:"Response: <empty>"].join(`
|
|
82
|
+
`);return new Ji(r,u,e.status,a)}function Ge(e){return e instanceof Ji?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function pr(e){const i=Ge(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function Te(e,i){if(!e.ok)throw await fn(e,i)}function hA(e){return e instanceof Ji&&e.status===410&&e.body.includes('"turn_not_active"')}function mA(e){return e instanceof Ji&&e.status===409&&e.body.includes('"turn_not_running"')}function gA(e){return e instanceof Ji&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Ox(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function yA(e){if(e.status!==409)return null;try{const i=await e.json();if(i.error==="turn_already_running"&&typeof i.turnId=="string")return i.turnId}catch{return null}return null}function Ah(e){return Math.max(aA,Math.min(lA,Math.round(e)))}function xA(){try{const e=window.localStorage.getItem(Iv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?Ah(i):Rx}catch{return Rx}}function bA(e){try{window.localStorage.setItem(Iv,String(Ah(e)))}catch{}}function xp(e){Uv(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function vA(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function wA(e){if(!e)return;const i=window.getComputedStyle(e),a=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=a*rA+r+u,d=a*sA+r+u;e.style.height="auto";const p=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${p}px`,e.style.overflowY=e.scrollHeight>d?"auto":"hidden"}function kA(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(oA,Math.max(1,i+1))}function SA(e){return Math.ceil(kA(e)*uA*cA+dA)}function Uv(e,i){const a=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=a}function jA(e){const i=e.getBoundingClientRect(),a=i.bottom-32,r=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),u=[...r].reverse().find(d=>{const p=d.getBoundingClientRect();return p.top<=a&&p.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 CA(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function zx(e,i){Uv(e,()=>{const a=CA(e,i.anchorTurnId);if(a&&i.anchorOffset!==null){const u=e.getBoundingClientRect().bottom-32,d=a.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(e.scrollTop+=d);return}e.scrollTop=Math.max(0,e.scrollHeight-i.previousScrollHeight)})}function TA(e,i){let a=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||zx(e,i)});zx(e,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 EA(){try{return window.localStorage.getItem(Jp)}catch{return null}}function bp(e){try{e?window.localStorage.setItem(Jp,e):window.localStorage.removeItem(Jp)}catch{}}function Bv(){try{const e=window.localStorage.getItem(Mv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function qv(){try{const e=window.localStorage.getItem(Ov),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function Hv(e){try{window.localStorage.setItem(Ov,JSON.stringify(e))}catch{}}function Yc(e){try{window.localStorage.setItem(Mv,JSON.stringify(e))}catch{}}function $v(){try{const e=window.localStorage.getItem(zv),i=e?JSON.parse(e):{};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 AA(e){return e?$v()[e]??"":""}function vp(e,i){if(e)try{const a=$v();i?a[e]=i:delete a[e],window.localStorage.setItem(zv,JSON.stringify(a))}catch{}}function NA(){try{const e=window.localStorage.getItem(Lv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(a=>typeof a=="string"):[])}catch{return new Set}}function wp(e){try{window.localStorage.setItem(Lv,JSON.stringify(Array.from(e)))}catch{}}function Yo(e){const i=Bv();if(i.length===0)return e;const a=new Map(i.map((r,u)=>[r,u]));return[...e].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 Ic(e){const i=qv();if(i.length===0)return e;const a=new Map(i.map((r,u)=>[r,u]));return[...e].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 kp(e){const i=new Set(e.map(u=>u.id)),a=Bv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));Yc([...a,...r])}function Sp(e){const i=new Set(e.map(u=>u.id)),a=qv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));Hv([...a,...r])}function DA(e,i){const a=e.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function RA(e,i,a,r){if(i===a)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===a);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===a),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function _A(e,i,a){if(i===a)return e;const r=e.findIndex(g=>g.id===i),u=e.findIndex(g=>g.id===a);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(g=>g.id===a);return c.splice(p+1,0,d),c}function MA({authEnabled:e,currentUser:i,onLogout:a}){var rr,co,fo,Ki;const[r,u]=D.useState(""),[c,d]=D.useState(new Set),[p,g]=D.useState([]),[m,b]=D.useState([]),[x,S]=D.useState(null),[w,E]=D.useState(null),[M,H]=D.useState("simple"),[R,q]=D.useState(null),[$,V]=D.useState(null),[ie,N]=D.useState(null),[Q,re]=D.useState(!1),[ee,L]=D.useState(!1),[te,de]=D.useState({}),[Ne,ye]=D.useState({}),[ue,F]=D.useState(null),[oe,be]=D.useState([]),[_e,O]=D.useState(null),[A,z]=D.useState(!1),[C,W]=D.useState(null),[fe,X]=D.useState("checking"),[xe,Me]=D.useState(null),[Ve,Ct]=D.useState(!1),[vt,rn]=D.useState(null),[Ye,St]=D.useState(!1),[It,sn]=D.useState(null),[Le,Ut]=D.useState(!1),[mn,Xt]=D.useState([]),[Ti,Qn]=D.useState([]),[La,_t]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[Ia,ae]=D.useState({profuseNotificationEnabled:!0,publicUrl:null}),[ce,Ee]=D.useState([]),[Ue,Qe]=D.useState(null),[Vt,Zn]=D.useState(null),[Ft,Et]=D.useState(!1),[ct,st]=D.useState(null),[Ei,wn]=D.useState(!1),[pd,jr]=D.useState(null),[Cr,Rl]=D.useState(!1),[Ai,Ua]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[Jt,Ba]=D.useState("global"),[wt,na]=D.useState(null),[qa,_l]=D.useState(null),[Os,Ha]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[pu,Tr]=D.useState({memory:"",items:[]}),[zs,Ls]=D.useState({memory:"",items:[]}),[hu,Jn]=D.useState({memory:"",items:[]}),[Yt,Bt]=D.useState([]),[Bn,Ni]=D.useState(Fo),[$a,Ga]=D.useState({description:"",key:"",value:""}),[Er,Di]=D.useState(null),[Is,ei]=D.useState(()=>new Set),[Ri,ia]=D.useState(!1),[_i,At]=D.useState(!1),[mu,Us]=D.useState(!1),[on,Mi]=D.useState(null),[gu,yu]=D.useState(!0),[xu,Ar]=D.useState(!1),[Ml,aa]=D.useState(!1),[fi,gn]=D.useState(!1),[pi,la]=D.useState(null),[Bs,hi]=D.useState(null),[Oi,bu]=D.useState(null),[Nt,qn]=D.useState(null),[zi,Nr]=D.useState(null),[ti,qs]=D.useState(null),[Ol,Va]=D.useState(()=>new Set),[Dr,Fa]=D.useState(null),[Rr,zl]=D.useState(null),[vu,_r]=D.useState(null),[yn,Qt]=D.useState(null),[Ll,ra]=D.useState(null),[Li,Ii]=D.useState(()=>NA()),[wu,Il]=D.useState(()=>xA()),[Hs,Ul]=D.useState(230),[en,$s]=D.useState(()=>Date.now()),[Bl,Ui]=D.useState(0),Mr=D.useRef(null),sa=D.useRef(null),Gs=D.useRef(null),Ya=D.useRef(null),mi=D.useRef(null),ql=D.useRef(!0),tn=D.useRef(null),Hn=D.useRef(null),Pa=D.useRef(null),oa=D.useRef(new Set),Vs=D.useRef(!1),Or=D.useRef([]),Wa=D.useRef(null),Ka=D.useRef(null),Bi=D.useRef(new Map),Xa=D.useRef(new Map),zr=D.useRef(new Set),Lr=D.useRef(new Map),Hl=D.useRef(new Map),qi=D.useRef(new Map),Qa=D.useRef(new Set),Hi=D.useRef(null),kn=D.useRef(new Map),Sn=D.useRef(new Map),Za=D.useRef(new Map),Ja=D.useRef(new Set),Ir=D.useRef(null),Ur=D.useRef(null),Fs=D.useRef(!1),Ys=D.useRef(!1),De=p.find(y=>y.id===x),ku=(De==null?void 0:De.unreadTurnCount)??0,ni=p.find(y=>y.id===on),Mt=p.find(y=>y.id===wt),Br=p.find(y=>y.id===Dr),$l=D.useMemo(()=>{const k=Ic(m.length>0?m:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(U=>({id:U.id,title:U.title,conversations:[]})),j=new Map(k.map(U=>[U.id,U])),_=k[0];for(const U of p)(j.get(U.groupId)??_).conversations.push(U);return k.filter(U=>U.conversations.length>0||U.id!=="default")},[p,m]),lt=x!==null?te[x]:null,el=(lt==null?void 0:lt.messages)??[],qr=(lt==null?void 0:lt.events)??[],Gl=XD(KD(qr),x?Ne[x]:null),Vl=ww(Gl),Ps=(lt==null?void 0:lt.status)??(De==null?void 0:De.status)??"idle",ua=rh(De,Ps),hd=on!==null?((rr=te[on])==null?void 0:rr.status)??(ni==null?void 0:ni.status)??"idle":"idle",Ws=rh(ni,hd),gi=x?Sn.current.get(x)??null:null,Su=D.useMemo(()=>new Map(p.map(y=>[y.id,y.title])),[p]),Hr=D.useMemo(()=>EN(el,qr,(lt==null?void 0:lt.turns)??[],(lt==null?void 0:lt.timelineNodes)??[],gi,Su),[gi,lt==null?void 0:lt.timelineNodes,lt==null?void 0:lt.turns,qr,el,Su]),$r=D.useMemo(()=>new Set(el.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[el]),Fl=x!==null&&Ol.has(x),ju=x!==null&&c.has(x),Ks=GE(r,ju),$i=gi?(co=Hr.find(y=>iu(y.turnIds,gi)))==null?void 0:co.activity:null,Gr=ua==="running"||ua==="initializing"||Fl?$i&&!LD($i)?$i:{title:ua==="initializing"?"Initializing clone":"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,md=!Gr&&ua==="waiting"&&(De!=null&&De.nextWakeup)?{title:"Scheduled wakeup",detail:ad(De.nextWakeup,en),createdAt:De.nextWakeup.wakeAt,tone:"waiting"}:null,Yl=Gr??md,Cu=D.useMemo(()=>WD(Object.values(te)),[te]),Tu=db(C,Cu);D.useEffect(()=>{Eu(),yd()},[]),D.useEffect(()=>()=>{mi.current!==null&&window.clearTimeout(mi.current)},[]),D.useEffect(()=>{Pr(!1),Pr(!0);const y=window.setInterval(()=>{Pr(!0)},300*1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{const y=window.setInterval(()=>$s(Date.now()),1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{Ja.current=Ol},[Ol]),D.useEffect(()=>{Wa.current=x},[x]),D.useLayoutEffect(()=>{const y=Ka.current;if(Ka.current=x,!x||y===x)return;const k=window.requestAnimationFrame(()=>{const j=Ya.current;j&&!j.disabled&&!document.querySelector('[aria-modal="true"]')&&j.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(k)},[x]),D.useEffect(()=>{Or.current=p},[p]),D.useEffect(()=>{x&&bp(x)},[x]),D.useLayoutEffect(()=>{if(!x||ku<=0)return;let y=!1;const k=async()=>{if(document.visibilityState==="visible"){g(_=>_.map(U=>U.id===x?{...U,unreadTurnCount:0}:U));try{await O2(x)}catch(_){y||console.error(_)}}},j=()=>void k();return k(),document.addEventListener("visibilitychange",j),()=>{y=!0,document.removeEventListener("visibilitychange",j)}},[x,ku]),D.useEffect(()=>{H("simple"),E(null),x&&(Cn(x),ga(x))},[x]),D.useEffect(()=>{const y=window.setInterval(()=>void gd(),iA);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{u(AA(x))},[x]),D.useEffect(()=>{if(!x)return;const y=PE({workspaceRunning:Ps==="running",streamLeaseActive:Fl,controllerActive:kn.current.has(x),currentTurnAbsent:zr.current.has(x),retryAt:Hl.current.get(x)??null,now:Date.now()});y.kind==="probe"&&is(x,{waitMs:y.waitMs})},[x,Fl,Bl,Ps]),D.useEffect(()=>()=>{for(const y of qi.current.values())window.clearTimeout(y);qi.current.clear()},[]),D.useEffect(()=>{if(!x)return;let y=!1;return rD(x).then(k=>{y||ye(j=>({...j,[x]:k}))}).catch(k=>console.error(k)),()=>{y=!0}},[x]),D.useEffect(()=>{!x&&Jt==="workspace"&&Ba("global")},[x,Jt]),D.useEffect(()=>{var y;if(Le){if(!wt&&x){na(x);return}wt&&!p.some(k=>k.id===wt)&&na(x??((y=p[0])==null?void 0:y.id)??null)}},[x,p,Le,wt]),D.useEffect(()=>{if(!Le||i.role!=="admin")return;const y=window.setInterval(()=>void Zl(),5e3);return()=>window.clearInterval(y)},[i.role,Le]),D.useEffect(()=>{!Le||Jt!=="workspace"||Jn({memory:(Mt==null?void 0:Mt.memory)??"",items:(Mt==null?void 0:Mt.memoryItems)??[]})},[Jt,Le,Mt==null?void 0:Mt.id,Mt==null?void 0:Mt.memory,Mt==null?void 0:Mt.memoryItems]),D.useEffect(()=>{if(!Ri)return;x&&pa(x);const y=k=>{k.key==="Escape"&&ia(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Ri]),D.useEffect(()=>{if(!Le)return;const y=k=>{k.key==="Escape"&&Ut(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Le]),D.useEffect(()=>{var k;if(!_i)return;if(on&&!p.some(j=>j.id===on)){Mi(x??((k=p[0])==null?void 0:k.id)??null);return}const y=j=>{j.key==="Escape"&&(pi?la(null):At(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,_i,pi,on,p]),D.useEffect(()=>{if(!Nt)return;Nr(null);const y=k=>{k.key==="Escape"&&qn(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Nt]),D.useLayoutEffect(()=>{wA(Ya.current)},[r]),D.useLayoutEffect(()=>{const y=Gs.current;if(!y)return;const k=()=>{const _=y.getBoundingClientRect();Ul(Math.ceil(_.height+44))};k();const j=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return j==null||j.observe(y),window.addEventListener("resize",k),()=>{j==null||j.disconnect(),window.removeEventListener("resize",k)}},[]),D.useLayoutEffect(()=>{var Z,pe;const y=sa.current;if(!y)return;const k=tn.current!==x;tn.current=x,k&&((Z=Hi.current)==null||Z.call(Hi),Hi.current=null);const j=Hn.current;if(j&&j.conversationId===x){(pe=Hi.current)==null||pe.call(Hi),Hi.current=TA(y,j),Hn.current=null,ql.current=!1;return}if(!k&&!ql.current)return;ql.current=!0,xp(y);const _=requestAnimationFrame(()=>xp(y)),U=window.setTimeout(()=>xp(y),120);return()=>{cancelAnimationFrame(_),window.clearTimeout(U)}},[x,qr.length,el.length]);async function Pl(){var k;const y=sa.current;y&&(ql.current=vA(y),!(!x||!((k=lt==null?void 0:lt.history)!=null&&k.hasMoreBefore))&&(lt.loadingOlder||oa.current.has(x)||y.scrollTop>96||await Jr(x)))}function ca(y){var j,_;if(y.history)return y.history;const k=((j=y.timelineNodes)==null?void 0:j.filter(U=>U.parentId===null).reduce((U,Z)=>U===null||Z.timelineAt<U.timelineAt||Z.timelineAt===U.timelineAt&&Z.sequence<U.sequence?Z:U,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((_=y.messages[0])==null?void 0:_.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 da(y){const k=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(k),Nr(y.url)}async function Gi(y,k){await navigator.clipboard.writeText(k),qs(y),mi.current!==null&&window.clearTimeout(mi.current),mi.current=window.setTimeout(()=>{qs(null),mi.current=null},1800)}function ke(y,k,j){const _=Date.now();bu({id:_,tone:y,text:k,detail:j}),window.setTimeout(()=>{bu(U=>(U==null?void 0:U.id)===_?null:U)},j?8e3:2400)}function Wl(y){const k=qi.current.get(y);k!==void 0&&(window.clearTimeout(k),qi.current.delete(y))}function fa(y){zr.current.delete(y),Lr.current.delete(y),Hl.current.delete(y),Qa.current.delete(y),Wl(y)}function Vr(y){zr.current.add(y),Lr.current.delete(y),Hl.current.delete(y),Qa.current.delete(y),Wl(y)}function Fr(y){zr.current.add(y),Qa.current.delete(y);const k=(Lr.current.get(y)??0)+1;Lr.current.set(y,k);const j=WE(k);Hl.current.set(y,Date.now()+j),Wl(y);const _=window.setTimeout(()=>{qi.current.delete(y),Ui(U=>U+1)},j);qi.current.set(y,_)}function Yr(y,k){k!=="running"&&fa(y)}async function Eu(){try{const[y,k]=await Promise.all([tb(),ib()]);X("connected");const j=Ic(k);if(b(j),Sp(j),y.length>0){const _=Yo(y),U=EA(),Z=_.find(pe=>pe.id===U)??_[0];g(_),kp(_),S(Z.id);return}g([]),bp(null),S(null)}catch(y){console.error(y),X("error")}}async function nn(){const[y,k]=await Promise.all([tb(),ib()]);for(const U of y)Yr(U.id,U.status);const j=Yo(y),_=Ic(k);b(_),Sp(_),g(j),kp(j)}async function gd(){if(!Vs.current){Vs.current=!0;try{const y=await D2(),k=Or.current,j=new Set(k.map(ve=>ve.id)),_=new Set(y.map(ve=>ve.id));if(j.size!==_.size||[...j].some(ve=>!_.has(ve))){await nn(),X("connected");return}const U=Wa.current;for(const ve of y)Yr(ve.id,ve.status);const Z=new Map(y.map(ve=>[ve.id,ve])),pe=U?Z.get(U)??null:null,Se=Yo(k.map(ve=>{const we=Z.get(ve.id);return we?{...ve,status:we.status,statusError:we.statusError,nextWakeup:we.nextWakeup,unreadTurnCount:we.unreadTurnCount,updatedAt:we.updatedAt}:ve}));g(Se),kp(Se),X("connected"),pe&&!Ja.current.has(pe.id)&&tt(pe.id,ve=>({...ve,status:pe.status}))}catch(y){console.error(y),X("error")}finally{Vs.current=!1}}}async function yd(){try{const y=await TD();X("connected"),F(y.version)}catch(y){console.error(y),X("error")}}async function Pr(y){try{const k=await ED(y);k&&W(j=>db(j,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function xd(){try{const y=await U2();Xt(y),X("connected")}catch(y){console.error(y),X("error")}}async function un(y){try{const k=await B2(y);Qn(k),X("connected")}catch(k){console.error(k),Qn([]),X("error")}}async function pa(y){try{const k=await q2(y);Bt(k),X("connected")}catch(k){console.error(k),Bt([]),X("error")}}async function Au(y){try{const k=await H2();_t(k),Ua(k),y||(_l(null),Ha(k)),X("connected")}catch(k){console.error(k),X("error")}}async function Nu(){if(i.role==="admin")try{ae(await $2()),X("connected")}catch(y){console.error(y),X("error")}}async function Kl(y=!0){try{const k=await Q2(y);Ee(k.models),X("connected"),k.refreshing&&window.setTimeout(()=>void Kl(!1),1e3)}catch(k){console.error(k),Ee([]),X("error")}}async function Wr(){try{const y=await V2();Qe(y.codexVersion),Zn(y.codexReleasedAt),X("connected")}catch(y){console.error(y),Qe(null),Zn(null),X("error")}}async function Xl(y=!1){y&&Rl(!0);try{const k=await Z2(y);st(k.job),jr(k.latest),X("connected"),k.job&&k.job.status!=="running"&&Pa.current===k.job.id&&(Pa.current=null,k.job.status==="succeeded"?(await Promise.all([Kl(),Wr()]),ke("success",`Codex CLI updated to ${fd(k.job.currentVersion)}`)):ke("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),X("error")}finally{y&&Rl(!1)}}async function bd(){wn(!0);try{const y=await J2();Pa.current=y.id,st(y),X("connected")}catch(y){console.error(y);const k=Ge(y);ke("error","Unable to start Codex CLI update",k.detail??k.message)}finally{wn(!1)}}D.useEffect(()=>{if(!Ft||(ct==null?void 0:ct.status)!=="running")return;const y=window.setInterval(()=>void Xl(),1e3);return()=>window.clearInterval(y)},[Ft,ct==null?void 0:ct.id,ct==null?void 0:ct.status]);async function Vi(y){try{const k=await eD(y);_l(k),Ha(k.effective),X("connected")}catch(k){console.error(k),_l(null),X("error")}}async function Xs(){try{const y=await tD();Tr(y),Ls(y),X("connected")}catch(y){console.error(y),X("error")}}async function Ql(){if(i.role!=="admin"){be([]);return}try{be(await kR()),X("connected")}catch(y){console.error(y),X("error")}}async function Zl(){if(i.role!=="admin"){O(null);return}z(!0);try{O(await G2()),X("connected")}catch(y){console.error(y),X("error")}finally{z(!1)}}async function Qs(y=wt){const k=[xd(),Au(y),Wr(),Kl(),Xs()];i.role==="admin"&&(k.push(Ql()),k.push(Zl()),k.push(Nu())),y&&(k.push(Cn(y)),k.push(Vi(y)),k.push(un(y)),k.push(pa(y))),await Promise.all(k)}function ha(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;L(!1),na(y),Ba(i.role==="admin"?"global":y?"workspace":"global"),Ut(!0),Qs(y)}function tl(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;na(y),Ba(y?"workspace":"global"),Ut(!0),Qs(y)}function Kr(){var k;L(!1);const y=x??((k=p[0])==null?void 0:k.id)??null;Mi(y),hi(null),la(null),At(!0),y&&Du(y)}async function Du(y){try{const k=await sw(y);if(!k||k.status!=="running")return;Ar(!0);const j=await ow(y,k);hi(j),await Cn(y),await nn(),j.warmupTurnId&&ri(y,j.warmupTurnId),ke("success","Full-history runtime reset completed")}catch(k){const j=Ge(k);ke("error","Full-history runtime reset failed",j.message)}finally{Ar(!1)}}function ma(y){na(y),Ba("workspace"),Cn(y),Vi(y),un(y),pa(y),Ni(Fo)}async function Ru(y){y.preventDefault();try{if(Jt==="workspace"&&wt){const k=(Mt==null?void 0:Mt.status)==="running",j=await rb(wt,uD(Os,La,qa));_l(j.settings),Ha(j.settings.effective),Dn(j.conversation),ke("success","Workspace settings saved",k?"The current turn keeps its existing settings. Changes apply from the next turn.":void 0)}else{const k=await nD(Ai);_t(k),Ua(k),wt&&await Vi(wt),ke("success","Global settings saved")}X("connected")}catch(k){console.error(k),X("error");const j=Ge(k);ke("error","Failed to save runtime settings",j.detail??j.message)}}async function _u(y){try{const k=await iD(y);ae(k),X("connected"),ke("success","Deployment settings saved")}catch(k){console.error(k),X("error");const j=Ge(k);throw ke("error","Failed to save deployment settings",j.detail??j.message),k}}async function Mu(){var j;const y=ni;if(!y){ke("error","No workspace selected");return}const k=((j=te[y.id])==null?void 0:j.status)??y.status;if(k==="running"||k==="initializing"){ke("error","Stop the running turn before resetting runtime");return}gn(!0),hi(null);try{const _=await ob(y.id);la(_),X("connected")}catch(_){console.error(_),X("error");const U=Ge(_);ke("error","Failed to preview runtime reset",U.detail??U.message)}finally{gn(!1)}}async function vd(y){const k=ni,j=pi;if(!k||!j||j.conversationId!==k.id){ke("error","Reset preview is required");return}aa(!0),hi(null);try{const _=await sb(k.id,{warmup:gu,previewFingerprint:j.fingerprint,selectedEntryIds:y});hi(_),la(null),X("connected"),await Cn(k.id),await nn(),_.warmupTurnId&&ri(k.id,_.warmupTurnId),ke("success","Runtime thread reset")}catch(_){console.error(_),X("error");const U=Ge(_);ke("error","Failed to reset runtime thread",U.detail??U.message)}finally{aa(!1)}}async function wd(){var _;const y=ni;if(!y){ke("error","No workspace selected");return}const k=((_=te[y.id])==null?void 0:_.status)??y.status;if(k==="running"||k==="initializing"){ke("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${y.title}" from a blank context?
|
|
83
83
|
|
|
84
|
-
This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){
|
|
84
|
+
This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){Ar(!0),hi(null);try{const U=await ob(y.id),Z=await sb(y.id,{warmup:!1,previewFingerprint:U.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});hi(Z),la(null),wt===y.id&&Jn({memory:"",items:[]}),X("connected"),await Cn(y.id),await nn(),ke("success","Workspace started from blank context")}catch(U){console.error(U),X("error");const Z=Ge(U);ke("error","Failed to clear workspace context",Z.detail??Z.message)}finally{Ar(!1)}}}async function kd(y){const k=ni,j=pi;if(!k||!j||j.conversationId!==k.id)throw new Error("Reset preview is no longer current.");try{await aD(k.id,{previewFingerprint:j.fingerprint,selectedEntryIds:y}),X("connected")}catch(_){console.error(_),X("error");const U=Ge(_);throw ke("error","Failed to save reset defaults",U.detail??U.message),_}}async function Ou(y,k){try{const j=await rb(y,{[k]:null});_l(j.settings),Ha(j.settings.effective),Dn(j.conversation),X("connected"),ke("success","Workspace override reset")}catch(j){console.error(j),X("error"),ke("error","Failed to reset workspace override")}}async function zu(y){try{const k=await gD({memory:mD(y),items:y});return Tr(k),Ls(k),X("connected"),ke("success","Base memory saved"),k.items}catch(k){throw console.error(k),X("error"),ke("error","Failed to save memory"),k}}async function Zs(y,k){try{const j=await Gc(y,{memoryItems:k});return Dn(j),Jn({memory:j.memory,items:j.memoryItems}),X("connected"),ke("success","Workspace memory saved"),j.memoryItems}catch(j){throw console.error(j),X("error"),ke("error","Failed to save memory"),j}}async function $n(y){y.preventDefault();const k=$a.key.trim();if(k)try{if(Jt==="workspace"&&wt){const j=await xD(wt,k,$a.value,$a.description);Qn(_=>[..._.filter(U=>U.key!==j.variable.key),j.variable].sort((U,Z)=>U.key.localeCompare(Z.key))),Dn(j.conversation)}else{const j=await yD(k,$a.value,$a.description);Xt(_=>[..._.filter(U=>U.key!==j.key),j].sort((U,Z)=>U.key.localeCompare(Z.key)))}ke("success",Jt==="workspace"?"Workspace environment saved":"Base environment saved"),Ga({description:"",key:"",value:""}),Di(null),ei(j=>{const _=new Set(j);return _.delete(k),_}),X("connected")}catch(j){console.error(j),X("error"),ke("error","Failed to save environment")}}async function Xr(y){try{if(Jt==="workspace"&&wt){const k=await kD(wt,y);Qn(j=>j.filter(_=>_.key!==y)),Dn(k)}else await wD(y),Xt(k=>k.filter(j=>j.key!==y));Er===y&&(Ga({description:"",key:"",value:""}),Di(null),ei(k=>{const j=new Set(k);return j.delete(y),j})),X("connected"),ke("success",Jt==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),X("error"),ke("error","Failed to delete environment")}}async function jn(y,k){if(k.preventDefault(),!Bn.name.trim()){ke("error","Knowledge name is required");return}const j=cD(Bn);try{const _=Bn.id?await jD(y,Bn.id,j):await SD(y,j);Bt(U=>[...U.filter(Z=>Z.id!==_.id),_].sort(ub)),Ni(Fo),X("connected"),ke("success","Workspace knowledge saved")}catch(_){console.error(_),X("error"),ke("error","Failed to save workspace knowledge")}}async function nl(y,k){try{await CD(y,k),Bt(j=>j.filter(_=>_.id!==k)),Bn.id===k&&Ni(Fo),X("connected"),ke("success","Workspace knowledge deleted")}catch(j){console.error(j),X("error"),ke("error","Failed to delete workspace knowledge")}}function Js(y){Ba("workspace"),Ni(dD(y))}function Qr(y){Ga({description:y.description,key:y.key,value:""}),Di(y.key),ei(k=>{const j=new Set(k);return j.delete(y.key),j}),Fi(y.key,{preserveTypedValue:!0})}function Zr(){const y=Er;Ga({description:"",key:"",value:""}),Di(null),y&&ei(k=>{const j=new Set(k);return j.delete(y),j})}async function eo(y){await Fi(y)}async function Fi(y,k={}){try{const j=Jt==="workspace"&&wt?await vD(wt,y):await bD(y);Ga(_=>_.key===y&&(!k.preserveTypedValue||_.value.length===0)?{..._,value:j}:_),ei(_=>new Set(_).add(y)),X("connected")}catch(j){console.error(j),X("error")}}async function Cn(y){const k=await Mp(y);ar(k)}async function Jl(y){try{const k=await Mp(y);so(k)}catch(k){console.warn("Failed to synchronize timeline before turn stream",k)}}async function ga(y){try{E(await ND(y))}catch(k){console.error(k)}}async function er(y){if(x)try{const k=await RD(x,y);E(y==="end"?null:k),y==="end"&&H("simple"),ke("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&is(x,{waitMs:15e3}),await nn()}catch(k){ke("error","Complex task control failed",Ge(k).detail??Ge(k).message)}}async function Ot(y){if(x)try{q(await DD(x,y))}catch(k){const j=Ge(k);ke("error","Failed to load complex task",j.detail??j.message)}}function to(){De&&N({sourceId:De.id,name:`${De.title} - Clone`,groupId:De.groupId})}async function yi(y){if(y.preventDefault(),!(!ie||!ie.name.trim())){re(!0);try{const k=await _D(ie.sourceId,ie.name.trim(),ie.groupId);g(j=>Yo([k.conversation,...j])),S(k.conversation.id),N(null),L(!1),ke(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){ke("error","Clone failed",Ge(k).detail??Ge(k).message)}finally{re(!1)}}}async function Lu(){if(De)try{const y=await MD(De.id);Dn(y.conversation),ke(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){ke("error","Clone retry failed",Ge(y).detail??Ge(y).message)}}async function Jr(y,k={}){var ve,we,mt;const j=te[y],_=(ve=j==null?void 0:j.history)==null?void 0:ve.oldestTimelineAt,U=(we=j==null?void 0:j.history)==null?void 0:we.oldestTimelineSequence,Z=_&&U!==null&&U!==void 0?`${_}|${U}`:U==null?(mt=j==null?void 0:j.history)==null?void 0:mt.oldestMessageCreatedAt:String(U),pe=sa.current;if(!Z||!pe)return;if(k.preserveAnchor??!0){const Fe=jA(pe);Hn.current={anchorOffset:Fe.anchorOffset,conversationId:y,previousScrollHeight:pe.scrollHeight,anchorTurnId:Fe.anchorTurnId}}else Hn.current=null;oa.current.add(y),tt(y,Fe=>({...Fe,loadingOlder:!0}));try{const Fe=await Mp(y,{before:Z,limit:_v});lr(Fe)}catch(Fe){console.error(Fe),Hn.current=null}finally{oa.current.delete(y),tt(y,Fe=>({...Fe,loadingOlder:!1}))}}async function ya(y,k){const j=await AD(y,k||void 0);g(_=>{const U=[j,..._];return Yc(U.map(Z=>Z.id)),U}),S(j.id),L(!1)}function es(y){y!==Wa.current&&(de(k=>{if(!(y in k))return k;const j={...k};return delete j[y],j}),S(y))}function Iu(){L(!1),sn({mode:"create",groupId:null,title:""})}function ts(y){sn({mode:"rename",groupId:y.id,title:y.title})}function no(){var y;L(!1),Me({mode:"create",conversationId:null,title:"",groupId:(De==null?void 0:De.groupId)??((y=m[0])==null?void 0:y.id)})}async function Tn(y){var k;if(y.status!=="running"){St(!0);try{await zD(y.id),de(_=>{const U={..._};return delete U[y.id],U});const j=p.filter(_=>_.id!==y.id);if(Yc(j.map(_=>_.id)),vp(y.id,""),g(j),x===y.id){const _=((k=j[0])==null?void 0:k.id)??null;bp(_),S(_)}(xe==null?void 0:xe.conversationId)===y.id&&xi(),rn(null),ke("success","Workspace moved to recycle")}catch(j){const _=Ge(j);ke("error","Failed to move workspace to recycle",_.detail??_.message)}finally{St(!1)}}}async function il(y){if(!(y.id===_x||!window.confirm(`Delete group "${y.title}"?
|
|
85
85
|
|
|
86
|
-
Workspaces in this group will move to Default.`)))try{const j=await I2(y.id),_=Uc(j.groups);b(_),Sp(_),g(j.conversations),zi(U=>{const Z=new Set(U);return Z.delete(y.id),wp(Z),Z})}catch(j){console.error(j)}}function nl(y){Me({mode:"rename",conversationId:y.id,title:y.title})}function $n(){Ct(!1),Me(null)}function xa(){sn(null)}async function tr(y,k){const j=k.trim(),_=p.find(Z=>Z.id===y);if(!_||!j||j===_.title){$n();return}const U=await Vc(y,{title:j});Fn(U),$n()}function En(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function yn(y){return y instanceof Element&&!!y.closest("input, button")}function Vi(y,k){const j=document.elementFromPoint(y,k);return j instanceof HTMLElement?j.closest(".session-item[data-workspace-id]"):null}function Gn(y,k){const j=document.elementFromPoint(y,k);return j instanceof HTMLElement?j.closest(".workspace-group[data-group-id]"):null}function li(y,k,j){const _=Vi(k,j),U=_==null?void 0:_.dataset.workspaceId;if(_&&U&&U!==y){Qt({kind:"workspace",id:U,position:DA(_,j)});return}const Z=Gn(k,j),pe=Z==null?void 0:Z.dataset.groupId;if(!pe){Qt(null);return}Qt({kind:"group",id:pe})}function bi(y,k){yn(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),Ur.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function Uu(y,k){const j=Ur.current;if(!j||j.id!==k||j.pointerId!==y.pointerId)return;const _=Math.hypot(y.clientX-j.startX,y.clientY-j.startY);if(Rr!==k){if(_<Dx)return;Fa(k),Qt(null)}y.preventDefault(),ra({x:y.clientX,y:y.clientY}),li(k,y.clientX,y.clientY)}async function to(y,k){var pe;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ur.current=null;const j=Rr===k;j&&($s.current=!0);const _=gn;if(!j||!_){Fa(null),Qt(null),ra(null);return}const U=p.find(Se=>Se.id===k),Z=_.kind==="group"?_.id:(pe=p.find(Se=>Se.id===_.id))==null?void 0:pe.groupId;if(!U||!Z){Fa(null),Qt(null),ra(null);return}if(g(Se=>{const be=_.kind==="workspace"?RA(Se.map(we=>we.id===k?{...we,groupId:Z}:we),k,_.id,_.position):[...Se.filter(we=>we.id!==k),{...U,groupId:Z}];return Pc(be.map(we=>we.id)),be}),U.groupId!==Z)try{const Se=await Vc(k,{groupId:Z});Fn(Se)}catch(Se){console.error(Se),await nn()}Fa(null),Qt(null),ra(null)}function no(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ur.current=null,Fa(null),Qt(null),ra(null)}function Bu(y,k){y.currentTarget.setPointerCapture(y.pointerId),Br.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function Wt(y,k){const j=Br.current;if(!j||j.id!==k||j.pointerId!==y.pointerId)return;const _=Math.hypot(y.clientX-j.startX,y.clientY-j.startY);if(_r!==k){if(_<Dx)return;Ol(k),Mr(null)}y.preventDefault();const U=Gn(y.clientX,y.clientY),Z=U==null?void 0:U.dataset.groupId;Mr(Z&&Z!==k?Z:null)}function mt(y,k){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const j=_r===k;j&&(y.preventDefault(),Gs.current=!0);const _=vu;j&&_&&b(U=>{const Z=_A(U,k,_);return Hv(Z.map(pe=>pe.id)),Z}),Br.current=null,Ol(null),Mr(null)}function Ye(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Br.current=null,Ol(null),Mr(null)}function Fi(y){const k=y.target.value;Me(j=>j&&{...j,title:k})}function An(y){const k=y.target.value;Me(j=>j&&{...j,groupId:k})}function io(y){const k=y.target.value;sn(j=>j&&{...j,title:k})}async function Yi(y){if(y.preventDefault(),!xe)return;const k=xe.title.trim();if(k){Ct(!0);try{if(xe.mode==="create"){await ya(k,xe.groupId),$n();return}xe.conversationId&&await tr(xe.conversationId,k)}catch(j){console.error(j);const _=Ge(j);ke("error",xe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",_.detail??_.message)}finally{Ct(!1)}}}function nr(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),$n())}async function qu(y){if(y.preventDefault(),!Ut)return;const k=Ut.title.trim();if(k)try{if(Ut.mode==="rename"){if(!Ut.groupId)return;const _=await L2(Ut.groupId,{title:k});b(U=>U.map(Z=>Z.id===_.id?_:Z)),xa();return}const j=await z2(k);b(_=>[..._,j]),zi(_=>{const U=new Set(_);return U.delete(j.id),wp(U),U}),xa()}catch(j){console.error(j)}}function Pi(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),xa())}async function ba(y){y.preventDefault(),await vi()}function ao(y){x&&Ii.current.set(x,(Ii.current.get(x)??0)+1),u(y),vp(x,y)}function Wi(y,k,j){const _={conversationId:y,version:j};if(!Tx(_,{conversationId:y,version:Ii.current.get(y)??0}))return;vp(y,"");const U=ql.current;U&&Tx(_,{conversationId:U,version:Ii.current.get(U)??0})&&u(Z=>Z.trim()===k?"":Z)}function lo(y){if(Ka.current.has(y))return null;const k=Symbol(y);return Ka.current.set(y,k),d(j=>{const _=new Set(j);return _.add(y),_}),k}function Nn(y,k){Ka.current.get(y)===k&&(Ka.current.delete(y),d(j=>{const _=new Set(j);return _.delete(y),_}))}function Vn(y){const k=Ge(y);ke("error","Message was not confirmed",`${k.message}. Your text is still in the composer and can be retried.`)}async function vi(y={}){const k=r.trim();if(!k)return;const j=x,_=VE({hasConversation:j!==null,messageSubmitting:j!==null&&Ka.current.has(j),hasActiveTurn:j!==null&&Sn.current.has(j),hasConfirmedCurrentTurn:j!==null&&Xa.current.has(j),complexTaskActive:!!w},!!y.forceNewTurn);if(_==="create-workspace"){ts();return}if(_==="blocked"||!j)return;const U=Ii.current.get(j)??0,Z=lo(j);if(!Z)return;if(_==="queue-turn"){await il(j,k,U,Z);return}if(_==="steer-turn"){await is(j,k,U,Z);return}const pe=`local-${Date.now()}`;rt(j,be=>({...be,messages:[...be.messages,{id:pe,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),xn(j,"running"),Ki(j,!0);let Se=!1;try{let be=null;const we=ge(`conversations/${j}/turns`),nt=await fetch(we,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:M})});if(nt.ok){const tt=await nt.json();if(!tt.turnId)throw new Error("Turn did not return a turn id");if(be=tt.turnId,(M==="complex"||w)&&(ga(j),H("simple")),!tt.message)throw new Error("Turn did not return the persisted message");Dt(j,pe,tt.message,be),Se=!0,Wi(j,k,U)}else{const tt=await yA(nt);if(tt){be=tt;const si=await wa(j,tt,k);if(!si.ok)throw await dn(si,{method:"POST",url:ge(`conversations/${j}/turns/${tt}/steer`)});const ls=await si.json();if(!ls.message)throw new Error("Steer did not return the persisted message");Dt(j,pe,ls.message,tt),Se=!0,Wi(j,k,U)}else throw await dn(nt,{method:"POST",url:we})}if(!be)throw await dn(nt,{method:"POST",url:we});va(j,be),Nn(j,Z)}catch(be){Se||Vn(be);const we=gA(be);we&&ke("error","Reset thread required",w?"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."),rt(j,nt=>({...nt,status:"error",messages:Se?nt.messages:nt.messages.filter(tt=>tt.id!==pe),events:[...nt.events,{id:nt.events.length+1,event:"client.error",data:we?{message:"Reset thread required",detail:w?"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."}:hr(be),createdAt:new Date().toISOString()}]})),xn(j,"error"),Ki(j,!1),await nn()}finally{Nn(j,Z)}}async function ri(y){const k=Qa.current.get(y)??[];if(k.length===0)return;const[j,..._]=k;Qa.current.set(y,_),await va(y,j)}async function ns(y,k={}){if(Za.current.has(y)||kn.current.has(y))return;Wl(y),Hl.current.delete(y);const j=new AbortController;kn.current.set(y,j),Ki(y,!0);try{const _=k.waitMs?`?waitMs=${k.waitMs}`:"",U=ge(`conversations/${y}/turns/current/events${_}`),Z=await fetch(U,{signal:j.signal});if(!Z.ok||!Z.body)throw await dn(Z,{method:"GET",url:U});fa(y),Xa.current.add(y),await Jl(y),await mb(Z.body,pe=>{const Se=Wx(pe,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Se.turnId&&!Sn.current.has(y)&&Sn.current.set(y,Se.turnId),rt(y,we=>({...we,status:Fc(Se)??we.status,events:Px(we.events,Se)}));const be=Fc(Se);be&&xn(y,be)}),await Cn(y),await nn()}catch(_){if(!Xx(_)){if(mA(_)){kn.current.get(y)===j&&Yr(y);return}rt(y,U=>({...U,status:"error",events:[...U.events,{id:U.events.length+1,event:"client.error",data:hr(_),createdAt:new Date().toISOString()}]}))}}finally{kn.current.get(y)===j&&(Xa.current.delete(y),Sn.current.delete(y),kn.current.delete(y),Ki(y,!1),await ri(y))}}async function va(y,k,j={}){const _=Sn.current.get(y);if(_===k)return;if(_||kn.current.has(y)){const Z=Qa.current.get(y)??[];Z.includes(k)||Qa.current.set(y,[...Z,k]);return}fa(y);const U=new AbortController;kn.current.set(y,U),Sn.current.set(y,k),Ki(y,!0);try{const Z=ge(`conversations/${y}/turns/${k}/events`),pe=await fetch(Z,{signal:U.signal});if(!pe.ok||!pe.body)throw await dn(pe,{method:"GET",url:Z});await Jl(y),await mb(pe.body,Se=>{const be=Wx(Se,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);rt(y,nt=>({...nt,status:Fc(be)??nt.status,events:Px(nt.events,be)}));const we=Fc(be);we&&xn(y,we)}),await Cn(y),await nn()}catch(Z){if(!Xx(Z)){if(j.recovered&&hA(Z)){await Cn(y),await nn();return}rt(y,pe=>({...pe,status:"error",events:[...pe.events,{id:pe.events.length+1,event:"client.error",data:hr(Z),createdAt:new Date().toISOString()}]}))}}finally{kn.current.get(y)===U&&(Sn.current.get(y)===k&&Sn.current.delete(y),kn.current.delete(y),Ki(y,!1),await ri(y))}}async function il(y,k,j,_){let U=!1;const Z=`local-queued-${Date.now()}`;rt(y,pe=>({...pe,messages:[...pe.messages,{id:Z,role:"user",content:k,createdAt:new Date().toISOString()}]}));try{const pe=ge(`conversations/${y}/turns`),Se=await fetch(pe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue",workMode:M})});if(!Se.ok)throw await dn(Se,{method:"POST",url:pe});const be=await Se.json();if(!be.turnId)throw new Error("Queued turn did not return a turn id");if(!be.message)throw new Error("Queued turn did not return the persisted message");Dt(y,Z,be.message,be.turnId),U=!0,Wi(y,k,j),va(y,be.turnId),Nn(y,_),await nn(),ke("success",be.queuePosition?`Queued as next turn (${be.queuePosition})`:"Started new turn")}catch(pe){U||Vn(pe),rt(y,Se=>({...Se,messages:U?Se.messages:Se.messages.filter(be=>be.id!==Z),events:[...Se.events,{id:Se.events.length+1,event:"client.error",data:hr(pe),createdAt:new Date().toISOString()}]}))}finally{Nn(y,_)}}async function is(y,k,j,_){const U=Sn.current.get(y);let Z=!1;const pe=`local-steer-${Date.now()}`;rt(y,Se=>({...Se,messages:[...Se.messages,{id:pe,role:"user",content:k,createdAt:new Date().toISOString(),turnId:U??null}],status:"running"}));try{const Se=ge(U?`conversations/${y}/turns/${U}/steer`:`conversations/${y}/turns/steer`),be=await fetch(Se,Ox(k));if(!be.ok)throw await dn(be,{method:"POST",url:Se});const we=await be.json();if(!we.message)throw new Error("Steer did not return the persisted message");Dt(y,pe,we.message,U),Z=!0,Wi(y,k,j),Nn(y,_)}catch(Se){Vn(Se),rt(y,be=>({...be,messages:Z?be.messages:be.messages.filter(we=>we.id!==pe),events:[...be.events,{id:be.events.length+1,event:"client.error",data:hr(Se),createdAt:new Date().toISOString()}]}))}finally{Nn(y,_)}}async function wa(y,k,j){return fetch(ge(`conversations/${y}/turns/${k}/steer`),Ox(j))}function Dt(y,k,j,_){rt(y,U=>({...U,messages:Tp(U.messages.filter(Z=>Z.id!==k),[{...j,turnId:_??j.turnId??null}])}))}async function as(){var _;if(!x||ua!=="running"&&ua!=="initializing"&&!Fl)return;const y=x,k=ua,j=`client-stop-${Date.now()}`;Fr(y),(_=kn.current.get(y))==null||_.abort(),Sn.current.delete(y),Qa.current.delete(y),Ki(y,!1),rt(y,U=>({...U,status:"done",events:[...U.events,{id:j,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),xn(y,"done");try{const U=await ro(y);fa(y),rt(y,Z=>({...Z,status:U})),xn(y,U),Promise.all([Cn(y),nn()]).catch(Z=>{console.warn("Failed to refresh workspace after Stop",Z)})}catch(U){Yr(y),rt(y,pe=>({...pe,status:k==="initializing"?"initializing":"running",events:[...pe.events.filter(Se=>Se.id!==j),{id:pe.events.length+1,event:"client.error",data:hr(U),createdAt:new Date().toISOString()}]})),xn(y,k==="initializing"?"initializing":"running");const Z=Ge(U);ke("error","Stop failed",Z.detail??Z.message);try{await nn()}catch(pe){console.warn("Failed to refresh workspace after Stop failed",pe)}}}async function ro(y){const k=ge(`conversations/${y}/turns/interrupt`),j=await fetch(k,{method:"POST"});if(!j.ok)throw await dn(j,{method:"POST",url:k});return KE(await j.json().catch(()=>null))}async function jd(){var _;const y=ai;if(!y){ke("error","No workspace selected");return}if(!window.confirm(`Force stop and repair "${y.title}"?
|
|
86
|
+
Workspaces in this group will move to Default.`)))try{const j=await I2(y.id),_=Ic(j.groups);b(_),Sp(_),g(j.conversations),Ii(U=>{const Z=new Set(U);return Z.delete(y.id),wp(Z),Z})}catch(j){console.error(j)}}function al(y){Me({mode:"rename",conversationId:y.id,title:y.title})}function xi(){Ct(!1),Me(null)}function Yi(){sn(null)}async function En(y,k){const j=k.trim(),_=p.find(Z=>Z.id===y);if(!_||!j||j===_.title){xi();return}const U=await Gc(y,{title:j});Dn(U),xi()}function An(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function bi(y){return y instanceof Element&&!!y.closest("input, button")}function ii(y,k){const j=document.elementFromPoint(y,k);return j instanceof HTMLElement?j.closest(".session-item[data-workspace-id]"):null}function Gn(y,k){const j=document.elementFromPoint(y,k);return j instanceof HTMLElement?j.closest(".workspace-group[data-group-id]"):null}function vi(y,k,j){const _=ii(k,j),U=_==null?void 0:_.dataset.workspaceId;if(_&&U&&U!==y){Qt({kind:"workspace",id:U,position:DA(_,j)});return}const Z=Gn(k,j),pe=Z==null?void 0:Z.dataset.groupId;if(!pe){Qt(null);return}Qt({kind:"group",id:pe})}function Uu(y,k){bi(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),Ir.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function io(y,k){const j=Ir.current;if(!j||j.id!==k||j.pointerId!==y.pointerId)return;const _=Math.hypot(y.clientX-j.startX,y.clientY-j.startY);if(Dr!==k){if(_<Dx)return;Fa(k),Qt(null)}y.preventDefault(),ra({x:y.clientX,y:y.clientY}),vi(k,y.clientX,y.clientY)}async function ao(y,k){var pe;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ir.current=null;const j=Dr===k;j&&(Fs.current=!0);const _=yn;if(!j||!_){Fa(null),Qt(null),ra(null);return}const U=p.find(Se=>Se.id===k),Z=_.kind==="group"?_.id:(pe=p.find(Se=>Se.id===_.id))==null?void 0:pe.groupId;if(!U||!Z){Fa(null),Qt(null),ra(null);return}if(g(Se=>{const ve=_.kind==="workspace"?RA(Se.map(we=>we.id===k?{...we,groupId:Z}:we),k,_.id,_.position):[...Se.filter(we=>we.id!==k),{...U,groupId:Z}];return Yc(ve.map(we=>we.id)),ve}),U.groupId!==Z)try{const Se=await Gc(k,{groupId:Z});Dn(Se)}catch(Se){console.error(Se),await nn()}Fa(null),Qt(null),ra(null)}function Bu(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ir.current=null,Fa(null),Qt(null),ra(null)}function Pt(y,k){y.currentTarget.setPointerCapture(y.pointerId),Ur.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function ht(y,k){const j=Ur.current;if(!j||j.id!==k||j.pointerId!==y.pointerId)return;const _=Math.hypot(y.clientX-j.startX,y.clientY-j.startY);if(Rr!==k){if(_<Dx)return;zl(k),_r(null)}y.preventDefault();const U=Gn(y.clientX,y.clientY),Z=U==null?void 0:U.dataset.groupId;_r(Z&&Z!==k?Z:null)}function Pe(y,k){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const j=Rr===k;j&&(y.preventDefault(),Ys.current=!0);const _=vu;j&&_&&b(U=>{const Z=_A(U,k,_);return Hv(Z.map(pe=>pe.id)),Z}),Ur.current=null,zl(null),_r(null)}function Pi(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ur.current=null,zl(null),_r(null)}function Nn(y){const k=y.target.value;Me(j=>j&&{...j,title:k})}function lo(y){const k=y.target.value;Me(j=>j&&{...j,groupId:k})}function Wi(y){const k=y.target.value;sn(j=>j&&{...j,title:k})}async function qu(y){if(y.preventDefault(),!xe)return;const k=xe.title.trim();if(k){Ct(!0);try{if(xe.mode==="create"){await ya(k,xe.groupId),xi();return}xe.conversationId&&await En(xe.conversationId,k)}catch(j){console.error(j);const _=Ge(j);ke("error",xe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",_.detail??_.message)}finally{Ct(!1)}}}function tr(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),xi())}async function ll(y){if(y.preventDefault(),!It)return;const k=It.title.trim();if(k)try{if(It.mode==="rename"){if(!It.groupId)return;const _=await L2(It.groupId,{title:k});b(U=>U.map(Z=>Z.id===_.id?_:Z)),Yi();return}const j=await z2(k);b(_=>[..._,j]),Ii(_=>{const U=new Set(_);return U.delete(j.id),wp(U),U}),Yi()}catch(j){console.error(j)}}function wi(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),Yi())}async function ro(y){y.preventDefault(),await li()}function nr(y){x&&Bi.current.set(x,(Bi.current.get(x)??0)+1),u(y),vp(x,y)}function rl(y,k,j){const _={conversationId:y,version:j};if(!Tx(_,{conversationId:y,version:Bi.current.get(y)??0}))return;vp(y,"");const U=Wa.current;U&&Tx(_,{conversationId:U,version:Bi.current.get(U)??0})&&u(Z=>Z.trim()===k?"":Z)}function xa(y){if(Xa.current.has(y))return null;const k=Symbol(y);return Xa.current.set(y,k),d(j=>{const _=new Set(j);return _.add(y),_}),k}function cn(y,k){Xa.current.get(y)===k&&(Xa.current.delete(y),d(j=>{const _=new Set(j);return _.delete(y),_}))}function ai(y){const k=Ge(y);ke("error","Message was not confirmed",`${k.message}. Your text is still in the composer and can be retried.`)}async function li(y={}){const k=r.trim();if(!k)return;const j=x,_=VE({hasConversation:j!==null,messageSubmitting:j!==null&&Xa.current.has(j),hasActiveTurn:j!==null&&Sn.current.has(j),hasConfirmedCurrentTurn:j!==null&&Qa.current.has(j),complexTaskActive:!!w},!!y.forceNewTurn);if(_==="create-workspace"){no();return}if(_==="blocked"||!j)return;const U=Bi.current.get(j)??0,Z=xa(j);if(!Z)return;if(_==="queue-turn"){await as(j,k,U,Z);return}if(_==="steer-turn"){await ba(j,k,U,Z);return}const pe=`local-${Date.now()}`;tt(j,ve=>({...ve,messages:[...ve.messages,{id:pe,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),xn(j,"running"),ki(j,!0);let Se=!1;try{let ve=null;const we=ge(`conversations/${j}/turns`),mt=await fetch(we,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:M})});if(mt.ok){const Fe=await mt.json();if(!Fe.turnId)throw new Error("Turn did not return a turn id");if(ve=Fe.turnId,(M==="complex"||w)&&(ga(j),H("simple")),!Fe.message)throw new Error("Turn did not return the persisted message");va(j,pe,Fe.message,ve),Se=!0,rl(j,k,U)}else{const Fe=await yA(mt);if(Fe){ve=Fe;const sr=await Wt(j,Fe,k);if(!sr.ok)throw await fn(sr,{method:"POST",url:ge(`conversations/${j}/turns/${Fe}/steer`)});const os=await sr.json();if(!os.message)throw new Error("Steer did not return the persisted message");va(j,pe,os.message,Fe),Se=!0,rl(j,k,U)}else throw await fn(mt,{method:"POST",url:we})}if(!ve)throw await fn(mt,{method:"POST",url:we});ri(j,ve),cn(j,Z)}catch(ve){Se||ai(ve);const we=gA(ve);we&&ke("error","Reset thread required",w?"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."),tt(j,mt=>({...mt,status:"error",messages:Se?mt.messages:mt.messages.filter(Fe=>Fe.id!==pe),events:[...mt.events,{id:mt.events.length+1,event:"client.error",data:we?{message:"Reset thread required",detail:w?"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."}:pr(ve),createdAt:new Date().toISOString()}]})),xn(j,"error"),ki(j,!1),await nn()}finally{cn(j,Z)}}async function ns(y){const k=Za.current.get(y)??[];if(k.length===0)return;const[j,..._]=k;Za.current.set(y,_),await ri(y,j)}async function is(y,k={}){if(Ja.current.has(y)||kn.current.has(y))return;Wl(y),Hl.current.delete(y);const j=new AbortController;kn.current.set(y,j),ki(y,!0);try{const _=k.waitMs?`?waitMs=${k.waitMs}`:"",U=ge(`conversations/${y}/turns/current/events${_}`),Z=await fetch(U,{signal:j.signal});if(!Z.ok||!Z.body)throw await fn(Z,{method:"GET",url:U});fa(y),Qa.current.add(y),await Jl(y),await mb(Z.body,pe=>{const Se=Wx(pe,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Se.turnId&&!Sn.current.has(y)&&Sn.current.set(y,Se.turnId),tt(y,we=>({...we,status:Vc(Se)??we.status,events:Px(we.events,Se)}));const ve=Vc(Se);ve&&xn(y,ve)}),await Cn(y),await nn()}catch(_){if(!Xx(_)){if(mA(_)){kn.current.get(y)===j&&Fr(y);return}tt(y,U=>({...U,status:"error",events:[...U.events,{id:U.events.length+1,event:"client.error",data:pr(_),createdAt:new Date().toISOString()}]}))}}finally{kn.current.get(y)===j&&(Qa.current.delete(y),Sn.current.delete(y),kn.current.delete(y),ki(y,!1),await ns(y))}}async function ri(y,k,j={}){const _=Sn.current.get(y);if(_===k)return;if(_||kn.current.has(y)){const Z=Za.current.get(y)??[];Z.includes(k)||Za.current.set(y,[...Z,k]);return}fa(y);const U=new AbortController;kn.current.set(y,U),Sn.current.set(y,k),ki(y,!0);try{const Z=ge(`conversations/${y}/turns/${k}/events`),pe=await fetch(Z,{signal:U.signal});if(!pe.ok||!pe.body)throw await fn(pe,{method:"GET",url:Z});await Jl(y),await mb(pe.body,Se=>{const ve=Wx(Se,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);tt(y,mt=>({...mt,status:Vc(ve)??mt.status,events:Px(mt.events,ve)}));const we=Vc(ve);we&&xn(y,we)}),await Cn(y),await nn()}catch(Z){if(!Xx(Z)){if(j.recovered&&hA(Z)){await Cn(y),await nn();return}tt(y,pe=>({...pe,status:"error",events:[...pe.events,{id:pe.events.length+1,event:"client.error",data:pr(Z),createdAt:new Date().toISOString()}]}))}}finally{kn.current.get(y)===U&&(Sn.current.get(y)===k&&Sn.current.delete(y),kn.current.delete(y),ki(y,!1),await ns(y))}}async function as(y,k,j,_){let U=!1;const Z=`local-queued-${Date.now()}`;tt(y,pe=>({...pe,messages:[...pe.messages,{id:Z,role:"user",content:k,createdAt:new Date().toISOString()}]}));try{const pe=ge(`conversations/${y}/turns`),Se=await fetch(pe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue",workMode:M})});if(!Se.ok)throw await fn(Se,{method:"POST",url:pe});const ve=await Se.json();if(!ve.turnId)throw new Error("Queued turn did not return a turn id");if(!ve.message)throw new Error("Queued turn did not return the persisted message");va(y,Z,ve.message,ve.turnId),U=!0,rl(y,k,j),ri(y,ve.turnId),cn(y,_),await nn(),ke("success",ve.queuePosition?`Queued as next turn (${ve.queuePosition})`:"Started new turn")}catch(pe){U||ai(pe),tt(y,Se=>({...Se,messages:U?Se.messages:Se.messages.filter(ve=>ve.id!==Z),events:[...Se.events,{id:Se.events.length+1,event:"client.error",data:pr(pe),createdAt:new Date().toISOString()}]}))}finally{cn(y,_)}}async function ba(y,k,j,_){const U=Sn.current.get(y);let Z=!1;const pe=`local-steer-${Date.now()}`;tt(y,Se=>({...Se,messages:[...Se.messages,{id:pe,role:"user",content:k,createdAt:new Date().toISOString(),turnId:U??null}],status:"running"}));try{const Se=ge(U?`conversations/${y}/turns/${U}/steer`:`conversations/${y}/turns/steer`),ve=await fetch(Se,Ox(k));if(!ve.ok)throw await fn(ve,{method:"POST",url:Se});const we=await ve.json();if(!we.message)throw new Error("Steer did not return the persisted message");va(y,pe,we.message,U),Z=!0,rl(y,k,j),cn(y,_)}catch(Se){ai(Se),tt(y,ve=>({...ve,messages:Z?ve.messages:ve.messages.filter(we=>we.id!==pe),events:[...ve.events,{id:ve.events.length+1,event:"client.error",data:pr(Se),createdAt:new Date().toISOString()}]}))}finally{cn(y,_)}}async function Wt(y,k,j){return fetch(ge(`conversations/${y}/turns/${k}/steer`),Ox(j))}function va(y,k,j,_){tt(y,U=>({...U,messages:Tp(U.messages.filter(Z=>Z.id!==k),[{...j,turnId:_??j.turnId??null}])}))}async function Hu(){var _;if(!x||ua!=="running"&&ua!=="initializing"&&!Fl)return;const y=x,k=ua,j=`client-stop-${Date.now()}`;Vr(y),(_=kn.current.get(y))==null||_.abort(),Sn.current.delete(y),Za.current.delete(y),ki(y,!1),tt(y,U=>({...U,status:"done",events:[...U.events,{id:j,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),xn(y,"done");try{const U=await $u(y);fa(y),tt(y,Z=>({...Z,status:U})),xn(y,U),Promise.all([Cn(y),nn()]).catch(Z=>{console.warn("Failed to refresh workspace after Stop",Z)})}catch(U){Fr(y),tt(y,pe=>({...pe,status:k==="initializing"?"initializing":"running",events:[...pe.events.filter(Se=>Se.id!==j),{id:pe.events.length+1,event:"client.error",data:pr(U),createdAt:new Date().toISOString()}]})),xn(y,k==="initializing"?"initializing":"running");const Z=Ge(U);ke("error","Stop failed",Z.detail??Z.message);try{await nn()}catch(pe){console.warn("Failed to refresh workspace after Stop failed",pe)}}}async function $u(y){const k=ge(`conversations/${y}/turns/interrupt`),j=await fetch(k,{method:"POST"});if(!j.ok)throw await fn(j,{method:"POST",url:k});return KE(await j.json().catch(()=>null))}async function Sd(){var _;const y=ni;if(!y){ke("error","No workspace selected");return}if(!window.confirm(`Force stop and repair "${y.title}"?
|
|
87
87
|
|
|
88
|
-
This cancels every current or queued turn and the active complex task, kills its runtime, and repairs scheduler state. Future scheduled wakeups are preserved.`))return;const j=y.id;aa(!0),Fr(j),(_=kn.current.get(j))==null||_.abort(),Sn.current.delete(j),Qa.current.delete(j),Ki(j,!1);try{const U=await ro(j);fa(j),rt(j,Z=>({...Z,status:U})),xn(j,U),await Cn(j),await nn(),ke("success","Workspace stopped and repaired")}catch(U){Yr(j);const Z=Ge(U);ke("error","Force stop failed",Z.detail??Z.message);try{await nn()}catch(pe){console.warn("Failed to refresh workspace after force Stop failed",pe)}}finally{aa(!1)}}async function ir(y,k){if(!x||!y.approvalTurnId||y.approvalRequestId===void 0)return;const j=x;try{const _=ge(`conversations/${j}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),U=await fetch(_,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!U.ok)throw await dn(U,{method:"POST",url:_});rt(j,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(_){rt(j,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"client.error",data:hr(_),createdAt:new Date().toISOString()}]}));const U=Ge(_);ke("error","Failed to respond to approval",U.detail??U.message)}}async function ar(y,k,j){const _=x,U=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!_||!U)return!1;try{const Z=ge(`conversations/${_}/workspace-change-proposals/${encodeURIComponent(U)}`),pe=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?j??y.workspaceChangePayload:void 0})});if(!pe.ok)throw await dn(pe,{method:"POST",url:Z});const Se=await pe.json(),be=QE(k,Se.decision),we=be==="accept"?Se.payload??j??y.workspaceChangePayload:null;return Fn(Se.conversation),rt(_,nt=>({...nt,events:[...nt.events,{id:`${y.id}:${be}`,event:"server.workspace_change.decision",data:{proposalId:U,changeType:y.workspaceChangeType??"responsibility",decision:be,payload:we},createdAt:new Date().toISOString()}]})),ke("success",be==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(Z){console.error(Z);const pe=Ge(Z);return ke("error","Failed to respond to workspace change proposal",pe.detail??pe.message),!1}}async function bt(y,k,j){const _=x;if(!(!_||!y.knowledgeProposalId))try{let U;if(k==="accept")try{U=JSON.parse(j??y.body)}catch{ke("error","Knowledge proposal JSON is invalid");return}const Z=ge(`conversations/${_}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),pe=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:U})});if(!pe.ok)throw await dn(pe,{method:"POST",url:Z});const Se=await pe.json();qt([...Se.items??[]].sort(ub)),rt(_,be=>({...be,events:[...be.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()}]})),ke("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(U){console.error(U);const Z=Ge(U);ke("error","Failed to respond to knowledge proposal",Z.detail??Z.message)}}function so(y){Pr(y.id,y.status),al(y),de(k=>{const j=k[y.id],_=y.events.map(U=>({id:U.id,turnId:U.turnId,seq:U.seq,event:U.event,data:U.data,createdAt:U.createdAt}));return{...k,[y.id]:{messages:y.messages,events:Hc(_,(j==null?void 0:j.events)??[]),timelineNodes:Ap(y.timelineNodes??[],(j==null?void 0:j.timelineNodes)??[]),turns:Ep(y.turns??[],(j==null?void 0:j.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:ca(y),loadingOlder:!1,fullEventTurnIds:(j==null?void 0:j.fullEventTurnIds)??new Set,loadingEventTurnIds:(j==null?void 0:j.loadingEventTurnIds)??new Set}}})}function lr(y){const k=ca(y);rt(y.id,j=>{var _,U,Z;return{...j,messages:Tp(y.messages,j.messages),timelineNodes:Ap(y.timelineNodes??[],j.timelineNodes),turns:Ep(y.turns??[],j.turns),events:Hc(y.events.map(pe=>({id:pe.id,turnId:pe.turnId,seq:pe.seq,event:pe.event,data:pe.data,createdAt:pe.createdAt})),j.events),contextVersions:(((_=y.contextVersions)==null?void 0:_.length)??0)>0?y.contextVersions??[]:j.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((U=j.history)==null?void 0:U.loadedMessageCount)??j.messages.length),loadedEventCount:k.loadedEventCount+(((Z=j.history)==null?void 0:Z.loadedEventCount)??j.events.length)},loadingOlder:!1}})}function rr(y){const k=ca(y),j=y.events.map(_=>({id:_.id,turnId:_.turnId,seq:_.seq,event:_.event,data:_.data,createdAt:_.createdAt}));rt(y.id,_=>{var U,Z,pe;return{..._,messages:Tp(_.messages,y.messages),timelineNodes:Ap(_.timelineNodes,y.timelineNodes??[]),turns:Ep(_.turns,y.turns??[]),events:Hc(j,_.events),contextVersions:(((U=y.contextVersions)==null?void 0:U.length)??0)>0?y.contextVersions??[]:_.contextVersions,status:y.status,history:{..._.history??k,messageTotal:k.messageTotal,eventTotal:k.eventTotal,loadedMessageCount:Math.max(((Z=_.history)==null?void 0:Z.loadedMessageCount)??_.messages.length,_.messages.length,y.messages.length),loadedEventCount:Math.max(((pe=_.history)==null?void 0:pe.loadedEventCount)??_.events.length,_.events.length,y.events.length)},loadingOlder:!1}})}function rt(y,k){de(j=>{const _=j[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...j,[y]:k(_)}})}function xn(y,k){g(j=>j.map(_=>_.id===y?{..._,status:k,updatedAt:new Date().toISOString()}:_))}function al(y){Fn(y)}function Fn(y){g(k=>Yo(k.map(j=>j.id===y.id?{...j,...y}:j)))}async function Hu(y,k){const j=k.filter(_=>{const U=te[y];return U&&!U.fullEventTurnIds.has(_)&&!U.loadingEventTurnIds.has(_)});if(j.length!==0){rt(y,_=>{const U=new Set(_.loadingEventTurnIds);for(const Z of j)U.add(Z);return{..._,loadingEventTurnIds:U}});try{const _=await Promise.all(j.map(U=>OD(y,U)));rt(y,U=>{const Z=new Set(U.fullEventTurnIds),pe=new Set(U.loadingEventTurnIds),Se=_.flatMap((be,we)=>{const nt=j[we];return Z.add(nt),pe.delete(nt),be.map(tt=>({id:tt.id,turnId:tt.turnId,seq:tt.seq,event:tt.event,data:tt.data,createdAt:tt.createdAt}))});return{...U,events:Hc(U.events,Se),fullEventTurnIds:Z,loadingEventTurnIds:pe}})}catch(_){console.error(_),rt(y,U=>{const Z=new Set(U.loadingEventTurnIds);for(const pe of j)Z.delete(pe);return{...U,loadingEventTurnIds:Z}}),ke("error","Failed to load process details")}}}function Ki(y,k){const j=new Set(Za.current);k?j.add(y):j.delete(y),Za.current=j,Va(_=>{const U=new Set(_);return k?U.add(y):U.delete(y),U})}function $u(y){const k=FE({key:y.key,metaKey:y.metaKey,ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,isComposing:y.nativeEvent.isComposing});k&&(y.preventDefault(),vi({forceNewTurn:k.forceNewTurn}))}function ka(y){zi(k=>{const j=new Set(k);return j.has(y)?j.delete(y):j.add(y),wp(j),j})}function oo(y){var k;return XE(y.status,(k=y.nextWakeup)==null?void 0:k.status,Ml.has(y.id))}function ll(y){var _;const k=(_=Or.current)==null?void 0:_.getBoundingClientRect(),j=k?y-k.left:y;return Ah(j)}function Gu(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),Ll(ll(y.clientX))}function rl(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),Ll(ll(y.clientX)))}function uo(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const k=ll(y.clientX);Ll(k),bA(k)}return s.jsxs("main",{className:`shell${ee?" mobile-sidebar-open":""}`,ref:Or,style:{"--sidebar-width":`${wu}px`},children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),ue?i.role==="admin"?s.jsxs("a",{"aria-label":`Open Seele Host control for Work v${ue}`,className:"work-version-link",href:`${Eh()}admin/host`,title:"Open Seele Host control: versions, restart, and logs",children:["v",ue,s.jsx("span",{"aria-hidden":"true",children:"↗"})]}):s.jsxs("span",{children:["v",ue]}):null,s.jsx("span",{"aria-label":xb(fe),className:`backend-status ${fe}`,"data-label":xb(fe)})]}),s.jsxs("div",{className:"sidebar-title-row",children:[s.jsx("h2",{children:"Workspaces"}),e?s.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]})]}),s.jsxs("div",{className:"sidebar-header-actions",children:[s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>L(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:ts,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:$l.map(y=>s.jsxs("section",{className:["workspace-group",_r===y.id?"dragging":"",vu===y.id?"drop-after":"",(gn==null?void 0:gn.kind)==="group"&&gn.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!Oi.has(y.id),className:"workspace-group-toggle",onClick:k=>{if(Gs.current){k.preventDefault(),Gs.current=!1;return}ka(y.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),eo(y)},onPointerCancel:Ye,onPointerDown:k=>Bu(k,y.id),onPointerMove:k=>Wt(k,y.id),onPointerUp:k=>mt(k,y.id),type:"button",children:[s.jsx("span",{className:Oi.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),eo(y)},title:"Double-click to rename",children:y.title})]}),y.id!==_x?s.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),Tn(y)},title:"Delete group",type:"button",children:"×"}):null]}),Oi.has(y.id)?null:s.jsx("div",{className:"workspace-group-items",children:y.conversations.map(k=>{const j=oo(k);return s.jsxs("div",{className:["session-item",k.id===x?"active":"",k.id===Rr?"dragging":"",(gn==null?void 0:gn.kind)==="workspace"&&gn.id===k.id?`drop-${gn.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:_=>{if($s.current){_.preventDefault(),$s.current=!1;return}S(k.id),L(!1)},onDoubleClick:_=>{yn(_.target)||(_.preventDefault(),nl(k))},onKeyDown:_=>{En(_.target)||_.key==="Enter"&&(S(k.id),L(!1))},onPointerCancel:no,onPointerDown:_=>bi(_,k.id),onPointerMove:_=>Uu(_,k.id),onPointerUp:_=>to(_,k.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":Qc(j,k.nextWakeup,en),className:`session-status ${j}`,title:Qc(j,k.nextWakeup,en)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),j==="waiting"&&k.nextWakeup?s.jsx("span",{className:"session-countdown",title:Qc(j,k.nextWakeup,en),children:ld(k.nextWakeup,en)}):null,k.unreadTurnCount>0?s.jsx("span",{"aria-label":`${k.unreadTurnCount} unread turns`,className:"session-unread",title:`${k.unreadTurnCount} unread turns`,children:k.unreadTurnCount>99?"99+":k.unreadTurnCount}):null,j!=="running"?s.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:_=>{_.stopPropagation(),rn(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",Ts(k.id)]})]},k.id)})})]},y.id))}),s.jsx("footer",{className:"sidebar-footer",children:s.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[s.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:ha,type:"button",children:s.jsx(Zx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Js,type:"button",children:s.jsx(k2,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{zs(!0),L(!1)},type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Xr,type:"button",children:s.jsx(S2,{})}),s.jsx(CN,{usage:Tu})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>L(!1),tabIndex:ee?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Gu,onPointerMove:rl,onPointerUp:uo,role:"separator",tabIndex:0}),qr&&zl?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${zl.x+12}px, ${zl.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:qr.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",Ts(qr.id)]})]}):null,xe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:nr,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:nr,onSubmit:y=>void Yi(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:Fi,onKeyDown:nr,value:xe.title}),xe.mode==="create"?s.jsxs(s.Fragment,{children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),s.jsx("select",{id:"workspace-group",onChange:An,onKeyDown:nr,value:xe.groupId??((co=m[0])==null?void 0:co.id)??"",children:m.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:$n,children:"Cancel"}),s.jsx("button",{disabled:Ve,type:"submit",children:Ve?"Saving...":xe.mode==="create"?"Create":"Save"})]})]})}):null,Ut?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Pi,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Pi,onSubmit:y=>void qu(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),s.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:io,onKeyDown:Pi,value:Ut.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:xa,children:"Cancel"}),s.jsx("button",{type:"submit",children:Ut.mode==="create"?"Create":"Save"})]})]})}):null,Le?s.jsx(BA,{currentUser:i,conversations:p,editingEnvironmentKey:Ar,deploymentSettings:Ia,environmentDraft:$a,globalEnvironment:hn,workspaceEnvironment:ji,memorySettings:pu,memorySettingsDraft:_s,workspaceMemoryDraft:hu,runtimeSettings:La,runtimeModels:ce,runtimeCodexVersion:Ue,runtimeCodexReleasedAt:Ft,runtimeCodexUpdating:(dt==null?void 0:dt.status)==="running",runtimeSettingsDraft:Ti,runtimeSettingsScope:Jt,settingsWorkspace:Ot,settingsWorkspaceId:wt,systemDiagnostics:_e,systemDiagnosticsLoading:A,workspaceGroups:$l,workspaceRuntimeSettings:qa,workspaceRuntimeSettingsDraft:Rs,managedUsers:oe,onCancelEnvironmentEdit:Jr,onClose:()=>Bt(!1),onCreateUser:async y=>{const k=await SR(y);ve(j=>[...j,k]),ke("success","User created")},onDeleteUser:async y=>{await CR(y),ve(k=>k.filter(j=>j.id!==y)),ke("success","User deleted")},onSaveDeploymentSettings:_u,onDeleteEnvironment:y=>void Qr(y),onDraftChange:Ga,onEditEnvironment:Zr,onRevealEnvironmentValue:y=>void Qs(y),onSaveBaseMemoryItems:y=>zu(y),onSaveResponsibility:async(y,k)=>{try{const j=await Vc(y,{responsibility:k});return Fn(j),X("connected"),ke("success","Workspace responsibility saved"),j.responsibility}catch(j){throw console.error(j),X("error"),ke("error","Failed to save workspace responsibility"),j}},onSaveWorkspaceMemoryItems:y=>wt?Ks(wt,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:Ua,onCodexAccountSwitched:async()=>{ke("success","Codex account switched"),(await Ew()).codexAccountsReady&&await Promise.all([Wr(!0),Kl(!0),Kr()])},onUpdateCodexCli:()=>{Et(!0),Xl(!0)},onRuntimeScopeChange:Ba,onSettingsWorkspaceChange:ma,onSubmitRuntimeSettings:y=>void Ru(y),onWorkspaceRuntimeDraftChange:Ha,onWorkspaceRuntimeReset:y=>wt?void Ou(wt,y):void 0,revealedEnvironmentKeys:Os,onSubmitEnvironment:y=>void Hn(y),onRefreshSystemDiagnostics:()=>void Zl(),onUpdateUser:async(y,k)=>{const j=await jR(y,k);ve(_=>_.map(U=>U.id===j.id?j:U)),ke("success","User updated")}}):null,Yt?s.jsx(UA,{currentReleasedAt:Ft,currentVersion:Ue,job:dt,latest:hd,latestChecking:Tr,starting:Ci,onClose:()=>Et(!1),onRefresh:()=>void Xl(),onStart:()=>void vd()}):null,Ni&&De?s.jsx(OA,{conversation:De,clockNow:en,knowledgeDraft:Un,workspaceKnowledge:Pt,tokenUsage:Gl,onCancelKnowledgeEdit:()=>Ei(Fo),onDeleteKnowledge:y=>void tl(De.id,y),onEditKnowledge:Xs,onKnowledgeDraftChange:Ei,onSubmitKnowledge:y=>void jn(De.id,y),onClose:()=>ia(!1)}):null,mu?s.jsx(zA,{conversations:p,onClose:()=>zs(!1),workspaceGroups:$l}):null,Di?s.jsx(LA,{busy:xu||_l,conversation:ai??null,conversationId:on,forceStopBusy:_l,preview:(hi==null?void 0:hi.conversationId)===on?hi:null,previewLoading:pi,result:Ls,status:Fs,warmup:gu,workspaceGroups:$l,onClose:()=>At(!1),onCancelResetPreview:()=>la(null),onForceStop:()=>void jd(),onPreviewReset:()=>void Mu(),onStartBlankContext:()=>void kd(),onResetRuntime:y=>void wd(y),onSaveResetSelection:Sd,onWorkspaceChange:y=>{Ri(y),mi(null),la(null)},onWarmupChange:yu}):null,ie?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!Q&&N(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:xi,onMouseDown:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>N(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:ie.name,onChange:y=>N(k=>k&&{...k,name:y.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:ie.groupId,onChange:y=>N(k=>k&&{...k,groupId:y.target.value}),children:$l.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:Q,onClick:()=>N(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:Q||!ie.name.trim(),type:"submit",children:Q?"Cloning...":"Clone"})]})]})}):null,R?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>q(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:R.title}),s.jsxs("p",{children:[yb(R.status),R.startedAt&&R.finishedAt?` · ${hR(R.startedAt,R.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>q(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:R.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:R.status==="completed"?"Final plan":"Current plan"}),R.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:Tl(R.currentPlan.planMarkdown,De)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:R.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:R.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:R.startedAt?He(R.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:R.finishedAt?He(R.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>q(null),type:"button",children:"Close"})})]})}):null,$?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>V(null),children:s.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:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:$.title}),s.jsx("p",{children:He($.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>V(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(Zo,{content:$.fullDetail??$.detail??"No additional details.",conversation:De,streaming:!1,onPreviewArtifact:Bn,onCopyArtifactUrl:da,copiedArtifactUrl:Mi})}),s.jsxs("footer",{children:[$.linkedTaskId?s.jsx("button",{onClick:()=>{const y=$.linkedTaskId;V(null),zt(y)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>V(null),type:"button",children:"Close"})]})]})}):null,vt?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Fe||rn(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Move Workspace to Recycle"}),s.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:Fe,onClick:()=>rn(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:vt.title})," to recycle?"]}),s.jsx("code",{children:vt.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Fe,onClick:()=>rn(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Fe,onClick:()=>void Iu(vt),type:"button",children:Fe?"Moving...":"Move to recycle"})]})]})}):null,_i?s.jsxs("div",{className:`app-toast ${_i.tone}`,role:"status",children:[s.jsx("strong",{children:_i.text}),_i.detail?s.jsx("pre",{children:_i.detail}):null]}):null,s.jsxs("section",{className:"conversation",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-main",children:[s.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>L(!0),title:"Workspaces",type:"button",children:s.jsx(w2,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(De==null?void 0:De.title)??"New workspace"})}),De?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",Ts(De.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:De?s.jsxs(s.Fragment,{children:[De.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Xr,title:`当前 Thread 工具集已过期(${De.threadCapabilityVersion} / ${De.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(rw,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:Zs,title:"Clone workspace",type:"button",children:s.jsx(v2,{})}),s.jsxs("button",{className:`context-button has-usage ${Lh(Vl??0)}`,onClick:()=>ia(!0),style:{"--context-usage":`${fd(Vl??0)}%`},title:Gl&&Vl!==null?`Context ${Math.round(Vl)}% · ${Ln(Gl.totalTokens)} / ${Xc(Gl.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(Vl??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:el,title:"Workspace settings",type:"button",children:s.jsx(Zx,{})})]}):null})]}),w?s.jsxs("section",{className:`complex-task-bar ${w.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void zt(w.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:w.title}),s.jsx("span",{className:"complex-task-state",children:yb(w.status)}),s.jsx("span",{className:"complex-task-duration",children:pR(w,en)})]}),s.jsxs("div",{className:"complex-task-actions",children:[zp(w.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!w.objective||!w.currentPlan,onClick:()=>void er("start"),title:w.objective&&w.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,w.status==="active"?s.jsx("button",{onClick:()=>void er("pause"),type:"button",children:"Pause"}):null,zp(w.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void er("resume"),type:"button",children:"Resume"}):null,zp(w.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void er("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void er("end"),type:"button",children:"End task"})]})]}):null,(De==null?void 0:De.status)==="initialization_failed"&&De.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:De.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void Lu(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void Pl(),ref:sa,style:{scrollPaddingBottom:Us},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:Us},children:[Ja.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("h2",{children:"Start a workspace"})}):null,s.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[De!=null&&De.cloneLineage&&Gr.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",De.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",He(De.cloneLineage.snapshotAt)," · ",De.cloneLineage.importedMessageCount," messages"]})]}):null,(fo=lt==null?void 0:lt.history)!=null&&fo.hasMoreBefore?s.jsx("div",{className:"history-loader",children:lt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,$r.map((y,k)=>{var pe,Se,be;const j=((pe=y.user)==null?void 0:pe.type)==="system",_=y.turnIds.some(we=>Gr.has(we)),U=$r[k+1],Z=_&&(!U||!U.turnIds.some(we=>Gr.has(we)));return s.jsxs(D.Fragment,{children:[s.jsxs("section",{className:`turn-group${_?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?s.jsxs("div",{className:`turn-panel ${j?"system-turn":"user-turn"}`,children:[Ko(y.user,De,Bn,da,Mi,ir,ar,bt,zt,V),s.jsx(Xo,{copied:ii===`${j?"system":"user"}-${y.id}-bottom`,content:Qo(y.user),id:`${j?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:Hi})]}):null,y.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(we=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),Ko(we,De,Bn,da,Mi,ir,ar,bt,zt,V),s.jsx(Xo,{copied:ii===`user-${we.id}-bottom`,content:Qo(we),id:`user-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Hi})]},we.id))}):null,(Se=y.acceptedSystemInputs)==null?void 0:Se.map(we=>s.jsxs("div",{className:"turn-panel system-turn",children:[Ko(we,De,Bn,da,Mi,ir,ar,bt,zt,V),s.jsx(Xo,{copied:ii===`system-${we.id}-bottom`,content:Qo(we),id:`system-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Hi})]},we.id)),y.agentItems.length>0?s.jsx(dN,{group:y,conversation:De,allowProcessView:!_,copiedFooter:ii===`agent-${y.id}-bottom`,copiedArtifactUrl:Mi,running:!_&&iu(y.turnIds,yi),onCopyArtifactUrl:da,onCopyBubble:Hi,onPreviewArtifact:Bn,onLoadProcessDetails:we=>De&&!_?Hu(De.id,we):void 0,onRespondApproval:ir,onRespondWorkspaceChangeProposal:ar,onRespondKnowledgeProposal:bt,onOpenComplexTask:zt,onOpenSystemEvent:V}):null,(be=y.trailingSystemItems)==null?void 0:be.map(we=>s.jsxs("div",{className:"turn-panel system-turn",children:[Ko(we,De,Bn,da,Mi,ir,ar,bt,zt,V),s.jsx(Xo,{copied:ii===`system-${we.id}-bottom`,content:Qo(we),id:`system-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Hi})]},we.id))]}),Z?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:ba,ref:qs,children:[Yl?s.jsxs("div",{className:`global-activity ${Yl.tone??"running"}`,children:[Vr?s.jsx("button",{"aria-label":"Stop current workspace activity",className:"turn-stop activity-stop",onClick:()=>void as(),title:"Stop current workspace activity",type:"button",children:s.jsx(hN,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:Yl.title}),Yl.detail?s.jsx("small",{children:Yl.detail}):null]}),Vr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":w?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!w||M==="complex",className:`complex-mode-button ${w||M==="complex"?"active":""}`,disabled:!!w,onClick:()=>H(y=>y==="complex"?"simple":"complex"),title:w?"End the current complex task before switching back":M==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(Vv,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:w?"Complex task active":M==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{disabled:Ys.textareaDisabled,onChange:y=>ao(y.target.value),onKeyDown:$u,placeholder:"Cmd/Ctrl + Enter",ref:Ya,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:Ys.sendDisabled,type:"submit",children:[s.jsx(mN,{}),s.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),s.jsxs("span",{children:[s.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),Nt?s.jsx("div",{className:"artifact-lightbox",onClick:()=>Bn(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>Bn(null),type:"button",children:"×"}),s.jsx("img",{alt:Nt.name,src:Nt.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:Nt.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:Nt.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void da(Nt),type:"button",children:Mi===Nt.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function OA({conversation:e,clockNow:i,knowledgeDraft:a,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,S]=D.useState("overview"),[w,E]=D.useState(!1),[M,H]=D.useState(!1),[R,q]=D.useState(null),[$,V]=D.useState(null),[ie,N]=D.useState(!1),[Q,re]=D.useState(null),[ee,L]=D.useState(null),[te,de]=D.useState(!1),[Ne,ye]=D.useState(null),[ue,F]=D.useState(null),oe=ww(u),ve=rh(e,e.status),_e=R?eR(R):null;D.useEffect(()=>{E(!1),q(null),V(null),re(null),L(null),ye(null),F(null)},[e.id]),D.useEffect(()=>{x==="additionalContext"&&!Q&&A()},[x,Q]),D.useEffect(()=>{x==="compactions"&&!Ne&&z()},[x,Ne]);const O=()=>{E(!0),H(!0),V(null),lD(e.id).then(C=>q(C)).catch(C=>{const W=Ge(C);V(W.detail?`${W.message}
|
|
88
|
+
This cancels every current or queued turn and the active complex task, kills its runtime, and repairs scheduler state. Future scheduled wakeups are preserved.`))return;const j=y.id;aa(!0),Vr(j),(_=kn.current.get(j))==null||_.abort(),Sn.current.delete(j),Za.current.delete(j),ki(j,!1);try{const U=await $u(j);fa(j),tt(j,Z=>({...Z,status:U})),xn(j,U),await Cn(j),await nn(),ke("success","Workspace stopped and repaired")}catch(U){Fr(j);const Z=Ge(U);ke("error","Force stop failed",Z.detail??Z.message);try{await nn()}catch(pe){console.warn("Failed to refresh workspace after force Stop failed",pe)}}finally{aa(!1)}}async function ir(y,k){if(!x||!y.approvalTurnId||y.approvalRequestId===void 0)return;const j=x;try{const _=ge(`conversations/${j}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),U=await fetch(_,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!U.ok)throw await fn(U,{method:"POST",url:_});tt(j,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(_){tt(j,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"client.error",data:pr(_),createdAt:new Date().toISOString()}]}));const U=Ge(_);ke("error","Failed to respond to approval",U.detail??U.message)}}async function bt(y,k,j){const _=x,U=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!_||!U)return!1;try{const Z=ge(`conversations/${_}/workspace-change-proposals/${encodeURIComponent(U)}`),pe=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?j??y.workspaceChangePayload:void 0})});if(!pe.ok)throw await fn(pe,{method:"POST",url:Z});const Se=await pe.json(),ve=QE(k,Se.decision),we=ve==="accept"?Se.payload??j??y.workspaceChangePayload:null;return Dn(Se.conversation),tt(_,mt=>({...mt,events:[...mt.events,{id:`${y.id}:${ve}`,event:"server.workspace_change.decision",data:{proposalId:U,changeType:y.workspaceChangeType??"responsibility",decision:ve,payload:we},createdAt:new Date().toISOString()}]})),ke("success",ve==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(Z){console.error(Z);const pe=Ge(Z);return ke("error","Failed to respond to workspace change proposal",pe.detail??pe.message),!1}}async function wa(y,k,j){const _=x;if(!(!_||!y.knowledgeProposalId))try{let U;if(k==="accept")try{U=JSON.parse(j??y.body)}catch{ke("error","Knowledge proposal JSON is invalid");return}const Z=ge(`conversations/${_}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),pe=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:U})});if(!pe.ok)throw await fn(pe,{method:"POST",url:Z});const Se=await pe.json();Bt([...Se.items??[]].sort(ub)),tt(_,ve=>({...ve,events:[...ve.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()}]})),ke("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(U){console.error(U);const Z=Ge(U);ke("error","Failed to respond to knowledge proposal",Z.detail??Z.message)}}function ar(y){Yr(y.id,y.status),jd(y),de(k=>{const j=k[y.id],_=y.events.map(U=>({id:U.id,turnId:U.turnId,seq:U.seq,event:U.event,data:U.data,createdAt:U.createdAt}));return{...k,[y.id]:{messages:y.messages,events:qc(_,(j==null?void 0:j.events)??[]),timelineNodes:Ap(y.timelineNodes??[],(j==null?void 0:j.timelineNodes)??[]),turns:Ep(y.turns??[],(j==null?void 0:j.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:ca(y),loadingOlder:!1,fullEventTurnIds:(j==null?void 0:j.fullEventTurnIds)??new Set,loadingEventTurnIds:(j==null?void 0:j.loadingEventTurnIds)??new Set}}})}function lr(y){const k=ca(y);tt(y.id,j=>{var _,U,Z;return{...j,messages:Tp(y.messages,j.messages),timelineNodes:Ap(y.timelineNodes??[],j.timelineNodes),turns:Ep(y.turns??[],j.turns),events:qc(y.events.map(pe=>({id:pe.id,turnId:pe.turnId,seq:pe.seq,event:pe.event,data:pe.data,createdAt:pe.createdAt})),j.events),contextVersions:(((_=y.contextVersions)==null?void 0:_.length)??0)>0?y.contextVersions??[]:j.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((U=j.history)==null?void 0:U.loadedMessageCount)??j.messages.length),loadedEventCount:k.loadedEventCount+(((Z=j.history)==null?void 0:Z.loadedEventCount)??j.events.length)},loadingOlder:!1}})}function so(y){const k=ca(y),j=y.events.map(_=>({id:_.id,turnId:_.turnId,seq:_.seq,event:_.event,data:_.data,createdAt:_.createdAt}));tt(y.id,_=>{var U,Z,pe;return{..._,messages:Tp(_.messages,y.messages),timelineNodes:Ap(_.timelineNodes,y.timelineNodes??[]),turns:Ep(_.turns,y.turns??[]),events:qc(j,_.events),contextVersions:(((U=y.contextVersions)==null?void 0:U.length)??0)>0?y.contextVersions??[]:_.contextVersions,status:y.status,history:{..._.history??k,messageTotal:k.messageTotal,eventTotal:k.eventTotal,loadedMessageCount:Math.max(((Z=_.history)==null?void 0:Z.loadedMessageCount)??_.messages.length,_.messages.length,y.messages.length),loadedEventCount:Math.max(((pe=_.history)==null?void 0:pe.loadedEventCount)??_.events.length,_.events.length,y.events.length)},loadingOlder:!1}})}function tt(y,k){de(j=>{const _=j[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...j,[y]:k(_)}})}function xn(y,k){g(j=>j.map(_=>_.id===y?{..._,status:k,updatedAt:new Date().toISOString()}:_))}function jd(y){Dn(y)}function Dn(y){g(k=>Yo(k.map(j=>j.id===y.id?{...j,...y}:j)))}async function Cd(y,k){const j=k.filter(_=>{const U=te[y];return U&&!U.fullEventTurnIds.has(_)&&!U.loadingEventTurnIds.has(_)});if(j.length!==0){tt(y,_=>{const U=new Set(_.loadingEventTurnIds);for(const Z of j)U.add(Z);return{..._,loadingEventTurnIds:U}});try{const _=await Promise.all(j.map(U=>OD(y,U)));tt(y,U=>{const Z=new Set(U.fullEventTurnIds),pe=new Set(U.loadingEventTurnIds),Se=_.flatMap((ve,we)=>{const mt=j[we];return Z.add(mt),pe.delete(mt),ve.map(Fe=>({id:Fe.id,turnId:Fe.turnId,seq:Fe.seq,event:Fe.event,data:Fe.data,createdAt:Fe.createdAt}))});return{...U,events:qc(U.events,Se),fullEventTurnIds:Z,loadingEventTurnIds:pe}})}catch(_){console.error(_),tt(y,U=>{const Z=new Set(U.loadingEventTurnIds);for(const pe of j)Z.delete(pe);return{...U,loadingEventTurnIds:Z}}),ke("error","Failed to load process details")}}}function ki(y,k){const j=new Set(Ja.current);k?j.add(y):j.delete(y),Ja.current=j,Va(_=>{const U=new Set(_);return k?U.add(y):U.delete(y),U})}function ka(y){const k=FE({key:y.key,metaKey:y.metaKey,ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,isComposing:y.nativeEvent.isComposing});k&&(y.preventDefault(),li({forceNewTurn:k.forceNewTurn}))}function oo(y){Ii(k=>{const j=new Set(k);return j.has(y)?j.delete(y):j.add(y),wp(j),j})}function ls(y){var k;return XE(y.status,(k=y.nextWakeup)==null?void 0:k.status,Ol.has(y.id))}function rs(y){var _;const k=(_=Mr.current)==null?void 0:_.getBoundingClientRect(),j=k?y-k.left:y;return Ah(j)}function sl(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),Il(rs(y.clientX))}function uo(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),Il(rs(y.clientX)))}function ss(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const k=rs(y.clientX);Il(k),bA(k)}return s.jsxs("main",{className:`shell${ee?" mobile-sidebar-open":""}`,ref:Mr,style:{"--sidebar-width":`${wu}px`},children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),ue?i.role==="admin"?s.jsxs("a",{"aria-label":`Open Seele Host control for Work v${ue}`,className:"work-version-link",href:`${Eh()}admin/host`,title:"Open Seele Host control: versions, restart, and logs",children:["v",ue,s.jsx("span",{"aria-hidden":"true",children:"↗"})]}):s.jsxs("span",{children:["v",ue]}):null,s.jsx("span",{"aria-label":xb(fe),className:`backend-status ${fe}`,"data-label":xb(fe)})]}),s.jsxs("div",{className:"sidebar-title-row",children:[s.jsx("h2",{children:"Workspaces"}),e?s.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]})]}),s.jsxs("div",{className:"sidebar-header-actions",children:[s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>L(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:no,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:$l.map(y=>s.jsxs("section",{className:["workspace-group",Rr===y.id?"dragging":"",vu===y.id?"drop-after":"",(yn==null?void 0:yn.kind)==="group"&&yn.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!Li.has(y.id),className:"workspace-group-toggle",onClick:k=>{if(Ys.current){k.preventDefault(),Ys.current=!1;return}oo(y.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),ts(y)},onPointerCancel:Pi,onPointerDown:k=>Pt(k,y.id),onPointerMove:k=>ht(k,y.id),onPointerUp:k=>Pe(k,y.id),type:"button",children:[s.jsx("span",{className:Li.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),ts(y)},title:"Double-click to rename",children:y.title})]}),y.id!==_x?s.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),il(y)},title:"Delete group",type:"button",children:"×"}):null]}),Li.has(y.id)?null:s.jsx("div",{className:"workspace-group-items",children:y.conversations.map(k=>{const j=ls(k);return s.jsxs("div",{className:["session-item",k.id===x?"active":"",k.id===Dr?"dragging":"",(yn==null?void 0:yn.kind)==="workspace"&&yn.id===k.id?`drop-${yn.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:_=>{if(Fs.current){_.preventDefault(),Fs.current=!1;return}es(k.id),L(!1)},onDoubleClick:_=>{bi(_.target)||(_.preventDefault(),al(k))},onKeyDown:_=>{An(_.target)||_.key==="Enter"&&(es(k.id),L(!1))},onPointerCancel:Bu,onPointerDown:_=>Uu(_,k.id),onPointerMove:_=>io(_,k.id),onPointerUp:_=>ao(_,k.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":Xc(j,k.nextWakeup,en),className:`session-status ${j}`,title:Xc(j,k.nextWakeup,en)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),j==="waiting"&&k.nextWakeup?s.jsx("span",{className:"session-countdown",title:Xc(j,k.nextWakeup,en),children:ad(k.nextWakeup,en)}):null,k.unreadTurnCount>0?s.jsx("span",{"aria-label":`${k.unreadTurnCount} unread turns`,className:"session-unread",title:`${k.unreadTurnCount} unread turns`,children:k.unreadTurnCount>99?"99+":k.unreadTurnCount}):null,j!=="running"?s.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:_=>{_.stopPropagation(),rn(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",Ns(k.id)]})]},k.id)})})]},y.id))}),s.jsx("footer",{className:"sidebar-footer",children:s.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[s.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:ha,type:"button",children:s.jsx(Zx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Iu,type:"button",children:s.jsx(k2,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{Us(!0),L(!1)},type:"button",children:s.jsx(Pc,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Kr,type:"button",children:s.jsx(S2,{})}),s.jsx(CN,{usage:Tu})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>L(!1),tabIndex:ee?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:sl,onPointerMove:uo,onPointerUp:ss,role:"separator",tabIndex:0}),Br&&Ll?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Ll.x+12}px, ${Ll.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:Br.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",Ns(Br.id)]})]}):null,xe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:tr,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:tr,onSubmit:y=>void qu(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:Nn,onKeyDown:tr,value:xe.title}),xe.mode==="create"?s.jsxs(s.Fragment,{children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),s.jsx("select",{id:"workspace-group",onChange:lo,onKeyDown:tr,value:xe.groupId??((fo=m[0])==null?void 0:fo.id)??"",children:m.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:xi,children:"Cancel"}),s.jsx("button",{disabled:Ve,type:"submit",children:Ve?"Saving...":xe.mode==="create"?"Create":"Save"})]})]})}):null,It?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:wi,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:wi,onSubmit:y=>void ll(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),s.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:Wi,onKeyDown:wi,value:It.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:Yi,children:"Cancel"}),s.jsx("button",{type:"submit",children:It.mode==="create"?"Create":"Save"})]})]})}):null,Le?s.jsx(BA,{currentUser:i,conversations:p,editingEnvironmentKey:Er,deploymentSettings:Ia,environmentDraft:$a,globalEnvironment:mn,workspaceEnvironment:Ti,memorySettings:pu,memorySettingsDraft:zs,workspaceMemoryDraft:hu,runtimeSettings:La,runtimeModels:ce,runtimeCodexVersion:Ue,runtimeCodexReleasedAt:Vt,runtimeCodexUpdating:(ct==null?void 0:ct.status)==="running",runtimeSettingsDraft:Ai,runtimeSettingsScope:Jt,settingsWorkspace:Mt,settingsWorkspaceId:wt,systemDiagnostics:_e,systemDiagnosticsLoading:A,workspaceGroups:$l,workspaceRuntimeSettings:qa,workspaceRuntimeSettingsDraft:Os,managedUsers:oe,onCancelEnvironmentEdit:Zr,onClose:()=>Ut(!1),onCreateUser:async y=>{const k=await SR(y);be(j=>[...j,k]),ke("success","User created")},onDeleteUser:async y=>{await CR(y),be(k=>k.filter(j=>j.id!==y)),ke("success","User deleted")},onSaveDeploymentSettings:_u,onDeleteEnvironment:y=>void Xr(y),onDraftChange:Ga,onEditEnvironment:Qr,onRevealEnvironmentValue:y=>void eo(y),onSaveBaseMemoryItems:y=>zu(y),onSaveResponsibility:async(y,k)=>{try{const j=await Gc(y,{responsibility:k});return Dn(j),X("connected"),ke("success","Workspace responsibility saved"),j.responsibility}catch(j){throw console.error(j),X("error"),ke("error","Failed to save workspace responsibility"),j}},onSaveWorkspaceMemoryItems:y=>wt?Zs(wt,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:Ua,onCodexAccountSwitched:async()=>{ke("success","Codex account switched"),(await Ew()).codexAccountsReady&&await Promise.all([Pr(!0),Kl(!0),Wr()])},onUpdateCodexCli:()=>{Et(!0),Xl(!0)},onRuntimeScopeChange:Ba,onSettingsWorkspaceChange:ma,onSubmitRuntimeSettings:y=>void Ru(y),onWorkspaceRuntimeDraftChange:Ha,onWorkspaceRuntimeReset:y=>wt?void Ou(wt,y):void 0,revealedEnvironmentKeys:Is,onSubmitEnvironment:y=>void $n(y),onRefreshSystemDiagnostics:()=>void Zl(),onUpdateUser:async(y,k)=>{const j=await jR(y,k);be(_=>_.map(U=>U.id===j.id?j:U)),ke("success","User updated")}}):null,Ft?s.jsx(UA,{currentReleasedAt:Vt,currentVersion:Ue,job:ct,latest:pd,latestChecking:Cr,starting:Ei,onClose:()=>Et(!1),onRefresh:()=>void Xl(),onStart:()=>void bd()}):null,Ri&&De?s.jsx(OA,{conversation:De,clockNow:en,knowledgeDraft:Bn,workspaceKnowledge:Yt,tokenUsage:Gl,onCancelKnowledgeEdit:()=>Ni(Fo),onDeleteKnowledge:y=>void nl(De.id,y),onEditKnowledge:Js,onKnowledgeDraftChange:Ni,onSubmitKnowledge:y=>void jn(De.id,y),onClose:()=>ia(!1)}):null,mu?s.jsx(zA,{conversations:p,onClose:()=>Us(!1),workspaceGroups:$l}):null,_i?s.jsx(LA,{busy:xu||Ml,conversation:ni??null,conversationId:on,forceStopBusy:Ml,preview:(pi==null?void 0:pi.conversationId)===on?pi:null,previewLoading:fi,result:Bs,status:Ws,warmup:gu,workspaceGroups:$l,onClose:()=>At(!1),onCancelResetPreview:()=>la(null),onForceStop:()=>void Sd(),onPreviewReset:()=>void Mu(),onStartBlankContext:()=>void wd(),onResetRuntime:y=>void vd(y),onSaveResetSelection:kd,onWorkspaceChange:y=>{Mi(y),hi(null),la(null)},onWarmupChange:yu}):null,ie?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!Q&&N(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:yi,onMouseDown:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>N(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:ie.name,onChange:y=>N(k=>k&&{...k,name:y.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:ie.groupId,onChange:y=>N(k=>k&&{...k,groupId:y.target.value}),children:$l.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:Q,onClick:()=>N(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:Q||!ie.name.trim(),type:"submit",children:Q?"Cloning...":"Clone"})]})]})}):null,R?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>q(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:R.title}),s.jsxs("p",{children:[yb(R.status),R.startedAt&&R.finishedAt?` · ${hR(R.startedAt,R.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>q(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:R.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:R.status==="completed"?"Final plan":"Current plan"}),R.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:El(R.currentPlan.planMarkdown,De)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:R.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:R.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:R.startedAt?He(R.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:R.finishedAt?He(R.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>q(null),type:"button",children:"Close"})})]})}):null,$?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>V(null),children:s.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:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:$.title}),s.jsx("p",{children:He($.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>V(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(Zo,{content:$.fullDetail??$.detail??"No additional details.",conversation:De,streaming:!1,onPreviewArtifact:qn,onCopyArtifactUrl:da,copiedArtifactUrl:zi})}),s.jsxs("footer",{children:[$.linkedTaskId?s.jsx("button",{onClick:()=>{const y=$.linkedTaskId;V(null),Ot(y)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>V(null),type:"button",children:"Close"})]})]})}):null,vt?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Ye||rn(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Move Workspace to Recycle"}),s.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:Ye,onClick:()=>rn(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:vt.title})," to recycle?"]}),s.jsx("code",{children:vt.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Ye,onClick:()=>rn(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Ye,onClick:()=>void Tn(vt),type:"button",children:Ye?"Moving...":"Move to recycle"})]})]})}):null,Oi?s.jsxs("div",{className:`app-toast ${Oi.tone}`,role:"status",children:[s.jsx("strong",{children:Oi.text}),Oi.detail?s.jsx("pre",{children:Oi.detail}):null]}):null,s.jsxs("section",{className:"conversation",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-main",children:[s.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>L(!0),title:"Workspaces",type:"button",children:s.jsx(w2,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(De==null?void 0:De.title)??"New workspace"})}),De?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",Ns(De.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:De?s.jsxs(s.Fragment,{children:[De.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Kr,title:`当前 Thread 工具集已过期(${De.threadCapabilityVersion} / ${De.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(rw,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:to,title:"Clone workspace",type:"button",children:s.jsx(v2,{})}),s.jsxs("button",{className:`context-button has-usage ${Lh(Vl??0)}`,onClick:()=>ia(!0),style:{"--context-usage":`${dd(Vl??0)}%`},title:Gl&&Vl!==null?`Context ${Math.round(Vl)}% · ${In(Gl.totalTokens)} / ${Kc(Gl.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(Vl??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:tl,title:"Workspace settings",type:"button",children:s.jsx(Zx,{})})]}):null})]}),w?s.jsxs("section",{className:`complex-task-bar ${w.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void Ot(w.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:w.title}),s.jsx("span",{className:"complex-task-state",children:yb(w.status)}),s.jsx("span",{className:"complex-task-duration",children:pR(w,en)})]}),s.jsxs("div",{className:"complex-task-actions",children:[zp(w.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!w.objective||!w.currentPlan,onClick:()=>void er("start"),title:w.objective&&w.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,w.status==="active"?s.jsx("button",{onClick:()=>void er("pause"),type:"button",children:"Pause"}):null,zp(w.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void er("resume"),type:"button",children:"Resume"}):null,zp(w.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void er("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void er("end"),type:"button",children:"End task"})]})]}):null,(De==null?void 0:De.status)==="initialization_failed"&&De.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:De.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void Lu(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void Pl(),ref:sa,style:{scrollPaddingBottom:Hs},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:Hs},children:[el.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("h2",{children:"Start a workspace"})}):null,s.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[De!=null&&De.cloneLineage&&$r.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",De.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",He(De.cloneLineage.snapshotAt)," · ",De.cloneLineage.importedMessageCount," messages"]})]}):null,(Ki=lt==null?void 0:lt.history)!=null&&Ki.hasMoreBefore?s.jsx("div",{className:"history-loader",children:lt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,Hr.map((y,k)=>{var pe,Se,ve;const j=((pe=y.user)==null?void 0:pe.type)==="system",_=y.turnIds.some(we=>$r.has(we)),U=Hr[k+1],Z=_&&(!U||!U.turnIds.some(we=>$r.has(we)));return s.jsxs(D.Fragment,{children:[s.jsxs("section",{className:`turn-group${_?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?s.jsxs("div",{className:`turn-panel ${j?"system-turn":"user-turn"}`,children:[Ko(y.user,De,qn,da,zi,ir,bt,wa,Ot,V),s.jsx(Xo,{copied:ti===`${j?"system":"user"}-${y.id}-bottom`,content:Qo(y.user),id:`${j?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:Gi})]}):null,y.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(we=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),Ko(we,De,qn,da,zi,ir,bt,wa,Ot,V),s.jsx(Xo,{copied:ti===`user-${we.id}-bottom`,content:Qo(we),id:`user-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Gi})]},we.id))}):null,(Se=y.acceptedSystemInputs)==null?void 0:Se.map(we=>s.jsxs("div",{className:"turn-panel system-turn",children:[Ko(we,De,qn,da,zi,ir,bt,wa,Ot,V),s.jsx(Xo,{copied:ti===`system-${we.id}-bottom`,content:Qo(we),id:`system-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Gi})]},we.id)),y.agentItems.length>0?s.jsx(dN,{group:y,conversation:De,allowProcessView:!_,copiedFooter:ti===`agent-${y.id}-bottom`,copiedArtifactUrl:zi,running:!_&&iu(y.turnIds,gi),onCopyArtifactUrl:da,onCopyBubble:Gi,onPreviewArtifact:qn,onLoadProcessDetails:we=>De&&!_?Cd(De.id,we):void 0,onRespondApproval:ir,onRespondWorkspaceChangeProposal:bt,onRespondKnowledgeProposal:wa,onOpenComplexTask:Ot,onOpenSystemEvent:V}):null,(ve=y.trailingSystemItems)==null?void 0:ve.map(we=>s.jsxs("div",{className:"turn-panel system-turn",children:[Ko(we,De,qn,da,zi,ir,bt,wa,Ot,V),s.jsx(Xo,{copied:ti===`system-${we.id}-bottom`,content:Qo(we),id:`system-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Gi})]},we.id))]}),Z?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:ro,ref:Gs,children:[Yl?s.jsxs("div",{className:`global-activity ${Yl.tone??"running"}`,children:[Gr?s.jsx("button",{"aria-label":"Stop current workspace activity",className:"turn-stop activity-stop",onClick:()=>void Hu(),title:"Stop current workspace activity",type:"button",children:s.jsx(hN,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:Yl.title}),Yl.detail?s.jsx("small",{children:Yl.detail}):null]}),Gr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":w?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!w||M==="complex",className:`complex-mode-button ${w||M==="complex"?"active":""}`,disabled:!!w,onClick:()=>H(y=>y==="complex"?"simple":"complex"),title:w?"End the current complex task before switching back":M==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(Vv,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:w?"Complex task active":M==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{disabled:Ks.textareaDisabled,onChange:y=>nr(y.target.value),onKeyDown:ka,placeholder:"Cmd/Ctrl + Enter",ref:Ya,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:Ks.sendDisabled,type:"submit",children:[s.jsx(mN,{}),s.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),s.jsxs("span",{children:[s.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),Nt?s.jsx("div",{className:"artifact-lightbox",onClick:()=>qn(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>qn(null),type:"button",children:"×"}),s.jsx("img",{alt:Nt.name,src:Nt.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:Nt.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:Nt.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void da(Nt),type:"button",children:zi===Nt.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function OA({conversation:e,clockNow:i,knowledgeDraft:a,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,S]=D.useState("overview"),[w,E]=D.useState(!1),[M,H]=D.useState(!1),[R,q]=D.useState(null),[$,V]=D.useState(null),[ie,N]=D.useState(!1),[Q,re]=D.useState(null),[ee,L]=D.useState(null),[te,de]=D.useState(!1),[Ne,ye]=D.useState(null),[ue,F]=D.useState(null),oe=ww(u),be=rh(e,e.status),_e=R?eR(R):null;D.useEffect(()=>{E(!1),q(null),V(null),re(null),L(null),ye(null),F(null)},[e.id]),D.useEffect(()=>{x==="additionalContext"&&!Q&&A()},[x,Q]),D.useEffect(()=>{x==="compactions"&&!Ne&&z()},[x,Ne]);const O=()=>{E(!0),H(!0),V(null),lD(e.id).then(C=>q(C)).catch(C=>{const W=Ge(C);V(W.detail?`${W.message}
|
|
89
89
|
${W.detail}`:W.message)}).finally(()=>H(!1))},A=()=>{N(!0),L(null),sD(e.id).then(C=>re(C)).catch(C=>{const W=Ge(C);L(W.detail?`${W.message}
|
|
90
90
|
${W.detail}`:W.message)}).finally(()=>N(!1))},z=()=>{de(!0),F(null),oD(e.id).then(C=>ye(C)).catch(C=>{const W=Ge(C);F(W.detail?`${W.message}
|
|
91
|
-
${W.detail}`:W.message)}).finally(()=>de(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:C=>C.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>S("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>S("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>S("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>S("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>S("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>S("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:x==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${ve}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:Qc(ve,e.nextWakeup,i)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(Je,{label:"Wake at",value:su(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:ld(e.nextWakeup,i)}):null,s.jsx(Je,{label:"Created by",value:e.nextWakeup.createdBy}),s.jsx(Je,{label:"Attempts",value:`${e.nextWakeup.attemptCount} / ${e.nextWakeup.maxAttempts}`,mono:!0}),s.jsxs("div",{className:"workspace-status-detail-text",children:[s.jsx("span",{children:"Wakeup instruction"}),s.jsx("pre",{children:e.nextWakeup.instruction})]}),e.nextWakeup.error?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Wakeup error"}),s.jsx("pre",{children:e.nextWakeup.error})]}):null]}):null,e.statusError?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Error"}),s.jsx("pre",{children:e.statusError})]}):e.status==="error"||e.status==="initialization_failed"?s.jsx("p",{className:"context-muted",children:"No persisted error detail is available for this status."}):null]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Workspace"}),s.jsx(Je,{label:"Name",value:e.title}),s.jsx(Je,{label:"ID",value:`workspaces/${Ts(e.id)}`,mono:!0}),s.jsx(Je,{label:"Path",value:e.workspacePath,mono:!0})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Context Assets"}),s.jsx(Je,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),s.jsx(Je,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),s.jsx(Je,{label:"Knowledge",value:`${r.length} item${r.length===1?"":"s"}`})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Current Responsibility"}),e.responsibility.trim()?s.jsx("div",{className:"context-markdown-preview",children:Tl(e.responsibility,e)}):s.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Knowledge Index"}),s.jsx(Gv,{items:r,onDelete:d,onEdit:C=>{p(C),S("knowledge")}})]})]}):x==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:Tl(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(tN,{draft:a,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):x==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Je,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:M,onClick:O,type:"button",children:M?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:M,onClick:()=>E(!1),type:"button",children:"Hide"}):null]})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Token Window"}),u?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Used",value:oe===null?"unknown":`${Math.round(oe)}%`,mono:!0}),s.jsx(Je,{label:"Latest usage",value:u.modelContextWindow?`${Ln(u.totalTokens)} / ${Ln(u.modelContextWindow)}`:Ln(u.totalTokens),mono:!0}),oe!==null?s.jsx("div",{className:`context-token-bar ${Lh(oe)}`,children:s.jsx("span",{style:{width:`${fd(oe)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${Xc(u.inputTokens)} / ${Xc(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:Xc(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",He(u.createdAt),"."]})]}):s.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),w?s.jsxs("section",{className:"context-card wide thread-read-panel",children:[s.jsx("h3",{children:"Runtime thread profile"}),s.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),M?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):$?s.jsx("pre",{className:"thread-read-error",children:$}):R?s.jsxs(s.Fragment,{children:[_e?s.jsx(oN,{summary:_e}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(R,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):x==="compactions"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Context Compactions"}),s.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),s.jsx("button",{className:"context-refresh-button",disabled:te,onClick:z,type:"button",children:te?"Refreshing...":"Refresh"})]}),ue?s.jsx("pre",{className:"thread-read-error",children:ue}):te&&!Ne?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ne!=null&&Ne.length?s.jsx("div",{className:"context-compaction-list",children:Ne.map(C=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:He(C.completedAt??C.usageObservedAt??C.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${C.status}`,children:C.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:PD(C).map(W=>s.jsxs("div",{children:[s.jsx("dt",{children:W.label}),s.jsx("dd",{children:W.value})]},W.label))}),s.jsxs("small",{children:[Al(C.id),C.turnId?` · turn ${Al(C.turnId)}`:""]})]},C.id))}):s.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):s.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Additional Context"}),s.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),ie?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):ee?s.jsx("pre",{className:"thread-read-error",children:ee}):Q?s.jsx(rN,{preview:Q,refreshing:ie,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function zA({conversations:e,onClose:i,workspaceGroups:a}){var O;const[r,u]=D.useState([]),[c,d]=D.useState("active"),[p,g]=D.useState(null),[m,b]=D.useState([]),[x,S]=D.useState(!0),[w,E]=D.useState(null),[M,H]=D.useState(null),[R,q]=D.useState(!1),[$,V]=D.useState(!1),[ie,N]=D.useState(new Set),[Q,re]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),ee=r.find(A=>A.id===p)??null,L=D.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),te=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),de=a.map(A=>({...A,conversations:A.conversations.filter(z=>z.id!==Q.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Ne=()=>{var A;re({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),N(new Set),H("create")},ye=()=>{!ee||ee.status!=="active"||(re({title:ee.title,publicDescription:ee.publicDescription,ownerWorkspaceId:ee.ownerWorkspaceId,participantWorkspaceIds:ee.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),N(new Set),H("edit"))},ue=async(A,z=c)=>{var C;S(!0),E(null);try{const W=await nb();u(W);const fe=W.filter(xe=>z==="archived"?xe.status==="archived":xe.status!=="archived"),X=(A&&fe.some(xe=>xe.id===A)?A:null)??(p&&fe.some(xe=>xe.id===p)?p:((C=fe[0])==null?void 0:C.id)??null);g(X),b(X?await Gc(X):[])}catch(W){E(W instanceof Ji?W.detail:W instanceof Error?W.message:String(W))}finally{S(!1)}};D.useEffect(()=>{ue()},[]),D.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const z=await nb();u(z),p&&z.some(C=>C.id===p)&&b(await Gc(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const F=async A=>{g(A),E(null);try{b(await Gc(A))}catch(z){E(z instanceof Ji?z.detail:z instanceof Error?z.message:String(z))}},oe=async A=>{var C;if(A===c)return;d(A),E(null);const z=((C=r.find(W=>A==="archived"?W.status==="archived":W.status!=="archived"))==null?void 0:C.id)??null;if(g(z),!z){b([]);return}try{b(await Gc(z))}catch(W){E(W instanceof Ji?W.detail:W instanceof Error?W.message:String(W))}},ve=async A=>{var z;if(A.preventDefault(),!(!Q.title.trim()||!Q.ownerWorkspaceId)){V(!0),E(null);try{const C=M==="edit"&&ee?await _2(ee.id,{expectedVersion:ee.version,title:Q.title.trim(),publicDescription:Q.publicDescription.trim(),participantWorkspaceIds:Q.participantWorkspaceIds}):await R2({...Q,title:Q.title.trim(),publicDescription:Q.publicDescription.trim()});d("active"),H(null),re({title:"",publicDescription:"",ownerWorkspaceId:((z=e[0])==null?void 0:z.id)??"",participantWorkspaceIds:[]}),await ue(C.id,"active")}catch(C){E(C instanceof Ji?C.detail:C instanceof Error?C.message:String(C))}finally{V(!1)}}},_e=async()=>{if(!(!ee||ee.status!=="active")){V(!0),E(null);try{const A=await M2(ee.id,ee.version);q(!1),d("active"),await ue(void 0,"active")}catch(A){E(A instanceof Ji?A.detail:A instanceof Error?A.message:String(A))}finally{V(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"协作"}),s.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),s.jsxs("div",{className:"collaboration-header-actions",children:[s.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Ne,title:"新建 Topic",type:"button",children:"+"}),s.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),w?s.jsx("div",{className:"collaboration-error",children:w}):null,s.jsxs("div",{className:"collaboration-body",children:[s.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[s.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[s.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void oe("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void oe("archived"),role:"tab",type:"button",children:"已归档"})]}),x?s.jsx("p",{children:"正在加载..."}):te.length===0?s.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):te.map(A=>s.jsxs("button",{className:`collaboration-topic-entry${A.id===p?" active":""}`,onClick:()=>void F(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:ee?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:ee.title}),s.jsx("p",{children:ee.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:ee.status}),ee.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${ee.title}`,className:"memory-icon-button",onClick:ye,title:"编辑",type:"button",children:s.jsx(dd,{})}),s.jsx("button",{"aria-label":`归档 Topic ${ee.title}`,className:"memory-icon-button",onClick:()=>q(!0),title:"归档",type:"button",children:s.jsx(j2,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:ee.members.filter(A=>A.status==="active").map(A=>s.jsxs("span",{children:[A.workspaceTitleSnapshot,s.jsx("small",{children:A.role})]},`${A.workspaceId}-${A.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(A=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:A.senderTitleSnapshot}),s.jsx("span",{children:A.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${uw(A.recipientWorkspaceIds.map(z=>L.get(z)??Al(z)))}`}),s.jsx("time",{children:He(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:Tl(A.contentMarkdown,void 0)})]},A.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),M?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!$&&H(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:ve,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:M==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:M==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>H(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:Q.title,onChange:A=>re(z=>({...z,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:Q.publicDescription,onChange:A=>re(z=>({...z,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:M==="edit",value:Q.ownerWorkspaceId,onChange:A=>re(z=>({...z,ownerWorkspaceId:A.target.value,participantWorkspaceIds:z.participantWorkspaceIds.filter(C=>C!==A.target.value)})),children:a.map(A=>s.jsx("optgroup",{label:A.title,children:A.conversations.map(z=>s.jsx("option",{value:z.id,children:z.title},z.id))},A.id))})]}),s.jsxs("fieldset",{className:"collaboration-participant-groups",children:[s.jsx("legend",{children:"参与工作空间"}),s.jsxs("div",{className:"collaboration-participant-toolbar",children:[s.jsxs("span",{children:[Q.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>N(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>N(new Set(de.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),de.map(A=>{const z=A.conversations,C=z.filter(fe=>Q.participantWorkspaceIds.includes(fe.id)).length,W=ie.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!W,className:"collaboration-group-toggle",onClick:()=>N(fe=>{const X=new Set(fe);return X.has(A.id)?X.delete(A.id):X.add(A.id),X}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:W?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[C,"/",z.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:C===z.length,onChange:()=>re(fe=>{const X=z.map(Me=>Me.id),xe=new Set(fe.participantWorkspaceIds);return X.every(Me=>xe.has(Me))?X.forEach(Me=>xe.delete(Me)):X.forEach(Me=>xe.add(Me)),{...fe,participantWorkspaceIds:Array.from(xe)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),W?null:s.jsx("div",{children:z.map(fe=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:Q.participantWorkspaceIds.includes(fe.id),onChange:X=>re(xe=>({...xe,participantWorkspaceIds:X.target.checked?[...xe.participantWorkspaceIds,fe.id]:xe.participantWorkspaceIds.filter(Me=>Me!==fe.id)})),type:"checkbox"}),s.jsx("span",{children:fe.title})]},fe.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>H(null),type:"button",children:"取消"}),s.jsx("button",{disabled:$||!Q.title.trim()||!Q.ownerWorkspaceId,type:"submit",children:$?"正在保存...":M==="edit"?"保存":"创建 Topic"})]})]})}):null,R&&ee?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!$&&q(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>q(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:ee.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>q(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:$,onClick:()=>void _e(),type:"button",children:$?"正在归档...":"归档"})]})]})}):null]})})}function LA({busy:e,conversation:i,conversationId:a,forceStopBusy:r,preview:u,previewLoading:c,result:d,status:p,warmup:g,workspaceGroups:m,onCancelResetPreview:b,onClose:x,onForceStop:S,onPreviewReset:w,onStartBlankContext:E,onResetRuntime:M,onSaveResetSelection:H,onWorkspaceChange:R,onWarmupChange:q}){const $=!i||e||p==="running"||p==="initializing";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:x,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:V=>V.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header console-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Console"}),s.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),s.jsxs("div",{className:"console-header-actions",children:[s.jsxs("label",{className:"console-workspace-picker",children:[s.jsx("span",{children:"Workspace"}),s.jsx("select",{disabled:e,onChange:V=>R(V.target.value),value:a??"",children:m.map(V=>s.jsx("optgroup",{label:V.title,children:V.conversations.map(ie=>s.jsxs("option",{value:ie.id,children:[ie.title," · workspaces/",Ts(ie.id)]},ie.id))},V.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:x,type:"button",children:"×"})]})]}),s.jsx("div",{className:"console-body",children:s.jsxs("section",{className:"console-card",children:[s.jsxs("div",{className:"console-card-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Runtime"}),s.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),s.jsx("span",{className:`console-status ${p}`,children:p})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:i?`workspaces/${Ts(i.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:g,onChange:V=>q(V.target.checked),type:"checkbox"}),s.jsxs("span",{children:["Run a warmup turn after reset",s.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),s.jsxs("div",{className:"console-actions",children:[s.jsx("button",{className:"danger",disabled:!i||r,onClick:S,title:"Kill the workspace runtime and repair every non-terminal scheduler state",type:"button",children:r?"Stopping & repairing...":"Force stop & repair"}),s.jsx("button",{className:"danger",disabled:$||c,onClick:w,type:"button",children:c?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:$||c,onClick:E,type:"button",children:"Clear memory & start blank"}),p==="running"||p==="initializing"?s.jsx("span",{children:"Force stop the active workspace operation before resetting."}):null]}),d?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:d.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[d.injectedItemCount," visible history items injected"]}),d.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",d.historyBatchCount," chronological batches with ",d.historyCompactionCount," native compactions"]}):null,d.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",d.newThreadId]}),d.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",d.warmupTurnId]}):null]}):null]})}),u?s.jsx(IA,{busy:e,preview:u,warmup:g,onCancel:b,onConfirm:M,onSaveSelection:H}):null]})})}function IA({busy:e,preview:i,warmup:a,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=D.useState(()=>new Set(i.entries.filter(L=>L.includedByDefault).map(L=>L.id))),[g,m]=D.useState(!1),[b,x]=D.useState(!1),[S,w]=D.useState(null),E=D.useRef(null),M=i.entries.filter(L=>d.has(L.id)),H=M.filter(L=>L.role==="user").length,R=M.length-H,q=i.entries.filter(L=>L.topicRelation!==null).map(L=>L.id),$=q.filter(L=>d.has(L)).length,V=i.entries.length>0&&d.size===i.entries.length;D.useEffect(()=>{E.current&&(E.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const ie=e||b;async function N(L){x(!0),w(null);try{await c(i.entries.filter(te=>L.has(te.id)).map(te=>te.id)),p(L)}catch(te){w(Ge(te).message)}finally{x(!1)}}function Q(L,te){const de=new Set(d);te?de.add(L):de.delete(L),N(de)}function re(){const L=new Set(d);q.forEach(te=>L.add(te)),N(L)}function ee(){const L=new Set(d);q.forEach(te=>{L.has(te)?L.delete(te):L.add(te)}),N(L)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:ie?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:L=>L.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(L=>!L),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:ie,onClick:r,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:V,disabled:ie||i.entries.length===0,onChange:L=>void N(L.target.checked?new Set(i.entries.map(te=>te.id)):new Set),ref:E,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[H," user"]}),s.jsxs("span",{children:[R," assistant"]}),q.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[$," of ",q.length," Topic input + response"]}),s.jsx("button",{disabled:ie||$===q.length,onClick:re,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:ie,onClick:ee,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:a?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,S?s.jsx("span",{className:"reset-preview-selection-error",children:S}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((L,te)=>s.jsxs("article",{className:`reset-preview-item ${L.role} ${d.has(L.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${L.role} message ${te+1}`,checked:d.has(L.id),disabled:ie,onChange:de=>Q(L.id,de.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:L.role}),L.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",L.topicRelation]}):null,s.jsx("time",{dateTime:L.createdAt,children:He(L.createdAt)})]}),s.jsx("pre",{children:L.content})]},L.id)):s.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),s.jsxs("footer",{className:"reset-preview-actions",children:[s.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:ie,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:ie,onClick:()=>u(i.entries.filter(L=>d.has(L.id)).map(L=>L.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function UA({currentReleasedAt:e,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&sR(r.version,m)?rR(r.version):null;return D.useEffect(()=>{const x=S=>{S.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:a?`status-${a.status}`:void 0,children:(a==null?void 0:a.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:lh(m,(a==null?void 0:a.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?lh(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?s.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),a?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:He(a.startedAt)})]}):null]}),r!=null&&r.error?s.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",r.error]}):null,s.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:a!=null&&a.logs.length?a.logs.map((x,S)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:lR(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${S}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.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 BA({currentUser:e,conversations:i,deploymentSettings:a,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,workspaceEnvironment:d,memorySettings:p,memorySettingsDraft:g,managedUsers:m,workspaceMemoryDraft:b,runtimeSettings:x,runtimeModels:S,runtimeCodexVersion:w,runtimeCodexReleasedAt:E,runtimeCodexUpdating:M,runtimeSettingsDraft:H,runtimeSettingsScope:R,settingsWorkspace:q,settingsWorkspaceId:$,systemDiagnostics:V,systemDiagnosticsLoading:ie,workspaceGroups:N,workspaceRuntimeSettings:Q,workspaceRuntimeSettingsDraft:re,onCancelEnvironmentEdit:ee,onClose:L,onCreateUser:te,onDeleteUser:de,onDeleteEnvironment:Ne,onDraftChange:ye,onEditEnvironment:ue,onSaveBaseMemoryItems:F,onSaveDeploymentSettings:oe,onSaveResponsibility:ve,onSaveWorkspaceMemoryItems:_e,onRevealEnvironmentValue:O,onRuntimeDraftChange:A,onCodexAccountSwitched:z,onUpdateCodexCli:C,onRuntimeScopeChange:W,onSettingsWorkspaceChange:fe,onSubmitRuntimeSettings:X,onSubmitEnvironment:xe,onRefreshSystemDiagnostics:Me,onUpdateUser:Ve,onWorkspaceRuntimeDraftChange:Ct,onWorkspaceRuntimeReset:vt,revealedEnvironmentKeys:rn}){const[Fe,St]=D.useState("model"),[Ut,sn]=D.useState(!1),[Le,Bt]=D.useState(null),[hn,Xt]=D.useState(!1),[ji,Jn]=D.useState((q==null?void 0:q.responsibility)??""),[La,Mt]=D.useState(!1),Ia=D.useRef(null),ae=R==="workspace"?Object.values((Q==null?void 0:Q.sources)??{}).filter(ce=>ce==="workspace").length:0;return D.useEffect(()=>{R==="global"&&Xt(!1)},[R]),D.useEffect(()=>{Jn((q==null?void 0:q.responsibility)??"")},[q==null?void 0:q.id,q==null?void 0:q.responsibility]),D.useEffect(()=>{if(!hn)return;const ce=Ue=>{var Ft;const Xe=Ue.target;Xe instanceof Node&&((Ft=Ia.current)!=null&&Ft.contains(Xe))||Xt(!1)},Ee=Ue=>{Ue.key==="Escape"&&Xt(!1)};return document.addEventListener("pointerdown",ce,!0),document.addEventListener("keydown",Ee,!0),()=>{document.removeEventListener("pointerdown",ce,!0),document.removeEventListener("keydown",Ee,!0)}},[hn]),s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:L,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:ce=>ce.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Fe!=="system"&&Fe!=="users"&&Fe!=="accounts"&&Fe!=="deployment"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":R==="global",className:R==="global"?"active":void 0,onClick:()=>W("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:Ia,children:[s.jsx("button",{"aria-checked":R==="workspace","aria-expanded":R==="workspace"?hn:void 0,"aria-label":R==="workspace"?"Settings workspace target":void 0,className:R==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(R!=="workspace"){W("workspace");return}Xt(ce=>!ce)},role:"radio",type:"button",children:R==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(q==null?void 0:q.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),R==="workspace"&&hn?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:N.map(ce=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:ce.title}),ce.conversations.map(Ee=>s.jsxs("button",{"aria-selected":Ee.id===$,className:Ee.id===$?"selected":void 0,onClick:()=>{fe(Ee.id),Xt(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ee.title}),s.jsxs("small",{children:["workspaces/",Ee.id]})]},Ee.id))]},ce.id))}):null]})]}):null]}),s.jsx("div",{className:"settings-header-actions",children:s.jsx("button",{"aria-label":"Close settings panel",onClick:L,type:"button",children:"×"})})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Fe==="model"?"active":void 0,onClick:()=>St("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Fe==="responsibility"?"active":void 0,onClick:()=>St("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Fe==="memory"?"active":void 0,onClick:()=>St("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Fe==="environment"?"active":void 0,onClick:()=>St("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Fe==="accounts"?"active":void 0,onClick:()=>St("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Cloud login + active account"})]}),s.jsxs("button",{className:Fe==="deployment"?"active":void 0,onClick:()=>St("deployment"),type:"button",children:[s.jsx("span",{children:"Deployment"}),s.jsx("small",{children:"Local integrations"})]}),s.jsxs("button",{onClick:()=>{window.location.assign(`${Eh()}admin/host`)},type:"button",children:[s.jsx("span",{children:"Work Operations"}),s.jsx("small",{children:"Versions, restart, logs"})]}),s.jsxs("button",{className:Fe==="system"?"active":void 0,onClick:()=>St("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Fe==="users"?"active":void 0,onClick:()=>St("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Fe!=="system"&&Fe!=="users"&&Fe!=="accounts"&&Fe!=="deployment"?s.jsxs("div",{className:`settings-scope-banner ${R==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:R==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:R==="workspace"?`${(q==null?void 0:q.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Fe==="system"?s.jsx(qA,{conversations:i,diagnostics:V,loading:ie,onRefresh:Me}):Fe==="users"?s.jsx(WA,{currentUser:e,users:m,onCreate:te,onDelete:de,onUpdate:Ve}):Fe==="accounts"?s.jsx(PA,{onSwitched:z}):Fe==="deployment"?s.jsx(KA,{settings:a,onSave:oe}):Fe==="model"?s.jsx(XA,{draft:R==="workspace"?re:H,globalSettings:x,models:S,codexVersion:w,codexReleasedAt:E,codexUpdating:M,scope:R,workspaceOverrideCount:ae,settings:R==="workspace"?(Q==null?void 0:Q.effective)??re:x,workspaceSettings:Q,onDraftChange:R==="workspace"?Ct:A,onResetWorkspaceSetting:vt,onSubmit:X,onUpdateCodexCli:C}):Fe==="responsibility"?s.jsx(GA,{draft:ji,saving:La,scope:R,workspace:q,onDraftChange:Jn,onSubmit:ce=>{ce.preventDefault(),ce.stopPropagation(),!(R!=="workspace"||!q)&&(Mt(!0),ve(q.id,ji).then(Ee=>Jn(Ee)).finally(()=>Mt(!1)))}}):Fe==="memory"?s.jsx(QA,{baseSettings:p,scope:R,workspaceSettings:b,workspaceName:q==null?void 0:q.title,onSaveBaseItems:F,onSaveWorkspaceItems:_e}):s.jsx(eN,{deleteConfirmKey:Le,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,scope:R,workspaceEnvironment:d,valueVisible:Ut,onCancelEnvironmentEdit:ee,onDeleteConfirmChange:Bt,onDeleteEnvironment:Ne,onDraftChange:ye,onEditEnvironment:ue,onRevealEnvironmentValue:O,onSubmitEnvironment:xe,onValueVisibleChange:sn,revealedEnvironmentKeys:rn})]})]})]})})}function qA({conversations:e,diagnostics:i,loading:a,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=D.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=D.useState(!1),g=D.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=D.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},x=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),E=document.createElement("a");E.href=w,E.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,E.click(),URL.revokeObjectURL(w)},S=()=>{if(!i||!c.length)return;const w=c[0],E=c.slice(0,5).map($=>`- ${su($.createdAt)} · ${$.level.toUpperCase()} · ${$.event} · ${$.summary}`).join(`
|
|
91
|
+
${W.detail}`:W.message)}).finally(()=>de(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:C=>C.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>S("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>S("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>S("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>S("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>S("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>S("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:x==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${be}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(et,{label:"Status",value:Xc(be,e.nextWakeup,i)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(et,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(et,{label:"Wake at",value:su(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(et,{label:"Remaining",value:ad(e.nextWakeup,i)}):null,s.jsx(et,{label:"Created by",value:e.nextWakeup.createdBy}),s.jsx(et,{label:"Attempts",value:`${e.nextWakeup.attemptCount} / ${e.nextWakeup.maxAttempts}`,mono:!0}),s.jsxs("div",{className:"workspace-status-detail-text",children:[s.jsx("span",{children:"Wakeup instruction"}),s.jsx("pre",{children:e.nextWakeup.instruction})]}),e.nextWakeup.error?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Wakeup error"}),s.jsx("pre",{children:e.nextWakeup.error})]}):null]}):null,e.statusError?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Error"}),s.jsx("pre",{children:e.statusError})]}):e.status==="error"||e.status==="initialization_failed"?s.jsx("p",{className:"context-muted",children:"No persisted error detail is available for this status."}):null]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Workspace"}),s.jsx(et,{label:"Name",value:e.title}),s.jsx(et,{label:"ID",value:`workspaces/${Ns(e.id)}`,mono:!0}),s.jsx(et,{label:"Path",value:e.workspacePath,mono:!0})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Context Assets"}),s.jsx(et,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),s.jsx(et,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),s.jsx(et,{label:"Knowledge",value:`${r.length} item${r.length===1?"":"s"}`})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Current Responsibility"}),e.responsibility.trim()?s.jsx("div",{className:"context-markdown-preview",children:El(e.responsibility,e)}):s.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Knowledge Index"}),s.jsx(Gv,{items:r,onDelete:d,onEdit:C=>{p(C),S("knowledge")}})]})]}):x==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:El(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(tN,{draft:a,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):x==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(et,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:M,onClick:O,type:"button",children:M?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:M,onClick:()=>E(!1),type:"button",children:"Hide"}):null]})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Token Window"}),u?s.jsxs(s.Fragment,{children:[s.jsx(et,{label:"Used",value:oe===null?"unknown":`${Math.round(oe)}%`,mono:!0}),s.jsx(et,{label:"Latest usage",value:u.modelContextWindow?`${In(u.totalTokens)} / ${In(u.modelContextWindow)}`:In(u.totalTokens),mono:!0}),oe!==null?s.jsx("div",{className:`context-token-bar ${Lh(oe)}`,children:s.jsx("span",{style:{width:`${dd(oe)}%`}})}):null,s.jsx(et,{label:"Input / output",value:`${Kc(u.inputTokens)} / ${Kc(u.outputTokens)}`,mono:!0}),s.jsx(et,{label:"Reasoning",value:Kc(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",He(u.createdAt),"."]})]}):s.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),w?s.jsxs("section",{className:"context-card wide thread-read-panel",children:[s.jsx("h3",{children:"Runtime thread profile"}),s.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),M?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):$?s.jsx("pre",{className:"thread-read-error",children:$}):R?s.jsxs(s.Fragment,{children:[_e?s.jsx(oN,{summary:_e}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(R,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):x==="compactions"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Context Compactions"}),s.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),s.jsx("button",{className:"context-refresh-button",disabled:te,onClick:z,type:"button",children:te?"Refreshing...":"Refresh"})]}),ue?s.jsx("pre",{className:"thread-read-error",children:ue}):te&&!Ne?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ne!=null&&Ne.length?s.jsx("div",{className:"context-compaction-list",children:Ne.map(C=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:He(C.completedAt??C.usageObservedAt??C.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${C.status}`,children:C.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:PD(C).map(W=>s.jsxs("div",{children:[s.jsx("dt",{children:W.label}),s.jsx("dd",{children:W.value})]},W.label))}),s.jsxs("small",{children:[Nl(C.id),C.turnId?` · turn ${Nl(C.turnId)}`:""]})]},C.id))}):s.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):s.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Additional Context"}),s.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),ie?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):ee?s.jsx("pre",{className:"thread-read-error",children:ee}):Q?s.jsx(rN,{preview:Q,refreshing:ie,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function zA({conversations:e,onClose:i,workspaceGroups:a}){var O;const[r,u]=D.useState([]),[c,d]=D.useState("active"),[p,g]=D.useState(null),[m,b]=D.useState([]),[x,S]=D.useState(!0),[w,E]=D.useState(null),[M,H]=D.useState(null),[R,q]=D.useState(!1),[$,V]=D.useState(!1),[ie,N]=D.useState(new Set),[Q,re]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),ee=r.find(A=>A.id===p)??null,L=D.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),te=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),de=a.map(A=>({...A,conversations:A.conversations.filter(z=>z.id!==Q.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Ne=()=>{var A;re({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),N(new Set),H("create")},ye=()=>{!ee||ee.status!=="active"||(re({title:ee.title,publicDescription:ee.publicDescription,ownerWorkspaceId:ee.ownerWorkspaceId,participantWorkspaceIds:ee.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),N(new Set),H("edit"))},ue=async(A,z=c)=>{var C;S(!0),E(null);try{const W=await nb();u(W);const fe=W.filter(xe=>z==="archived"?xe.status==="archived":xe.status!=="archived"),X=(A&&fe.some(xe=>xe.id===A)?A:null)??(p&&fe.some(xe=>xe.id===p)?p:((C=fe[0])==null?void 0:C.id)??null);g(X),b(X?await $c(X):[])}catch(W){E(W instanceof Ji?W.detail:W instanceof Error?W.message:String(W))}finally{S(!1)}};D.useEffect(()=>{ue()},[]),D.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const z=await nb();u(z),p&&z.some(C=>C.id===p)&&b(await $c(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const F=async A=>{g(A),E(null);try{b(await $c(A))}catch(z){E(z instanceof Ji?z.detail:z instanceof Error?z.message:String(z))}},oe=async A=>{var C;if(A===c)return;d(A),E(null);const z=((C=r.find(W=>A==="archived"?W.status==="archived":W.status!=="archived"))==null?void 0:C.id)??null;if(g(z),!z){b([]);return}try{b(await $c(z))}catch(W){E(W instanceof Ji?W.detail:W instanceof Error?W.message:String(W))}},be=async A=>{var z;if(A.preventDefault(),!(!Q.title.trim()||!Q.ownerWorkspaceId)){V(!0),E(null);try{const C=M==="edit"&&ee?await _2(ee.id,{expectedVersion:ee.version,title:Q.title.trim(),publicDescription:Q.publicDescription.trim(),participantWorkspaceIds:Q.participantWorkspaceIds}):await R2({...Q,title:Q.title.trim(),publicDescription:Q.publicDescription.trim()});d("active"),H(null),re({title:"",publicDescription:"",ownerWorkspaceId:((z=e[0])==null?void 0:z.id)??"",participantWorkspaceIds:[]}),await ue(C.id,"active")}catch(C){E(C instanceof Ji?C.detail:C instanceof Error?C.message:String(C))}finally{V(!1)}}},_e=async()=>{if(!(!ee||ee.status!=="active")){V(!0),E(null);try{const A=await M2(ee.id,ee.version);q(!1),d("active"),await ue(void 0,"active")}catch(A){E(A instanceof Ji?A.detail:A instanceof Error?A.message:String(A))}finally{V(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"协作"}),s.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),s.jsxs("div",{className:"collaboration-header-actions",children:[s.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Ne,title:"新建 Topic",type:"button",children:"+"}),s.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),w?s.jsx("div",{className:"collaboration-error",children:w}):null,s.jsxs("div",{className:"collaboration-body",children:[s.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[s.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[s.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void oe("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void oe("archived"),role:"tab",type:"button",children:"已归档"})]}),x?s.jsx("p",{children:"正在加载..."}):te.length===0?s.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):te.map(A=>s.jsxs("button",{className:`collaboration-topic-entry${A.id===p?" active":""}`,onClick:()=>void F(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:ee?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:ee.title}),s.jsx("p",{children:ee.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:ee.status}),ee.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${ee.title}`,className:"memory-icon-button",onClick:ye,title:"编辑",type:"button",children:s.jsx(cd,{})}),s.jsx("button",{"aria-label":`归档 Topic ${ee.title}`,className:"memory-icon-button",onClick:()=>q(!0),title:"归档",type:"button",children:s.jsx(j2,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:ee.members.filter(A=>A.status==="active").map(A=>s.jsxs("span",{children:[A.workspaceTitleSnapshot,s.jsx("small",{children:A.role})]},`${A.workspaceId}-${A.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(A=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:A.senderTitleSnapshot}),s.jsx("span",{children:A.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${uw(A.recipientWorkspaceIds.map(z=>L.get(z)??Nl(z)))}`}),s.jsx("time",{children:He(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:El(A.contentMarkdown,void 0)})]},A.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),M?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!$&&H(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:be,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:M==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:M==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>H(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:Q.title,onChange:A=>re(z=>({...z,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:Q.publicDescription,onChange:A=>re(z=>({...z,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:M==="edit",value:Q.ownerWorkspaceId,onChange:A=>re(z=>({...z,ownerWorkspaceId:A.target.value,participantWorkspaceIds:z.participantWorkspaceIds.filter(C=>C!==A.target.value)})),children:a.map(A=>s.jsx("optgroup",{label:A.title,children:A.conversations.map(z=>s.jsx("option",{value:z.id,children:z.title},z.id))},A.id))})]}),s.jsxs("fieldset",{className:"collaboration-participant-groups",children:[s.jsx("legend",{children:"参与工作空间"}),s.jsxs("div",{className:"collaboration-participant-toolbar",children:[s.jsxs("span",{children:[Q.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>N(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>N(new Set(de.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),de.map(A=>{const z=A.conversations,C=z.filter(fe=>Q.participantWorkspaceIds.includes(fe.id)).length,W=ie.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!W,className:"collaboration-group-toggle",onClick:()=>N(fe=>{const X=new Set(fe);return X.has(A.id)?X.delete(A.id):X.add(A.id),X}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:W?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[C,"/",z.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:C===z.length,onChange:()=>re(fe=>{const X=z.map(Me=>Me.id),xe=new Set(fe.participantWorkspaceIds);return X.every(Me=>xe.has(Me))?X.forEach(Me=>xe.delete(Me)):X.forEach(Me=>xe.add(Me)),{...fe,participantWorkspaceIds:Array.from(xe)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),W?null:s.jsx("div",{children:z.map(fe=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:Q.participantWorkspaceIds.includes(fe.id),onChange:X=>re(xe=>({...xe,participantWorkspaceIds:X.target.checked?[...xe.participantWorkspaceIds,fe.id]:xe.participantWorkspaceIds.filter(Me=>Me!==fe.id)})),type:"checkbox"}),s.jsx("span",{children:fe.title})]},fe.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>H(null),type:"button",children:"取消"}),s.jsx("button",{disabled:$||!Q.title.trim()||!Q.ownerWorkspaceId,type:"submit",children:$?"正在保存...":M==="edit"?"保存":"创建 Topic"})]})]})}):null,R&&ee?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!$&&q(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>q(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:ee.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>q(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:$,onClick:()=>void _e(),type:"button",children:$?"正在归档...":"归档"})]})]})}):null]})})}function LA({busy:e,conversation:i,conversationId:a,forceStopBusy:r,preview:u,previewLoading:c,result:d,status:p,warmup:g,workspaceGroups:m,onCancelResetPreview:b,onClose:x,onForceStop:S,onPreviewReset:w,onStartBlankContext:E,onResetRuntime:M,onSaveResetSelection:H,onWorkspaceChange:R,onWarmupChange:q}){const $=!i||e||p==="running"||p==="initializing";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:x,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:V=>V.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header console-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Console"}),s.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),s.jsxs("div",{className:"console-header-actions",children:[s.jsxs("label",{className:"console-workspace-picker",children:[s.jsx("span",{children:"Workspace"}),s.jsx("select",{disabled:e,onChange:V=>R(V.target.value),value:a??"",children:m.map(V=>s.jsx("optgroup",{label:V.title,children:V.conversations.map(ie=>s.jsxs("option",{value:ie.id,children:[ie.title," · workspaces/",Ns(ie.id)]},ie.id))},V.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:x,type:"button",children:"×"})]})]}),s.jsx("div",{className:"console-body",children:s.jsxs("section",{className:"console-card",children:[s.jsxs("div",{className:"console-card-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Runtime"}),s.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),s.jsx("span",{className:`console-status ${p}`,children:p})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:i?`workspaces/${Ns(i.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:g,onChange:V=>q(V.target.checked),type:"checkbox"}),s.jsxs("span",{children:["Run a warmup turn after reset",s.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),s.jsxs("div",{className:"console-actions",children:[s.jsx("button",{className:"danger",disabled:!i||r,onClick:S,title:"Kill the workspace runtime and repair every non-terminal scheduler state",type:"button",children:r?"Stopping & repairing...":"Force stop & repair"}),s.jsx("button",{className:"danger",disabled:$||c,onClick:w,type:"button",children:c?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:$||c,onClick:E,type:"button",children:"Clear memory & start blank"}),p==="running"||p==="initializing"?s.jsx("span",{children:"Force stop the active workspace operation before resetting."}):null]}),d?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:d.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[d.injectedItemCount," visible history items injected"]}),d.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",d.historyBatchCount," chronological batches with ",d.historyCompactionCount," native compactions"]}):null,d.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",d.newThreadId]}),d.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",d.warmupTurnId]}):null]}):null]})}),u?s.jsx(IA,{busy:e,preview:u,warmup:g,onCancel:b,onConfirm:M,onSaveSelection:H}):null]})})}function IA({busy:e,preview:i,warmup:a,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=D.useState(()=>new Set(i.entries.filter(L=>L.includedByDefault).map(L=>L.id))),[g,m]=D.useState(!1),[b,x]=D.useState(!1),[S,w]=D.useState(null),E=D.useRef(null),M=i.entries.filter(L=>d.has(L.id)),H=M.filter(L=>L.role==="user").length,R=M.length-H,q=i.entries.filter(L=>L.topicRelation!==null).map(L=>L.id),$=q.filter(L=>d.has(L)).length,V=i.entries.length>0&&d.size===i.entries.length;D.useEffect(()=>{E.current&&(E.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const ie=e||b;async function N(L){x(!0),w(null);try{await c(i.entries.filter(te=>L.has(te.id)).map(te=>te.id)),p(L)}catch(te){w(Ge(te).message)}finally{x(!1)}}function Q(L,te){const de=new Set(d);te?de.add(L):de.delete(L),N(de)}function re(){const L=new Set(d);q.forEach(te=>L.add(te)),N(L)}function ee(){const L=new Set(d);q.forEach(te=>{L.has(te)?L.delete(te):L.add(te)}),N(L)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:ie?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:L=>L.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(L=>!L),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:ie,onClick:r,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:V,disabled:ie||i.entries.length===0,onChange:L=>void N(L.target.checked?new Set(i.entries.map(te=>te.id)):new Set),ref:E,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[H," user"]}),s.jsxs("span",{children:[R," assistant"]}),q.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[$," of ",q.length," Topic input + response"]}),s.jsx("button",{disabled:ie||$===q.length,onClick:re,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:ie,onClick:ee,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:a?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,S?s.jsx("span",{className:"reset-preview-selection-error",children:S}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((L,te)=>s.jsxs("article",{className:`reset-preview-item ${L.role} ${d.has(L.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${L.role} message ${te+1}`,checked:d.has(L.id),disabled:ie,onChange:de=>Q(L.id,de.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:L.role}),L.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",L.topicRelation]}):null,s.jsx("time",{dateTime:L.createdAt,children:He(L.createdAt)})]}),s.jsx("pre",{children:L.content})]},L.id)):s.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),s.jsxs("footer",{className:"reset-preview-actions",children:[s.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:ie,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:ie,onClick:()=>u(i.entries.filter(L=>d.has(L.id)).map(L=>L.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function UA({currentReleasedAt:e,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&sR(r.version,m)?rR(r.version):null;return D.useEffect(()=>{const x=S=>{S.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:a?`status-${a.status}`:void 0,children:(a==null?void 0:a.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:lh(m,(a==null?void 0:a.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?lh(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?s.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),a?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:He(a.startedAt)})]}):null]}),r!=null&&r.error?s.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",r.error]}):null,s.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:a!=null&&a.logs.length?a.logs.map((x,S)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:lR(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${S}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.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 BA({currentUser:e,conversations:i,deploymentSettings:a,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,workspaceEnvironment:d,memorySettings:p,memorySettingsDraft:g,managedUsers:m,workspaceMemoryDraft:b,runtimeSettings:x,runtimeModels:S,runtimeCodexVersion:w,runtimeCodexReleasedAt:E,runtimeCodexUpdating:M,runtimeSettingsDraft:H,runtimeSettingsScope:R,settingsWorkspace:q,settingsWorkspaceId:$,systemDiagnostics:V,systemDiagnosticsLoading:ie,workspaceGroups:N,workspaceRuntimeSettings:Q,workspaceRuntimeSettingsDraft:re,onCancelEnvironmentEdit:ee,onClose:L,onCreateUser:te,onDeleteUser:de,onDeleteEnvironment:Ne,onDraftChange:ye,onEditEnvironment:ue,onSaveBaseMemoryItems:F,onSaveDeploymentSettings:oe,onSaveResponsibility:be,onSaveWorkspaceMemoryItems:_e,onRevealEnvironmentValue:O,onRuntimeDraftChange:A,onCodexAccountSwitched:z,onUpdateCodexCli:C,onRuntimeScopeChange:W,onSettingsWorkspaceChange:fe,onSubmitRuntimeSettings:X,onSubmitEnvironment:xe,onRefreshSystemDiagnostics:Me,onUpdateUser:Ve,onWorkspaceRuntimeDraftChange:Ct,onWorkspaceRuntimeReset:vt,revealedEnvironmentKeys:rn}){const[Ye,St]=D.useState("model"),[It,sn]=D.useState(!1),[Le,Ut]=D.useState(null),[mn,Xt]=D.useState(!1),[Ti,Qn]=D.useState((q==null?void 0:q.responsibility)??""),[La,_t]=D.useState(!1),Ia=D.useRef(null),ae=R==="workspace"?Object.values((Q==null?void 0:Q.sources)??{}).filter(ce=>ce==="workspace").length:0;return D.useEffect(()=>{R==="global"&&Xt(!1)},[R]),D.useEffect(()=>{Qn((q==null?void 0:q.responsibility)??"")},[q==null?void 0:q.id,q==null?void 0:q.responsibility]),D.useEffect(()=>{if(!mn)return;const ce=Ue=>{var Vt;const Qe=Ue.target;Qe instanceof Node&&((Vt=Ia.current)!=null&&Vt.contains(Qe))||Xt(!1)},Ee=Ue=>{Ue.key==="Escape"&&Xt(!1)};return document.addEventListener("pointerdown",ce,!0),document.addEventListener("keydown",Ee,!0),()=>{document.removeEventListener("pointerdown",ce,!0),document.removeEventListener("keydown",Ee,!0)}},[mn]),s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:L,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:ce=>ce.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Ye!=="system"&&Ye!=="users"&&Ye!=="accounts"&&Ye!=="deployment"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":R==="global",className:R==="global"?"active":void 0,onClick:()=>W("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:Ia,children:[s.jsx("button",{"aria-checked":R==="workspace","aria-expanded":R==="workspace"?mn:void 0,"aria-label":R==="workspace"?"Settings workspace target":void 0,className:R==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(R!=="workspace"){W("workspace");return}Xt(ce=>!ce)},role:"radio",type:"button",children:R==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(q==null?void 0:q.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),R==="workspace"&&mn?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:N.map(ce=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:ce.title}),ce.conversations.map(Ee=>s.jsxs("button",{"aria-selected":Ee.id===$,className:Ee.id===$?"selected":void 0,onClick:()=>{fe(Ee.id),Xt(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ee.title}),s.jsxs("small",{children:["workspaces/",Ee.id]})]},Ee.id))]},ce.id))}):null]})]}):null]}),s.jsx("div",{className:"settings-header-actions",children:s.jsx("button",{"aria-label":"Close settings panel",onClick:L,type:"button",children:"×"})})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Ye==="model"?"active":void 0,onClick:()=>St("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Ye==="responsibility"?"active":void 0,onClick:()=>St("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Ye==="memory"?"active":void 0,onClick:()=>St("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Ye==="environment"?"active":void 0,onClick:()=>St("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Ye==="accounts"?"active":void 0,onClick:()=>St("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Cloud login + active account"})]}),s.jsxs("button",{className:Ye==="deployment"?"active":void 0,onClick:()=>St("deployment"),type:"button",children:[s.jsx("span",{children:"Deployment"}),s.jsx("small",{children:"Local integrations"})]}),s.jsxs("button",{onClick:()=>{window.location.assign(`${Eh()}admin/host`)},type:"button",children:[s.jsx("span",{children:"Work Operations"}),s.jsx("small",{children:"Versions, restart, logs"})]}),s.jsxs("button",{className:Ye==="system"?"active":void 0,onClick:()=>St("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Ye==="users"?"active":void 0,onClick:()=>St("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Ye!=="system"&&Ye!=="users"&&Ye!=="accounts"&&Ye!=="deployment"?s.jsxs("div",{className:`settings-scope-banner ${R==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:R==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:R==="workspace"?`${(q==null?void 0:q.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Ye==="system"?s.jsx(qA,{conversations:i,diagnostics:V,loading:ie,onRefresh:Me}):Ye==="users"?s.jsx(WA,{currentUser:e,users:m,onCreate:te,onDelete:de,onUpdate:Ve}):Ye==="accounts"?s.jsx(PA,{onSwitched:z}):Ye==="deployment"?s.jsx(KA,{settings:a,onSave:oe}):Ye==="model"?s.jsx(XA,{draft:R==="workspace"?re:H,globalSettings:x,models:S,codexVersion:w,codexReleasedAt:E,codexUpdating:M,scope:R,workspaceOverrideCount:ae,settings:R==="workspace"?(Q==null?void 0:Q.effective)??re:x,workspaceSettings:Q,onDraftChange:R==="workspace"?Ct:A,onResetWorkspaceSetting:vt,onSubmit:X,onUpdateCodexCli:C}):Ye==="responsibility"?s.jsx(GA,{draft:Ti,saving:La,scope:R,workspace:q,onDraftChange:Qn,onSubmit:ce=>{ce.preventDefault(),ce.stopPropagation(),!(R!=="workspace"||!q)&&(_t(!0),be(q.id,Ti).then(Ee=>Qn(Ee)).finally(()=>_t(!1)))}}):Ye==="memory"?s.jsx(QA,{baseSettings:p,scope:R,workspaceSettings:b,workspaceName:q==null?void 0:q.title,onSaveBaseItems:F,onSaveWorkspaceItems:_e}):s.jsx(eN,{deleteConfirmKey:Le,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,scope:R,workspaceEnvironment:d,valueVisible:It,onCancelEnvironmentEdit:ee,onDeleteConfirmChange:Ut,onDeleteEnvironment:Ne,onDraftChange:ye,onEditEnvironment:ue,onRevealEnvironmentValue:O,onSubmitEnvironment:xe,onValueVisibleChange:sn,revealedEnvironmentKeys:rn})]})]})]})})}function qA({conversations:e,diagnostics:i,loading:a,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=D.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=D.useState(!1),g=D.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=D.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},x=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),E=document.createElement("a");E.href=w,E.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,E.click(),URL.revokeObjectURL(w)},S=()=>{if(!i||!c.length)return;const w=c[0],E=c.slice(0,5).map($=>`- ${su($.createdAt)} · ${$.level.toUpperCase()} · ${$.event} · ${$.summary}`).join(`
|
|
92
92
|
`),M=JSON.stringify(w,null,2),H=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${su(i.generatedAt)}`,"","## Latest incident","","```json",M.slice(0,2500),"```","","## Recent system log","",E,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
|
|
93
|
-
`),R=`[System Log] ${w.summary}`.slice(0,180),q=new URL("https://github.com/seele-labs/seele-work/issues/new");q.searchParams.set("title",R),q.searchParams.set("body",H),window.open(q.toString(),"_blank","noopener,noreferrer")};return s.jsxs("section",{className:"system-information-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"System"}),s.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),s.jsx("button",{className:"system-information-refresh",disabled:a,onClick:r,type:"button",children:a?"Refreshing...":"Refresh"})]}),u?s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"system-information-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"LRU pool target"}),s.jsxs("dd",{children:[Ln(u.maxRetainedRuntimes)," runtimes"]}),s.jsx("small",{children:u.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Retention policy"}),s.jsxs("dd",{children:["LRU · ",Op(u.maxIdleSeconds*1e3)," max idle"]}),s.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current pool"}),s.jsxs("dd",{children:[u.activeRuntimeCount," active · ",u.idleRuntimeCount," idle"]}),s.jsxs("small",{children:[u.retainedRuntimeCount," retained runtimes"]})]})]}),s.jsxs("section",{className:"system-runtime-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"Workspace runtimes"}),s.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),s.jsx("time",{dateTime:i==null?void 0:i.generatedAt,children:i?He(i.generatedAt):""})]}),u.workspaces.length>0?s.jsxs("div",{className:"system-runtime-table",children:[s.jsxs("div",{className:"system-runtime-table-header",children:[s.jsx("span",{children:"Workspace"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Runtime"}),s.jsx("span",{children:"Age"})]}),u.workspaces.map(w=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:g.get(w.workspaceId)??w.workspaceId}),s.jsx("small",{children:w.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${w.turnId?"active":"idle"}`,children:w.lifecycle==="shutting_down"?"Shutting down":w.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:w.turnId?w.state:"Retained"}),s.jsx("small",{children:w.pid===null?"PID unavailable":`PID ${w.pid}`})]}),s.jsx("span",{children:w.idleMs===null?Op(w.uptimeMs):`${Op(w.idleMs)} idle`})]},w.workspaceId))]}):s.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),s.jsxs("section",{className:"system-runtime-list system-log-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"System log"}),s.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),s.jsxs("div",{className:"system-log-actions",children:[s.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!c.length,onClick:()=>void b(),title:"Copy system log report",type:"button",children:s.jsx(Mh,{})}),s.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!c.length,onClick:x,title:"Download system log report",type:"button",children:s.jsx(HA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:S,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx($A,{})}),d?s.jsx("small",{children:"Copied"}):null]})]}),c.length?s.jsx("div",{className:"system-log-entries",children:c.map(w=>s.jsxs("details",{className:`system-log-entry ${w.level}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"system-log-level",children:w.level}),s.jsxs("span",{children:[s.jsx("strong",{children:w.summary}),s.jsxs("small",{children:[w.component," · ",su(w.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:w.event})]}),w.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[g.get(w.workspaceId)??w.workspaceId," · ",w.workspaceId]})]}):null,w.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:w.turnId})]}):null,w.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:w.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(w.detail,null,2)})]},w.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:a?"Loading system information...":"System information is unavailable."})]})}function HA(){return s.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function $A(){return s.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"M12 7v6m0 4h.01"})]})}function GA({draft:e,saving:i,scope:a,workspace:r,onDraftChange:u,onSubmit:c}){const d=a==="workspace";return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Responsibility"}),s.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),d&&r?s.jsxs("form",{className:"settings-responsibility-form",onSubmit:c,children:[s.jsxs("label",{children:[s.jsx("span",{children:r.title}),s.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:p=>u(p.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:i,type:"submit",children:i?"Saving...":"Save responsibility"})})]}):s.jsx("section",{className:"settings-readonly-block",children:s.jsxs("div",{children:[s.jsx("strong",{children:"Workspace-only setting"}),s.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function VA({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((i,a)=>i.windowDurationMins-a.windowDurationMins).map(i=>{const a=fd(i.usedPercent),r=Yv(i.windowDurationMins);return s.jsxs("div",{className:"codex-account-usage-window",children:[s.jsxs("div",{children:[s.jsxs("span",{children:[r," used"]}),s.jsx("strong",{children:jw(a)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${a}%`}})}),s.jsxs("small",{children:["Resets ",Cw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function FA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function YA(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function PA({onSwitched:e}){var A;const[i,a]=D.useState(null),[r,u]=D.useState(!0),[c,d]=D.useState(!1),[p,g]=D.useState(!1),[m,b]=D.useState(""),[x,S]=D.useState(!1),[w,E]=D.useState(""),[M,H]=D.useState(null),[R,q]=D.useState(null),[$,V]=D.useState(""),[ie,N]=D.useState(null),[Q,re]=D.useState(null),[ee,L]=D.useState(!1);async function te(){var C;const z=await ab();a(z),((C=z.login)==null?void 0:C.status)==="pending"&&(H(z.login),S(!0))}async function de(z){d(!0),b("");try{a(await lb(z))}catch(C){b(Ge(C).message)}finally{d(!1)}}D.useEffect(()=>{let z=!1;return ab().then(C=>{var W;z||(a(C),((W=C.login)==null?void 0:W.status)==="pending"&&(H(C.login),S(!0)),C.accounts.length>0&&(d(!0),lb(!1).then(fe=>{z||a(fe)}).catch(fe=>{z||b(Ge(fe).message)}).finally(()=>{z||d(!1)})))}).catch(C=>{z||b(Ge(C).message)}).finally(()=>{z||u(!1)}),()=>{z=!0}},[]),D.useEffect(()=>{if(!M||M.status!=="pending")return;let z=!1;const C=window.setInterval(()=>{Y2(M.id).then(async W=>{z||(H(W),W.status!=="pending"&&(window.clearInterval(C),W.status==="succeeded"&&a(fe=>{if(!fe||!W.account)return fe;const X=fe.accounts.some(xe=>{var Me;return xe.id===((Me=W.account)==null?void 0:Me.id)})?fe.accounts.map(xe=>{var Me;return xe.id===((Me=W.account)==null?void 0:Me.id)?W.account:xe}):[...fe.accounts,W.account];return{...fe,accounts:X}})))}).catch(W=>{z||b(Ge(W).message)})},1e3);return()=>{z=!0,window.clearInterval(C)}},[M==null?void 0:M.id,M==null?void 0:M.status]);function Ne(){E(""),H(null),b(""),L(!1),S(!0)}async function ye(z){z.preventDefault(),g(!0),b("");try{H(await F2(w.trim()))}catch(C){b(Ge(C).message)}finally{g(!1)}}async function ue(){if(!M||M.status!=="pending"){S(!1);return}g(!0),b("");try{const z=await P2(M.id);H(z),S(!1)}catch(z){b(Ge(z).message)}finally{g(!1)}}function F(z){q(z),V(z.name),b("")}async function oe(z){if(z.preventDefault(),!R)return;const C=$.trim();if(!C||C===R.name){q(null);return}g(!0),b("");try{await W2(R.id,C),await te(),q(null)}catch(W){b(Ge(W).message)}finally{g(!1)}}async function ve(){var z;if(ie){g(!0),b("");try{const C=await X2(ie.id);a(C),N(null),await e()}catch(C){const W=Ge(C);b((z=W.detail)!=null&&z.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":W.detail??W.message)}finally{g(!1)}}}async function _e(){if(Q){g(!0),b("");try{await K2(Q.id),await te(),re(null)}catch(z){b(Ge(z).detail??Ge(z).message)}finally{g(!1)}}}const O=(i==null?void 0:i.accounts)??[];return s.jsxs("section",{className:"settings-section codex-accounts-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex Accounts"}),s.jsx("p",{children:"Manage the cloud-owned Codex logins. Every deployment uses the same globally active account; workspaces do not bind to accounts."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||O.length===0,onClick:()=>void de(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(M==null?void 0:M.status)==="pending",onClick:Ne,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Cloud-wide active account"}),s.jsx("span",{children:"Switching requires the cloud runtime to be idle. The cloud publishes the selected credential; members pause new work and apply it after any active turn finishes. There is no per-deployment selection."})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,r?s.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!r&&O.length===0?s.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,s.jsx("div",{className:"codex-account-list",children:O.map(z=>{var Ve,Ct;const C=(i==null?void 0:i.activeAccountId)===z.id,W=(Ve=i==null?void 0:i.accountDetails)==null?void 0:Ve[z.id],fe=((Ct=i==null?void 0:i.accountIssues)==null?void 0:Ct[z.id])??[],X=fe.length>0,xe=fe.some(vt=>["missing_credential","invalid_credential","credential_unreadable"].includes(vt.code)),Me=[z.email,FA(z.accountType),YA(z.planType)].filter(vt=>!!vt);return s.jsxs("article",{className:`codex-account-card${C?" active":""}${X?" issue":""}`,children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:z.name}),C?s.jsx("span",{className:"codex-account-active",children:"Active"}):null,X?s.jsx("span",{className:"codex-account-warning",children:"Needs attention"}):null]}),s.jsx("small",{children:Me.join(" · ")||`Added ${He(z.createdAt)}`}),X?s.jsx("div",{className:"codex-account-issues",role:"status",children:fe.map(vt=>s.jsx("span",{children:vt.message},vt.code))}):null,W!=null&&W.usage?s.jsx(VA,{usage:W.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),W?s.jsx("small",{className:W.error?"codex-account-detail-error":"codex-account-refreshed",children:W.error?`Refresh issue: ${W.error}`:`Updated ${He(W.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c||xe,onClick:()=>F(z),title:xe?"Sign in again or delete this account to replace its credential.":void 0,type:"button",children:X?"Repair & rename":"Rename"}),s.jsx("button",{disabled:p||c||C||X,onClick:()=>{b(""),N(z)},type:"button",children:C?"In use":X?"Unavailable":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||C,onClick:()=>{b(""),re(z)},type:"button",children:"Delete"})]})]},z.id)})}),R?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&q(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void oe(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Rename Codex Account"}),s.jsx("button",{"aria-label":"Close account rename",className:"memory-icon-button",disabled:p,onClick:()=>q(null),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:z=>V(z.target.value),value:$})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>q(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!$.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!M&&S(!1),role:"presentation",children:M?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:M.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void ue(),type:"button",children:"×"})]}),M.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),s.jsxs("div",{className:"codex-device-code",children:[s.jsx("strong",{children:M.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(M.userCode),L(!0),window.setTimeout(()=>L(!1),1500)},type:"button",children:ee?"Copied":"Copy code"})]}),s.jsx("a",{href:M.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),s.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):M.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=M.account)==null?void 0:A.name)??M.accountName})," is persisted on the cloud and ready to synchronize. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:M.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void ue(),type:"button",children:M.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void ye(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>S(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates the login profile on the cloud. Completing login shares it with every deployment but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:z=>E(z.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>S(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,ie?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&N(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>N(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch cloud-wide execution to ",s.jsx("strong",{children:ie.name}),"? The cloud runtime must be idle. Member deployments finish active turns, pause new work, and then install this credential; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>N(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void ve(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,Q?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&re(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Codex Account"}),s.jsx("button",{"aria-label":"Close account deletion",className:"memory-icon-button",disabled:p,onClick:()=>re(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:Q.name})," and its persisted Codex credential from the cloud and every member mirror? This cannot be undone."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>re(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:p,onClick:()=>void _e(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function WA({currentUser:e,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=D.useState(null),[g,m]=D.useState(c),[b,x]=D.useState(!1),[S,w]=D.useState(null),[E,M]=D.useState("");function H(){m(c),M(""),p("new")}function R(V){m({username:V.username,password:"",role:V.role,active:V.active}),M(""),p(V)}function q(){b||(p(null),M(""))}async function $(V){if(V.preventDefault(),!!d){x(!0),M("");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}),p(null)}catch(ie){M(Ge(ie).message)}finally{x(!1)}}}return s.jsxs("section",{className:"settings-section user-management-section",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Users"}),s.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:H,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(V=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:V.username}),V.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",He(V.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${V.role}`,children:V.role}),s.jsx("span",{className:`user-status ${V.active?"active":"disabled"}`,children:V.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${V.username}`,className:"memory-icon-button",onClick:()=>R(V),title:"Edit",type:"button",children:s.jsx(dd,{})}),s.jsx("button",{"aria-label":`Delete user ${V.username}`,className:"memory-icon-button memory-item-delete",disabled:V.id===e.id,onClick:()=>{M(""),w(V)},title:"Delete",type:"button",children:"×"})]})]},V.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:q,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:V=>V.stopPropagation(),onSubmit:V=>void $(V),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:q,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:V=>m(ie=>({...ie,username:V.target.value})),placeholder:"Sign-in username",value:g.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:d==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:V=>m(ie=>({...ie,password:V.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:V=>m(ie=>({...ie,role:V.target.value==="admin"?"admin":"user"})),value:g.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:V=>m(ie=>({...ie,active:V.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,E?s.jsx("p",{className:"memory-editor-error",children:E}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:q,type:"button",children:"Cancel"}),s.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,S?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:V=>V.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete User"}),s.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>w(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:S.username}),". Users that own workspaces must be disabled instead."]}),E?s.jsx("p",{className:"memory-editor-error",children:E}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>w(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(S.id).then(()=>w(null)).catch(V=>M(Ge(V).message))},type:"button",children:"Delete"})]})]})}):null]})}function KA({settings:e,onSave:i}){const[a,r]=D.useState(e),[u,c]=D.useState(!1);return D.useEffect(()=>r(e),[e]),s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Deployment"}),s.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:d=>{d.preventDefault(),c(!0),i(a).finally(()=>c(!1))},children:[s.jsxs("label",{className:"settings-field",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Public URL"}),s.jsx("small",{children:"The externally reachable main URL of this deployment. Seele uses it when publishing callback links to external systems."})]}),s.jsx("input",{"aria-label":"Public URL of this deployment",onChange:d=>r({...a,publicUrl:d.target.value||null}),placeholder:"https://profuse.antgroup-inc.cn/codex/yishao-0/",type:"url",value:a.publicUrl||""})]}),s.jsxs("label",{className:"settings-toggle-field",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Profuse notification"}),s.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),s.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:a.profuseNotificationEnabled,onChange:d=>r({...a,profuseNotificationEnabled:d.target.checked}),type:"checkbox"})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:u,type:"submit",children:u?"Saving...":"Save deployment settings"})})]})]})}function XA({codexReleasedAt:e,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:S,onUpdateCodexCli:w}){var V;const E=d==="workspace",M=Jo(r.model,c),H=Jo(u.model,c),R=Jo(p.model,c),q=Cx(r.reasoningEffort,M),$=HE(M,r.reasoningEffort);return D.useEffect(()=>{M&&q!==r.reasoningEffort&&b({...r,reasoningEffort:q})},[r,M,q,b]),s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),E?s.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:S,children:[s.jsxs("label",{className:qc(E,Cl(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(Bc,{globalValue:pb(u.model,c),isWorkspaceScope:E,label:"Model",settingKey:"model",source:Cl(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(jp,{"aria-label":"Runtime model",onChange:ie=>{const N=Jo(ie,c);b({...r,model:ie,reasoningEffort:Cx(r.reasoningEffort,N)})},options:oR(c,r.model),value:r.model||((V=c.find(ie=>ie.isDefault))==null?void 0:V.model)||""})]}),s.jsxs("label",{className:qc(E,Cl(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(Bc,{globalValue:jx(u.reasoningEffort,H),isWorkspaceScope:E,label:"Reasoning effort",settingKey:"reasoningEffort",source:Cl(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(jp,{"aria-label":"Runtime reasoning effort",onChange:ie=>b({...r,reasoningEffort:ie}),options:$,value:q})]}),s.jsxs("label",{className:qc(E,Cl(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(Bc,{globalValue:gb(u.sandbox),isWorkspaceScope:E,label:"Permission mode",settingKey:"sandbox",source:Cl(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(jp,{"aria-label":"Permission mode",onChange:ie=>b({...r,sandbox:ie}),options:pA,value:r.sandbox})]}),s.jsxs("label",{className:qc(E,Cl(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Bc,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:E,label:"Fast mode",settingKey:"fastMode",source:Cl(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:x}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:ie=>b({...r,fastMode:ie.target.checked}),type:"checkbox"})]}),s.jsxs("dl",{className:"runtime-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsxs("dd",{children:["Model ",pb(p.model,c),", reasoning"," ",jx(p.reasoningEffort,R),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",gb(p.sandbox),"."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:lh(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:a,onClick:w,type:"button",children:a?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:E?"Save workspace overrides":"Save global runtime"})})]})]})}function Bc({globalValue:e,isWorkspaceScope:i,label:a,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:a}),i?s.jsxs("span",{className:"runtime-field-meta",children:[s.jsx("span",{className:d?"override":"inherited",children:d?"Workspace override":`Inherited: ${e}`}),d?s.jsx("button",{type:"button",onClick:()=>c(r),children:"Reset"}):null]}):null]})}function jp({"aria-label":e,onChange:i,options:a,value:r}){const[u,c]=D.useState(!1),d=D.useRef(null),p=a.find(g=>g.value===r)??a[0]??null;return D.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]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:a.map(g=>s.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 Cl(e,i,a){return e!==i?"workspace":a}function qc(e,i,a="settings-wide-field"){return[a,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function QA({baseSettings:e,scope:i,workspaceSettings:a,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?a.items:e.items,g=d?c:u;return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),s.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?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(JA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(ZA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function ZA({ariaLabel:e,emptyText:i,items:a,onSaveItems:r,title:u}){var Q;const[c,d]=D.useState(ru(a)),[p,g]=D.useState(null),[m,b]=D.useState({key:"",value:""}),[x,S]=D.useState(null),[w,E]=D.useState(null),[M,H]=D.useState(null);D.useEffect(()=>{d(ru(a))},[a]),D.useEffect(()=>{if(p===null)return;const re=ee=>{ee.key==="Escape"&&(V(),E(null))};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[p]);async function R(re,ee){H(ee);try{const L=await r(re);return d(ru(L)),L}finally{H(null)}}function q(){E(null),S(null),b({key:"",value:""}),g("new")}function $(re){const ee=c[re];ee&&(E(null),S(null),b({...ee}),g(re))}function V(){g(null),S(null),b({key:"",value:""})}async function ie(re){const ee=c[re],L=(ee==null?void 0:ee.key)||`${re}`;await R(c.filter((te,de)=>de!==re),`delete:${L}`),E(null)}async function N(re){re.preventDefault(),re.stopPropagation();const ee=m.key.trim(),L=hD(ee);if(L){S(L);return}const te=m.value.trim();if(!te){S("Value is required.");return}const de=p==="new"?-1:p;if(c.some((ye,ue)=>ue!==de&&ye.key.trim()===ee)){S(`Key "${ee}" already exists. Each memory key must be unique.`);return}const Ne={...m,key:ee,value:te};p==="new"?await R([...c,Ne],"add"):typeof p=="number"&&await R(c.map((ye,ue)=>ue===p?Ne:ye),`save:${p}`),V()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:q,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((re,ee)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${re.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${re.key}>`}),`
|
|
93
|
+
`),R=`[System Log] ${w.summary}`.slice(0,180),q=new URL("https://github.com/seele-labs/seele-work/issues/new");q.searchParams.set("title",R),q.searchParams.set("body",H),window.open(q.toString(),"_blank","noopener,noreferrer")};return s.jsxs("section",{className:"system-information-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"System"}),s.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),s.jsx("button",{className:"system-information-refresh",disabled:a,onClick:r,type:"button",children:a?"Refreshing...":"Refresh"})]}),u?s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"system-information-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"LRU pool target"}),s.jsxs("dd",{children:[In(u.maxRetainedRuntimes)," runtimes"]}),s.jsx("small",{children:u.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Retention policy"}),s.jsxs("dd",{children:["LRU · ",Op(u.maxIdleSeconds*1e3)," max idle"]}),s.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current pool"}),s.jsxs("dd",{children:[u.activeRuntimeCount," active · ",u.idleRuntimeCount," idle"]}),s.jsxs("small",{children:[u.retainedRuntimeCount," retained runtimes"]})]})]}),s.jsxs("section",{className:"system-runtime-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"Workspace runtimes"}),s.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),s.jsx("time",{dateTime:i==null?void 0:i.generatedAt,children:i?He(i.generatedAt):""})]}),u.workspaces.length>0?s.jsxs("div",{className:"system-runtime-table",children:[s.jsxs("div",{className:"system-runtime-table-header",children:[s.jsx("span",{children:"Workspace"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Runtime"}),s.jsx("span",{children:"Age"})]}),u.workspaces.map(w=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:g.get(w.workspaceId)??w.workspaceId}),s.jsx("small",{children:w.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${w.turnId?"active":"idle"}`,children:w.lifecycle==="shutting_down"?"Shutting down":w.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:w.turnId?w.state:"Retained"}),s.jsx("small",{children:w.pid===null?"PID unavailable":`PID ${w.pid}`})]}),s.jsx("span",{children:w.idleMs===null?Op(w.uptimeMs):`${Op(w.idleMs)} idle`})]},w.workspaceId))]}):s.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),s.jsxs("section",{className:"system-runtime-list system-log-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"System log"}),s.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),s.jsxs("div",{className:"system-log-actions",children:[s.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!c.length,onClick:()=>void b(),title:"Copy system log report",type:"button",children:s.jsx(Mh,{})}),s.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!c.length,onClick:x,title:"Download system log report",type:"button",children:s.jsx(HA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:S,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx($A,{})}),d?s.jsx("small",{children:"Copied"}):null]})]}),c.length?s.jsx("div",{className:"system-log-entries",children:c.map(w=>s.jsxs("details",{className:`system-log-entry ${w.level}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"system-log-level",children:w.level}),s.jsxs("span",{children:[s.jsx("strong",{children:w.summary}),s.jsxs("small",{children:[w.component," · ",su(w.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:w.event})]}),w.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[g.get(w.workspaceId)??w.workspaceId," · ",w.workspaceId]})]}):null,w.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:w.turnId})]}):null,w.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:w.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(w.detail,null,2)})]},w.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:a?"Loading system information...":"System information is unavailable."})]})}function HA(){return s.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function $A(){return s.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"M12 7v6m0 4h.01"})]})}function GA({draft:e,saving:i,scope:a,workspace:r,onDraftChange:u,onSubmit:c}){const d=a==="workspace";return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Responsibility"}),s.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),d&&r?s.jsxs("form",{className:"settings-responsibility-form",onSubmit:c,children:[s.jsxs("label",{children:[s.jsx("span",{children:r.title}),s.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:p=>u(p.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:i,type:"submit",children:i?"Saving...":"Save responsibility"})})]}):s.jsx("section",{className:"settings-readonly-block",children:s.jsxs("div",{children:[s.jsx("strong",{children:"Workspace-only setting"}),s.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function VA({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((i,a)=>i.windowDurationMins-a.windowDurationMins).map(i=>{const a=dd(i.usedPercent),r=Yv(i.windowDurationMins);return s.jsxs("div",{className:"codex-account-usage-window",children:[s.jsxs("div",{children:[s.jsxs("span",{children:[r," used"]}),s.jsx("strong",{children:jw(a)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${a}%`}})}),s.jsxs("small",{children:["Resets ",Cw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function FA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function YA(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function PA({onSwitched:e}){var A;const[i,a]=D.useState(null),[r,u]=D.useState(!0),[c,d]=D.useState(!1),[p,g]=D.useState(!1),[m,b]=D.useState(""),[x,S]=D.useState(!1),[w,E]=D.useState(""),[M,H]=D.useState(null),[R,q]=D.useState(null),[$,V]=D.useState(""),[ie,N]=D.useState(null),[Q,re]=D.useState(null),[ee,L]=D.useState(!1);async function te(){var C;const z=await ab();a(z),((C=z.login)==null?void 0:C.status)==="pending"&&(H(z.login),S(!0))}async function de(z){d(!0),b("");try{a(await lb(z))}catch(C){b(Ge(C).message)}finally{d(!1)}}D.useEffect(()=>{let z=!1;return ab().then(C=>{var W;z||(a(C),((W=C.login)==null?void 0:W.status)==="pending"&&(H(C.login),S(!0)),C.accounts.length>0&&(d(!0),lb(!1).then(fe=>{z||a(fe)}).catch(fe=>{z||b(Ge(fe).message)}).finally(()=>{z||d(!1)})))}).catch(C=>{z||b(Ge(C).message)}).finally(()=>{z||u(!1)}),()=>{z=!0}},[]),D.useEffect(()=>{if(!M||M.status!=="pending")return;let z=!1;const C=window.setInterval(()=>{Y2(M.id).then(async W=>{z||(H(W),W.status!=="pending"&&(window.clearInterval(C),W.status==="succeeded"&&a(fe=>{if(!fe||!W.account)return fe;const X=fe.accounts.some(xe=>{var Me;return xe.id===((Me=W.account)==null?void 0:Me.id)})?fe.accounts.map(xe=>{var Me;return xe.id===((Me=W.account)==null?void 0:Me.id)?W.account:xe}):[...fe.accounts,W.account];return{...fe,accounts:X}})))}).catch(W=>{z||b(Ge(W).message)})},1e3);return()=>{z=!0,window.clearInterval(C)}},[M==null?void 0:M.id,M==null?void 0:M.status]);function Ne(){E(""),H(null),b(""),L(!1),S(!0)}async function ye(z){z.preventDefault(),g(!0),b("");try{H(await F2(w.trim()))}catch(C){b(Ge(C).message)}finally{g(!1)}}async function ue(){if(!M||M.status!=="pending"){S(!1);return}g(!0),b("");try{const z=await P2(M.id);H(z),S(!1)}catch(z){b(Ge(z).message)}finally{g(!1)}}function F(z){q(z),V(z.name),b("")}async function oe(z){if(z.preventDefault(),!R)return;const C=$.trim();if(!C||C===R.name){q(null);return}g(!0),b("");try{await W2(R.id,C),await te(),q(null)}catch(W){b(Ge(W).message)}finally{g(!1)}}async function be(){var z;if(ie){g(!0),b("");try{const C=await X2(ie.id);a(C),N(null),await e()}catch(C){const W=Ge(C);b((z=W.detail)!=null&&z.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":W.detail??W.message)}finally{g(!1)}}}async function _e(){if(Q){g(!0),b("");try{await K2(Q.id),await te(),re(null)}catch(z){b(Ge(z).detail??Ge(z).message)}finally{g(!1)}}}const O=(i==null?void 0:i.accounts)??[];return s.jsxs("section",{className:"settings-section codex-accounts-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex Accounts"}),s.jsx("p",{children:"Manage the cloud-owned Codex logins. Every deployment uses the same globally active account; workspaces do not bind to accounts."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||O.length===0,onClick:()=>void de(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(M==null?void 0:M.status)==="pending",onClick:Ne,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Cloud-wide active account"}),s.jsx("span",{children:"Switching requires the cloud runtime to be idle. The cloud publishes the selected credential; members pause new work and apply it after any active turn finishes. There is no per-deployment selection."})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,r?s.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!r&&O.length===0?s.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,s.jsx("div",{className:"codex-account-list",children:O.map(z=>{var Ve,Ct;const C=(i==null?void 0:i.activeAccountId)===z.id,W=(Ve=i==null?void 0:i.accountDetails)==null?void 0:Ve[z.id],fe=((Ct=i==null?void 0:i.accountIssues)==null?void 0:Ct[z.id])??[],X=fe.length>0,xe=fe.some(vt=>["missing_credential","invalid_credential","credential_unreadable"].includes(vt.code)),Me=[z.email,FA(z.accountType),YA(z.planType)].filter(vt=>!!vt);return s.jsxs("article",{className:`codex-account-card${C?" active":""}${X?" issue":""}`,children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:z.name}),C?s.jsx("span",{className:"codex-account-active",children:"Active"}):null,X?s.jsx("span",{className:"codex-account-warning",children:"Needs attention"}):null]}),s.jsx("small",{children:Me.join(" · ")||`Added ${He(z.createdAt)}`}),X?s.jsx("div",{className:"codex-account-issues",role:"status",children:fe.map(vt=>s.jsx("span",{children:vt.message},vt.code))}):null,W!=null&&W.usage?s.jsx(VA,{usage:W.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),W?s.jsx("small",{className:W.error?"codex-account-detail-error":"codex-account-refreshed",children:W.error?`Refresh issue: ${W.error}`:`Updated ${He(W.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c||xe,onClick:()=>F(z),title:xe?"Sign in again or delete this account to replace its credential.":void 0,type:"button",children:X?"Repair & rename":"Rename"}),s.jsx("button",{disabled:p||c||C||X,onClick:()=>{b(""),N(z)},type:"button",children:C?"In use":X?"Unavailable":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||C,onClick:()=>{b(""),re(z)},type:"button",children:"Delete"})]})]},z.id)})}),R?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&q(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void oe(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Rename Codex Account"}),s.jsx("button",{"aria-label":"Close account rename",className:"memory-icon-button",disabled:p,onClick:()=>q(null),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:z=>V(z.target.value),value:$})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>q(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!$.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!M&&S(!1),role:"presentation",children:M?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:M.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void ue(),type:"button",children:"×"})]}),M.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),s.jsxs("div",{className:"codex-device-code",children:[s.jsx("strong",{children:M.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(M.userCode),L(!0),window.setTimeout(()=>L(!1),1500)},type:"button",children:ee?"Copied":"Copy code"})]}),s.jsx("a",{href:M.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),s.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):M.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=M.account)==null?void 0:A.name)??M.accountName})," is persisted on the cloud and ready to synchronize. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:M.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void ue(),type:"button",children:M.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void ye(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>S(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates the login profile on the cloud. Completing login shares it with every deployment but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:z=>E(z.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>S(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,ie?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&N(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>N(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch cloud-wide execution to ",s.jsx("strong",{children:ie.name}),"? The cloud runtime must be idle. Member deployments finish active turns, pause new work, and then install this credential; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>N(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void be(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,Q?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&re(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Codex Account"}),s.jsx("button",{"aria-label":"Close account deletion",className:"memory-icon-button",disabled:p,onClick:()=>re(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:Q.name})," and its persisted Codex credential from the cloud and every member mirror? This cannot be undone."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>re(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:p,onClick:()=>void _e(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function WA({currentUser:e,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=D.useState(null),[g,m]=D.useState(c),[b,x]=D.useState(!1),[S,w]=D.useState(null),[E,M]=D.useState("");function H(){m(c),M(""),p("new")}function R(V){m({username:V.username,password:"",role:V.role,active:V.active}),M(""),p(V)}function q(){b||(p(null),M(""))}async function $(V){if(V.preventDefault(),!!d){x(!0),M("");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}),p(null)}catch(ie){M(Ge(ie).message)}finally{x(!1)}}}return s.jsxs("section",{className:"settings-section user-management-section",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Users"}),s.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:H,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(V=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:V.username}),V.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",He(V.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${V.role}`,children:V.role}),s.jsx("span",{className:`user-status ${V.active?"active":"disabled"}`,children:V.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${V.username}`,className:"memory-icon-button",onClick:()=>R(V),title:"Edit",type:"button",children:s.jsx(cd,{})}),s.jsx("button",{"aria-label":`Delete user ${V.username}`,className:"memory-icon-button memory-item-delete",disabled:V.id===e.id,onClick:()=>{M(""),w(V)},title:"Delete",type:"button",children:"×"})]})]},V.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:q,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:V=>V.stopPropagation(),onSubmit:V=>void $(V),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:q,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:V=>m(ie=>({...ie,username:V.target.value})),placeholder:"Sign-in username",value:g.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:d==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:V=>m(ie=>({...ie,password:V.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:V=>m(ie=>({...ie,role:V.target.value==="admin"?"admin":"user"})),value:g.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:V=>m(ie=>({...ie,active:V.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,E?s.jsx("p",{className:"memory-editor-error",children:E}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:q,type:"button",children:"Cancel"}),s.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,S?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:V=>V.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete User"}),s.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>w(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:S.username}),". Users that own workspaces must be disabled instead."]}),E?s.jsx("p",{className:"memory-editor-error",children:E}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>w(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(S.id).then(()=>w(null)).catch(V=>M(Ge(V).message))},type:"button",children:"Delete"})]})]})}):null]})}function KA({settings:e,onSave:i}){const[a,r]=D.useState(e),[u,c]=D.useState(!1);return D.useEffect(()=>r(e),[e]),s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Deployment"}),s.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:d=>{d.preventDefault(),c(!0),i(a).finally(()=>c(!1))},children:[s.jsxs("label",{className:"settings-field settings-field-wide",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Public URL"}),s.jsx("small",{children:"The externally reachable main URL of this deployment. Seele uses it when publishing callback links to external systems."})]}),s.jsx("input",{"aria-label":"Public URL of this deployment",onChange:d=>r({...a,publicUrl:d.target.value||null}),placeholder:"https://profuse.antgroup-inc.cn/codex/yishao-0/",type:"url",value:a.publicUrl||""})]}),s.jsxs("label",{className:"settings-toggle-field",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Profuse notification"}),s.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),s.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:a.profuseNotificationEnabled,onChange:d=>r({...a,profuseNotificationEnabled:d.target.checked}),type:"checkbox"})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:u,type:"submit",children:u?"Saving...":"Save deployment settings"})})]})]})}function XA({codexReleasedAt:e,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:S,onUpdateCodexCli:w}){var V;const E=d==="workspace",M=Jo(r.model,c),H=Jo(u.model,c),R=Jo(p.model,c),q=Cx(r.reasoningEffort,M),$=HE(M,r.reasoningEffort);return D.useEffect(()=>{M&&q!==r.reasoningEffort&&b({...r,reasoningEffort:q})},[r,M,q,b]),s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),E?s.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:S,children:[s.jsxs("label",{className:Bc(E,Tl(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(Uc,{globalValue:pb(u.model,c),isWorkspaceScope:E,label:"Model",settingKey:"model",source:Tl(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(jp,{"aria-label":"Runtime model",onChange:ie=>{const N=Jo(ie,c);b({...r,model:ie,reasoningEffort:Cx(r.reasoningEffort,N)})},options:oR(c,r.model),value:r.model||((V=c.find(ie=>ie.isDefault))==null?void 0:V.model)||""})]}),s.jsxs("label",{className:Bc(E,Tl(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(Uc,{globalValue:jx(u.reasoningEffort,H),isWorkspaceScope:E,label:"Reasoning effort",settingKey:"reasoningEffort",source:Tl(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(jp,{"aria-label":"Runtime reasoning effort",onChange:ie=>b({...r,reasoningEffort:ie}),options:$,value:q})]}),s.jsxs("label",{className:Bc(E,Tl(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(Uc,{globalValue:gb(u.sandbox),isWorkspaceScope:E,label:"Permission mode",settingKey:"sandbox",source:Tl(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(jp,{"aria-label":"Permission mode",onChange:ie=>b({...r,sandbox:ie}),options:pA,value:r.sandbox})]}),s.jsxs("label",{className:Bc(E,Tl(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Uc,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:E,label:"Fast mode",settingKey:"fastMode",source:Tl(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:x}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:ie=>b({...r,fastMode:ie.target.checked}),type:"checkbox"})]}),s.jsxs("dl",{className:"runtime-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsxs("dd",{children:["Model ",pb(p.model,c),", reasoning"," ",jx(p.reasoningEffort,R),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",gb(p.sandbox),"."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:lh(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:a,onClick:w,type:"button",children:a?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:E?"Save workspace overrides":"Save global runtime"})})]})]})}function Uc({globalValue:e,isWorkspaceScope:i,label:a,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:a}),i?s.jsxs("span",{className:"runtime-field-meta",children:[s.jsx("span",{className:d?"override":"inherited",children:d?"Workspace override":`Inherited: ${e}`}),d?s.jsx("button",{type:"button",onClick:()=>c(r),children:"Reset"}):null]}):null]})}function jp({"aria-label":e,onChange:i,options:a,value:r}){const[u,c]=D.useState(!1),d=D.useRef(null),p=a.find(g=>g.value===r)??a[0]??null;return D.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]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:a.map(g=>s.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 Tl(e,i,a){return e!==i?"workspace":a}function Bc(e,i,a="settings-wide-field"){return[a,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function QA({baseSettings:e,scope:i,workspaceSettings:a,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?a.items:e.items,g=d?c:u;return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),s.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?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(JA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(ZA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function ZA({ariaLabel:e,emptyText:i,items:a,onSaveItems:r,title:u}){var Q;const[c,d]=D.useState(ru(a)),[p,g]=D.useState(null),[m,b]=D.useState({key:"",value:""}),[x,S]=D.useState(null),[w,E]=D.useState(null),[M,H]=D.useState(null);D.useEffect(()=>{d(ru(a))},[a]),D.useEffect(()=>{if(p===null)return;const re=ee=>{ee.key==="Escape"&&(V(),E(null))};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[p]);async function R(re,ee){H(ee);try{const L=await r(re);return d(ru(L)),L}finally{H(null)}}function q(){E(null),S(null),b({key:"",value:""}),g("new")}function $(re){const ee=c[re];ee&&(E(null),S(null),b({...ee}),g(re))}function V(){g(null),S(null),b({key:"",value:""})}async function ie(re){const ee=c[re],L=(ee==null?void 0:ee.key)||`${re}`;await R(c.filter((te,de)=>de!==re),`delete:${L}`),E(null)}async function N(re){re.preventDefault(),re.stopPropagation();const ee=m.key.trim(),L=hD(ee);if(L){S(L);return}const te=m.value.trim();if(!te){S("Value is required.");return}const de=p==="new"?-1:p;if(c.some((ye,ue)=>ue!==de&&ye.key.trim()===ee)){S(`Key "${ee}" already exists. Each memory key must be unique.`);return}const Ne={...m,key:ee,value:te};p==="new"?await R([...c,Ne],"add"):typeof p=="number"&&await R(c.map((ye,ue)=>ue===p?Ne:ye),`save:${p}`),V()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:q,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((re,ee)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${re.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${re.key}>`}),`
|
|
94
94
|
`,s.jsx("span",{children:re.value}),`
|
|
95
95
|
`,s.jsx("span",{className:"memory-tag",children:`</${re.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${re.key||ee+1}`,className:"memory-icon-button memory-item-edit",disabled:M!==null,title:"Edit",type:"button",onClick:()=>$(ee),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${re.key||ee+1}`,className:"memory-icon-button memory-item-delete",disabled:M!==null,title:"Delete",type:"button",onClick:()=>E(ee),children:"×"})]})]},`${ee}-${re.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:V,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:re=>re.stopPropagation(),onSubmit:re=>void N(re),children:[s.jsxs("header",{children:[s.jsx("strong",{children:p==="new"?"Add Memory":"Edit Memory"}),s.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:V,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:re=>b(ee=>({...ee,key:re.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value · up to 1000 tokens"}),s.jsx("textarea",{onChange:re=>b(ee=>({...ee,value:re.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),x?s.jsx("p",{className:"memory-editor-error",children:x}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:V,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:M!==null,type:"submit",children:M==="add"||M!=null&&M.startsWith("save:")?"Saving...":"Save"})]})]})}):null,w!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>E(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:re=>re.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Memory"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>E(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((Q=c[w])==null?void 0:Q.key)||`item ${w+1}`}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:M!==null,type:"button",onClick:()=>E(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:M!==null,type:"button",onClick:()=>void ie(w),children:"Delete"})]})]})}):null]})}function JA({emptyText:e,items:i}){const a=ru(i);return a.length?s.jsx("div",{className:"memory-items-list",children:a.map(r=>s.jsx("div",{className:"memory-item-display memory-item-readonly",children:s.jsxs("pre",{"aria-label":`Memory item ${r.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${r.key}>`}),`
|
|
96
96
|
`,s.jsx("span",{children:r.value}),`
|
|
97
|
-
`,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function eN({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:S,onSubmitEnvironment:w,onValueVisibleChange:E,revealedEnvironmentKeys:M}){const H=i!==null&&M.has(i),R=u==="workspace",q=R?c:r,[$,V]=D.useState(!1);function ie(){p(),b({description:"",key:"",value:""}),E(!1),V(!0)}function N(ee){x(ee),E(!1),V(!0)}function Q(){V(!1),p(),E(!1)}function re(ee){w(ee),V(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:R?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:R?"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."})]})}),R?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Environment"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(Lx,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,s.jsxs("section",{className:"environment-manager",children:[s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:ie,children:"+"})}),s.jsx(Lx,{emptyText:R?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:ee=>g(ee),onEdit:N,variables:q})]}),$?s.jsx("div",{className:"memory-editor-overlay",onClick:Q,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:ee=>ee.stopPropagation(),onSubmit:re,children:[s.jsxs("header",{children:[s.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:Q,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:ee=>b({...a,key:ee.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:a.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:ee=>b({...a,value:ee.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:a.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!H&&!a.value){S(i),E(!0);return}E(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(T2,{}):s.jsx(C2,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:ee=>b({...a,description:ee.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:a.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:Q,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!a.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:ee=>ee.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function Lx({emptyText:e,onDelete:i,onEdit:a,readonly:r=!1,variables:u}){return u.length===0?s.jsx("p",{className:"settings-note",children:e}):s.jsx("div",{className:r?"environment-list readonly":"environment-list",children:u.map(c=>s.jsxs("div",{className:r?"environment-row readonly":"environment-row",children:[s.jsxs("div",{className:"environment-row-main",children:[s.jsxs("pre",{"aria-label":`Environment variable ${c.key}`,children:[s.jsx("span",{className:"memory-tag",children:c.key}),"=",c.hasValue?"••••••":"",c.description?s.jsx("span",{className:"environment-comment",children:` # ${c.description}`}):null]}),s.jsxs("span",{children:[c.hasValue?"configured":"empty"," · updated"," ",He(c.updatedAt)]})]}),r?s.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):s.jsxs("div",{className:"environment-row-actions",children:[s.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:"✎"}),s.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 Gv({items:e,onDelete:i,onEdit:a}){const[r,u]=D.useState(null),[c,d]=D.useState(null);return e.length===0?s.jsxs("section",{className:"knowledge-empty",children:[s.jsx("h4",{children:"No knowledge registered"}),s.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."})]}):s.jsx("div",{className:"knowledge-list",children:e.map(p=>s.jsxs("article",{className:"knowledge-row",children:[s.jsxs("div",{className:"knowledge-row-main",children:[s.jsxs("header",{children:[s.jsx("strong",{children:p.name}),s.jsx("span",{children:nN(p.kind)}),s.jsx("span",{className:lN(p.status),children:iN(p.status)})]}),s.jsx("p",{children:p.purpose||p.description||"No purpose set."}),s.jsxs("div",{className:"knowledge-paths",children:[s.jsx("code",{children:p.digestPath}),s.jsx("code",{children:p.skillPath}),s.jsx("code",{children:p.fetch.scriptPath})]}),p.fetch.requiredEnv.length>0?s.jsx("div",{className:"knowledge-envs",children:p.fetch.requiredEnv.map(g=>s.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===p.id?s.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,s.jsxs("small",{children:[p.attention," · ",aN(p.refreshPolicy)," · updated ",He(p.updatedAt)]})]}),s.jsx("div",{className:"environment-row-actions",children:r===p.id?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"danger",onClick:()=>{i(p.id),u(null)},type:"button",children:"Delete"}),s.jsx("button",{onClick:()=>u(null),type:"button",children:"Cancel"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`Check ${p.name}`,onClick:()=>d(p.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),s.jsx("button",{"aria-label":`Edit ${p.name}`,onClick:()=>a(p),title:"Edit knowledge",type:"button",children:s.jsx(dd,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function tN({draft:e,items:i,scope:a,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:g}){return a==="workspace"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.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."]})]})}),s.jsx(Gv,{items:i,onDelete:c,onEdit:p}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[s.jsxs("div",{className:"knowledge-form-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Edit metadata"}),s.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),s.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),s.jsxs("div",{className:"knowledge-form-grid",children:[s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...e,name:b.target.value}),value:e.name})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Kind"}),s.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...e,kind:b.target.value}),value:e.kind,children:[s.jsx("option",{value:"source",children:"Source"}),s.jsx("option",{value:"skill",children:"Skill"}),s.jsx("option",{value:"reference",children:"Reference"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Status"}),s.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...e,status:b.target.value}),value:e.status,children:[s.jsx("option",{value:"draft",children:"Draft"}),s.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),s.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),s.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),s.jsx("option",{value:"ready",children:"Ready"}),s.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Attention"}),s.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...e,attention:b.target.value}),value:e.attention,children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"tracked",children:"Tracked"}),s.jsx("option",{value:"watch",children:"Watch"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Refresh"}),s.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...e,refreshPolicy:b.target.value}),value:e.refreshPolicy,children:[s.jsx("option",{value:"manual",children:"Manual"}),s.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Purpose"}),s.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...e,purpose:b.target.value}),rows:2,value:e.purpose})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Content"}),s.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...e,description:b.target.value}),rows:2,value:e.description})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Source clues"}),s.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...e,sourceCluesText:b.target.value}),rows:4,value:e.sourceCluesText})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Required environment"}),s.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...e,requiredEnvText:b.target.value}),rows:3,value:e.requiredEnvText})]}),s.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."}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):s.jsxs("section",{className:"settings-empty-section",children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.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 nN(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function iN(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function aN(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function lN(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function Je({label:e,value:i,mono:a=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:a?"mono":void 0,title:i,children:i})]})}function rN({onRefresh:e,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=D.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,sN(p)]).sort(([d],[p])=>{const g=r.indexOf(d),m=r.indexOf(p);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Ix(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs("div",{className:"additional-context-preview",children:[s.jsx("div",{className:"additional-context-header",children:s.jsxs("div",{className:"additional-context-meta",children:[s.jsxs("span",{children:["Generated ",He(i.generatedAt)]}),s.jsxs("span",{children:[Ln(u.length)," keys"]}),s.jsx("button",{disabled:a,onClick:e,type:"button",children:a?"Rendering...":"Refresh"})]})}),s.jsxs("div",{className:"additional-context-toc",children:[s.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),s.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>s.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),s.jsx("div",{className:"additional-context-list",children:u.map(([d,p])=>s.jsxs("section",{className:"additional-context-item",id:Ix(d),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",d,">"]}),s.jsxs("span",{children:[Ln(p.length)," chars"]})]}),s.jsx("pre",{children:p})]},d))})]})}function Ix(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function sN(e){if(typeof e=="string")return e;if(e!==null&&typeof e=="object"&&"value"in e&&typeof e.value=="string")return e.value;if(e==null)return"";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function oN({summary:e}){return s.jsxs("div",{className:"thread-read-summary",children:[s.jsxs("section",{className:"thread-read-summary-grid",children:[s.jsx(Je,{label:"Thread",value:e.id,mono:!0}),s.jsx(Je,{label:"Session",value:e.sessionId,mono:!0}),s.jsx(Je,{label:"Status",value:e.status}),s.jsx(Je,{label:"Source",value:e.source}),s.jsx(Je,{label:"Created",value:Wo(e.createdAt)}),s.jsx(Je,{label:"Updated",value:Wo(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:Wo(e.recencyAt)}),s.jsx(Je,{label:"Turns",value:Ln(e.turnCount),mono:!0}),s.jsx(Je,{label:"Items",value:Ln(e.itemCount),mono:!0}),s.jsx(Je,{label:"User / agent",value:`${Ln(e.userMessageCount)} / ${Ln(e.agentMessageCount)}`,mono:!0}),s.jsx(Je,{label:"Compactions",value:`${Ln(e.compactionCount)} / ${Ln(e.contextCompactionCount)} context`,mono:!0}),s.jsx(Je,{label:"CWD",value:e.cwd,mono:!0}),s.jsx(Je,{label:"Path",value:e.path,mono:!0})]}),e.preview?s.jsxs("details",{className:"thread-read-preview",children:[s.jsx("summary",{children:"Preview"}),s.jsx("p",{children:e.preview})]}):null,s.jsxs("section",{className:"thread-read-turns",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Turns"}),s.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),s.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((i,a)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",a+1]}),s.jsx("span",{title:i.id,children:i.id}),s.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),s.jsxs("div",{className:"thread-read-turn-detail",children:[s.jsxs("div",{className:"thread-read-turn-fields",children:[s.jsx(Je,{label:"Status",value:i.status}),s.jsx(Je,{label:"Items view",value:i.itemsView}),s.jsx(Je,{label:"Started",value:Wo(i.startedAt)}),s.jsx(Je,{label:"Completed",value:Wo(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":As(i.durationMs)}),s.jsx(Je,{label:"Item types",value:i.itemTypes||"none"})]}),i.preview?s.jsx("p",{className:"thread-read-turn-preview",children:i.preview}):null,s.jsxs("details",{className:"thread-read-turn-raw",children:[s.jsx("summary",{children:"Turn raw JSON"}),s.jsx("pre",{children:JSON.stringify(i.raw,null,2)})]})]})]},i.id))})]})]})}function Ko(e,i,a,r,u,c,d,p,g,m){var b,x,S,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":He(e.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:"Seele"}),s.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":He(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(Zo,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":He(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(Kx,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":He(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:gR(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:He(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(Kx,{content:e.message.content}):s.jsx(Zo,{content:e.message.content,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="system"){if((b=e.topicMessages)!=null&&b.length)return s.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(M=>s.jsx("article",{className:"message topic-input","data-hover-time":He(M.createdAt),children:s.jsxs("div",{className:"topic-message-bubble topic-input-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["From ",M.senderName]}),s.jsx("time",{dateTime:M.createdAt,children:He(M.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Zo,{content:M.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},M.id))});const E=vr({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":He(e.createdAt),children:s.jsx("div",{className:"message-main",children:s.jsxs("button",{className:`system-message-body system-message-link${e.visualKind?` ${e.visualKind}`:""}`,onClick:()=>m==null?void 0:m(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(Wc,{})}):null,s.jsx("span",{className:"system-message-title",children:e.title}),s.jsx("small",{children:E})]})})})}return e.type==="steerMarker"?s.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[s.jsx("span",{children:"Added while running"}),s.jsx("strong",{children:e.content})]}):e.tool.linkedTaskId&&g?s.jsx(Fv,{description:e.tool.body,icon:s.jsx(Vv,{}),onClick:()=>void g(e.tool.linkedTaskId),timestamp:e.tool.createdAt,title:"View complex task details",trailing:e.tool.meta,visibleTitle:e.tool.title}):e.tool.kind==="command"?s.jsx(vN,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(xN,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(gN,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(yN,{tool:e.tool,onRespond:p}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?s.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":He(e.tool.createdAt),title:He(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Wc,{})}),s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsxs("div",{className:"topic-message-bubble topic-output-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["To ",e.tool.topicRecipientLabel??"Topic"]}),s.jsx("time",{dateTime:e.tool.createdAt,children:He(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Zo,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(S=e.tool.rawEvents)!=null&&S.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":He(e.tool.createdAt),title:He(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Wc,{})}):null,s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsx("code",{children:e.tool.body}),e.tool.output?s.jsx("pre",{children:e.tool.output}):null,(w=e.tool.rawEvents)!=null&&w.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function Ux(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&uN(e.tool)}function uN(e){return e.kind==="responsibility"||e.kind==="workspaceChange"&&!!(e.workspaceChangeProposalId??e.responsibilityProposalId)||e.kind==="knowledge"||e.kind==="collaboration"&&e.topicAction==="send"||!!e.linkedTaskId||e.meta==="approval"}function cN(e){const i=[],a=[];for(const r of e)r.type==="tool"&&(r.tool.kind==="collaboration"&&r.tool.topicAction==="send"||r.tool.kind==="workspaceChange"||r.tool.kind==="responsibility")?a.push(r):i.push(r);return[...i,...a]}function dN({group:e,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:S,onOpenComplexTask:w,onOpenSystemEvent:E}){const M=cN(e.agentItems.filter(Ux)),H=e.agentItems.some(te=>!Ux(te)),R=a&&(H||e.turnIds.length>0),q=c?"process":"result",[$,V]=D.useState(q),[ie,N]=D.useState(!1),Q=$==="result"?M:e.agentItems,re=SN(Q);D.useEffect(()=>{ie||V(q)},[q,ie]);const ee=c||R||e.stopped,L=s.jsxs(s.Fragment,{children:[ee?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):R?s.jsx("button",{"aria-label":$==="result"?"Show process":"Show result",className:"turn-view-toggle",title:$==="result"?"Show process":"Show result",type:"button",onClick:()=>{N(!0),V(te=>te==="result"?(g(e.turnIds),"process"):"result")},children:$==="result"?s.jsx(fN,{}):s.jsx(pN,{})}):null}):null,Q.map(te=>s.jsx(D.Fragment,{children:Ko(te,i,m,d,u,b,x,S,w,E)},te.id)),$==="result"&&Q.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":H?"No reliable final answer captured":"No result yet"}):null,s.jsx(Xo,{copied:r,content:re,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:jN(Q),variant:"outside",onCopy:p})]});return e.stopped?s.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[s.jsxs("summary",{children:[s.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),s.jsx("span",{children:"Run stopped by user"})]}),s.jsx("div",{className:ee?"stopped-turn-body has-controls":"stopped-turn-body",children:L})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ee?"has-controls":""].filter(Boolean).join(" "),children:L})}function fN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function pN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function hN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:s.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function Vv(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"15",viewBox:"0 0 24 24",width:"15",children:[s.jsx("circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"18",cy:"7",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"12",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.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 mN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:s.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function Fv({className:e="",description:i,icon:a,onClick:r,timestamp:u,title:c,trailing:d,visibleTitle:p}){return s.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":He(u),onClick:r,title:c,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:a}),s.jsxs("span",{className:"compact-timeline-link-copy",children:[s.jsx("strong",{children:p}),s.jsx("small",{children:i})]}),d?s.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function gN({conversation:e,tool:i,onRespond:a}){var H;const r=Ce((H=i.workspaceChangePayload)==null?void 0:H.content)||i.body,[u,c]=D.useState(r),[d,p]=D.useState(null),[g,m]=D.useState("source"),[b,x]=D.useState(!1),S=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:S?"pending":"preparing",E=w==="pending";D.useEffect(()=>{c(r)},[r]);async function M(R){p(R);try{await a(i,R,R==="accept"?{content:u}:void 0)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Fv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(dd,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:R=>R.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",He(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:S?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,E?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:R=>c(R.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:Tl(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Tl(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:E?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void M("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void M("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function yN({tool:e,onRespond:i}){const[a,r]=D.useState(e.body),[u,c]=D.useState(null),[d,p]=D.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=Bx(a);return D.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":He(e.createdAt),title:He(e.createdAt),children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:e.title}),s.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),s.jsx("span",{children:g})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:a}):b?s.jsx(qx,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(qx,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:a}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{Bx(a)&&(c("accept"),Promise.resolve(i(e,"accept",a)).finally(()=>c(null)))},children:u==="accept"?"Saving...":"Save"}),s.jsx("button",{className:"reject",disabled:!!u,type:"button",onClick:()=>{c("decline"),Promise.resolve(i(e,"decline",a)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function Bx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function Cp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function qx({value:e,saved:i}){return s.jsx("div",{className:`knowledge-proposal-preview${i?" saved":""}`,children:s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:Cp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:Cp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:Cp(e.content??e.description)})]})]})})}function xN({conversation:e,tool:i}){var d;const a=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=IE(a),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":He(i.createdAt),title:He(i.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),s.jsx("span",{className:"file-change-title",children:LE(a,r)})]}),s.jsx(Hx,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:a.map((p,g)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:bN(p.kind)}),s.jsx("code",{title:p.path,children:Av(p.path,r)}),s.jsx(Hx,{additions:p.additions,deletions:p.deletions})]},`${p.path}:${g}`))}),(d=i.rawEvents)!=null&&d.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(i.rawEvents,null,2)})]}):null]})}function Hx({additions:e,deletions:i,running:a=!1}){return s.jsxs("span",{className:"file-change-stats",children:[a?s.jsx("small",{children:"editing"}):null,e>0?s.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,i>0?s.jsxs("span",{className:"file-change-deletions",children:["-",i]}):null]})}function bN(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function vN({tool:e,onRespondApproval:i}){var S;const a=HD(e),[r,u]=D.useState(!1),[c,d]=D.useState("script"),p=a==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=id(e.body)?null:e.body,m=g?YD(g):null,b=m?`${wN(a)} · ${m}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",x=$D(e,a);return s.jsxs("article",{className:`tool-card command ${a}`,"data-hover-time":He(e.createdAt),title:He(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(w=>!w),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:b}),s.jsx("small",{className:"tool-command-badge",children:x})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(S=e.rawEvents)!=null&&S.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx($x,{content:g}):s.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?s.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[s.jsx("p",{className:"tool-command-result-meta",children:GD(e,a)}),e.output?s.jsx($x,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:a==="running"?"Waiting for output...":a==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(kN,{events:e.rawEvents??[]}):null]})}function wN(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function $x({content:e}){const[i,a]=D.useState(!1),r=FD(e,Mx);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:VD(e,Mx)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function kN({events:e}){return s.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function Xo({copied:e,content:i,id:a,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?s.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?s.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:s.jsx(rw,{})}):null,s.jsx("time",{dateTime:u,children:He(u)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(a,i),title:e?"Copied":"Copy",type:"button",children:e?s.jsx("span",{"aria-hidden":"true",children:"Copied"}):s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function Qo(e){return e.type==="message"?e.message.role==="user"?e.message.content:kr(e.message.content):e.type==="assistantText"?kr(e.content):e.type==="turnError"?`Task failed
|
|
97
|
+
`,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function eN({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:S,onSubmitEnvironment:w,onValueVisibleChange:E,revealedEnvironmentKeys:M}){const H=i!==null&&M.has(i),R=u==="workspace",q=R?c:r,[$,V]=D.useState(!1);function ie(){p(),b({description:"",key:"",value:""}),E(!1),V(!0)}function N(ee){x(ee),E(!1),V(!0)}function Q(){V(!1),p(),E(!1)}function re(ee){w(ee),V(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:R?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:R?"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."})]})}),R?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Environment"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(Lx,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,s.jsxs("section",{className:"environment-manager",children:[s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:ie,children:"+"})}),s.jsx(Lx,{emptyText:R?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:ee=>g(ee),onEdit:N,variables:q})]}),$?s.jsx("div",{className:"memory-editor-overlay",onClick:Q,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:ee=>ee.stopPropagation(),onSubmit:re,children:[s.jsxs("header",{children:[s.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:Q,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:ee=>b({...a,key:ee.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:a.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:ee=>b({...a,value:ee.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:a.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!H&&!a.value){S(i),E(!0);return}E(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(T2,{}):s.jsx(C2,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:ee=>b({...a,description:ee.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:a.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:Q,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!a.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:ee=>ee.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function Lx({emptyText:e,onDelete:i,onEdit:a,readonly:r=!1,variables:u}){return u.length===0?s.jsx("p",{className:"settings-note",children:e}):s.jsx("div",{className:r?"environment-list readonly":"environment-list",children:u.map(c=>s.jsxs("div",{className:r?"environment-row readonly":"environment-row",children:[s.jsxs("div",{className:"environment-row-main",children:[s.jsxs("pre",{"aria-label":`Environment variable ${c.key}`,children:[s.jsx("span",{className:"memory-tag",children:c.key}),"=",c.hasValue?"••••••":"",c.description?s.jsx("span",{className:"environment-comment",children:` # ${c.description}`}):null]}),s.jsxs("span",{children:[c.hasValue?"configured":"empty"," · updated"," ",He(c.updatedAt)]})]}),r?s.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):s.jsxs("div",{className:"environment-row-actions",children:[s.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:"✎"}),s.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 Gv({items:e,onDelete:i,onEdit:a}){const[r,u]=D.useState(null),[c,d]=D.useState(null);return e.length===0?s.jsxs("section",{className:"knowledge-empty",children:[s.jsx("h4",{children:"No knowledge registered"}),s.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."})]}):s.jsx("div",{className:"knowledge-list",children:e.map(p=>s.jsxs("article",{className:"knowledge-row",children:[s.jsxs("div",{className:"knowledge-row-main",children:[s.jsxs("header",{children:[s.jsx("strong",{children:p.name}),s.jsx("span",{children:nN(p.kind)}),s.jsx("span",{className:lN(p.status),children:iN(p.status)})]}),s.jsx("p",{children:p.purpose||p.description||"No purpose set."}),s.jsxs("div",{className:"knowledge-paths",children:[s.jsx("code",{children:p.digestPath}),s.jsx("code",{children:p.skillPath}),s.jsx("code",{children:p.fetch.scriptPath})]}),p.fetch.requiredEnv.length>0?s.jsx("div",{className:"knowledge-envs",children:p.fetch.requiredEnv.map(g=>s.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===p.id?s.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,s.jsxs("small",{children:[p.attention," · ",aN(p.refreshPolicy)," · updated ",He(p.updatedAt)]})]}),s.jsx("div",{className:"environment-row-actions",children:r===p.id?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"danger",onClick:()=>{i(p.id),u(null)},type:"button",children:"Delete"}),s.jsx("button",{onClick:()=>u(null),type:"button",children:"Cancel"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`Check ${p.name}`,onClick:()=>d(p.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),s.jsx("button",{"aria-label":`Edit ${p.name}`,onClick:()=>a(p),title:"Edit knowledge",type:"button",children:s.jsx(cd,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function tN({draft:e,items:i,scope:a,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:g}){return a==="workspace"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.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."]})]})}),s.jsx(Gv,{items:i,onDelete:c,onEdit:p}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[s.jsxs("div",{className:"knowledge-form-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Edit metadata"}),s.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),s.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),s.jsxs("div",{className:"knowledge-form-grid",children:[s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...e,name:b.target.value}),value:e.name})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Kind"}),s.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...e,kind:b.target.value}),value:e.kind,children:[s.jsx("option",{value:"source",children:"Source"}),s.jsx("option",{value:"skill",children:"Skill"}),s.jsx("option",{value:"reference",children:"Reference"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Status"}),s.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...e,status:b.target.value}),value:e.status,children:[s.jsx("option",{value:"draft",children:"Draft"}),s.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),s.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),s.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),s.jsx("option",{value:"ready",children:"Ready"}),s.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Attention"}),s.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...e,attention:b.target.value}),value:e.attention,children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"tracked",children:"Tracked"}),s.jsx("option",{value:"watch",children:"Watch"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Refresh"}),s.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...e,refreshPolicy:b.target.value}),value:e.refreshPolicy,children:[s.jsx("option",{value:"manual",children:"Manual"}),s.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Purpose"}),s.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...e,purpose:b.target.value}),rows:2,value:e.purpose})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Content"}),s.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...e,description:b.target.value}),rows:2,value:e.description})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Source clues"}),s.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...e,sourceCluesText:b.target.value}),rows:4,value:e.sourceCluesText})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Required environment"}),s.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...e,requiredEnvText:b.target.value}),rows:3,value:e.requiredEnvText})]}),s.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."}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):s.jsxs("section",{className:"settings-empty-section",children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.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 nN(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function iN(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function aN(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function lN(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function et({label:e,value:i,mono:a=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:a?"mono":void 0,title:i,children:i})]})}function rN({onRefresh:e,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=D.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,sN(p)]).sort(([d],[p])=>{const g=r.indexOf(d),m=r.indexOf(p);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Ix(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs("div",{className:"additional-context-preview",children:[s.jsx("div",{className:"additional-context-header",children:s.jsxs("div",{className:"additional-context-meta",children:[s.jsxs("span",{children:["Generated ",He(i.generatedAt)]}),s.jsxs("span",{children:[In(u.length)," keys"]}),s.jsx("button",{disabled:a,onClick:e,type:"button",children:a?"Rendering...":"Refresh"})]})}),s.jsxs("div",{className:"additional-context-toc",children:[s.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),s.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>s.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),s.jsx("div",{className:"additional-context-list",children:u.map(([d,p])=>s.jsxs("section",{className:"additional-context-item",id:Ix(d),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",d,">"]}),s.jsxs("span",{children:[In(p.length)," chars"]})]}),s.jsx("pre",{children:p})]},d))})]})}function Ix(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function sN(e){if(typeof e=="string")return e;if(e!==null&&typeof e=="object"&&"value"in e&&typeof e.value=="string")return e.value;if(e==null)return"";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function oN({summary:e}){return s.jsxs("div",{className:"thread-read-summary",children:[s.jsxs("section",{className:"thread-read-summary-grid",children:[s.jsx(et,{label:"Thread",value:e.id,mono:!0}),s.jsx(et,{label:"Session",value:e.sessionId,mono:!0}),s.jsx(et,{label:"Status",value:e.status}),s.jsx(et,{label:"Source",value:e.source}),s.jsx(et,{label:"Created",value:Wo(e.createdAt)}),s.jsx(et,{label:"Updated",value:Wo(e.updatedAt)}),s.jsx(et,{label:"Recency",value:Wo(e.recencyAt)}),s.jsx(et,{label:"Turns",value:In(e.turnCount),mono:!0}),s.jsx(et,{label:"Items",value:In(e.itemCount),mono:!0}),s.jsx(et,{label:"User / agent",value:`${In(e.userMessageCount)} / ${In(e.agentMessageCount)}`,mono:!0}),s.jsx(et,{label:"Compactions",value:`${In(e.compactionCount)} / ${In(e.contextCompactionCount)} context`,mono:!0}),s.jsx(et,{label:"CWD",value:e.cwd,mono:!0}),s.jsx(et,{label:"Path",value:e.path,mono:!0})]}),e.preview?s.jsxs("details",{className:"thread-read-preview",children:[s.jsx("summary",{children:"Preview"}),s.jsx("p",{children:e.preview})]}):null,s.jsxs("section",{className:"thread-read-turns",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Turns"}),s.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),s.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((i,a)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",a+1]}),s.jsx("span",{title:i.id,children:i.id}),s.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),s.jsxs("div",{className:"thread-read-turn-detail",children:[s.jsxs("div",{className:"thread-read-turn-fields",children:[s.jsx(et,{label:"Status",value:i.status}),s.jsx(et,{label:"Items view",value:i.itemsView}),s.jsx(et,{label:"Started",value:Wo(i.startedAt)}),s.jsx(et,{label:"Completed",value:Wo(i.completedAt)}),s.jsx(et,{label:"Duration",value:i.durationMs===null?"unknown":Rs(i.durationMs)}),s.jsx(et,{label:"Item types",value:i.itemTypes||"none"})]}),i.preview?s.jsx("p",{className:"thread-read-turn-preview",children:i.preview}):null,s.jsxs("details",{className:"thread-read-turn-raw",children:[s.jsx("summary",{children:"Turn raw JSON"}),s.jsx("pre",{children:JSON.stringify(i.raw,null,2)})]})]})]},i.id))})]})]})}function Ko(e,i,a,r,u,c,d,p,g,m){var b,x,S,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":He(e.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:"Seele"}),s.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":He(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(Zo,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":He(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(Kx,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":He(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:gR(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:He(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(Kx,{content:e.message.content}):s.jsx(Zo,{content:e.message.content,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="system"){if((b=e.topicMessages)!=null&&b.length)return s.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(M=>s.jsx("article",{className:"message topic-input","data-hover-time":He(M.createdAt),children:s.jsxs("div",{className:"topic-message-bubble topic-input-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["From ",M.senderName]}),s.jsx("time",{dateTime:M.createdAt,children:He(M.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Zo,{content:M.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},M.id))});const E=br({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":He(e.createdAt),children:s.jsx("div",{className:"message-main",children:s.jsxs("button",{className:`system-message-body system-message-link${e.visualKind?` ${e.visualKind}`:""}`,onClick:()=>m==null?void 0:m(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(Pc,{})}):null,s.jsx("span",{className:"system-message-title",children:e.title}),s.jsx("small",{children:E})]})})})}return e.type==="steerMarker"?s.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[s.jsx("span",{children:"Added while running"}),s.jsx("strong",{children:e.content})]}):e.tool.linkedTaskId&&g?s.jsx(Fv,{description:e.tool.body,icon:s.jsx(Vv,{}),onClick:()=>void g(e.tool.linkedTaskId),timestamp:e.tool.createdAt,title:"View complex task details",trailing:e.tool.meta,visibleTitle:e.tool.title}):e.tool.kind==="command"?s.jsx(vN,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(xN,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(gN,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(yN,{tool:e.tool,onRespond:p}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?s.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":He(e.tool.createdAt),title:He(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Pc,{})}),s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsxs("div",{className:"topic-message-bubble topic-output-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["To ",e.tool.topicRecipientLabel??"Topic"]}),s.jsx("time",{dateTime:e.tool.createdAt,children:He(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Zo,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(S=e.tool.rawEvents)!=null&&S.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":He(e.tool.createdAt),title:He(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Pc,{})}):null,s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsx("code",{children:e.tool.body}),e.tool.output?s.jsx("pre",{children:e.tool.output}):null,(w=e.tool.rawEvents)!=null&&w.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function Ux(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&uN(e.tool)}function uN(e){return e.kind==="responsibility"||e.kind==="workspaceChange"&&!!(e.workspaceChangeProposalId??e.responsibilityProposalId)||e.kind==="knowledge"||e.kind==="collaboration"&&e.topicAction==="send"||!!e.linkedTaskId||e.meta==="approval"}function cN(e){const i=[],a=[];for(const r of e)r.type==="tool"&&(r.tool.kind==="collaboration"&&r.tool.topicAction==="send"||r.tool.kind==="workspaceChange"||r.tool.kind==="responsibility")?a.push(r):i.push(r);return[...i,...a]}function dN({group:e,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:S,onOpenComplexTask:w,onOpenSystemEvent:E}){const M=cN(e.agentItems.filter(Ux)),H=e.agentItems.some(te=>!Ux(te)),R=a&&(H||e.turnIds.length>0),q=c?"process":"result",[$,V]=D.useState(q),[ie,N]=D.useState(!1),Q=$==="result"?M:e.agentItems,re=SN(Q);D.useEffect(()=>{ie||V(q)},[q,ie]);const ee=c||R||e.stopped,L=s.jsxs(s.Fragment,{children:[ee?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):R?s.jsx("button",{"aria-label":$==="result"?"Show process":"Show result",className:"turn-view-toggle",title:$==="result"?"Show process":"Show result",type:"button",onClick:()=>{N(!0),V(te=>te==="result"?(g(e.turnIds),"process"):"result")},children:$==="result"?s.jsx(fN,{}):s.jsx(pN,{})}):null}):null,Q.map(te=>s.jsx(D.Fragment,{children:Ko(te,i,m,d,u,b,x,S,w,E)},te.id)),$==="result"&&Q.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":H?"No reliable final answer captured":"No result yet"}):null,s.jsx(Xo,{copied:r,content:re,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:jN(Q),variant:"outside",onCopy:p})]});return e.stopped?s.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[s.jsxs("summary",{children:[s.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),s.jsx("span",{children:"Run stopped by user"})]}),s.jsx("div",{className:ee?"stopped-turn-body has-controls":"stopped-turn-body",children:L})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ee?"has-controls":""].filter(Boolean).join(" "),children:L})}function fN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function pN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function hN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:s.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function Vv(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"15",viewBox:"0 0 24 24",width:"15",children:[s.jsx("circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"18",cy:"7",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"12",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.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 mN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:s.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function Fv({className:e="",description:i,icon:a,onClick:r,timestamp:u,title:c,trailing:d,visibleTitle:p}){return s.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":He(u),onClick:r,title:c,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:a}),s.jsxs("span",{className:"compact-timeline-link-copy",children:[s.jsx("strong",{children:p}),s.jsx("small",{children:i})]}),d?s.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function gN({conversation:e,tool:i,onRespond:a}){var H;const r=Ce((H=i.workspaceChangePayload)==null?void 0:H.content)||i.body,[u,c]=D.useState(r),[d,p]=D.useState(null),[g,m]=D.useState("source"),[b,x]=D.useState(!1),S=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:S?"pending":"preparing",E=w==="pending";D.useEffect(()=>{c(r)},[r]);async function M(R){p(R);try{await a(i,R,R==="accept"?{content:u}:void 0)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Fv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(cd,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:R=>R.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",He(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:S?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,E?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:R=>c(R.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:El(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:El(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:E?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void M("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void M("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function yN({tool:e,onRespond:i}){const[a,r]=D.useState(e.body),[u,c]=D.useState(null),[d,p]=D.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=Bx(a);return D.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":He(e.createdAt),title:He(e.createdAt),children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:e.title}),s.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),s.jsx("span",{children:g})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:a}):b?s.jsx(qx,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(qx,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:a}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{Bx(a)&&(c("accept"),Promise.resolve(i(e,"accept",a)).finally(()=>c(null)))},children:u==="accept"?"Saving...":"Save"}),s.jsx("button",{className:"reject",disabled:!!u,type:"button",onClick:()=>{c("decline"),Promise.resolve(i(e,"decline",a)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function Bx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function Cp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function qx({value:e,saved:i}){return s.jsx("div",{className:`knowledge-proposal-preview${i?" saved":""}`,children:s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:Cp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:Cp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:Cp(e.content??e.description)})]})]})})}function xN({conversation:e,tool:i}){var d;const a=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=IE(a),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":He(i.createdAt),title:He(i.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),s.jsx("span",{className:"file-change-title",children:LE(a,r)})]}),s.jsx(Hx,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:a.map((p,g)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:bN(p.kind)}),s.jsx("code",{title:p.path,children:Av(p.path,r)}),s.jsx(Hx,{additions:p.additions,deletions:p.deletions})]},`${p.path}:${g}`))}),(d=i.rawEvents)!=null&&d.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(i.rawEvents,null,2)})]}):null]})}function Hx({additions:e,deletions:i,running:a=!1}){return s.jsxs("span",{className:"file-change-stats",children:[a?s.jsx("small",{children:"editing"}):null,e>0?s.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,i>0?s.jsxs("span",{className:"file-change-deletions",children:["-",i]}):null]})}function bN(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function vN({tool:e,onRespondApproval:i}){var S;const a=HD(e),[r,u]=D.useState(!1),[c,d]=D.useState("script"),p=a==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=nd(e.body)?null:e.body,m=g?YD(g):null,b=m?`${wN(a)} · ${m}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",x=$D(e,a);return s.jsxs("article",{className:`tool-card command ${a}`,"data-hover-time":He(e.createdAt),title:He(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(w=>!w),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:b}),s.jsx("small",{className:"tool-command-badge",children:x})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(S=e.rawEvents)!=null&&S.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx($x,{content:g}):s.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?s.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[s.jsx("p",{className:"tool-command-result-meta",children:GD(e,a)}),e.output?s.jsx($x,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:a==="running"?"Waiting for output...":a==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(kN,{events:e.rawEvents??[]}):null]})}function wN(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function $x({content:e}){const[i,a]=D.useState(!1),r=FD(e,Mx);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:VD(e,Mx)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function kN({events:e}){return s.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function Xo({copied:e,content:i,id:a,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?s.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?s.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:s.jsx(rw,{})}):null,s.jsx("time",{dateTime:u,children:He(u)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(a,i),title:e?"Copied":"Copy",type:"button",children:e?s.jsx("span",{"aria-hidden":"true",children:"Copied"}):s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function Qo(e){return e.type==="message"?e.message.role==="user"?e.message.content:wr(e.message.content):e.type==="assistantText"?wr(e.content):e.type==="turnError"?`Task failed
|
|
98
98
|
|
|
99
99
|
${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(i=>!!(i!=null&&i.trim())).join(`
|
|
100
100
|
|
|
101
101
|
`):""}function SN(e){return e.map(Qo).filter(i=>i.trim()).join(`
|
|
102
102
|
|
|
103
|
-
`)}function jN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.type!=="tool")return a.createdAt}return new Date().toISOString()}function CN({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(TN,{label:Yv(i.windowDurationMins),window:i},`${i.windowDurationMins}:${i.resetsAt}`))}):s.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:s.jsx("strong",{children:"--"})})}function Yv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function TN({label:e,window:i}){const a=
|
|
104
|
-
`)}}const u=Ce(r.complexTaskId)||Ce(me(r.task).id)||void 0,c=Tv(e.title,e.subtype),d=
|
|
103
|
+
`)}function jN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.type!=="tool")return a.createdAt}return new Date().toISOString()}function CN({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(TN,{label:Yv(i.windowDurationMins),window:i},`${i.windowDurationMins}:${i.resetsAt}`))}):s.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:s.jsx("strong",{children:"--"})})}function Yv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function TN({label:e,window:i}){const a=dd(i.usedPercent),r=Lh(a),u=`${e} usage ${jw(a)} · resets ${Cw(i.resetsAt)}`;return s.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${a}%`},tabIndex:0,children:s.jsxs("strong",{children:[Math.round(a),"%"]})})}function EN(e,i,a,r,u,c){const d=[...e].sort(lu),p=new Map(r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>[N.turnId,N.sequence])),g=new Map(r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>[N.turnId,N.timelineAt])),m=new Map(r.filter(N=>N.nodeType==="user_message"&&N.entityId!==null).map(N=>[N.entityId,N.sequence])),b=new Map(r.filter(N=>N.nodeType==="user_message"&&N.entityId!==null).map(N=>[N.entityId,N.timelineAt])),x=r.filter(N=>N.parentId===null&&N.nodeType==="system_event"),S=x.filter(N=>N.turnId!==null&&N.subtype.startsWith("input:")),w=x.filter(N=>!S.includes(N)),E=new Set(x.flatMap(N=>N.turnId?[N.turnId]:[])),M=jE(i),H=new Map(a.map(N=>[N.id,N])),R=r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>N.turnId),$=[...new Set(r.length>0?[...R,...u?[u]:[]]:[...a.map(N=>N.id),...d.flatMap(N=>N.turnId?[N.turnId]:[]),...i.flatMap(N=>N.turnId?[N.turnId]:[])])].map(N=>{var Ye,St,It,sn;const Q=H.get(N),re=d.filter(Le=>Le.turnId===N),ee=re.filter(Le=>Le.role==="user").sort((Le,Ut)=>{const mn=b.get(Le.id)??Le.createdAt,Xt=b.get(Ut.id)??Ut.createdAt;return mn.localeCompare(Xt)||lu(Le,Ut)}),L=re.filter(Le=>Le.role==="assistant"),te=i.filter(Le=>Le.turnId===N).sort(lu),de=`turn:${N}`,Ne=r.filter(Le=>Le.parentId===de).sort((Le,Ut)=>Le.sequence-Ut.sequence),ye=(Q==null?void 0:Q.origin)??M.get(N),ue=S.filter(Le=>Le.turnId===N).sort((Le,Ut)=>Le.timelineAt.localeCompare(Ut.timelineAt)||Le.sequence-Ut.sequence).map(Le=>Gx(Le,void 0,c)),F=ye==="timeline_event"?[]:r.length>0?LN(Ne,te,iu([N],u),c):Wv(te,iu([N],u),c),oe=L.map(Po),be=Ne.find(Le=>Le.subtype==="server.complex_task.plan_updated"),_e=te.find(Le=>Le.event==="server.complex_task.plan_updated"),O=(be==null?void 0:be.detail)??(_e==null?void 0:_e.data),A=me(me(O).task),z=me(A.currentPlan),C=Ce(z.planMarkdown),W=RN(zN(F,oe),C),fe=CE(Q);fe&&W.push({id:`turn-error-${fe.turnId}`,type:"turnError",createdAt:fe.createdAt,content:fe.content});const X=te.find(Le=>Le.event==="server.wakeup.started"),xe=me(X==null?void 0:X.data),Me=typeof xe.instruction=="string"?xe.instruction.trim():"",Ve=ye==="timeline_event"?te[0]:void 0,Ct=E.has(N)?null:Ve?Pv(Ve,(Q==null?void 0:Q.startedAt)??new Date(0).toISOString()):_N(ye)?{id:`system-${N}`,type:"system",createdAt:(Q==null?void 0:Q.startedAt)??((Ye=te[0])==null?void 0:Ye.createdAt)??new Date(0).toISOString(),title:MN(ye??"system"),detail:ON(ye??"system",Me),fullDetail:Me||void 0}:null,vt=XN(te),rn=(ee[0]?b.get(ee[0].id):(St=S.find(Le=>Le.turnId===N))==null?void 0:St.timelineAt)??g.get(N)??(Q==null?void 0:Q.startedAt)??((It=re[0])==null?void 0:It.createdAt)??((sn=te[0])==null?void 0:sn.createdAt)??new Date(0).toISOString();return{id:`turn-${N}`,turnIds:[N],user:Ct??(ee[0]?Po(ee[0]):null),followupUsers:ee.slice(1).map(Po),acceptedSystemInputs:ue,agentItems:W,activity:vt??(iu([N],u)?{id:-1,title:W.some(Le=>Le.type==="assistantText"&&Le.streaming)?"Writing response":"Working",createdAt:rn,tone:"running"}:null),notificationFailure:KN(te),stopped:te.some(Xv),trailingSystemItems:[],sortAt:rn,sortSequence:p.get(N)??null}}),V=d.filter(N=>!N.turnId);$.push(...V.map(N=>({id:`message-${N.id}`,turnIds:[],user:N.role==="user"?Po(N):null,followupUsers:[],agentItems:N.role==="assistant"?[Po(N)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(N.id)??N.createdAt,sortSequence:m.get(N.id)??null})));const ie=new Map(i.map(N=>[String(N.id),N]));return $.push(...w.map(N=>({id:N.id,turnIds:[],user:Gx(N,N.entityType==="event"&&N.entityId?ie.get(N.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:N.timelineAt,sortSequence:N.sequence}))),$.sort((N,Q)=>{const re=N.sortAt.localeCompare(Q.sortAt);return re!==0?re:N.sortSequence!==null||Q.sortSequence!==null?(N.sortSequence??Number.MAX_SAFE_INTEGER)-(Q.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:N,...Q})=>Q)}function Gx(e,i,a){var g,m;if(i||e.entityType==="event")return Pv(i??th(e),e.createdAt);const r=me(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=Pp(r,a),x=AN(r.messages,a),S=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(E=>typeof E=="string"&&E.trim().length>0):[],w=typeof r.unreadCount=="number"?r.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:b.title,detail:b.detail,visualKind:"topic",topicMessages:x,fullDetail:[`## ${b.title}`,"","**Unread**","",String(w),"","**From**","",S.length>0?S.map(E=>{const M=a.get(E)??E;return`${gr(M)} (\`${E}\`)`}).join(", "):"Unknown"].join(`
|
|
104
|
+
`)}}const u=Ce(r.complexTaskId)||Ce(me(r.task).id)||void 0,c=Tv(e.title,e.subtype),d=br(r,[e.summary,e.contentMarkdown]),p=[`## ${gr(c)}`,"",((g=e.contentMarkdown)==null?void 0:g.trim())||((m=e.summary)==null?void 0:m.trim())||"",Object.keys(r).length>0?["","```json",JSON.stringify(r,null,2),"```"].join(`
|
|
105
105
|
`):""].filter(Boolean).join(`
|
|
106
|
-
`);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function AN(e,i){if(!Array.isArray(e))return[];const a=new Set,r=[];for(const u of e){const c=me(u),d=Ce(c.id),p=Ce(c.senderWorkspaceId),g=Ce(c.contentMarkdown).trim(),m=Ce(c.createdAt);!d||a.has(d)||!p||!g||!m||(a.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(Ce(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function Pv(e,i){return e.event==="server.collaboration.topic_created"?NN(e,i):DN(e,i)}function NN(e,i){const a=me(me(e.data).topic),r=Ce(a.title).trim()||"Untitled Topic",u=Ce(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(me):[],d=Ce(a.ownerWorkspaceId),p=c.find(x=>Ce(x.role)==="owner"||Ce(x.workspaceId)===d),g=Ce(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>Ce(x.role)!=="owner"&&Ce(x.status)==="active"),b=m.length?m.map(x=>{const S=Ce(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${
|
|
107
|
-
`)}}function DN(e,i){const a=me(e.data),r=eh(e.data),u=Tv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:
|
|
108
|
-
`)}}function eh(e,i=""){return Array.isArray(e)?e.map(a=>eh(a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,r])=>[a,eh(r,a)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&su(e)||e}function RN(e,i){const a=i.trim();return a?e.filter(r=>r.type==="assistantText"?kr(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?kr(r.message.content).trim()!==a:!0):e}function _N(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function MN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function ON(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?yw(i,20):"Auto resumed"}function zN(e,i){if(e.some(u=>u.type==="assistantText"))return nd(e);if(i.length===0)return e;const a=[...i],r=[];for(const u of e)u.type==="tool"&&Rh(u.tool)&&Dh(a,u.tool)||r.push(u);return nd([...r,...a])}function LN(e,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 e){const b=IN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(Oa(x),x)}if(a)for(const m of i)UN(e,m)||c.set(Oa(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(Oa(m),m);const p=Wv([...c.values()].sort(lu),a,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:BN(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:a&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:qN(m,r)})}return nd(p)}function IN(e,i,a){if(e.entityType==="event"&&e.entityId){const r=a.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[th(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>Nh(u)===e.entityId);return r.length>0?r:[th(e)]}return[]}function th(e){const i=me(e.detail),a=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":Ce(i.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,seq:e.sequence,event:e.entityType==="codex_item"?"codex.notification":a,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function UN(e,i){const a=i.id===void 0?null:String(i.id),r=Nh(i);return e.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function Nh(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=me(i.params),r=me(a.item);return Ce(r.id)||Ce(a.itemId)||null}function BN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function qN(e,i){var r,u;const a=me(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Pp(a,i).title:e.title||xw(e.subtype),body:e.subtype==="input:collaboration_notice"?Pp(a,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||dw(a),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Wv(e,i,a){const r=[],u=new Map,c=new Map,d=new Map;for(const p of e){if(p.event==="server.workspace_change.decision"||p.event==="server.responsibility.decision"){GN(r,p);continue}if(p.event==="server.knowledge.decision"){VN(r,p);continue}if(Xv(p)){WN(r);continue}if(p.event==="server.steer"){const E=me(p.data),M=typeof E.message=="string"?E.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:M||"Additional input",messageId:typeof E.messageId=="string"?E.messageId:void 0});continue}const g=dR(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=cR(p.data);if(m!=null&&m.text){const E=m.itemId?d.get(m.itemId)??m.phase:m.phase,M=m.itemId??`phase:${E}`,H=`${u.get(M)??""}${m.text}`,R=nw(H),q=c.get(M)??"",$=R.startsWith(q)?R.slice(q.length):R;if(u.set(M,H),c.set(M,R),$){const V=r[r.length-1];(V==null?void 0:V.type)==="assistantText"&&YN(V,m.itemId,E)?(V.content+=$,V.itemId=V.itemId??m.itemId,V.streamKey=V.streamKey??M,V.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:$,phase:E,itemId:m.itemId,streamKey:M,streaming:i})}continue}const b=fR(p.data);if(b!=null&&b.text){const E=kr(b.text),M=b.itemId??`phase:${b.phase}`,H=PN(r,b.itemId,b.phase);if(H>=0){const R=r[H];R.type==="assistantText"&&(E?(R.content=E,R.phase=b.phase,R.itemId=R.itemId??b.itemId,R.streamKey=R.streamKey??M,R.streaming=!1,$N(r,H,b.itemId)):r.splice(H,1))}else E&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:E,phase:b.phase,itemId:b.itemId,streamKey:M,streaming:!1});continue}const x=ID(p,a);if(x){x.rawEvents=[p];const E=Fx(r,x);if(E>=0){Yx(r[E],x);continue}if(Rh(x)&&Dh(r,x)||x.kind==="command"&&x.meta==="running"&&id(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const S=UD(p);if(S){S.rawEvents=[p];const E=Fx(r,S);if(E>=0){Yx(r[E],S);continue}r.push({id:`tool-${S.id}`,type:"tool",createdAt:S.createdAt,tool:S});continue}if(_E(p)){HN(r,p);continue}const w=BD(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return nd(r)}function HN(e,i){const a=Nh(i);if(a)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==a)){u.tool={...u.tool,rawEvents:Qv(u.tool.rawEvents,[i])};return}}}function $N(e,i,a){if(a)for(let r=e.length-1;r>i;r-=1){const u=e[r];u.type==="assistantText"&&u.itemId===a&&e.splice(r,1)}}function GN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.payload),d=Ce(c.content)||(typeof a.responsibility=="string"?a.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let p=e.length-1;p>=0;p-=1){const g=e[p];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){const m=ZE(g.tool.meta,u);g.tool={...g.tool,title:m==="saved"?"Workspace change applied":"Workspace change declined",meta:m,body:m==="saved"?d??g.tool.body:g.tool.body,workspaceChangePayload:m==="saved"&&Object.keys(c).length>0?c:g.tool.workspaceChangePayload};return}}}function VN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=e.length-1;d>=0;d-=1){const p=e[d];if(p.type==="tool"&&p.tool.kind==="knowledge"&&p.tool.knowledgeProposalId===r){p.tool={...p.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):p.tool.body};return}}}function Dh(e,i){const a=Kv(i);if(typeof a!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Vx(d,i))continue;const p=kr(d.content);p!==d.content&&(e[c]={...d,content:p})}let r=0,u=-1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Vx(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,a>=g)continue;const m=Math.max(0,Math.min(d.content.length,a-p)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),S=[];return b&&S.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),S.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&S.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...S),!0}if(u>=0&&a>=r){const c=e[u];return(c==null?void 0:c.type)==="assistantText"&&(e[u]={...c,pinnedToResult:!0}),e.splice(u+1,0,{id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),!0}return!1}function Vx(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function nd(e){const i=[],a=[];for(const c of e){if(c.type==="tool"&&Rh(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)Dh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return FN([...u,...r])}function Rh(e){return typeof Kv(e)=="number"}function Kv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function FN(e){const i=[];for(let a=0;a<e.length;a+=1){const r=e[a],u=e[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 YN(e,i,a){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===a}function PN(e,i,a){if(i){const r=e.findIndex(u=>u.type==="assistantText"&&u.itemId===i);if(r>=0)return r}for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(u.type==="assistantText"&&u.streaming&&(!i||!u.itemId)&&(u.phase===a||u.phase==="unknown"||a==="unknown"))return r}return-1}function Xv(e){return e.event==="server.stop"||e.event==="server.stopped"}function WN(e){for(const i of e)i.type==="tool"&&i.tool.kind==="command"&&i.tool.meta==="running"&&(i.tool={...i.tool,title:"Command stopped",meta:"stopped"})}function KN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.event!=="server.notification.failed")continue;const r=me(a.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function XN(e){for(let i=e.length-1;i>=0;i-=1){const a=bw(e[i]);if(a)return a}return null}function Fx(e,i){for(let a=e.length-1;a>=0;a-=1){const r=e[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 Yx(e,i){if(e.type!=="tool")return;const a=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&id(i.body)&&!id(e.tool.body);e.tool={...e.tool,...i,id:e.tool.id,createdAt:e.tool.createdAt,title:a?e.tool.title:i.title,body:r?e.tool.body:i.body,meta:a?e.tool.meta:i.meta,output:JD(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:Qv(e.tool.rawEvents,i.rawEvents)}}function Qv(e,i){const a=[...e??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=Oa(u);return r.has(c)?!1:(r.add(c),!0)})}function Po(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function Tp(e,i){const a=new Set,r=[...e,...i].filter(u=>a.has(u.id)?!1:(a.add(u.id),!0));return r.filter(u=>Zv(u)?!r.some(c=>QN(c,u)):!0)}function Ep(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function Ap(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function Zv(e){return e.id.startsWith("local-")}function QN(e,i){if(Zv(e)||e.role!==i.role||e.content.trim()!==i.content.trim())return!1;const a=Date.parse(e.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(a)||Number.isNaN(r)?!1:Math.abs(a-r)<=12e4}function Hc(e,i){const a=new Map,r=new Map;for(const c of[...e,...i]){const d=Oa(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const p=Jv(c,d);return p!==0?p:(r.get(Oa(c))??0)-(r.get(Oa(d))??0)})}function Px(e,i){const a=Oa(i),r=e.findIndex(c=>Oa(c)===a);if(r<0)return[...e,i];if(ZN(e[r],i))return e;const u=[...e];return u[r]=i,u}function ZN(e,i){return e.turnId===i.turnId&&e.event===i.event&&e.createdAt===i.createdAt&&e.seq===i.seq&&JSON.stringify(e.data)===JSON.stringify(i.data)}function Oa(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function lu(e,i){const a=Jv(e,i);return a!==0?a:JN(e.id,i.id)}function Jv(e,i){if(e.turnId&&i.turnId&&e.turnId===i.turnId&&typeof e.seq=="number"&&typeof i.seq=="number"&&e.seq!==i.seq)return e.seq-i.seq;const a=Date.parse(e.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 JN(e,i){return e===i?0:e===void 0?1:i===void 0?-1:typeof e=="number"&&typeof i=="number"?e-i:String(e).localeCompare(String(i))}function Wx(e,i){const a=me(e.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:e.event,data:a.payload,createdAt:a.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const Zo=D.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?nw(i):kr(i),g=a&&!r?s2(p,a):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(n2,{content:p,conversation:a}):Tl(p,a),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(r2,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},e2);function e2(e,i){var a,r,u,c;return e.content===i.content&&e.streaming===i.streaming&&e.copiedArtifactUrl===i.copiedArtifactUrl&&((a=e.conversation)==null?void 0:a.id)===((r=i.conversation)==null?void 0:r.id)&&((u=e.conversation)==null?void 0:u.workspacePath)===((c=i.conversation)==null?void 0:c.workspacePath)}function Kx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const t2=2;function n2({content:e,conversation:i}){const a=D.useRef(null),[r,u]=D.useState(null),{committedBlocks:c,activeBlock:d}=i2(e);return D.useLayoutEffect(()=>{const p=a.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=g*t2,S=Math.min(m,x);return b!==null&&S<=b?b:S})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:a,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(D.Fragment,{children:Tl(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function i2(e){const i=l2(e),a=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:a2(a),activeBlock:r}}function a2(e){const i=[];let a=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||($c(i,e.slice(a,d)),a=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&($c(i,e.slice(a,m)),a=m,u=!1),g===""&&($c(i,e.slice(a,d)),a=d)}return a<e.length&&$c(i,e.slice(a)),i}function $c(e,i){i.trim()&&e.push(i)}function l2(e){const i=e.lastIndexOf(`
|
|
106
|
+
`);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function AN(e,i){if(!Array.isArray(e))return[];const a=new Set,r=[];for(const u of e){const c=me(u),d=Ce(c.id),p=Ce(c.senderWorkspaceId),g=Ce(c.contentMarkdown).trim(),m=Ce(c.createdAt);!d||a.has(d)||!p||!g||!m||(a.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(Ce(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function Pv(e,i){return e.event==="server.collaboration.topic_created"?NN(e,i):DN(e,i)}function NN(e,i){const a=me(me(e.data).topic),r=Ce(a.title).trim()||"Untitled Topic",u=Ce(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(me):[],d=Ce(a.ownerWorkspaceId),p=c.find(x=>Ce(x.role)==="owner"||Ce(x.workspaceId)===d),g=Ce(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>Ce(x.role)!=="owner"&&Ce(x.status)==="active"),b=m.length?m.map(x=>{const S=Ce(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${gr(S)} (\`${Ce(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",gr(r),"","**描述**","",gr(u),"","**Owner Workspace**","",`${gr(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
|
|
107
|
+
`)}}function DN(e,i){const a=me(e.data),r=eh(e.data),u=Tv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:br(a),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${gr(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
|
|
108
|
+
`)}}function eh(e,i=""){return Array.isArray(e)?e.map(a=>eh(a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,r])=>[a,eh(r,a)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&su(e)||e}function RN(e,i){const a=i.trim();return a?e.filter(r=>r.type==="assistantText"?wr(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?wr(r.message.content).trim()!==a:!0):e}function _N(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function MN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function ON(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?yw(i,20):"Auto resumed"}function zN(e,i){if(e.some(u=>u.type==="assistantText"))return td(e);if(i.length===0)return e;const a=[...i],r=[];for(const u of e)u.type==="tool"&&Rh(u.tool)&&Dh(a,u.tool)||r.push(u);return td([...r,...a])}function LN(e,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 e){const b=IN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(Oa(x),x)}if(a)for(const m of i)UN(e,m)||c.set(Oa(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(Oa(m),m);const p=Wv([...c.values()].sort(lu),a,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:BN(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:a&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:qN(m,r)})}return td(p)}function IN(e,i,a){if(e.entityType==="event"&&e.entityId){const r=a.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[th(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>Nh(u)===e.entityId);return r.length>0?r:[th(e)]}return[]}function th(e){const i=me(e.detail),a=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":Ce(i.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,seq:e.sequence,event:e.entityType==="codex_item"?"codex.notification":a,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function UN(e,i){const a=i.id===void 0?null:String(i.id),r=Nh(i);return e.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function Nh(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=me(i.params),r=me(a.item);return Ce(r.id)||Ce(a.itemId)||null}function BN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function qN(e,i){var r,u;const a=me(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Pp(a,i).title:e.title||xw(e.subtype),body:e.subtype==="input:collaboration_notice"?Pp(a,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||dw(a),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Wv(e,i,a){const r=[],u=new Map,c=new Map,d=new Map;for(const p of e){if(p.event==="server.workspace_change.decision"||p.event==="server.responsibility.decision"){GN(r,p);continue}if(p.event==="server.knowledge.decision"){VN(r,p);continue}if(Xv(p)){WN(r);continue}if(p.event==="server.steer"){const E=me(p.data),M=typeof E.message=="string"?E.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:M||"Additional input",messageId:typeof E.messageId=="string"?E.messageId:void 0});continue}const g=dR(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=cR(p.data);if(m!=null&&m.text){const E=m.itemId?d.get(m.itemId)??m.phase:m.phase,M=m.itemId??`phase:${E}`,H=`${u.get(M)??""}${m.text}`,R=nw(H),q=c.get(M)??"",$=R.startsWith(q)?R.slice(q.length):R;if(u.set(M,H),c.set(M,R),$){const V=r[r.length-1];(V==null?void 0:V.type)==="assistantText"&&YN(V,m.itemId,E)?(V.content+=$,V.itemId=V.itemId??m.itemId,V.streamKey=V.streamKey??M,V.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:$,phase:E,itemId:m.itemId,streamKey:M,streaming:i})}continue}const b=fR(p.data);if(b!=null&&b.text){const E=wr(b.text),M=b.itemId??`phase:${b.phase}`,H=PN(r,b.itemId,b.phase);if(H>=0){const R=r[H];R.type==="assistantText"&&(E?(R.content=E,R.phase=b.phase,R.itemId=R.itemId??b.itemId,R.streamKey=R.streamKey??M,R.streaming=!1,$N(r,H,b.itemId)):r.splice(H,1))}else E&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:E,phase:b.phase,itemId:b.itemId,streamKey:M,streaming:!1});continue}const x=ID(p,a);if(x){x.rawEvents=[p];const E=Fx(r,x);if(E>=0){Yx(r[E],x);continue}if(Rh(x)&&Dh(r,x)||x.kind==="command"&&x.meta==="running"&&nd(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const S=UD(p);if(S){S.rawEvents=[p];const E=Fx(r,S);if(E>=0){Yx(r[E],S);continue}r.push({id:`tool-${S.id}`,type:"tool",createdAt:S.createdAt,tool:S});continue}if(_E(p)){HN(r,p);continue}const w=BD(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return td(r)}function HN(e,i){const a=Nh(i);if(a)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==a)){u.tool={...u.tool,rawEvents:Qv(u.tool.rawEvents,[i])};return}}}function $N(e,i,a){if(a)for(let r=e.length-1;r>i;r-=1){const u=e[r];u.type==="assistantText"&&u.itemId===a&&e.splice(r,1)}}function GN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.payload),d=Ce(c.content)||(typeof a.responsibility=="string"?a.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let p=e.length-1;p>=0;p-=1){const g=e[p];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){const m=ZE(g.tool.meta,u);g.tool={...g.tool,title:m==="saved"?"Workspace change applied":"Workspace change declined",meta:m,body:m==="saved"?d??g.tool.body:g.tool.body,workspaceChangePayload:m==="saved"&&Object.keys(c).length>0?c:g.tool.workspaceChangePayload};return}}}function VN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=e.length-1;d>=0;d-=1){const p=e[d];if(p.type==="tool"&&p.tool.kind==="knowledge"&&p.tool.knowledgeProposalId===r){p.tool={...p.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):p.tool.body};return}}}function Dh(e,i){const a=Kv(i);if(typeof a!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Vx(d,i))continue;const p=wr(d.content);p!==d.content&&(e[c]={...d,content:p})}let r=0,u=-1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Vx(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,a>=g)continue;const m=Math.max(0,Math.min(d.content.length,a-p)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),S=[];return b&&S.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),S.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&S.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...S),!0}if(u>=0&&a>=r){const c=e[u];return(c==null?void 0:c.type)==="assistantText"&&(e[u]={...c,pinnedToResult:!0}),e.splice(u+1,0,{id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),!0}return!1}function Vx(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function td(e){const i=[],a=[];for(const c of e){if(c.type==="tool"&&Rh(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)Dh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return FN([...u,...r])}function Rh(e){return typeof Kv(e)=="number"}function Kv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function FN(e){const i=[];for(let a=0;a<e.length;a+=1){const r=e[a],u=e[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 YN(e,i,a){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===a}function PN(e,i,a){if(i){const r=e.findIndex(u=>u.type==="assistantText"&&u.itemId===i);if(r>=0)return r}for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(u.type==="assistantText"&&u.streaming&&(!i||!u.itemId)&&(u.phase===a||u.phase==="unknown"||a==="unknown"))return r}return-1}function Xv(e){return e.event==="server.stop"||e.event==="server.stopped"}function WN(e){for(const i of e)i.type==="tool"&&i.tool.kind==="command"&&i.tool.meta==="running"&&(i.tool={...i.tool,title:"Command stopped",meta:"stopped"})}function KN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.event!=="server.notification.failed")continue;const r=me(a.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function XN(e){for(let i=e.length-1;i>=0;i-=1){const a=bw(e[i]);if(a)return a}return null}function Fx(e,i){for(let a=e.length-1;a>=0;a-=1){const r=e[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 Yx(e,i){if(e.type!=="tool")return;const a=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&nd(i.body)&&!nd(e.tool.body);e.tool={...e.tool,...i,id:e.tool.id,createdAt:e.tool.createdAt,title:a?e.tool.title:i.title,body:r?e.tool.body:i.body,meta:a?e.tool.meta:i.meta,output:JD(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:Qv(e.tool.rawEvents,i.rawEvents)}}function Qv(e,i){const a=[...e??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=Oa(u);return r.has(c)?!1:(r.add(c),!0)})}function Po(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function Tp(e,i){const a=new Set,r=[...e,...i].filter(u=>a.has(u.id)?!1:(a.add(u.id),!0));return r.filter(u=>Zv(u)?!r.some(c=>QN(c,u)):!0)}function Ep(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function Ap(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function Zv(e){return e.id.startsWith("local-")}function QN(e,i){if(Zv(e)||e.role!==i.role||e.content.trim()!==i.content.trim())return!1;const a=Date.parse(e.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(a)||Number.isNaN(r)?!1:Math.abs(a-r)<=12e4}function qc(e,i){const a=new Map,r=new Map;for(const c of[...e,...i]){const d=Oa(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const p=Jv(c,d);return p!==0?p:(r.get(Oa(c))??0)-(r.get(Oa(d))??0)})}function Px(e,i){const a=Oa(i),r=e.findIndex(c=>Oa(c)===a);if(r<0)return[...e,i];if(ZN(e[r],i))return e;const u=[...e];return u[r]=i,u}function ZN(e,i){return e.turnId===i.turnId&&e.event===i.event&&e.createdAt===i.createdAt&&e.seq===i.seq&&JSON.stringify(e.data)===JSON.stringify(i.data)}function Oa(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function lu(e,i){const a=Jv(e,i);return a!==0?a:JN(e.id,i.id)}function Jv(e,i){if(e.turnId&&i.turnId&&e.turnId===i.turnId&&typeof e.seq=="number"&&typeof i.seq=="number"&&e.seq!==i.seq)return e.seq-i.seq;const a=Date.parse(e.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 JN(e,i){return e===i?0:e===void 0?1:i===void 0?-1:typeof e=="number"&&typeof i=="number"?e-i:String(e).localeCompare(String(i))}function Wx(e,i){const a=me(e.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:e.event,data:a.payload,createdAt:a.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const Zo=D.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?nw(i):wr(i),g=a&&!r?s2(p,a):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(n2,{content:p,conversation:a}):El(p,a),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(r2,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},e2);function e2(e,i){var a,r,u,c;return e.content===i.content&&e.streaming===i.streaming&&e.copiedArtifactUrl===i.copiedArtifactUrl&&((a=e.conversation)==null?void 0:a.id)===((r=i.conversation)==null?void 0:r.id)&&((u=e.conversation)==null?void 0:u.workspacePath)===((c=i.conversation)==null?void 0:c.workspacePath)}function Kx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const t2=2;function n2({content:e,conversation:i}){const a=D.useRef(null),[r,u]=D.useState(null),{committedBlocks:c,activeBlock:d}=i2(e);return D.useLayoutEffect(()=>{const p=a.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=g*t2,S=Math.min(m,x);return b!==null&&S<=b?b:S})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:a,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(D.Fragment,{children:El(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function i2(e){const i=l2(e),a=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:a2(a),activeBlock:r}}function a2(e){const i=[];let a=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(Hc(i,e.slice(a,d)),a=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&(Hc(i,e.slice(a,m)),a=m,u=!1),g===""&&(Hc(i,e.slice(a,d)),a=d)}return a<e.length&&Hc(i,e.slice(a)),i}function Hc(e,i){i.trim()&&e.push(i)}function l2(e){const i=e.lastIndexOf(`
|
|
109
109
|
`);if(i<0)return 0;const a=[0];for(let u=0;u<e.length;u+=1)e[u]===`
|
|
110
110
|
`&&u+1<e.length&&a.push(u+1);let r=-1;for(const u of a){const c=e.indexOf(`
|
|
111
|
-
`,u),d=e.slice(u,c===-1?e.length:c);/^\s*(```|~~~)/.test(d)&&(r=r===-1?u:-1)}return r>=0?r:i+1}function r2({artifact:e,onPreview:i,onCopyUrl:a,copied:r}){return e?s.jsxs("figure",{className:"artifact-preview",children:[s.jsx("button",{className:"artifact-preview-media",onClick:()=>i(e),type:"button",children:s.jsx("img",{alt:e.name,src:e.url})}),s.jsxs("figcaption",{children:[s.jsx("span",{children:e.name}),s.jsxs("div",{className:"artifact-preview-actions",children:[s.jsx("button",{onClick:()=>i(e),type:"button",children:"Preview"}),s.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),s.jsx("button",{onClick:()=>a(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function s2(e,i){const a=new Map;for(const r of o2(e)){const u=ew(r);if(u){const c=tw(u).toLowerCase(),d=a.get(c);(!d||d2(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>u2(r,i)).filter(r=>r!==null)}function o2(e){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(e))!==null;)i.push(d[1])}return i}function u2(e,i){const a=ew(e);if(!a||!c2(a))return null;const r=Rv(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:tw(r),url:ge(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function ew(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function c2(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function tw(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function d2(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function
|
|
112
|
-
$2`)}function m2(e){var c;const i=D.Children.toArray(e),a=i.length===1&&D.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:nh(a.props.children).replace(/\n$/,""),language:u}}function nh(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(nh).join(""):D.isValidElement(e)?nh(e.props.children):""}const iw="github-light",Np=new Map,Dp=new Map;let Rp=null,_p=null;const aw=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function _h(e){const i=e.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 lw(e){const i=_h(e);return!i||i==="text"||i==="txt"?"text":aw.has(i)?i:"text"}function g2({code:e}){const a=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=D.useState(!1),[c,d]=D.useState(()=>Dp.get(e)??null),[p,g]=D.useState(null);D.useEffect(()=>{let b=!1,x;const S=Dp.get(e);return S?(d(S),g(null),()=>{b=!0}):(g(null),d(null),y2(a,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),Dp.set(e,w),d(w),g(null))},w=>{if(!b){const E=w instanceof Error?w.message:String(w);x=window.setTimeout(()=>{b||g(E)},fA)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[e,a]);async function m(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${p?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Mh,{})})}),c?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):p?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:p}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function y2(e,i){return(await(await x2()).render(e,i)).svg}function x2(){return _p||(_p=Tt(()=>import("./mermaid.core-B0u2MJhc.js").then(e=>e.bp),[],import.meta.url).then(e=>{const i=e.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})),_p}function b2({code:e,language:i,reserveHeight:a=!1}){const[r,u]=D.useState(!1),[c,d]=D.useState(()=>{if(!eb(i))return null;const m=Jx(e,i);return Np.get(m)??null}),p=a?{"--code-block-min-height":`${SA(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!eb(i))return d(null),()=>{m=!0};const b=Jx(e,i),x=Np.get(b);return x?(d(x),()=>{m=!0}):(d(null),E2(e,i).then(S=>{Np.set(b,S),m||d(S)}).catch(S=>{console.warn("Failed to highlight code block",S),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:"code-block",style:p,children:[i?s.jsx("span",{className:"code-block-kind",children:i}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Mh,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Mh(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function v2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[s.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.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 rw(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),s.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),s.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function w2(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function k2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function Zx(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),s.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 S2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Wc(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[s.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.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 dd(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function j2(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function C2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.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"}),s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function T2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.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 Jx(e,i){return`${iw}:${lw(i)}:${e}`}function eb(e){const i=_h(e);return!!i&&aw.has(i)}async function E2(e,i){return(await A2()).codeToHtml(e,{lang:lw(i),theme:iw})}function A2(){return Rp||(Rp=N2()),Rp}async function N2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:x},{default:S},{default:w},{default:E},{default:M},{default:H},{default:R},{default:q},{default:$},{default:V},{default:ie}]=await Promise.all([Tt(()=>import("./core-DZdSXnTD.js"),[],import.meta.url),Tt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),Tt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),Tt(()=>import("./bash-BELqPA7S.js").then(N=>N.b),[],import.meta.url),Tt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),Tt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),Tt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),Tt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),Tt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),Tt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),Tt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),Tt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),Tt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),Tt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),Tt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),Tt(()=>import("./bash-BELqPA7S.js").then(N=>N.s),[],import.meta.url),Tt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),Tt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),Tt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),Tt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),Tt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),Tt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[a],langs:[r,u,c,d,p,g,m,b,x,S,w,E,M,H,R,q,$,V,ie]})}async function tb(){const e=ge("conversations"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).conversations}async function D2(){const e=ge("workspace-states"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).workspaces}async function nb(){const e=ge("collaboration/topics"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).topics}async function Gc(e){const i=ge(`collaboration/topics/${e}/messages?limit=100`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).messages}async function R2(e){const i=ge("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Te(a,{method:"POST",url:i}),(await a.json()).topic}async function _2(e,i){const a=ge(`collaboration/topics/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Te(r,{method:"PATCH",url:a}),(await r.json()).topic}async function M2(e,i){const a=ge(`collaboration/topics/${e}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await Te(r,{method:"POST",url:a}),(await r.json()).topic}async function O2(e){const i=ge(`conversations/${e}/read`),a=await fetch(i,{method:"POST"});await Te(a,{method:"POST",url:i})}async function ib(){const e=ge("workspace-groups"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).groups}async function z2(e){const i=ge("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Te(a,{method:"POST",url:i}),(await a.json()).group}async function L2(e,i){const a=ge(`workspace-groups/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Te(r,{method:"PATCH",url:a}),(await r.json()).group}async function I2(e){const i=ge(`workspace-groups/${e}`),a=await fetch(i,{method:"DELETE"});return await Te(a,{method:"DELETE",url:i}),await a.json()}async function U2(){const e=ge("settings/environment"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).variables}async function B2(e){const i=ge(`conversations/${e}/settings/environment`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).variables}async function q2(e){const i=ge(`conversations/${e}/knowledge`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).items}async function H2(){const e=ge("settings/runtime"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).settings}async function $2(){const e=ge("settings/deployment"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).settings}async function G2(){const e=ge("diagnostics"),i=await fetch(e);return await Te(i,{url:e}),await i.json()}async function V2(){const e=ge("settings/runtime/codex"),i=await fetch(e);return await Te(i,{url:e}),await i.json()}async function ab(){const e=ge("settings/runtime/accounts"),i=await fetch(e);await Te(i,{url:e});const a=await i.json();return jr(),a}async function lb(e=!1){const i=ge(`settings/runtime/accounts/refresh${e?"?force=1":""}`),a=await fetch(i,{method:"POST"});await Te(a,{method:"POST",url:i});const r=await a.json();return jr(),r}async function F2(e){const i=ge("settings/runtime/accounts"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Te(a,{method:"POST",url:i});const r=await a.json();return r.login.status==="succeeded"&&jr(),r.login}async function Y2(e){const i=ge(`settings/runtime/accounts/login/${e}`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).login}async function P2(e){const i=ge(`settings/runtime/accounts/login/${e}/cancel`),a=await fetch(i,{method:"POST"});return await Te(a,{method:"POST",url:i}),(await a.json()).login}async function W2(e,i){const a=ge(`settings/runtime/accounts/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});await Te(r,{method:"PATCH",url:a});const u=await r.json();return jr(),u.account}async function K2(e){const i=ge(`settings/runtime/accounts/${e}`),a=await fetch(i,{method:"DELETE"});await Te(a,{method:"DELETE",url:i}),jr()}async function X2(e){const i=ge(`settings/runtime/accounts/${e}/switch`),a=await fetch(i,{method:"POST"});await Te(a,{method:"POST",url:i});const r=await a.json();return jr(),r}async function Q2(e=!0){const i=ge(`settings/runtime/models?refresh=${e?"1":"0"}`),a=await fetch(i);return await Te(a,{url:i}),await a.json()}async function Z2(e=!1){const i=ge(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),a=await fetch(i);return await Te(a,{url:i}),await a.json()}async function J2(){const e=ge("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await Te(i,{method:"POST",url:e}),(await i.json()).job}async function eD(e){const i=ge(`conversations/${e}/settings/runtime`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).settings}async function tD(){const e=ge("settings/memory"),i=await fetch(e);return await Te(i,{url:e}),await i.json()}async function nD(e){const i=ge("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Te(a,{method:"PUT",url:i}),(await a.json()).settings}async function iD(e){const i=ge("settings/deployment"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Te(a,{method:"PUT",url:i}),(await a.json()).settings}async function rb(e,i){const a=ge(`conversations/${e}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Te(r,{method:"PUT",url:a}),await r.json()}async function sb(e,i){const a=ge(`conversations/${e}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Te(r,{method:"POST",url:a});const u=(await r.json()).job;return ow(e,u)}async function sw(e){const i=ge(`conversations/${e}/runtime/reset`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).job}async function ow(e,i){let a=i;const r=Date.now()+1800*1e3;for(;a.status==="running";){if(Date.now()>=r)throw new Error("Full-history reset is still running after 30 minutes. Reopen Console to check the workspace before retrying.");await new Promise(c=>window.setTimeout(c,1e3));const u=await sw(e);if(!u||u.id!==a.id)throw new Error("The runtime reset job is no longer available.");a=u}if(a.status==="failed"||a.status==="cancelled"||!a.result)throw new Error(a.error??"Full-history reset failed.");return a.result}async function ob(e){const i=ge(`conversations/${e}/runtime/reset-preview`),a=await fetch(i);return await Te(a,{url:i}),await a.json()}async function aD(e,i){const a=ge(`conversations/${e}/runtime/reset-selection`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Te(r,{method:"PUT",url:a})}async function lD(e){const i=ge(`conversations/${e}/runtime/thread-read`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).result}async function rD(e){const i=ge(`conversations/${e}/runtime/token-usage`),a=await fetch(i);await Te(a,{url:i});const r=await a.json();return r.event?vw(r.event):null}async function sD(e){const i=ge(`conversations/${e}/runtime/additional-context`),a=await fetch(i);return await Te(a,{url:i}),await a.json()}async function oD(e){const i=ge(`conversations/${e}/runtime/compactions`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).compactions}function uD(e,i,a){return{model:e.model===i.model?null:e.model,reasoningEffort:$E(e.reasoningEffort,i.reasoningEffort,(a==null?void 0:a.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox}}function cD(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:fD(e.sourceCluesText),requiredEnv:pD(e.requiredEnvText)}}function dD(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(i=>`${i.type}: ${i.value}`).join(`
|
|
111
|
+
`,u),d=e.slice(u,c===-1?e.length:c);/^\s*(```|~~~)/.test(d)&&(r=r===-1?u:-1)}return r>=0?r:i+1}function r2({artifact:e,onPreview:i,onCopyUrl:a,copied:r}){return e?s.jsxs("figure",{className:"artifact-preview",children:[s.jsx("button",{className:"artifact-preview-media",onClick:()=>i(e),type:"button",children:s.jsx("img",{alt:e.name,src:e.url})}),s.jsxs("figcaption",{children:[s.jsx("span",{children:e.name}),s.jsxs("div",{className:"artifact-preview-actions",children:[s.jsx("button",{onClick:()=>i(e),type:"button",children:"Preview"}),s.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),s.jsx("button",{onClick:()=>a(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function s2(e,i){const a=new Map;for(const r of o2(e)){const u=ew(r);if(u){const c=tw(u).toLowerCase(),d=a.get(c);(!d||d2(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>u2(r,i)).filter(r=>r!==null)}function o2(e){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(e))!==null;)i.push(d[1])}return i}function u2(e,i){const a=ew(e);if(!a||!c2(a))return null;const r=Rv(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:tw(r),url:ge(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function ew(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function c2(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function tw(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function d2(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function wr(e){return e.trim()}function nw(e){return e.trim()}function Xx(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function f2(e){return{a({children:i,href:a}){if(!a)return s.jsx(s.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(a),u=!r&&e?p2(a,e):null,c=u??a,d=r||!!u;return s.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=m2(i);return a?_h(a.language)==="mermaid"?s.jsx(g2,{code:a.code}):s.jsx(b2,{code:a.code,language:a.language}):s.jsx("pre",{children:i})},table({children:i}){return s.jsx("div",{className:"markdown-table-wrap",children:s.jsx("table",{className:"markdown-table",children:i})})},td({align:i,children:a}){return s.jsx("td",{style:Qx(i),children:a})},th({align:i,children:a}){return s.jsx("th",{style:Qx(i),children:a})}}}function p2(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const a=tA(e,i.workspacePath);if(!a)return null;const r=a.line?`#L${a.line}${a.column?`C${a.column}`:""}`:"";return`${ge(`conversations/${i.id}/files?path=${encodeURIComponent(a.path)}`)}${r}`}function Qx(e){return e&&e!=="char"?{textAlign:e}:void 0}function El(e,i){const a=h2(e);return s.jsx(cC,{components:f2(i),remarkPlugins:[SE],skipHtml:!0,children:a})}function h2(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
|
|
112
|
+
$2`)}function m2(e){var c;const i=D.Children.toArray(e),a=i.length===1&&D.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:nh(a.props.children).replace(/\n$/,""),language:u}}function nh(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(nh).join(""):D.isValidElement(e)?nh(e.props.children):""}const iw="github-light",Np=new Map,Dp=new Map;let Rp=null,_p=null;const aw=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function _h(e){const i=e.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 lw(e){const i=_h(e);return!i||i==="text"||i==="txt"?"text":aw.has(i)?i:"text"}function g2({code:e}){const a=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=D.useState(!1),[c,d]=D.useState(()=>Dp.get(e)??null),[p,g]=D.useState(null);D.useEffect(()=>{let b=!1,x;const S=Dp.get(e);return S?(d(S),g(null),()=>{b=!0}):(g(null),d(null),y2(a,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),Dp.set(e,w),d(w),g(null))},w=>{if(!b){const E=w instanceof Error?w.message:String(w);x=window.setTimeout(()=>{b||g(E)},fA)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[e,a]);async function m(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${p?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Mh,{})})}),c?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):p?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:p}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function y2(e,i){return(await(await x2()).render(e,i)).svg}function x2(){return _p||(_p=Tt(()=>import("./mermaid.core-Ci_ONQ9q.js").then(e=>e.bp),[],import.meta.url).then(e=>{const i=e.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})),_p}function b2({code:e,language:i,reserveHeight:a=!1}){const[r,u]=D.useState(!1),[c,d]=D.useState(()=>{if(!eb(i))return null;const m=Jx(e,i);return Np.get(m)??null}),p=a?{"--code-block-min-height":`${SA(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!eb(i))return d(null),()=>{m=!0};const b=Jx(e,i),x=Np.get(b);return x?(d(x),()=>{m=!0}):(d(null),E2(e,i).then(S=>{Np.set(b,S),m||d(S)}).catch(S=>{console.warn("Failed to highlight code block",S),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:"code-block",style:p,children:[i?s.jsx("span",{className:"code-block-kind",children:i}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Mh,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Mh(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function v2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[s.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.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 rw(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),s.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),s.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function w2(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function k2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function Zx(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),s.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 S2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Pc(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[s.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.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 cd(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function j2(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function C2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.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"}),s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function T2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.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 Jx(e,i){return`${iw}:${lw(i)}:${e}`}function eb(e){const i=_h(e);return!!i&&aw.has(i)}async function E2(e,i){return(await A2()).codeToHtml(e,{lang:lw(i),theme:iw})}function A2(){return Rp||(Rp=N2()),Rp}async function N2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:x},{default:S},{default:w},{default:E},{default:M},{default:H},{default:R},{default:q},{default:$},{default:V},{default:ie}]=await Promise.all([Tt(()=>import("./core-bqmd5bjk.js"),[],import.meta.url),Tt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),Tt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),Tt(()=>import("./bash-BELqPA7S.js").then(N=>N.b),[],import.meta.url),Tt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),Tt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),Tt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),Tt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),Tt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),Tt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),Tt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),Tt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),Tt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),Tt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),Tt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),Tt(()=>import("./bash-BELqPA7S.js").then(N=>N.s),[],import.meta.url),Tt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),Tt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),Tt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),Tt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),Tt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),Tt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[a],langs:[r,u,c,d,p,g,m,b,x,S,w,E,M,H,R,q,$,V,ie]})}async function tb(){const e=ge("conversations"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).conversations}async function D2(){const e=ge("workspace-states"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).workspaces}async function nb(){const e=ge("collaboration/topics"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).topics}async function $c(e){const i=ge(`collaboration/topics/${e}/messages?limit=100`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).messages}async function R2(e){const i=ge("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Te(a,{method:"POST",url:i}),(await a.json()).topic}async function _2(e,i){const a=ge(`collaboration/topics/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Te(r,{method:"PATCH",url:a}),(await r.json()).topic}async function M2(e,i){const a=ge(`collaboration/topics/${e}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await Te(r,{method:"POST",url:a}),(await r.json()).topic}async function O2(e){const i=ge(`conversations/${e}/read`),a=await fetch(i,{method:"POST"});await Te(a,{method:"POST",url:i})}async function ib(){const e=ge("workspace-groups"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).groups}async function z2(e){const i=ge("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Te(a,{method:"POST",url:i}),(await a.json()).group}async function L2(e,i){const a=ge(`workspace-groups/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Te(r,{method:"PATCH",url:a}),(await r.json()).group}async function I2(e){const i=ge(`workspace-groups/${e}`),a=await fetch(i,{method:"DELETE"});return await Te(a,{method:"DELETE",url:i}),await a.json()}async function U2(){const e=ge("settings/environment"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).variables}async function B2(e){const i=ge(`conversations/${e}/settings/environment`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).variables}async function q2(e){const i=ge(`conversations/${e}/knowledge`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).items}async function H2(){const e=ge("settings/runtime"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).settings}async function $2(){const e=ge("settings/deployment"),i=await fetch(e);return await Te(i,{url:e}),(await i.json()).settings}async function G2(){const e=ge("diagnostics"),i=await fetch(e);return await Te(i,{url:e}),await i.json()}async function V2(){const e=ge("settings/runtime/codex"),i=await fetch(e);return await Te(i,{url:e}),await i.json()}async function ab(){const e=ge("settings/runtime/accounts"),i=await fetch(e);await Te(i,{url:e});const a=await i.json();return Sr(),a}async function lb(e=!1){const i=ge(`settings/runtime/accounts/refresh${e?"?force=1":""}`),a=await fetch(i,{method:"POST"});await Te(a,{method:"POST",url:i});const r=await a.json();return Sr(),r}async function F2(e){const i=ge("settings/runtime/accounts"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Te(a,{method:"POST",url:i});const r=await a.json();return r.login.status==="succeeded"&&Sr(),r.login}async function Y2(e){const i=ge(`settings/runtime/accounts/login/${e}`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).login}async function P2(e){const i=ge(`settings/runtime/accounts/login/${e}/cancel`),a=await fetch(i,{method:"POST"});return await Te(a,{method:"POST",url:i}),(await a.json()).login}async function W2(e,i){const a=ge(`settings/runtime/accounts/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});await Te(r,{method:"PATCH",url:a});const u=await r.json();return Sr(),u.account}async function K2(e){const i=ge(`settings/runtime/accounts/${e}`),a=await fetch(i,{method:"DELETE"});await Te(a,{method:"DELETE",url:i}),Sr()}async function X2(e){const i=ge(`settings/runtime/accounts/${e}/switch`),a=await fetch(i,{method:"POST"});await Te(a,{method:"POST",url:i});const r=await a.json();return Sr(),r}async function Q2(e=!0){const i=ge(`settings/runtime/models?refresh=${e?"1":"0"}`),a=await fetch(i);return await Te(a,{url:i}),await a.json()}async function Z2(e=!1){const i=ge(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),a=await fetch(i);return await Te(a,{url:i}),await a.json()}async function J2(){const e=ge("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await Te(i,{method:"POST",url:e}),(await i.json()).job}async function eD(e){const i=ge(`conversations/${e}/settings/runtime`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).settings}async function tD(){const e=ge("settings/memory"),i=await fetch(e);return await Te(i,{url:e}),await i.json()}async function nD(e){const i=ge("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Te(a,{method:"PUT",url:i}),(await a.json()).settings}async function iD(e){const i=ge("settings/deployment"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Te(a,{method:"PUT",url:i}),(await a.json()).settings}async function rb(e,i){const a=ge(`conversations/${e}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Te(r,{method:"PUT",url:a}),await r.json()}async function sb(e,i){const a=ge(`conversations/${e}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Te(r,{method:"POST",url:a});const u=(await r.json()).job;return ow(e,u)}async function sw(e){const i=ge(`conversations/${e}/runtime/reset`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).job}async function ow(e,i){let a=i;const r=Date.now()+1800*1e3;for(;a.status==="running";){if(Date.now()>=r)throw new Error("Full-history reset is still running after 30 minutes. Reopen Console to check the workspace before retrying.");await new Promise(c=>window.setTimeout(c,1e3));const u=await sw(e);if(!u||u.id!==a.id)throw new Error("The runtime reset job is no longer available.");a=u}if(a.status==="failed"||a.status==="cancelled"||!a.result)throw new Error(a.error??"Full-history reset failed.");return a.result}async function ob(e){const i=ge(`conversations/${e}/runtime/reset-preview`),a=await fetch(i);return await Te(a,{url:i}),await a.json()}async function aD(e,i){const a=ge(`conversations/${e}/runtime/reset-selection`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Te(r,{method:"PUT",url:a})}async function lD(e){const i=ge(`conversations/${e}/runtime/thread-read`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).result}async function rD(e){const i=ge(`conversations/${e}/runtime/token-usage`),a=await fetch(i);await Te(a,{url:i});const r=await a.json();return r.event?vw(r.event):null}async function sD(e){const i=ge(`conversations/${e}/runtime/additional-context`),a=await fetch(i);return await Te(a,{url:i}),await a.json()}async function oD(e){const i=ge(`conversations/${e}/runtime/compactions`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).compactions}function uD(e,i,a){return{model:e.model===i.model?null:e.model,reasoningEffort:$E(e.reasoningEffort,i.reasoningEffort,(a==null?void 0:a.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox}}function cD(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:fD(e.sourceCluesText),requiredEnv:pD(e.requiredEnvText)}}function dD(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(i=>`${i.type}: ${i.value}`).join(`
|
|
113
113
|
`),requiredEnvText:e.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
|
|
114
114
|
`)}}function fD(e){const i=new Date().toISOString();return e.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 pD(e){return e.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 ub(e,i){const a=cb(i.attention)-cb(e.attention);return a!==0?a:i.updatedAt.localeCompare(e.updatedAt)}function cb(e){return e==="watch"?2:e==="tracked"?1:0}function ru(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function hD(e){return e?/^[a-z_][a-z0-9_.-]*$/.test(e)?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 mD(e){return ru(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
|
|
115
|
-
`)}async function gD(e){const i=ge("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Te(a,{method:"PUT",url:i}),await a.json()}async function yD(e,i,a){const r=ge("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:e,value:i})});return await Te(u,{method:"PUT",url:r}),(await u.json()).variable}async function xD(e,i,a,r){const u=ge(`conversations/${e}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:a})});return await Te(c,{method:"PUT",url:u}),await c.json()}async function bD(e){const i=ge(`settings/environment/${encodeURIComponent(e)}/reveal`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).variable.value}async function vD(e,i){const a=ge(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await Te(r,{url:a}),(await r.json()).variable.value}async function wD(e){const i=ge(`settings/environment/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});await Te(a,{method:"DELETE",url:i})}async function kD(e,i){const a=ge(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await Te(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function SD(e,i){const a=ge(`conversations/${e}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Te(r,{method:"POST",url:a}),(await r.json()).item}async function jD(e,i,a){const r=ge(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await Te(u,{method:"PATCH",url:r}),(await u.json()).item}async function CD(e,i){const a=ge(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await Te(r,{method:"DELETE",url:a})}async function TD(){const e=ge("meta"),i=await fetch(e);return await Te(i,{url:e}),await i.json()}async function ED(e){const i=ge(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).usage??null}async function AD(e,i){const a=ge("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await Te(r,{method:"POST",url:a}),(await r.json()).conversation}async function ND(e){const i=ge(`conversations/${e}/complex-task`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).task}async function DD(e,i){const a=ge(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await Te(r,{url:a}),(await r.json()).task}async function RD(e,i){const a=ge(`conversations/${e}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await Te(r,{method:"POST",url:a}),(await r.json()).task}async function _D(e,i,a){const r=ge(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await Te(u,{method:"POST",url:r}),await u.json()}async function MD(e){const i=ge(`conversations/${e}/clone/retry`),a=await fetch(i,{method:"POST"});return await Te(a,{method:"POST",url:i}),await a.json()}async function Mp(e,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??_v)),i.before&&a.set("before",i.before);const r=ge(`conversations/${e}?${a}`),u=await fetch(r);return await Te(u,{url:r}),(await u.json()).conversation}async function OD(e,i){const a=ge(`conversations/${e}/turns/${i}/history-events`),r=await fetch(a);return await Te(r,{url:a}),(await r.json()).events}async function
|
|
115
|
+
`)}async function gD(e){const i=ge("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Te(a,{method:"PUT",url:i}),await a.json()}async function yD(e,i,a){const r=ge("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:e,value:i})});return await Te(u,{method:"PUT",url:r}),(await u.json()).variable}async function xD(e,i,a,r){const u=ge(`conversations/${e}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:a})});return await Te(c,{method:"PUT",url:u}),await c.json()}async function bD(e){const i=ge(`settings/environment/${encodeURIComponent(e)}/reveal`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).variable.value}async function vD(e,i){const a=ge(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await Te(r,{url:a}),(await r.json()).variable.value}async function wD(e){const i=ge(`settings/environment/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});await Te(a,{method:"DELETE",url:i})}async function kD(e,i){const a=ge(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await Te(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function SD(e,i){const a=ge(`conversations/${e}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Te(r,{method:"POST",url:a}),(await r.json()).item}async function jD(e,i,a){const r=ge(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await Te(u,{method:"PATCH",url:r}),(await u.json()).item}async function CD(e,i){const a=ge(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await Te(r,{method:"DELETE",url:a})}async function TD(){const e=ge("meta"),i=await fetch(e);return await Te(i,{url:e}),await i.json()}async function ED(e){const i=ge(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).usage??null}async function AD(e,i){const a=ge("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await Te(r,{method:"POST",url:a}),(await r.json()).conversation}async function ND(e){const i=ge(`conversations/${e}/complex-task`),a=await fetch(i);return await Te(a,{url:i}),(await a.json()).task}async function DD(e,i){const a=ge(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await Te(r,{url:a}),(await r.json()).task}async function RD(e,i){const a=ge(`conversations/${e}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await Te(r,{method:"POST",url:a}),(await r.json()).task}async function _D(e,i,a){const r=ge(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await Te(u,{method:"POST",url:r}),await u.json()}async function MD(e){const i=ge(`conversations/${e}/clone/retry`),a=await fetch(i,{method:"POST"});return await Te(a,{method:"POST",url:i}),await a.json()}async function Mp(e,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??_v)),i.before&&a.set("before",i.before);const r=ge(`conversations/${e}?${a}`),u=await fetch(r);return await Te(u,{url:r}),(await u.json()).conversation}async function OD(e,i){const a=ge(`conversations/${e}/turns/${i}/history-events`),r=await fetch(a);return await Te(r,{url:a}),(await r.json()).events}async function Gc(e,i){const a=ge(`conversations/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Te(r,{method:"PATCH",url:a}),(await r.json()).conversation}async function zD(e){const i=ge(`conversations/${e}`),a=await fetch(i,{method:"DELETE"});await Te(a,{method:"DELETE",url:i})}function LD(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function uw(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function ID(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:aR(e.data),createdAt:e.createdAt??new Date().toISOString()};if(e.event==="server.collaboration.message_staged"||e.event==="server.collaboration.message_sent"||e.event==="server.collaboration.message_rejected"){const c=me(e.data),d=Ce(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const g=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=Ce(c.audience),x=Ce(c.recipientWorkspaceId),S=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(H=>typeof H=="string"):Array.isArray(c.recipients)?c.recipients.filter(H=>typeof H=="string"):[],w=S.filter(H=>H!=="ALL").map(H=>i.get(H)).filter(H=>!!H);let E="Topic";w.length>0?E=uw(w):S.length===1?E=S[0]==="ALL"?"Topic participants":Nl(S[0]):S.length>1?E=`${S.length} workspaces`:b==="public"||b==="all"?E="Topic participants":b==="owner"&&(E="Topic owner");const M=Ce(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${E}`,body:M?`Topic ${Nl(M)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":m?"done":"failed",output:g||m?Ce(c.contentMarkdown)||void 0:Ce(c.reason)||void 0,topicAction:"send",topicRecipientLabel:E,topicMessageContent:(g||m)&&Ce(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=me(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=me(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=me(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",S=Array.isArray(b.options)?b.options.map(w=>{const E=me(w);return typeof E.label=="string"?`- ${E.label}${typeof E.description=="string"?`: ${E.description}`:""}`:""}).filter(Boolean).join(`
|
|
116
116
|
`):"";return S?`${x}
|
|
117
117
|
|
|
118
118
|
${S}`:x}).join(`
|
|
119
119
|
|
|
120
|
-
`);return{id:e.id,kind:"activity",title:"Seele needs input",body:g||"Please answer in the main input box to continue.",createdAt:e.createdAt??new Date().toISOString(),meta:"waiting for reply"}}}if(e.event==="server.agent_action.staged"){const c=me(e.data);if(Ce(c.actionType)==="seele_workspace_change"){const p=me(c.payload),g=me(p.payload),m=Ce(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:mw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=zE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=OE(e.data);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),meta:c.meta}}if(e.event==="codex.dynamic_tool_request"){const c=me(e.data),d=me(c.params),p=Ce(d.tool)||"dynamic tool",g=me(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:pw(p,!1,g),body:hw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?cw(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&Ce(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?me(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=me(e.data),d=me(c.payload),p=Ce(d.content)||Ce(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.toolCallId)||void 0,meta:"pending",responsibilityProposalId:String(e.id),workspaceChangeProposalId:String(e.id),responsibilityReason:typeof c.reason=="string"?c.reason:void 0,responsibilityAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0,workspaceChangeType:Ce(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=me(e.data),d=me(c.knowledge);return{id:e.id,kind:"knowledge",title:c.action==="update"?"Knowledge update proposed":"Knowledge creation proposed",body:JSON.stringify(d,null,2),createdAt:e.createdAt??new Date().toISOString(),meta:"pending",knowledgeProposalId:String(e.id),knowledgeAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0}}if(e.event==="server.complex_task.plan_updated"){const c=me(e.data),d=me(c.task),p=me(d.currentPlan),g=me(c.update),m=Ce(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",x=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${x} change${x===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:Ce(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=me(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:Ce(c.reason)||"The proposed Plan change could not be applied.",createdAt:e.createdAt??new Date().toISOString(),meta:"not applied"}}if(e.event==="runtime.command.started"||e.event==="runtime.command.completed"){const c=me(e.data),d=e.event==="runtime.command.completed",p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:d?p!==null&&p!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?Kc(c.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?p!==null?`exit ${p}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const c=me(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:ih(c,d),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?"done":"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=iR(c.requestId),p=me(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"){const c=me(u.item);if(c.type==="commandExecution"){const p=c.status==="inProgress"&&c.processId===null;return{id:e.id,kind:"command",title:p?"Command waiting for approval":"Seele ran command",body:Kc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Wp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File change",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=me(u.item);if(c.type==="commandExecution"){const p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:p!==null&&p!==0?"Command failed":"Command completed",body:Kc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p!==null?`exit ${p}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=Wp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File changed",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.id)||void 0,meta:"done",fileChanges:d}}return r==="item/commandExecution/outputDelta"?{id:e.id,kind:"command",title:"Command output",body:typeof u.itemId=="string"?u.itemId:"command",createdAt:e.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 UD(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=i.method;if(a!=="item/started"&&a!=="item/completed")return null;const r=me(i.params),u=me(r.item),c=typeof u.type=="string"?u.type:"item";if(fw(c)||kw(u))return null;const d=a==="item/completed",p=me(u.arguments),g=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:e.id,kind:g==="seele_topics"?"collaboration":g==="seele_workspace_change"?"workspaceChange":"activity",title:g?pw(g,d,p):d?`Finished ${El(c)}`:`Working on ${El(c)}`,body:g?hw(g,p):gw(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:g==="seele_wakeup"&&d?"after turn":d?qD(u):"running",topicAction:g==="seele_topics"?cw(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&Ce(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?me(p.payload):void 0}}function cw(e){return e==="read"||e==="history"||e==="send"?e:void 0}function BD(e){if(bw(e)||["server.turn","server.done","server.notification.sent","server.notification.failed","server.approval.decision","server.workspace_change.decision","server.responsibility.decision","server.knowledge.decision","server.collaboration.topic_created"].includes(e.event))return null;const i=ME(e);return i?{id:e.id,kind:"activity",title:xw(i),body:dw(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function dw(e){const i=me(e);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return yw(i[a].trim(),180);return"Event details are available"}function fw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function qD(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function El(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function pw(e,i,a){if(e==="seele_topics")switch(Ce(a.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(e==="seele_wakeup"){const u=Ce(a.action)==="cancel";return i?u?"Wakeup cancellation requested":"Wakeup requested":u?"Requesting wakeup cancellation":"Requesting wakeup"}if(e==="seele_workspace_change")return i?"Workspace change proposed":"Preparing workspace change";const r=El(e);return i?`Finished ${r}`:`Running ${r}`}function hw(e,i){if(e==="seele_topics"){const a=Ce(i.topicId);return a?`Topic ${Al(a)}`:"Topic"}if(e==="seele_wakeup")return Ce(i.instruction)||(Ce(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const a=Ce(i.type)||"workspace";return mw(a,me(i.payload))}return El(e)}function mw(e,i){return e==="responsibility"?Ce(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function gw(e,i){for(const a of["title","name","description","text","summary"])if(typeof e[a]=="string"&&e[a].trim())return js(e[a].trim(),160);return typeof e.id=="string"?`${El(i)} ${Al(e.id)}`:El(i)}function HD(e){var a;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const i=(a=e.meta)==null?void 0:a.match(/^exit\s+(-?\d+)$/);return i?Number(i[1])===0?"done":"failed":"done"}function $D(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function GD(e,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=e.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return a?`Exit code: ${a[1]}`:i==="failed"?"Command failed.":"Command completed."}function VD(e,i){const a=e.split(/\r?\n/),u=a.slice(0,i).join(`
|
|
120
|
+
`);return{id:e.id,kind:"activity",title:"Seele needs input",body:g||"Please answer in the main input box to continue.",createdAt:e.createdAt??new Date().toISOString(),meta:"waiting for reply"}}}if(e.event==="server.agent_action.staged"){const c=me(e.data);if(Ce(c.actionType)==="seele_workspace_change"){const p=me(c.payload),g=me(p.payload),m=Ce(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:mw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=zE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=OE(e.data);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),meta:c.meta}}if(e.event==="codex.dynamic_tool_request"){const c=me(e.data),d=me(c.params),p=Ce(d.tool)||"dynamic tool",g=me(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:pw(p,!1,g),body:hw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?cw(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&Ce(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?me(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=me(e.data),d=me(c.payload),p=Ce(d.content)||Ce(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.toolCallId)||void 0,meta:"pending",responsibilityProposalId:String(e.id),workspaceChangeProposalId:String(e.id),responsibilityReason:typeof c.reason=="string"?c.reason:void 0,responsibilityAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0,workspaceChangeType:Ce(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=me(e.data),d=me(c.knowledge);return{id:e.id,kind:"knowledge",title:c.action==="update"?"Knowledge update proposed":"Knowledge creation proposed",body:JSON.stringify(d,null,2),createdAt:e.createdAt??new Date().toISOString(),meta:"pending",knowledgeProposalId:String(e.id),knowledgeAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0}}if(e.event==="server.complex_task.plan_updated"){const c=me(e.data),d=me(c.task),p=me(d.currentPlan),g=me(c.update),m=Ce(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",x=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${x} change${x===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:Ce(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=me(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:Ce(c.reason)||"The proposed Plan change could not be applied.",createdAt:e.createdAt??new Date().toISOString(),meta:"not applied"}}if(e.event==="runtime.command.started"||e.event==="runtime.command.completed"){const c=me(e.data),d=e.event==="runtime.command.completed",p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:d?p!==null&&p!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?Wc(c.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?p!==null?`exit ${p}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const c=me(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:ih(c,d),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?"done":"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=iR(c.requestId),p=me(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"){const c=me(u.item);if(c.type==="commandExecution"){const p=c.status==="inProgress"&&c.processId===null;return{id:e.id,kind:"command",title:p?"Command waiting for approval":"Seele ran command",body:Wc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Wp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File change",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=me(u.item);if(c.type==="commandExecution"){const p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:p!==null&&p!==0?"Command failed":"Command completed",body:Wc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p!==null?`exit ${p}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=Wp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File changed",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.id)||void 0,meta:"done",fileChanges:d}}return r==="item/commandExecution/outputDelta"?{id:e.id,kind:"command",title:"Command output",body:typeof u.itemId=="string"?u.itemId:"command",createdAt:e.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 UD(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=i.method;if(a!=="item/started"&&a!=="item/completed")return null;const r=me(i.params),u=me(r.item),c=typeof u.type=="string"?u.type:"item";if(fw(c)||kw(u))return null;const d=a==="item/completed",p=me(u.arguments),g=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:e.id,kind:g==="seele_topics"?"collaboration":g==="seele_workspace_change"?"workspaceChange":"activity",title:g?pw(g,d,p):d?`Finished ${Al(c)}`:`Working on ${Al(c)}`,body:g?hw(g,p):gw(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:g==="seele_wakeup"&&d?"after turn":d?qD(u):"running",topicAction:g==="seele_topics"?cw(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&Ce(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?me(p.payload):void 0}}function cw(e){return e==="read"||e==="history"||e==="send"?e:void 0}function BD(e){if(bw(e)||["server.turn","server.done","server.notification.sent","server.notification.failed","server.approval.decision","server.workspace_change.decision","server.responsibility.decision","server.knowledge.decision","server.collaboration.topic_created"].includes(e.event))return null;const i=ME(e);return i?{id:e.id,kind:"activity",title:xw(i),body:dw(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function dw(e){const i=me(e);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return yw(i[a].trim(),180);return"Event details are available"}function fw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function qD(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function Al(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function pw(e,i,a){if(e==="seele_topics")switch(Ce(a.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(e==="seele_wakeup"){const u=Ce(a.action)==="cancel";return i?u?"Wakeup cancellation requested":"Wakeup requested":u?"Requesting wakeup cancellation":"Requesting wakeup"}if(e==="seele_workspace_change")return i?"Workspace change proposed":"Preparing workspace change";const r=Al(e);return i?`Finished ${r}`:`Running ${r}`}function hw(e,i){if(e==="seele_topics"){const a=Ce(i.topicId);return a?`Topic ${Nl(a)}`:"Topic"}if(e==="seele_wakeup")return Ce(i.instruction)||(Ce(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const a=Ce(i.type)||"workspace";return mw(a,me(i.payload))}return Al(e)}function mw(e,i){return e==="responsibility"?Ce(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function gw(e,i){for(const a of["title","name","description","text","summary"])if(typeof e[a]=="string"&&e[a].trim())return Es(e[a].trim(),160);return typeof e.id=="string"?`${Al(i)} ${Nl(e.id)}`:Al(i)}function HD(e){var a;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const i=(a=e.meta)==null?void 0:a.match(/^exit\s+(-?\d+)$/);return i?Number(i[1])===0?"done":"failed":"done"}function $D(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function GD(e,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=e.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return a?`Exit code: ${a[1]}`:i==="failed"?"Command failed.":"Command completed."}function VD(e,i){const a=e.split(/\r?\n/),u=a.slice(0,i).join(`
|
|
121
121
|
`);return a.length>i?`${u}
|
|
122
|
-
...`:u}function FD(e,i){return e?e.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function
|
|
123
|
-
`)?null:
|
|
122
|
+
...`:u}function FD(e,i){return e?e.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function nd(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function YD(e){const i=e.trim();return!i||i.includes(`
|
|
123
|
+
`)?null:Es(i,120)}function Es(e,i){if(e.length<=i)return e;const a=Math.max(8,Math.floor((i-3)/2));return`${e.slice(0,a)}...${e.slice(-a)}`}function yw(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function xw(e){const a=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function bw(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=me(e.data);if(c.status==="initialized")return{id:e.id,title:"Connected to Seele runtime",createdAt:i,tone:"done"};if(c.status==="turn_started")return{id:e.id,title:"Turn started",createdAt:i,tone:"running"};if(c.status==="archived_thread_replaced")return{id:e.id,title:"Started a fresh runtime thread",detail:typeof c.archivedThreadId=="string"?`archived ${Nl(c.archivedThreadId)}`:void 0,createdAt:i,tone:"warning"}}if(e.event==="server.stopped"||e.event==="server.stop")return{id:e.id,title:"Stopped current run",createdAt:i,tone:"error"};if(e.event==="runtime.worker_stale")return{id:e.id,title:"Runtime appears stalled",detail:"No runtime signal for a while",createdAt:i,tone:"warning"};if(e.event==="runtime.worker_recovered")return{id:e.id,title:"Runtime resumed",createdAt:i,tone:"running"};if(e.event==="runtime.compaction.started"){const c=me(e.data);return{id:e.id,title:"Codex compacting context",detail:ih(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=me(e.data);return{id:e.id,title:"Codex context compacted",detail:ih(c,!0),createdAt:i,tone:"done"}}if(e.event==="server.turn.long_running")return{id:e.id,title:"Long run in progress",detail:"Consider splitting into a wakeup phase",createdAt:i,tone:"warning"};if(e.event==="server.turn.phase_boundary_recommended"){const c=me(e.data);return{id:e.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(e.event==="server.wakeup.started"){const c=me(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?Es(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=me(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?Es(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"||r==="item/completed"){const c=me(u.item),d=typeof c.type=="string"?c.type:"item",p=r==="item/completed";if(d==="commandExecution")return{id:e.id,title:p?"Command completed":"Running command",detail:Es(Wc(c.command),96),createdAt:i,tone:p?"done":"running"};if(d==="contextCompaction")return{id:e.id,title:p?"Codex context compacted":"Codex compacting context",detail:p?void 0:"Current runtime thread is being compacted",createdAt:i,tone:p?"done":"running"};const g=kw(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:Es(g,96),createdAt:i,tone:p?"done":"running"};if(!fw(d))return{id:e.id,title:p?`Finished ${Al(d)}`:`Working on ${Al(d)}`,detail:gw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=me(u.status),d=Array.isArray(c.activeFlags)?c.activeFlags:[];if(c.type==="active"&&d.some(p=>p==="waitingOnApproval"))return{id:e.id,title:"Waiting for approval",detail:"Command needs confirmation",createdAt:i,tone:"warning"}}if(r==="turn/started")return{id:e.id,title:"Seele started working",createdAt:i,tone:"running"};if(r==="turn/completed"){const c=me(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?Rs(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=me(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${fb(d)}`:`Finished ${fb(d)}`,detail:typeof c.durationMs=="number"?Rs(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function ih(e,i){const a=id(e.before),r=id(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${Rs(c)}`)}else u.push("Codex triggered");if(a&&r){u.push(`context ${mr(a)} → ${mr(r)}`);const c=a.totalTokens-r.totalTokens;c>0&&u.push(`released ~${Oh(c)} tokens`)}else a&&u.push(`context ${mr(a)}`);return u.join(" · ")}function PD(e){const i=id(e.before),a=id(e.after),r=i&&a?i.totalTokens-a.totalTokens:null;let u="Unavailable";return i&&a?u=`${mr(i)} → ${mr(a)}`:i?u=`${mr(i)} → unavailable`:a&&(u=`unavailable → ${mr(a)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":Rs(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${Oh(r)} tokens`:"No decrease observed"}]}function id(e){const i=me(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function mr(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${Oh(e.totalTokens)} tokens`}function Oh(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function WD(e){let i=null;for(const a of e)for(const r of a.events){const u=QD(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function db(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.updatedAt)>Date.parse(i.updatedAt))?a:i,null)}function KD(e){let i=null;for(const a of e){const r=vw(a);r&&(!i||lu(a,i)>0)&&(i=r)}return i}function vw(e){if(e.event!=="codex.notification")return null;const i=me(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const a=me(i.params),r=me(a.tokenUsage),u=me(r.last),c=me(r.total),d=Object.keys(u).length>0?u:c,p=di(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:di(d.inputTokens),cachedInputTokens:di(d.cachedInputTokens),outputTokens:di(d.outputTokens),reasoningOutputTokens:di(d.reasoningOutputTokens),modelContextWindow:di(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function XD(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.createdAt)>Date.parse(i.createdAt))?a:i,null)}function ww(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function QD(e){if(e.event!=="codex.notification")return null;const i=me(e.data);if(i.method!=="account/rateLimits/updated")return null;const a=me(i.params),r=me(a.rateLimits),u=[r.primary,r.secondary].map(c=>ZD(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function ZD(e){const i=me(e);return typeof i.usedPercent!="number"||typeof i.resetsAt!="number"||typeof i.windowDurationMins!="number"?null:{usedPercent:i.usedPercent,resetsAt:i.resetsAt,windowDurationMins:i.windowDurationMins}}function JD(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Wc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function kw(e){var a;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((a=Wp(e)[0])==null?void 0:a.path)??null}function me(e){return e&&typeof e=="object"?e:{}}function di(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Ce(e){return typeof e=="string"?e:""}function gr(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function eR(e){const i=me(e),a=me(i.thread);if(!Object.keys(a).length)return null;const r=Array.isArray(a.turns)?a.turns:[],u=[];let c=0,d=0,p=0,g=0,m=0;return r.forEach((b,x)=>{const S=me(b),w=Ce(S.id)||`turn-${x+1}`,E=Array.isArray(S.items)?S.items:[];c+=E.length,u.push(tR(S,w)),E.forEach(M=>{const H=me(M),R=Ce(H.type);R==="userMessage"?d+=1:R==="agentMessage"?p+=1:R==="compaction"?g+=1:R==="contextCompaction"&&(m+=1)})}),{id:Ce(a.id),sessionId:Ce(a.sessionId),status:Sw(a.status),source:zh(a.source),cwd:Ce(a.cwd),path:Ce(a.path),preview:Ce(a.preview),createdAt:di(a.createdAt),updatedAt:di(a.updatedAt),recencyAt:di(a.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:m,turns:u}}function tR(e,i){const a=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(a.map(c=>Ce(me(c).type)).filter(c=>c.length>0))).join(", "),u=nR(a.map(c=>ah(c)).filter(Boolean).join(" "),220);return{id:i,status:Sw(e.status),itemsView:Ce(e.itemsView)||"unknown",itemCount:a.length,startedAt:di(e.startedAt),completedAt:di(e.completedAt),durationMs:di(e.durationMs),itemTypes:r,preview:u,raw:e}}function ah(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(ah).filter(Boolean).join(`
|
|
124
124
|
`);if(!e||typeof e!="object")return"";const i=e,a=Ce(i.text),r=ah(i.content);return[a,r].filter(Boolean).join(`
|
|
125
125
|
`)}function Sw(e){const i=me(e);return Ce(i.type)||zh(e)}function nR(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}...`:a}function Wo(e){return e===null?"unknown":He(e*1e3)}function iR(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function zh(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function aR(e){if(typeof e=="string")return e;const i=me(e),a=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return a&&r?`${a}
|
|
126
126
|
|
|
127
|
-
${r}`:a||r||zh(e)}function fb(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function
|
|
127
|
+
${r}`:a||r||zh(e)}function fb(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function Rs(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Op(e){if(e<6e4)return Rs(e);const i=Math.floor(e/6e4);if(i<60)return`${i}m`;const a=Math.floor(i/60),r=i%60;return r===0?`${a}h`:`${a}h ${r}m`}function jw(e){return`${Math.round(e)}%`}function In(e){return new Intl.NumberFormat("en-US").format(e)}function Kc(e){return e===null?"unknown":In(e)}function dd(e){return Math.max(0,Math.min(100,Math.round(e)))}function Lh(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function Cw(e){return He(e*1e3)}function He(e){const i=typeof e=="number"?new Date(e):new Date(e);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(p=>p.type===c))==null?void 0:d.value)??""};return`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`}function su(e){const i=He(e);return i?`${i} UTC+08:00`:""}function lR(e){const i=new Date(e);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 pb(e,i){const a=Jo(e,i);return a?`${a.displayName}${a.isDefault?" (default)":""}`:e||"Unavailable"}function Jo(e,i){return e?i.find(a=>a.model===e)??null:i.find(a=>a.isDefault)??i[0]??null}function fd(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function lh(e,i){const a=fd(e);return i?`${a} (${He(i)})`:a}function rR(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(fd(e))}`}function sR(e,i){const a=hb(e),r=hb(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 hb(e){if(!e)return null;const i=fd(e).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 oR(e,i){const a=e.map(r=>({value:r.model,label:`${r.displayName}${r.isDefault?" (default)":""}`}));return i&&!e.some(r=>r.model===i)&&a.push({value:i,label:`${i} (unavailable)`}),a.length===0&&a.push({value:"",label:"Models unavailable"}),a}async function mb(e,i){const a=e.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 p=u.split(`
|
|
128
128
|
|
|
129
129
|
`);u=p.pop()??"";for(const g of p){const m=uR(g);m&&i(m)}}}function uR(e){const i=e.split(`
|
|
130
130
|
`),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(`
|
|
131
|
-
`);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function cR(e){var r,u,c,d,p;if(!e||typeof e!="object")return null;const i=e;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:(p=i.params)==null?void 0:p.itemId}:null}function dR(e){var r;if(!e||typeof e!="object")return null;const i=e;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 fR(e){var r;if(!e||typeof e!="object")return null;const i=e;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 Fc(e){var a,r,u,c;if(e.event==="server.error"||e.event==="client.error")return"error";if(!e.data||typeof e.data!="object")return null;const i=e.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 Ts(e){return e.length<=6?e:e.slice(0,6)}function Al(e){return e.slice(0,8)}function gb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function yb(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function zp(e,...i){return i.includes(e)}function pR(e,i){const a=Date.parse(e.startedAt??e.createdAt),r=e.finishedAt?Date.parse(e.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 hR(e,i){const a=Date.parse(e),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 rh(e,i){var a;return i==="running"||i==="error"?i:((a=e==null?void 0:e.nextWakeup)==null?void 0:a.status)==="scheduled"?"waiting":i}function mR(e,i){return`waiting ${ld(e,i)}`}function ld(e,i){const a=Date.parse(e.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 Qc(e,i=null,a=Date.now()){if(e==="waiting")return i?mR(i,a):"waiting";switch(e){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 xb(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function gR(e){return e==="assistant"?"Seele":"You"}const yR=document.getElementById("root"),Tw=window.__seeleCodexRoot??Zk.createRoot(yR);window.__seeleCodexRoot=Tw;TR();Tw.render(s.jsx(D.StrictMode,{children:s.jsx(xR,{})}));function xR(){const[e,i]=D.useState(null),[a,r]=D.useState(null),[u,c]=D.useState(""),[d,p]=D.useState(""),[g,m]=D.useState("admin"),[b,x]=D.useState(""),[S,w]=D.useState(!1),[E,M]=D.useState("");D.useEffect(()=>{let q=!1,$=0;const V=async()=>{try{const ie=await bb();if(q)return;i(ie),p("")}catch{if(q)return;p("Reconnecting to Seele..."),$=window.setTimeout(V,2e3)}};return V(),()=>{q=!0,window.clearTimeout($)}},[]),D.useEffect(()=>{let q=!1,$=0;const V=async()=>{try{const N=await Ew();if(q)return;r(N),c(""),$=window.setTimeout(V,N.status==="authorized"&&N.configurationReady&&N.codexAccountsReady?3e4:3e3)}catch{if(q)return;c("Unable to reach Seele."),$=window.setTimeout(V,3e3)}},ie=()=>{window.clearTimeout($),V()};return window.addEventListener(Zp,ie),V(),()=>{q=!0,window.clearTimeout($),window.removeEventListener(Zp,ie)}},[]),D.useEffect(()=>{const q=()=>{i({enabled:!0,authenticated:!1,user:null}),x(""),M("Your session has expired. Sign in again.")};return window.addEventListener(Qp,q),()=>window.removeEventListener(Qp,q)},[]);async function H(q){q.preventDefault(),w(!0),M("");try{const $=await fetch(ge("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:g,password:b})});if(!$.ok){M($.status===401?"Incorrect username or password.":$.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}x(""),i(await bb())}catch{M("Unable to reach Seele.")}finally{w(!1)}}async function R(){await fetch(ge("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}if(a&&(a.status!=="authorized"||!a.configurationReady||!a.codexAccountsReady))return s.jsx(bR,{authorization:a});if(!e||!a)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:u||d||"Loading Seele..."})});if(!e.enabled||e.authenticated){const q=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(MA,{authEnabled:e.enabled,currentUser:q,onLogout:R})}return s.jsx("main",{className:"auth-shell",children:s.jsxs("section",{className:"auth-panel",children:[s.jsxs("header",{children:[s.jsx("p",{children:"Seele"}),s.jsx("h1",{children:"Sign in"})]}),s.jsxs("form",{onSubmit:H,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:q=>m(q.target.value),value:g})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:q=>x(q.target.value),type:"password",value:b})]}),E?s.jsx("p",{className:"auth-error",role:"alert",children:E}):null,s.jsx("button",{disabled:S||!g||!b,type:"submit",children:S?"Signing in...":"Sign in"})]})]})})}function bR({authorization:e}){const i={starting:{title:"Checking deployment authorization",body:"Seele is contacting its configured cloud service."},pending:{title:"Waiting for cloud approval",body:"A cloud administrator must authorize this deployment before it can be used."},revoked:{title:"Deployment access revoked",body:"This deployment is disabled until a cloud administrator authorizes it again."},unavailable:{title:"Cloud authorization unavailable",body:"Seele will keep retrying. Business APIs and the runtime remain paused."},authorized:{title:"Deployment authorized",body:"Seele is ready."}},a=e.status==="authorized"&&!e.configurationReady?{title:"Synchronizing global configuration",body:"Seele is applying the current cloud configuration before the deployment becomes available."}:e.status==="authorized"&&!e.codexAccountsReady?{title:"Synchronizing Codex accounts",body:"Seele is installing the cloud account credentials before the deployment becomes available."}:i[e.status];return s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-waiting-panel",children:[s.jsx("div",{className:`deployment-status-mark is-${e.status}`,"aria-hidden":"true"}),s.jsx("p",{className:"deployment-kicker",children:"Seele deployment"}),s.jsx("h1",{children:a.title}),s.jsx("p",{className:"deployment-lead",children:a.body}),s.jsxs("dl",{className:"deployment-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Deployment ID"}),s.jsx("dd",{children:s.jsx("code",{children:e.deploymentId})})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:e.name})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Cloud"}),s.jsx("dd",{children:e.cloudUrl})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last checked"}),s.jsx("dd",{children:e.lastCheckedAt?wR(e.lastCheckedAt):"Starting"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsxs("dd",{children:[e.appliedGlobalRevision," / ",e.requiredGlobalRevision]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex account revision"}),s.jsxs("dd",{children:[e.appliedCodexAccountRevision," / ",e.requiredCodexAccountRevision]})]})]}),e.lastError||e.configurationError||e.codexAccountError?s.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError||e.configurationError||e.codexAccountError}):null,s.jsx("a",{className:"deployment-primary-link",href:vR(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function vR(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function wR(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function Ew(){const e=await fetch(ge("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function bb(){const e=await fetch(ge("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function kR(){const e=ge("admin/users"),i=await fetch(e);if(!i.ok)throw await dn(i,{url:e});return(await i.json()).users}async function SR(e){const i=ge("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw await dn(a,{method:"POST",url:i});return(await a.json()).user}async function jR(e,i){const a=ge(`admin/users/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await dn(r,{method:"PATCH",url:a});return(await r.json()).user}async function CR(e){const i=ge(`admin/users/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await dn(a,{method:"DELETE",url:i})}function TR(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const a=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;if(a.status===401){const u=await a.clone().json().then(c=>c&&typeof c=="object"&&"error"in c?c.error:void 0).catch(()=>{});YE(a.status,u,r.includes("/api/auth/"))==="reauthenticate"&&window.dispatchEvent(new Event(Qp))}return a.status===503&&r.includes("/api/")&&jr(),a},window.__seeleAuthFetchInstalled=!0}function jr(){window.dispatchEvent(new Event(Zp))}export{Tt as _,Jk as a,mS as b,hx as c,dS as f,vb as g,hS as h,uh as s,aS as w};
|
|
131
|
+
`);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function cR(e){var r,u,c,d,p;if(!e||typeof e!="object")return null;const i=e;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:(p=i.params)==null?void 0:p.itemId}:null}function dR(e){var r;if(!e||typeof e!="object")return null;const i=e;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 fR(e){var r;if(!e||typeof e!="object")return null;const i=e;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 Vc(e){var a,r,u,c;if(e.event==="server.error"||e.event==="client.error")return"error";if(!e.data||typeof e.data!="object")return null;const i=e.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 Ns(e){return e.length<=6?e:e.slice(0,6)}function Nl(e){return e.slice(0,8)}function gb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function yb(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function zp(e,...i){return i.includes(e)}function pR(e,i){const a=Date.parse(e.startedAt??e.createdAt),r=e.finishedAt?Date.parse(e.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 hR(e,i){const a=Date.parse(e),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 rh(e,i){var a;return i==="running"||i==="error"?i:((a=e==null?void 0:e.nextWakeup)==null?void 0:a.status)==="scheduled"?"waiting":i}function mR(e,i){return`waiting ${ad(e,i)}`}function ad(e,i){const a=Date.parse(e.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 Xc(e,i=null,a=Date.now()){if(e==="waiting")return i?mR(i,a):"waiting";switch(e){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 xb(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function gR(e){return e==="assistant"?"Seele":"You"}const yR=document.getElementById("root"),Tw=window.__seeleCodexRoot??Zk.createRoot(yR);window.__seeleCodexRoot=Tw;TR();Tw.render(s.jsx(D.StrictMode,{children:s.jsx(xR,{})}));function xR(){const[e,i]=D.useState(null),[a,r]=D.useState(null),[u,c]=D.useState(""),[d,p]=D.useState(""),[g,m]=D.useState("admin"),[b,x]=D.useState(""),[S,w]=D.useState(!1),[E,M]=D.useState("");D.useEffect(()=>{let q=!1,$=0;const V=async()=>{try{const ie=await bb();if(q)return;i(ie),p("")}catch{if(q)return;p("Reconnecting to Seele..."),$=window.setTimeout(V,2e3)}};return V(),()=>{q=!0,window.clearTimeout($)}},[]),D.useEffect(()=>{let q=!1,$=0;const V=async()=>{try{const N=await Ew();if(q)return;r(N),c(""),$=window.setTimeout(V,N.status==="authorized"&&N.configurationReady&&N.codexAccountsReady?3e4:3e3)}catch{if(q)return;c("Unable to reach Seele."),$=window.setTimeout(V,3e3)}},ie=()=>{window.clearTimeout($),V()};return window.addEventListener(Zp,ie),V(),()=>{q=!0,window.clearTimeout($),window.removeEventListener(Zp,ie)}},[]),D.useEffect(()=>{const q=()=>{i({enabled:!0,authenticated:!1,user:null}),x(""),M("Your session has expired. Sign in again.")};return window.addEventListener(Qp,q),()=>window.removeEventListener(Qp,q)},[]);async function H(q){q.preventDefault(),w(!0),M("");try{const $=await fetch(ge("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:g,password:b})});if(!$.ok){M($.status===401?"Incorrect username or password.":$.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}x(""),i(await bb())}catch{M("Unable to reach Seele.")}finally{w(!1)}}async function R(){await fetch(ge("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}if(a&&(a.status!=="authorized"||!a.configurationReady||!a.codexAccountsReady))return s.jsx(bR,{authorization:a});if(!e||!a)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:u||d||"Loading Seele..."})});if(!e.enabled||e.authenticated){const q=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(MA,{authEnabled:e.enabled,currentUser:q,onLogout:R})}return s.jsx("main",{className:"auth-shell",children:s.jsxs("section",{className:"auth-panel",children:[s.jsxs("header",{children:[s.jsx("p",{children:"Seele"}),s.jsx("h1",{children:"Sign in"})]}),s.jsxs("form",{onSubmit:H,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:q=>m(q.target.value),value:g})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:q=>x(q.target.value),type:"password",value:b})]}),E?s.jsx("p",{className:"auth-error",role:"alert",children:E}):null,s.jsx("button",{disabled:S||!g||!b,type:"submit",children:S?"Signing in...":"Sign in"})]})]})})}function bR({authorization:e}){const i={starting:{title:"Checking deployment authorization",body:"Seele is contacting its configured cloud service."},pending:{title:"Waiting for cloud approval",body:"A cloud administrator must authorize this deployment before it can be used."},revoked:{title:"Deployment access revoked",body:"This deployment is disabled until a cloud administrator authorizes it again."},unavailable:{title:"Cloud authorization unavailable",body:"Seele will keep retrying. Business APIs and the runtime remain paused."},authorized:{title:"Deployment authorized",body:"Seele is ready."}},a=e.status==="authorized"&&!e.configurationReady?{title:"Synchronizing global configuration",body:"Seele is applying the current cloud configuration before the deployment becomes available."}:e.status==="authorized"&&!e.codexAccountsReady?{title:"Synchronizing Codex accounts",body:"Seele is installing the cloud account credentials before the deployment becomes available."}:i[e.status];return s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-waiting-panel",children:[s.jsx("div",{className:`deployment-status-mark is-${e.status}`,"aria-hidden":"true"}),s.jsx("p",{className:"deployment-kicker",children:"Seele deployment"}),s.jsx("h1",{children:a.title}),s.jsx("p",{className:"deployment-lead",children:a.body}),s.jsxs("dl",{className:"deployment-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Deployment ID"}),s.jsx("dd",{children:s.jsx("code",{children:e.deploymentId})})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:e.name})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Cloud"}),s.jsx("dd",{children:e.cloudUrl})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last checked"}),s.jsx("dd",{children:e.lastCheckedAt?wR(e.lastCheckedAt):"Starting"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsxs("dd",{children:[e.appliedGlobalRevision," / ",e.requiredGlobalRevision]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex account revision"}),s.jsxs("dd",{children:[e.appliedCodexAccountRevision," / ",e.requiredCodexAccountRevision]})]})]}),e.lastError||e.configurationError||e.codexAccountError?s.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError||e.configurationError||e.codexAccountError}):null,s.jsx("a",{className:"deployment-primary-link",href:vR(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function vR(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function wR(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function Ew(){const e=await fetch(ge("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function bb(){const e=await fetch(ge("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function kR(){const e=ge("admin/users"),i=await fetch(e);if(!i.ok)throw await fn(i,{url:e});return(await i.json()).users}async function SR(e){const i=ge("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw await fn(a,{method:"POST",url:i});return(await a.json()).user}async function jR(e,i){const a=ge(`admin/users/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await fn(r,{method:"PATCH",url:a});return(await r.json()).user}async function CR(e){const i=ge(`admin/users/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await fn(a,{method:"DELETE",url:i})}function TR(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const a=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;if(a.status===401){const u=await a.clone().json().then(c=>c&&typeof c=="object"&&"error"in c?c.error:void 0).catch(()=>{});YE(a.status,u,r.includes("/api/auth/"))==="reauthenticate"&&window.dispatchEvent(new Event(Qp))}return a.status===503&&r.includes("/api/")&&Sr(),a},window.__seeleAuthFetchInstalled=!0}function Sr(){window.dispatchEvent(new Event(Zp))}export{Tt as _,Jk as a,mS as b,hx as c,dS as f,vb as g,hS as h,uh as s,aS as w};
|