@seele00/seele 0.1.68 → 0.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libexec/seele-server +0 -0
- package/libexec/seele-worker +0 -0
- package/package.json +1 -1
- package/web/dist/assets/{abnfDiagram-VRR7QNED-BjOBp60C.js → abnfDiagram-VRR7QNED-oS8kY8LV.js} +1 -1
- package/web/dist/assets/{arc-DWNjkzCj.js → arc-B-114UVp.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-BhJgtsd2.js → architectureDiagram-ZJ3FMSHR-BCj04PQF.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-CQL2hrG6.js → blockDiagram-677ZJIJ3-DRhYXp3c.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-i3id2p5H.js → c4Diagram-LMCZKHZV-B21_OeS1.js} +1 -1
- package/web/dist/assets/channel-Dp6kjiHd.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-vldrBz7z.js → chunk-2Q5K7J3B-DIWhWoWu.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-BYKVrGHG.js → chunk-32BRIVSS--C4WFpwg.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-BSkatTTy.js → chunk-5VM5RSS4-BpQ3t5HK.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-BUT7WtYc.js → chunk-EX3LRPZG-Do1kDpcd.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-DkIel1W4.js → chunk-JWPE2WC7-87yls-9Y.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-CQHnq-qa.js → chunk-MOJQB5TN-S2T8pMmm.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-BMGhR4Pf.js → chunk-RYQCIY6F-BbaS_b2L.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-PZLcSRMm.js → chunk-V7JOEXUC-Cu7ZxcYq.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-Bi2o1Sks.js → chunk-VR4S4FIN-CDlkqO6z.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-hLvrOsqk.js → chunk-XXDRQBXY-iHT5xUcm.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-CmLyjsmC.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-CmLyjsmC.js +1 -0
- package/web/dist/assets/{core-C37HqXUQ.js → core-DQSoOJXF.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-BT3I5Dlr.js → cose-bilkent-JH36ORCC-CJomsuGT.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-Dlu-1CCa.js → cynefin-VYW2F7L2-D8JZFrjc.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-Bcyd3WiC.js → cynefinDiagram-TSTJHNR4-DnygiUq3.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-uGsjH0IB.js → dagre-VKFMJZFB-DHzZYnvk.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-BeAlI2Sx.js → diagram-FQU43EPY-9Aj-4Diu.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-BovEeBcz.js → diagram-G47NLZAW-_Siz1JFt.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-OCXvbd2Y.js → diagram-NH7WQ7WH-BkaGZMwJ.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-Dhw0i9SU.js → diagram-OA4YK3LP-Clf852C9.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-CNiciHwx.js → diagram-WEI45ONY-Idnpu_zq.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-B4zyJI3F.js → ebnfDiagram-CCIWWBDH-CwzEZiPb.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-CTg7rKw7.js → erDiagram-Q63AITRT-DYCPgDNQ.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-BYOcQZHY.js → flowDiagram-23GEKE2U-BWxQK_3r.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-EHfiyzV7.js → ganttDiagram-NO4QXBWP-C3frT6hB.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-2khId8yV.js → gitGraphDiagram-IHSO6WYX-C4almRnh.js} +1 -1
- package/web/dist/assets/index-CF0rgEvT.js +120 -0
- package/web/dist/assets/index-DJQAqqOv.css +1 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-CpAG9Ers.js → infoDiagram-FWYZ7A6U-BYukkM9r.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-7WPE4LpU.js → ishikawaDiagram-FXEZZL3T-CLH7le5d.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-CTNr7NWP.js → journeyDiagram-5HDEW3XC-CUTly7ei.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-ENr17lJW.js → kanban-definition-HUTT4EX6-B8D6sCKI.js} +1 -1
- package/web/dist/assets/{linear-CQAJRi6v.js → linear-uO4JyAjR.js} +1 -1
- package/web/dist/assets/{mermaid.core-BLflHVXr.js → mermaid.core-DTg-GtLV.js} +4 -4
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-Cdc53u_R.js → mindmap-definition-LN4V7U3C-CoPGduAr.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-WA8CeEJY.js → pegDiagram-2B236MQR-BmoZNi3R.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-2sHT6S9v.js → pieDiagram-ENE6RG2P-wAn730ZV.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-DLueuY0z.js → quadrantDiagram-ABIIQ3AL-91aSMQTF.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-U0UiODwu.js → railroadDiagram-RFXS5EU6-B8UJhf3J.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-BcLWz1K7.js → requirementDiagram-TGXJPOKE-C9aPawTs.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-C1L8QOju.js → sankeyDiagram-HTMAVEWB-dnlymmfy.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-fBYlterW.js → sequenceDiagram-DBY2YBRQ-qNa5Z4FQ.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-CCRT4QRx.js → sizeCapture-X5ZJPWSS-BaYMhqVL.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-BXAjCK7x.js → stateDiagram-2N3HPSRC-CeD47D9t.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-CjsqiqZK.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-X9Ho-RvL.js → swimlanes-5IMT3BWC-ClcP42DX.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BpSHa5SV.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-CuTeumWf.js → timeline-definition-FHXFAJF6-BTraBrSk.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-B2nAmQbt.js → vennDiagram-L72KCM5P-S32wXK7Y.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-tb6HXTNK.js → wardleyDiagram-EHGQE667-DML71lWz.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-C5czv02d.js → xychartDiagram-FW5EYKEG-BGPrBpJN.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/channel-95G0oMQW.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-BNuRXHqD.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-BNuRXHqD.js +0 -1
- package/web/dist/assets/index-CE_oWBFj.css +0 -1
- package/web/dist/assets/index-g9r3tklj.js +0 -118
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-B8Nl6PEf.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BzlgR5Zx.js +0 -8
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var ek=Object.defineProperty;var tk=(e,i,a)=>i in e?ek(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var lc=(e,i,a)=>tk(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 nk="modulepreload",ik=function(e,i){return new URL(e,i).href},ly={},kt=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let d=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const h=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(a.map(b=>{if(b=ik(b,r),b in ly)return;ly[b]=!0;const x=b.endsWith(".css"),w=x?'[rel="stylesheet"]':"";if(!!r)for(let z=h.length-1;z>=0;z--){const L=h[z];if(L.href===b&&(!x||L.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${w}`))return;const A=document.createElement("link");if(A.rel=x?"stylesheet":nk,x||(A.as="script"),A.crossOrigin="",A.href=b,m&&A.setAttribute("nonce",m),document.head.appendChild(A),x)return new Promise((z,L)=>{A.addEventListener("load",z),A.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return u.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return i().catch(c)})};function Vx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Df={exports:{}},no={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var ay;function lk(){if(ay)return no;ay=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var h in u)h!=="key"&&(c[h]=u[h])}else c=u;return u=c.ref,{$$typeof:e,type:r,key:d,ref:u!==void 0?u:null,props:c}}return no.Fragment=i,no.jsx=a,no.jsxs=a,no}var ry;function ak(){return ry||(ry=1,Df.exports=lk()),Df.exports}var o=ak(),Mf={exports:{}},Ue={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var sy;function rk(){if(sy)return Ue;sy=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"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),w=Symbol.iterator;function S(T){return T===null||typeof T!="object"?null:(T=w&&T[w]||T["@@iterator"],typeof T=="function"?T:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,L={};function D(T,q,E){this.props=T,this.context=q,this.refs=L,this.updater=E||A}D.prototype.isReactComponent={},D.prototype.setState=function(T,q){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,q,"setState")},D.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function X(){}X.prototype=D.prototype;function G(T,q,E){this.props=T,this.context=q,this.refs=L,this.updater=E||A}var P=G.prototype=new X;P.constructor=G,z(P,D.prototype),P.isPureReactComponent=!0;var de=Array.isArray;function _(){}var K={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function Q(T,q,E){var te=E.ref;return{$$typeof:e,type:T,key:q,ref:te!==void 0?te:null,props:E}}function H(T,q){return Q(T.type,q,T.props)}function oe(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function fe(T){var q={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(E){return q[E]})}var Se=/\/+/g;function me(T,q){return typeof T=="object"&&T!==null&&T.key!=null?fe(""+T.key):q.toString(36)}function re(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(_,_):(T.status="pending",T.then(function(q){T.status==="pending"&&(T.status="fulfilled",T.value=q)},function(q){T.status==="pending"&&(T.status="rejected",T.reason=q)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function $(T,q,E,te,ge){var he=typeof T;(he==="undefined"||he==="boolean")&&(T=null);var be=!1;if(T===null)be=!0;else switch(he){case"bigint":case"string":case"number":be=!0;break;case"object":switch(T.$$typeof){case e:case i:be=!0;break;case b:return be=T._init,$(be(T._payload),q,E,te,ge)}}if(be)return ge=ge(T),be=te===""?"."+me(T,0):te,de(ge)?(E="",be!=null&&(E=be.replace(Se,"$&/")+"/"),$(ge,q,E,"",function(At){return At})):ge!=null&&(oe(ge)&&(ge=H(ge,E+(ge.key==null||T&&T.key===ge.key?"":(""+ge.key).replace(Se,"$&/")+"/")+be)),q.push(ge)),1;be=0;var Le=te===""?".":te+":";if(de(T))for(var He=0;He<T.length;He++)te=T[He],he=Le+me(te,He),be+=$(te,q,E,he,ge);else if(He=S(T),typeof He=="function")for(T=He.call(T),He=0;!(te=T.next()).done;)te=te.value,he=Le+me(te,He++),be+=$(te,q,E,he,ge);else if(he==="object"){if(typeof T.then=="function")return $(re(T),q,E,te,ge);throw q=String(T),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return be}function ae(T,q,E){if(T==null)return T;var te=[],ge=0;return $(T,te,"","",function(he){return q.call(E,he,ge++)}),te}function xe(T){if(T._status===-1){var q=T._result;q=q(),q.then(function(E){(T._status===0||T._status===-1)&&(T._status=1,T._result=E)},function(E){(T._status===0||T._status===-1)&&(T._status=2,T._result=E)}),T._status===-1&&(T._status=0,T._result=q)}if(T._status===1)return T._result.default;throw T._result}var Te=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=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(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},N={map:ae,forEach:function(T,q,E){ae(T,function(){q.apply(this,arguments)},E)},count:function(T){var q=0;return ae(T,function(){q++}),q},toArray:function(T){return ae(T,function(q){return q})||[]},only:function(T){if(!oe(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Ue.Activity=x,Ue.Children=N,Ue.Component=D,Ue.Fragment=a,Ue.Profiler=u,Ue.PureComponent=G,Ue.StrictMode=r,Ue.Suspense=g,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(T){return K.H.useMemoCache(T)}},Ue.cache=function(T){return function(){return T.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(T,q,E){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var te=z({},T.props),ge=T.key;if(q!=null)for(he in q.key!==void 0&&(ge=""+q.key),q)!ee.call(q,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&q.ref===void 0||(te[he]=q[he]);var he=arguments.length-2;if(he===1)te.children=E;else if(1<he){for(var be=Array(he),Le=0;Le<he;Le++)be[Le]=arguments[Le+2];te.children=be}return Q(T.type,ge,te)},Ue.createContext=function(T){return T={$$typeof:d,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:c,_context:T},T},Ue.createElement=function(T,q,E){var te,ge={},he=null;if(q!=null)for(te in q.key!==void 0&&(he=""+q.key),q)ee.call(q,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ge[te]=q[te]);var be=arguments.length-2;if(be===1)ge.children=E;else if(1<be){for(var Le=Array(be),He=0;He<be;He++)Le[He]=arguments[He+2];ge.children=Le}if(T&&T.defaultProps)for(te in be=T.defaultProps,be)ge[te]===void 0&&(ge[te]=be[te]);return Q(T,he,ge)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(T){return{$$typeof:h,render:T}},Ue.isValidElement=oe,Ue.lazy=function(T){return{$$typeof:b,_payload:{_status:-1,_result:T},_init:xe}},Ue.memo=function(T,q){return{$$typeof:m,type:T,compare:q===void 0?null:q}},Ue.startTransition=function(T){var q=K.T,E={};K.T=E;try{var te=T(),ge=K.S;ge!==null&&ge(E,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(_,Te)}catch(he){Te(he)}finally{q!==null&&E.types!==null&&(q.types=E.types),K.T=q}},Ue.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},Ue.use=function(T){return K.H.use(T)},Ue.useActionState=function(T,q,E){return K.H.useActionState(T,q,E)},Ue.useCallback=function(T,q){return K.H.useCallback(T,q)},Ue.useContext=function(T){return K.H.useContext(T)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(T,q){return K.H.useDeferredValue(T,q)},Ue.useEffect=function(T,q){return K.H.useEffect(T,q)},Ue.useEffectEvent=function(T){return K.H.useEffectEvent(T)},Ue.useId=function(){return K.H.useId()},Ue.useImperativeHandle=function(T,q,E){return K.H.useImperativeHandle(T,q,E)},Ue.useInsertionEffect=function(T,q){return K.H.useInsertionEffect(T,q)},Ue.useLayoutEffect=function(T,q){return K.H.useLayoutEffect(T,q)},Ue.useMemo=function(T,q){return K.H.useMemo(T,q)},Ue.useOptimistic=function(T,q){return K.H.useOptimistic(T,q)},Ue.useReducer=function(T,q,E){return K.H.useReducer(T,q,E)},Ue.useRef=function(T){return K.H.useRef(T)},Ue.useState=function(T){return K.H.useState(T)},Ue.useSyncExternalStore=function(T,q,E){return K.H.useSyncExternalStore(T,q,E)},Ue.useTransition=function(){return K.H.useTransition()},Ue.version="19.2.7",Ue}var oy;function Up(){return oy||(oy=1,Mf.exports=rk()),Mf.exports}var O=Up(),Of={exports:{}},io={},Rf={exports:{}},zf={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var uy;function sk(){return uy||(uy=1,(function(e){function i($,ae){var xe=$.length;$.push(ae);e:for(;0<xe;){var Te=xe-1>>>1,N=$[Te];if(0<u(N,ae))$[Te]=ae,$[xe]=N,xe=Te;else break e}}function a($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var ae=$[0],xe=$.pop();if(xe!==ae){$[0]=xe;e:for(var Te=0,N=$.length,T=N>>>1;Te<T;){var q=2*(Te+1)-1,E=$[q],te=q+1,ge=$[te];if(0>u(E,xe))te<N&&0>u(ge,E)?($[Te]=ge,$[te]=xe,Te=te):($[Te]=E,$[q]=xe,Te=q);else if(te<N&&0>u(ge,xe))$[Te]=ge,$[te]=xe,Te=te;else break e}}return ae}function u($,ae){var xe=$.sortIndex-ae.sortIndex;return xe!==0?xe:$.id-ae.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,h=d.now();e.unstable_now=function(){return d.now()-h}}var g=[],m=[],b=1,x=null,w=3,S=!1,A=!1,z=!1,L=!1,D=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function P($){for(var ae=a(m);ae!==null;){if(ae.callback===null)r(m);else if(ae.startTime<=$)r(m),ae.sortIndex=ae.expirationTime,i(g,ae);else break;ae=a(m)}}function de($){if(z=!1,P($),!A)if(a(g)!==null)A=!0,_||(_=!0,fe());else{var ae=a(m);ae!==null&&re(de,ae.startTime-$)}}var _=!1,K=-1,ee=5,Q=-1;function H(){return L?!0:!(e.unstable_now()-Q<ee)}function oe(){if(L=!1,_){var $=e.unstable_now();Q=$;var ae=!0;try{e:{A=!1,z&&(z=!1,X(K),K=-1),S=!0;var xe=w;try{t:{for(P($),x=a(g);x!==null&&!(x.expirationTime>$&&H());){var Te=x.callback;if(typeof Te=="function"){x.callback=null,w=x.priorityLevel;var N=Te(x.expirationTime<=$);if($=e.unstable_now(),typeof N=="function"){x.callback=N,P($),ae=!0;break t}x===a(g)&&r(g),P($)}else r(g);x=a(g)}if(x!==null)ae=!0;else{var T=a(m);T!==null&&re(de,T.startTime-$),ae=!1}}break e}finally{x=null,w=xe,S=!1}ae=void 0}}finally{ae?fe():_=!1}}}var fe;if(typeof G=="function")fe=function(){G(oe)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,me=Se.port2;Se.port1.onmessage=oe,fe=function(){me.postMessage(null)}}else fe=function(){D(oe,0)};function re($,ae){K=D(function(){$(e.unstable_now())},ae)}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($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function($){switch(w){case 1:case 2:case 3:var ae=3;break;default:ae=w}var xe=w;w=ae;try{return $()}finally{w=xe}},e.unstable_requestPaint=function(){L=!0},e.unstable_runWithPriority=function($,ae){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var xe=w;w=$;try{return ae()}finally{w=xe}},e.unstable_scheduleCallback=function($,ae,xe){var Te=e.unstable_now();switch(typeof xe=="object"&&xe!==null?(xe=xe.delay,xe=typeof xe=="number"&&0<xe?Te+xe:Te):xe=Te,$){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=xe+N,$={id:b++,callback:ae,priorityLevel:$,startTime:xe,expirationTime:N,sortIndex:-1},xe>Te?($.sortIndex=xe,i(m,$),a(g)===null&&$===a(m)&&(z?(X(K),K=-1):z=!0,re(de,xe-Te))):($.sortIndex=N,i(g,$),A||S||(A=!0,_||(_=!0,fe()))),$},e.unstable_shouldYield=H,e.unstable_wrapCallback=function($){var ae=w;return function(){var xe=w;w=ae;try{return $.apply(this,arguments)}finally{w=xe}}}})(zf)),zf}var cy;function ok(){return cy||(cy=1,Rf.exports=sk()),Rf.exports}var Lf={exports:{}},on={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var dy;function uk(){if(dy)return on;dy=1;var e=Up();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return on.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,on.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)},on.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()}},on.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))},on.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},on.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=h(b,m.crossOrigin),w=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:w,fetchPriority:S}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:w,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},on.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=h(m.as,m.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(g)},on.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=h(b,m.crossOrigin);r.d.L(g,b,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},on.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=h(m.as,m.crossOrigin);r.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(g)},on.requestFormReset=function(g){r.d.r(g)},on.unstable_batchedUpdates=function(g,m){return g(m)},on.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},on.useFormStatus=function(){return d.H.useHostTransitionStatus()},on.version="19.2.7",on}var fy;function ck(){if(fy)return Lf.exports;fy=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(),Lf.exports=uk(),Lf.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var py;function dk(){if(py)return io;py=1;var e=ok(),i=Up(),a=ck();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 h(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,s=n;;){var f=l.return;if(f===null)break;var p=f.alternate;if(p===null){if(s=f.return,s!==null){l=s;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===l)return g(f),t;if(p===s)return g(f),n;p=p.sibling}throw Error(r(188))}if(l.return!==s.return)l=f,s=p;else{for(var v=!1,j=f.child;j;){if(j===l){v=!0,l=f,s=p;break}if(j===s){v=!0,s=f,l=p;break}j=j.sibling}if(!v){for(j=p.child;j;){if(j===l){v=!0,l=p,s=f;break}if(j===s){v=!0,s=p,l=f;break}j=j.sibling}if(!v)throw Error(r(189))}}if(l.alternate!==s)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?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,w=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),G=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function fe(t){return t===null||typeof t!="object"?null:(t=oe&&t[oe]||t["@@iterator"],typeof t=="function"?t:null)}var Se=Symbol.for("react.client.reference");function me(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Se?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case z:return"Fragment";case D:return"Profiler";case L:return"StrictMode";case de:return"Suspense";case _:return"SuspenseList";case Q:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case G:return t.displayName||"Context";case X:return(t._context.displayName||"Context")+".Consumer";case P:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case K:return n=t.displayName||null,n!==null?n:me(t.type)||"Memo";case ee:n=t._payload,t=t._init;try{return me(t(n))}catch{}}return null}var re=Array.isArray,$=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Te=[],N=-1;function T(t){return{current:t}}function q(t){0>N||(t.current=Te[N],Te[N]=null,N--)}function E(t,n){N++,Te[N]=t.current,t.current=n}var te=T(null),ge=T(null),he=T(null),be=T(null);function Le(t,n){switch(E(he,n),E(ge,t),E(te,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Tg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Tg(n),t=Ag(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}q(te),E(te,t)}function He(){q(te),q(ge),q(he)}function At(t){t.memoizedState!==null&&E(be,t);var n=te.current,l=Ag(n,t.type);n!==l&&(E(ge,t),E(te,l))}function St(t){ge.current===t&&(q(te),q(ge)),be.current===t&&(q(be),Zs._currentValue=xe)}var dn,bn;function jt(t){if(dn===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);dn=n&&n[1]||"",bn=-1<l.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+dn+t+bn}var vn=!1;function ze(t,n){if(!t||vn)return"";vn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(W){var F=W}Reflect.construct(t,[],le)}else{try{le.call()}catch(W){F=W}t.call(le.prototype)}}else{try{throw Error()}catch(W){F=W}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(W){if(W&&F&&typeof W.stack=="string")return[W.stack,F.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=s.DetermineComponentFrameRoot(),v=p[0],j=p[1];if(v&&j){var R=v.split(`
|
|
45
|
+
`),Y=j.split(`
|
|
46
|
+
`);for(f=s=0;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;for(;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;if(s===R.length||f===Y.length)for(s=R.length-1,f=Y.length-1;1<=s&&0<=f&&R[s]!==Y[f];)f--;for(;1<=s&&0<=f;s--,f--)if(R[s]!==Y[f]){if(s!==1||f!==1)do if(s--,f--,0>f||R[s]!==Y[f]){var J=`
|
|
47
|
+
`+R[s].replace(" at new "," at ");return t.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",t.displayName)),J}while(1<=s&&0<=f);break}}}finally{vn=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?jt(l):""}function Gt(t,n){switch(t.tag){case 26:case 27:case 5:return jt(t.type);case 16:return jt("Lazy");case 13:return t.child!==n&&n!==null?jt("Suspense Fallback"):jt("Suspense");case 19:return jt("SuspenseList");case 0:case 15:return ze(t.type,!1);case 11:return ze(t.type.render,!1);case 1:return ze(t.type,!0);case 31:return jt("Activity");default:return""}}function Jn(t){try{var n="",l=null;do n+=Gt(t,l),l=t,t=t.return;while(t);return n}catch(s){return`
|
|
48
|
+
Error generating stack: `+s.message+`
|
|
49
|
+
`+s.stack}}var Un=Object.prototype.hasOwnProperty,di=e.unstable_scheduleCallback,yt=e.unstable_cancelCallback,Vt=e.unstable_shouldYield,vi=e.unstable_requestPaint,Nt=e.unstable_now,wi=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,se=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,Qe=e.unstable_IdlePriority,fn=e.log,fi=e.unstable_setDisableYieldValue,Xt=null,Ct=null;function Qt(t){if(typeof fn=="function"&&fi(t),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Xt,t)}catch{}}var tt=Math.clz32?Math.clz32:wt,zt=Math.log,Yt=Math.LN2;function wt(t){return t>>>=0,t===0?32:31-(zt(t)/Yt|0)|0}var ki=256,Xa=262144,Si=4194304;function ji(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 Ci(t,n,l){var s=t.pendingLanes;if(s===0)return 0;var f=0,p=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var j=s&134217727;return j!==0?(s=j&~p,s!==0?f=ji(s):(v&=j,v!==0?f=ji(v):l||(l=j&~t,l!==0&&(f=ji(l))))):(j=s&~p,j!==0?f=ji(j):v!==0?f=ji(v):l||(l=s&~t,l!==0&&(f=ji(l)))),f===0?0:n!==0&&n!==f&&(n&p)===0&&(p=f&-f,l=n&-n,p>=l||p===32&&(l&4194048)!==0)?n:f}function da(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Do(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 Mo(){var t=Si;return Si<<=1,(Si&62914560)===0&&(Si=4194304),t}function Qa(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function fa(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Oo(t,n,l,s,f,p){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 j=t.entanglements,R=t.expirationTimes,Y=t.hiddenUpdates;for(l=v&~l;0<l;){var J=31-tt(l),le=1<<J;j[J]=0,R[J]=-1;var F=Y[J];if(F!==null)for(Y[J]=null,J=0;J<F.length;J++){var W=F[J];W!==null&&(W.lane&=-536870913)}l&=~le}s!==0&&Ro(t,s,0),p!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=p&~(v&~n))}function Ro(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var s=31-tt(n);t.entangledLanes|=n,t.entanglements[s]=t.entanglements[s]|1073741824|l&261930}function bl(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var s=31-tt(l),f=1<<s;f&n|t[s]&n&&(t[s]|=n),l&=~f}}function qi(t,n){var l=n&-n;return l=(l&42)!==0?1:Ei(l),(l&(t.suspendedLanes|n))!==0?0:l}function Ei(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 Ti(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Hi(){var t=ae.p;return t!==0?t:(t=window.event,t===void 0?32:Qg(t.type))}function Za(t,n){var l=ae.p;try{return ae.p=t,n()}finally{ae.p=l}}var Bn=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Bn,Lt="__reactProps$"+Bn,Ai="__reactContainer$"+Bn,pa="__reactEvents$"+Bn,Jr="__reactListeners$"+Bn,es="__reactHandles$"+Bn,zo="__reactResources$"+Bn,vl="__reactMarker$"+Bn;function ei(t){delete t[Ht],delete t[Lt],delete t[pa],delete t[Jr],delete t[es]}function Ni(t){var n=t[Ht];if(n)return n;for(var l=t.parentNode;l;){if(n=l[Ai]||l[Ht]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=zg(t);t!==null;){if(l=t[Ht])return l;t=zg(t)}return n}t=l,l=t.parentNode}return null}function $i(t){if(t=t[Ht]||t[Ai]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ha(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function wl(t){var n=t[zo];return n||(n=t[zo]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function _t(t){t[vl]=!0}var Lo=new Set,ts={};function ln(t,n){qn(t,n),qn(t+"Capture",n)}function qn(t,n){for(ts[t]=n,t=0;t<n.length;t++)Lo.add(n[t])}var Ic=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]*$"),kl={},Sl={};function Io(t){return Un.call(Sl,t)?!0:Un.call(kl,t)?!1:Ic.test(t)?Sl[t]=!0:(kl[t]=!0,!1)}function wn(t,n,l){if(Io(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function kn(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 Zt(t,n,l,s){if(s===null)t.removeAttribute(l);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,""+s)}}function pn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function jl(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Uc(t,n,l){var s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var f=s.get,p=s.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,p.call(this,v)}}),Object.defineProperty(t,n,{enumerable:s.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Gi(t){if(!t._valueTracker){var n=jl(t)?"checked":"value";t._valueTracker=Uc(t,n,""+t[n])}}function Uo(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return t&&(s=jl(t)?t.checked?"true":"false":t.value),t=s,t!==l?(n.setValue(t),!0):!1}function Vi(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 ma=/[\n"\\]/g;function an(t){return t.replace(ma,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ga(t,n,l,s,f,p,v,j){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=""+pn(n)):t.value!==""+pn(n)&&(t.value=""+pn(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?Cl(t,v,pn(n)):l!=null?Cl(t,v,pn(l)):s!=null&&t.removeAttribute("value"),f==null&&p!=null&&(t.defaultChecked=!!p),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.name=""+pn(j):t.removeAttribute("name")}function ns(t,n,l,s,f,p,v,j){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),n!=null||l!=null){if(!(p!=="submit"&&p!=="reset"||n!=null)){Gi(t);return}l=l!=null?""+pn(l):"",n=n!=null?""+pn(n):l,j||n===t.value||(t.value=n),t.defaultValue=n}s=s??f,s=typeof s!="function"&&typeof s!="symbol"&&!!s,t.checked=j?t.checked:!!s,t.defaultChecked=!!s,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),Gi(t)}function Cl(t,n,l){n==="number"&&Vi(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function Jt(t,n,l,s){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&&s&&(t[l].defaultSelected=!0)}else{for(l=""+pn(l),n=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,s&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function pi(t,n,l){if(n!=null&&(n=""+pn(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+pn(l):""}function Ja(t,n,l,s){if(n==null){if(s!=null){if(l!=null)throw Error(r(92));if(re(s)){if(1<s.length)throw Error(r(93));s=s[0]}l=s}l==null&&(l=""),n=l}l=pn(n),t.defaultValue=l,s=t.textContent,s===l&&s!==""&&s!==null&&(t.value=s),Gi(t)}function ti(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var is=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function er(t,n,l){var s=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?s?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":s?t.setProperty(n,l):typeof l!="number"||l===0||is.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function Bo(t,n,l){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,l!=null){for(var s in l)!l.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="");for(var f in n)s=n[f],n.hasOwnProperty(f)&&l[f]!==s&&er(t,f,s)}else for(var p in n)n.hasOwnProperty(p)&&er(t,p,n[p])}function ya(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 qo=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Bc=/^[\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 ni(t){return Bc.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function hi(){}var tr=null;function El(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Yi=null,Fi=null;function xa(t){var n=$i(t);if(n&&(t=n.stateNode)){var l=t[Lt]||null;e:switch(t=n.stateNode,n.type){case"input":if(ga(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="'+an(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==t&&s.form===t.form){var f=s[Lt]||null;if(!f)throw Error(r(90));ga(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)s=l[n],s.form===t.form&&Uo(s)}break e;case"textarea":pi(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&Jt(t,!!l.multiple,n,!1)}}}var nr=!1;function Tl(t,n,l){if(nr)return t(n,l);nr=!0;try{var s=t(n);return s}finally{if(nr=!1,(Yi!==null||Fi!==null)&&(Lu(),Yi&&(n=Yi,t=Fi,Fi=Yi=null,xa(n),t)))for(n=0;n<t.length;n++)xa(t[n])}}function Pi(t,n){var l=t.stateNode;if(l===null)return null;var s=l[Lt]||null;if(s===null)return null;l=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(t=t.type,s=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!s;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,n,typeof l));return l}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ba=!1;if(Hn)try{var Al={};Object.defineProperty(Al,"passive",{get:function(){ba=!0}}),window.addEventListener("test",Al,Al),window.removeEventListener("test",Al,Al)}catch{ba=!1}var mi=null,ii=null,hn=null;function en(){if(hn)return hn;var t,n=ii,l=n.length,s,f="value"in mi?mi.value:mi.textContent,p=f.length;for(t=0;t<l&&n[t]===f[t];t++);var v=l-t;for(s=1;s<=v&&n[l-s]===f[p-s];s++);return hn=f.slice(t,1<s?1-s:void 0)}function Ki(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 Wi(){return!0}function Nl(){return!1}function Dt(t){function n(l,s,f,p,v){this._reactName=l,this._targetInst=f,this.type=s,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var j in t)t.hasOwnProperty(j)&&(l=t[j],this[j]=l?l(p):p[j]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Wi:Nl,this.isPropagationStopped=Nl,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Wi)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Wi)},persist:function(){},isPersistent:Wi}),n}var li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Dt(li),Qi=x({},li,{view:0,detail:0}),ls=Dt(Qi),je,ir,Sn,Mt=x({},Qi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ja,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!==Sn&&(Sn&&t.type==="mousemove"?(je=t.screenX-Sn.screenX,ir=t.screenY-Sn.screenY):ir=je=0,Sn=t),je)},movementY:function(t){return"movementY"in t?t.movementY:ir}}),lr=Dt(Mt),va=x({},Mt,{dataTransfer:0}),nt=Dt(va),_l=x({},Qi,{relatedTarget:0}),Dl=Dt(_l),wa=x({},li,{animationName:0,elapsedTime:0,pseudoElement:0}),ka=Dt(wa),as=x({},li,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ar=Dt(as),qc=x({},li,{data:0}),Ho=Dt(qc),Sa={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$o={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},rs={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ss(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=rs[t])?!!n[t]:!1}function ja(){return ss}var os=x({},Qi,{key:function(t){if(t.key){var n=Sa[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Ki(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?$o[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ja,charCode:function(t){return t.type==="keypress"?Ki(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ki(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),rr=Dt(os),Hc=x({},Mt,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ml=Dt(Hc),$c=x({},Qi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ja}),Gc=Dt($c),Vc=x({},li,{propertyName:0,elapsedTime:0,pseudoElement:0}),Go=Dt(Vc),Zi=x({},Mt,{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}),Ca=Dt(Zi),Ae=x({},li,{newState:0,oldState:0}),Yc=Dt(Ae),jn=[9,13,27,32],us=Hn&&"CompositionEvent"in window,Ea=null;Hn&&"documentMode"in document&&(Ea=document.documentMode);var cs=Hn&&"TextEvent"in window&&!Ea,Vo=Hn&&(!us||Ea&&8<Ea&&11>=Ea),ds=" ",sr=!1;function Yo(t,n){switch(t){case"keyup":return jn.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function or(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ji=!1;function fs(t,n){switch(t){case"compositionend":return or(n);case"keypress":return n.which!==32?null:(sr=!0,ds);case"textInput":return t=n.data,t===ds&&sr?null:t;default:return null}}function Fc(t,n){if(Ji)return t==="compositionend"||!us&&Yo(t,n)?(t=en(),hn=ii=mi=null,Ji=!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 Vo&&n.locale!=="ko"?null:n.data;default:return null}}var ps={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fo(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!ps[t.type]:n==="textarea"}function Po(t,n,l,s){Yi?Fi?Fi.push(s):Fi=[s]:Yi=s,n=Gu(n,"onChange"),0<n.length&&(l=new Xi("onChange","change",null,l,s),t.push({event:l,listeners:n}))}var Ol=null,Ta=null;function Pc(t){wg(t,0)}function Aa(t){var n=ha(t);if(Uo(n))return t}function Ko(t,n){if(t==="change")return n}var Wo=!1;if(Hn){var hs;if(Hn){var ms="oninput"in document;if(!ms){var Xo=document.createElement("div");Xo.setAttribute("oninput","return;"),ms=typeof Xo.oninput=="function"}hs=ms}else hs=!1;Wo=hs&&(!document.documentMode||9<document.documentMode)}function Qo(){Ol&&(Ol.detachEvent("onpropertychange",Zo),Ta=Ol=null)}function Zo(t){if(t.propertyName==="value"&&Aa(Ta)){var n=[];Po(n,Ta,t,El(t)),Tl(Pc,n)}}function Kc(t,n,l){t==="focusin"?(Qo(),Ol=n,Ta=l,Ol.attachEvent("onpropertychange",Zo)):t==="focusout"&&Qo()}function Wc(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Aa(Ta)}function Xc(t,n){if(t==="click")return Aa(n)}function Qc(t,n){if(t==="input"||t==="change")return Aa(n)}function Zc(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var mn=typeof Object.is=="function"?Object.is:Zc;function Na(t,n){if(mn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),s=Object.keys(n);if(l.length!==s.length)return!1;for(s=0;s<l.length;s++){var f=l[s];if(!Un.call(n,f)||!mn(t[f],n[f]))return!1}return!0}function Jo(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function eu(t,n){var l=Jo(t);t=0;for(var s;l;){if(l.nodeType===3){if(s=t+l.textContent.length,t<=n&&s>=n)return{node:l,offset:n-t};t=s}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Jo(l)}}function gs(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?gs(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function _i(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Vi(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=Vi(t.document)}return n}function ur(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 _a=Hn&&"documentMode"in document&&11>=document.documentMode,Cn=null,ys=null,Da=null,xs=!1;function tu(t,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;xs||Cn==null||Cn!==Vi(s)||(s=Cn,"selectionStart"in s&&ur(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Da&&Na(Da,s)||(Da=s,s=Gu(ys,"onSelect"),0<s.length&&(n=new Xi("onSelect","select",null,n,l),t.push({event:n,listeners:s}),n.target=Cn)))}function el(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var Rl={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionrun:el("Transition","TransitionRun"),transitionstart:el("Transition","TransitionStart"),transitioncancel:el("Transition","TransitionCancel"),transitionend:el("Transition","TransitionEnd")},cr={},bs={};Hn&&(bs=document.createElement("div").style,"AnimationEvent"in window||(delete Rl.animationend.animation,delete Rl.animationiteration.animation,delete Rl.animationstart.animation),"TransitionEvent"in window||delete Rl.transitionend.transition);function tl(t){if(cr[t])return cr[t];if(!Rl[t])return t;var n=Rl[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in bs)return cr[t]=n[l];return t}var nu=tl("animationend"),iu=tl("animationiteration"),nl=tl("animationstart"),dr=tl("transitionrun"),Jc=tl("transitionstart"),ed=tl("transitioncancel"),vs=tl("transitionend"),lu=new Map,fr="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(" ");fr.push("scrollEnd");function $n(t,n){lu.set(t,n),ln(n,[t])}var pr=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)},En=[],zl=0,ws=0;function hr(){for(var t=zl,n=ws=zl=0;n<t;){var l=En[n];En[n++]=null;var s=En[n];En[n++]=null;var f=En[n];En[n++]=null;var p=En[n];if(En[n++]=null,s!==null&&f!==null){var v=s.pending;v===null?f.next=f:(f.next=v.next,v.next=f),s.pending=f}p!==0&&au(l,f,p)}}function mr(t,n,l,s){En[zl++]=t,En[zl++]=n,En[zl++]=l,En[zl++]=s,ws|=s,t.lanes|=s,t=t.alternate,t!==null&&(t.lanes|=s)}function ks(t,n,l,s){return mr(t,n,l,s),gr(t)}function il(t,n){return mr(t,null,null,n),gr(t)}function au(t,n,l){t.lanes|=l;var s=t.alternate;s!==null&&(s.lanes|=l);for(var f=!1,p=t.return;p!==null;)p.childLanes|=l,s=p.alternate,s!==null&&(s.childLanes|=l),p.tag===22&&(t=p.stateNode,t===null||t._visibility&1||(f=!0)),t=p,p=p.return;return t.tag===3?(p=t.stateNode,f&&n!==null&&(f=31-tt(l),t=p.hiddenUpdates,s=t[f],s===null?t[f]=[n]:s.push(n),n.lane=l|536870912),p):null}function gr(t){if(50<Ys)throw Ys=0,ef=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Ll={};function td(t,n,l,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(t,n,l,s){return new td(t,n,l,s)}function Ss(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Gn(t,n){var l=t.alternate;return l===null?(l=Ft(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 ru(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 yr(t,n,l,s,f,p){var v=0;if(s=t,typeof t=="function")Ss(t)&&(v=1);else if(typeof t=="string")v=$w(t,l,te.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Q:return t=Ft(31,l,n,f),t.elementType=Q,t.lanes=p,t;case z:return gi(l.children,f,p,n);case L:v=8,f|=24;break;case D:return t=Ft(12,l,n,f|2),t.elementType=D,t.lanes=p,t;case de:return t=Ft(13,l,n,f),t.elementType=de,t.lanes=p,t;case _:return t=Ft(19,l,n,f),t.elementType=_,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G:v=10;break e;case X:v=9;break e;case P:v=11;break e;case K:v=14;break e;case ee:v=16,s=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),s=null}return n=Ft(v,l,n,f),n.elementType=t,n.type=s,n.lanes=p,n}function gi(t,n,l,s){return t=Ft(7,t,s,n),t.lanes=l,t}function xr(t,n,l){return t=Ft(6,t,null,n),t.lanes=l,t}function br(t){var n=Ft(18,null,null,0);return n.stateNode=t,n}function vr(t,n,l){return n=Ft(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var wr=new WeakMap;function Tn(t,n){if(typeof t=="object"&&t!==null){var l=wr.get(t);return l!==void 0?l:(n={value:t,source:n,stack:Jn(n)},wr.set(t,n),n)}return{value:t,source:n,stack:Jn(n)}}var Il=[],Ul=0,kr=null,Bl=0,Pt=[],An=0,Di=null,rn=1,sn="";function gn(t,n){Il[Ul++]=Bl,Il[Ul++]=kr,kr=t,Bl=n}function su(t,n,l){Pt[An++]=rn,Pt[An++]=sn,Pt[An++]=Di,Di=t;var s=rn;t=sn;var f=32-tt(s)-1;s&=~(1<<f),l+=1;var p=32-tt(n)+f;if(30<p){var v=f-f%5;p=(s&(1<<v)-1).toString(32),s>>=v,f-=v,rn=1<<32-tt(n)+f|l<<f|s,sn=p+t}else rn=1<<p|l<<f|s,sn=t}function js(t){t.return!==null&&(gn(t,1),su(t,1,0))}function lt(t){for(;t===kr;)kr=Il[--Ul],Il[Ul]=null,Bl=Il[--Ul],Il[Ul]=null;for(;t===Di;)Di=Pt[--An],Pt[An]=null,sn=Pt[--An],Pt[An]=null,rn=Pt[--An],Pt[An]=null}function ll(t,n){Pt[An++]=rn,Pt[An++]=sn,Pt[An++]=Di,rn=n.id,sn=n.overflow,Di=t}var st=null,dt=null,Be=!1,Mi=null,Nn=!1,Cs=Error(r(519));function ai(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hl(Tn(n,t)),Cs}function ou(t){var n=t.stateNode,l=t.type,s=t.memoizedProps;switch(n[Ht]=t,n[Lt]=s,l){case"dialog":Ye("cancel",n),Ye("close",n);break;case"iframe":case"object":case"embed":Ye("load",n);break;case"video":case"audio":for(l=0;l<Ps.length;l++)Ye(Ps[l],n);break;case"source":Ye("error",n);break;case"img":case"image":case"link":Ye("error",n),Ye("load",n);break;case"details":Ye("toggle",n);break;case"input":Ye("invalid",n),ns(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ye("invalid",n);break;case"textarea":Ye("invalid",n),Ja(n,s.value,s.defaultValue,s.children)}l=s.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||s.suppressHydrationWarning===!0||Cg(n.textContent,l)?(s.popover!=null&&(Ye("beforetoggle",n),Ye("toggle",n)),s.onScroll!=null&&Ye("scroll",n),s.onScrollEnd!=null&&Ye("scrollend",n),s.onClick!=null&&(n.onclick=hi),n=!0):n=!1,n||ai(t,!0)}function uu(t){for(st=t.return;st;)switch(st.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:st=st.return}}function ql(t){if(t!==st)return!1;if(!Be)return uu(t),Be=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||gf(t.type,t.memoizedProps)),l=!l),l&&dt&&ai(t),uu(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));dt=Rg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));dt=Rg(t)}else n===27?(n=dt,ea(t.type)?(t=wf,wf=null,dt=t):dt=n):dt=st?si(t.stateNode.nextSibling):null;return!0}function Oi(){dt=st=null,Be=!1}function Sr(){var t=Mi;return t!==null&&(Rn===null?Rn=t:Rn.push.apply(Rn,t),Mi=null),t}function Hl(t){Mi===null?Mi=[t]:Mi.push(t)}var jr=T(null),y=null,k=null;function C(t,n,l){E(jr,n._currentValue),n._currentValue=l}function M(t){t._currentValue=jr.current,q(jr)}function I(t,n,l){for(;t!==null;){var s=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),t===l)break;t=t.return}}function Z(t,n,l,s){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var p=f.dependencies;if(p!==null){var v=f.child;p=p.firstContext;e:for(;p!==null;){var j=p;p=f;for(var R=0;R<n.length;R++)if(j.context===n[R]){p.lanes|=l,j=p.alternate,j!==null&&(j.lanes|=l),I(p.return,l,t),s||(v=null);break e}p=j.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=l,p=v.alternate,p!==null&&(p.lanes|=l),I(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 we(t,n,l,s){t=null;for(var f=n,p=!1;f!==null;){if(!p){if((f.flags&524288)!==0)p=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var j=f.type;mn(f.pendingProps.value,v.value)||(t!==null?t.push(j):t=[j])}}else if(f===be.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Zs):t=[Zs])}f=f.return}t!==null&&Z(n,t,l,s),n.flags|=262144}function Ne(t){for(t=t.firstContext;t!==null;){if(!mn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function _e(t){y=t,k=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function pe(t){return mt(y,t)}function Vn(t,n){return y===null&&_e(t),mt(t,n)}function mt(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},k===null){if(t===null)throw Error(r(308));k=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else k=k.next=n;return l}var _n=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,s){t.push(s)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},al=e.unstable_scheduleCallback,Ma=e.unstable_NormalPriority,xt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nd(){return{controller:new _n,data:new Map,refCount:0}}function Es(t){t.refCount--,t.refCount===0&&al(Ma,function(){t.controller.abort()})}var Ts=null,id=0,Cr=0,Er=null;function Hv(t,n){if(Ts===null){var l=Ts=[];id=0,Cr=sf(),Er={status:"pending",value:void 0,then:function(s){l.push(s)}}}return id++,n.then(dh,dh),n}function dh(){if(--id===0&&Ts!==null){Er!==null&&(Er.status="fulfilled");var t=Ts;Ts=null,Cr=0,Er=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function $v(t,n){var l=[],s={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){s.status="fulfilled",s.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(s.status="rejected",s.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),s}var fh=$.S;$.S=function(t,n){Wm=Nt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Hv(t,n),fh!==null&&fh(t,n)};var Oa=T(null);function ld(){var t=Oa.current;return t!==null?t:ft.pooledCache}function cu(t,n){n===null?E(Oa,Oa.current):E(Oa,n.pool)}function ph(){var t=ld();return t===null?null:{parent:xt._currentValue,pool:t}}var Tr=Error(r(460)),ad=Error(r(474)),du=Error(r(542)),fu={then:function(){}};function hh(t){return t=t.status,t==="fulfilled"||t==="rejected"}function mh(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(hi,hi),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,yh(t),t;default:if(typeof n.status=="string")n.then(hi,hi);else{if(t=ft,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(s){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=s}},function(s){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,yh(t),t}throw za=n,Tr}}function Ra(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(za=l,Tr):l}}var za=null;function gh(){if(za===null)throw Error(r(459));var t=za;return za=null,t}function yh(t){if(t===Tr||t===du)throw Error(r(483))}var Ar=null,As=0;function pu(t){var n=As;return As+=1,Ar===null&&(Ar=[]),mh(Ar,t,n)}function Ns(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function hu(t,n){throw n.$$typeof===w?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function xh(t){function n(B,U){if(t){var V=B.deletions;V===null?(B.deletions=[U],B.flags|=16):V.push(U)}}function l(B,U){if(!t)return null;for(;U!==null;)n(B,U),U=U.sibling;return null}function s(B){for(var U=new Map;B!==null;)B.key!==null?U.set(B.key,B):U.set(B.index,B),B=B.sibling;return U}function f(B,U){return B=Gn(B,U),B.index=0,B.sibling=null,B}function p(B,U,V){return B.index=V,t?(V=B.alternate,V!==null?(V=V.index,V<U?(B.flags|=67108866,U):V):(B.flags|=67108866,U)):(B.flags|=1048576,U)}function v(B){return t&&B.alternate===null&&(B.flags|=67108866),B}function j(B,U,V,ie){return U===null||U.tag!==6?(U=xr(V,B.mode,ie),U.return=B,U):(U=f(U,V),U.return=B,U)}function R(B,U,V,ie){var Ee=V.type;return Ee===z?J(B,U,V.props.children,ie,V.key):U!==null&&(U.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===ee&&Ra(Ee)===U.type)?(U=f(U,V.props),Ns(U,V),U.return=B,U):(U=yr(V.type,V.key,V.props,null,B.mode,ie),Ns(U,V),U.return=B,U)}function Y(B,U,V,ie){return U===null||U.tag!==4||U.stateNode.containerInfo!==V.containerInfo||U.stateNode.implementation!==V.implementation?(U=vr(V,B.mode,ie),U.return=B,U):(U=f(U,V.children||[]),U.return=B,U)}function J(B,U,V,ie,Ee){return U===null||U.tag!==7?(U=gi(V,B.mode,ie,Ee),U.return=B,U):(U=f(U,V),U.return=B,U)}function le(B,U,V){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=xr(""+U,B.mode,V),U.return=B,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return V=yr(U.type,U.key,U.props,null,B.mode,V),Ns(V,U),V.return=B,V;case A:return U=vr(U,B.mode,V),U.return=B,U;case ee:return U=Ra(U),le(B,U,V)}if(re(U)||fe(U))return U=gi(U,B.mode,V,null),U.return=B,U;if(typeof U.then=="function")return le(B,pu(U),V);if(U.$$typeof===G)return le(B,Vn(B,U),V);hu(B,U)}return null}function F(B,U,V,ie){var Ee=U!==null?U.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Ee!==null?null:j(B,U,""+V,ie);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return V.key===Ee?R(B,U,V,ie):null;case A:return V.key===Ee?Y(B,U,V,ie):null;case ee:return V=Ra(V),F(B,U,V,ie)}if(re(V)||fe(V))return Ee!==null?null:J(B,U,V,ie,null);if(typeof V.then=="function")return F(B,U,pu(V),ie);if(V.$$typeof===G)return F(B,U,Vn(B,V),ie);hu(B,V)}return null}function W(B,U,V,ie,Ee){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return B=B.get(V)||null,j(U,B,""+ie,Ee);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case S:return B=B.get(ie.key===null?V:ie.key)||null,R(U,B,ie,Ee);case A:return B=B.get(ie.key===null?V:ie.key)||null,Y(U,B,ie,Ee);case ee:return ie=Ra(ie),W(B,U,V,ie,Ee)}if(re(ie)||fe(ie))return B=B.get(V)||null,J(U,B,ie,Ee,null);if(typeof ie.then=="function")return W(B,U,V,pu(ie),Ee);if(ie.$$typeof===G)return W(B,U,V,Vn(U,ie),Ee);hu(U,ie)}return null}function ve(B,U,V,ie){for(var Ee=null,Je=null,ke=U,$e=U=0,Ke=null;ke!==null&&$e<V.length;$e++){ke.index>$e?(Ke=ke,ke=null):Ke=ke.sibling;var et=F(B,ke,V[$e],ie);if(et===null){ke===null&&(ke=Ke);break}t&&ke&&et.alternate===null&&n(B,ke),U=p(et,U,$e),Je===null?Ee=et:Je.sibling=et,Je=et,ke=Ke}if($e===V.length)return l(B,ke),Be&&gn(B,$e),Ee;if(ke===null){for(;$e<V.length;$e++)ke=le(B,V[$e],ie),ke!==null&&(U=p(ke,U,$e),Je===null?Ee=ke:Je.sibling=ke,Je=ke);return Be&&gn(B,$e),Ee}for(ke=s(ke);$e<V.length;$e++)Ke=W(ke,B,$e,V[$e],ie),Ke!==null&&(t&&Ke.alternate!==null&&ke.delete(Ke.key===null?$e:Ke.key),U=p(Ke,U,$e),Je===null?Ee=Ke:Je.sibling=Ke,Je=Ke);return t&&ke.forEach(function(aa){return n(B,aa)}),Be&&gn(B,$e),Ee}function Re(B,U,V,ie){if(V==null)throw Error(r(151));for(var Ee=null,Je=null,ke=U,$e=U=0,Ke=null,et=V.next();ke!==null&&!et.done;$e++,et=V.next()){ke.index>$e?(Ke=ke,ke=null):Ke=ke.sibling;var aa=F(B,ke,et.value,ie);if(aa===null){ke===null&&(ke=Ke);break}t&&ke&&aa.alternate===null&&n(B,ke),U=p(aa,U,$e),Je===null?Ee=aa:Je.sibling=aa,Je=aa,ke=Ke}if(et.done)return l(B,ke),Be&&gn(B,$e),Ee;if(ke===null){for(;!et.done;$e++,et=V.next())et=le(B,et.value,ie),et!==null&&(U=p(et,U,$e),Je===null?Ee=et:Je.sibling=et,Je=et);return Be&&gn(B,$e),Ee}for(ke=s(ke);!et.done;$e++,et=V.next())et=W(ke,B,$e,et.value,ie),et!==null&&(t&&et.alternate!==null&&ke.delete(et.key===null?$e:et.key),U=p(et,U,$e),Je===null?Ee=et:Je.sibling=et,Je=et);return t&&ke.forEach(function(Jw){return n(B,Jw)}),Be&&gn(B,$e),Ee}function ct(B,U,V,ie){if(typeof V=="object"&&V!==null&&V.type===z&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case S:e:{for(var Ee=V.key;U!==null;){if(U.key===Ee){if(Ee=V.type,Ee===z){if(U.tag===7){l(B,U.sibling),ie=f(U,V.props.children),ie.return=B,B=ie;break e}}else if(U.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===ee&&Ra(Ee)===U.type){l(B,U.sibling),ie=f(U,V.props),Ns(ie,V),ie.return=B,B=ie;break e}l(B,U);break}else n(B,U);U=U.sibling}V.type===z?(ie=gi(V.props.children,B.mode,ie,V.key),ie.return=B,B=ie):(ie=yr(V.type,V.key,V.props,null,B.mode,ie),Ns(ie,V),ie.return=B,B=ie)}return v(B);case A:e:{for(Ee=V.key;U!==null;){if(U.key===Ee)if(U.tag===4&&U.stateNode.containerInfo===V.containerInfo&&U.stateNode.implementation===V.implementation){l(B,U.sibling),ie=f(U,V.children||[]),ie.return=B,B=ie;break e}else{l(B,U);break}else n(B,U);U=U.sibling}ie=vr(V,B.mode,ie),ie.return=B,B=ie}return v(B);case ee:return V=Ra(V),ct(B,U,V,ie)}if(re(V))return ve(B,U,V,ie);if(fe(V)){if(Ee=fe(V),typeof Ee!="function")throw Error(r(150));return V=Ee.call(V),Re(B,U,V,ie)}if(typeof V.then=="function")return ct(B,U,pu(V),ie);if(V.$$typeof===G)return ct(B,U,Vn(B,V),ie);hu(B,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,U!==null&&U.tag===6?(l(B,U.sibling),ie=f(U,V),ie.return=B,B=ie):(l(B,U),ie=xr(V,B.mode,ie),ie.return=B,B=ie),v(B)):l(B,U)}return function(B,U,V,ie){try{As=0;var Ee=ct(B,U,V,ie);return Ar=null,Ee}catch(ke){if(ke===Tr||ke===du)throw ke;var Je=Ft(29,ke,null,B.mode);return Je.lanes=ie,Je.return=B,Je}finally{}}}var La=xh(!0),bh=xh(!1),$l=!1;function rd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sd(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 Gl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Vl(t,n,l){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(it&2)!==0){var f=s.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),s.pending=n,n=gr(t),au(t,null,l),n}return mr(t,s,n,l),gr(t)}function _s(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var s=n.lanes;s&=t.pendingLanes,l|=s,n.lanes=l,bl(t,l)}}function od(t,n){var l=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,l===s)){var f=null,p=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};p===null?f=p=v:p=p.next=v,l=l.next}while(l!==null);p===null?f=p=n:p=p.next=n}else f=p=n;l={baseState:s.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:s.shared,callbacks:s.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var ud=!1;function Ds(){if(ud){var t=Er;if(t!==null)throw t}}function Ms(t,n,l,s){ud=!1;var f=t.updateQueue;$l=!1;var p=f.firstBaseUpdate,v=f.lastBaseUpdate,j=f.shared.pending;if(j!==null){f.shared.pending=null;var R=j,Y=R.next;R.next=null,v===null?p=Y:v.next=Y,v=R;var J=t.alternate;J!==null&&(J=J.updateQueue,j=J.lastBaseUpdate,j!==v&&(j===null?J.firstBaseUpdate=Y:j.next=Y,J.lastBaseUpdate=R))}if(p!==null){var le=f.baseState;v=0,J=Y=R=null,j=p;do{var F=j.lane&-536870913,W=F!==j.lane;if(W?(Pe&F)===F:(s&F)===F){F!==0&&F===Cr&&(ud=!0),J!==null&&(J=J.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var ve=t,Re=j;F=n;var ct=l;switch(Re.tag){case 1:if(ve=Re.payload,typeof ve=="function"){le=ve.call(ct,le,F);break e}le=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Re.payload,F=typeof ve=="function"?ve.call(ct,le,F):ve,F==null)break e;le=x({},le,F);break e;case 2:$l=!0}}F=j.callback,F!==null&&(t.flags|=64,W&&(t.flags|=8192),W=f.callbacks,W===null?f.callbacks=[F]:W.push(F))}else W={lane:F,tag:j.tag,payload:j.payload,callback:j.callback,next:null},J===null?(Y=J=W,R=le):J=J.next=W,v|=F;if(j=j.next,j===null){if(j=f.shared.pending,j===null)break;W=j,j=W.next,W.next=null,f.lastBaseUpdate=W,f.shared.pending=null}}while(!0);J===null&&(R=le),f.baseState=R,f.firstBaseUpdate=Y,f.lastBaseUpdate=J,p===null&&(f.shared.lanes=0),Wl|=v,t.lanes=v,t.memoizedState=le}}function vh(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function wh(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)vh(l[t],n)}var Nr=T(null),mu=T(0);function kh(t,n){t=hl,E(mu,t),E(Nr,n),hl=t|n.baseLanes}function cd(){E(mu,hl),E(Nr,Nr.current)}function dd(){hl=mu.current,q(Nr),q(mu)}var Yn=T(null),ri=null;function Yl(t){var n=t.alternate;E(Ot,Ot.current&1),E(Yn,t),ri===null&&(n===null||Nr.current!==null||n.memoizedState!==null)&&(ri=t)}function fd(t){E(Ot,Ot.current),E(Yn,t),ri===null&&(ri=t)}function Sh(t){t.tag===22?(E(Ot,Ot.current),E(Yn,t),ri===null&&(ri=t)):Fl()}function Fl(){E(Ot,Ot.current),E(Yn,Yn.current)}function Fn(t){q(Yn),ri===t&&(ri=null),q(Ot)}var Ot=T(0);function gu(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||bf(l)||vf(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 rl=0,qe=null,ot=null,It=null,yu=!1,_r=!1,Ia=!1,xu=0,Os=0,Dr=null,Gv=0;function Et(){throw Error(r(321))}function pd(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!mn(t[l],n[l]))return!1;return!0}function hd(t,n,l,s,f,p){return rl=p,qe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,$.H=t===null||t.memoizedState===null?rm:Nd,Ia=!1,p=l(s,f),Ia=!1,_r&&(p=Ch(n,l,s,f)),jh(t),p}function jh(t){$.H=Ls;var n=ot!==null&&ot.next!==null;if(rl=0,It=ot=qe=null,yu=!1,Os=0,Dr=null,n)throw Error(r(300));t===null||Ut||(t=t.dependencies,t!==null&&Ne(t)&&(Ut=!0))}function Ch(t,n,l,s){qe=t;var f=0;do{if(_r&&(Dr=null),Os=0,_r=!1,25<=f)throw Error(r(301));if(f+=1,It=ot=null,t.updateQueue!=null){var p=t.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}$.H=sm,p=n(l,s)}while(_r);return p}function Vv(){var t=$.H,n=t.useState()[0];return n=typeof n.then=="function"?Rs(n):n,t=t.useState()[0],(ot!==null?ot.memoizedState:null)!==t&&(qe.flags|=1024),n}function md(){var t=xu!==0;return xu=0,t}function gd(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function yd(t){if(yu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}yu=!1}rl=0,It=ot=qe=null,_r=!1,Os=xu=0,Dr=null}function yn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?qe.memoizedState=It=t:It=It.next=t,It}function Rt(){if(ot===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=ot.next;var n=It===null?qe.memoizedState:It.next;if(n!==null)It=n,ot=t;else{if(t===null)throw qe.alternate===null?Error(r(467)):Error(r(310));ot=t,t={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},It===null?qe.memoizedState=It=t:It=It.next=t}return It}function bu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rs(t){var n=Os;return Os+=1,Dr===null&&(Dr=[]),t=mh(Dr,t,n),n=qe,(It===null?n.memoizedState:It.next)===null&&(n=n.alternate,$.H=n===null||n.memoizedState===null?rm:Nd),t}function vu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Rs(t);if(t.$$typeof===G)return pe(t)}throw Error(r(438,String(t)))}function xd(t){var n=null,l=qe.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var s=qe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=bu(),qe.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),s=0;s<t;s++)l[s]=H;return n.index++,l}function sl(t,n){return typeof n=="function"?n(t):n}function wu(t){var n=Rt();return bd(n,ot,t)}function bd(t,n,l){var s=t.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=l;var f=t.baseQueue,p=s.pending;if(p!==null){if(f!==null){var v=f.next;f.next=p.next,p.next=v}n.baseQueue=f=p,s.pending=null}if(p=t.baseState,f===null)t.memoizedState=p;else{n=f.next;var j=v=null,R=null,Y=n,J=!1;do{var le=Y.lane&-536870913;if(le!==Y.lane?(Pe&le)===le:(rl&le)===le){var F=Y.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),le===Cr&&(J=!0);else if((rl&F)===F){Y=Y.next,F===Cr&&(J=!0);continue}else le={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},R===null?(j=R=le,v=p):R=R.next=le,qe.lanes|=F,Wl|=F;le=Y.action,Ia&&l(p,le),p=Y.hasEagerState?Y.eagerState:l(p,le)}else F={lane:le,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},R===null?(j=R=F,v=p):R=R.next=F,qe.lanes|=le,Wl|=le;Y=Y.next}while(Y!==null&&Y!==n);if(R===null?v=p:R.next=j,!mn(p,t.memoizedState)&&(Ut=!0,J&&(l=Er,l!==null)))throw l;t.memoizedState=p,t.baseState=v,t.baseQueue=R,s.lastRenderedState=p}return f===null&&(s.lanes=0),[t.memoizedState,s.dispatch]}function vd(t){var n=Rt(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var s=l.dispatch,f=l.pending,p=n.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do p=t(p,v.action),v=v.next;while(v!==f);mn(p,n.memoizedState)||(Ut=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),l.lastRenderedState=p}return[p,s]}function Eh(t,n,l){var s=qe,f=Rt(),p=Be;if(p){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!mn((ot||f).memoizedState,l);if(v&&(f.memoizedState=l,Ut=!0),f=f.queue,Sd(Nh.bind(null,s,f,t),[t]),f.getSnapshot!==n||v||It!==null&&It.memoizedState.tag&1){if(s.flags|=2048,Mr(9,{destroy:void 0},Ah.bind(null,s,f,l,n),null),ft===null)throw Error(r(349));p||(rl&127)!==0||Th(s,n,l)}return l}function Th(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=qe.updateQueue,n===null?(n=bu(),qe.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Ah(t,n,l,s){n.value=l,n.getSnapshot=s,_h(n)&&Dh(t)}function Nh(t,n,l){return l(function(){_h(n)&&Dh(t)})}function _h(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!mn(t,l)}catch{return!0}}function Dh(t){var n=il(t,2);n!==null&&zn(n,t,2)}function wd(t){var n=yn();if(typeof t=="function"){var l=t;if(t=l(),Ia){Qt(!0);try{l()}finally{Qt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sl,lastRenderedState:t},n}function Mh(t,n,l,s){return t.baseState=l,bd(t,ot,typeof s=="function"?s:sl)}function Yv(t,n,l,s,f){if(ju(t))throw Error(r(485));if(t=n.action,t!==null){var p={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){p.listeners.push(v)}};$.T!==null?l(!0):p.isTransition=!1,s(p),l=n.pending,l===null?(p.next=n.pending=p,Oh(n,p)):(p.next=l.next,n.pending=l.next=p)}}function Oh(t,n){var l=n.action,s=n.payload,f=t.state;if(n.isTransition){var p=$.T,v={};$.T=v;try{var j=l(f,s),R=$.S;R!==null&&R(v,j),Rh(t,n,j)}catch(Y){kd(t,n,Y)}finally{p!==null&&v.types!==null&&(p.types=v.types),$.T=p}}else try{p=l(f,s),Rh(t,n,p)}catch(Y){kd(t,n,Y)}}function Rh(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(s){zh(t,n,s)},function(s){return kd(t,n,s)}):zh(t,n,l)}function zh(t,n,l){n.status="fulfilled",n.value=l,Lh(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Oh(t,l)))}function kd(t,n,l){var s=t.pending;if(t.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=l,Lh(n),n=n.next;while(n!==s)}t.action=null}function Lh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Ih(t,n){return n}function Uh(t,n){if(Be){var l=ft.formState;if(l!==null){e:{var s=qe;if(Be){if(dt){t:{for(var f=dt,p=Nn;f.nodeType!==8;){if(!p){f=null;break t}if(f=si(f.nextSibling),f===null){f=null;break t}}p=f.data,f=p==="F!"||p==="F"?f:null}if(f){dt=si(f.nextSibling),s=f.data==="F!";break e}}ai(s)}s=!1}s&&(n=l[0])}}return l=yn(),l.memoizedState=l.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ih,lastRenderedState:n},l.queue=s,l=im.bind(null,qe,s),s.dispatch=l,s=wd(!1),p=Ad.bind(null,qe,!1,s.queue),s=yn(),f={state:n,dispatch:null,action:t,pending:null},s.queue=f,l=Yv.bind(null,qe,f,p,l),f.dispatch=l,s.memoizedState=t,[n,l,!1]}function Bh(t){var n=Rt();return qh(n,ot,t)}function qh(t,n,l){if(n=bd(t,n,Ih)[0],t=wu(sl)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Rs(n)}catch(v){throw v===Tr?du:v}else s=n;n=Rt();var f=n.queue,p=f.dispatch;return l!==n.memoizedState&&(qe.flags|=2048,Mr(9,{destroy:void 0},Fv.bind(null,f,l),null)),[s,p,t]}function Fv(t,n){t.action=n}function Hh(t){var n=Rt(),l=ot;if(l!==null)return qh(n,l,t);Rt(),n=n.memoizedState,l=Rt();var s=l.queue.dispatch;return l.memoizedState=t,[n,s,!1]}function Mr(t,n,l,s){return t={tag:t,create:l,deps:s,inst:n,next:null},n=qe.updateQueue,n===null&&(n=bu(),qe.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(s=l.next,l.next=t,t.next=s,n.lastEffect=t),t}function $h(){return Rt().memoizedState}function ku(t,n,l,s){var f=yn();qe.flags|=t,f.memoizedState=Mr(1|n,{destroy:void 0},l,s===void 0?null:s)}function Su(t,n,l,s){var f=Rt();s=s===void 0?null:s;var p=f.memoizedState.inst;ot!==null&&s!==null&&pd(s,ot.memoizedState.deps)?f.memoizedState=Mr(n,p,l,s):(qe.flags|=t,f.memoizedState=Mr(1|n,p,l,s))}function Gh(t,n){ku(8390656,8,t,n)}function Sd(t,n){Su(2048,8,t,n)}function Pv(t){qe.flags|=4;var n=qe.updateQueue;if(n===null)n=bu(),qe.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function Vh(t){var n=Rt().memoizedState;return Pv({ref:n,nextImpl:t}),function(){if((it&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Yh(t,n){return Su(4,2,t,n)}function Fh(t,n){return Su(4,4,t,n)}function Ph(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 Kh(t,n,l){l=l!=null?l.concat([t]):null,Su(4,4,Ph.bind(null,n,t),l)}function jd(){}function Wh(t,n){var l=Rt();n=n===void 0?null:n;var s=l.memoizedState;return n!==null&&pd(n,s[1])?s[0]:(l.memoizedState=[t,n],t)}function Xh(t,n){var l=Rt();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&pd(n,s[1]))return s[0];if(s=t(),Ia){Qt(!0);try{t()}finally{Qt(!1)}}return l.memoizedState=[s,n],s}function Cd(t,n,l){return l===void 0||(rl&1073741824)!==0&&(Pe&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=Qm(),qe.lanes|=t,Wl|=t,l)}function Qh(t,n,l,s){return mn(l,n)?l:Nr.current!==null?(t=Cd(t,l,s),mn(t,n)||(Ut=!0),t):(rl&42)===0||(rl&1073741824)!==0&&(Pe&261930)===0?(Ut=!0,t.memoizedState=l):(t=Qm(),qe.lanes|=t,Wl|=t,n)}function Zh(t,n,l,s,f){var p=ae.p;ae.p=p!==0&&8>p?p:8;var v=$.T,j={};$.T=j,Ad(t,!1,n,l);try{var R=f(),Y=$.S;if(Y!==null&&Y(j,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var J=$v(R,s);zs(t,n,J,Wn(t))}else zs(t,n,s,Wn(t))}catch(le){zs(t,n,{then:function(){},status:"rejected",reason:le},Wn())}finally{ae.p=p,v!==null&&j.types!==null&&(v.types=j.types),$.T=v}}function Kv(){}function Ed(t,n,l,s){if(t.tag!==5)throw Error(r(476));var f=Jh(t).queue;Zh(t,f,n,xe,l===null?Kv:function(){return em(t),l(s)})}function Jh(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sl,lastRenderedState:xe},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sl,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function em(t){var n=Jh(t);n.next===null&&(n=t.alternate.memoizedState),zs(t,n.next.queue,{},Wn())}function Td(){return pe(Zs)}function tm(){return Rt().memoizedState}function nm(){return Rt().memoizedState}function Wv(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Wn();t=Gl(l);var s=Vl(n,t,l);s!==null&&(zn(s,n,l),_s(s,n,l)),n={cache:nd()},t.payload=n;return}n=n.return}}function Xv(t,n,l){var s=Wn();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ju(t)?lm(n,l):(l=ks(t,n,l,s),l!==null&&(zn(l,t,s),am(l,n,s)))}function im(t,n,l){var s=Wn();zs(t,n,l,s)}function zs(t,n,l,s){var f={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ju(t))lm(n,f);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var v=n.lastRenderedState,j=p(v,l);if(f.hasEagerState=!0,f.eagerState=j,mn(j,v))return mr(t,n,f,0),ft===null&&hr(),!1}catch{}finally{}if(l=ks(t,n,f,s),l!==null)return zn(l,t,s),am(l,n,s),!0}return!1}function Ad(t,n,l,s){if(s={lane:2,revertLane:sf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ju(t)){if(n)throw Error(r(479))}else n=ks(t,l,s,2),n!==null&&zn(n,t,2)}function ju(t){var n=t.alternate;return t===qe||n!==null&&n===qe}function lm(t,n){_r=yu=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function am(t,n,l){if((l&4194048)!==0){var s=n.lanes;s&=t.pendingLanes,l|=s,n.lanes=l,bl(t,l)}}var Ls={readContext:pe,use:vu,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};Ls.useEffectEvent=Et;var rm={readContext:pe,use:vu,useCallback:function(t,n){return yn().memoizedState=[t,n===void 0?null:n],t},useContext:pe,useEffect:Gh,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,ku(4194308,4,Ph.bind(null,n,t),l)},useLayoutEffect:function(t,n){return ku(4194308,4,t,n)},useInsertionEffect:function(t,n){ku(4,2,t,n)},useMemo:function(t,n){var l=yn();n=n===void 0?null:n;var s=t();if(Ia){Qt(!0);try{t()}finally{Qt(!1)}}return l.memoizedState=[s,n],s},useReducer:function(t,n,l){var s=yn();if(l!==void 0){var f=l(n);if(Ia){Qt(!0);try{l(n)}finally{Qt(!1)}}}else f=n;return s.memoizedState=s.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},s.queue=t,t=t.dispatch=Xv.bind(null,qe,t),[s.memoizedState,t]},useRef:function(t){var n=yn();return t={current:t},n.memoizedState=t},useState:function(t){t=wd(t);var n=t.queue,l=im.bind(null,qe,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:jd,useDeferredValue:function(t,n){var l=yn();return Cd(l,t,n)},useTransition:function(){var t=wd(!1);return t=Zh.bind(null,qe,t.queue,!0,!1),yn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var s=qe,f=yn();if(Be){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),ft===null)throw Error(r(349));(Pe&127)!==0||Th(s,n,l)}f.memoizedState=l;var p={value:l,getSnapshot:n};return f.queue=p,Gh(Nh.bind(null,s,p,t),[t]),s.flags|=2048,Mr(9,{destroy:void 0},Ah.bind(null,s,p,l,n),null),l},useId:function(){var t=yn(),n=ft.identifierPrefix;if(Be){var l=sn,s=rn;l=(s&~(1<<32-tt(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=xu++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=Gv++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Td,useFormState:Uh,useActionState:Uh,useOptimistic:function(t){var n=yn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Ad.bind(null,qe,!0,l),l.dispatch=n,[t,n]},useMemoCache:xd,useCacheRefresh:function(){return yn().memoizedState=Wv.bind(null,qe)},useEffectEvent:function(t){var n=yn(),l={impl:t};return n.memoizedState=l,function(){if((it&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Nd={readContext:pe,use:vu,useCallback:Wh,useContext:pe,useEffect:Sd,useImperativeHandle:Kh,useInsertionEffect:Yh,useLayoutEffect:Fh,useMemo:Xh,useReducer:wu,useRef:$h,useState:function(){return wu(sl)},useDebugValue:jd,useDeferredValue:function(t,n){var l=Rt();return Qh(l,ot.memoizedState,t,n)},useTransition:function(){var t=wu(sl)[0],n=Rt().memoizedState;return[typeof t=="boolean"?t:Rs(t),n]},useSyncExternalStore:Eh,useId:tm,useHostTransitionStatus:Td,useFormState:Bh,useActionState:Bh,useOptimistic:function(t,n){var l=Rt();return Mh(l,ot,t,n)},useMemoCache:xd,useCacheRefresh:nm};Nd.useEffectEvent=Vh;var sm={readContext:pe,use:vu,useCallback:Wh,useContext:pe,useEffect:Sd,useImperativeHandle:Kh,useInsertionEffect:Yh,useLayoutEffect:Fh,useMemo:Xh,useReducer:vd,useRef:$h,useState:function(){return vd(sl)},useDebugValue:jd,useDeferredValue:function(t,n){var l=Rt();return ot===null?Cd(l,t,n):Qh(l,ot.memoizedState,t,n)},useTransition:function(){var t=vd(sl)[0],n=Rt().memoizedState;return[typeof t=="boolean"?t:Rs(t),n]},useSyncExternalStore:Eh,useId:tm,useHostTransitionStatus:Td,useFormState:Hh,useActionState:Hh,useOptimistic:function(t,n){var l=Rt();return ot!==null?Mh(l,ot,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:xd,useCacheRefresh:nm};sm.useEffectEvent=Vh;function _d(t,n,l,s){n=t.memoizedState,l=l(s,n),l=l==null?n:x({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Dd={enqueueSetState:function(t,n,l){t=t._reactInternals;var s=Wn(),f=Gl(s);f.payload=n,l!=null&&(f.callback=l),n=Vl(t,f,s),n!==null&&(zn(n,t,s),_s(n,t,s))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var s=Wn(),f=Gl(s);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=Vl(t,f,s),n!==null&&(zn(n,t,s),_s(n,t,s))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Wn(),s=Gl(l);s.tag=2,n!=null&&(s.callback=n),n=Vl(t,s,l),n!==null&&(zn(n,t,l),_s(n,t,l))}};function om(t,n,l,s,f,p,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,p,v):n.prototype&&n.prototype.isPureReactComponent?!Na(l,s)||!Na(f,p):!0}function um(t,n,l,s){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,s),n.state!==t&&Dd.enqueueReplaceState(n,n.state,null)}function Ua(t,n){var l=n;if("ref"in n){l={};for(var s in n)s!=="ref"&&(l[s]=n[s])}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 cm(t){pr(t)}function dm(t){console.error(t)}function fm(t){pr(t)}function Cu(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function pm(t,n,l){try{var s=t.onCaughtError;s(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Md(t,n,l){return l=Gl(l),l.tag=3,l.payload={element:null},l.callback=function(){Cu(t,n)},l}function hm(t){return t=Gl(t),t.tag=3,t}function mm(t,n,l,s){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var p=s.value;t.payload=function(){return f(p)},t.callback=function(){pm(n,l,s)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){pm(n,l,s),typeof f!="function"&&(Xl===null?Xl=new Set([this]):Xl.add(this));var j=s.stack;this.componentDidCatch(s.value,{componentStack:j!==null?j:""})})}function Qv(t,n,l,s,f){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&we(n,l,f,!0),l=Yn.current,l!==null){switch(l.tag){case 31:case 13:return ri===null?Iu():l.alternate===null&&Tt===0&&(Tt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,s===fu?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([s]):n.add(s),lf(t,s,f)),!1;case 22:return l.flags|=65536,s===fu?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([s]):l.add(s)),lf(t,s,f)),!1}throw Error(r(435,l.tag))}return lf(t,s,f),Iu(),!1}if(Be)return n=Yn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,s!==Cs&&(t=Error(r(422),{cause:s}),Hl(Tn(t,l)))):(s!==Cs&&(n=Error(r(423),{cause:s}),Hl(Tn(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,s=Tn(s,l),f=Md(t.stateNode,s,f),od(t,f),Tt!==4&&(Tt=2)),!1;var p=Error(r(520),{cause:s});if(p=Tn(p,l),Vs===null?Vs=[p]:Vs.push(p),Tt!==4&&(Tt=2),n===null)return!0;s=Tn(s,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Md(l.stateNode,s,t),od(l,t),!1;case 1:if(n=l.type,p=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Xl===null||!Xl.has(p))))return l.flags|=65536,f&=-f,l.lanes|=f,f=hm(f),mm(f,t,l,s),od(l,f),!1}l=l.return}while(l!==null);return!1}var Od=Error(r(461)),Ut=!1;function tn(t,n,l,s){n.child=t===null?bh(n,null,l,s):La(n,t.child,l,s)}function gm(t,n,l,s,f){l=l.render;var p=n.ref;if("ref"in s){var v={};for(var j in s)j!=="ref"&&(v[j]=s[j])}else v=s;return _e(n),s=hd(t,n,l,v,p,f),j=md(),t!==null&&!Ut?(gd(t,n,f),ol(t,n,f)):(Be&&j&&js(n),n.flags|=1,tn(t,n,s,f),n.child)}function ym(t,n,l,s,f){if(t===null){var p=l.type;return typeof p=="function"&&!Ss(p)&&p.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=p,xm(t,n,p,s,f)):(t=yr(l.type,null,s,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(p=t.child,!Hd(t,f)){var v=p.memoizedProps;if(l=l.compare,l=l!==null?l:Na,l(v,s)&&t.ref===n.ref)return ol(t,n,f)}return n.flags|=1,t=Gn(p,s),t.ref=n.ref,t.return=n,n.child=t}function xm(t,n,l,s,f){if(t!==null){var p=t.memoizedProps;if(Na(p,s)&&t.ref===n.ref)if(Ut=!1,n.pendingProps=s=p,Hd(t,f))(t.flags&131072)!==0&&(Ut=!0);else return n.lanes=t.lanes,ol(t,n,f)}return Rd(t,n,l,s,f)}function bm(t,n,l,s){var f=s.children,p=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(p=p!==null?p.baseLanes|l:l,t!==null){for(s=n.child=t.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;s=f&~p}else s=0,n.child=null;return vm(t,n,p,l,s)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&cu(n,p!==null?p.cachePool:null),p!==null?kh(n,p):cd(),Sh(n);else return s=n.lanes=536870912,vm(t,n,p!==null?p.baseLanes|l:l,l,s)}else p!==null?(cu(n,p.cachePool),kh(n,p),Fl(),n.memoizedState=null):(t!==null&&cu(n,null),cd(),Fl());return tn(t,n,f,l),n.child}function Is(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function vm(t,n,l,s,f){var p=ld();return p=p===null?null:{parent:xt._currentValue,pool:p},n.memoizedState={baseLanes:l,cachePool:p},t!==null&&cu(n,null),cd(),Sh(n),t!==null&&we(t,n,s,!0),n.childLanes=f,null}function Eu(t,n){return n=Au({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function wm(t,n,l){return La(n,t.child,null,l),t=Eu(n,n.pendingProps),t.flags|=2,Fn(n),n.memoizedState=null,t}function Zv(t,n,l){var s=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Be){if(s.mode==="hidden")return t=Eu(n,s),n.lanes=536870912,Is(null,t);if(fd(n),(t=dt)?(t=Og(t,Nn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Di!==null?{id:rn,overflow:sn}:null,retryLane:536870912,hydrationErrors:null},l=br(t),l.return=n,n.child=l,st=n,dt=null)):t=null,t===null)throw ai(n);return n.lanes=536870912,null}return Eu(n,s)}var p=t.memoizedState;if(p!==null){var v=p.dehydrated;if(fd(n),f)if(n.flags&256)n.flags&=-257,n=wm(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ut||we(t,n,l,!1),f=(l&t.childLanes)!==0,Ut||f){if(s=ft,s!==null&&(v=qi(s,l),v!==0&&v!==p.retryLane))throw p.retryLane=v,il(t,v),zn(s,t,v),Od;Iu(),n=wm(t,n,l)}else t=p.treeContext,dt=si(v.nextSibling),st=n,Be=!0,Mi=null,Nn=!1,t!==null&&ll(n,t),n=Eu(n,s),n.flags|=4096;return n}return t=Gn(t.child,{mode:s.mode,children:s.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Tu(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 Rd(t,n,l,s,f){return _e(n),l=hd(t,n,l,s,void 0,f),s=md(),t!==null&&!Ut?(gd(t,n,f),ol(t,n,f)):(Be&&s&&js(n),n.flags|=1,tn(t,n,l,f),n.child)}function km(t,n,l,s,f,p){return _e(n),n.updateQueue=null,l=Ch(n,s,l,f),jh(t),s=md(),t!==null&&!Ut?(gd(t,n,p),ol(t,n,p)):(Be&&s&&js(n),n.flags|=1,tn(t,n,l,p),n.child)}function Sm(t,n,l,s,f){if(_e(n),n.stateNode===null){var p=Ll,v=l.contextType;typeof v=="object"&&v!==null&&(p=pe(v)),p=new l(s,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Dd,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=s,p.state=n.memoizedState,p.refs={},rd(n),v=l.contextType,p.context=typeof v=="object"&&v!==null?pe(v):Ll,p.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(_d(n,l,v,s),p.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(v=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),v!==p.state&&Dd.enqueueReplaceState(p,p.state,null),Ms(n,s,p,f),Ds(),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(t===null){p=n.stateNode;var j=n.memoizedProps,R=Ua(l,j);p.props=R;var Y=p.context,J=l.contextType;v=Ll,typeof J=="object"&&J!==null&&(v=pe(J));var le=l.getDerivedStateFromProps;J=typeof le=="function"||typeof p.getSnapshotBeforeUpdate=="function",j=n.pendingProps!==j,J||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(j||Y!==v)&&um(n,p,s,v),$l=!1;var F=n.memoizedState;p.state=F,Ms(n,s,p,f),Ds(),Y=n.memoizedState,j||F!==Y||$l?(typeof le=="function"&&(_d(n,l,le,s),Y=n.memoizedState),(R=$l||om(n,l,R,s,F,Y,v))?(J||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(n.flags|=4194308)):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=Y),p.props=s,p.state=Y,p.context=v,s=R):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{p=n.stateNode,sd(t,n),v=n.memoizedProps,J=Ua(l,v),p.props=J,le=n.pendingProps,F=p.context,Y=l.contextType,R=Ll,typeof Y=="object"&&Y!==null&&(R=pe(Y)),j=l.getDerivedStateFromProps,(Y=typeof j=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(v!==le||F!==R)&&um(n,p,s,R),$l=!1,F=n.memoizedState,p.state=F,Ms(n,s,p,f),Ds();var W=n.memoizedState;v!==le||F!==W||$l||t!==null&&t.dependencies!==null&&Ne(t.dependencies)?(typeof j=="function"&&(_d(n,l,j,s),W=n.memoizedState),(J=$l||om(n,l,J,s,F,W,R)||t!==null&&t.dependencies!==null&&Ne(t.dependencies))?(Y||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(s,W,R),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(s,W,R)),typeof p.componentDidUpdate=="function"&&(n.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof p.componentDidUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=W),p.props=s,p.state=W,p.context=R,s=J):(typeof p.componentDidUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=1024),s=!1)}return p=s,Tu(t,n),s=(n.flags&128)!==0,p||s?(p=n.stateNode,l=s&&typeof l.getDerivedStateFromError!="function"?null:p.render(),n.flags|=1,t!==null&&s?(n.child=La(n,t.child,null,f),n.child=La(n,null,l,f)):tn(t,n,l,f),n.memoizedState=p.state,t=n.child):t=ol(t,n,f),t}function jm(t,n,l,s){return Oi(),n.flags|=256,tn(t,n,l,s),n.child}var zd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ld(t){return{baseLanes:t,cachePool:ph()}}function Id(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Kn),t}function Cm(t,n,l){var s=n.pendingProps,f=!1,p=(n.flags&128)!==0,v;if((v=p)||(v=t!==null&&t.memoizedState===null?!1:(Ot.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Be){if(f?Yl(n):Fl(),(t=dt)?(t=Og(t,Nn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Di!==null?{id:rn,overflow:sn}:null,retryLane:536870912,hydrationErrors:null},l=br(t),l.return=n,n.child=l,st=n,dt=null)):t=null,t===null)throw ai(n);return vf(t)?n.lanes=32:n.lanes=536870912,null}var j=s.children;return s=s.fallback,f?(Fl(),f=n.mode,j=Au({mode:"hidden",children:j},f),s=gi(s,f,l,null),j.return=n,s.return=n,j.sibling=s,n.child=j,s=n.child,s.memoizedState=Ld(l),s.childLanes=Id(t,v,l),n.memoizedState=zd,Is(null,s)):(Yl(n),Ud(n,j))}var R=t.memoizedState;if(R!==null&&(j=R.dehydrated,j!==null)){if(p)n.flags&256?(Yl(n),n.flags&=-257,n=Bd(t,n,l)):n.memoizedState!==null?(Fl(),n.child=t.child,n.flags|=128,n=null):(Fl(),j=s.fallback,f=n.mode,s=Au({mode:"visible",children:s.children},f),j=gi(j,f,l,null),j.flags|=2,s.return=n,j.return=n,s.sibling=j,n.child=s,La(n,t.child,null,l),s=n.child,s.memoizedState=Ld(l),s.childLanes=Id(t,v,l),n.memoizedState=zd,n=Is(null,s));else if(Yl(n),vf(j)){if(v=j.nextSibling&&j.nextSibling.dataset,v)var Y=v.dgst;v=Y,s=Error(r(419)),s.stack="",s.digest=v,Hl({value:s,source:null,stack:null}),n=Bd(t,n,l)}else if(Ut||we(t,n,l,!1),v=(l&t.childLanes)!==0,Ut||v){if(v=ft,v!==null&&(s=qi(v,l),s!==0&&s!==R.retryLane))throw R.retryLane=s,il(t,s),zn(v,t,s),Od;bf(j)||Iu(),n=Bd(t,n,l)}else bf(j)?(n.flags|=192,n.child=t.child,n=null):(t=R.treeContext,dt=si(j.nextSibling),st=n,Be=!0,Mi=null,Nn=!1,t!==null&&ll(n,t),n=Ud(n,s.children),n.flags|=4096);return n}return f?(Fl(),j=s.fallback,f=n.mode,R=t.child,Y=R.sibling,s=Gn(R,{mode:"hidden",children:s.children}),s.subtreeFlags=R.subtreeFlags&65011712,Y!==null?j=Gn(Y,j):(j=gi(j,f,l,null),j.flags|=2),j.return=n,s.return=n,s.sibling=j,n.child=s,Is(null,s),s=n.child,j=t.child.memoizedState,j===null?j=Ld(l):(f=j.cachePool,f!==null?(R=xt._currentValue,f=f.parent!==R?{parent:R,pool:R}:f):f=ph(),j={baseLanes:j.baseLanes|l,cachePool:f}),s.memoizedState=j,s.childLanes=Id(t,v,l),n.memoizedState=zd,Is(t.child,s)):(Yl(n),l=t.child,t=l.sibling,l=Gn(l,{mode:"visible",children:s.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 Ud(t,n){return n=Au({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Au(t,n){return t=Ft(22,t,null,n),t.lanes=0,t}function Bd(t,n,l){return La(n,t.child,null,l),t=Ud(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Em(t,n,l){t.lanes|=n;var s=t.alternate;s!==null&&(s.lanes|=n),I(t.return,n,l)}function qd(t,n,l,s,f,p){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:l,tailMode:f,treeForkCount:p}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=s,v.tail=l,v.tailMode=f,v.treeForkCount=p)}function Tm(t,n,l){var s=n.pendingProps,f=s.revealOrder,p=s.tail;s=s.children;var v=Ot.current,j=(v&2)!==0;if(j?(v=v&1|2,n.flags|=128):v&=1,E(Ot,v),tn(t,n,s,l),s=Be?Bl:0,!j&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Em(t,l,n);else if(t.tag===19)Em(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&&gu(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),qd(n,!1,f,l,p,s);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&gu(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}qd(n,!0,l,null,p,s);break;case"together":qd(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function ol(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),Wl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(we(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=Gn(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=Gn(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function Hd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Ne(t)))}function Jv(t,n,l){switch(n.tag){case 3:Le(n,n.stateNode.containerInfo),C(n,xt,t.memoizedState.cache),Oi();break;case 27:case 5:At(n);break;case 4:Le(n,n.stateNode.containerInfo);break;case 10:C(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,fd(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(Yl(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Cm(t,n,l):(Yl(n),t=ol(t,n,l),t!==null?t.sibling:null);Yl(n);break;case 19:var f=(t.flags&128)!==0;if(s=(l&n.childLanes)!==0,s||(we(t,n,l,!1),s=(l&n.childLanes)!==0),f){if(s)return Tm(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),E(Ot,Ot.current),s)break;return null;case 22:return n.lanes=0,bm(t,n,l,n.pendingProps);case 24:C(n,xt,t.memoizedState.cache)}return ol(t,n,l)}function Am(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ut=!0;else{if(!Hd(t,l)&&(n.flags&128)===0)return Ut=!1,Jv(t,n,l);Ut=(t.flags&131072)!==0}else Ut=!1,Be&&(n.flags&1048576)!==0&&su(n,Bl,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(t=Ra(n.elementType),n.type=t,typeof t=="function")Ss(t)?(s=Ua(t,s),n.tag=1,n=Sm(null,n,t,s,l)):(n.tag=0,n=Rd(null,n,t,s,l));else{if(t!=null){var f=t.$$typeof;if(f===P){n.tag=11,n=gm(null,n,t,s,l);break e}else if(f===K){n.tag=14,n=ym(null,n,t,s,l);break e}}throw n=me(t)||t,Error(r(306,n,""))}}return n;case 0:return Rd(t,n,n.type,n.pendingProps,l);case 1:return s=n.type,f=Ua(s,n.pendingProps),Sm(t,n,s,f,l);case 3:e:{if(Le(n,n.stateNode.containerInfo),t===null)throw Error(r(387));s=n.pendingProps;var p=n.memoizedState;f=p.element,sd(t,n),Ms(n,s,null,l);var v=n.memoizedState;if(s=v.cache,C(n,xt,s),s!==p.cache&&Z(n,[xt],l,!0),Ds(),s=v.element,p.isDehydrated)if(p={element:s,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){n=jm(t,n,s,l);break e}else if(s!==f){f=Tn(Error(r(424)),n),Hl(f),n=jm(t,n,s,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(dt=si(t.firstChild),st=n,Be=!0,Mi=null,Nn=!0,l=bh(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Oi(),s===f){n=ol(t,n,l);break e}tn(t,n,s,l)}n=n.child}return n;case 26:return Tu(t,n),t===null?(l=Bg(n.type,null,n.pendingProps,null))?n.memoizedState=l:Be||(l=n.type,t=n.pendingProps,s=Vu(he.current).createElement(l),s[Ht]=n,s[Lt]=t,nn(s,l,t),_t(s),n.stateNode=s):n.memoizedState=Bg(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return At(n),t===null&&Be&&(s=n.stateNode=Lg(n.type,n.pendingProps,he.current),st=n,Nn=!0,f=dt,ea(n.type)?(wf=f,dt=si(s.firstChild)):dt=f),tn(t,n,n.pendingProps.children,l),Tu(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Be&&((f=s=dt)&&(s=Nw(s,n.type,n.pendingProps,Nn),s!==null?(n.stateNode=s,st=n,dt=si(s.firstChild),Nn=!1,f=!0):f=!1),f||ai(n)),At(n),f=n.type,p=n.pendingProps,v=t!==null?t.memoizedProps:null,s=p.children,gf(f,p)?s=null:v!==null&&gf(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=hd(t,n,Vv,null,null,l),Zs._currentValue=f),Tu(t,n),tn(t,n,s,l),n.child;case 6:return t===null&&Be&&((t=l=dt)&&(l=_w(l,n.pendingProps,Nn),l!==null?(n.stateNode=l,st=n,dt=null,t=!0):t=!1),t||ai(n)),null;case 13:return Cm(t,n,l);case 4:return Le(n,n.stateNode.containerInfo),s=n.pendingProps,t===null?n.child=La(n,null,s,l):tn(t,n,s,l),n.child;case 11:return gm(t,n,n.type,n.pendingProps,l);case 7:return tn(t,n,n.pendingProps,l),n.child;case 8:return tn(t,n,n.pendingProps.children,l),n.child;case 12:return tn(t,n,n.pendingProps.children,l),n.child;case 10:return s=n.pendingProps,C(n,n.type,s.value),tn(t,n,s.children,l),n.child;case 9:return f=n.type._context,s=n.pendingProps.children,_e(n),f=pe(f),s=s(f),n.flags|=1,tn(t,n,s,l),n.child;case 14:return ym(t,n,n.type,n.pendingProps,l);case 15:return xm(t,n,n.type,n.pendingProps,l);case 19:return Tm(t,n,l);case 31:return Zv(t,n,l);case 22:return bm(t,n,l,n.pendingProps);case 24:return _e(n),s=pe(xt),t===null?(f=ld(),f===null&&(f=ft,p=nd(),f.pooledCache=p,p.refCount++,p!==null&&(f.pooledCacheLanes|=l),f=p),n.memoizedState={parent:s,cache:f},rd(n),C(n,xt,f)):((t.lanes&l)!==0&&(sd(t,n),Ms(n,null,null,l),Ds()),f=t.memoizedState,p=n.memoizedState,f.parent!==s?(f={parent:s,cache:s},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),C(n,xt,s)):(s=p.cache,C(n,xt,s),s!==f.cache&&Z(n,[xt],l,!0))),tn(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function ul(t){t.flags|=4}function $d(t,n,l,s,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(tg())t.flags|=8192;else throw za=fu,ad}else t.flags&=-16777217}function Nm(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Vg(n))if(tg())t.flags|=8192;else throw za=fu,ad}function Nu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Mo():536870912,t.lanes|=n,Lr|=n)}function Us(t,n){if(!Be)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 s=null;l!==null;)l.alternate!==null&&(s=l),l=l.sibling;s===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function gt(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,s=0;if(n)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,s|=f.subtreeFlags&65011712,s|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,s|=f.subtreeFlags,s|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=s,t.childLanes=l,n}function ew(t,n,l){var s=n.pendingProps;switch(lt(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(n),null;case 1:return gt(n),null;case 3:return l=n.stateNode,s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),M(xt),He(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(ql(n)?ul(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Sr())),gt(n),null;case 26:var f=n.type,p=n.memoizedState;return t===null?(ul(n),p!==null?(gt(n),Nm(n,p)):(gt(n),$d(n,f,null,s,l))):p?p!==t.memoizedState?(ul(n),gt(n),Nm(n,p)):(gt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==s&&ul(n),gt(n),$d(n,f,t,s,l)),null;case 27:if(St(n),l=he.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==s&&ul(n);else{if(!s){if(n.stateNode===null)throw Error(r(166));return gt(n),null}t=te.current,ql(n)?ou(n):(t=Lg(f,s,l),n.stateNode=t,ul(n))}return gt(n),null;case 5:if(St(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==s&&ul(n);else{if(!s){if(n.stateNode===null)throw Error(r(166));return gt(n),null}if(p=te.current,ql(n))ou(n);else{var v=Vu(he.current);switch(p){case 1:p=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:p=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":p=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":p=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":p=v.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof s.is=="string"?v.createElement("select",{is:s.is}):v.createElement("select"),s.multiple?p.multiple=!0:s.size&&(p.size=s.size);break;default:p=typeof s.is=="string"?v.createElement(f,{is:s.is}):v.createElement(f)}}p[Ht]=n,p[Lt]=s;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)p.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=p;e:switch(nn(p,f,s),f){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ul(n)}}return gt(n),$d(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==s&&ul(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(r(166));if(t=he.current,ql(n)){if(t=n.stateNode,l=n.memoizedProps,s=null,f=st,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}t[Ht]=n,t=!!(t.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||Cg(t.nodeValue,l)),t||ai(n,!0)}else t=Vu(t).createTextNode(s),t[Ht]=n,n.stateNode=t}return gt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(s=ql(n),l!==null){if(t===null){if(!s)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Ht]=n}else Oi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),t=!1}else l=Sr(),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 gt(n),null;case 13:if(s=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=ql(n),s!==null&&s.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[Ht]=n}else Oi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),f=!1}else f=Sr(),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=s!==null,t=t!==null&&t.memoizedState!==null,l&&(s=n.child,f=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(f=s.alternate.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==f&&(s.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),Nu(n,n.updateQueue),gt(n),null);case 4:return He(),t===null&&df(n.stateNode.containerInfo),gt(n),null;case 10:return M(n.type),gt(n),null;case 19:if(q(Ot),s=n.memoizedState,s===null)return gt(n),null;if(f=(n.flags&128)!==0,p=s.rendering,p===null)if(f)Us(s,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(p=gu(t),p!==null){for(n.flags|=128,Us(s,!1),t=p.updateQueue,n.updateQueue=t,Nu(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)ru(l,t),l=l.sibling;return E(Ot,Ot.current&1|2),Be&&gn(n,s.treeForkCount),n.child}t=t.sibling}s.tail!==null&&Nt()>Ru&&(n.flags|=128,f=!0,Us(s,!1),n.lanes=4194304)}else{if(!f)if(t=gu(p),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Nu(n,t),Us(s,!0),s.tail===null&&s.tailMode==="hidden"&&!p.alternate&&!Be)return gt(n),null}else 2*Nt()-s.renderingStartTime>Ru&&l!==536870912&&(n.flags|=128,f=!0,Us(s,!1),n.lanes=4194304);s.isBackwards?(p.sibling=n.child,n.child=p):(t=s.last,t!==null?t.sibling=p:n.child=p,s.last=p)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Nt(),t.sibling=null,l=Ot.current,E(Ot,f?l&1|2:l&1),Be&&gn(n,s.treeForkCount),t):(gt(n),null);case 22:case 23:return Fn(n),dd(),s=n.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(l&536870912)!==0&&(n.flags&128)===0&&(gt(n),n.subtreeFlags&6&&(n.flags|=8192)):gt(n),l=n.updateQueue,l!==null&&Nu(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==l&&(n.flags|=2048),t!==null&&q(Oa),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),M(xt),gt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function tw(t,n){switch(lt(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return M(xt),He(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return St(n),null;case 31:if(n.memoizedState!==null){if(Fn(n),n.alternate===null)throw Error(r(340));Oi()}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));Oi()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return q(Ot),null;case 4:return He(),null;case 10:return M(n.type),null;case 22:case 23:return Fn(n),dd(),t!==null&&q(Oa),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return M(xt),null;case 25:return null;default:return null}}function _m(t,n){switch(lt(n),n.tag){case 3:M(xt),He();break;case 26:case 27:case 5:St(n);break;case 4:He();break;case 31:n.memoizedState!==null&&Fn(n);break;case 13:Fn(n);break;case 19:q(Ot);break;case 10:M(n.type);break;case 22:case 23:Fn(n),dd(),t!==null&&q(Oa);break;case 24:M(xt)}}function Bs(t,n){try{var l=n.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var f=s.next;l=f;do{if((l.tag&t)===t){s=void 0;var p=l.create,v=l.inst;s=p(),v.destroy=s}l=l.next}while(l!==f)}}catch(j){rt(n,n.return,j)}}function Pl(t,n,l){try{var s=n.updateQueue,f=s!==null?s.lastEffect:null;if(f!==null){var p=f.next;s=p;do{if((s.tag&t)===t){var v=s.inst,j=v.destroy;if(j!==void 0){v.destroy=void 0,f=n;var R=l,Y=j;try{Y()}catch(J){rt(f,R,J)}}}s=s.next}while(s!==p)}}catch(J){rt(n,n.return,J)}}function Dm(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{wh(n,l)}catch(s){rt(t,t.return,s)}}}function Mm(t,n,l){l.props=Ua(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(s){rt(t,n,s)}}function qs(t,n){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof l=="function"?t.refCleanup=l(s):l.current=s}}catch(f){rt(t,n,f)}}function Ri(t,n){var l=t.ref,s=t.refCleanup;if(l!==null)if(typeof s=="function")try{s()}catch(f){rt(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){rt(t,n,f)}else l.current=null}function Om(t){var n=t.type,l=t.memoizedProps,s=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&s.focus();break e;case"img":l.src?s.src=l.src:l.srcSet&&(s.srcset=l.srcSet)}}catch(f){rt(t,t.return,f)}}function Gd(t,n,l){try{var s=t.stateNode;Sw(s,t.type,l,n),s[Lt]=n}catch(f){rt(t,t.return,f)}}function Rm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ea(t.type)||t.tag===4}function Vd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Rm(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&&ea(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 Yd(t,n,l){var s=t.tag;if(s===5||s===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=hi));else if(s!==4&&(s===27&&ea(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(Yd(t,n,l),t=t.sibling;t!==null;)Yd(t,n,l),t=t.sibling}function _u(t,n,l){var s=t.tag;if(s===5||s===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(s!==4&&(s===27&&ea(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(_u(t,n,l),t=t.sibling;t!==null;)_u(t,n,l),t=t.sibling}function zm(t){var n=t.stateNode,l=t.memoizedProps;try{for(var s=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);nn(n,s,l),n[Ht]=t,n[Lt]=l}catch(p){rt(t,t.return,p)}}var cl=!1,Bt=!1,Fd=!1,Lm=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function nw(t,n){if(t=t.containerInfo,hf=Qu,t=_i(t),ur(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var s=l.getSelection&&l.getSelection();if(s&&s.rangeCount!==0){l=s.anchorNode;var f=s.anchorOffset,p=s.focusNode;s=s.focusOffset;try{l.nodeType,p.nodeType}catch{l=null;break e}var v=0,j=-1,R=-1,Y=0,J=0,le=t,F=null;t:for(;;){for(var W;le!==l||f!==0&&le.nodeType!==3||(j=v+f),le!==p||s!==0&&le.nodeType!==3||(R=v+s),le.nodeType===3&&(v+=le.nodeValue.length),(W=le.firstChild)!==null;)F=le,le=W;for(;;){if(le===t)break t;if(F===l&&++Y===f&&(j=v),F===p&&++J===s&&(R=v),(W=le.nextSibling)!==null)break;le=F,F=le.parentNode}le=W}l=j===-1||R===-1?null:{start:j,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(mf={focusedElem:t,selectionRange:l},Qu=!1,Kt=n;Kt!==null;)if(n=Kt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Kt=t;else for(;Kt!==null;){switch(n=Kt,p=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&&p!==null){t=void 0,l=n,f=p.memoizedProps,p=p.memoizedState,s=l.stateNode;try{var ve=Ua(l.type,f);t=s.getSnapshotBeforeUpdate(ve,p),s.__reactInternalSnapshotBeforeUpdate=t}catch(Re){rt(l,l.return,Re)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)xf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":xf(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,Kt=t;break}Kt=n.return}}function Im(t,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:fl(t,l),s&4&&Bs(5,l);break;case 1:if(fl(t,l),s&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(v){rt(l,l.return,v)}else{var f=Ua(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){rt(l,l.return,v)}}s&64&&Dm(l),s&512&&qs(l,l.return);break;case 3:if(fl(t,l),s&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{wh(t,n)}catch(v){rt(l,l.return,v)}}break;case 27:n===null&&s&4&&zm(l);case 26:case 5:fl(t,l),n===null&&s&4&&Om(l),s&512&&qs(l,l.return);break;case 12:fl(t,l);break;case 31:fl(t,l),s&4&&qm(t,l);break;case 13:fl(t,l),s&4&&Hm(t,l),s&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=dw.bind(null,l),Dw(t,l))));break;case 22:if(s=l.memoizedState!==null||cl,!s){n=n!==null&&n.memoizedState!==null||Bt,f=cl;var p=Bt;cl=s,(Bt=n)&&!p?pl(t,l,(l.subtreeFlags&8772)!==0):fl(t,l),cl=f,Bt=p}break;case 30:break;default:fl(t,l)}}function Um(t){var n=t.alternate;n!==null&&(t.alternate=null,Um(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&ei(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 bt=null,Dn=!1;function dl(t,n,l){for(l=l.child;l!==null;)Bm(t,n,l),l=l.sibling}function Bm(t,n,l){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Xt,l)}catch{}switch(l.tag){case 26:Bt||Ri(l,n),dl(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Bt||Ri(l,n);var s=bt,f=Dn;ea(l.type)&&(bt=l.stateNode,Dn=!1),dl(t,n,l),Ws(l.stateNode),bt=s,Dn=f;break;case 5:Bt||Ri(l,n);case 6:if(s=bt,f=Dn,bt=null,dl(t,n,l),bt=s,Dn=f,bt!==null)if(Dn)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(l.stateNode)}catch(p){rt(l,n,p)}else try{bt.removeChild(l.stateNode)}catch(p){rt(l,n,p)}break;case 18:bt!==null&&(Dn?(t=bt,Dg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Vr(t)):Dg(bt,l.stateNode));break;case 4:s=bt,f=Dn,bt=l.stateNode.containerInfo,Dn=!0,dl(t,n,l),bt=s,Dn=f;break;case 0:case 11:case 14:case 15:Pl(2,l,n),Bt||Pl(4,l,n),dl(t,n,l);break;case 1:Bt||(Ri(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&Mm(l,n,s)),dl(t,n,l);break;case 21:dl(t,n,l);break;case 22:Bt=(s=Bt)||l.memoizedState!==null,dl(t,n,l),Bt=s;break;default:dl(t,n,l)}}function qm(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Vr(t)}catch(l){rt(n,n.return,l)}}}function Hm(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Vr(t)}catch(l){rt(n,n.return,l)}}function iw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Lm),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Lm),n;default:throw Error(r(435,t.tag))}}function Du(t,n){var l=iw(t);n.forEach(function(s){if(!l.has(s)){l.add(s);var f=fw.bind(null,t,s);s.then(f,f)}})}function Mn(t,n){var l=n.deletions;if(l!==null)for(var s=0;s<l.length;s++){var f=l[s],p=t,v=n,j=v;e:for(;j!==null;){switch(j.tag){case 27:if(ea(j.type)){bt=j.stateNode,Dn=!1;break e}break;case 5:bt=j.stateNode,Dn=!1;break e;case 3:case 4:bt=j.stateNode.containerInfo,Dn=!0;break e}j=j.return}if(bt===null)throw Error(r(160));Bm(p,v,f),bt=null,Dn=!1,p=f.alternate,p!==null&&(p.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)$m(n,t),n=n.sibling}var yi=null;function $m(t,n){var l=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Mn(n,t),On(t),s&4&&(Pl(3,t,t.return),Bs(3,t),Pl(5,t,t.return));break;case 1:Mn(n,t),On(t),s&512&&(Bt||l===null||Ri(l,l.return)),s&64&&cl&&(t=t.updateQueue,t!==null&&(s=t.callbacks,s!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?s:l.concat(s))));break;case 26:var f=yi;if(Mn(n,t),On(t),s&512&&(Bt||l===null||Ri(l,l.return)),s&4){var p=l!==null?l.memoizedState:null;if(s=t.memoizedState,l===null)if(s===null)if(t.stateNode===null){e:{s=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(s){case"title":p=f.getElementsByTagName("title")[0],(!p||p[vl]||p[Ht]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=f.createElement(s),f.head.insertBefore(p,f.querySelector("head > title"))),nn(p,s,l),p[Ht]=t,_t(p),s=p;break e;case"link":var v=$g("link","href",f).get(s+(l.href||""));if(v){for(var j=0;j<v.length;j++)if(p=v[j],p.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&p.getAttribute("rel")===(l.rel==null?null:l.rel)&&p.getAttribute("title")===(l.title==null?null:l.title)&&p.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(j,1);break t}}p=f.createElement(s),nn(p,s,l),f.head.appendChild(p);break;case"meta":if(v=$g("meta","content",f).get(s+(l.content||""))){for(j=0;j<v.length;j++)if(p=v[j],p.getAttribute("content")===(l.content==null?null:""+l.content)&&p.getAttribute("name")===(l.name==null?null:l.name)&&p.getAttribute("property")===(l.property==null?null:l.property)&&p.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&p.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(j,1);break t}}p=f.createElement(s),nn(p,s,l),f.head.appendChild(p);break;default:throw Error(r(468,s))}p[Ht]=t,_t(p),s=p}t.stateNode=s}else Gg(f,t.type,t.stateNode);else t.stateNode=Hg(f,s,t.memoizedProps);else p!==s?(p===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):p.count--,s===null?Gg(f,t.type,t.stateNode):Hg(f,s,t.memoizedProps)):s===null&&t.stateNode!==null&&Gd(t,t.memoizedProps,l.memoizedProps)}break;case 27:Mn(n,t),On(t),s&512&&(Bt||l===null||Ri(l,l.return)),l!==null&&s&4&&Gd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Mn(n,t),On(t),s&512&&(Bt||l===null||Ri(l,l.return)),t.flags&32){f=t.stateNode;try{ti(f,"")}catch(ve){rt(t,t.return,ve)}}s&4&&t.stateNode!=null&&(f=t.memoizedProps,Gd(t,f,l!==null?l.memoizedProps:f)),s&1024&&(Fd=!0);break;case 6:if(Mn(n,t),On(t),s&4){if(t.stateNode===null)throw Error(r(162));s=t.memoizedProps,l=t.stateNode;try{l.nodeValue=s}catch(ve){rt(t,t.return,ve)}}break;case 3:if(Pu=null,f=yi,yi=Yu(n.containerInfo),Mn(n,t),yi=f,On(t),s&4&&l!==null&&l.memoizedState.isDehydrated)try{Vr(n.containerInfo)}catch(ve){rt(t,t.return,ve)}Fd&&(Fd=!1,Gm(t));break;case 4:s=yi,yi=Yu(t.stateNode.containerInfo),Mn(n,t),On(t),yi=s;break;case 12:Mn(n,t),On(t);break;case 31:Mn(n,t),On(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Du(t,s)));break;case 13:Mn(n,t),On(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ou=Nt()),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Du(t,s)));break;case 22:f=t.memoizedState!==null;var R=l!==null&&l.memoizedState!==null,Y=cl,J=Bt;if(cl=Y||f,Bt=J||R,Mn(n,t),Bt=J,cl=Y,On(t),s&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||R||cl||Bt||Ba(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){R=l=n;try{if(p=R.stateNode,f)v=p.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{j=R.stateNode;var le=R.memoizedProps.style,F=le!=null&&le.hasOwnProperty("display")?le.display:null;j.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ve){rt(R,R.return,ve)}}}else if(n.tag===6){if(l===null){R=n;try{R.stateNode.nodeValue=f?"":R.memoizedProps}catch(ve){rt(R,R.return,ve)}}}else if(n.tag===18){if(l===null){R=n;try{var W=R.stateNode;f?Mg(W,!0):Mg(R.stateNode,!1)}catch(ve){rt(R,R.return,ve)}}}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}s&4&&(s=t.updateQueue,s!==null&&(l=s.retryQueue,l!==null&&(s.retryQueue=null,Du(t,l))));break;case 19:Mn(n,t),On(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Du(t,s)));break;case 30:break;case 21:break;default:Mn(n,t),On(t)}}function On(t){var n=t.flags;if(n&2){try{for(var l,s=t.return;s!==null;){if(Rm(s)){l=s;break}s=s.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,p=Vd(t);_u(t,p,f);break;case 5:var v=l.stateNode;l.flags&32&&(ti(v,""),l.flags&=-33);var j=Vd(t);_u(t,j,v);break;case 3:case 4:var R=l.stateNode.containerInfo,Y=Vd(t);Yd(t,Y,R);break;default:throw Error(r(161))}}catch(J){rt(t,t.return,J)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Gm(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Gm(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function fl(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Im(t,n.alternate,n),n=n.sibling}function Ba(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Pl(4,n,n.return),Ba(n);break;case 1:Ri(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Mm(n,n.return,l),Ba(n);break;case 27:Ws(n.stateNode);case 26:case 5:Ri(n,n.return),Ba(n);break;case 22:n.memoizedState===null&&Ba(n);break;case 30:Ba(n);break;default:Ba(n)}t=t.sibling}}function pl(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,f=t,p=n,v=p.flags;switch(p.tag){case 0:case 11:case 15:pl(f,p,l),Bs(4,p);break;case 1:if(pl(f,p,l),s=p,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Y){rt(s,s.return,Y)}if(s=p,f=s.updateQueue,f!==null){var j=s.stateNode;try{var R=f.shared.hiddenCallbacks;if(R!==null)for(f.shared.hiddenCallbacks=null,f=0;f<R.length;f++)vh(R[f],j)}catch(Y){rt(s,s.return,Y)}}l&&v&64&&Dm(p),qs(p,p.return);break;case 27:zm(p);case 26:case 5:pl(f,p,l),l&&s===null&&v&4&&Om(p),qs(p,p.return);break;case 12:pl(f,p,l);break;case 31:pl(f,p,l),l&&v&4&&qm(f,p);break;case 13:pl(f,p,l),l&&v&4&&Hm(f,p);break;case 22:p.memoizedState===null&&pl(f,p,l),qs(p,p.return);break;case 30:break;default:pl(f,p,l)}n=n.sibling}}function Pd(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&&Es(l))}function Kd(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Es(t))}function xi(t,n,l,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Vm(t,n,l,s),n=n.sibling}function Vm(t,n,l,s){var f=n.flags;switch(n.tag){case 0:case 11:case 15:xi(t,n,l,s),f&2048&&Bs(9,n);break;case 1:xi(t,n,l,s);break;case 3:xi(t,n,l,s),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Es(t)));break;case 12:if(f&2048){xi(t,n,l,s),t=n.stateNode;try{var p=n.memoizedProps,v=p.id,j=p.onPostCommit;typeof j=="function"&&j(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(R){rt(n,n.return,R)}}else xi(t,n,l,s);break;case 31:xi(t,n,l,s);break;case 13:xi(t,n,l,s);break;case 23:break;case 22:p=n.stateNode,v=n.alternate,n.memoizedState!==null?p._visibility&2?xi(t,n,l,s):Hs(t,n):p._visibility&2?xi(t,n,l,s):(p._visibility|=2,Or(t,n,l,s,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Pd(v,n);break;case 24:xi(t,n,l,s),f&2048&&Kd(n.alternate,n);break;default:xi(t,n,l,s)}}function Or(t,n,l,s,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=t,v=n,j=l,R=s,Y=v.flags;switch(v.tag){case 0:case 11:case 15:Or(p,v,j,R,f),Bs(8,v);break;case 23:break;case 22:var J=v.stateNode;v.memoizedState!==null?J._visibility&2?Or(p,v,j,R,f):Hs(p,v):(J._visibility|=2,Or(p,v,j,R,f)),f&&Y&2048&&Pd(v.alternate,v);break;case 24:Or(p,v,j,R,f),f&&Y&2048&&Kd(v.alternate,v);break;default:Or(p,v,j,R,f)}n=n.sibling}}function Hs(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,s=n,f=s.flags;switch(s.tag){case 22:Hs(l,s),f&2048&&Pd(s.alternate,s);break;case 24:Hs(l,s),f&2048&&Kd(s.alternate,s);break;default:Hs(l,s)}n=n.sibling}}var $s=8192;function Rr(t,n,l){if(t.subtreeFlags&$s)for(t=t.child;t!==null;)Ym(t,n,l),t=t.sibling}function Ym(t,n,l){switch(t.tag){case 26:Rr(t,n,l),t.flags&$s&&t.memoizedState!==null&&Gw(l,yi,t.memoizedState,t.memoizedProps);break;case 5:Rr(t,n,l);break;case 3:case 4:var s=yi;yi=Yu(t.stateNode.containerInfo),Rr(t,n,l),yi=s;break;case 22:t.memoizedState===null&&(s=t.alternate,s!==null&&s.memoizedState!==null?(s=$s,$s=16777216,Rr(t,n,l),$s=s):Rr(t,n,l));break;default:Rr(t,n,l)}}function Fm(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 Gs(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Kt=s,Km(s,t)}Fm(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Pm(t),t=t.sibling}function Pm(t){switch(t.tag){case 0:case 11:case 15:Gs(t),t.flags&2048&&Pl(9,t,t.return);break;case 3:Gs(t);break;case 12:Gs(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Mu(t)):Gs(t);break;default:Gs(t)}}function Mu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Kt=s,Km(s,t)}Fm(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Pl(8,n,n.return),Mu(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Mu(n));break;default:Mu(n)}t=t.sibling}}function Km(t,n){for(;Kt!==null;){var l=Kt;switch(l.tag){case 0:case 11:case 15:Pl(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var s=l.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Es(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,Kt=s;else e:for(l=t;Kt!==null;){s=Kt;var f=s.sibling,p=s.return;if(Um(s),s===l){Kt=null;break e}if(f!==null){f.return=p,Kt=f;break e}Kt=p}}}var lw={getCacheForType:function(t){var n=pe(xt),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return pe(xt).controller.signal}},aw=typeof WeakMap=="function"?WeakMap:Map,it=0,ft=null,Ve=null,Pe=0,at=0,Pn=null,Kl=!1,zr=!1,Wd=!1,hl=0,Tt=0,Wl=0,qa=0,Xd=0,Kn=0,Lr=0,Vs=null,Rn=null,Qd=!1,Ou=0,Wm=0,Ru=1/0,zu=null,Xl=null,$t=0,Ql=null,Ir=null,ml=0,Zd=0,Jd=null,Xm=null,Ys=0,ef=null;function Wn(){return(it&2)!==0&&Pe!==0?Pe&-Pe:$.T!==null?sf():Hi()}function Qm(){if(Kn===0)if((Pe&536870912)===0||Be){var t=Xa;Xa<<=1,(Xa&3932160)===0&&(Xa=262144),Kn=t}else Kn=536870912;return t=Yn.current,t!==null&&(t.flags|=32),Kn}function zn(t,n,l){(t===ft&&(at===2||at===9)||t.cancelPendingCommit!==null)&&(Ur(t,0),Zl(t,Pe,Kn,!1)),fa(t,l),((it&2)===0||t!==ft)&&(t===ft&&((it&2)===0&&(qa|=l),Tt===4&&Zl(t,Pe,Kn,!1)),zi(t))}function Zm(t,n,l){if((it&6)!==0)throw Error(r(327));var s=!l&&(n&127)===0&&(n&t.expiredLanes)===0||da(t,n),f=s?ow(t,n):nf(t,n,!0),p=s;do{if(f===0){zr&&!s&&Zl(t,n,0,!1);break}else{if(l=t.current.alternate,p&&!rw(l)){f=nf(t,n,!1),p=!1;continue}if(f===2){if(p=n,t.errorRecoveryDisabledLanes&p)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var j=t;f=Vs;var R=j.current.memoizedState.isDehydrated;if(R&&(Ur(j,v).flags|=256),v=nf(j,v,!1),v!==2){if(Wd&&!R){j.errorRecoveryDisabledLanes|=p,qa|=p,f=4;break e}p=Rn,Rn=f,p!==null&&(Rn===null?Rn=p:Rn.push.apply(Rn,p))}f=v}if(p=!1,f!==2)continue}}if(f===1){Ur(t,0),Zl(t,n,0,!0);break}e:{switch(s=t,p=f,p){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:Zl(s,n,Kn,!Kl);break e;case 2:Rn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Ou+300-Nt(),10<f)){if(Zl(s,n,Kn,!Kl),Ci(s,0,!0)!==0)break e;ml=n,s.timeoutHandle=Ng(Jm.bind(null,s,l,Rn,zu,Qd,n,Kn,qa,Lr,Kl,p,"Throttled",-0,0),f);break e}Jm(s,l,Rn,zu,Qd,n,Kn,qa,Lr,Kl,p,null,-0,0)}}break}while(!0);zi(t)}function Jm(t,n,l,s,f,p,v,j,R,Y,J,le,F,W){if(t.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hi},Ym(n,p,le);var ve=(p&62914560)===p?Ou-Nt():(p&4194048)===p?Wm-Nt():0;if(ve=Vw(le,ve),ve!==null){ml=p,t.cancelPendingCommit=ve(sg.bind(null,t,n,p,l,s,f,v,j,R,J,le,null,F,W)),Zl(t,p,v,!Y);return}}sg(t,n,p,l,s,f,v,j,R)}function rw(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 s=0;s<l.length;s++){var f=l[s],p=f.getSnapshot;f=f.value;try{if(!mn(p(),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 Zl(t,n,l,s){n&=~Xd,n&=~qa,t.suspendedLanes|=n,t.pingedLanes&=~n,s&&(t.warmLanes|=n),s=t.expirationTimes;for(var f=n;0<f;){var p=31-tt(f),v=1<<p;s[p]=-1,f&=~v}l!==0&&Ro(t,l,n)}function Lu(){return(it&6)===0?(Fs(0),!1):!0}function tf(){if(Ve!==null){if(at===0)var t=Ve.return;else t=Ve,k=y=null,yd(t),Ar=null,As=0,t=Ve;for(;t!==null;)_m(t.alternate,t),t=t.return;Ve=null}}function Ur(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Ew(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),ml=0,tf(),ft=t,Ve=l=Gn(t.current,null),Pe=n,at=0,Pn=null,Kl=!1,zr=da(t,n),Wd=!1,Lr=Kn=Xd=qa=Wl=Tt=0,Rn=Vs=null,Qd=!1,(n&8)!==0&&(n|=n&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=n;0<s;){var f=31-tt(s),p=1<<f;n|=t[f],s&=~p}return hl=n,hr(),l}function eg(t,n){qe=null,$.H=Ls,n===Tr||n===du?(n=gh(),at=3):n===ad?(n=gh(),at=4):at=n===Od?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Pn=n,Ve===null&&(Tt=1,Cu(t,Tn(n,t.current)))}function tg(){var t=Yn.current;return t===null?!0:(Pe&4194048)===Pe?ri===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?t===ri:!1}function ng(){var t=$.H;return $.H=Ls,t===null?Ls:t}function ig(){var t=$.A;return $.A=lw,t}function Iu(){Tt=4,Kl||(Pe&4194048)!==Pe&&Yn.current!==null||(zr=!0),(Wl&134217727)===0&&(qa&134217727)===0||ft===null||Zl(ft,Pe,Kn,!1)}function nf(t,n,l){var s=it;it|=2;var f=ng(),p=ig();(ft!==t||Pe!==n)&&(zu=null,Ur(t,n)),n=!1;var v=Tt;e:do try{if(at!==0&&Ve!==null){var j=Ve,R=Pn;switch(at){case 8:tf(),v=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(n=!0);var Y=at;if(at=0,Pn=null,Br(t,j,R,Y),l&&zr){v=0;break e}break;default:Y=at,at=0,Pn=null,Br(t,j,R,Y)}}sw(),v=Tt;break}catch(J){eg(t,J)}while(!0);return n&&t.shellSuspendCounter++,k=y=null,it=s,$.H=f,$.A=p,Ve===null&&(ft=null,Pe=0,hr()),v}function sw(){for(;Ve!==null;)lg(Ve)}function ow(t,n){var l=it;it|=2;var s=ng(),f=ig();ft!==t||Pe!==n?(zu=null,Ru=Nt()+500,Ur(t,n)):zr=da(t,n);e:do try{if(at!==0&&Ve!==null){n=Ve;var p=Pn;t:switch(at){case 1:at=0,Pn=null,Br(t,n,p,1);break;case 2:case 9:if(hh(p)){at=0,Pn=null,ag(n);break}n=function(){at!==2&&at!==9||ft!==t||(at=7),zi(t)},p.then(n,n);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:hh(p)?(at=0,Pn=null,ag(n)):(at=0,Pn=null,Br(t,n,p,7));break;case 5:var v=null;switch(Ve.tag){case 26:v=Ve.memoizedState;case 5:case 27:var j=Ve;if(v?Vg(v):j.stateNode.complete){at=0,Pn=null;var R=j.sibling;if(R!==null)Ve=R;else{var Y=j.return;Y!==null?(Ve=Y,Uu(Y)):Ve=null}break t}}at=0,Pn=null,Br(t,n,p,5);break;case 6:at=0,Pn=null,Br(t,n,p,6);break;case 8:tf(),Tt=6;break e;default:throw Error(r(462))}}uw();break}catch(J){eg(t,J)}while(!0);return k=y=null,$.H=s,$.A=f,it=l,Ve!==null?0:(ft=null,Pe=0,hr(),Tt)}function uw(){for(;Ve!==null&&!Vt();)lg(Ve)}function lg(t){var n=Am(t.alternate,t,hl);t.memoizedProps=t.pendingProps,n===null?Uu(t):Ve=n}function ag(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=km(l,n,n.pendingProps,n.type,void 0,Pe);break;case 11:n=km(l,n,n.pendingProps,n.type.render,n.ref,Pe);break;case 5:yd(n);default:_m(l,n),n=Ve=ru(n,hl),n=Am(l,n,hl)}t.memoizedProps=t.pendingProps,n===null?Uu(t):Ve=n}function Br(t,n,l,s){k=y=null,yd(n),Ar=null,As=0;var f=n.return;try{if(Qv(t,f,n,l,Pe)){Tt=1,Cu(t,Tn(l,t.current)),Ve=null;return}}catch(p){if(f!==null)throw Ve=f,p;Tt=1,Cu(t,Tn(l,t.current)),Ve=null;return}n.flags&32768?(Be||s===1?t=!0:zr||(Pe&536870912)!==0?t=!1:(Kl=t=!0,(s===2||s===9||s===3||s===6)&&(s=Yn.current,s!==null&&s.tag===13&&(s.flags|=16384))),rg(n,t)):Uu(n)}function Uu(t){var n=t;do{if((n.flags&32768)!==0){rg(n,Kl);return}t=n.return;var l=ew(n.alternate,n,hl);if(l!==null){Ve=l;return}if(n=n.sibling,n!==null){Ve=n;return}Ve=n=t}while(n!==null);Tt===0&&(Tt=5)}function rg(t,n){do{var l=tw(t.alternate,t);if(l!==null){l.flags&=32767,Ve=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Ve=t;return}Ve=t=l}while(t!==null);Tt=6,Ve=null}function sg(t,n,l,s,f,p,v,j,R){t.cancelPendingCommit=null;do Bu();while($t!==0);if((it&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(p=n.lanes|n.childLanes,p|=ws,Oo(t,l,p,v,j,R),t===ft&&(Ve=ft=null,Pe=0),Ir=n,Ql=t,ml=l,Zd=p,Jd=f,Xm=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,pw(Oe,function(){return fg(),null})):(t.callbackNode=null,t.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=$.T,$.T=null,f=ae.p,ae.p=2,v=it,it|=4;try{nw(t,n,l)}finally{it=v,ae.p=f,$.T=s}}$t=1,og(),ug(),cg()}}function og(){if($t===1){$t=0;var t=Ql,n=Ir,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=$.T,$.T=null;var s=ae.p;ae.p=2;var f=it;it|=4;try{$m(n,t);var p=mf,v=_i(t.containerInfo),j=p.focusedElem,R=p.selectionRange;if(v!==j&&j&&j.ownerDocument&&gs(j.ownerDocument.documentElement,j)){if(R!==null&&ur(j)){var Y=R.start,J=R.end;if(J===void 0&&(J=Y),"selectionStart"in j)j.selectionStart=Y,j.selectionEnd=Math.min(J,j.value.length);else{var le=j.ownerDocument||document,F=le&&le.defaultView||window;if(F.getSelection){var W=F.getSelection(),ve=j.textContent.length,Re=Math.min(R.start,ve),ct=R.end===void 0?Re:Math.min(R.end,ve);!W.extend&&Re>ct&&(v=ct,ct=Re,Re=v);var B=eu(j,Re),U=eu(j,ct);if(B&&U&&(W.rangeCount!==1||W.anchorNode!==B.node||W.anchorOffset!==B.offset||W.focusNode!==U.node||W.focusOffset!==U.offset)){var V=le.createRange();V.setStart(B.node,B.offset),W.removeAllRanges(),Re>ct?(W.addRange(V),W.extend(U.node,U.offset)):(V.setEnd(U.node,U.offset),W.addRange(V))}}}}for(le=[],W=j;W=W.parentNode;)W.nodeType===1&&le.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<le.length;j++){var ie=le[j];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Qu=!!hf,mf=hf=null}finally{it=f,ae.p=s,$.T=l}}t.current=n,$t=2}}function ug(){if($t===2){$t=0;var t=Ql,n=Ir,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=$.T,$.T=null;var s=ae.p;ae.p=2;var f=it;it|=4;try{Im(t,n.alternate,n)}finally{it=f,ae.p=s,$.T=l}}$t=3}}function cg(){if($t===4||$t===3){$t=0,vi();var t=Ql,n=Ir,l=ml,s=Xm;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?$t=5:($t=0,Ir=Ql=null,dg(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(Xl=null),Ti(l),n=n.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Xt,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=$.T,f=ae.p,ae.p=2,$.T=null;try{for(var p=t.onRecoverableError,v=0;v<s.length;v++){var j=s[v];p(j.value,{componentStack:j.stack})}}finally{$.T=n,ae.p=f}}(ml&3)!==0&&Bu(),zi(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===ef?Ys++:(Ys=0,ef=t):Ys=0,Fs(0)}}function dg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Es(n)))}function Bu(){return og(),ug(),cg(),fg()}function fg(){if($t!==5)return!1;var t=Ql,n=Zd;Zd=0;var l=Ti(ml),s=$.T,f=ae.p;try{ae.p=32>l?32:l,$.T=null,l=Jd,Jd=null;var p=Ql,v=ml;if($t=0,Ir=Ql=null,ml=0,(it&6)!==0)throw Error(r(331));var j=it;if(it|=4,Pm(p.current),Vm(p,p.current,v,l),it=j,Fs(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Xt,p)}catch{}return!0}finally{ae.p=f,$.T=s,dg(t,n)}}function pg(t,n,l){n=Tn(l,n),n=Md(t.stateNode,n,2),t=Vl(t,n,2),t!==null&&(fa(t,2),zi(t))}function rt(t,n,l){if(t.tag===3)pg(t,t,l);else for(;n!==null;){if(n.tag===3){pg(n,t,l);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Xl===null||!Xl.has(s))){t=Tn(l,t),l=hm(2),s=Vl(n,l,2),s!==null&&(mm(l,s,n,t),fa(s,2),zi(s));break}}n=n.return}}function lf(t,n,l){var s=t.pingCache;if(s===null){s=t.pingCache=new aw;var f=new Set;s.set(n,f)}else f=s.get(n),f===void 0&&(f=new Set,s.set(n,f));f.has(l)||(Wd=!0,f.add(l),t=cw.bind(null,t,n,l),n.then(t,t))}function cw(t,n,l){var s=t.pingCache;s!==null&&s.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,ft===t&&(Pe&l)===l&&(Tt===4||Tt===3&&(Pe&62914560)===Pe&&300>Nt()-Ou?(it&2)===0&&Ur(t,0):Xd|=l,Lr===Pe&&(Lr=0)),zi(t)}function hg(t,n){n===0&&(n=Mo()),t=il(t,n),t!==null&&(fa(t,n),zi(t))}function dw(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),hg(t,l)}function fw(t,n){var l=0;switch(t.tag){case 31:case 13:var s=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(r(314))}s!==null&&s.delete(n),hg(t,l)}function pw(t,n){return di(t,n)}var qu=null,qr=null,af=!1,Hu=!1,rf=!1,Jl=0;function zi(t){t!==qr&&t.next===null&&(qr===null?qu=qr=t:qr=qr.next=t),Hu=!0,af||(af=!0,mw())}function Fs(t,n){if(!rf&&Hu){rf=!0;do for(var l=!1,s=qu;s!==null;){if(t!==0){var f=s.pendingLanes;if(f===0)var p=0;else{var v=s.suspendedLanes,j=s.pingedLanes;p=(1<<31-tt(42|t)+1)-1,p&=f&~(v&~j),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(l=!0,xg(s,p))}else p=Pe,p=Ci(s,s===ft?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(p&3)===0||da(s,p)||(l=!0,xg(s,p));s=s.next}while(l);rf=!1}}function hw(){mg()}function mg(){Hu=af=!1;var t=0;Jl!==0&&Cw()&&(t=Jl);for(var n=Nt(),l=null,s=qu;s!==null;){var f=s.next,p=gg(s,n);p===0?(s.next=null,l===null?qu=f:l.next=f,f===null&&(qr=l)):(l=s,(t!==0||(p&3)!==0)&&(Hu=!0)),s=f}$t!==0&&$t!==5||Fs(t),Jl!==0&&(Jl=0)}function gg(t,n){for(var l=t.suspendedLanes,s=t.pingedLanes,f=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var v=31-tt(p),j=1<<v,R=f[v];R===-1?((j&l)===0||(j&s)!==0)&&(f[v]=Do(j,n)):R<=n&&(t.expiredLanes|=j),p&=~j}if(n=ft,l=Pe,l=Ci(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s=t.callbackNode,l===0||t===n&&(at===2||at===9)||t.cancelPendingCommit!==null)return s!==null&&s!==null&&yt(s),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||da(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(s!==null&&yt(s),Ti(l)){case 2:case 8:l=se;break;case 32:l=Oe;break;case 268435456:l=Qe;break;default:l=Oe}return s=yg.bind(null,t),l=di(l,s),t.callbackPriority=n,t.callbackNode=l,n}return s!==null&&s!==null&&yt(s),t.callbackPriority=2,t.callbackNode=null,2}function yg(t,n){if($t!==0&&$t!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Bu()&&t.callbackNode!==l)return null;var s=Pe;return s=Ci(t,t===ft?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s===0?null:(Zm(t,s,n),gg(t,Nt()),t.callbackNode!=null&&t.callbackNode===l?yg.bind(null,t):null)}function xg(t,n){if(Bu())return null;Zm(t,n,!0)}function mw(){Tw(function(){(it&6)!==0?di(ne,hw):mg()})}function sf(){if(Jl===0){var t=Cr;t===0&&(t=ki,ki<<=1,(ki&261888)===0&&(ki=256)),Jl=t}return Jl}function bg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ni(""+t)}function vg(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 gw(t,n,l,s,f){if(n==="submit"&&l&&l.stateNode===f){var p=bg((f[Lt]||null).action),v=s.submitter;v&&(n=(n=v[Lt]||null)?bg(n.formAction):v.getAttribute("formAction"),n!==null&&(p=n,v=null));var j=new Xi("action","action",null,s,f);t.push({event:j,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Jl!==0){var R=v?vg(f,v):new FormData(f);Ed(l,{pending:!0,data:R,method:f.method,action:p},null,R)}}else typeof p=="function"&&(j.preventDefault(),R=v?vg(f,v):new FormData(f),Ed(l,{pending:!0,data:R,method:f.method,action:p},p,R))},currentTarget:f}]})}}for(var of=0;of<fr.length;of++){var uf=fr[of],yw=uf.toLowerCase(),xw=uf[0].toUpperCase()+uf.slice(1);$n(yw,"on"+xw)}$n(nu,"onAnimationEnd"),$n(iu,"onAnimationIteration"),$n(nl,"onAnimationStart"),$n("dblclick","onDoubleClick"),$n("focusin","onFocus"),$n("focusout","onBlur"),$n(dr,"onTransitionRun"),$n(Jc,"onTransitionStart"),$n(ed,"onTransitionCancel"),$n(vs,"onTransitionEnd"),qn("onMouseEnter",["mouseout","mouseover"]),qn("onMouseLeave",["mouseout","mouseover"]),qn("onPointerEnter",["pointerout","pointerover"]),qn("onPointerLeave",["pointerout","pointerover"]),ln("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ln("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ln("onBeforeInput",["compositionend","keypress","textInput","paste"]),ln("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ln("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ln("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ps="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(" "),bw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ps));function wg(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var s=t[l],f=s.event;s=s.listeners;e:{var p=void 0;if(n)for(var v=s.length-1;0<=v;v--){var j=s[v],R=j.instance,Y=j.currentTarget;if(j=j.listener,R!==p&&f.isPropagationStopped())break e;p=j,f.currentTarget=Y;try{p(f)}catch(J){pr(J)}f.currentTarget=null,p=R}else for(v=0;v<s.length;v++){if(j=s[v],R=j.instance,Y=j.currentTarget,j=j.listener,R!==p&&f.isPropagationStopped())break e;p=j,f.currentTarget=Y;try{p(f)}catch(J){pr(J)}f.currentTarget=null,p=R}}}}function Ye(t,n){var l=n[pa];l===void 0&&(l=n[pa]=new Set);var s=t+"__bubble";l.has(s)||(kg(n,t,2,!1),l.add(s))}function cf(t,n,l){var s=0;n&&(s|=4),kg(l,t,s,n)}var $u="_reactListening"+Math.random().toString(36).slice(2);function df(t){if(!t[$u]){t[$u]=!0,Lo.forEach(function(l){l!=="selectionchange"&&(bw.has(l)||cf(l,!1,t),cf(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[$u]||(n[$u]=!0,cf("selectionchange",!1,n))}}function kg(t,n,l,s){switch(Qg(n)){case 2:var f=Pw;break;case 8:f=Kw;break;default:f=Ef}l=f.bind(null,n,l,t),f=void 0,!ba||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),s?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 ff(t,n,l,s,f){var p=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var v=s.tag;if(v===3||v===4){var j=s.stateNode.containerInfo;if(j===f)break;if(v===4)for(v=s.return;v!==null;){var R=v.tag;if((R===3||R===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;j!==null;){if(v=Ni(j),v===null)return;if(R=v.tag,R===5||R===6||R===26||R===27){s=p=v;continue e}j=j.parentNode}}s=s.return}Tl(function(){var Y=p,J=El(l),le=[];e:{var F=lu.get(t);if(F!==void 0){var W=Xi,ve=t;switch(t){case"keypress":if(Ki(l)===0)break e;case"keydown":case"keyup":W=rr;break;case"focusin":ve="focus",W=Dl;break;case"focusout":ve="blur",W=Dl;break;case"beforeblur":case"afterblur":W=Dl;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":W=lr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=nt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=Gc;break;case nu:case iu:case nl:W=ka;break;case vs:W=Go;break;case"scroll":case"scrollend":W=ls;break;case"wheel":W=Ca;break;case"copy":case"cut":case"paste":W=ar;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=Ml;break;case"toggle":case"beforetoggle":W=Yc}var Re=(n&4)!==0,ct=!Re&&(t==="scroll"||t==="scrollend"),B=Re?F!==null?F+"Capture":null:F;Re=[];for(var U=Y,V;U!==null;){var ie=U;if(V=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||V===null||B===null||(ie=Pi(U,B),ie!=null&&Re.push(Ks(U,ie,V))),ct)break;U=U.return}0<Re.length&&(F=new W(F,ve,null,l,J),le.push({event:F,listeners:Re}))}}if((n&7)===0){e:{if(F=t==="mouseover"||t==="pointerover",W=t==="mouseout"||t==="pointerout",F&&l!==tr&&(ve=l.relatedTarget||l.fromElement)&&(Ni(ve)||ve[Ai]))break e;if((W||F)&&(F=J.window===J?J:(F=J.ownerDocument)?F.defaultView||F.parentWindow:window,W?(ve=l.relatedTarget||l.toElement,W=Y,ve=ve?Ni(ve):null,ve!==null&&(ct=c(ve),Re=ve.tag,ve!==ct||Re!==5&&Re!==27&&Re!==6)&&(ve=null)):(W=null,ve=Y),W!==ve)){if(Re=lr,ie="onMouseLeave",B="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(Re=Ml,ie="onPointerLeave",B="onPointerEnter",U="pointer"),ct=W==null?F:ha(W),V=ve==null?F:ha(ve),F=new Re(ie,U+"leave",W,l,J),F.target=ct,F.relatedTarget=V,ie=null,Ni(J)===Y&&(Re=new Re(B,U+"enter",ve,l,J),Re.target=V,Re.relatedTarget=ct,ie=Re),ct=ie,W&&ve)t:{for(Re=vw,B=W,U=ve,V=0,ie=B;ie;ie=Re(ie))V++;ie=0;for(var Ee=U;Ee;Ee=Re(Ee))ie++;for(;0<V-ie;)B=Re(B),V--;for(;0<ie-V;)U=Re(U),ie--;for(;V--;){if(B===U||U!==null&&B===U.alternate){Re=B;break t}B=Re(B),U=Re(U)}Re=null}else Re=null;W!==null&&Sg(le,F,W,Re,!1),ve!==null&&ct!==null&&Sg(le,ct,ve,Re,!0)}}e:{if(F=Y?ha(Y):window,W=F.nodeName&&F.nodeName.toLowerCase(),W==="select"||W==="input"&&F.type==="file")var Je=Ko;else if(Fo(F))if(Wo)Je=Qc;else{Je=Wc;var ke=Kc}else W=F.nodeName,!W||W.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?Y&&ya(Y.elementType)&&(Je=Ko):Je=Xc;if(Je&&(Je=Je(t,Y))){Po(le,Je,l,J);break e}ke&&ke(t,F,Y),t==="focusout"&&Y&&F.type==="number"&&Y.memoizedProps.value!=null&&Cl(F,"number",F.value)}switch(ke=Y?ha(Y):window,t){case"focusin":(Fo(ke)||ke.contentEditable==="true")&&(Cn=ke,ys=Y,Da=null);break;case"focusout":Da=ys=Cn=null;break;case"mousedown":xs=!0;break;case"contextmenu":case"mouseup":case"dragend":xs=!1,tu(le,l,J);break;case"selectionchange":if(_a)break;case"keydown":case"keyup":tu(le,l,J)}var $e;if(us)e:{switch(t){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Ji?Yo(t,l)&&(Ke="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ke="onCompositionStart");Ke&&(Vo&&l.locale!=="ko"&&(Ji||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Ji&&($e=en()):(mi=J,ii="value"in mi?mi.value:mi.textContent,Ji=!0)),ke=Gu(Y,Ke),0<ke.length&&(Ke=new Ho(Ke,t,null,l,J),le.push({event:Ke,listeners:ke}),$e?Ke.data=$e:($e=or(l),$e!==null&&(Ke.data=$e)))),($e=cs?fs(t,l):Fc(t,l))&&(Ke=Gu(Y,"onBeforeInput"),0<Ke.length&&(ke=new Ho("onBeforeInput","beforeinput",null,l,J),le.push({event:ke,listeners:Ke}),ke.data=$e)),gw(le,t,Y,l,J)}wg(le,n)})}function Ks(t,n,l){return{instance:t,listener:n,currentTarget:l}}function Gu(t,n){for(var l=n+"Capture",s=[];t!==null;){var f=t,p=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||p===null||(f=Pi(t,l),f!=null&&s.unshift(Ks(t,f,p)),f=Pi(t,n),f!=null&&s.push(Ks(t,f,p))),t.tag===3)return s;t=t.return}return[]}function vw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Sg(t,n,l,s,f){for(var p=n._reactName,v=[];l!==null&&l!==s;){var j=l,R=j.alternate,Y=j.stateNode;if(j=j.tag,R!==null&&R===s)break;j!==5&&j!==26&&j!==27||Y===null||(R=Y,f?(Y=Pi(l,p),Y!=null&&v.unshift(Ks(l,Y,R))):f||(Y=Pi(l,p),Y!=null&&v.push(Ks(l,Y,R)))),l=l.return}v.length!==0&&t.push({event:n,listeners:v})}var ww=/\r\n?/g,kw=/\u0000|\uFFFD/g;function jg(t){return(typeof t=="string"?t:""+t).replace(ww,`
|
|
50
|
+
`).replace(kw,"")}function Cg(t,n){return n=jg(n),jg(t)===n}function ut(t,n,l,s,f,p){switch(l){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||ti(t,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&ti(t,""+s);break;case"className":kn(t,"class",s);break;case"tabIndex":kn(t,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":kn(t,l,s);break;case"style":Bo(t,s,p);break;case"data":if(n!=="object"){kn(t,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(l);break}s=ni(""+s),t.setAttribute(l,s);break;case"action":case"formAction":if(typeof s=="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 p=="function"&&(l==="formAction"?(n!=="input"&&ut(t,n,"name",f.name,f,null),ut(t,n,"formEncType",f.formEncType,f,null),ut(t,n,"formMethod",f.formMethod,f,null),ut(t,n,"formTarget",f.formTarget,f,null)):(ut(t,n,"encType",f.encType,f,null),ut(t,n,"method",f.method,f,null),ut(t,n,"target",f.target,f,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(l);break}s=ni(""+s),t.setAttribute(l,s);break;case"onClick":s!=null&&(t.onclick=hi);break;case"onScroll":s!=null&&Ye("scroll",t);break;case"onScrollEnd":s!=null&&Ye("scrollend",t);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(r(61));if(l=s.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":t.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){t.removeAttribute("xlink:href");break}l=ni(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(l,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":s===!0?t.setAttribute(l,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(l,s):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?t.setAttribute(l,s):t.removeAttribute(l);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?t.removeAttribute(l):t.setAttribute(l,s);break;case"popover":Ye("beforetoggle",t),Ye("toggle",t),wn(t,"popover",s);break;case"xlinkActuate":Zt(t,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Zt(t,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Zt(t,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Zt(t,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Zt(t,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Zt(t,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Zt(t,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Zt(t,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Zt(t,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":wn(t,"is",s);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=qo.get(l)||l,wn(t,l,s))}}function pf(t,n,l,s,f,p){switch(l){case"style":Bo(t,s,p);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(r(61));if(l=s.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof s=="string"?ti(t,s):(typeof s=="number"||typeof s=="bigint")&&ti(t,""+s);break;case"onScroll":s!=null&&Ye("scroll",t);break;case"onScrollEnd":s!=null&&Ye("scrollend",t);break;case"onClick":s!=null&&(t.onclick=hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ts.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),p=t[Lt]||null,p=p!=null?p[l]:null,typeof p=="function"&&t.removeEventListener(n,p,f),typeof s=="function")){typeof p!="function"&&p!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,s,f);break e}l in t?t[l]=s:s===!0?t.setAttribute(l,""):wn(t,l,s)}}}function nn(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",t),Ye("load",t);var s=!1,f=!1,p;for(p in l)if(l.hasOwnProperty(p)){var v=l[p];if(v!=null)switch(p){case"src":s=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ut(t,n,p,v,l,null)}}f&&ut(t,n,"srcSet",l.srcSet,l,null),s&&ut(t,n,"src",l.src,l,null);return;case"input":Ye("invalid",t);var j=p=v=f=null,R=null,Y=null;for(s in l)if(l.hasOwnProperty(s)){var J=l[s];if(J!=null)switch(s){case"name":f=J;break;case"type":v=J;break;case"checked":R=J;break;case"defaultChecked":Y=J;break;case"value":p=J;break;case"defaultValue":j=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,n));break;default:ut(t,n,s,J,l,null)}}ns(t,p,j,R,Y,v,f,!1);return;case"select":Ye("invalid",t),s=v=p=null;for(f in l)if(l.hasOwnProperty(f)&&(j=l[f],j!=null))switch(f){case"value":p=j;break;case"defaultValue":v=j;break;case"multiple":s=j;default:ut(t,n,f,j,l,null)}n=p,l=v,t.multiple=!!s,n!=null?Jt(t,!!s,n,!1):l!=null&&Jt(t,!!s,l,!0);return;case"textarea":Ye("invalid",t),p=f=s=null;for(v in l)if(l.hasOwnProperty(v)&&(j=l[v],j!=null))switch(v){case"value":s=j;break;case"defaultValue":f=j;break;case"children":p=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(r(91));break;default:ut(t,n,v,j,l,null)}Ja(t,s,f,p);return;case"option":for(R in l)if(l.hasOwnProperty(R)&&(s=l[R],s!=null))switch(R){case"selected":t.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:ut(t,n,R,s,l,null)}return;case"dialog":Ye("beforetoggle",t),Ye("toggle",t),Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":Ye("load",t);break;case"video":case"audio":for(s=0;s<Ps.length;s++)Ye(Ps[s],t);break;case"image":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"embed":case"source":case"link":Ye("error",t),Ye("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(Y in l)if(l.hasOwnProperty(Y)&&(s=l[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ut(t,n,Y,s,l,null)}return;default:if(ya(n)){for(J in l)l.hasOwnProperty(J)&&(s=l[J],s!==void 0&&pf(t,n,J,s,l,void 0));return}}for(j in l)l.hasOwnProperty(j)&&(s=l[j],s!=null&&ut(t,n,j,s,l,null))}function Sw(t,n,l,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,p=null,v=null,j=null,R=null,Y=null,J=null;for(W in l){var le=l[W];if(l.hasOwnProperty(W)&&le!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":R=le;default:s.hasOwnProperty(W)||ut(t,n,W,null,s,le)}}for(var F in s){var W=s[F];if(le=l[F],s.hasOwnProperty(F)&&(W!=null||le!=null))switch(F){case"type":p=W;break;case"name":f=W;break;case"checked":Y=W;break;case"defaultChecked":J=W;break;case"value":v=W;break;case"defaultValue":j=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,n));break;default:W!==le&&ut(t,n,F,W,s,le)}}ga(t,v,j,R,Y,J,p,f);return;case"select":W=v=j=F=null;for(p in l)if(R=l[p],l.hasOwnProperty(p)&&R!=null)switch(p){case"value":break;case"multiple":W=R;default:s.hasOwnProperty(p)||ut(t,n,p,null,s,R)}for(f in s)if(p=s[f],R=l[f],s.hasOwnProperty(f)&&(p!=null||R!=null))switch(f){case"value":F=p;break;case"defaultValue":j=p;break;case"multiple":v=p;default:p!==R&&ut(t,n,f,p,s,R)}n=j,l=v,s=W,F!=null?Jt(t,!!l,F,!1):!!s!=!!l&&(n!=null?Jt(t,!!l,n,!0):Jt(t,!!l,l?[]:"",!1));return;case"textarea":W=F=null;for(j in l)if(f=l[j],l.hasOwnProperty(j)&&f!=null&&!s.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:ut(t,n,j,null,s,f)}for(v in s)if(f=s[v],p=l[v],s.hasOwnProperty(v)&&(f!=null||p!=null))switch(v){case"value":F=f;break;case"defaultValue":W=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==p&&ut(t,n,v,f,s,p)}pi(t,F,W);return;case"option":for(var ve in l)if(F=l[ve],l.hasOwnProperty(ve)&&F!=null&&!s.hasOwnProperty(ve))switch(ve){case"selected":t.selected=!1;break;default:ut(t,n,ve,null,s,F)}for(R in s)if(F=s[R],W=l[R],s.hasOwnProperty(R)&&F!==W&&(F!=null||W!=null))switch(R){case"selected":t.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:ut(t,n,R,F,s,W)}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 Re in l)F=l[Re],l.hasOwnProperty(Re)&&F!=null&&!s.hasOwnProperty(Re)&&ut(t,n,Re,null,s,F);for(Y in s)if(F=s[Y],W=l[Y],s.hasOwnProperty(Y)&&F!==W&&(F!=null||W!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(137,n));break;default:ut(t,n,Y,F,s,W)}return;default:if(ya(n)){for(var ct in l)F=l[ct],l.hasOwnProperty(ct)&&F!==void 0&&!s.hasOwnProperty(ct)&&pf(t,n,ct,void 0,s,F);for(J in s)F=s[J],W=l[J],!s.hasOwnProperty(J)||F===W||F===void 0&&W===void 0||pf(t,n,J,F,s,W);return}}for(var B in l)F=l[B],l.hasOwnProperty(B)&&F!=null&&!s.hasOwnProperty(B)&&ut(t,n,B,null,s,F);for(le in s)F=s[le],W=l[le],!s.hasOwnProperty(le)||F===W||F==null&&W==null||ut(t,n,le,F,s,W)}function Eg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),s=0;s<l.length;s++){var f=l[s],p=f.transferSize,v=f.initiatorType,j=f.duration;if(p&&j&&Eg(v)){for(v=0,j=f.responseEnd,s+=1;s<l.length;s++){var R=l[s],Y=R.startTime;if(Y>j)break;var J=R.transferSize,le=R.initiatorType;J&&Eg(le)&&(R=R.responseEnd,v+=J*(R<j?1:(j-Y)/(R-Y)))}if(--s,n+=8*(p+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 hf=null,mf=null;function Vu(t){return t.nodeType===9?t:t.ownerDocument}function Tg(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 Ag(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 gf(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 yf=null;function Cw(){var t=window.event;return t&&t.type==="popstate"?t===yf?!1:(yf=t,!0):(yf=null,!1)}var Ng=typeof setTimeout=="function"?setTimeout:void 0,Ew=typeof clearTimeout=="function"?clearTimeout:void 0,_g=typeof Promise=="function"?Promise:void 0,Tw=typeof queueMicrotask=="function"?queueMicrotask:typeof _g<"u"?function(t){return _g.resolve(null).then(t).catch(Aw)}:Ng;function Aw(t){setTimeout(function(){throw t})}function ea(t){return t==="head"}function Dg(t,n){var l=n,s=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(s===0){t.removeChild(f),Vr(n);return}s--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")s++;else if(l==="html")Ws(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Ws(l);for(var p=l.firstChild;p;){var v=p.nextSibling,j=p.nodeName;p[vl]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&p.rel.toLowerCase()==="stylesheet"||l.removeChild(p),p=v}}else l==="body"&&Ws(t.ownerDocument.body);l=f}while(l);Vr(n)}function Mg(t,n){var l=t;t=0;do{var s=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),s&&s.nodeType===8)if(l=s.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=s}while(l)}function xf(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":xf(l),ei(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Nw(t,n,l,s){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(s){if(!t[vl])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(p=t.getAttribute("rel"),p==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(p!==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(p=t.getAttribute("src"),(p!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&p&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var p=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===p)return t}else return t;if(t=si(t.nextSibling),t===null)break}return null}function _w(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=si(t.nextSibling),t===null))return null;return t}function Og(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=si(t.nextSibling),t===null))return null;return t}function bf(t){return t.data==="$?"||t.data==="$~"}function vf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Dw(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var s=function(){n(),l.removeEventListener("DOMContentLoaded",s)};l.addEventListener("DOMContentLoaded",s),t._reactRetry=s}}function si(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 wf=null;function Rg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return si(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 Lg(t,n,l){switch(n=Vu(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 Ws(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);ei(t)}var oi=new Map,Ig=new Set;function Yu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var gl=ae.d;ae.d={f:Mw,r:Ow,D:Rw,C:zw,L:Lw,m:Iw,X:Bw,S:Uw,M:qw};function Mw(){var t=gl.f(),n=Lu();return t||n}function Ow(t){var n=$i(t);n!==null&&n.tag===5&&n.type==="form"?em(n):gl.r(t)}var Hr=typeof document>"u"?null:document;function Ug(t,n,l){var s=Hr;if(s&&typeof n=="string"&&n){var f=an(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Ig.has(f)||(Ig.add(f),t={rel:t,crossOrigin:l,href:n},s.querySelector(f)===null&&(n=s.createElement("link"),nn(n,"link",t),_t(n),s.head.appendChild(n)))}}function Rw(t){gl.D(t),Ug("dns-prefetch",t,null)}function zw(t,n){gl.C(t,n),Ug("preconnect",t,n)}function Lw(t,n,l){gl.L(t,n,l);var s=Hr;if(s&&t&&n){var f='link[rel="preload"][as="'+an(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+an(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+an(l.imageSizes)+'"]')):f+='[href="'+an(t)+'"]';var p=f;switch(n){case"style":p=$r(t);break;case"script":p=Gr(t)}oi.has(p)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),oi.set(p,t),s.querySelector(f)!==null||n==="style"&&s.querySelector(Xs(p))||n==="script"&&s.querySelector(Qs(p))||(n=s.createElement("link"),nn(n,"link",t),_t(n),s.head.appendChild(n)))}}function Iw(t,n){gl.m(t,n);var l=Hr;if(l&&t){var s=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+an(s)+'"][href="'+an(t)+'"]',p=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Gr(t)}if(!oi.has(p)&&(t=x({rel:"modulepreload",href:t},n),oi.set(p,t),l.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Qs(p)))return}s=l.createElement("link"),nn(s,"link",t),_t(s),l.head.appendChild(s)}}}function Uw(t,n,l){gl.S(t,n,l);var s=Hr;if(s&&t){var f=wl(s).hoistableStyles,p=$r(t);n=n||"default";var v=f.get(p);if(!v){var j={loading:0,preload:null};if(v=s.querySelector(Xs(p)))j.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=oi.get(p))&&kf(t,l);var R=v=s.createElement("link");_t(R),nn(R,"link",t),R._p=new Promise(function(Y,J){R.onload=Y,R.onerror=J}),R.addEventListener("load",function(){j.loading|=1}),R.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Fu(v,n,s)}v={type:"stylesheet",instance:v,count:1,state:j},f.set(p,v)}}}function Bw(t,n){gl.X(t,n);var l=Hr;if(l&&t){var s=wl(l).hoistableScripts,f=Gr(t),p=s.get(f);p||(p=l.querySelector(Qs(f)),p||(t=x({src:t,async:!0},n),(n=oi.get(f))&&Sf(t,n),p=l.createElement("script"),_t(p),nn(p,"link",t),l.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(f,p))}}function qw(t,n){gl.M(t,n);var l=Hr;if(l&&t){var s=wl(l).hoistableScripts,f=Gr(t),p=s.get(f);p||(p=l.querySelector(Qs(f)),p||(t=x({src:t,async:!0,type:"module"},n),(n=oi.get(f))&&Sf(t,n),p=l.createElement("script"),_t(p),nn(p,"link",t),l.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(f,p))}}function Bg(t,n,l,s){var f=(f=he.current)?Yu(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=$r(l.href),l=wl(f).hoistableStyles,s=l.get(n),s||(s={type:"style",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=$r(l.href);var p=wl(f).hoistableStyles,v=p.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,v),(p=f.querySelector(Xs(t)))&&!p._p&&(v.instance=p,v.state.loading=5),oi.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},oi.set(t,l),p||Hw(f,t,l,v.state))),n&&s===null)throw Error(r(528,""));return v}if(n&&s!==null)throw Error(r(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Gr(l),l=wl(f).hoistableScripts,s=l.get(n),s||(s={type:"script",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function $r(t){return'href="'+an(t)+'"'}function Xs(t){return'link[rel="stylesheet"]['+t+"]"}function qg(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Hw(t,n,l,s){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=t.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),nn(n,"link",l),_t(n),t.head.appendChild(n))}function Gr(t){return'[src="'+an(t)+'"]'}function Qs(t){return"script[async]"+t}function Hg(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var s=t.querySelector('style[data-href~="'+an(l.href)+'"]');if(s)return n.instance=s,_t(s),s;var f=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),_t(s),nn(s,"style",f),Fu(s,l.precedence,t),n.instance=s;case"stylesheet":f=$r(l.href);var p=t.querySelector(Xs(f));if(p)return n.state.loading|=4,n.instance=p,_t(p),p;s=qg(l),(f=oi.get(f))&&kf(s,f),p=(t.ownerDocument||t).createElement("link"),_t(p);var v=p;return v._p=new Promise(function(j,R){v.onload=j,v.onerror=R}),nn(p,"link",s),n.state.loading|=4,Fu(p,l.precedence,t),n.instance=p;case"script":return p=Gr(l.src),(f=t.querySelector(Qs(p)))?(n.instance=f,_t(f),f):(s=l,(f=oi.get(p))&&(s=x({},l),Sf(s,f)),t=t.ownerDocument||t,f=t.createElement("script"),_t(f),nn(f,"link",s),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&&(s=n.instance,n.state.loading|=4,Fu(s,l.precedence,t));return n.instance}function Fu(t,n,l){for(var s=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=s.length?s[s.length-1]:null,p=f,v=0;v<s.length;v++){var j=s[v];if(j.dataset.precedence===n)p=j;else if(p!==f)break}p?p.parentNode.insertBefore(t,p.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function kf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Sf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Pu=null;function $g(t,n,l){if(Pu===null){var s=new Map,f=Pu=new Map;f.set(l,s)}else f=Pu,s=f.get(l),s||(s=new Map,f.set(l,s));if(s.has(t))return s;for(s.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var p=l[f];if(!(p[vl]||p[Ht]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var v=p.getAttribute(n)||"";v=t+v;var j=s.get(v);j?j.push(p):s.set(v,[p])}}return s}function Gg(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function $w(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 Vg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Gw(t,n,l,s){if(l.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=$r(s.href),p=n.querySelector(Xs(f));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Ku.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=p,_t(p);return}p=n.ownerDocument||n,s=qg(s),(f=oi.get(f))&&kf(s,f),p=p.createElement("link"),_t(p);var v=p;v._p=new Promise(function(j,R){v.onload=j,v.onerror=R}),nn(p,"link",s),l.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Ku.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var jf=0;function Vw(t,n){return t.stylesheets&&t.count===0&&Xu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var s=setTimeout(function(){if(t.stylesheets&&Xu(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+n);0<t.imgBytes&&jf===0&&(jf=62500*jw());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Xu(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>jf?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function Ku(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Wu=null;function Xu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Wu=new Map,n.forEach(Yw,t),Wu=null,Ku.call(t))}function Yw(t,n){if(!(n.state.loading&4)){var l=Wu.get(t);if(l)var s=l.get(null);else{l=new Map,Wu.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<f.length;p++){var v=f[p];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),s=v)}s&&l.set(null,s)}f=n.instance,v=f.getAttribute("data-precedence"),p=l.get(v)||s,p===s&&l.set(null,f),l.set(v,f),this.count++,s=Ku.bind(this),f.addEventListener("load",s),f.addEventListener("error",s),p?p.parentNode.insertBefore(f,p.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var Zs={$$typeof:G,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function Fw(t,n,l,s,f,p,v,j,R){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=Qa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qa(0),this.hiddenUpdates=Qa(null),this.identifierPrefix=s,this.onUncaughtError=f,this.onCaughtError=p,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Yg(t,n,l,s,f,p,v,j,R,Y,J,le){return t=new Fw(t,n,l,v,R,Y,J,le,j),n=1,p===!0&&(n|=24),p=Ft(3,null,null,n),t.current=p,p.stateNode=t,n=nd(),n.refCount++,t.pooledCache=n,n.refCount++,p.memoizedState={element:s,isDehydrated:l,cache:n},rd(p),t}function Fg(t){return t?(t=Ll,t):Ll}function Pg(t,n,l,s,f,p){f=Fg(f),s.context===null?s.context=f:s.pendingContext=f,s=Gl(n),s.payload={element:l},p=p===void 0?null:p,p!==null&&(s.callback=p),l=Vl(t,s,n),l!==null&&(zn(l,t,n),_s(l,t,n))}function Kg(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Cf(t,n){Kg(t,n),(t=t.alternate)&&Kg(t,n)}function Wg(t){if(t.tag===13||t.tag===31){var n=il(t,67108864);n!==null&&zn(n,t,67108864),Cf(t,67108864)}}function Xg(t){if(t.tag===13||t.tag===31){var n=Wn();n=Ei(n);var l=il(t,n);l!==null&&zn(l,t,n),Cf(t,n)}}var Qu=!0;function Pw(t,n,l,s){var f=$.T;$.T=null;var p=ae.p;try{ae.p=2,Ef(t,n,l,s)}finally{ae.p=p,$.T=f}}function Kw(t,n,l,s){var f=$.T;$.T=null;var p=ae.p;try{ae.p=8,Ef(t,n,l,s)}finally{ae.p=p,$.T=f}}function Ef(t,n,l,s){if(Qu){var f=Tf(s);if(f===null)ff(t,n,s,Zu,l),Zg(t,s);else if(Xw(f,t,n,l,s))s.stopPropagation();else if(Zg(t,s),n&4&&-1<Ww.indexOf(t)){for(;f!==null;){var p=$i(f);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var v=ji(p.pendingLanes);if(v!==0){var j=p;for(j.pendingLanes|=2,j.entangledLanes|=2;v;){var R=1<<31-tt(v);j.entanglements[1]|=R,v&=~R}zi(p),(it&6)===0&&(Ru=Nt()+500,Fs(0))}}break;case 31:case 13:j=il(p,2),j!==null&&zn(j,p,2),Lu(),Cf(p,2)}if(p=Tf(s),p===null&&ff(t,n,s,Zu,l),p===f)break;f=p}f!==null&&s.stopPropagation()}else ff(t,n,s,null,l)}}function Tf(t){return t=El(t),Af(t)}var Zu=null;function Af(t){if(Zu=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=h(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 Zu=t,null}function Qg(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(wi()){case ne:return 2;case se:return 8;case Oe:case Ge:return 32;case Qe:return 268435456;default:return 32}default:return 32}}var Nf=!1,ta=null,na=null,ia=null,Js=new Map,eo=new Map,la=[],Ww="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Zg(t,n){switch(t){case"focusin":case"focusout":ta=null;break;case"dragenter":case"dragleave":na=null;break;case"mouseover":case"mouseout":ia=null;break;case"pointerover":case"pointerout":Js.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":eo.delete(n.pointerId)}}function to(t,n,l,s,f,p){return t===null||t.nativeEvent!==p?(t={blockedOn:n,domEventName:l,eventSystemFlags:s,nativeEvent:p,targetContainers:[f]},n!==null&&(n=$i(n),n!==null&&Wg(n)),t):(t.eventSystemFlags|=s,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function Xw(t,n,l,s,f){switch(n){case"focusin":return ta=to(ta,t,n,l,s,f),!0;case"dragenter":return na=to(na,t,n,l,s,f),!0;case"mouseover":return ia=to(ia,t,n,l,s,f),!0;case"pointerover":var p=f.pointerId;return Js.set(p,to(Js.get(p)||null,t,n,l,s,f)),!0;case"gotpointercapture":return p=f.pointerId,eo.set(p,to(eo.get(p)||null,t,n,l,s,f)),!0}return!1}function Jg(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,Za(t.priority,function(){Xg(l)});return}}else if(n===31){if(n=h(l),n!==null){t.blockedOn=n,Za(t.priority,function(){Xg(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 Ju(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Tf(t.nativeEvent);if(l===null){l=t.nativeEvent;var s=new l.constructor(l.type,l);tr=s,l.target.dispatchEvent(s),tr=null}else return n=$i(l),n!==null&&Wg(n),t.blockedOn=l,!1;n.shift()}return!0}function ey(t,n,l){Ju(t)&&l.delete(n)}function Qw(){Nf=!1,ta!==null&&Ju(ta)&&(ta=null),na!==null&&Ju(na)&&(na=null),ia!==null&&Ju(ia)&&(ia=null),Js.forEach(ey),eo.forEach(ey)}function ec(t,n){t.blockedOn===n&&(t.blockedOn=null,Nf||(Nf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Qw)))}var tc=null;function ty(t){tc!==t&&(tc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){tc===t&&(tc=null);for(var n=0;n<t.length;n+=3){var l=t[n],s=t[n+1],f=t[n+2];if(typeof s!="function"){if(Af(s||l)===null)continue;break}var p=$i(l);p!==null&&(t.splice(n,3),n-=3,Ed(p,{pending:!0,data:f,method:l.method,action:s},s,f))}}))}function Vr(t){function n(R){return ec(R,t)}ta!==null&&ec(ta,t),na!==null&&ec(na,t),ia!==null&&ec(ia,t),Js.forEach(n),eo.forEach(n);for(var l=0;l<la.length;l++){var s=la[l];s.blockedOn===t&&(s.blockedOn=null)}for(;0<la.length&&(l=la[0],l.blockedOn===null);)Jg(l),l.blockedOn===null&&la.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(s=0;s<l.length;s+=3){var f=l[s],p=l[s+1],v=f[Lt]||null;if(typeof p=="function")v||ty(l);else if(v){var j=null;if(p&&p.hasAttribute("formAction")){if(f=p,v=p[Lt]||null)j=v.formAction;else if(Af(f)!==null)continue}else j=v.action;typeof j=="function"?l[s+1]=j:(l.splice(s,3),s-=3),ty(l)}}}function ny(){function t(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),s||setTimeout(l,20)}function l(){if(!s&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){s=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function _f(t){this._internalRoot=t}nc.prototype.render=_f.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,s=Wn();Pg(l,s,t,n,null,null)},nc.prototype.unmount=_f.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Pg(t.current,2,null,t,null,null),Lu(),n[Ai]=null}};function nc(t){this._internalRoot=t}nc.prototype.unstable_scheduleHydration=function(t){if(t){var n=Hi();t={blockedOn:null,target:t,priority:n};for(var l=0;l<la.length&&n!==0&&n<la[l].priority;l++);la.splice(l,0,t),l===0&&Jg(t)}};var iy=i.version;if(iy!=="19.2.7")throw Error(r(527,iy,"19.2.7"));ae.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 Zw={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ic.isDisabled&&ic.supportsFiber)try{Xt=ic.inject(Zw),Ct=ic}catch{}}return io.createRoot=function(t,n){if(!u(t))throw Error(r(299));var l=!1,s="",f=cm,p=dm,v=fm;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=Yg(t,1,!1,null,null,l,s,null,f,p,v,ny),t[Ai]=n.current,df(t),new _f(n)},io.hydrateRoot=function(t,n,l){if(!u(t))throw Error(r(299));var s=!1,f="",p=cm,v=dm,j=fm,R=null;return l!=null&&(l.unstable_strictMode===!0&&(s=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(p=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(j=l.onRecoverableError),l.formState!==void 0&&(R=l.formState)),n=Yg(t,1,!0,n,l??null,s,f,R,p,v,j,ny),n.context=Fg(null),l=n.current,s=Wn(),s=Ei(s),f=Gl(s),f.callback=null,Vl(l,f,s),l=s,n.current.lanes=l,fa(n,l),zi(n),t[Ai]=n.current,df(t),new nc(n)},io.version="19.2.7",io}var hy;function fk(){if(hy)return Of.exports;hy=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(),Of.exports=dk(),Of.exports}var pk=fk();function hk(e,i){const a=i||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const mk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yk={};function my(e,i){return(yk.jsx?gk:mk).test(e)}const xk=/[ \t\n\f\r]/g;function bk(e){return typeof e=="object"?e.type==="text"?gy(e.value):!1:gy(e)}function gy(e){return e.replace(xk,"")===""}class Ao{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}Ao.prototype.normal={};Ao.prototype.property={};Ao.prototype.space=void 0;function Yx(e,i){const a={},r={};for(const u of e)Object.assign(a,u.property),Object.assign(r,u.normal);return new Ao(a,r,i)}function xp(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 vk=0;const Ie=Wa(),qt=Wa(),bp=Wa(),ue=Wa(),pt=Wa(),Fa=Wa(),Xn=Wa();function Wa(){return 2**++vk}const vp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:qt,commaOrSpaceSeparated:Xn,commaSeparated:Fa,number:ue,overloadedBoolean:bp,spaceSeparated:pt},Symbol.toStringTag,{value:"Module"})),If=Object.keys(vp);class Bp extends In{constructor(i,a,r,u){let c=-1;if(super(i,a),yy(this,"space",u),typeof r=="number")for(;++c<If.length;){const d=If[c];yy(this,If[c],(r&vp[d])===vp[d])}}}Bp.prototype.defined=!0;function yy(e,i,a){a&&(e[i]=a)}function Qr(e){const i={},a={};for(const[r,u]of Object.entries(e.properties)){const c=new Bp(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[xp(r)]=r,a[xp(c.attribute)]=r}return new Ao(i,a,e.space)}const Fx=Qr({properties:{ariaActiveDescendant:null,ariaAtomic:qt,ariaAutoComplete:null,ariaBusy:qt,ariaChecked:qt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:pt,ariaCurrent:null,ariaDescribedBy:pt,ariaDetails:null,ariaDisabled:qt,ariaDropEffect:pt,ariaErrorMessage:null,ariaExpanded:qt,ariaFlowTo:pt,ariaGrabbed:qt,ariaHasPopup:null,ariaHidden:qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pt,ariaLevel:ue,ariaLive:null,ariaModal:qt,ariaMultiLine:qt,ariaMultiSelectable:qt,ariaOrientation:null,ariaOwns:pt,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:qt,ariaReadOnly:qt,ariaRelevant:null,ariaRequired:qt,ariaRoleDescription:pt,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:qt,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Px(e,i){return i in e?e[i]:i}function Kx(e,i){return Px(e,i.toLowerCase())}const wk=Qr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fa,acceptCharset:pt,accessKey:pt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:pt,autoFocus:Ie,autoPlay:Ie,blocking:pt,capture:null,charSet:null,checked:Ie,cite:null,className:pt,closedBy:null,colorSpace:null,cols:ue,colSpan:ue,command:null,commandFor:null,content:null,contentEditable:qt,controls:Ie,controlsList:pt,coords:ue|Fa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:bp,draggable:qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:pt,height:ue,hidden:bp,high:ue,href:null,hrefLang:null,htmlFor:pt,httpEquiv:pt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:pt,itemRef:pt,itemScope:Ie,itemType:pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,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:ue,pattern:null,ping:pt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:pt,required:Ie,reversed:Ie,rows:ue,rowSpan:ue,sandbox:pt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:qt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pt,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,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:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:qt,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:Fa,part:pt,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:Kx}),kk=Qr({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:Xn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:pt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,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:Fa,g2:Fa,glyphName:Fa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:Xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,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:ue,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:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xn,rev:Xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xn,requiredFeatures:Xn,requiredFonts:Xn,requiredFormats:Xn,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:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:Xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Px}),Wx=Qr({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()}}),Xx=Qr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Kx}),Qx=Qr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),Sk={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"},jk=/[A-Z]/g,xy=/-[a-z]/g,Ck=/^data[-\w.:]+$/i;function Ek(e,i){const a=xp(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"&&Ck.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(xy,Ak);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!xy.test(c)){let d=c.replace(jk,Tk);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=Bp}return new u(r,i)}function Tk(e){return"-"+e.toLowerCase()}function Ak(e){return e.charAt(1).toUpperCase()}const Nk=Yx([Fx,wk,Wx,Xx,Qx],"html"),qp=Yx([Fx,kk,Wx,Xx,Qx],"svg");function _k(e){return e.join(" ").trim()}var Yr={},Uf,by;function Dk(){if(by)return Uf;by=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,h=/^\s+|\s+$/g,g=`
|
|
51
|
+
`,m="/",b="*",x="",w="comment",S="declaration";function A(L,D){if(typeof L!="string")throw new TypeError("First argument must be a string");if(!L)return[];D=D||{};var X=1,G=1;function P(me){var re=me.match(i);re&&(X+=re.length);var $=me.lastIndexOf(g);G=~$?me.length-$:G+me.length}function de(){var me={line:X,column:G};return function(re){return re.position=new _(me),Q(),re}}function _(me){this.start=me,this.end={line:X,column:G},this.source=D.source}_.prototype.content=L;function K(me){var re=new Error(D.source+":"+X+":"+G+": "+me);if(re.reason=me,re.filename=D.source,re.line=X,re.column=G,re.source=L,!D.silent)throw re}function ee(me){var re=me.exec(L);if(re){var $=re[0];return P($),L=L.slice($.length),re}}function Q(){ee(a)}function H(me){var re;for(me=me||[];re=oe();)re!==!1&&me.push(re);return me}function oe(){var me=de();if(!(m!=L.charAt(0)||b!=L.charAt(1))){for(var re=2;x!=L.charAt(re)&&(b!=L.charAt(re)||m!=L.charAt(re+1));)++re;if(re+=2,x===L.charAt(re-1))return K("End of comment missing");var $=L.slice(2,re-2);return G+=2,P($),L=L.slice(re),G+=2,me({type:w,comment:$})}}function fe(){var me=de(),re=ee(r);if(re){if(oe(),!ee(u))return K("property missing ':'");var $=ee(c),ae=me({type:S,property:z(re[0].replace(e,x)),value:$?z($[0].replace(e,x)):x});return ee(d),ae}}function Se(){var me=[];H(me);for(var re;re=fe();)re!==!1&&(me.push(re),H(me));return me}return Q(),Se()}function z(L){return L?L.replace(h,x):x}return Uf=A,Uf}var vy;function Mk(){if(vy)return Yr;vy=1;var e=Yr&&Yr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.default=a;const i=e(Dk());function a(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),h=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;h?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return Yr}var lo={},wy;function Ok(){if(wy)return lo;wy=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.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()},h=function(m,b){return"".concat(b,"-")},g=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(u,h):m=m.replace(r,h),m.replace(i,d))};return lo.camelCase=g,lo}var ao,ky;function Rk(){if(ky)return ao;ky=1;var e=ao&&ao.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(Mk()),a=Ok();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(h,g){h&&g&&(d[(0,a.camelCase)(h,c)]=g)}),d}return r.default=r,ao=r,ao}var zk=Rk();const Lk=Vx(zk),Zx=Jx("end"),Hp=Jx("start");function Jx(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 Ik(e){const i=Hp(e),a=Zx(e);if(i&&a)return{start:i,end:a}}function xo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Sy(e.position):"start"in e||"end"in e?Sy(e):"line"in e||"column"in e?wp(e):""}function wp(e){return jy(e&&e.line)+":"+jy(e&&e.column)}function Sy(e){return wp(e&&e.start)+"-"+wp(e&&e.end)}function jy(e){return e&&typeof e=="number"?e:1}class cn extends Error{constructor(i,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let u="",c={},d=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c={...a}),typeof i=="string"?u=i:!c.cause&&i&&(d=!0,u=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?c.ruleId=r:(c.source=r.slice(0,g),c.ruleId=r.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const h=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=h?h.line:void 0,this.name=xo(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}cn.prototype.file="";cn.prototype.name="";cn.prototype.reason="";cn.prototype.message="";cn.prototype.stack="";cn.prototype.column=void 0;cn.prototype.line=void 0;cn.prototype.ancestors=void 0;cn.prototype.cause=void 0;cn.prototype.fatal=void 0;cn.prototype.place=void 0;cn.prototype.ruleId=void 0;cn.prototype.source=void 0;const $p={}.hasOwnProperty,Uk=new Map,Bk=/[A-Z]/g,qk=new Set(["table","tbody","thead","tfoot","tr"]),Hk=new Set(["td","th"]),eb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $k(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=Xk(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=Wk(a,i.jsx,i.jsxs)}const u={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:r,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?qp:Nk,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=tb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function tb(e,i,a){if(i.type==="element")return Gk(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return Vk(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return Fk(e,i,a);if(i.type==="mdxjsEsm")return Yk(e,i);if(i.type==="root")return Pk(e,i,a);if(i.type==="text")return Kk(e,i)}function Gk(e,i,a){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=qp,e.schema=u),e.ancestors.push(i);const c=ib(e,i.tagName,!1),d=Qk(e,i);let h=Vp(e,i);return qk.has(i.tagName)&&(h=h.filter(function(g){return typeof g=="string"?!bk(g):!0})),nb(e,d,c,i),Gp(d,h),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function Vk(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)}Co(e,i.position)}function Yk(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);Co(e,i.position)}function Fk(e,i,a){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=qp,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:ib(e,i.name,!0),d=Zk(e,i),h=Vp(e,i);return nb(e,d,c,i),Gp(d,h),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function Pk(e,i,a){const r={};return Gp(r,Vp(e,i)),e.create(i,e.Fragment,r,a)}function Kk(e,i){return i.value}function nb(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function Gp(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function Wk(e,i,a){return r;function r(u,c,d,h){const m=Array.isArray(d.children)?a:i;return h?m(c,d,h):m(c,d)}}function Xk(e,i){return a;function a(r,u,c,d){const h=Array.isArray(c.children),g=Hp(r);return i(u,c,d,h,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function Qk(e,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&$p.call(i.properties,u)){const c=Jk(e,u,i.properties[u]);if(c){const[d,h]=c;e.tableCellAlignToStyle&&d==="align"&&typeof h=="string"&&Hk.has(i.tagName)?r=h:a[d]=h}}if(r){const c=a.style||(a.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function Zk(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 h=d.properties[0];h.type,Object.assign(a,e.evaluater.evaluateExpression(h.argument))}else Co(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 h=r.value.data.estree.body[0];h.type,c=e.evaluater.evaluateExpression(h.expression)}else Co(e,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function Vp(e,i){const a=[];let r=-1;const u=e.passKeys?new Map:Uk;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 h=tb(e,c,d);h!==void 0&&a.push(h)}return a}function Jk(e,i,a){const r=Ek(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?hk(a):_k(a)),r.property==="style"){let u=typeof a=="object"?a:e1(e,String(a));return e.stylePropertyNameCase==="css"&&(u=t1(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?Sk[r.property]||r.property:r.attribute,a]}}function e1(e,i){try{return Lk(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,u=new cn("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=eb+"#cannot-parse-style-attribute",u}}function ib(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 h=my(u[c])?{type:"Identifier",name:u[c]}:{type:"Literal",value:u[c]};d=d?{type:"MemberExpression",object:d,property:h,computed:!!(c&&h.type==="Literal"),optional:!1}:h}r=d}else r=my(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return $p.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);Co(e)}function Co(e,i){const a=new cn("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=eb+"#cannot-handle-mdx-estrees-without-createevaluater",a}function t1(e){const i={};let a;for(a in e)$p.call(e,a)&&(i[n1(a)]=e[a]);return i}function n1(e){let i=e.replace(Bk,i1);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function i1(e){return"-"+e.toLowerCase()}const Bf={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"]},l1={};function Yp(e,i){const a=l1,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return lb(e,r,u)}function lb(e,i,a){if(a1(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 Cy(e.children,i,a)}return Array.isArray(e)?Cy(e,i,a):""}function Cy(e,i,a){const r=[];let u=-1;for(;++u<e.length;)r[u]=lb(e[u],i,a);return r.join("")}function a1(e){return!!(e&&typeof e=="object")}const Ey=document.createElement("i");function Fp(e){const i="&"+e+";";Ey.innerHTML=i;const a=Ey.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 ui(e,i){return e.length>0?(Zn(e,e.length,0,i),e):i}const Ty={}.hasOwnProperty;function ab(e){const i={};let a=-1;for(;++a<e.length;)r1(i,e[a]);return i}function r1(e,i){let a;for(a in i){const u=(Ty.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){Ty.call(u,d)||(u[d]=[]);const h=c[d];s1(u[d],Array.isArray(h)?h:h?[h]:[])}}}function s1(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 rb(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 bi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xn=ca(/[A-Za-z]/),un=ca(/[\dA-Za-z]/),o1=ca(/[#-'*+\--9=?A-Z^-~]/);function vc(e){return e!==null&&(e<32||e===127)}const kp=ca(/\d/),u1=ca(/[\dA-Fa-f]/),c1=ca(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function Fe(e){return e===-2||e===-1||e===32}const Nc=ca(new RegExp("\\p{P}|\\p{S}","u")),Pa=ca(/\s/);function ca(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Zr(e){const i=[];let a=-1,r=0,u=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&un(e.charCodeAt(a+1))&&un(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 h=e.charCodeAt(a+1);c<56320&&h>56319&&h<57344?(d=String.fromCharCode(c,h),u=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(e.slice(r,a),encodeURIComponent(d)),r=a+u+1,d=""),u&&(a+=u,u=0)}return i.join("")+e.slice(r)}function Xe(e,i,a,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return Fe(g)?(e.enter(a),h(g)):i(g)}function h(g){return Fe(g)&&c++<u?(e.consume(g),h):(e.exit(a),i(g))}}const d1={tokenize:f1};function f1(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let a;return i;function r(h){if(h===null){e.consume(h);return}return e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Xe(e,i,"linePrefix")}function u(h){return e.enter("paragraph"),c(h)}function c(h){const g=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=g),a=g,d(h)}function d(h){if(h===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(h);return}return Me(h)?(e.consume(h),e.exit("chunkText"),c):(e.consume(h),d)}}const p1={tokenize:h1},Ay={tokenize:m1};function h1(e){const i=this,a=[];let r=0,u,c,d;return h;function h(G){if(r<a.length){const P=a[r];return i.containerState=P[1],e.attempt(P[0].continuation,g,m)(G)}return m(G)}function g(G){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&X();const P=i.events.length;let de=P,_;for(;de--;)if(i.events[de][0]==="exit"&&i.events[de][1].type==="chunkFlow"){_=i.events[de][1].end;break}D(r);let K=P;for(;K<i.events.length;)i.events[K][1].end={..._},K++;return Zn(i.events,de+1,0,i.events.slice(P)),i.events.length=K,m(G)}return h(G)}function m(G){if(r===a.length){if(!u)return w(G);if(u.currentConstruct&&u.currentConstruct.concrete)return A(G);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Ay,b,x)(G)}function b(G){return u&&X(),D(r),w(G)}function x(G){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,A(G)}function w(G){return i.containerState={},e.attempt(Ay,S,A)(G)}function S(G){return r++,a.push([i.currentConstruct,i.containerState]),w(G)}function A(G){if(G===null){u&&X(),D(0),e.consume(G);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),z(G)}function z(G){if(G===null){L(e.exit("chunkFlow"),!0),D(0),e.consume(G);return}return Me(G)?(e.consume(G),L(e.exit("chunkFlow")),r=0,i.interrupt=void 0,h):(e.consume(G),z)}function L(G,P){const de=i.sliceStream(G);if(P&&de.push(null),G.previous=c,c&&(c.next=G),c=G,u.defineSkip(G.start),u.write(de),i.parser.lazy[G.start.line]){let _=u.events.length;for(;_--;)if(u.events[_][1].start.offset<d&&(!u.events[_][1].end||u.events[_][1].end.offset>d))return;const K=i.events.length;let ee=K,Q,H;for(;ee--;)if(i.events[ee][0]==="exit"&&i.events[ee][1].type==="chunkFlow"){if(Q){H=i.events[ee][1].end;break}Q=!0}for(D(r),_=K;_<i.events.length;)i.events[_][1].end={...H},_++;Zn(i.events,ee+1,0,i.events.slice(K)),i.events.length=_}}function D(G){let P=a.length;for(;P-- >G;){const de=a[P];i.containerState=de[1],de[0].exit.call(i,e)}a.length=G}function X(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function m1(e,i,a){return Xe(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xr(e){if(e===null||ht(e)||Pa(e))return 1;if(Nc(e))return 2}function _c(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 Sp={name:"attention",resolveAll:g1,tokenize:y1};function g1(e,i){let a=-1,r,u,c,d,h,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},w={...e[a][1].start};Ny(x,-g),Ny(w,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},h={type:g>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:w},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:{...h.end}},e[r][1].end={...d.start},e[a][1].start={...h.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=ui(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=ui(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=ui(m,_c(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),m=ui(m,[["exit",c,i],["enter",h,i],["exit",h,i],["exit",u,i]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,m=ui(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 y1(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=Xr(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),h(g)}function h(g){if(g===c)return e.consume(g),h;const m=e.exit("attentionSequence"),b=Xr(g),x=!b||b===2&&u||a.includes(g),w=!u||u===2&&b||a.includes(r);return m._open=!!(c===42?x:x&&(u||!w)),m._close=!!(c===42?w:w&&(b||!x)),i(g)}}function Ny(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const x1={name:"autolink",tokenize:b1};function b1(e,i,a){let r=0;return u;function u(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(S){return xn(S)?(e.consume(S),d):S===64?a(S):m(S)}function d(S){return S===43||S===45||S===46||un(S)?(r=1,h(S)):m(S)}function h(S){return S===58?(e.consume(S),r=0,g):(S===43||S===45||S===46||un(S))&&r++<32?(e.consume(S),h):(r=0,m(S))}function g(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),i):S===null||S===32||S===60||vc(S)?a(S):(e.consume(S),g)}function m(S){return S===64?(e.consume(S),b):o1(S)?(e.consume(S),m):a(S)}function b(S){return un(S)?x(S):a(S)}function x(S){return S===46?(e.consume(S),r=0,b):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),i):w(S)}function w(S){if((S===45||un(S))&&r++<63){const A=S===45?w:x;return e.consume(S),A}return a(S)}}const No={partial:!0,tokenize:v1};function v1(e,i,a){return r;function r(c){return Fe(c)?Xe(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Me(c)?i(c):a(c)}}const sb={continuation:{tokenize:k1},exit:S1,name:"blockQuote",tokenize:w1};function w1(e,i,a){const r=this;return u;function u(d){if(d===62){const h=r.containerState;return h.open||(e.enter("blockQuote",{_container:!0}),h.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return a(d)}function c(d){return Fe(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function k1(e,i,a){const r=this;return u;function u(d){return Fe(d)?Xe(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(sb,i,a)(d)}}function S1(e){e.exit("blockQuote")}const ob={name:"characterEscape",tokenize:j1};function j1(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 c1(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const ub={name:"characterReference",tokenize:C1};function C1(e,i,a){const r=this;let u=0,c,d;return h;function h(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=un,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=u1,b):(e.enter("characterReferenceValue"),c=7,d=kp,b(x))}function b(x){if(x===59&&u){const w=e.exit("characterReferenceValue");return d===un&&!Fp(r.sliceSerialize(w))?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 _y={partial:!0,tokenize:T1},Dy={concrete:!0,name:"codeFenced",tokenize:E1};function E1(e,i,a){const r=this,u={partial:!0,tokenize:de};let c=0,d=0,h;return g;function g(_){return m(_)}function m(_){const K=r.events[r.events.length-1];return c=K&&K[1].type==="linePrefix"?K[2].sliceSerialize(K[1],!0).length:0,h=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(_)}function b(_){return _===h?(d++,e.consume(_),b):d<3?a(_):(e.exit("codeFencedFenceSequence"),Fe(_)?Xe(e,x,"whitespace")(_):x(_))}function x(_){return _===null||Me(_)?(e.exit("codeFencedFence"),r.interrupt?i(_):e.check(_y,z,P)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===null||Me(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(_)):Fe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xe(e,S,"whitespace")(_)):_===96&&_===h?a(_):(e.consume(_),w)}function S(_){return _===null||Me(_)?x(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),A(_))}function A(_){return _===null||Me(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(_)):_===96&&_===h?a(_):(e.consume(_),A)}function z(_){return e.attempt(u,P,L)(_)}function L(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),D}function D(_){return c>0&&Fe(_)?Xe(e,X,"linePrefix",c+1)(_):X(_)}function X(_){return _===null||Me(_)?e.check(_y,z,P)(_):(e.enter("codeFlowValue"),G(_))}function G(_){return _===null||Me(_)?(e.exit("codeFlowValue"),X(_)):(e.consume(_),G)}function P(_){return e.exit("codeFenced"),i(_)}function de(_,K,ee){let Q=0;return H;function H(re){return _.enter("lineEnding"),_.consume(re),_.exit("lineEnding"),oe}function oe(re){return _.enter("codeFencedFence"),Fe(re)?Xe(_,fe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):fe(re)}function fe(re){return re===h?(_.enter("codeFencedFenceSequence"),Se(re)):ee(re)}function Se(re){return re===h?(Q++,_.consume(re),Se):Q>=d?(_.exit("codeFencedFenceSequence"),Fe(re)?Xe(_,me,"whitespace")(re):me(re)):ee(re)}function me(re){return re===null||Me(re)?(_.exit("codeFencedFence"),K(re)):ee(re)}}}function T1(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 qf={name:"codeIndented",tokenize:N1},A1={partial:!0,tokenize:_1};function N1(e,i,a){const r=this;return u;function u(m){return e.enter("codeIndented"),Xe(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):Me(m)?e.attempt(A1,d,g)(m):(e.enter("codeFlowValue"),h(m))}function h(m){return m===null||Me(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),h)}function g(m){return e.exit("codeIndented"),i(m)}}function _1(e,i,a){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?a(d):Me(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):Xe(e,c,"linePrefix",5)(d)}function c(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?i(d):Me(d)?u(d):a(d)}}const D1={name:"codeText",previous:O1,resolve:M1,tokenize:R1};function M1(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 O1(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function R1(e,i,a){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),h(x)}function h(x){return x===96?(e.consume(x),r++,h):(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)):Me(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||Me(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 z1{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(i,r):i>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(i,a,r){const u=a||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&ro(this.left,r),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),ro(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),ro(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const a=this.left.splice(i,Number.POSITIVE_INFINITY);ro(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);ro(this.left,a.reverse())}}}function ro(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 cb(e){const i={};let a=-1,r,u,c,d,h,g,m;const b=new z1(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,L1(b,a)),a=i[a],m=!0);else if(r[1]._container){for(c=a,u=void 0;c--;)if(d=b.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),d[1].type="lineEnding",u=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;u&&(r[1].end={...b.get(u)[1].start},h=b.slice(u,a),h.unshift(r),b.splice(u,a-u+1,h))}}return Zn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function L1(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 h=d.events,g=[],m={};let b,x,w=-1,S=a,A=0,z=0;const L=[z];for(;S;){for(;e.get(++u)[1]!==S;);c.push(u),S._tokenizer||(b=r.sliceStream(S),S.next||b.push(null),x&&d.defineSkip(S.start),S._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),S._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=S,S=S.next}for(S=a;++w<h.length;)h[w][0]==="exit"&&h[w-1][0]==="enter"&&h[w][1].type===h[w-1][1].type&&h[w][1].start.line!==h[w][1].end.line&&(z=w+1,L.push(z),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(d.events=[],S?(S._tokenizer=void 0,S.previous=void 0):L.pop(),w=L.length;w--;){const D=h.slice(L[w],L[w+1]),X=c.pop();g.push([X,X+D.length-1]),e.splice(X,2,D)}for(g.reverse(),w=-1;++w<g.length;)m[A+g[w][0]]=A+g[w][1],A+=g[w][1]-g[w][0]-1;return m}const I1={resolve:B1,tokenize:q1},U1={partial:!0,tokenize:H1};function B1(e){return cb(e),e}function q1(e,i){let a;return r;function r(h){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),u(h)}function u(h){return h===null?c(h):Me(h)?e.check(U1,d,c)(h):(e.consume(h),u)}function c(h){return e.exit("chunkContent"),e.exit("content"),i(h)}function d(h){return e.consume(h),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function H1(e,i,a){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Xe(e,c,"linePrefix")}function c(d){if(d===null||Me(d))return a(d);const h=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?i(d):e.interrupt(r.parser.constructs.flow,a,i)(d)}}function db(e,i,a,r,u,c,d,h,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(D){return D===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(D),e.exit(c),w):D===null||D===32||D===41||vc(D)?a(D):(e.enter(r),e.enter(d),e.enter(h),e.enter("chunkString",{contentType:"string"}),z(D))}function w(D){return D===62?(e.enter(c),e.consume(D),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(h),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===62?(e.exit("chunkString"),e.exit(h),w(D)):D===null||D===60||Me(D)?a(D):(e.consume(D),D===92?A:S)}function A(D){return D===60||D===62||D===92?(e.consume(D),S):S(D)}function z(D){return!b&&(D===null||D===41||ht(D))?(e.exit("chunkString"),e.exit(h),e.exit(d),e.exit(r),i(D)):b<m&&D===40?(e.consume(D),b++,z):D===41?(e.consume(D),b--,z):D===null||D===32||D===40||vc(D)?a(D):(e.consume(D),D===92?L:z)}function L(D){return D===40||D===41||D===92?(e.consume(D),z):z(D)}}function fb(e,i,a,r,u,c){const d=this;let h=0,g;return m;function m(S){return e.enter(r),e.enter(u),e.consume(S),e.exit(u),e.enter(c),b}function b(S){return h>999||S===null||S===91||S===93&&!g||S===94&&!h&&"_hiddenFootnoteSupport"in d.parser.constructs?a(S):S===93?(e.exit(c),e.enter(u),e.consume(S),e.exit(u),e.exit(r),i):Me(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===null||S===91||S===93||Me(S)||h++>999?(e.exit("chunkString"),b(S)):(e.consume(S),g||(g=!Fe(S)),S===92?w:x)}function w(S){return S===91||S===92||S===93?(e.consume(S),h++,x):x(S)}}function pb(e,i,a,r,u,c){let d;return h;function h(w){return w===34||w===39||w===40?(e.enter(r),e.enter(u),e.consume(w),e.exit(u),d=w===40?41:w,g):a(w)}function g(w){return w===d?(e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):(e.enter(c),m(w))}function m(w){return w===d?(e.exit(c),g(d)):w===null?a(w):Me(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),Xe(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(w))}function b(w){return w===d||w===null||Me(w)?(e.exit("chunkString"),m(w)):(e.consume(w),w===92?x:b)}function x(w){return w===d||w===92?(e.consume(w),b):b(w)}}function bo(e,i){let a;return r;function r(u){return Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a=!0,r):Fe(u)?Xe(e,r,a?"linePrefix":"lineSuffix")(u):i(u)}}const $1={name:"definition",tokenize:V1},G1={partial:!0,tokenize:Y1};function V1(e,i,a){const r=this;let u;return c;function c(S){return e.enter("definition"),d(S)}function d(S){return fb.call(r,e,h,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function h(S){return u=bi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),g):a(S)}function g(S){return ht(S)?bo(e,m)(S):m(S)}function m(S){return db(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function b(S){return e.attempt(G1,x,x)(S)}function x(S){return Fe(S)?Xe(e,w,"whitespace")(S):w(S)}function w(S){return S===null||Me(S)?(e.exit("definition"),r.parser.defined.push(u),i(S)):a(S)}}function Y1(e,i,a){return r;function r(h){return ht(h)?bo(e,u)(h):a(h)}function u(h){return pb(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function c(h){return Fe(h)?Xe(e,d,"whitespace")(h):d(h)}function d(h){return h===null||Me(h)?i(h):a(h)}}const F1={name:"hardBreakEscape",tokenize:P1};function P1(e,i,a){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Me(c)?(e.exit("hardBreakEscape"),i(c)):a(c)}}const K1={name:"headingAtx",resolve:W1,tokenize:X1};function W1(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 X1(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||ht(b)?(e.exit("atxHeadingSequence"),h(b)):a(b)}function h(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Me(b)?(e.exit("atxHeading"),i(b)):Fe(b)?Xe(e,h,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),h(b))}function m(b){return b===null||b===35||ht(b)?(e.exit("atxHeadingText"),h(b)):(e.consume(b),m)}}const Q1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],My=["pre","script","style","textarea"],Z1={concrete:!0,name:"htmlFlow",resolveTo:t0,tokenize:n0},J1={partial:!0,tokenize:l0},e0={partial:!0,tokenize:i0};function t0(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 n0(e,i,a){const r=this;let u,c,d,h,g;return m;function m(E){return b(E)}function b(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),x}function x(E){return E===33?(e.consume(E),w):E===47?(e.consume(E),c=!0,z):E===63?(e.consume(E),u=3,r.interrupt?i:N):xn(E)?(e.consume(E),d=String.fromCharCode(E),L):a(E)}function w(E){return E===45?(e.consume(E),u=2,S):E===91?(e.consume(E),u=5,h=0,A):xn(E)?(e.consume(E),u=4,r.interrupt?i:N):a(E)}function S(E){return E===45?(e.consume(E),r.interrupt?i:N):a(E)}function A(E){const te="CDATA[";return E===te.charCodeAt(h++)?(e.consume(E),h===te.length?r.interrupt?i:fe:A):a(E)}function z(E){return xn(E)?(e.consume(E),d=String.fromCharCode(E),L):a(E)}function L(E){if(E===null||E===47||E===62||ht(E)){const te=E===47,ge=d.toLowerCase();return!te&&!c&&My.includes(ge)?(u=1,r.interrupt?i(E):fe(E)):Q1.includes(d.toLowerCase())?(u=6,te?(e.consume(E),D):r.interrupt?i(E):fe(E)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(E):c?X(E):G(E))}return E===45||un(E)?(e.consume(E),d+=String.fromCharCode(E),L):a(E)}function D(E){return E===62?(e.consume(E),r.interrupt?i:fe):a(E)}function X(E){return Fe(E)?(e.consume(E),X):H(E)}function G(E){return E===47?(e.consume(E),H):E===58||E===95||xn(E)?(e.consume(E),P):Fe(E)?(e.consume(E),G):H(E)}function P(E){return E===45||E===46||E===58||E===95||un(E)?(e.consume(E),P):de(E)}function de(E){return E===61?(e.consume(E),_):Fe(E)?(e.consume(E),de):G(E)}function _(E){return E===null||E===60||E===61||E===62||E===96?a(E):E===34||E===39?(e.consume(E),g=E,K):Fe(E)?(e.consume(E),_):ee(E)}function K(E){return E===g?(e.consume(E),g=null,Q):E===null||Me(E)?a(E):(e.consume(E),K)}function ee(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ht(E)?de(E):(e.consume(E),ee)}function Q(E){return E===47||E===62||Fe(E)?G(E):a(E)}function H(E){return E===62?(e.consume(E),oe):a(E)}function oe(E){return E===null||Me(E)?fe(E):Fe(E)?(e.consume(E),oe):a(E)}function fe(E){return E===45&&u===2?(e.consume(E),$):E===60&&u===1?(e.consume(E),ae):E===62&&u===4?(e.consume(E),T):E===63&&u===3?(e.consume(E),N):E===93&&u===5?(e.consume(E),Te):Me(E)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(J1,q,Se)(E)):E===null||Me(E)?(e.exit("htmlFlowData"),Se(E)):(e.consume(E),fe)}function Se(E){return e.check(e0,me,q)(E)}function me(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),re}function re(E){return E===null||Me(E)?Se(E):(e.enter("htmlFlowData"),fe(E))}function $(E){return E===45?(e.consume(E),N):fe(E)}function ae(E){return E===47?(e.consume(E),d="",xe):fe(E)}function xe(E){if(E===62){const te=d.toLowerCase();return My.includes(te)?(e.consume(E),T):fe(E)}return xn(E)&&d.length<8?(e.consume(E),d+=String.fromCharCode(E),xe):fe(E)}function Te(E){return E===93?(e.consume(E),N):fe(E)}function N(E){return E===62?(e.consume(E),T):E===45&&u===2?(e.consume(E),N):fe(E)}function T(E){return E===null||Me(E)?(e.exit("htmlFlowData"),q(E)):(e.consume(E),T)}function q(E){return e.exit("htmlFlow"),i(E)}}function i0(e,i,a){const r=this;return u;function u(d){return Me(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 l0(e,i,a){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(No,i,a)}}const a0={name:"htmlText",tokenize:r0};function r0(e,i,a){const r=this;let u,c,d;return h;function h(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),g}function g(N){return N===33?(e.consume(N),m):N===47?(e.consume(N),de):N===63?(e.consume(N),G):xn(N)?(e.consume(N),ee):a(N)}function m(N){return N===45?(e.consume(N),b):N===91?(e.consume(N),c=0,A):xn(N)?(e.consume(N),X):a(N)}function b(N){return N===45?(e.consume(N),S):a(N)}function x(N){return N===null?a(N):N===45?(e.consume(N),w):Me(N)?(d=x,ae(N)):(e.consume(N),x)}function w(N){return N===45?(e.consume(N),S):x(N)}function S(N){return N===62?$(N):N===45?w(N):x(N)}function A(N){const T="CDATA[";return N===T.charCodeAt(c++)?(e.consume(N),c===T.length?z:A):a(N)}function z(N){return N===null?a(N):N===93?(e.consume(N),L):Me(N)?(d=z,ae(N)):(e.consume(N),z)}function L(N){return N===93?(e.consume(N),D):z(N)}function D(N){return N===62?$(N):N===93?(e.consume(N),D):z(N)}function X(N){return N===null||N===62?$(N):Me(N)?(d=X,ae(N)):(e.consume(N),X)}function G(N){return N===null?a(N):N===63?(e.consume(N),P):Me(N)?(d=G,ae(N)):(e.consume(N),G)}function P(N){return N===62?$(N):G(N)}function de(N){return xn(N)?(e.consume(N),_):a(N)}function _(N){return N===45||un(N)?(e.consume(N),_):K(N)}function K(N){return Me(N)?(d=K,ae(N)):Fe(N)?(e.consume(N),K):$(N)}function ee(N){return N===45||un(N)?(e.consume(N),ee):N===47||N===62||ht(N)?Q(N):a(N)}function Q(N){return N===47?(e.consume(N),$):N===58||N===95||xn(N)?(e.consume(N),H):Me(N)?(d=Q,ae(N)):Fe(N)?(e.consume(N),Q):$(N)}function H(N){return N===45||N===46||N===58||N===95||un(N)?(e.consume(N),H):oe(N)}function oe(N){return N===61?(e.consume(N),fe):Me(N)?(d=oe,ae(N)):Fe(N)?(e.consume(N),oe):Q(N)}function fe(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(e.consume(N),u=N,Se):Me(N)?(d=fe,ae(N)):Fe(N)?(e.consume(N),fe):(e.consume(N),me)}function Se(N){return N===u?(e.consume(N),u=void 0,re):N===null?a(N):Me(N)?(d=Se,ae(N)):(e.consume(N),Se)}function me(N){return N===null||N===34||N===39||N===60||N===61||N===96?a(N):N===47||N===62||ht(N)?Q(N):(e.consume(N),me)}function re(N){return N===47||N===62||ht(N)?Q(N):a(N)}function $(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),i):a(N)}function ae(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),xe}function xe(N){return Fe(N)?Xe(e,Te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):Te(N)}function Te(N){return e.enter("htmlTextData"),d(N)}}const Pp={name:"labelEnd",resolveAll:c0,resolveTo:d0,tokenize:f0},s0={tokenize:p0},o0={tokenize:h0},u0={tokenize:m0};function c0(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 d0(e,i){let a=e.length,r=0,u,c,d,h;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 h=[["enter",g,i],["enter",m,i]],h=ui(h,e.slice(c+1,c+r+3)),h=ui(h,[["enter",b,i]]),h=ui(h,_c(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),h=ui(h,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),h=ui(h,e.slice(d+1)),h=ui(h,[["exit",g,i]]),Zn(e,c,e.length,h),e}function f0(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 h;function h(w){return c?c._inactive?x(w):(d=r.parser.defined.includes(bi(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(w),e.exit("labelMarker"),e.exit("labelEnd"),g):a(w)}function g(w){return w===40?e.attempt(s0,b,d?b:x)(w):w===91?e.attempt(o0,b,d?m:x)(w):d?b(w):x(w)}function m(w){return e.attempt(u0,b,x)(w)}function b(w){return i(w)}function x(w){return c._balanced=!0,a(w)}}function p0(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 ht(x)?bo(e,c)(x):c(x)}function c(x){return x===41?b(x):db(e,d,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return ht(x)?bo(e,g)(x):b(x)}function h(x){return a(x)}function g(x){return x===34||x===39||x===40?pb(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return ht(x)?bo(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 h0(e,i,a){const r=this;return u;function u(h){return fb.call(r,e,c,d,"reference","referenceMarker","referenceString")(h)}function c(h){return r.parser.defined.includes(bi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(h):a(h)}function d(h){return a(h)}}function m0(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 g0={name:"labelStartImage",resolveAll:Pp.resolveAll,tokenize:y0};function y0(e,i,a){const r=this;return u;function u(h){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(h),e.exit("labelImageMarker"),c}function c(h){return h===91?(e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelImage"),d):a(h)}function d(h){return h===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(h):i(h)}}const x0={name:"labelStartLink",resolveAll:Pp.resolveAll,tokenize:b0};function b0(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 Hf={name:"lineEnding",tokenize:v0};function v0(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xe(e,i,"linePrefix")}}const pc={name:"thematicBreak",tokenize:w0};function w0(e,i,a){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,h(m)}function h(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Me(m))?(e.exit("thematicBreak"),i(m)):a(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),Fe(m)?Xe(e,h,"whitespace")(m):h(m))}}const Ln={continuation:{tokenize:C0},exit:T0,name:"list",tokenize:j0},k0={partial:!0,tokenize:A0},S0={partial:!0,tokenize:E0};function j0(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 h;function h(S){const A=r.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(A==="listUnordered"?!r.containerState.marker||S===r.containerState.marker:kp(S)){if(r.containerState.type||(r.containerState.type=A,e.enter(A,{_container:!0})),A==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check(pc,a,m)(S):m(S);if(!r.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(S)}return a(S)}function g(S){return kp(S)&&++d<10?(e.consume(S),g):(!r.interrupt||d<2)&&(r.containerState.marker?S===r.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),m(S)):a(S)}function m(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||S,e.check(No,r.interrupt?a:b,e.attempt(k0,w,x))}function b(S){return r.containerState.initialBlankLine=!0,c++,w(S)}function x(S){return Fe(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),w):a(S)}function w(S){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(S)}}function C0(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(No,u,c);function u(h){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xe(e,i,"listItemIndent",r.containerState.size+1)(h)}function c(h){return r.containerState.furtherBlankLines||!Fe(h)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(h)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(S0,i,d)(h))}function d(h){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xe(e,e.attempt(Ln,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function E0(e,i,a){const r=this;return Xe(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 T0(e){e.exit(this.containerState.type)}function A0(e,i,a){const r=this;return Xe(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!Fe(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):a(c)}}const Oy={name:"setextUnderline",resolveTo:N0,tokenize:_0};function N0(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 _0(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"),h(m)}function h(m){return m===u?(e.consume(m),h):(e.exit("setextHeadingLineSequence"),Fe(m)?Xe(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Me(m)?(e.exit("setextHeadingLine"),i(m)):a(m)}}const D0={tokenize:M0};function M0(e){const i=this,a=e.attempt(No,r,e.attempt(this.parser.constructs.flowInitial,u,Xe(e,e.attempt(this.parser.constructs.flow,u,e.attempt(I1,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 O0={resolveAll:mb()},R0=hb("string"),z0=hb("text");function hb(e){return{resolveAll:mb(e==="text"?L0:void 0),tokenize:i};function i(a){const r=this,u=this.parser.constructs[e],c=a.attempt(u,d,h);return d;function d(b){return m(b)?c(b):h(b)}function h(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),g}function g(b){return m(b)?(a.exit("data"),c(b)):(a.consume(b),g)}function m(b){if(b===null)return!0;const x=u[b];let w=-1;if(x)for(;++w<x.length;){const S=x[w];if(!S.previous||S.previous.call(r,r.previous))return!0}return!1}}}function mb(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 L0(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,h=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)h++,d--;if(d)break;d=-1}else if(m===-2)g=!0,h++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(h=0),h){const m={type:a===e.length||g||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-h,offset:r.end.offset-h},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(a,0,["enter",m,i],["exit",m,i]),a+=2)}a++}return e}const I0={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:sb},U0={91:$1},B0={[-2]:qf,[-1]:qf,32:qf},q0={35:K1,42:pc,45:[Oy,pc],60:Z1,61:Oy,95:pc,96:Dy,126:Dy},H0={38:ub,92:ob},$0={[-5]:Hf,[-4]:Hf,[-3]:Hf,33:g0,38:ub,42:Sp,60:[x1,a0],91:x0,92:[F1,ob],93:Pp,95:Sp,96:D1},G0={null:[Sp,O0]},V0={null:[42,95]},Y0={null:[]},F0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:V0,contentInitial:U0,disable:Y0,document:I0,flow:q0,flowInitial:B0,insideSpan:G0,string:H0,text:$0},Symbol.toStringTag,{value:"Module"}));function P0(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=[],h=[];const g={attempt:K(de),check:K(_),consume:X,enter:G,exit:P,interrupt:K(_,{interrupt:!0})},m={code:null,containerState:{},defineSkip:z,events:[],now:A,parser:e,previous:null,sliceSerialize:w,sliceStream:S,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(oe){return d=ui(d,oe),L(),d[d.length-1]!==null?[]:(ee(i,0),m.events=_c(c,m.events,m),m.events)}function w(oe,fe){return W0(S(oe),fe)}function S(oe){return K0(d,oe)}function A(){const{_bufferIndex:oe,_index:fe,line:Se,column:me,offset:re}=r;return{_bufferIndex:oe,_index:fe,line:Se,column:me,offset:re}}function z(oe){u[oe.line]=oe.column,H()}function L(){let oe;for(;r._index<d.length;){const fe=d[r._index];if(typeof fe=="string")for(oe=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===oe&&r._bufferIndex<fe.length;)D(fe.charCodeAt(r._bufferIndex));else D(fe)}}function D(oe){b=b(oe)}function X(oe){Me(oe)?(r.line++,r.column=1,r.offset+=oe===-3?2:1,H()):oe!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=oe}function G(oe,fe){const Se=fe||{};return Se.type=oe,Se.start=A(),m.events.push(["enter",Se,m]),h.push(Se),Se}function P(oe){const fe=h.pop();return fe.end=A(),m.events.push(["exit",fe,m]),fe}function de(oe,fe){ee(oe,fe.from)}function _(oe,fe){fe.restore()}function K(oe,fe){return Se;function Se(me,re,$){let ae,xe,Te,N;return Array.isArray(me)?q(me):"tokenize"in me?q([me]):T(me);function T(he){return be;function be(Le){const He=Le!==null&&he[Le],At=Le!==null&&he.null,St=[...Array.isArray(He)?He:He?[He]:[],...Array.isArray(At)?At:At?[At]:[]];return q(St)(Le)}}function q(he){return ae=he,xe=0,he.length===0?$:E(he[xe])}function E(he){return be;function be(Le){return N=Q(),Te=he,he.partial||(m.currentConstruct=he),he.name&&m.parser.constructs.disable.null.includes(he.name)?ge():he.tokenize.call(fe?Object.assign(Object.create(m),fe):m,g,te,ge)(Le)}}function te(he){return oe(Te,N),re}function ge(he){return N.restore(),++xe<ae.length?E(ae[xe]):$}}}function ee(oe,fe){oe.resolveAll&&!c.includes(oe)&&c.push(oe),oe.resolve&&Zn(m.events,fe,m.events.length-fe,oe.resolve(m.events.slice(fe),m)),oe.resolveTo&&(m.events=oe.resolveTo(m.events,m))}function Q(){const oe=A(),fe=m.previous,Se=m.currentConstruct,me=m.events.length,re=Array.from(h);return{from:me,restore:$};function $(){r=oe,m.previous=fe,m.currentConstruct=Se,m.events.length=me,h=re,H()}}function H(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function K0(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 h=d[0];typeof h=="string"?d[0]=h.slice(r):d.shift()}c>0&&d.push(e[u].slice(0,c))}return d}function W0(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
|
+
`;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 X0(e){const r={constructs:ab([F0,...(e||{}).extensions||[]]),content:u(d1),defined:[],document:u(p1),flow:u(D0),lazy:{},string:u(R0),text:u(z0)};return r;function u(c){return d;function d(h){return P0(r,c,h)}}}function Q0(e){for(;!cb(e););return e}const Ry=/[\0\t\n\r]/g;function Z0(){let e=1,i="",a=!0,r;return u;function u(c,d,h){const g=[];let m,b,x,w,S;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),x=0,i="",a&&(c.charCodeAt(0)===65279&&x++,a=void 0);x<c.length;){if(Ry.lastIndex=x,m=Ry.exec(c),w=m&&m.index!==void 0?m.index:c.length,S=c.charCodeAt(w),!m){i=c.slice(x);break}if(S===10&&x===w&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<w&&(g.push(c.slice(x,w)),e+=w-x),S){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=w+1}return h&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const J0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eS(e){return e.replace(J0,tS)}function tS(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),c=u===120||u===88;return rb(a.slice(c?2:1),c?16:10)}return Fp(a)||e}const gb={}.hasOwnProperty;function nS(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),iS(a)(Q0(X0(a).document().write(Z0()(e,i,!0))))}function iS(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Un),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:c(vn),blockQuote:c(At),characterEscape:Q,characterReference:Q,codeFenced:c(St),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(St,d),codeText:c(dn,d),codeTextData:Q,data:Q,codeFlowValue:Q,definition:c(bn),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(jt),hardBreakEscape:c(ze),hardBreakTrailing:c(ze),htmlFlow:c(Gt,d),htmlFlowData:Q,htmlText:c(Gt,d),htmlTextData:Q,image:c(Jn),label:d,link:c(Un),listItem:c(yt),listItemValue:w,listOrdered:c(di,x),listUnordered:c(di),paragraph:c(Vt),reference:E,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(vn),strong:c(vi),thematicBreak:c(wi)},exit:{atxHeading:g(),atxHeadingSequence:de,autolink:g(),autolinkEmail:He,autolinkProtocol:Le,blockQuote:g(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:he,characterReference:be,codeFenced:g(L),codeFencedFence:z,codeFencedFenceInfo:S,codeFencedFenceMeta:A,codeFlowValue:H,codeIndented:g(D),codeText:g(re),codeTextData:H,data:H,definition:g(),definitionDestinationString:P,definitionLabelString:X,definitionTitleString:G,emphasis:g(),hardBreakEscape:g(fe),hardBreakTrailing:g(fe),htmlFlow:g(Se),htmlFlowData:H,htmlText:g(me),htmlTextData:H,image:g(ae),label:Te,labelText:xe,lineEnding:oe,link:g($),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:te,resourceDestinationString:N,resourceTitleString:T,resource:q,setextHeading:g(ee),setextHeadingLineSequence:K,setextHeadingText:_,strong:g(),thematicBreak:g()}};yb(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ne){let se={type:"root",children:[]};const Oe={stack:[se],tokenStack:[],config:i,enter:h,exit:m,buffer:d,resume:b,data:a},Ge=[];let Qe=-1;for(;++Qe<ne.length;)if(ne[Qe][1].type==="listOrdered"||ne[Qe][1].type==="listUnordered")if(ne[Qe][0]==="enter")Ge.push(Qe);else{const fn=Ge.pop();Qe=u(ne,fn,Qe)}for(Qe=-1;++Qe<ne.length;){const fn=i[ne[Qe][0]];gb.call(fn,ne[Qe][1].type)&&fn[ne[Qe][1].type].call(Object.assign({sliceSerialize:ne[Qe][2].sliceSerialize},Oe),ne[Qe][1])}if(Oe.tokenStack.length>0){const fn=Oe.tokenStack[Oe.tokenStack.length-1];(fn[1]||zy).call(Oe,void 0,fn[0])}for(se.position={start:ra(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ra(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Qe=-1;++Qe<i.transforms.length;)se=i.transforms[Qe](se)||se;return se}function u(ne,se,Oe){let Ge=se-1,Qe=-1,fn=!1,fi,Xt,Ct,Qt;for(;++Ge<=Oe;){const tt=ne[Ge];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?Qe++:Qe--,Qt=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&(fi&&!Qt&&!Qe&&!Ct&&(Ct=Ge),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=void 0}if(!Qe&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Qe===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if(fi){let zt=Ge;for(Xt=void 0;zt--;){const Yt=ne[zt];if(Yt[1].type==="lineEnding"||Yt[1].type==="lineEndingBlank"){if(Yt[0]==="exit")continue;Xt&&(ne[Xt][1].type="lineEndingBlank",fn=!0),Yt[1].type="lineEnding",Xt=zt}else if(!(Yt[1].type==="linePrefix"||Yt[1].type==="blockQuotePrefix"||Yt[1].type==="blockQuotePrefixWhitespace"||Yt[1].type==="blockQuoteMarker"||Yt[1].type==="listItemIndent"))break}Ct&&(!Xt||Ct<Xt)&&(fi._spread=!0),fi.end=Object.assign({},Xt?ne[Xt][1].start:tt[1].end),ne.splice(Xt||Ge,0,["exit",fi,tt[2]]),Ge++,Oe++}if(tt[1].type==="listItemPrefix"){const zt={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};fi=zt,ne.splice(Ge,0,["enter",zt,tt[2]]),Ge++,Oe++,Ct=void 0,Qt=!0}}}return ne[se][1]._spread=fn,Oe}function c(ne,se){return Oe;function Oe(Ge){h.call(this,ne(Ge),Ge),se&&se.call(this,Ge)}}function d(){this.stack.push({type:"fragment",children:[]})}function h(ne,se,Oe){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([se,Oe||void 0]),ne.position={start:ra(se.start),end:void 0}}function g(ne){return se;function se(Oe){ne&&ne.call(this,Oe),m.call(this,Oe)}}function m(ne,se){const Oe=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==ne.type&&(se?se.call(this,ne,Ge[0]):(Ge[1]||zy).call(this,ne,Ge[0]));else throw new Error("Cannot close `"+ne.type+"` ("+xo({start:ne.start,end:ne.end})+"): it’s not open");Oe.position.end=ra(ne.end)}function b(){return Yp(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function w(ne){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function S(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.lang=ne}function A(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.meta=ne}function z(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function L(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function D(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.value=ne.replace(/(\r?\n|\r)$/g,"")}function X(ne){const se=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=se,Oe.identifier=bi(this.sliceSerialize(ne)).toLowerCase()}function G(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.title=ne}function P(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.url=ne}function de(ne){const se=this.stack[this.stack.length-1];if(!se.depth){const Oe=this.sliceSerialize(ne).length;se.depth=Oe}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function K(ne){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function ee(){this.data.setextHeadingSlurpLineEnding=void 0}function Q(ne){const Oe=this.stack[this.stack.length-1].children;let Ge=Oe[Oe.length-1];(!Ge||Ge.type!=="text")&&(Ge=Nt(),Ge.position={start:ra(ne.start),end:void 0},Oe.push(Ge)),this.stack.push(Ge)}function H(ne){const se=this.stack.pop();se.value+=this.sliceSerialize(ne),se.position.end=ra(ne.end)}function oe(ne){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=se.children[se.children.length-1];Oe.position.end=ra(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(se.type)&&(Q.call(this,ne),H.call(this,ne))}function fe(){this.data.atHardBreak=!0}function Se(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.value=ne}function me(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.value=ne}function re(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.value=ne}function $(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=se,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function ae(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=se,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function xe(ne){const se=this.sliceSerialize(ne),Oe=this.stack[this.stack.length-2];Oe.label=eS(se),Oe.identifier=bi(se).toLowerCase()}function Te(){const ne=this.stack[this.stack.length-1],se=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const Ge=ne.children;Oe.children=Ge}else Oe.alt=se}function N(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.url=ne}function T(){const ne=this.resume(),se=this.stack[this.stack.length-1];se.title=ne}function q(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function te(ne){const se=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=se,Oe.identifier=bi(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function ge(ne){this.data.characterReferenceType=ne.type}function he(ne){const se=this.sliceSerialize(ne),Oe=this.data.characterReferenceType;let Ge;Oe?(Ge=rb(se,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Fp(se);const Qe=this.stack[this.stack.length-1];Qe.value+=Ge}function be(ne){const se=this.stack.pop();se.position.end=ra(ne.end)}function Le(ne){H.call(this,ne);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(ne)}function He(ne){H.call(this,ne);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(ne)}function At(){return{type:"blockquote",children:[]}}function St(){return{type:"code",lang:null,meta:null,value:""}}function dn(){return{type:"inlineCode",value:""}}function bn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function jt(){return{type:"emphasis",children:[]}}function vn(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function Gt(){return{type:"html",value:""}}function Jn(){return{type:"image",title:null,url:"",alt:null}}function Un(){return{type:"link",title:null,url:"",children:[]}}function di(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function yt(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function Vt(){return{type:"paragraph",children:[]}}function vi(){return{type:"strong",children:[]}}function Nt(){return{type:"text",value:""}}function wi(){return{type:"thematicBreak"}}}function ra(e){return{line:e.line,column:e.column,offset:e.offset}}function yb(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?yb(e,r):lS(e,r)}}function lS(e,i){let a;for(a in i)if(gb.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+"` ("+xo({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+xo({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+xo({start:i.start,end:i.end})+") is still open")}function aS(e){const i=this;i.parser=a;function a(r){return nS(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function rS(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 sS(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
|
|
54
|
+
`}]}function oS(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 uS(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function cS(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function dS(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=Zr(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,h=e.footnoteCounts.get(r);h===void 0?(h=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,h+=1,e.footnoteCounts.set(r,h);const g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+u,id:a+"fnref-"+u+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function fS(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 pS(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function xb(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 hS(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return xb(e,i);const u={src:Zr(r.url||""),alt:i.alt};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"img",properties:u,children:[]};return e.patch(i,c),e.applyData(i,c)}function mS(e,i){const a={src:Zr(i.url)};i.alt!==null&&i.alt!==void 0&&(a.alt=i.alt),i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(i,r),e.applyData(i,r)}function gS(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 yS(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return xb(e,i);const u={href:Zr(r.url||"")};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"a",properties:u,children:e.all(i)};return e.patch(i,c),e.applyData(i,c)}function xS(e,i){const a={href:Zr(i.url)};i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"a",properties:a,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function bS(e,i,a){const r=e.all(i),u=a?vS(a):bb(i),c={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let x;b&&b.type==="element"&&b.tagName==="p"?x=b:(x={type:"element",tagName:"p",properties:{},children:[]},r.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let h=-1;for(;++h<r.length;){const b=r[h];(u||h!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
|
|
56
|
+
`}),b.type==="element"&&b.tagName==="p"&&!u?d.push(...b.children):d.push(b)}const g=r[r.length-1];g&&(u||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
|
|
57
|
+
`});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function vS(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=bb(a[r])}return i}function bb(e){const i=e.spread;return i??e.children.length>1}function wS(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 kS(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function SS(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function jS(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function CS(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)},h=Hp(i.children[1]),g=Zx(i.children[i.children.length-1]);h&&g&&(d.position={start:h,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(u,!0)};return e.patch(i,c),e.applyData(i,c)}function ES(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,h=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<h;){const x=i.children[g],w={},S=d?d[g]:void 0;S&&(w.align=S);let A={type:"element",tagName:c,properties:w,children:[]};x&&(A.children=e.all(x),e.patch(x,A),A=e.applyData(x,A)),m.push(A)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function TS(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const Ly=9,Iy=32;function AS(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(Uy(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(Uy(i.slice(u),u>0,!1)),c.join("")}function Uy(e,i,a){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===Ly||c===Iy;)r++,c=e.codePointAt(r)}if(a){let c=e.codePointAt(u-1);for(;c===Ly||c===Iy;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function NS(e,i){const a={type:"text",value:AS(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function _S(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const DS={blockquote:rS,break:sS,code:oS,delete:uS,emphasis:cS,footnoteReference:dS,heading:fS,html:pS,imageReference:hS,image:mS,inlineCode:gS,linkReference:yS,link:xS,listItem:bS,list:wS,paragraph:kS,root:SS,strong:jS,table:CS,tableCell:TS,tableRow:ES,text:NS,thematicBreak:_S,toml:ac,yaml:ac,definition:ac,footnoteDefinition:ac};function ac(){}const vb=-1,Dc=0,vo=1,wc=2,Kp=3,Wp=4,Xp=5,Qp=6,wb=7,kb=8,MS=typeof self=="object"?self:globalThis,By=(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 MS[e](i)},OS=(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 Dc:case vb:return a(d,u);case vo:{const h=a([],u);for(const g of d)h.push(r(g));return h}case wc:{const h=a({},u);for(const[g,m]of d)h[r(g)]=r(m);return h}case Kp:return a(new Date(d),u);case Wp:{const{source:h,flags:g}=d;return a(new RegExp(h,g),u)}case Xp:{const h=a(new Map,u);for(const[g,m]of d)h.set(r(g),r(m));return h}case Qp:{const h=a(new Set,u);for(const g of d)h.add(r(g));return h}case wb:{const{name:h,message:g}=d;return a(By(h,g),u)}case kb:return a(BigInt(d),u);case"BigInt":return a(Object(BigInt(d)),u);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:h}=new Uint8Array(d);return a(new DataView(h),d)}}return a(By(c,d),u)};return r},qy=e=>OS(new Map,e)(0),Ga="",{toString:RS}={},{keys:zS}=Object,so=e=>{const i=typeof e;if(i!=="object"||!e)return[Dc,i];const a=RS.call(e).slice(8,-1);switch(a){case"Array":return[vo,Ga];case"Object":return[wc,Ga];case"Date":return[Kp,Ga];case"RegExp":return[Wp,Ga];case"Map":return[Xp,Ga];case"Set":return[Qp,Ga];case"DataView":return[vo,a]}return a.includes("Array")?[vo,a]:a.includes("Error")?[wb,a]:[wc,a]},rc=([e,i])=>e===Dc&&(i==="function"||i==="symbol"),LS=(e,i,a,r)=>{const u=(d,h)=>{const g=r.push(d)-1;return a.set(h,g),g},c=d=>{if(a.has(d))return a.get(d);let[h,g]=so(d);switch(h){case Dc:{let b=d;switch(g){case"bigint":h=kb,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([vb],d)}return u([h,b],d)}case vo:{if(g){let w=d;return g==="DataView"?w=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(w=new Uint8Array(d)),u([g,[...w]],d)}const b=[],x=u([h,b],d);for(const w of d)b.push(c(w));return x}case wc:{if(g)switch(g){case"BigInt":return u([g,d.toString()],d);case"Boolean":case"Number":case"String":return u([g,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const b=[],x=u([h,b],d);for(const w of zS(d))(e||!rc(so(d[w])))&&b.push([c(w),c(d[w])]);return x}case Kp:return u([h,isNaN(d.getTime())?Ga:d.toISOString()],d);case Wp:{const{source:b,flags:x}=d;return u([h,{source:b,flags:x}],d)}case Xp:{const b=[],x=u([h,b],d);for(const[w,S]of d)(e||!(rc(so(w))||rc(so(S))))&&b.push([c(w),c(S)]);return x}case Qp:{const b=[],x=u([h,b],d);for(const w of d)(e||!rc(so(w)))&&b.push(c(w));return x}}const{message:m}=d;return u([h,{name:g,message:m}],d)};return c},Hy=(e,{json:i,lossy:a}={})=>{const r=[];return LS(!(i||a),!!i,new Map,r)(e),r},kc=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?qy(Hy(e,i)):structuredClone(e):(e,i)=>qy(Hy(e,i));function IS(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 US(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function BS(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||IS,r=e.options.footnoteBackLabel||US,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},h=[];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(),w=Zr(x.toLowerCase());let S=0;const A=[],z=e.footnoteCounts.get(x);for(;z!==void 0&&++S<=z;){A.length>0&&A.push({type:"text",value:" "});let X=typeof a=="string"?a:a(g,S);typeof X=="string"&&(X={type:"text",value:X}),A.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+w+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,S),className:["data-footnote-backref"]},children:Array.isArray(X)?X:[X]})}const L=b[b.length-1];if(L&&L.type==="element"&&L.tagName==="p"){const X=L.children[L.children.length-1];X&&X.type==="text"?X.value+=" ":L.children.push({type:"text",value:" "}),L.children.push(...A)}else b.push(...A);const D={type:"element",tagName:"li",properties:{id:i+"fn-"+w},children:e.wrap(b,!0)};e.patch(m,D),h.push(D)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...kc(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
|
|
58
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(h,!0)},{type:"text",value:`
|
|
59
|
+
`}]}}const Mc=(function(e){if(e==null)return GS;if(typeof e=="function")return Oc(e);if(typeof e=="object")return Array.isArray(e)?qS(e):HS(e);if(typeof e=="string")return $S(e);throw new Error("Expected function, string, or object as test")});function qS(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=Mc(e[a]);return Oc(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function HS(e){const i=e;return Oc(a);function a(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function $S(e){return Oc(i);function i(a){return a&&a.type===e}}function Oc(e){return i;function i(a,r,u){return!!(VS(a)&&e.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function GS(){return!0}function VS(e){return e!==null&&typeof e=="object"&&"type"in e}const Sb=[],YS=!0,jp=!1,FS="skip";function jb(e,i,a,r){let u;typeof i=="function"&&typeof a!="function"?(r=a,a=i):u=i;const c=Mc(u),d=r?-1:1;h(e,void 0,[])();function h(g,m,b){const x=g&&typeof g=="object"?g:{};if(typeof x.type=="string"){const S=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(g.type+(S?"<"+S+">":""))+")"})}return w;function w(){let S=Sb,A,z,L;if((!i||c(g,m,b[b.length-1]||void 0))&&(S=PS(a(g,b)),S[0]===jp))return S;if("children"in g&&g.children){const D=g;if(D.children&&S[0]!==FS)for(z=(r?D.children.length:-1)+d,L=b.concat(D);z>-1&&z<D.children.length;){const X=D.children[z];if(A=h(X,z,L)(),A[0]===jp)return A;z=typeof A[1]=="number"?A[1]:z+d}}return S}}}function PS(e){return Array.isArray(e)?e:typeof e=="number"?[YS,e]:e==null?Sb:[e]}function Zp(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),jb(e,c,h,u);function h(g,m){const b=m[m.length-1],x=b?b.children.indexOf(g):void 0;return d(g,x,b)}}const Cp={}.hasOwnProperty,KS={};function WS(e,i){const a=i||KS,r=new Map,u=new Map,c=new Map,d={...DS,...a.handlers},h={all:m,applyData:QS,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:a,patch:XS,wrap:JS};return Zp(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,w=String(b.identifier).toUpperCase();x.has(w)||x.set(w,b)}}),h;function g(b,x){const w=b.type,S=h.handlers[w];if(Cp.call(h.handlers,w)&&S)return S(h,b,x);if(h.options.passThrough&&h.options.passThrough.includes(w)){if("children"in b){const{children:z,...L}=b,D=kc(L);return D.children=h.all(b),D}return kc(b)}return(h.options.unknownHandler||ZS)(h,b,x)}function m(b){const x=[];if("children"in b){const w=b.children;let S=-1;for(;++S<w.length;){const A=h.one(w[S],b);if(A){if(S&&w[S-1].type==="break"&&(!Array.isArray(A)&&A.type==="text"&&(A.value=$y(A.value)),!Array.isArray(A)&&A.type==="element")){const z=A.children[0];z&&z.type==="text"&&(z.value=$y(z.value))}Array.isArray(A)?x.push(...A):x.push(A)}}}return x}}function XS(e,i){e.position&&(i.position=Ik(e))}function QS(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,kc(c)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function ZS(e,i){const a=i.data||{},r="value"in i&&!(Cp.call(a,"hProperties")||Cp.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 JS(e,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
|
|
60
|
+
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
61
|
+
`}),a.push(e[r]);return i&&e.length>0&&a.push({type:"text",value:`
|
|
62
|
+
`}),a}function $y(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function Gy(e,i){const a=WS(e,i),r=a.one(e,void 0),u=BS(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 ej(e,i){return e&&"run"in e?async function(a,r){const u=Gy(a,{file:r,...i});await e.run(u,r)}:function(a,r){return Gy(a,{file:r,...e||i})}}function Vy(e){if(e)throw e}var $f,Yy;function tj(){if(Yy)return $f;Yy=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 w;for(w in m);return typeof w>"u"||e.call(m,w)},d=function(m,b){a&&b.name==="__proto__"?a(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},h=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return $f=function g(){var m,b,x,w,S,A,z=arguments[0],L=1,D=arguments.length,X=!1;for(typeof z=="boolean"&&(X=z,z=arguments[1]||{},L=2),(z==null||typeof z!="object"&&typeof z!="function")&&(z={});L<D;++L)if(m=arguments[L],m!=null)for(b in m)x=h(z,b),w=h(m,b),z!==w&&(X&&w&&(c(w)||(S=u(w)))?(S?(S=!1,A=x&&u(x)?x:[]):A=x&&c(x)?x:{},d(z,{name:b,newValue:g(X,A,w)})):typeof w<"u"&&d(z,{name:b,newValue:w}));return z},$f}var nj=tj();const Gf=Vx(nj);function Ep(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 ij(){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);h(null,...u);function h(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?lj(b,h)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function lj(e,i){let a;return r;function r(...d){const h=e.length>d.length;let g;h&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(h&&a)throw b;return u(b)}h||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...h){a||(a=!0,i(d,...h))}function c(d){u(null,d)}}const Ii={basename:aj,dirname:rj,extname:sj,join:oj,sep:"/"};function aj(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');_o(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,h=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else d<0&&(c=!0,d=u+1),h>-1&&(e.codePointAt(u)===i.codePointAt(h--)?h<0&&(r=u):(h=-1,r=d));return a===r?r=d:r<0&&(r=e.length),e.slice(a,r)}function rj(e){if(_o(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 sj(e){_o(e);let i=e.length,a=-1,r=0,u=-1,c=0,d;for(;i--;){const h=e.codePointAt(i);if(h===47){if(d){r=i+1;break}continue}a<0&&(d=!0,a=i+1),h===46?u<0?u=i:c!==1&&(c=1):u>-1&&(c=-1)}return u<0||a<0||c===0||c===1&&u===a-1&&u===r+1?"":e.slice(u,a)}function oj(...e){let i=-1,a;for(;++i<e.length;)_o(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":uj(a)}function uj(e){_o(e);const i=e.codePointAt(0)===47;let a=cj(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function cj(e,i){let a="",r=0,u=-1,c=0,d=-1,h,g;for(;++d<=e.length;){if(d<e.length)h=e.codePointAt(d);else{if(h===47)break;h=47}if(h===47){if(!(u===d-1||c===1))if(u!==d-1&&c===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(g=a.lastIndexOf("/"),g!==a.length-1){g<0?(a="",r=0):(a=a.slice(0,g),r=a.length-1-a.lastIndexOf("/")),u=d,c=0;continue}}else if(a.length>0){a="",r=0,u=d,c=0;continue}}i&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(u+1,d):a=e.slice(u+1,d),r=d-u-1;u=d,c=0}else h===46&&c>-1?c++:c=-1}return a}function _o(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dj={cwd:fj};function fj(){return"/"}function Tp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pj(e){if(typeof e=="string")e=new URL(e);else if(!Tp(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 hj(e)}function hj(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 Vf=["history","path","basename","stem","extname","dirname"];class Cb{constructor(i){let a;i?Tp(i)?a={path:i}:typeof i=="string"||mj(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":dj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Vf.length;){const c=Vf[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)Vf.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?Ii.basename(this.path):void 0}set basename(i){Ff(i,"basename"),Yf(i,"basename"),this.path=Ii.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ii.dirname(this.path):void 0}set dirname(i){Fy(this.basename,"dirname"),this.path=Ii.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ii.extname(this.path):void 0}set extname(i){if(Yf(i,"extname"),Fy(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ii.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Tp(i)&&(i=pj(i)),Ff(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ii.basename(this.path,this.extname):void 0}set stem(i){Ff(i,"stem"),Yf(i,"stem"),this.path=Ii.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 cn(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 Yf(e,i){if(e&&e.includes(Ii.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ii.sep+"`")}function Ff(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function Fy(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function mj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gj=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),yj={}.hasOwnProperty;class Jp extends gj{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=ij()}copy(){const i=new Jp;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(Gf(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(Wf("data",this.frozen),this.namespace[i]=a,this):yj.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Wf("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=sc(i),r=this.parser||this.Parser;return Pf("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),Pf("process",this.parser||this.Parser),Kf("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const h=sc(i),g=r.parse(h);r.run(g,h,function(b,x,w){if(b||!x||!w)return m(b);const S=x,A=r.stringify(S,w);vj(A)?w.value=A:w.result=A,m(b,w)});function m(b,x){b||!x?d(b):c?c(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),Pf("processSync",this.parser||this.Parser),Kf("processSync",this.compiler||this.Compiler),this.process(i,u),Ky("processSync","process",a),r;function u(c,d){a=!0,Vy(c),r=d}}run(i,a,r){Py(i),this.freeze();const u=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?c(void 0,r):new Promise(c);function c(d,h){const g=sc(a);u.run(i,g,m);function m(b,x,w){const S=x||i;b?h(b):d?d(S):r(void 0,S,w)}}}runSync(i,a){let r=!1,u;return this.run(i,a,c),Ky("runSync","run",r),u;function c(d,h){Vy(d),u=h,r=!0}}stringify(i,a){this.freeze();const r=sc(a),u=this.compiler||this.Compiler;return Kf("stringify",u),Py(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(Wf("use",this.frozen),i!=null)if(typeof i=="function")g(i,a);else if(typeof i=="object")Array.isArray(i)?h(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;g(b,x)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");h(m.plugins),m.settings&&(u.settings=Gf(!0,u.settings,m.settings))}function h(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const x=m[b];c(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function g(m,b){let x=-1,w=-1;for(;++x<r.length;)if(r[x][0]===m){w=x;break}if(w===-1)r.push([m,...b]);else if(b.length>0){let[S,...A]=b;const z=r[w][1];Ep(z)&&Ep(S)&&(S=Gf(!0,z,S)),r[w]=[m,S,...A]}}}}const xj=new Jp().freeze();function Pf(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Kf(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wf(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 Py(e){if(!Ep(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ky(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function sc(e){return bj(e)?e:new Cb(e)}function bj(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vj(e){return typeof e=="string"||wj(e)}function wj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Wy=[],Xy={allowDangerousHtml:!0},Sj=/^(https?|ircs?|mailto|xmpp)$/i,jj=[{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 Cj(e){const i=Ej(e),a=Tj(e);return Aj(i.runSync(i.parse(a),a),e)}function Ej(e){const i=e.rehypePlugins||Wy,a=e.remarkPlugins||Wy,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Xy}:Xy;return xj().use(aS).use(a).use(ej,r).use(i)}function Tj(e){const i=e.children||"",a=new Cb;return typeof i=="string"&&(a.value=i),a}function Aj(e,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,h=i.unwrapDisallowed,g=i.urlTransform||Nj;for(const b of jj)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+kj+b.id,void 0);return Zp(e,m),$k(e,{Fragment:o.Fragment,components:u,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function m(b,x,w){if(b.type==="raw"&&w&&typeof x=="number")return d?w.children.splice(x,1):w.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let S;for(S in Bf)if(Object.hasOwn(Bf,S)&&Object.hasOwn(b.properties,S)){const A=b.properties[S],z=Bf[S];(z===null||z.includes(b.tagName))&&(b.properties[S]=g(String(A||""),S,b))}}if(b.type==="element"){let S=a?!a.includes(b.tagName):c?c.includes(b.tagName):!1;if(!S&&r&&typeof x=="number"&&(S=!r(b,x,w)),S&&w&&typeof x=="number")return h&&b.children?w.children.splice(x,1,...b.children):w.children.splice(x,1),x}}}function Nj(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||Sj.test(e.slice(0,i))?e:""}function Qy(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 _j(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Dj(e,i,a){const u=Mc((a||{}).ignore||[]),c=Mj(i);let d=-1;for(;++d<c.length;)jb(e,"text",h);function h(m,b){let x=-1,w;for(;++x<b.length;){const S=b[x],A=w?w.children:void 0;if(u(S,A?A.indexOf(S):void 0,w))return;w=S}if(w)return g(m,b)}function g(m,b){const x=b[b.length-1],w=c[d][0],S=c[d][1];let A=0;const L=x.children.indexOf(m);let D=!1,X=[];w.lastIndex=0;let G=w.exec(m.value);for(;G;){const P=G.index,de={index:G.index,input:G.input,stack:[...b,m]};let _=S(...G,de);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?w.lastIndex=P+1:(A!==P&&X.push({type:"text",value:m.value.slice(A,P)}),Array.isArray(_)?X.push(..._):_&&X.push(_),A=P+G[0].length,D=!0),!w.global)break;G=w.exec(m.value)}return D?(A<m.value.length&&X.push({type:"text",value:m.value.slice(A)}),x.children.splice(L,1,...X)):X=[m],L+X.length}}function Mj(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([Oj(u[0]),Rj(u[1])])}return i}function Oj(e){return typeof e=="string"?new RegExp(_j(e),"g"):e}function Rj(e){return typeof e=="function"?e:function(){return e}}const Xf="phrasing",Qf=["autolink","link","image","label"];function zj(){return{transforms:[$j],enter:{literalAutolink:Ij,literalAutolinkEmail:Zf,literalAutolinkHttp:Zf,literalAutolinkWww:Zf},exit:{literalAutolink:Hj,literalAutolinkEmail:qj,literalAutolinkHttp:Uj,literalAutolinkWww:Bj}}}function Lj(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Xf,notInConstruct:Qf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Xf,notInConstruct:Qf},{character:":",before:"[ps]",after:"\\/",inConstruct:Xf,notInConstruct:Qf}]}}function Ij(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Zf(e){this.config.enter.autolinkProtocol.call(this,e)}function Uj(e){this.config.exit.autolinkProtocol.call(this,e)}function Bj(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 qj(e){this.config.exit.autolinkEmail.call(this,e)}function Hj(e){this.exit(e)}function $j(e){Dj(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Gj],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Vj]],{ignore:["link","linkReference"]})}function Gj(e,i,a,r,u){let c="";if(!Eb(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!Yj(a)))return!1;const d=Fj(a+r);if(!d[0])return!1;const h={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[h,{type:"text",value:d[1]}]:h}function Vj(e,i,a,r){return!Eb(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function Yj(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 Fj(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=Qy(e,"(");let c=Qy(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 Eb(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Pa(a)||Nc(a))&&(!i||a!==47)}Tb.peek=tC;function Pj(){this.buffer()}function Kj(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Wj(){this.buffer()}function Xj(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Qj(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=bi(this.sliceSerialize(e)).toLowerCase(),a.label=i}function Zj(e){this.exit(e)}function Jj(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=bi(this.sliceSerialize(e)).toLowerCase(),a.label=i}function eC(e){this.exit(e)}function tC(){return"["}function Tb(e,i,a,r){const u=a.createTracker(r);let c=u.move("[^");const d=a.enter("footnoteReference"),h=a.enter("reference");return c+=u.move(a.safe(a.associationId(e),{after:"]",before:c})),h(),d(),c+=u.move("]"),c}function nC(){return{enter:{gfmFootnoteCallString:Pj,gfmFootnoteCall:Kj,gfmFootnoteDefinitionLabelString:Wj,gfmFootnoteDefinition:Xj},exit:{gfmFootnoteCallString:Qj,gfmFootnoteCall:Zj,gfmFootnoteDefinitionLabelString:Jj,gfmFootnoteDefinition:eC}}}function iC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:Tb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const h=c.createTracker(d);let g=h.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=h.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=h.move("]:"),r.children&&r.children.length>0&&(h.shift(4),g+=h.move((i?`
|
|
64
|
+
`:" ")+c.indentLines(c.containerFlow(r,h.current()),i?Ab:lC))),m(),g}}function lC(e,i,a){return i===0?e:Ab(e,i,a)}function Ab(e,i,a){return(a?"":" ")+e}const aC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Nb.peek=cC;function rC(){return{canContainEols:["delete"],enter:{strikethrough:oC},exit:{strikethrough:uC}}}function sC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:aC}],handlers:{delete:Nb}}}function oC(e){this.enter({type:"delete",children:[]},e)}function uC(e){this.exit(e)}function Nb(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 cC(){return"~"}function dC(e){return e.length}function fC(e,i){const a=i||{},r=(a.align||[]).concat(),u=a.stringLength||dC,c=[],d=[],h=[],g=[];let m=0,b=-1;for(;++b<e.length;){const z=[],L=[];let D=-1;for(e[b].length>m&&(m=e[b].length);++D<e[b].length;){const X=pC(e[b][D]);if(a.alignDelimiters!==!1){const G=u(X);L[D]=G,(g[D]===void 0||G>g[D])&&(g[D]=G)}z.push(X)}d[b]=z,h[b]=L}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=Zy(r[x]);else{const z=Zy(r);for(;++x<m;)c[x]=z}x=-1;const w=[],S=[];for(;++x<m;){const z=c[x];let L="",D="";z===99?(L=":",D=":"):z===108?L=":":z===114&&(D=":");let X=a.alignDelimiters===!1?1:Math.max(1,g[x]-L.length-D.length);const G=L+"-".repeat(X)+D;a.alignDelimiters!==!1&&(X=L.length+X+D.length,X>g[x]&&(g[x]=X),S[x]=X),w[x]=G}d.splice(1,0,w),h.splice(1,0,S),b=-1;const A=[];for(;++b<d.length;){const z=d[b],L=h[b];x=-1;const D=[];for(;++x<m;){const X=z[x]||"";let G="",P="";if(a.alignDelimiters!==!1){const de=g[x]-(L[x]||0),_=c[x];_===114?G=" ".repeat(de):_===99?de%2?(G=" ".repeat(de/2+.5),P=" ".repeat(de/2-.5)):(G=" ".repeat(de/2),P=G):P=" ".repeat(de)}a.delimiterStart!==!1&&!x&&D.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&X==="")&&(a.delimiterStart!==!1||x)&&D.push(" "),a.alignDelimiters!==!1&&D.push(G),D.push(X),a.alignDelimiters!==!1&&D.push(P),a.padding!==!1&&D.push(" "),(a.delimiterEnd!==!1||x!==m-1)&&D.push("|")}A.push(a.delimiterEnd===!1?D.join("").replace(/ +$/,""):D.join(""))}return A.join(`
|
|
65
|
+
`)}function pC(e){return e==null?"":String(e)}function Zy(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 hC(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()),mC);return u(),d}function mC(e,i,a){return">"+(a?"":" ")+e}function gC(e,i){return Jy(e,i.inConstruct,!0)&&!Jy(e,i.notInConstruct,!1)}function Jy(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 ex(e,i,a,r){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
|
|
66
|
+
`&&gC(a.stack,a.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
67
|
+
`}function yC(e,i){const a=String(e);let r=a.indexOf(i),u=r,c=0,d=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===u?++c>d&&(d=c):c=1,u=r+i.length,r=a.indexOf(i,u);return d}function xC(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function bC(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function vC(e,i,a,r){const u=bC(a),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(xC(e,a)){const x=a.enter("codeIndented"),w=a.indentLines(c,wC);return x(),w}const h=a.createTracker(r),g=u.repeat(Math.max(yC(c,u)+1,3)),m=a.enter("codeFenced");let b=h.move(g);if(e.lang){const x=a.enter(`codeFencedLang${d}`);b+=h.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...h.current()})),x()}if(e.lang&&e.meta){const x=a.enter(`codeFencedMeta${d}`);b+=h.move(" "),b+=h.move(a.safe(e.meta,{before:b,after:`
|
|
68
|
+
`,encode:["`"],...h.current()})),x()}return b+=h.move(`
|
|
69
|
+
`),c&&(b+=h.move(c+`
|
|
70
|
+
`)),b+=h.move(g),m(),b}function wC(e,i,a){return(a?"":" ")+e}function eh(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 kC(e,i,a,r){const u=eh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("definition");let h=a.enter("label");const g=a.createTracker(r);let m=g.move("[");return m+=g.move(a.safe(a.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),h(),!e.url||/[\0- \u007F]/.test(e.url)?(h=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(h=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":`
|
|
71
|
+
`,...g.current()}))),h(),e.title&&(h=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),h()),d(),m}function SC(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 Eo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Sc(e,i,a){const r=Xr(e),u=Xr(i);return r===void 0?u===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_b.peek=jC;function _b(e,i,a,r){const u=SC(a),c=a.enter("emphasis"),d=a.createTracker(r),h=d.move(u);let g=d.move(a.containerPhrasing(e,{after:u,before:h,...d.current()}));const m=g.charCodeAt(0),b=Sc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Eo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),w=Sc(r.after.charCodeAt(0),x,u);w.inside&&(g=g.slice(0,-1)+Eo(x));const S=d.move(u);return c(),a.attentionEncodeSurroundingInfo={after:w.outside,before:b.outside},h+g+S}function jC(e,i,a){return a.options.emphasis||"*"}function CC(e,i){let a=!1;return Zp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,jp}),!!((!e.depth||e.depth<3)&&Yp(e)&&(i.options.setext||a))}function EC(e,i,a,r){const u=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(r);if(CC(e,a)){const b=a.enter("headingSetext"),x=a.enter("phrasing"),w=a.containerPhrasing(e,{...c.current(),before:`
|
|
72
|
+
`,after:`
|
|
73
|
+
`});return x(),b(),w+`
|
|
74
|
+
`+(u===1?"=":"-").repeat(w.length-(Math.max(w.lastIndexOf("\r"),w.lastIndexOf(`
|
|
75
|
+
`))+1))}const d="#".repeat(u),h=a.enter("headingAtx"),g=a.enter("phrasing");c.move(d+" ");let m=a.containerPhrasing(e,{before:"# ",after:`
|
|
76
|
+
`,...c.current()});return/^[\t ]/.test(m)&&(m=Eo(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,a.options.closeAtx&&(m+=" "+d),g(),h(),m}Db.peek=TC;function Db(e){return e.value||""}function TC(){return"<"}Mb.peek=AC;function Mb(e,i,a,r){const u=eh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let h=a.enter("label");const g=a.createTracker(r);let m=g.move("![");return m+=g.move(a.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(h=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),h(),e.title&&(h=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),h()),m+=g.move(")"),d(),m}function AC(){return"!"}Ob.peek=NC;function Ob(e,i,a,r){const u=e.referenceType,c=a.enter("imageReference");let d=a.enter("label");const h=a.createTracker(r);let g=h.move("![");const m=a.safe(e.alt,{before:g,after:"]",...h.current()});g+=h.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...h.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=h.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function NC(){return"!"}Rb.peek=_C;function Rb(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],h=a.compilePattern(d);let g;if(d.atBreak)for(;g=h.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function _C(){return"`"}function zb(e,i){const a=Yp(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))}Lb.peek=DC;function Lb(e,i,a,r){const u=eh(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let h,g;if(zb(e,a)){const b=a.stack;a.stack=[],h=a.enter("autolink");let x=d.move("<");return x+=d.move(a.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),h(),a.stack=b,x}h=a.enter("link"),g=a.enter("label");let m=d.move("[");return m+=d.move(a.containerPhrasing(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(")"),h(),m}function DC(e,i,a){return zb(e,a)?"<":"["}Ib.peek=MC;function Ib(e,i,a,r){const u=e.referenceType,c=a.enter("linkReference");let d=a.enter("label");const h=a.createTracker(r);let g=h.move("[");const m=a.containerPhrasing(e,{before:g,after:"]",...h.current()});g+=h.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...h.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=h.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function MC(){return"["}function th(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 OC(e){const i=th(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 RC(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 Ub(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 zC(e,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?RC(a):th(a);const h=e.ordered?d==="."?")":".":OC(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),Ub(a)===d&&b){let x=-1;for(;++x<e.children.length;){const w=e.children[x];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=h),a.bulletCurrent=d;const m=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),m}function LC(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 IC(e,i,a,r){const u=LC(a);let c=a.bulletCurrent||th(a);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(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 h=a.createTracker(r);h.move(c+" ".repeat(d-c.length)),h.shift(d);const g=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,h.current()),b);return g(),m;function b(x,w,S){return w?(S?"":" ".repeat(d))+x:(S?c:c+" ".repeat(d-c.length))+x}}function UC(e,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,r);return c(),u(),d}const BC=Mc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function qC(e,i,a,r){return(e.children.some(function(d){return BC(d)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function HC(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}Bb.peek=$C;function Bb(e,i,a,r){const u=HC(a),c=a.enter("strong"),d=a.createTracker(r),h=d.move(u+u);let g=d.move(a.containerPhrasing(e,{after:u,before:h,...d.current()}));const m=g.charCodeAt(0),b=Sc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Eo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),w=Sc(r.after.charCodeAt(0),x,u);w.inside&&(g=g.slice(0,-1)+Eo(x));const S=d.move(u+u);return c(),a.attentionEncodeSurroundingInfo={after:w.outside,before:b.outside},h+g+S}function $C(e,i,a){return a.options.strong||"*"}function GC(e,i,a,r){return a.safe(e.value,r)}function VC(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 YC(e,i,a){const r=(Ub(a)+(a.options.ruleSpaces?" ":"")).repeat(VC(a));return a.options.ruleSpaces?r.slice(0,-1):r}const qb={blockquote:hC,break:ex,code:vC,definition:kC,emphasis:_b,hardBreak:ex,heading:EC,html:Db,image:Mb,imageReference:Ob,inlineCode:Rb,link:Lb,linkReference:Ib,list:zC,listItem:IC,paragraph:UC,root:qC,strong:Bb,text:GC,thematicBreak:YC};function FC(){return{enter:{table:PC,tableData:tx,tableHeader:tx,tableRow:WC},exit:{codeText:XC,table:KC,tableData:Jf,tableHeader:Jf,tableRow:Jf}}}function PC(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 KC(e){this.exit(e),this.data.inTable=void 0}function WC(e){this.enter({type:"tableRow",children:[]},e)}function Jf(e){this.exit(e)}function tx(e){this.enter({type:"tableCell",children:[]},e)}function XC(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,QC));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function QC(e,i){return i==="|"?i:e}function ZC(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
77
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:d,tableCell:g,tableRow:h}};function d(S,A,z,L){return m(b(S,z,L),S.align)}function h(S,A,z,L){const D=x(S,z,L),X=m([D]);return X.slice(0,X.indexOf(`
|
|
78
|
+
`))}function g(S,A,z,L){const D=z.enter("tableCell"),X=z.enter("phrasing"),G=z.containerPhrasing(S,{...L,before:c,after:c});return X(),D(),G}function m(S,A){return fC(S,{align:A,alignDelimiters:r,padding:a,stringLength:u})}function b(S,A,z){const L=S.children;let D=-1;const X=[],G=A.enter("table");for(;++D<L.length;)X[D]=x(L[D],A,z);return G(),X}function x(S,A,z){const L=S.children;let D=-1;const X=[],G=A.enter("tableRow");for(;++D<L.length;)X[D]=g(L[D],S,A,z);return G(),X}function w(S,A,z){let L=qb.inlineCode(S,A,z);return z.stack.includes("tableCell")&&(L=L.replace(/\|/g,"\\$&")),L}}function JC(){return{exit:{taskListCheckValueChecked:nx,taskListCheckValueUnchecked:nx,paragraph:tE}}}function eE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nE}}}function nx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function tE(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 h=u[c];if(h.type==="paragraph"){d=h;break}}d===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function nE(e,i,a,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",h=a.createTracker(r);c&&h.move(d);let g=qb.listItem(e,i,a,{...r,...h.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function iE(){return[zj(),nC(),rC(),FC(),JC()]}function lE(e){return{extensions:[Lj(),iC(e),sC(),ZC(e),eE()]}}const aE={tokenize:dE,partial:!0},Hb={tokenize:fE,partial:!0},$b={tokenize:pE,partial:!0},Gb={tokenize:hE,partial:!0},rE={tokenize:mE,partial:!0},Vb={name:"wwwAutolink",tokenize:uE,previous:Fb},Yb={name:"protocolAutolink",tokenize:cE,previous:Pb},xl={name:"emailAutolink",tokenize:oE,previous:Kb},Bi={};function sE(){return{text:Bi}}let Ha=48;for(;Ha<123;)Bi[Ha]=xl,Ha++,Ha===58?Ha=65:Ha===91&&(Ha=97);Bi[43]=xl;Bi[45]=xl;Bi[46]=xl;Bi[95]=xl;Bi[72]=[xl,Yb];Bi[104]=[xl,Yb];Bi[87]=[xl,Vb];Bi[119]=[xl,Vb];function oE(e,i,a){const r=this;let u,c;return d;function d(x){return!Ap(x)||!Kb.call(r,r.previous)||nh(r.events)?a(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),h(x))}function h(x){return Ap(x)?(e.consume(x),h):x===64?(e.consume(x),g):a(x)}function g(x){return x===46?e.check(rE,b,m)(x):x===45||x===95||un(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&&xn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):a(x)}}function uE(e,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!Fb.call(r,r.previous)||nh(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(aE,e.attempt(Hb,e.attempt($b,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function cE(e,i,a){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&Pb.call(r,r.previous)&&!nh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),h):a(x)}function h(x){if(xn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),h;if(x===58){const w=u.toLowerCase();if(w==="http"||w==="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||vc(x)||ht(x)||Pa(x)||Nc(x)?a(x):e.attempt(Hb,e.attempt($b,b),a)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function dE(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 fE(e,i,a){let r,u,c;return d;function d(m){return m===46||m===95?e.check(Gb,g,h)(m):m===null||ht(m)||Pa(m)||m!==45&&Nc(m)?g(m):(c=!0,e.consume(m),d)}function h(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 pE(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(Gb,i,c)(d):d===null||ht(d)||Pa(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function hE(e,i,a){return r;function r(h){return h===33||h===34||h===39||h===41||h===42||h===44||h===46||h===58||h===59||h===63||h===95||h===126?(e.consume(h),r):h===38?(e.consume(h),c):h===93?(e.consume(h),u):h===60||h===null||ht(h)||Pa(h)?i(h):a(h)}function u(h){return h===null||h===40||h===91||ht(h)||Pa(h)?i(h):r(h)}function c(h){return xn(h)?d(h):a(h)}function d(h){return h===59?(e.consume(h),r):xn(h)?(e.consume(h),d):a(h)}}function mE(e,i,a){return r;function r(c){return e.consume(c),u}function u(c){return un(c)?a(c):i(c)}}function Fb(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ht(e)}function Pb(e){return!xn(e)}function Kb(e){return!(e===47||Ap(e))}function Ap(e){return e===43||e===45||e===46||e===95||un(e)}function nh(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 gE={tokenize:jE,partial:!0};function yE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:wE,continuation:{tokenize:kE},exit:SE}},text:{91:{name:"gfmFootnoteCall",tokenize:vE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:xE,resolveTo:bE}}}}function xE(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 h;function h(g){if(!d||!d._balanced)return a(g);const m=bi(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function bE(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)},h=[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,...h),e}function vE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return h;function h(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||ht(x))return a(x);if(x===93){e.exit("chunkString");const w=e.exit("gfmFootnoteCallString");return u.includes(bi(r.sliceSerialize(w)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(x)}return ht(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 wE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,h;return g;function g(A){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(A),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(A){return A===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(A),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):a(A)}function b(A){if(d>999||A===93&&!h||A===null||A===91||ht(A))return a(A);if(A===93){e.exit("chunkString");const z=e.exit("gfmFootnoteDefinitionLabelString");return c=bi(r.sliceSerialize(z)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(A),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),w}return ht(A)||(h=!0),d++,e.consume(A),A===92?x:b}function x(A){return A===91||A===92||A===93?(e.consume(A),d++,b):b(A)}function w(A){return A===58?(e.enter("definitionMarker"),e.consume(A),e.exit("definitionMarker"),u.includes(c)||u.push(c),Xe(e,S,"gfmFootnoteDefinitionWhitespace")):a(A)}function S(A){return i(A)}}function kE(e,i,a){return e.check(No,i,e.attempt(gE,i,a))}function SE(e){e.exit("gfmFootnoteDefinition")}function jE(e,i,a){const r=this;return Xe(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,h){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},w=[["enter",b,h],["enter",d[m][1],h],["exit",d[m][1],h],["enter",x,h]],S=h.parser.constructs.insideSpan.null;S&&Zn(w,w.length,0,_c(S,d.slice(m+1,g),h)),Zn(w,w.length,0,[["exit",x,h],["enter",d[g][1],h],["exit",d[g][1],h],["exit",b,h]]),Zn(d,m-1,g-m+3,w),g=m+w.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,h,g){const m=this.previous,b=this.events;let x=0;return w;function w(A){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(A):(d.enter("strikethroughSequenceTemporary"),S(A))}function S(A){const z=Xr(m);if(A===126)return x>1?g(A):(d.consume(A),x++,S);if(x<2&&!a)return g(A);const L=d.exit("strikethroughSequenceTemporary"),D=Xr(A);return L._open=!D||D===2&&!!z,L._close=!z||z===2&&!!D,h(A)}}}class EE{constructor(){this.map=[]}add(i,a,r){TE(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 TE(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 AE(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 NE(){return{flow:{null:{name:"table",tokenize:_E,resolveAll:DE}}}}function _E(e,i,a){const r=this;let u=0,c=0,d;return h;function h(H){let oe=r.events.length-1;for(;oe>-1;){const me=r.events[oe][1].type;if(me==="lineEnding"||me==="linePrefix")oe--;else break}const fe=oe>-1?r.events[oe][1].type:null,Se=fe==="tableHead"||fe==="tableRow"?_:g;return Se===_&&r.parser.lazy[r.now().line]?a(H):Se(H)}function g(H){return e.enter("tableHead"),e.enter("tableRow"),m(H)}function m(H){return H===124||(d=!0,c+=1),b(H)}function b(H){return H===null?a(H):Me(H)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),S):a(H):Fe(H)?Xe(e,b,"whitespace")(H):(c+=1,d&&(d=!1,u+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(H)))}function x(H){return H===null||H===124||ht(H)?(e.exit("data"),b(H)):(e.consume(H),H===92?w:x)}function w(H){return H===92||H===124?(e.consume(H),x):x(H)}function S(H){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(H):(e.enter("tableDelimiterRow"),d=!1,Fe(H)?Xe(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):A(H))}function A(H){return H===45||H===58?L(H):H===124?(d=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),z):de(H)}function z(H){return Fe(H)?Xe(e,L,"whitespace")(H):L(H)}function L(H){return H===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),D):H===45?(c+=1,D(H)):H===null||Me(H)?P(H):de(H)}function D(H){return H===45?(e.enter("tableDelimiterFiller"),X(H)):de(H)}function X(H){return H===45?(e.consume(H),X):H===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),G):(e.exit("tableDelimiterFiller"),G(H))}function G(H){return Fe(H)?Xe(e,P,"whitespace")(H):P(H)}function P(H){return H===124?A(H):H===null||Me(H)?!d||u!==c?de(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(H)):de(H)}function de(H){return a(H)}function _(H){return e.enter("tableRow"),K(H)}function K(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),K):H===null||Me(H)?(e.exit("tableRow"),i(H)):Fe(H)?Xe(e,K,"whitespace")(H):(e.enter("data"),ee(H))}function ee(H){return H===null||H===124||ht(H)?(e.exit("data"),K(H)):(e.consume(H),H===92?Q:ee)}function Q(H){return H===92||H===124?(e.consume(H),ee):ee(H)}}function DE(e,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],h=!1,g=0,m,b,x;const w=new EE;for(;++a<e.length;){const S=e[a],A=S[1];S[0]==="enter"?A.type==="tableHead"?(h=!1,g!==0&&(ix(w,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},A.start),end:Object.assign({},A.end)},w.add(a,0,[["enter",m,i]])):A.type==="tableRow"||A.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,a+1,0,0],h&&(h=!1,b={type:"tableBody",start:Object.assign({},A.start),end:Object.assign({},A.end)},w.add(a,0,[["enter",b,i]])),u=A.type==="tableDelimiterRow"?2:b?3:1):u&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=oc(w,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=a)):A.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=oc(w,i,c,u,void 0,x)),c=d,d=[c[1],a,0,0])):A.type==="tableHead"?(h=!0,g=a):A.type==="tableRow"||A.type==="tableDelimiterRow"?(g=a,c[1]!==0?(d[0]=d[1],x=oc(w,i,c,u,a,x)):d[1]!==0&&(x=oc(w,i,d,u,a,x)),u=0):u&&(A.type==="data"||A.type==="tableDelimiterMarker"||A.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&ix(w,i,g,m,b),w.consume(i.events),a=-1;++a<i.events.length;){const S=i.events[a];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=AE(i.events,a))}return e}function oc(e,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",h="tableContent";a[0]!==0&&(c.end=Object.assign({},Pr(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const g=Pr(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=Pr(i.events,a[2]),b=Pr(i.events,a[3]),x={type:h,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",x,i]]),r!==2){const w=i.events[a[2]],S=i.events[a[3]];if(w[1].end=Object.assign({},S[1].end),w[1].type="chunkText",w[1].contentType="text",a[3]>a[2]+1){const A=a[2]+1,z=a[3]-a[2]-1;e.add(A,z,[])}}e.add(a[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},Pr(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function ix(e,i,a,r,u){const c=[],d=Pr(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 Pr(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const ME={name:"tasklistCheck",tokenize:RE};function OE(){return{text:{91:ME}}}function RE(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 ht(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"),h):a(g)}function h(g){return Me(g)?i(g):Fe(g)?e.check({tokenize:zE},i,a)(g):a(g)}}function zE(e,i,a){return Xe(e,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function LE(e){return ab([sE(),yE(),CE(e),NE(),OE()])}const IE={};function UE(e){const i=this,a=e||IE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(LE(a)),c.push(iE()),d.push(lE(a))}function BE(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=qE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function wo(e,i){return!!(i&&e.includes(i))}function qE(e){return e&&typeof e=="object"?e:{}}const HE=["summary","message","status","instruction","description","reason","error","text"],lx=96,$E=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),GE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),VE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]);function YE(e){if(GE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||$E.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=ko(e.data),a=typeof i.method=="string"?i.method:"",r=ko(i.params),u=ko(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||a.endsWith("/delta")||a.endsWith("/outputDelta")||VE.has(c)?null:a}function Wb(e,i){const a=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===a?FE(a):r}function Rc(e,i=[]){const a=ko(e),u=[...i,...HE.map(c=>PE(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=lx?u:`${u.slice(0,lx-3)}...`:"查看详情"}function Np(e,i=new Map){const a=ko(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",h=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:Rc({},[h])}}function FE(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 PE(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function ko(e){return e&&typeof e=="object"?e:{}}const _p="seele:authentication-required",Xb=12,KE=5e3,Dp="seele.activeWorkspaceId",Qb="seele.workspaceOrder",Zb="seele.workspaceGroupOrder",Jb="seele.workspaceDrafts",ev="seele.collapsedWorkspaceGroups",tv="seele.sidebarWidth",ax=5,rx=275,WE=236,XE=420,sx="default",ox=300,QE=3,ZE=10,JE=2,eT=13,tT=1.65,nT=20,iT=900;class Ui extends Error{constructor(a,r,u,c){super(a);lc(this,"detail");lc(this,"status");lc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const lT=[{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium (default)"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],aT=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],oo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function ye(e){var a;return`${((a=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:a.content.replace(/\/?$/,"/"))??"/"}api/${e.replace(/^\/+/,"")}`}async function Wt(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(`
|
|
79
|
+
`);return new Ui(r,u,e.status,a)}function vt(e){return e instanceof Ui?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function $a(e){const i=vt(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function De(e,i){if(!e.ok)throw await Wt(e,i)}function rT(e){return e instanceof Ui&&e.status===410&&e.body.includes('"turn_not_active"')}function sT(e){return e instanceof Ui&&e.status===409&&e.body.includes('"turn_not_running"')}function oT(e){return e instanceof Ui&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function ux(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function uT(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 ih(e){return Math.max(WE,Math.min(XE,Math.round(e)))}function cT(){try{const e=window.localStorage.getItem(tv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?ih(i):rx}catch{return rx}}function dT(e){try{window.localStorage.setItem(tv,String(ih(e)))}catch{}}function ep(e){nv(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function fT(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function pT(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*QE+r+u,d=a*ZE+r+u;e.style.height="auto";const h=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${h}px`,e.style.overflowY=e.scrollHeight>d?"auto":"hidden"}function hT(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(JE,Math.max(1,i+1))}function mT(e){return Math.ceil(hT(e)*eT*tT+nT)}function nv(e,i){const a=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=a}function gT(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 h=d.getBoundingClientRect();return h.top<=a&&h.bottom>=i.top})??r[r.length-1]??null;if(!(u!=null&&u.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const c=u.getBoundingClientRect();return{anchorOffset:a-c.top,anchorTurnId:u.dataset.turnId}}function yT(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function cx(e,i){nv(e,()=>{const a=yT(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 xT(e,i){let a=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||cx(e,i)});cx(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 bT(){try{return window.localStorage.getItem(Dp)}catch{return null}}function tp(e){try{e?window.localStorage.setItem(Dp,e):window.localStorage.removeItem(Dp)}catch{}}function iv(){try{const e=window.localStorage.getItem(Qb),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function lv(){try{const e=window.localStorage.getItem(Zb),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function av(e){try{window.localStorage.setItem(Zb,JSON.stringify(e))}catch{}}function hc(e){try{window.localStorage.setItem(Qb,JSON.stringify(e))}catch{}}function rv(){try{const e=window.localStorage.getItem(Jb),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 vT(e){return e?rv()[e]??"":""}function np(e,i){if(e)try{const a=rv();i?a[e]=i:delete a[e],window.localStorage.setItem(Jb,JSON.stringify(a))}catch{}}function wT(){try{const e=window.localStorage.getItem(ev),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(a=>typeof a=="string"):[])}catch{return new Set}}function ip(e){try{window.localStorage.setItem(ev,JSON.stringify(Array.from(e)))}catch{}}function uo(e){const i=iv();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=lv();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 lp(e){const i=new Set(e.map(u=>u.id)),a=iv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));hc([...a,...r])}function ap(e){const i=new Set(e.map(u=>u.id)),a=lv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));av([...a,...r])}function kT(e,i){const a=e.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function ST(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],[h]=d.splice(u,1),g=d.findIndex(b=>b.id===a),m=r==="before"?g:g+1;return d.splice(m,0,h),d}function jT(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),h=c.findIndex(g=>g.id===a);return c.splice(h+1,0,d),c}function CT({authEnabled:e,currentUser:i,onLogout:a}){var Oi,Sr,Hl,jr;const[r,u]=O.useState(""),[c,d]=O.useState([]),[h,g]=O.useState([]),[m,b]=O.useState(null),[x,w]=O.useState(null),[S,A]=O.useState("simple"),[z,L]=O.useState(null),[D,X]=O.useState(null),[G,P]=O.useState(null),[de,_]=O.useState(!1),[K,ee]=O.useState(!1),[Q,H]=O.useState({}),[oe,fe]=O.useState({}),[Se,me]=O.useState(null),[re,$]=O.useState([]),[ae,xe]=O.useState(null),[Te,N]=O.useState("checking"),[T,q]=O.useState(null),[E,te]=O.useState(!1),[ge,he]=O.useState(null),[be,Le]=O.useState(!1),[He,At]=O.useState(null),[St,dn]=O.useState(!1),[bn,jt]=O.useState([]),[vn,ze]=O.useState([]),[Gt,Jn]=O.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Un,di]=O.useState([]),[yt,Vt]=O.useState(null),[vi,Nt]=O.useState(null),[wi,ne]=O.useState(!1),[se,Oe]=O.useState(null),[Ge,Qe]=O.useState(!1),[fn,fi]=O.useState(null),[Xt,Ct]=O.useState(!1),[Qt,tt]=O.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[zt,Yt]=O.useState("global"),[wt,ki]=O.useState(null),[Xa,Si]=O.useState(null),[ji,Ci]=O.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[da,Do]=O.useState({memory:"",items:[]}),[Mo,Qa]=O.useState({memory:"",items:[]}),[fa,Oo]=O.useState({memory:"",items:[]}),[Ro,bl]=O.useState([]),[qi,Ei]=O.useState(oo),[Ti,Hi]=O.useState({description:"",key:"",value:""}),[Za,Bn]=O.useState(null),[Ht,Lt]=O.useState(()=>new Set),[Ai,pa]=O.useState(!1),[Jr,es]=O.useState(!1),[zo,vl]=O.useState(!1),[ei,Ni]=O.useState(null),[$i,ha]=O.useState(!0),[wl,_t]=O.useState(!1),[Lo,ts]=O.useState(!1),[ln,qn]=O.useState(null),[Ic,kl]=O.useState(null),[Sl,Io]=O.useState(null),[wn,kn]=O.useState(null),[Zt,pn]=O.useState(null),[jl,Uc]=O.useState(null),[Gi,Uo]=O.useState(()=>new Set),[Vi,ma]=O.useState(null),[an,ga]=O.useState(null),[ns,Cl]=O.useState(null),[Jt,pi]=O.useState(null),[Ja,ti]=O.useState(null),[is,er]=O.useState(()=>wT()),[Bo,ya]=O.useState(()=>cT()),[qo,Bc]=O.useState(230),[ni,hi]=O.useState(()=>Date.now()),tr=O.useRef(null),El=O.useRef(null),Yi=O.useRef(null),Fi=O.useRef(null),xa=O.useRef(!0),nr=O.useRef(null),Tl=O.useRef(null),Pi=O.useRef(null),Hn=O.useRef(new Set),ba=O.useRef(!1),Al=O.useRef([]),mi=O.useRef(null),ii=O.useRef(null),hn=O.useRef(new Map),en=O.useRef(new Map),Ki=O.useRef(new Set),Wi=O.useRef(new Map),Nl=O.useRef(new Map),Dt=O.useRef(new Set),li=O.useRef(null),Xi=O.useRef(null),Qi=O.useRef(!1),ls=O.useRef(!1),je=c.find(y=>y.id===m),ir=(je==null?void 0:je.unreadTurnCount)??0,Sn=c.find(y=>y.id===ei),Mt=c.find(y=>y.id===wt),lr=c.find(y=>y.id===Vi),va=O.useMemo(()=>{const k=uc(h.length>0?h:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(I=>({id:I.id,title:I.title,conversations:[]})),C=new Map(k.map(I=>[I.id,I])),M=k[0];for(const I of c)(C.get(I.groupId)??M).conversations.push(I);return k.filter(I=>I.conversations.length>0||I.id!=="default")},[c,h]),nt=m!==null?Q[m]:null,_l=(nt==null?void 0:nt.messages)??[],Dl=(nt==null?void 0:nt.events)??[],wa=T2(E2(Dl),m?oe[m]:null),ka=Uv(wa),as=(nt==null?void 0:nt.status)??(je==null?void 0:je.status)??"idle",ar=xc(je,as),qc=ei!==null?((Oi=Q[ei])==null?void 0:Oi.status)??(Sn==null?void 0:Sn.status)??"idle":"idle",Ho=xc(Sn,qc),Sa=m?en.current.get(m)??null:null,$o=O.useMemo(()=>new Map(c.map(y=>[y.id,y.title])),[c]),rs=O.useMemo(()=>cA(_l,Dl,(nt==null?void 0:nt.turns)??[],(nt==null?void 0:nt.timelineNodes)??[],Sa,$o),[Sa,nt==null?void 0:nt.timelineNodes,nt==null?void 0:nt.turns,Dl,_l,$o]),ss=O.useMemo(()=>new Set(_l.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[_l]),ja=m!==null&&Gi.has(m),os=Sa?(Sr=rs.find(y=>wo(y.turnIds,Sa)))==null?void 0:Sr.activity:null,rr=ar==="running"||ja?os&&!p2(os)?os:{title:"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,Hc=!rr&&ar==="waiting"&&(je!=null&&je.nextWakeup)?{title:"Scheduled wakeup",detail:Ac(je.nextWakeup,ni),createdAt:je.nextWakeup.wakeAt,tone:"waiting"}:null,Ml=rr??Hc,$c=O.useMemo(()=>C2(Object.values(Q)),[Q]),Gc=zx(ae,$c);O.useEffect(()=>{Yc(),Ea()},[]),O.useEffect(()=>{cs(!1),cs(!0);const y=window.setInterval(()=>{cs(!0)},300*1e3);return()=>window.clearInterval(y)},[]),O.useEffect(()=>{const y=window.setInterval(()=>hi(Date.now()),1e3);return()=>window.clearInterval(y)},[]),O.useEffect(()=>{Dt.current=Gi},[Gi]),O.useEffect(()=>{mi.current=m},[m]),O.useEffect(()=>{Al.current=c},[c]),O.useEffect(()=>{m&&tp(m)},[m]),O.useLayoutEffect(()=>{if(!m||ir<=0)return;let y=!1;const k=async()=>{if(document.visibilityState==="visible"){d(M=>M.map(I=>I.id===m?{...I,unreadTurnCount:0}:I));try{await xN(m)}catch(M){y||console.error(M)}}},C=()=>void k();return k(),document.addEventListener("visibilitychange",C),()=>{y=!0,document.removeEventListener("visibilitychange",C)}},[m,ir]),O.useEffect(()=>{A("simple"),w(null),m&&(_i(m),ur(m))},[m]),O.useEffect(()=>{const y=window.setInterval(()=>void us(),KE);return()=>window.clearInterval(y)},[]),O.useEffect(()=>{u(vT(m))},[m]),O.useEffect(()=>{!m||as!=="running"||Dt.current.has(m)||vr(m)},[m,as,Gi]),O.useEffect(()=>{if(!m)return;let y=!1;return IN(m).then(k=>{y||fe(C=>({...C,[m]:k}))}).catch(k=>console.error(k)),()=>{y=!0}},[m]),O.useEffect(()=>{!m&&zt==="workspace"&&Yt("global")},[m,zt]),O.useEffect(()=>{var y;if(St){if(!wt&&m){ki(m);return}wt&&!c.some(k=>k.id===wt)&&ki(m??((y=c[0])==null?void 0:y.id)??null)}},[m,c,St,wt]),O.useEffect(()=>{!St||zt!=="workspace"||Oo({memory:(Mt==null?void 0:Mt.memory)??"",items:(Mt==null?void 0:Mt.memoryItems)??[]})},[zt,St,Mt==null?void 0:Mt.id,Mt==null?void 0:Mt.memory,Mt==null?void 0:Mt.memoryItems]),O.useEffect(()=>{if(!Ai)return;m&&sr(m);const y=k=>{k.key==="Escape"&&pa(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m,Ai]),O.useEffect(()=>{if(!St)return;const y=k=>{k.key==="Escape"&&dn(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[St]),O.useEffect(()=>{var k;if(!Jr)return;if(ei&&!c.some(C=>C.id===ei)){Ni(m??((k=c[0])==null?void 0:k.id)??null);return}const y=C=>{C.key==="Escape"&&(ln?qn(null):es(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m,Jr,ln,ei,c]),O.useEffect(()=>{if(!wn)return;pn(null);const y=k=>{k.key==="Escape"&&kn(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[wn]),O.useLayoutEffect(()=>{pT(Fi.current)},[r]),O.useLayoutEffect(()=>{const y=Yi.current;if(!y)return;const k=()=>{const M=y.getBoundingClientRect();Bc(Math.ceil(M.height+44))};k();const C=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return C==null||C.observe(y),window.addEventListener("resize",k),()=>{C==null||C.disconnect(),window.removeEventListener("resize",k)}},[]),O.useLayoutEffect(()=>{var Z,we;const y=El.current;if(!y)return;const k=nr.current!==m;nr.current=m,k&&((Z=ii.current)==null||Z.call(ii),ii.current=null);const C=Tl.current;if(C&&C.conversationId===m){(we=ii.current)==null||we.call(ii),ii.current=xT(y,C),Tl.current=null,xa.current=!1;return}if(!k&&!xa.current)return;xa.current=!0,ep(y);const M=requestAnimationFrame(()=>ep(y)),I=window.setTimeout(()=>ep(y),120);return()=>{cancelAnimationFrame(M),window.clearTimeout(I)}},[m,Dl.length,_l.length]);async function Vc(){var k;const y=El.current;y&&(xa.current=fT(y),!(!m||!((k=nt==null?void 0:nt.history)!=null&&k.hasMoreBefore))&&(nt.loadingOlder||Hn.current.has(m)||y.scrollTop>96||await tu(m)))}function Go(y){var C,M;if(y.history)return y.history;const k=((C=y.timelineNodes)==null?void 0:C.filter(I=>I.parentId===null).reduce((I,Z)=>I===null||Z.timelineAt<I.timelineAt||Z.timelineAt===I.timelineAt&&Z.sequence<I.sequence?Z:I,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((M=y.messages[0])==null?void 0:M.createdAt)??null,oldestTimelineAt:(k==null?void 0:k.timelineAt)??null,oldestTimelineSequence:(k==null?void 0:k.sequence)??null,messageTotal:y.messages.length,eventTotal:y.events.length,loadedMessageCount:y.messages.length,loadedEventCount:y.events.length}}async function Zi(y){const k=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(k),pn(y.url)}async function Ca(y,k){await navigator.clipboard.writeText(k),Uc(y)}function Ae(y,k,C){const M=Date.now();Io({id:M,tone:y,text:k,detail:C}),window.setTimeout(()=>{Io(I=>(I==null?void 0:I.id)===M?null:I)},C?8e3:2400)}async function Yc(){try{const[y,k]=await Promise.all([Ax(),_x()]);N("connected");const C=uc(k);if(g(C),ap(C),y.length>0){const M=uo(y),I=bT(),Z=M.find(we=>we.id===I)??M[0];d(M),lp(M),b(Z.id);return}d([]),tp(null),b(null)}catch(y){console.error(y),N("error")}}async function jn(){const[y,k]=await Promise.all([Ax(),_x()]),C=uo(y),M=uc(k);g(M),ap(M),d(C),lp(C)}async function us(){if(!ba.current){ba.current=!0;try{const y=await hN(),k=Al.current,C=new Set(k.map(_e=>_e.id)),M=new Set(y.map(_e=>_e.id));if(C.size!==M.size||[...C].some(_e=>!M.has(_e))){await jn(),N("connected");return}const I=mi.current,Z=I?y.find(_e=>_e.id===I)??null:null,we=new Map(y.map(_e=>[_e.id,_e])),Ne=uo(k.map(_e=>{const pe=we.get(_e.id);return pe?{..._e,status:pe.status,statusError:pe.statusError,nextWakeup:pe.nextWakeup,unreadTurnCount:pe.unreadTurnCount,updatedAt:pe.updatedAt}:_e}));d(Ne),lp(Ne),N("connected"),Z&&!Dt.current.has(Z.id)&<(Z.id,_e=>({..._e,status:Z.status}))}catch(y){console.error(y),N("error")}finally{ba.current=!1}}}async function Ea(){try{const y=await i2();N("connected"),me(y.version)}catch(y){console.error(y),N("error")}}async function cs(y){try{const k=await l2(y);k&&xe(C=>zx(C,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function Vo(){try{const y=await kN();jt(y),N("connected")}catch(y){console.error(y),N("error")}}async function ds(y){try{const k=await SN(y);ze(k),N("connected")}catch(k){console.error(k),ze([]),N("error")}}async function sr(y){try{const k=await jN(y);bl(k),N("connected")}catch(k){console.error(k),bl([]),N("error")}}async function Yo(y){try{const k=await CN();Jn(k),tt(k),y||(Si(null),Ci(k)),N("connected")}catch(k){console.error(k),N("error")}}async function or(y=!0){try{const k=await TN(y);di(k.models),N("connected"),k.refreshing&&window.setTimeout(()=>void or(!1),1e3)}catch(k){console.error(k),di([]),N("error")}}async function Ji(){try{const y=await EN();Vt(y.codexVersion),Nt(y.codexReleasedAt),N("connected")}catch(y){console.error(y),Vt(null),Nt(null),N("error")}}async function fs(y=!1){y&&Ct(!0);try{const k=await AN(y);Oe(k.job),fi(k.latest),N("connected"),k.job&&k.job.status!=="running"&&Pi.current===k.job.id&&(Pi.current=null,k.job.status==="succeeded"?(await Promise.all([or(),Ji()]),Ae("success",`Codex CLI updated to ${Lc(k.job.currentVersion)}`)):Ae("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),N("error")}finally{y&&Ct(!1)}}async function Fc(){Qe(!0);try{const y=await NN();Pi.current=y.id,Oe(y),N("connected")}catch(y){console.error(y);const k=vt(y);Ae("error","Unable to start Codex CLI update",k.detail??k.message)}finally{Qe(!1)}}O.useEffect(()=>{if(!wi||(se==null?void 0:se.status)!=="running")return;const y=window.setInterval(()=>void fs(),1e3);return()=>window.clearInterval(y)},[wi,se==null?void 0:se.id,se==null?void 0:se.status]);async function ps(y){try{const k=await _N(y);Si(k),Ci(k.effective),N("connected")}catch(k){console.error(k),Si(null),N("error")}}async function Fo(){try{const y=await DN();Do(y),Qa(y),N("connected")}catch(y){console.error(y),N("error")}}async function Po(){if(i.role!=="admin"){$([]);return}try{$(await Z2()),N("connected")}catch(y){console.error(y),N("error")}}async function Ol(y=wt){const k=[Vo(),Yo(y),Ji(),or(),Fo()];i.role==="admin"&&k.push(Po()),y&&(k.push(ps(y)),k.push(ds(y)),k.push(sr(y))),await Promise.all(k)}function Ta(){var k;const y=m??((k=c[0])==null?void 0:k.id)??null;ee(!1),ki(y),Yt(i.role==="admin"?"global":y?"workspace":"global"),dn(!0),Ol(y)}function Pc(){var k;const y=m??((k=c[0])==null?void 0:k.id)??null;ki(y),Yt(y?"workspace":"global"),dn(!0),Ol(y)}function Aa(){var y;ee(!1),Ni(m??((y=c[0])==null?void 0:y.id)??null),kl(null),qn(null),es(!0)}function Ko(y){ki(y),Yt("workspace"),ps(y),ds(y),sr(y),Ei(oo)}async function Wo(y){y.preventDefault();try{if(zt==="workspace"&&wt){const k=await Dx(wt,qN(ji,Gt));Si(k.settings),Ci(k.settings.effective),st(k.conversation),Ae("success","Workspace settings saved")}else{const k=await MN(Qt);Jn(k),tt(k),wt&&await ps(wt),Ae("success","Global settings saved")}N("connected")}catch(k){console.error(k),N("error");const C=vt(k);Ae("error","Failed to save runtime settings",C.detail??C.message)}}async function hs(){var C;const y=Sn;if(!y){Ae("error","No workspace selected");return}if((((C=Q[y.id])==null?void 0:C.status)??y.status)==="running"){Ae("error","Stop the running turn before resetting runtime");return}ts(!0),kl(null);try{const M=await RN(y.id);qn(M),N("connected")}catch(M){console.error(M),N("error");const I=vt(M);Ae("error","Failed to preview runtime reset",I.detail??I.message)}finally{ts(!1)}}async function ms(y){const k=Sn,C=ln;if(!k||!C||C.conversationId!==k.id){Ae("error","Reset preview is required");return}_t(!0),kl(null);try{const M=await ON(k.id,{warmup:$i,previewFingerprint:C.fingerprint,selectedEntryIds:y});kl(M),qn(null),N("connected"),await _i(k.id),await jn(),M.warmupTurnId&&wr(k.id,M.warmupTurnId),Ae("success","Runtime thread reset")}catch(M){console.error(M),N("error");const I=vt(M);Ae("error","Failed to reset runtime thread",I.detail??I.message)}finally{_t(!1)}}async function Xo(y){const k=Sn,C=ln;if(!k||!C||C.conversationId!==k.id)throw new Error("Reset preview is no longer current.");try{await zN(k.id,{previewFingerprint:C.fingerprint,selectedEntryIds:y}),N("connected")}catch(M){console.error(M),N("error");const I=vt(M);throw Ae("error","Failed to save reset defaults",I.detail??I.message),M}}async function Qo(y,k){try{const C=await Dx(y,{[k]:null});Si(C.settings),Ci(C.settings.effective),st(C.conversation),N("connected"),Ae("success","Workspace override reset")}catch(C){console.error(C),N("error"),Ae("error","Failed to reset workspace override")}}async function Zo(y){try{const k=await PN({memory:FN(y),items:y});return Do(k),Qa(k),N("connected"),Ae("success","Base memory saved"),k.items}catch(k){throw console.error(k),N("error"),Ae("error","Failed to save memory"),k}}async function Kc(y,k){try{const C=await fc(y,{memoryItems:k});return st(C),Oo({memory:C.memory,items:C.memoryItems}),N("connected"),Ae("success","Workspace memory saved"),C.memoryItems}catch(C){throw console.error(C),N("error"),Ae("error","Failed to save memory"),C}}async function Wc(y){y.preventDefault();const k=Ti.key.trim();if(k)try{if(zt==="workspace"&&wt){const C=await WN(wt,k,Ti.value,Ti.description);ze(M=>[...M.filter(I=>I.key!==C.variable.key),C.variable].sort((I,Z)=>I.key.localeCompare(Z.key))),st(C.conversation)}else{const C=await KN(k,Ti.value,Ti.description);jt(M=>[...M.filter(I=>I.key!==C.key),C].sort((I,Z)=>I.key.localeCompare(Z.key)))}Ae("success",zt==="workspace"?"Workspace environment saved":"Base environment saved"),Hi({description:"",key:"",value:""}),Bn(null),Lt(C=>{const M=new Set(C);return M.delete(k),M}),N("connected")}catch(C){console.error(C),N("error"),Ae("error","Failed to save environment")}}async function Xc(y){try{if(zt==="workspace"&&wt){const k=await JN(wt,y);ze(C=>C.filter(M=>M.key!==y)),st(k)}else await ZN(y),jt(k=>k.filter(C=>C.key!==y));Za===y&&(Hi({description:"",key:"",value:""}),Bn(null),Lt(k=>{const C=new Set(k);return C.delete(y),C})),N("connected"),Ae("success",zt==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),N("error"),Ae("error","Failed to delete environment")}}async function Qc(y,k){if(k.preventDefault(),!qi.name.trim()){Ae("error","Knowledge name is required");return}const C=HN(qi);try{const M=qi.id?await t2(y,qi.id,C):await e2(y,C);bl(I=>[...I.filter(Z=>Z.id!==M.id),M].sort(Mx)),Ei(oo),N("connected"),Ae("success","Workspace knowledge saved")}catch(M){console.error(M),N("error"),Ae("error","Failed to save workspace knowledge")}}async function Zc(y,k){try{await n2(y,k),bl(C=>C.filter(M=>M.id!==k)),qi.id===k&&Ei(oo),N("connected"),Ae("success","Workspace knowledge deleted")}catch(C){console.error(C),N("error"),Ae("error","Failed to delete workspace knowledge")}}function mn(y){Yt("workspace"),Ei($N(y))}function Na(y){Hi({description:y.description,key:y.key,value:""}),Bn(y.key),Lt(k=>{const C=new Set(k);return C.delete(y.key),C}),gs(y.key,{preserveTypedValue:!0})}function Jo(){const y=Za;Hi({description:"",key:"",value:""}),Bn(null),y&&Lt(k=>{const C=new Set(k);return C.delete(y),C})}async function eu(y){await gs(y)}async function gs(y,k={}){try{const C=zt==="workspace"&&wt?await QN(wt,y):await XN(y);Hi(M=>M.key===y&&(!k.preserveTypedValue||M.value.length===0)?{...M,value:C}:M),Lt(M=>new Set(M).add(y)),N("connected")}catch(C){console.error(C),N("error")}}async function _i(y){const k=await Rx(y);su(k)}async function ur(y){try{w(await r2(y))}catch(k){console.error(k)}}async function _a(y){if(m)try{const k=await o2(m,y);w(y==="end"?null:k),y==="end"&&A("simple"),Ae("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&vr(m,{waitMs:15e3}),await jn()}catch(k){Ae("error","Complex task control failed",vt(k).detail??vt(k).message)}}async function Cn(y){if(m)try{L(await s2(m,y))}catch(k){const C=vt(k);Ae("error","Failed to load complex task",C.detail??C.message)}}function ys(){je&&P({sourceId:je.id,name:`${je.title} - Clone`,groupId:je.groupId})}async function Da(y){if(y.preventDefault(),!(!G||!G.name.trim())){_(!0);try{const k=await u2(G.sourceId,G.name.trim(),G.groupId);d(C=>uo([k.conversation,...C])),b(k.conversation.id),P(null),ee(!1),Ae(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){Ae("error","Clone failed",vt(k).detail??vt(k).message)}finally{_(!1)}}}async function xs(){if(je)try{const y=await c2(je.id);st(y.conversation),Ae(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){Ae("error","Clone retry failed",vt(y).detail??vt(y).message)}}async function tu(y,k={}){var _e,pe,Vn;const C=Q[y],M=(_e=C==null?void 0:C.history)==null?void 0:_e.oldestTimelineAt,I=(pe=C==null?void 0:C.history)==null?void 0:pe.oldestTimelineSequence,Z=M&&I!==null&&I!==void 0?`${M}|${I}`:I==null?(Vn=C==null?void 0:C.history)==null?void 0:Vn.oldestMessageCreatedAt:String(I),we=El.current;if(!Z||!we)return;if(k.preserveAnchor??!0){const mt=gT(we);Tl.current={anchorOffset:mt.anchorOffset,conversationId:y,previousScrollHeight:we.scrollHeight,anchorTurnId:mt.anchorTurnId}}else Tl.current=null;Hn.current.add(y),lt(y,mt=>({...mt,loadingOlder:!0}));try{const mt=await Rx(y,{before:Z,limit:Xb});js(mt)}catch(mt){console.error(mt),Tl.current=null}finally{Hn.current.delete(y),lt(y,mt=>({...mt,loadingOlder:!1}))}}async function el(y,k){const C=await a2(y,k||void 0);d(M=>{const I=[C,...M];return hc(I.map(Z=>Z.id)),I}),b(C.id),ee(!1)}function Rl(){ee(!1),At({mode:"create",groupId:null,title:""})}function cr(y){At({mode:"rename",groupId:y.id,title:y.title})}function bs(){var y;ee(!1),q({mode:"create",conversationId:null,title:"",groupId:(je==null?void 0:je.groupId)??((y=h[0])==null?void 0:y.id)})}async function tl(y){var k;if(y.status!=="running"){Le(!0);try{await f2(y.id),H(M=>{const I={...M};return delete I[y.id],I});const C=c.filter(M=>M.id!==y.id);if(hc(C.map(M=>M.id)),np(y.id,""),d(C),m===y.id){const M=((k=C[0])==null?void 0:k.id)??null;tp(M),b(M)}(T==null?void 0:T.conversationId)===y.id&&nl(),he(null),Ae("success","Workspace moved to recycle")}catch(C){const M=vt(C);Ae("error","Failed to move workspace to recycle",M.detail??M.message)}finally{Le(!1)}}}async function nu(y){if(!(y.id===sx||!window.confirm(`Delete group "${y.title}"?
|
|
80
|
+
|
|
81
|
+
Workspaces in this group will move to Default.`)))try{const C=await wN(y.id),M=uc(C.groups);g(M),ap(M),d(C.conversations),er(I=>{const Z=new Set(I);return Z.delete(y.id),ip(Z),Z})}catch(C){console.error(C)}}function iu(y){q({mode:"rename",conversationId:y.id,title:y.title})}function nl(){te(!1),q(null)}function dr(){At(null)}async function Jc(y,k){const C=k.trim(),M=c.find(Z=>Z.id===y);if(!M||!C||C===M.title){nl();return}const I=await fc(y,{title:C});st(I),nl()}function ed(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function vs(y){return y instanceof Element&&!!y.closest("input, button")}function lu(y,k){const C=document.elementFromPoint(y,k);return C instanceof HTMLElement?C.closest(".session-item[data-workspace-id]"):null}function fr(y,k){const C=document.elementFromPoint(y,k);return C instanceof HTMLElement?C.closest(".workspace-group[data-group-id]"):null}function $n(y,k,C){const M=lu(k,C),I=M==null?void 0:M.dataset.workspaceId;if(M&&I&&I!==y){pi({kind:"workspace",id:I,position:kT(M,C)});return}const Z=fr(k,C),we=Z==null?void 0:Z.dataset.groupId;if(!we){pi(null);return}pi({kind:"group",id:we})}function pr(y,k){vs(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),li.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function En(y,k){const C=li.current;if(!C||C.id!==k||C.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-C.startX,y.clientY-C.startY);if(Vi!==k){if(M<ax)return;ma(k),pi(null)}y.preventDefault(),ti({x:y.clientX,y:y.clientY}),$n(k,y.clientX,y.clientY)}async function zl(y,k){var we;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),li.current=null;const C=Vi===k;C&&(Qi.current=!0);const M=Jt;if(!C||!M){ma(null),pi(null),ti(null);return}const I=c.find(Ne=>Ne.id===k),Z=M.kind==="group"?M.id:(we=c.find(Ne=>Ne.id===M.id))==null?void 0:we.groupId;if(!I||!Z){ma(null),pi(null),ti(null);return}if(d(Ne=>{const _e=M.kind==="workspace"?ST(Ne.map(pe=>pe.id===k?{...pe,groupId:Z}:pe),k,M.id,M.position):[...Ne.filter(pe=>pe.id!==k),{...I,groupId:Z}];return hc(_e.map(pe=>pe.id)),_e}),I.groupId!==Z)try{const Ne=await fc(k,{groupId:Z});st(Ne)}catch(Ne){console.error(Ne),await jn()}ma(null),pi(null),ti(null)}function ws(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),li.current=null,ma(null),pi(null),ti(null)}function hr(y,k){y.currentTarget.setPointerCapture(y.pointerId),Xi.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function mr(y,k){const C=Xi.current;if(!C||C.id!==k||C.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-C.startX,y.clientY-C.startY);if(an!==k){if(M<ax)return;ga(k),Cl(null)}y.preventDefault();const I=fr(y.clientX,y.clientY),Z=I==null?void 0:I.dataset.groupId;Cl(Z&&Z!==k?Z:null)}function ks(y,k){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const C=an===k;C&&(y.preventDefault(),ls.current=!0);const M=ns;C&&M&&g(I=>{const Z=jT(I,k,M);return av(Z.map(we=>we.id)),Z}),Xi.current=null,ga(null),Cl(null)}function il(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Xi.current=null,ga(null),Cl(null)}function au(y){const k=y.target.value;q(C=>C&&{...C,title:k})}function gr(y){const k=y.target.value;q(C=>C&&{...C,groupId:k})}function Ll(y){const k=y.target.value;At(C=>C&&{...C,title:k})}async function td(y){if(y.preventDefault(),!T)return;const k=T.title.trim();if(k){te(!0);try{if(T.mode==="create"){await el(k,T.groupId),nl();return}T.conversationId&&await Jc(T.conversationId,k)}catch(C){console.error(C);const M=vt(C);Ae("error",T.mode==="create"?"Failed to create workspace":"Failed to rename workspace",M.detail??M.message)}finally{te(!1)}}}function Ft(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),nl())}async function Ss(y){if(y.preventDefault(),!He)return;const k=He.title.trim();if(k)try{if(He.mode==="rename"){if(!He.groupId)return;const M=await vN(He.groupId,{title:k});g(I=>I.map(Z=>Z.id===M.id?M:Z)),dr();return}const C=await bN(k);g(M=>[...M,C]),er(M=>{const I=new Set(M);return I.delete(C.id),ip(I),I}),dr()}catch(C){console.error(C)}}function Gn(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),dr())}async function ru(y){y.preventDefault(),await xr()}function yr(y){u(y),np(m,y)}function gi(y){np(y,""),m===y&&u("")}async function xr(y={}){const k=r.trim();if(!k)return;if(!m){bs();return}const C=m,M=en.current.has(C),I=Ki.current.has(C);if(ar==="running"||ja||M||I){if(y.forceNewTurn&&!x){await Tn(C,k);return}await Il(C,k);return}Ki.current.add(C);const Z=`local-${Date.now()}`;lt(C,Ne=>({...Ne,messages:[...Ne.messages,{id:Z,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),ll(C,"running"),Be(C,!0),gi(C),await jn();const we=new AbortController;hn.current.set(C,we);try{let Ne=null;const _e=ye(`conversations/${C}/turns`),pe=await fetch(_e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:S})});if(pe.ok){const _n=await pe.json();if(!_n.turnId)throw new Error("Turn did not return a turn id");Ne=_n.turnId,(S==="complex"||x)&&(ur(C),A("simple")),_n.message&&Pt(C,Z,_n.message,Ne)}else{const _n=await uT(pe);if(_n){Ne=_n;const al=await Bl(C,_n,k);if(!al.ok)throw await Wt(al,{method:"POST",url:ye(`conversations/${C}/turns/${_n}/steer`)});const Ma=await al.json();Ma.message&&Pt(C,Z,Ma.message,_n)}else throw await Wt(pe,{method:"POST",url:_e})}if(!Ne)throw await Wt(pe,{method:"POST",url:_e});en.current.set(C,Ne),await kr(C,Ne);const Vn=ye(`conversations/${C}/turns/${Ne}/events`),mt=await fetch(Vn,{signal:we.signal});if(!mt.ok||!mt.body)throw await Wt(mt,{method:"GET",url:Vn});await gp(mt.body,_n=>{const al=cp(_n,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);lt(C,xt=>({...xt,status:Fr(al)??xt.status,events:up(xt.events,al)}));const Ma=Fr(al);Ma&&ll(C,Ma)}),await _i(C),await jn()}catch(Ne){if(dp(Ne))return;const _e=oT(Ne);_e&&Ae("error","Reset thread required",x?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),en.current.has(C)||Nl.current.delete(C),lt(C,pe=>({...pe,status:"error",events:[...pe.events,{id:pe.events.length+1,event:"client.error",data:_e?{message:"Reset thread required",detail:x?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:$a(Ne),createdAt:new Date().toISOString()}]})),ll(C,"error"),await jn()}finally{Ki.current.delete(C),en.current.delete(C),hn.current.get(C)===we&&hn.current.delete(C),Be(C,!1),await br(C)}}async function br(y){const k=Wi.current.get(y)??[];if(k.length===0)return;const[C,...M]=k;Wi.current.set(y,M),await wr(y,C)}async function vr(y,k={}){if(Dt.current.has(y))return;const C=new AbortController;hn.current.set(y,C),Be(y,!0);try{const M=k.waitMs?`?waitMs=${k.waitMs}`:"",I=ye(`conversations/${y}/turns/current/events${M}`),Z=await fetch(I,{signal:C.signal});if(!Z.ok||!Z.body)throw await Wt(Z,{method:"GET",url:I});await gp(Z.body,we=>{const Ne=cp(we,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Ne.turnId&&!en.current.has(y)&&en.current.set(y,Ne.turnId),lt(y,pe=>({...pe,status:Fr(Ne)??pe.status,events:up(pe.events,Ne)}));const _e=Fr(Ne);_e&&ll(y,_e)}),await _i(y),await jn()}catch(M){if(!dp(M)){if(sT(M)){await _i(y),await jn();return}lt(y,I=>({...I,status:"error",events:[...I.events,{id:I.events.length+1,event:"client.error",data:$a(M),createdAt:new Date().toISOString()}]}))}}finally{en.current.delete(y),hn.current.get(y)===C&&hn.current.delete(y),Be(y,!1),await br(y)}}async function wr(y,k,C={}){if(en.current.has(y)){const I=Wi.current.get(y)??[];I.includes(k)||Wi.current.set(y,[...I,k]);return}const M=new AbortController;hn.current.set(y,M),en.current.set(y,k),Be(y,!0);try{const I=ye(`conversations/${y}/turns/${k}/events`),Z=await fetch(I,{signal:M.signal});if(!Z.ok||!Z.body)throw await Wt(Z,{method:"GET",url:I});await gp(Z.body,we=>{const Ne=cp(we,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);lt(y,pe=>({...pe,status:Fr(Ne)??pe.status,events:up(pe.events,Ne)}));const _e=Fr(Ne);_e&&ll(y,_e)}),await _i(y),await jn()}catch(I){if(!dp(I)){if(C.recovered&&rT(I)){await _i(y),await jn();return}lt(y,Z=>({...Z,status:"error",events:[...Z.events,{id:Z.events.length+1,event:"client.error",data:$a(I),createdAt:new Date().toISOString()}]}))}}finally{en.current.delete(y),hn.current.get(y)===M&&hn.current.delete(y),Be(y,!1),await br(y)}}async function Tn(y,k){const C=`local-queued-${Date.now()}`;lt(y,M=>({...M,messages:[...M.messages,{id:C,role:"user",content:k,createdAt:new Date().toISOString()}]})),gi(y);try{const M=ye(`conversations/${y}/turns`),I=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue"})});if(!I.ok)throw await Wt(I,{method:"POST",url:M});const Z=await I.json();if(!Z.turnId)throw new Error("Queued turn did not return a turn id");Z.message?Pt(y,C,Z.message,Z.turnId):An(y,C,Z.turnId),wr(y,Z.turnId),await jn(),Ae("success",Z.queuePosition?`Queued as next turn (${Z.queuePosition})`:"Started new turn")}catch(M){lt(y,I=>({...I,events:[...I.events,{id:I.events.length+1,event:"client.error",data:$a(M),createdAt:new Date().toISOString()}]}))}}async function Il(y,k){const C=en.current.get(y),M=`local-steer-${Date.now()}`;if(lt(y,I=>({...I,messages:[...I.messages,{id:M,role:"user",content:k,createdAt:new Date().toISOString(),turnId:C??null}],status:"running"})),gi(y),!C&&Ki.current.has(y)){Ul(y,k,M);return}try{const I=ye(C?`conversations/${y}/turns/${C}/steer`:`conversations/${y}/turns/steer`),Z=await fetch(I,ux(k));if(!Z.ok)throw await Wt(Z,{method:"POST",url:I});const we=await Z.json();we.message&&Pt(y,M,we.message,C)}catch(I){lt(y,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"client.error",data:$a(I),createdAt:new Date().toISOString()}]}))}}function Ul(y,k,C){const M=Nl.current.get(y)??[];Nl.current.set(y,[...M,{message:k,localMessageId:C}])}async function kr(y,k){const C=Nl.current.get(y)??[];if(C.length!==0){Nl.current.delete(y);for(const M of C){const I=await Bl(y,k,M.message);if(!I.ok)throw await Wt(I,{method:"POST",url:ye(`conversations/${y}/turns/${k}/steer`)});const Z=await I.json();Z.message&&Pt(y,M.localMessageId,Z.message,k)}}}async function Bl(y,k,C){return fetch(ye(`conversations/${y}/turns/${k}/steer`),ux(C))}function Pt(y,k,C,M){lt(y,I=>({...I,messages:wx(I.messages.filter(Z=>Z.id!==k),[{...C,turnId:M??C.turnId??null}])}))}function An(y,k,C){lt(y,M=>({...M,messages:M.messages.map(I=>I.id===k?{...I,turnId:C}:I)}))}async function Di(){var C;if(!m||ar!=="running"&&!ja)return;const y=m,k=en.current.get(y);(C=hn.current.get(y))==null||C.abort(),Be(y,!1),lt(y,M=>({...M,status:"done",events:[...M.events,{id:M.events.length+1,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),ll(y,"done");try{const M=ye(k?`conversations/${y}/turns/${k}/stop`:`conversations/${y}/turns/interrupt`),I=await fetch(M,{method:"POST"});if(!I.ok&&I.status!==409)throw await Wt(I,{method:"POST",url:M})}catch(M){lt(y,I=>({...I,events:[...I.events,{id:I.events.length+1,event:"client.error",data:$a(M),createdAt:new Date().toISOString()}]}))}en.current.delete(y)}async function rn(y,k){if(!m||!y.approvalTurnId||y.approvalRequestId===void 0)return;const C=m;try{const M=ye(`conversations/${C}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),I=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!I.ok)throw await Wt(I,{method:"POST",url:M});lt(C,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(M){lt(C,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"client.error",data:$a(M),createdAt:new Date().toISOString()}]}));const I=vt(M);Ae("error","Failed to respond to approval",I.detail??I.message)}}async function sn(y,k,C){const M=m,I=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!M||!I)return!1;try{const Z=ye(`conversations/${M}/workspace-change-proposals/${encodeURIComponent(I)}`),we=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?C??y.workspaceChangePayload:void 0})});if(!we.ok)throw await Wt(we,{method:"POST",url:Z});const Ne=await we.json();return st(Ne.conversation),lt(M,_e=>({..._e,events:[..._e.events,{id:`${y.id}:${k}`,event:"server.workspace_change.decision",data:{proposalId:I,changeType:y.workspaceChangeType??"responsibility",decision:k,payload:k==="accept"?C??y.workspaceChangePayload:null},createdAt:new Date().toISOString()}]})),Ae("success",k==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(Z){console.error(Z);const we=vt(Z);return Ae("error","Failed to respond to workspace change proposal",we.detail??we.message),!1}}async function gn(y,k,C){const M=m;if(!(!M||!y.knowledgeProposalId))try{let I;if(k==="accept")try{I=JSON.parse(C??y.body)}catch{Ae("error","Knowledge proposal JSON is invalid");return}const Z=ye(`conversations/${M}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),we=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:I})});if(!we.ok)throw await Wt(we,{method:"POST",url:Z});const Ne=await we.json();bl([...Ne.items??[]].sort(Mx)),lt(M,_e=>({..._e,events:[..._e.events,{id:`${y.id}:${k}`,event:"server.knowledge.decision",data:{proposalId:y.knowledgeProposalId,decision:k,knowledge:k==="accept"?Ne.item:null},createdAt:new Date().toISOString()}]})),Ae("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(I){console.error(I);const Z=vt(I);Ae("error","Failed to respond to knowledge proposal",Z.detail??Z.message)}}function su(y){H(k=>{const C=k[y.id],M=y.events.map(I=>({id:I.id,turnId:I.turnId,seq:I.seq,event:I.event,data:I.data,createdAt:I.createdAt}));return{...k,[y.id]:{messages:y.messages,events:op(M,(C==null?void 0:C.events)??[]),timelineNodes:Sx(y.timelineNodes??[],(C==null?void 0:C.timelineNodes)??[]),turns:kx(y.turns??[],(C==null?void 0:C.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:Go(y),loadingOlder:!1,fullEventTurnIds:(C==null?void 0:C.fullEventTurnIds)??new Set,loadingEventTurnIds:(C==null?void 0:C.loadingEventTurnIds)??new Set}}})}function js(y){const k=Go(y);lt(y.id,C=>{var M,I,Z;return{...C,messages:wx(y.messages,C.messages),timelineNodes:Sx(y.timelineNodes??[],C.timelineNodes),turns:kx(y.turns??[],C.turns),events:op(y.events.map(we=>({id:we.id,turnId:we.turnId,seq:we.seq,event:we.event,data:we.data,createdAt:we.createdAt})),C.events),contextVersions:(((M=y.contextVersions)==null?void 0:M.length)??0)>0?y.contextVersions??[]:C.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((I=C.history)==null?void 0:I.loadedMessageCount)??C.messages.length),loadedEventCount:k.loadedEventCount+(((Z=C.history)==null?void 0:Z.loadedEventCount)??C.events.length)},loadingOlder:!1}})}function lt(y,k){H(C=>{const M=C[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...C,[y]:k(M)}})}function ll(y,k){d(C=>C.map(M=>M.id===y?{...M,status:k,updatedAt:new Date().toISOString()}:M))}function st(y){d(k=>uo(k.map(C=>C.id===y.id?{...C,...y}:C)))}async function dt(y,k){const C=k.filter(M=>{const I=Q[y];return I&&!I.fullEventTurnIds.has(M)&&!I.loadingEventTurnIds.has(M)});if(C.length!==0){lt(y,M=>{const I=new Set(M.loadingEventTurnIds);for(const Z of C)I.add(Z);return{...M,loadingEventTurnIds:I}});try{const M=await Promise.all(C.map(I=>d2(y,I)));lt(y,I=>{const Z=new Set(I.fullEventTurnIds),we=new Set(I.loadingEventTurnIds),Ne=M.flatMap((_e,pe)=>{const Vn=C[pe];return Z.add(Vn),we.delete(Vn),_e.map(mt=>({id:mt.id,turnId:mt.turnId,seq:mt.seq,event:mt.event,data:mt.data,createdAt:mt.createdAt}))});return{...I,events:op(I.events,Ne),fullEventTurnIds:Z,loadingEventTurnIds:we}})}catch(M){console.error(M),lt(y,I=>{const Z=new Set(I.loadingEventTurnIds);for(const we of C)Z.delete(we);return{...I,loadingEventTurnIds:Z}}),Ae("error","Failed to load process details")}}}function Be(y,k){const C=new Set(Dt.current);k?C.add(y):C.delete(y),Dt.current=C,Uo(M=>{const I=new Set(M);return k?I.add(y):I.delete(y),I})}function Mi(y){y.key!=="Enter"||!y.metaKey&&!y.ctrlKey||y.nativeEvent.isComposing||(y.preventDefault(),xr({forceNewTurn:y.shiftKey}))}function Nn(y){er(k=>{const C=new Set(k);return C.has(y)?C.delete(y):C.add(y),ip(C),C})}function Cs(y){var k;return Gi.has(y.id)?"running":xc(y,((k=Q[y.id])==null?void 0:k.status)??y.status)}function ai(y){var M;const k=(M=tr.current)==null?void 0:M.getBoundingClientRect(),C=k?y-k.left:y;return ih(C)}function ou(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),ya(ai(y.clientX))}function uu(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),ya(ai(y.clientX)))}function ql(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const k=ai(y.clientX);ya(k),dT(k)}return o.jsxs("main",{className:`shell${K?" mobile-sidebar-open":""}`,ref:tr,style:{"--sidebar-width":`${Bo}px`},children:[o.jsxs("aside",{className:"sidebar",children:[o.jsxs("div",{className:"sidebar-header",children:[o.jsxs("div",{children:[o.jsxs("p",{className:"eyebrow brand-line",children:[o.jsx("span",{children:"Seele"}),Se?o.jsxs("span",{children:["v",Se]}):null,o.jsx("span",{"aria-label":$x(Te),className:`backend-status ${Te}`,"data-label":$x(Te)})]}),o.jsxs("div",{className:"sidebar-title-row",children:[o.jsx("h2",{children:"Workspaces"}),e?o.jsx("button",{"aria-label":`Sign out ${i.username}`,className:"sign-out-button",onClick:a,title:`Sign out ${i.username}`,type:"button",children:"Sign out"}):null]})]}),o.jsxs("div",{className:"sidebar-header-actions",children:[o.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>ee(!1),title:"Close workspace list",type:"button",children:"×"}),o.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:bs,children:"+"})]})]}),o.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:va.map(y=>o.jsxs("section",{className:["workspace-group",an===y.id?"dragging":"",ns===y.id?"drop-after":"",(Jt==null?void 0:Jt.kind)==="group"&&Jt.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[o.jsxs("div",{className:"workspace-group-header",children:[o.jsxs("button",{"aria-expanded":!is.has(y.id),className:"workspace-group-toggle",onClick:k=>{if(ls.current){k.preventDefault(),ls.current=!1;return}Nn(y.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),cr(y)},onPointerCancel:il,onPointerDown:k=>hr(k,y.id),onPointerMove:k=>mr(k,y.id),onPointerUp:k=>ks(k,y.id),type:"button",children:[o.jsx("span",{className:is.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),o.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),cr(y)},title:"Double-click to rename",children:y.title})]}),y.id!==sx?o.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),nu(y)},title:"Delete group",type:"button",children:"×"}):null]}),is.has(y.id)?null:o.jsx("div",{className:"workspace-group-items",children:y.conversations.map(k=>{const C=Cs(k);return o.jsxs("div",{className:["session-item",k.id===m?"active":"",k.id===Vi?"dragging":"",(Jt==null?void 0:Jt.kind)==="workspace"&&Jt.id===k.id?`drop-${Jt.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:M=>{if(Qi.current){M.preventDefault(),Qi.current=!1;return}b(k.id),ee(!1)},onDoubleClick:M=>{vs(M.target)||(M.preventDefault(),iu(k))},onKeyDown:M=>{ed(M.target)||M.key==="Enter"&&(b(k.id),ee(!1))},onPointerCancel:ws,onPointerDown:M=>pr(M,k.id),onPointerMove:M=>En(M,k.id),onPointerUp:M=>zl(M,k.id),role:"button",tabIndex:0,children:[o.jsxs("span",{className:"session-heading",children:[o.jsx("span",{"aria-label":bc(C,k.nextWakeup,ni),className:`session-status ${C}`,title:bc(C,k.nextWakeup,ni)}),o.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),C==="waiting"&&k.nextWakeup?o.jsx("span",{className:"session-countdown",title:bc(C,k.nextWakeup,ni),children:Ac(k.nextWakeup,ni)}):null,k.unreadTurnCount>0?o.jsx("span",{"aria-label":`${k.unreadTurnCount} unread turns`,className:"session-unread",title:`${k.unreadTurnCount} unread turns`,children:k.unreadTurnCount>99?"99+":k.unreadTurnCount}):null,C!=="running"?o.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:M=>{M.stopPropagation(),he(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),o.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",Wr(k.id)]})]},k.id)})})]},y.id))}),o.jsx("footer",{className:"sidebar-footer",children:o.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[o.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:Ta,type:"button",children:o.jsx(Cx,{})}),o.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Rl,type:"button",children:o.jsx(rN,{})}),o.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{vl(!0),ee(!1)},type:"button",children:o.jsx(Rp,{})}),o.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Aa,type:"button",children:o.jsx(sN,{})}),o.jsx(sA,{usage:Gc})]})})]}),o.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>ee(!1),tabIndex:K?0:-1,type:"button"}),o.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:ou,onPointerMove:uu,onPointerUp:ql,role:"separator",tabIndex:0}),lr&&Ja?o.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Ja.x+12}px, ${Ja.y+10}px, 0)`},children:[o.jsx("span",{className:"workspace-drag-title",children:lr.title}),o.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",Wr(lr.id)]})]}):null,T?o.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Ft,role:"presentation",children:o.jsxs("form",{className:"workspace-editor",onKeyDown:Ft,onSubmit:y=>void td(y),children:[o.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),o.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:au,onKeyDown:Ft,value:T.title}),T.mode==="create"?o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),o.jsx("select",{id:"workspace-group",onChange:gr,onKeyDown:Ft,value:T.groupId??((Hl=h[0])==null?void 0:Hl.id)??"",children:h.map(y=>o.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,o.jsxs("div",{className:"workspace-editor-actions",children:[o.jsx("button",{type:"button",onClick:nl,children:"Cancel"}),o.jsx("button",{disabled:E,type:"submit",children:E?"Saving...":T.mode==="create"?"Create":"Save"})]})]})}):null,He?o.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Gn,role:"presentation",children:o.jsxs("form",{className:"workspace-editor",onKeyDown:Gn,onSubmit:y=>void Ss(y),children:[o.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),o.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:Ll,onKeyDown:Gn,value:He.title}),o.jsxs("div",{className:"workspace-editor-actions",children:[o.jsx("button",{type:"button",onClick:dr,children:"Cancel"}),o.jsx("button",{type:"submit",children:He.mode==="create"?"Create":"Save"})]})]})}):null,St?o.jsx(DT,{currentUser:i,conversations:c,editingEnvironmentKey:Za,environmentDraft:Ti,globalEnvironment:bn,workspaceEnvironment:vn,memorySettings:da,memorySettingsDraft:Mo,workspaceMemoryDraft:fa,runtimeSettings:Gt,runtimeModels:Un,runtimeCodexVersion:yt,runtimeCodexReleasedAt:vi,runtimeCodexUpdating:(se==null?void 0:se.status)==="running",runtimeSettingsDraft:Qt,runtimeSettingsScope:zt,settingsWorkspace:Mt,settingsWorkspaceId:wt,workspaceGroups:va,workspaceRuntimeSettings:Xa,workspaceRuntimeSettingsDraft:ji,managedUsers:re,onCancelEnvironmentEdit:Jo,onClose:()=>dn(!1),onCreateUser:async y=>{const k=await J2(y);$(C=>[...C,k]),Ae("success","User created")},onDeleteUser:async y=>{await t_(y),$(k=>k.filter(C=>C.id!==y)),Ae("success","User deleted")},onDeleteEnvironment:y=>void Xc(y),onDraftChange:Hi,onEditEnvironment:Na,onRevealEnvironmentValue:y=>void eu(y),onSaveBaseMemoryItems:y=>Zo(y),onSaveResponsibility:async(y,k)=>{try{const C=await fc(y,{responsibility:k});return st(C),N("connected"),Ae("success","Workspace responsibility saved"),C.responsibility}catch(C){throw console.error(C),N("error"),Ae("error","Failed to save workspace responsibility"),C}},onSaveWorkspaceMemoryItems:y=>wt?Kc(wt,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:tt,onUpdateCodexCli:()=>{ne(!0),fs(!0)},onRuntimeScopeChange:Yt,onSettingsWorkspaceChange:Ko,onSubmitRuntimeSettings:y=>void Wo(y),onWorkspaceRuntimeDraftChange:Ci,onWorkspaceRuntimeReset:y=>wt?void Qo(wt,y):void 0,revealedEnvironmentKeys:Ht,onSubmitEnvironment:y=>void Wc(y),onUpdateUser:async(y,k)=>{const C=await e_(y,k);$(M=>M.map(I=>I.id===C.id?C:I)),Ae("success","User updated")}}):null,wi?o.jsx(_T,{currentReleasedAt:vi,currentVersion:yt,job:se,latest:fn,latestChecking:Xt,starting:Ge,onClose:()=>ne(!1),onRefresh:()=>void fs(),onStart:()=>void Fc()}):null,Ai&&je?o.jsx(ET,{conversation:je,clockNow:ni,knowledgeDraft:qi,workspaceKnowledge:Ro,tokenUsage:wa,onCancelKnowledgeEdit:()=>Ei(oo),onDeleteKnowledge:y=>void Zc(je.id,y),onEditKnowledge:mn,onKnowledgeDraftChange:Ei,onSubmitKnowledge:y=>void Qc(je.id,y),onClose:()=>pa(!1)}):null,zo?o.jsx(TT,{conversations:c,onClose:()=>vl(!1),workspaceGroups:va}):null,Jr?o.jsx(AT,{busy:wl,conversation:Sn??null,conversationId:ei,preview:(ln==null?void 0:ln.conversationId)===ei?ln:null,previewLoading:Lo,result:Ic,status:Ho,warmup:$i,workspaceGroups:va,onClose:()=>es(!1),onCancelResetPreview:()=>qn(null),onPreviewReset:()=>void hs(),onResetRuntime:y=>void ms(y),onSaveResetSelection:Xo,onWorkspaceChange:y=>{Ni(y),kl(null),qn(null)},onWarmupChange:ha}):null,G?o.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!de&&P(null),children:o.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:Da,onMouseDown:y=>y.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{children:"Clone workspace"}),o.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),o.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>P(null),type:"button",children:"×"})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Name"}),o.jsx("input",{autoFocus:!0,value:G.name,onChange:y=>P(k=>k&&{...k,name:y.target.value})})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Group"}),o.jsx("select",{value:G.groupId,onChange:y=>P(k=>k&&{...k,groupId:y.target.value}),children:va.map(y=>o.jsx("option",{value:y.id,children:y.title},y.id))})]}),o.jsxs("footer",{children:[o.jsx("button",{className:"secondary",disabled:de,onClick:()=>P(null),type:"button",children:"Cancel"}),o.jsx("button",{disabled:de||!G.name.trim(),type:"submit",children:de?"Cloning...":"Clone"})]})]})}):null,z?o.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>L(null),children:o.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"complex-task-detail-title",children:z.title}),o.jsxs("p",{children:[Hx(z.status),z.startedAt&&z.finishedAt?` · ${P2(z.startedAt,z.finishedAt)}`:""]})]}),o.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>L(null),type:"button",children:"×"})]}),o.jsxs("div",{className:"complex-task-detail task-record-detail",children:[o.jsxs("div",{children:[o.jsx("small",{children:"Objective"}),o.jsx("p",{children:z.objective??"No objective recorded."})]}),o.jsxs("div",{children:[o.jsx("small",{children:z.status==="completed"?"Final plan":"Current plan"}),z.currentPlan?o.jsx("article",{className:"message assistant complex-task-plan-preview",children:o.jsx("div",{className:"message-main",children:o.jsx("div",{className:"message-body",children:sa(z.currentPlan.planMarkdown,je)})})}):o.jsx("p",{children:"No plan recorded."})]}),o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Goal"}),o.jsx("dd",{children:z.codexGoalStatus??"not started"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Plan versions"}),o.jsx("dd",{children:z.planVersions.length})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Started"}),o.jsx("dd",{children:z.startedAt?Ze(z.startedAt):"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Finished"}),o.jsx("dd",{children:z.finishedAt?Ze(z.finishedAt):"—"})]})]})]}),o.jsx("footer",{children:o.jsx("button",{className:"secondary",onClick:()=>L(null),type:"button",children:"Close"})})]})}):null,D?o.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>X(null),children:o.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"system-event-detail-title",children:D.title}),o.jsx("p",{children:Ze(D.createdAt)})]}),o.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>X(null),type:"button",children:"×"})]}),o.jsx("div",{className:"system-event-detail-content",children:o.jsx(mc,{content:D.fullDetail??D.detail??"No additional details.",conversation:je,streaming:!1,onPreviewArtifact:kn,onCopyArtifactUrl:Zi,copiedArtifactUrl:Zt})}),o.jsxs("footer",{children:[D.linkedTaskId?o.jsx("button",{onClick:()=>{const y=D.linkedTaskId;X(null),Cn(y)},type:"button",children:"View task"}):null,o.jsx("button",{className:"secondary",onClick:()=>X(null),type:"button",children:"Close"})]})]})}):null,ge?o.jsx("div",{className:"memory-editor-overlay",onClick:()=>{be||he(null)},role:"presentation",children:o.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[o.jsxs("header",{children:[o.jsx("strong",{children:"Move Workspace to Recycle"}),o.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:be,onClick:()=>he(null),title:"Close",type:"button",children:"×"})]}),o.jsxs("p",{children:["Move ",o.jsx("strong",{children:ge.title})," to recycle?"]}),o.jsx("code",{children:ge.workspacePath}),o.jsxs("div",{className:"memory-delete-actions",children:[o.jsx("button",{className:"memory-dialog-button",disabled:be,onClick:()=>he(null),type:"button",children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button danger",disabled:be,onClick:()=>void tl(ge),type:"button",children:be?"Moving...":"Move to recycle"})]})]})}):null,Sl?o.jsxs("div",{className:`app-toast ${Sl.tone}`,role:"status",children:[o.jsx("strong",{children:Sl.text}),Sl.detail?o.jsx("pre",{children:Sl.detail}):null]}):null,o.jsxs("section",{className:"conversation",children:[o.jsxs("header",{className:"topbar",children:[o.jsxs("div",{className:"topbar-main",children:[o.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>ee(!0),title:"Workspaces",type:"button",children:o.jsx(aN,{})}),o.jsxs("div",{className:"topbar-heading",children:[o.jsx("div",{className:"topbar-title-row",children:o.jsx("h1",{children:(je==null?void 0:je.title)??"New workspace"})}),je?o.jsxs("p",{className:"topbar-workspace",children:["workspaces/",Wr(je.id)]}):null]})]}),o.jsx("div",{className:"topbar-actions",children:je?o.jsxs(o.Fragment,{children:[je.threadUpgradeRequired?o.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Aa,title:`当前 Thread 工具集已过期(${je.threadCapabilityVersion} / ${je.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:o.jsx(Cv,{})}):null,o.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:ys,title:"Clone workspace",type:"button",children:o.jsx(lN,{})}),o.jsxs("button",{className:`context-button has-usage ${ch(ka??0)}`,onClick:()=>pa(!0),style:{"--context-usage":`${uh(ka??0)}%`},title:wa&&ka!==null?`Context ${Math.round(ka)}% · ${Qn(wa.totalTokens)} / ${yc(wa.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[o.jsx("span",{children:"Context"}),o.jsxs("strong",{children:[Math.round(ka??0),"%"]})]}),o.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:Pc,title:"Workspace settings",type:"button",children:o.jsx(Cx,{})})]}):null})]}),x?o.jsxs("section",{className:`complex-task-bar ${x.status}`,children:[o.jsxs("button",{className:"complex-task-summary",onClick:()=>void Cn(x.id),title:"View complex task details",type:"button",children:[o.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),o.jsx("strong",{children:x.title}),o.jsx("span",{className:"complex-task-state",children:Hx(x.status)}),o.jsx("span",{className:"complex-task-duration",children:F2(x,ni)})]}),o.jsxs("div",{className:"complex-task-actions",children:[yp(x.status,"discussing","ready","replanning")?o.jsx("button",{disabled:!x.objective||!x.currentPlan,onClick:()=>void _a("start"),title:x.objective&&x.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,x.status==="active"?o.jsx("button",{onClick:()=>void _a("pause"),type:"button",children:"Pause"}):null,yp(x.status,"paused","waiting","blocked")?o.jsx("button",{onClick:()=>void _a("resume"),type:"button",children:"Resume"}):null,yp(x.status,"active","paused","waiting","blocked")?o.jsx("button",{className:"secondary",onClick:()=>void _a("replan"),type:"button",children:"Replan"}):null,o.jsx("button",{className:"quiet danger",onClick:()=>void _a("end"),type:"button",children:"End task"})]})]}):null,(je==null?void 0:je.status)==="initialization_failed"&&je.cloneLineage?o.jsxs("div",{className:"clone-initialization-error",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Clone initialization failed"}),o.jsx("span",{children:je.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),o.jsx("button",{onClick:()=>void xs(),type:"button",children:"Retry with a clean thread"})]}):null,o.jsx("div",{className:"stream",onScroll:()=>void Vc(),ref:El,style:{scrollPaddingBottom:qo},children:o.jsxs("div",{className:"stream-inner",style:{paddingBottom:qo},children:[_l.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("h2",{children:"Start a workspace"})}):null,o.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[je!=null&&je.cloneLineage&&ss.size>0?o.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[o.jsxs("strong",{children:["Inherited from ",je.cloneLineage.sourceWorkspaceTitle]}),o.jsxs("span",{children:["through ",Ze(je.cloneLineage.snapshotAt)," · ",je.cloneLineage.importedMessageCount," messages"]})]}):null,(jr=nt==null?void 0:nt.history)!=null&&jr.hasMoreBefore?o.jsx("div",{className:"history-loader",children:nt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,rs.map((y,k)=>{var we,Ne,_e;const C=((we=y.user)==null?void 0:we.type)==="system",M=y.turnIds.some(pe=>ss.has(pe)),I=rs[k+1],Z=M&&(!I||!I.turnIds.some(pe=>ss.has(pe)));return o.jsxs(O.Fragment,{children:[o.jsxs("section",{className:`turn-group${M?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?o.jsxs("div",{className:`turn-panel ${C?"system-turn":"user-turn"}`,children:[mo(y.user,je,kn,Zi,Zt,rn,sn,gn,Cn,X),o.jsx(go,{copied:jl===`${C?"system":"user"}-${y.id}-bottom`,content:yo(y.user),id:`${C?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:Ca})]}):null,y.followupUsers.length>0?o.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(pe=>o.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[o.jsx("span",{className:"followup-user-label",children:"Added while running"}),mo(pe,je,kn,Zi,Zt,rn,sn,gn,Cn,X),o.jsx(go,{copied:jl===`user-${pe.id}-bottom`,content:yo(pe),id:`user-${pe.id}-bottom`,timestamp:pe.createdAt,variant:"outside",onCopy:Ca})]},pe.id))}):null,(Ne=y.acceptedSystemInputs)==null?void 0:Ne.map(pe=>o.jsxs("div",{className:"turn-panel system-turn",children:[mo(pe,je,kn,Zi,Zt,rn,sn,gn,Cn,X),o.jsx(go,{copied:jl===`system-${pe.id}-bottom`,content:yo(pe),id:`system-${pe.id}-bottom`,timestamp:pe.createdAt,variant:"outside",onCopy:Ca})]},pe.id)),y.agentItems.length>0?o.jsx(WT,{group:y,conversation:je,allowProcessView:!M,copiedFooter:jl===`agent-${y.id}-bottom`,copiedArtifactUrl:Zt,running:!M&&wo(y.turnIds,Sa),onCopyArtifactUrl:Zi,onCopyBubble:Ca,onPreviewArtifact:kn,onLoadProcessDetails:pe=>je&&!M?dt(je.id,pe):void 0,onRespondApproval:rn,onRespondWorkspaceChangeProposal:sn,onRespondKnowledgeProposal:gn,onOpenComplexTask:Cn,onOpenSystemEvent:X}):null,(_e=y.trailingSystemItems)==null?void 0:_e.map(pe=>o.jsxs("div",{className:"turn-panel system-turn",children:[mo(pe,je,kn,Zi,Zt,rn,sn,gn,Cn,X),o.jsx(go,{copied:jl===`system-${pe.id}-bottom`,content:yo(pe),id:`system-${pe.id}-bottom`,timestamp:pe.createdAt,variant:"outside",onCopy:Ca})]},pe.id))]}),Z?o.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),o.jsxs("form",{className:"composer",onSubmit:ru,ref:Yi,children:[Ml?o.jsxs("div",{className:`global-activity ${Ml.tone??"running"}`,children:[rr?o.jsx("button",{"aria-label":"Stop current agent run",className:"turn-stop activity-stop",onClick:()=>void Di(),title:"Stop current agent run",type:"button",children:o.jsx(ZT,{})}):o.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),o.jsxs("div",{className:"global-activity-text",children:[o.jsx("span",{children:Ml.title}),Ml.detail?o.jsx("small",{children:Ml.detail}):null]}),rr?o.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,o.jsxs("div",{className:"composer-panel",children:[o.jsxs("button",{"aria-label":x?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!x||S==="complex",className:`complex-mode-button ${x||S==="complex"?"active":""}`,disabled:!!x,onClick:()=>A(y=>y==="complex"?"simple":"complex"),title:x?"End the current complex task before switching back":S==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[o.jsx(ov,{}),o.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:x?"Complex task active":S==="complex"?"Complex task mode on":"Complex task mode off"})]}),o.jsx("textarea",{onChange:y=>yr(y.target.value),onKeyDown:Mi,placeholder:"Cmd/Ctrl + Enter",ref:Fi,value:r}),o.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:!r.trim(),type:"submit",children:[o.jsx(JT,{}),o.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[o.jsxs("span",{children:[o.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),o.jsxs("span",{children:[o.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),wn?o.jsx("div",{className:"artifact-lightbox",onClick:()=>kn(null),role:"presentation",children:o.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[o.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>kn(null),type:"button",children:"×"}),o.jsx("img",{alt:wn.name,src:wn.url}),o.jsxs("figcaption",{children:[o.jsx("span",{children:wn.name}),o.jsxs("div",{className:"artifact-lightbox-actions",children:[o.jsx("a",{href:wn.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),o.jsx("button",{onClick:()=>void Zi(wn),type:"button",children:Zt===wn.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function ET({conversation:e,clockNow:i,knowledgeDraft:a,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:h,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,w]=O.useState("overview"),[S,A]=O.useState(!1),[z,L]=O.useState(!1),[D,X]=O.useState(null),[G,P]=O.useState(null),[de,_]=O.useState(!1),[K,ee]=O.useState(null),[Q,H]=O.useState(null),[oe,fe]=O.useState(!1),[Se,me]=O.useState(null),[re,$]=O.useState(null),ae=Uv(u),xe=xc(e,e.status),Te=D?D2(D):null;O.useEffect(()=>{A(!1),X(null),P(null),ee(null),H(null),me(null),$(null)},[e.id]),O.useEffect(()=>{x==="additionalContext"&&!K&&T()},[x,K]),O.useEffect(()=>{x==="compactions"&&!Se&&q()},[x,Se]);const N=()=>{A(!0),L(!0),P(null),LN(e.id).then(E=>X(E)).catch(E=>{const te=vt(E);P(te.detail?`${te.message}
|
|
82
|
+
${te.detail}`:te.message)}).finally(()=>L(!1))},T=()=>{_(!0),H(null),UN(e.id).then(E=>ee(E)).catch(E=>{const te=vt(E);H(te.detail?`${te.message}
|
|
83
|
+
${te.detail}`:te.message)}).finally(()=>_(!1))},q=()=>{fe(!0),$(null),BN(e.id).then(E=>me(E)).catch(E=>{const te=vt(E);$(te.detail?`${te.message}
|
|
84
|
+
${te.detail}`:te.message)}).finally(()=>fe(!1))};return o.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:o.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:E=>E.stopPropagation(),children:[o.jsxs("header",{className:"context-panel-header workspace-context-header",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"Workspace Context"}),o.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),o.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),o.jsxs("div",{className:"workspace-context-body",children:[o.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[o.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>w("overview"),type:"button",children:[o.jsx("span",{children:"Overview"}),o.jsx("small",{children:"Identity + state"})]}),o.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>w("responsibility"),type:"button",children:[o.jsx("span",{children:"Responsibility"}),o.jsx("small",{children:"Long-lived role"})]}),o.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>w("knowledge"),type:"button",children:[o.jsx("span",{children:"Knowledge"}),o.jsx("small",{children:"Sources + skills"})]}),o.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>w("runtime"),type:"button",children:[o.jsx("span",{children:"Runtime View"}),o.jsx("small",{children:"Thread + tokens"})]}),o.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>w("compactions"),type:"button",children:[o.jsx("span",{children:"Compactions"}),o.jsx("small",{children:"Context history"})]}),o.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>w("additionalContext"),type:"button",children:[o.jsx("span",{children:"Additional Context"}),o.jsx("small",{children:"Injected keys"})]})]}),o.jsx("div",{className:"workspace-context-content",children:x==="overview"?o.jsxs("div",{className:"workspace-context-grid",children:[o.jsxs("section",{className:`context-card wide workspace-status-detail ${xe}`,children:[o.jsx("h3",{children:"Current Status"}),o.jsx(We,{label:"Status",value:bc(xe,e.nextWakeup,i)}),e.nextWakeup?o.jsxs(o.Fragment,{children:[o.jsx(We,{label:"Wakeup state",value:e.nextWakeup.status}),o.jsx(We,{label:"Wake at",value:Ze(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?o.jsx(We,{label:"Remaining",value:Ac(e.nextWakeup,i)}):null,o.jsx(We,{label:"Created by",value:e.nextWakeup.createdBy}),o.jsx(We,{label:"Attempts",value:`${e.nextWakeup.attemptCount} / ${e.nextWakeup.maxAttempts}`,mono:!0}),o.jsxs("div",{className:"workspace-status-detail-text",children:[o.jsx("span",{children:"Wakeup instruction"}),o.jsx("pre",{children:e.nextWakeup.instruction})]}),e.nextWakeup.error?o.jsxs("div",{className:"workspace-status-detail-text error",children:[o.jsx("span",{children:"Wakeup error"}),o.jsx("pre",{children:e.nextWakeup.error})]}):null]}):null,e.statusError?o.jsxs("div",{className:"workspace-status-detail-text error",children:[o.jsx("span",{children:"Error"}),o.jsx("pre",{children:e.statusError})]}):e.status==="error"||e.status==="initialization_failed"?o.jsx("p",{className:"context-muted",children:"No persisted error detail is available for this status."}):null]}),o.jsxs("section",{className:"context-card",children:[o.jsx("h3",{children:"Workspace"}),o.jsx(We,{label:"Name",value:e.title}),o.jsx(We,{label:"ID",value:`workspaces/${Wr(e.id)}`,mono:!0}),o.jsx(We,{label:"Path",value:e.workspacePath,mono:!0})]}),o.jsxs("section",{className:"context-card",children:[o.jsx("h3",{children:"Context Assets"}),o.jsx(We,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),o.jsx(We,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),o.jsx(We,{label:"Knowledge",value:`${r.length} item${r.length===1?"":"s"}`})]}),o.jsxs("section",{className:"context-card wide",children:[o.jsx("h3",{children:"Current Responsibility"}),e.responsibility.trim()?o.jsx("div",{className:"context-markdown-preview",children:sa(e.responsibility,e)}):o.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),o.jsxs("section",{className:"context-card wide",children:[o.jsx("h3",{children:"Knowledge Index"}),o.jsx(sv,{items:r,onDelete:d,onEdit:E=>{h(E),w("knowledge")}})]})]}):x==="responsibility"?o.jsxs("section",{className:"context-tab-surface",children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Workspace Responsibility"}),o.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?o.jsx("div",{className:"context-card context-markdown-preview",children:sa(e.responsibility,e)}):o.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?o.jsx(BT,{draft:a,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:h,onSubmit:m}):x==="runtime"?o.jsxs("div",{className:"workspace-context-grid",children:[o.jsxs("section",{className:"context-card",children:[o.jsx("h3",{children:"Runtime"}),o.jsx(We,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),o.jsxs("div",{className:"thread-read-actions",children:[o.jsx("button",{disabled:z,onClick:N,type:"button",children:z?"Reading...":"Read Codex thread"}),S?o.jsx("button",{disabled:z,onClick:()=>A(!1),type:"button",children:"Hide"}):null]})]}),o.jsxs("section",{className:"context-card",children:[o.jsx("h3",{children:"Token Window"}),u?o.jsxs(o.Fragment,{children:[o.jsx(We,{label:"Used",value:ae===null?"unknown":`${Math.round(ae)}%`,mono:!0}),o.jsx(We,{label:"Latest usage",value:u.modelContextWindow?`${Qn(u.totalTokens)} / ${Qn(u.modelContextWindow)}`:Qn(u.totalTokens),mono:!0}),ae!==null?o.jsx("div",{className:`context-token-bar ${ch(ae)}`,children:o.jsx("span",{style:{width:`${uh(ae)}%`}})}):null,o.jsx(We,{label:"Input / output",value:`${yc(u.inputTokens)} / ${yc(u.outputTokens)}`,mono:!0}),o.jsx(We,{label:"Reasoning",value:yc(u.reasoningOutputTokens),mono:!0}),o.jsxs("p",{className:"context-muted",children:["Updated ",Ze(u.createdAt),"."]})]}):o.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),S?o.jsxs("section",{className:"context-card wide thread-read-panel",children:[o.jsx("h3",{children:"Runtime thread profile"}),o.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),z?o.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):G?o.jsx("pre",{className:"thread-read-error",children:G}):D?o.jsxs(o.Fragment,{children:[Te?o.jsx(FT,{summary:Te}):null,o.jsxs("details",{className:"thread-read-raw",open:!0,children:[o.jsx("summary",{children:"Raw thread/read JSON"}),o.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(D,null,2)})]})]}):o.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):x==="compactions"?o.jsxs("section",{className:"context-tab-surface",children:[o.jsxs("header",{className:"settings-section-header",children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Context Compactions"}),o.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),o.jsx("button",{className:"context-refresh-button",disabled:oe,onClick:q,type:"button",children:oe?"Refreshing...":"Refresh"})]}),re?o.jsx("pre",{className:"thread-read-error",children:re}):oe&&!Se?o.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Se!=null&&Se.length?o.jsx("div",{className:"context-compaction-list",children:Se.map(E=>o.jsxs("article",{className:"context-compaction-item",children:[o.jsxs("div",{className:"context-compaction-heading",children:[o.jsx("time",{children:Ze(E.completedAt??E.usageObservedAt??E.startedAt??"")}),o.jsx("span",{className:`context-compaction-status ${E.status}`,children:E.status==="completed"?"Completed":"Running"})]}),o.jsx("dl",{className:"context-compaction-facts",children:j2(E).map(te=>o.jsxs("div",{children:[o.jsx("dt",{children:te.label}),o.jsx("dd",{children:te.value})]},te.label))}),o.jsxs("small",{children:[ua(E.id),E.turnId?` · turn ${ua(E.turnId)}`:""]})]},E.id))}):o.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):o.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Additional Context"}),o.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),de?o.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):Q?o.jsx("pre",{className:"thread-read-error",children:Q}):K?o.jsx(VT,{preview:K,refreshing:de,onRefresh:T}):o.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function TT({conversations:e,onClose:i,workspaceGroups:a}){var N;const[r,u]=O.useState([]),[c,d]=O.useState("active"),[h,g]=O.useState(null),[m,b]=O.useState([]),[x,w]=O.useState(!0),[S,A]=O.useState(null),[z,L]=O.useState(null),[D,X]=O.useState(!1),[G,P]=O.useState(!1),[de,_]=O.useState(new Set),[K,ee]=O.useState({title:"",publicDescription:"",ownerWorkspaceId:((N=e[0])==null?void 0:N.id)??"",participantWorkspaceIds:[]}),Q=r.find(T=>T.id===h)??null,H=O.useMemo(()=>new Map(e.map(T=>[T.id,T.title])),[e]),oe=r.filter(T=>c==="archived"?T.status==="archived":T.status!=="archived"),fe=a.map(T=>({...T,conversations:T.conversations.filter(q=>q.id!==K.ownerWorkspaceId)})).filter(T=>T.conversations.length>0),Se=()=>{var T;ee({title:"",publicDescription:"",ownerWorkspaceId:((T=e[0])==null?void 0:T.id)??"",participantWorkspaceIds:[]}),_(new Set),L("create")},me=()=>{!Q||Q.status!=="active"||(ee({title:Q.title,publicDescription:Q.publicDescription,ownerWorkspaceId:Q.ownerWorkspaceId,participantWorkspaceIds:Q.members.filter(T=>T.role==="participant"&&T.status==="active").map(T=>T.workspaceId)}),_(new Set),L("edit"))},re=async(T,q=c)=>{var E;w(!0),A(null);try{const te=await Nx();u(te);const ge=te.filter(be=>q==="archived"?be.status==="archived":be.status!=="archived"),he=(T&&ge.some(be=>be.id===T)?T:null)??(h&&ge.some(be=>be.id===h)?h:((E=ge[0])==null?void 0:E.id)??null);g(he),b(he?await dc(he):[])}catch(te){A(te instanceof Ui?te.detail:te instanceof Error?te.message:String(te))}finally{w(!1)}};O.useEffect(()=>{re()},[]),O.useEffect(()=>{const T=window.setInterval(()=>{(async()=>{try{const q=await Nx();u(q),h&&q.some(E=>E.id===h)&&b(await dc(h))}catch{}})()},1e4);return()=>window.clearInterval(T)},[h]);const $=async T=>{g(T),A(null);try{b(await dc(T))}catch(q){A(q instanceof Ui?q.detail:q instanceof Error?q.message:String(q))}},ae=async T=>{var E;if(T===c)return;d(T),A(null);const q=((E=r.find(te=>T==="archived"?te.status==="archived":te.status!=="archived"))==null?void 0:E.id)??null;if(g(q),!q){b([]);return}try{b(await dc(q))}catch(te){A(te instanceof Ui?te.detail:te instanceof Error?te.message:String(te))}},xe=async T=>{var q;if(T.preventDefault(),!(!K.title.trim()||!K.ownerWorkspaceId)){P(!0),A(null);try{const E=z==="edit"&&Q?await gN(Q.id,{expectedVersion:Q.version,title:K.title.trim(),publicDescription:K.publicDescription.trim(),participantWorkspaceIds:K.participantWorkspaceIds}):await mN({...K,title:K.title.trim(),publicDescription:K.publicDescription.trim()});d("active"),L(null),ee({title:"",publicDescription:"",ownerWorkspaceId:((q=e[0])==null?void 0:q.id)??"",participantWorkspaceIds:[]}),await re(E.id,"active")}catch(E){A(E instanceof Ui?E.detail:E instanceof Error?E.message:String(E))}finally{P(!1)}}},Te=async()=>{if(!(!Q||Q.status!=="active")){P(!0),A(null);try{const T=await yN(Q.id,Q.version);X(!1),d("active"),await re(void 0,"active")}catch(T){A(T instanceof Ui?T.detail:T instanceof Error?T.message:String(T))}finally{P(!1)}}};return o.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:o.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:T=>T.stopPropagation(),children:[o.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"协作"}),o.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),o.jsxs("div",{className:"collaboration-header-actions",children:[o.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Se,title:"新建 Topic",type:"button",children:"+"}),o.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),S?o.jsx("div",{className:"collaboration-error",children:S}):null,o.jsxs("div",{className:"collaboration-body",children:[o.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[o.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[o.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void ae("active"),role:"tab",type:"button",children:"当前"}),o.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void ae("archived"),role:"tab",type:"button",children:"已归档"})]}),x?o.jsx("p",{children:"正在加载..."}):oe.length===0?o.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):oe.map(T=>o.jsxs("button",{className:`collaboration-topic-entry${T.id===h?" active":""}`,onClick:()=>void $(T.id),type:"button",children:[o.jsx("span",{children:T.title}),o.jsxs("small",{children:[T.members.length," 个工作空间 · ",T.status]})]},T.id))]}),o.jsx("main",{className:"collaboration-topic-detail",children:Q?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h3",{children:Q.title}),o.jsx("p",{children:Q.publicDescription||"没有公开描述。"})]}),o.jsxs("div",{className:"collaboration-topic-actions",children:[o.jsx("span",{children:Q.status}),Q.status==="active"?o.jsxs(o.Fragment,{children:[o.jsx("button",{"aria-label":`编辑 Topic ${Q.title}`,className:"memory-icon-button",onClick:me,title:"编辑",type:"button",children:o.jsx(zc,{})}),o.jsx("button",{"aria-label":`归档 Topic ${Q.title}`,className:"memory-icon-button",onClick:()=>X(!0),title:"归档",type:"button",children:o.jsx(oN,{})})]}):null]})]}),o.jsx("div",{className:"collaboration-members",children:Q.members.filter(T=>T.status==="active").map(T=>o.jsxs("span",{children:[T.workspaceTitleSnapshot,o.jsx("small",{children:T.role})]},`${T.workspaceId}-${T.membershipVersion}`))}),o.jsx("div",{className:"collaboration-message-list",children:m.length===0?o.jsx("p",{children:"还没有消息。"}):m.map(T=>o.jsxs("article",{children:[o.jsxs("header",{children:[o.jsx("strong",{children:T.senderTitleSnapshot}),o.jsx("span",{children:T.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${Ev(T.recipientWorkspaceIds.map(q=>H.get(q)??ua(q)))}`}),o.jsx("time",{children:Ze(T.createdAt)})]}),o.jsx("div",{className:"markdown-body",children:sa(T.contentMarkdown,void 0)})]},T.id))})]}):o.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),z?o.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!G&&L(null),children:o.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:T=>T.stopPropagation(),onSubmit:xe,children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h3",{children:z==="edit"?"编辑 Topic":"新建 Topic"}),o.jsx("p",{children:z==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),o.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>L(null),type:"button",children:"×"})]}),o.jsxs("label",{children:["标题",o.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:K.title,onChange:T=>ee(q=>({...q,title:T.target.value}))})]}),o.jsxs("label",{children:["公开描述",o.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:K.publicDescription,onChange:T=>ee(q=>({...q,publicDescription:T.target.value}))})]}),o.jsxs("label",{children:["Owner 工作空间",o.jsx("select",{disabled:z==="edit",value:K.ownerWorkspaceId,onChange:T=>ee(q=>({...q,ownerWorkspaceId:T.target.value,participantWorkspaceIds:q.participantWorkspaceIds.filter(E=>E!==T.target.value)})),children:a.map(T=>o.jsx("optgroup",{label:T.title,children:T.conversations.map(q=>o.jsx("option",{value:q.id,children:q.title},q.id))},T.id))})]}),o.jsxs("fieldset",{className:"collaboration-participant-groups",children:[o.jsx("legend",{children:"参与工作空间"}),o.jsxs("div",{className:"collaboration-participant-toolbar",children:[o.jsxs("span",{children:[K.participantWorkspaceIds.length," 个已选择"]}),o.jsxs("div",{children:[o.jsx("button",{onClick:()=>_(new Set),type:"button",children:"全部展开"}),o.jsx("button",{onClick:()=>_(new Set(fe.map(T=>T.id))),type:"button",children:"全部收起"})]})]}),fe.map(T=>{const q=T.conversations,E=q.filter(ge=>K.participantWorkspaceIds.includes(ge.id)).length,te=de.has(T.id);return o.jsxs("section",{className:"collaboration-participant-group",children:[o.jsxs("header",{children:[o.jsxs("button",{"aria-expanded":!te,className:"collaboration-group-toggle",onClick:()=>_(ge=>{const he=new Set(ge);return he.has(T.id)?he.delete(T.id):he.add(T.id),he}),type:"button",children:[o.jsx("span",{"aria-hidden":"true",className:te?void 0:"expanded",children:"›"}),o.jsx("strong",{children:T.title}),o.jsxs("small",{children:[E,"/",q.length]})]}),o.jsxs("label",{title:`选择 ${T.title} 全部工作空间`,children:[o.jsx("input",{checked:E===q.length,onChange:()=>ee(ge=>{const he=q.map(Le=>Le.id),be=new Set(ge.participantWorkspaceIds);return he.every(Le=>be.has(Le))?he.forEach(Le=>be.delete(Le)):he.forEach(Le=>be.add(Le)),{...ge,participantWorkspaceIds:Array.from(be)}}),type:"checkbox"}),o.jsx("span",{children:"全选"})]})]}),te?null:o.jsx("div",{children:q.map(ge=>o.jsxs("label",{className:"collaboration-participant-option",children:[o.jsx("input",{checked:K.participantWorkspaceIds.includes(ge.id),onChange:he=>ee(be=>({...be,participantWorkspaceIds:he.target.checked?[...be.participantWorkspaceIds,ge.id]:be.participantWorkspaceIds.filter(Le=>Le!==ge.id)})),type:"checkbox"}),o.jsx("span",{children:ge.title})]},ge.id))})]},T.id)})]}),o.jsxs("footer",{children:[o.jsx("button",{className:"secondary",disabled:G,onClick:()=>L(null),type:"button",children:"取消"}),o.jsx("button",{disabled:G||!K.title.trim()||!K.ownerWorkspaceId,type:"submit",children:G?"正在保存...":z==="edit"?"保存":"创建 Topic"})]})]})}):null,D&&Q?o.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!G&&X(!1),role:"presentation",children:o.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:T=>T.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h3",{children:"归档 Topic"}),o.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),o.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>X(!1),type:"button",children:"×"})]}),o.jsx("strong",{children:Q.title}),o.jsxs("footer",{children:[o.jsx("button",{className:"secondary",disabled:G,onClick:()=>X(!1),type:"button",children:"取消"}),o.jsx("button",{className:"danger",disabled:G,onClick:()=>void Te(),type:"button",children:G?"正在归档...":"归档"})]})]})}):null]})})}function AT({busy:e,conversation:i,conversationId:a,preview:r,previewLoading:u,result:c,status:d,warmup:h,workspaceGroups:g,onCancelResetPreview:m,onClose:b,onPreviewReset:x,onResetRuntime:w,onSaveResetSelection:S,onWorkspaceChange:A,onWarmupChange:z}){const L=!i||e||d==="running";return o.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:b,role:"presentation",children:o.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:D=>D.stopPropagation(),children:[o.jsxs("header",{className:"context-panel-header console-panel-header",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"Console"}),o.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),o.jsxs("div",{className:"console-header-actions",children:[o.jsxs("label",{className:"console-workspace-picker",children:[o.jsx("span",{children:"Workspace"}),o.jsx("select",{disabled:e,onChange:D=>A(D.target.value),value:a??"",children:g.map(D=>o.jsx("optgroup",{label:D.title,children:D.conversations.map(X=>o.jsxs("option",{value:X.id,children:[X.title," · workspaces/",Wr(X.id)]},X.id))},D.id))})]}),o.jsx("button",{"aria-label":"Close console",onClick:b,type:"button",children:"×"})]})]}),o.jsx("div",{className:"console-body",children:o.jsxs("section",{className:"console-card",children:[o.jsxs("div",{className:"console-card-heading",children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Workspace Runtime"}),o.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),o.jsx("span",{className:`console-status ${d}`,children:d})]}),o.jsxs("dl",{className:"console-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Workspace"}),o.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"ID"}),o.jsx("dd",{children:i?`workspaces/${Wr(i.id)}`:"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Thread"}),o.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),o.jsxs("label",{className:"console-toggle",children:[o.jsx("input",{checked:h,onChange:D=>z(D.target.checked),type:"checkbox"}),o.jsxs("span",{children:["Run a warmup turn after reset",o.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),o.jsxs("div",{className:"console-actions",children:[o.jsx("button",{className:"danger",disabled:L||u,onClick:x,type:"button",children:u?"Preparing preview...":"Preview runtime reset"}),d==="running"?o.jsx("span",{children:"Stop the running turn before resetting."}):null]}),c?o.jsxs("div",{className:"console-result",children:[o.jsx("strong",{children:"Runtime reset completed"}),o.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),o.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?o.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),r?o.jsx(NT,{busy:e,preview:r,warmup:h,onCancel:m,onConfirm:w,onSaveSelection:S}):null]})})}function NT({busy:e,preview:i,warmup:a,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,h]=O.useState(()=>new Set(i.entries.filter(_=>_.includedByDefault).map(_=>_.id))),[g,m]=O.useState(!1),[b,x]=O.useState(!1),[w,S]=O.useState(null),A=O.useRef(null),z=i.entries.filter(_=>d.has(_.id)),L=z.filter(_=>_.role==="user").length,D=z.length-L,X=i.entries.length>0&&d.size===i.entries.length;O.useEffect(()=>{A.current&&(A.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const G=e||b;async function P(_){x(!0),S(null);try{await c(i.entries.filter(K=>_.has(K.id)).map(K=>K.id)),h(_)}catch(K){S(vt(K).message)}finally{x(!1)}}function de(_,K){const ee=new Set(d);K?ee.add(_):ee.delete(_),P(ee)}return o.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:G?void 0:r,role:"presentation",children:o.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:_=>_.stopPropagation(),role:"dialog",children:[o.jsxs("header",{className:"reset-preview-header",children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Confirm runtime reset"}),o.jsx("p",{children:"Visible history that will be restored, with each message's original time."})]}),o.jsxs("div",{className:"reset-preview-header-actions",children:[o.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(_=>!_),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),o.jsx("button",{"aria-label":"Close reset preview",disabled:G,onClick:r,type:"button",children:"×"})]})]}),o.jsxs("div",{className:"reset-preview-summary",children:[o.jsxs("label",{className:"reset-preview-select-all",children:[o.jsx("input",{checked:X,disabled:G||i.entries.length===0,onChange:_=>void P(_.target.checked?new Set(i.entries.map(K=>K.id)):new Set),ref:A,type:"checkbox"}),o.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),o.jsxs("span",{children:[L," user"]}),o.jsxs("span",{children:[D," assistant"]}),o.jsx("span",{children:a?"Warmup enabled":"No warmup"}),b?o.jsx("span",{children:"Saving defaults..."}):null,w?o.jsx("span",{className:"reset-preview-selection-error",children:w}):null]}),o.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((_,K)=>o.jsxs("article",{className:`reset-preview-item ${_.role} ${d.has(_.id)?"":"excluded"}`,children:[o.jsxs("header",{children:[o.jsxs("label",{children:[o.jsx("input",{"aria-label":`Include ${_.role} message ${K+1}`,checked:d.has(_.id),disabled:G,onChange:ee=>de(_.id,ee.target.checked),type:"checkbox"}),o.jsx("span",{children:K+1})]}),o.jsx("strong",{children:_.role}),o.jsx("time",{dateTime:_.createdAt,children:Ze(_.createdAt)})]}),o.jsx("pre",{children:_.content})]},_.id)):o.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),o.jsxs("footer",{className:"reset-preview-actions",children:[o.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),o.jsxs("div",{children:[o.jsx("button",{disabled:G,onClick:r,type:"button",children:"Cancel"}),o.jsx("button",{className:"danger",disabled:G,onClick:()=>u(i.entries.filter(_=>d.has(_.id)).map(_=>_.id)),type:"button",children:e?"Resetting...":"Confirm reset"})]})]})]})})}function _T({currentReleasedAt:e,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:h,onStart:g}){const m=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&q2(r.version,m)?B2(r.version):null;return O.useEffect(()=>{const x=w=>{w.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),o.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:o.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Codex CLI update"}),o.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),o.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),o.jsxs("dl",{className:"codex-update-summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Status"}),o.jsx("dd",{className:a?`status-${a.status}`:void 0,children:(a==null?void 0:a.status)??"Not started"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Current"}),o.jsx("dd",{children:Ip(m,(a==null?void 0:a.codexReleasedAt)??e)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Latest"}),o.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?Ip(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?o.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),a?o.jsxs("div",{children:[o.jsx("dt",{children:"Started"}),o.jsx("dd",{children:Ze(a.startedAt)})]}):null]}),r!=null&&r.error?o.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",r.error]}):null,o.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:a!=null&&a.logs.length?a.logs.map((x,w)=>o.jsxs("div",{className:`log-${x.stream}`,children:[o.jsx("time",{children:U2(x.at)}),o.jsx("span",{children:x.text})]},`${x.at}-${w}`)):o.jsx("p",{children:"No update logs yet."})}),o.jsxs("footer",{children:[o.jsx("button",{className:"secondary",onClick:h,type:"button",children:"Refresh"}),o.jsx("button",{disabled:c||(a==null?void 0:a.status)==="running",onClick:g,type:"button",children:c?"Starting...":(a==null?void 0:a.status)==="running"?"Updating...":a?"Run again":"Start update"})]})]})})}function DT({currentUser:e,conversations:i,editingEnvironmentKey:a,environmentDraft:r,globalEnvironment:u,workspaceEnvironment:c,memorySettings:d,memorySettingsDraft:h,managedUsers:g,workspaceMemoryDraft:m,runtimeSettings:b,runtimeModels:x,runtimeCodexVersion:w,runtimeCodexReleasedAt:S,runtimeCodexUpdating:A,runtimeSettingsDraft:z,runtimeSettingsScope:L,settingsWorkspace:D,settingsWorkspaceId:X,workspaceGroups:G,workspaceRuntimeSettings:P,workspaceRuntimeSettingsDraft:de,onCancelEnvironmentEdit:_,onClose:K,onCreateUser:ee,onDeleteUser:Q,onDeleteEnvironment:H,onDraftChange:oe,onEditEnvironment:fe,onSaveBaseMemoryItems:Se,onSaveResponsibility:me,onSaveWorkspaceMemoryItems:re,onRevealEnvironmentValue:$,onRuntimeDraftChange:ae,onUpdateCodexCli:xe,onRuntimeScopeChange:Te,onSettingsWorkspaceChange:N,onSubmitRuntimeSettings:T,onSubmitEnvironment:q,onUpdateUser:E,onWorkspaceRuntimeDraftChange:te,onWorkspaceRuntimeReset:ge,revealedEnvironmentKeys:he}){const[be,Le]=O.useState("model"),[He,At]=O.useState(!1),[St,dn]=O.useState(null),[bn,jt]=O.useState(!1),[vn,ze]=O.useState((D==null?void 0:D.responsibility)??""),[Gt,Jn]=O.useState(!1),Un=O.useRef(null),di=L==="workspace"?Object.values((P==null?void 0:P.sources)??{}).filter(yt=>yt==="workspace").length:0;return O.useEffect(()=>{L==="global"&&jt(!1)},[L]),O.useEffect(()=>{ze((D==null?void 0:D.responsibility)??"")},[D==null?void 0:D.id,D==null?void 0:D.responsibility]),O.useEffect(()=>{if(!bn)return;const yt=vi=>{var wi;const Nt=vi.target;Nt instanceof Node&&((wi=Un.current)!=null&&wi.contains(Nt))||jt(!1)},Vt=vi=>{vi.key==="Escape"&&jt(!1)};return document.addEventListener("pointerdown",yt,!0),document.addEventListener("keydown",Vt,!0),()=>{document.removeEventListener("pointerdown",yt,!0),document.removeEventListener("keydown",Vt,!0)}},[bn]),o.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:K,role:"presentation",children:o.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:yt=>yt.stopPropagation(),children:[o.jsxs("header",{className:"context-panel-header settings-panel-header",children:[o.jsxs("div",{className:"settings-panel-title",children:[o.jsx("h2",{children:"Settings"}),o.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?o.jsx("button",{"aria-checked":L==="global",className:L==="global"?"active":void 0,onClick:()=>Te("global"),role:"radio",type:"button",children:"Global"}):null,o.jsxs("div",{className:"settings-workspace-picker",ref:Un,children:[o.jsx("button",{"aria-checked":L==="workspace","aria-expanded":L==="workspace"?bn:void 0,"aria-label":L==="workspace"?"Settings workspace target":void 0,className:L==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(L!=="workspace"){Te("workspace");return}jt(yt=>!yt)},role:"radio",type:"button",children:L==="workspace"?o.jsxs(o.Fragment,{children:[o.jsxs("span",{children:["Workspace: ",(D==null?void 0:D.title)??"Select workspace"]}),o.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),L==="workspace"&&bn?o.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:G.map(yt=>o.jsxs("div",{className:"settings-workspace-menu-group",children:[o.jsx("div",{className:"settings-workspace-menu-heading",children:yt.title}),yt.conversations.map(Vt=>o.jsxs("button",{"aria-selected":Vt.id===X,className:Vt.id===X?"selected":void 0,onClick:()=>{N(Vt.id),jt(!1)},role:"option",type:"button",children:[o.jsx("span",{children:Vt.title}),o.jsxs("small",{children:["workspaces/",Vt.id]})]},Vt.id))]},yt.id))}):null]})]})]}),o.jsx("div",{className:"settings-header-actions",children:o.jsx("button",{"aria-label":"Close settings panel",onClick:K,type:"button",children:"×"})})]}),o.jsxs("div",{className:"settings-body",children:[o.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[o.jsxs("button",{className:be==="model"?"active":void 0,onClick:()=>Le("model"),type:"button",children:[o.jsx("span",{children:"Runtime"}),o.jsx("small",{children:"Effective settings"})]}),o.jsxs("button",{className:be==="responsibility"?"active":void 0,onClick:()=>Le("responsibility"),type:"button",children:[o.jsx("span",{children:"Responsibility"}),o.jsx("small",{children:"Workspace role"})]}),o.jsxs("button",{className:be==="memory"?"active":void 0,onClick:()=>Le("memory"),type:"button",children:[o.jsx("span",{children:"Memory"}),o.jsx("small",{children:"Base + workspace context"})]}),o.jsxs("button",{className:be==="environment"?"active":void 0,onClick:()=>Le("environment"),type:"button",children:[o.jsx("span",{children:"Environment"}),o.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?o.jsxs("button",{className:be==="users"?"active":void 0,onClick:()=>Le("users"),type:"button",children:[o.jsx("span",{children:"Users"}),o.jsx("small",{children:"Access + roles"})]}):null]}),o.jsxs("section",{className:"settings-content",children:[o.jsxs("div",{className:`settings-scope-banner ${L==="workspace"?"workspace":"global"}`,children:[o.jsx("strong",{children:L==="workspace"?"Editing workspace custom settings":"Editing global settings"}),o.jsx("span",{children:L==="workspace"?`${(D==null?void 0:D.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}),be==="users"?o.jsx(OT,{currentUser:e,users:g,onCreate:ee,onDelete:Q,onUpdate:E}):be==="model"?o.jsx(RT,{draft:L==="workspace"?de:z,globalSettings:b,models:x,codexVersion:w,codexReleasedAt:S,codexUpdating:A,scope:L,workspaceOverrideCount:di,settings:L==="workspace"?(P==null?void 0:P.effective)??de:b,workspaceSettings:P,onDraftChange:L==="workspace"?te:ae,onResetWorkspaceSetting:ge,onSubmit:T,onUpdateCodexCli:xe}):be==="responsibility"?o.jsx(MT,{draft:vn,saving:Gt,scope:L,workspace:D,onDraftChange:ze,onSubmit:yt=>{yt.preventDefault(),yt.stopPropagation(),!(L!=="workspace"||!D)&&(Jn(!0),me(D.id,vn).then(Vt=>ze(Vt)).finally(()=>Jn(!1)))}}):be==="memory"?o.jsx(zT,{baseSettings:d,scope:L,workspaceSettings:m,workspaceName:D==null?void 0:D.title,onSaveBaseItems:Se,onSaveWorkspaceItems:re}):o.jsx(UT,{deleteConfirmKey:St,editingEnvironmentKey:a,environmentDraft:r,globalEnvironment:u,scope:L,workspaceEnvironment:c,valueVisible:He,onCancelEnvironmentEdit:_,onDeleteConfirmChange:dn,onDeleteEnvironment:H,onDraftChange:oe,onEditEnvironment:fe,onRevealEnvironmentValue:$,onSubmitEnvironment:q,onValueVisibleChange:At,revealedEnvironmentKeys:he})]})]})]})})}function MT({draft:e,saving:i,scope:a,workspace:r,onDraftChange:u,onSubmit:c}){const d=a==="workspace";return o.jsxs(o.Fragment,{children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Responsibility"}),o.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),d&&r?o.jsxs("form",{className:"settings-responsibility-form",onSubmit:c,children:[o.jsxs("label",{children:[o.jsx("span",{children:r.title}),o.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:h=>u(h.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),o.jsx("div",{className:"settings-form-actions",children:o.jsx("button",{disabled:i,type:"submit",children:i?"Saving...":"Save responsibility"})})]}):o.jsx("section",{className:"settings-readonly-block",children:o.jsxs("div",{children:[o.jsx("strong",{children:"Workspace-only setting"}),o.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function OT({currentUser:e,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,h]=O.useState(null),[g,m]=O.useState(c),[b,x]=O.useState(!1),[w,S]=O.useState(null),[A,z]=O.useState("");function L(){m(c),z(""),h("new")}function D(P){m({username:P.username,password:"",role:P.role,active:P.active}),z(""),h(P)}function X(){b||(h(null),z(""))}async function G(P){if(P.preventDefault(),!!d){x(!0),z("");try{d==="new"?await a({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),h(null)}catch(de){z(vt(de).message)}finally{x(!1)}}}return o.jsxs("section",{className:"settings-section user-management-section",children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Users"}),o.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),o.jsx("div",{className:"memory-items-editor-header actions-only",children:o.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:L,title:"Add user",type:"button",children:"+"})}),o.jsxs("div",{className:"user-list",children:[i.map(P=>o.jsxs("div",{className:"user-list-item",children:[o.jsxs("div",{className:"user-list-main",children:[o.jsxs("div",{children:[o.jsx("strong",{children:P.username}),P.id===e.id?o.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),o.jsxs("small",{children:["Created ",Ze(P.createdAt)]})]}),o.jsx("span",{className:`user-role-badge role-${P.role}`,children:P.role}),o.jsx("span",{className:`user-status ${P.active?"active":"disabled"}`,children:P.active?"Active":"Disabled"}),o.jsxs("div",{className:"user-row-actions",children:[o.jsx("button",{"aria-label":`Edit user ${P.username}`,className:"memory-icon-button",onClick:()=>D(P),title:"Edit",type:"button",children:o.jsx(zc,{})}),o.jsx("button",{"aria-label":`Delete user ${P.username}`,className:"memory-icon-button memory-item-delete",disabled:P.id===e.id,onClick:()=>{z(""),S(P)},title:"Delete",type:"button",children:"×"})]})]},P.id)),i.length===0?o.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?o.jsx("div",{className:"memory-editor-overlay",onClick:X,role:"presentation",children:o.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:P=>P.stopPropagation(),onSubmit:P=>void G(P),children:[o.jsxs("header",{children:[o.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),o.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:X,title:"Close",type:"button",children:"×"})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Username"}),o.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:P=>m(de=>({...de,username:P.target.value})),placeholder:"Sign-in username",value:g.username})]}),o.jsxs("label",{children:[o.jsx("span",{children:d==="new"?"Initial password":"New password"}),o.jsx("input",{autoComplete:"new-password",minLength:8,onChange:P=>m(de=>({...de,password:P.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Role"}),o.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:P=>m(de=>({...de,role:P.target.value==="admin"?"admin":"user"})),value:g.role,children:[o.jsx("option",{value:"user",children:"User"}),o.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?o.jsxs("label",{className:"user-editor-active",children:[o.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:P=>m(de=>({...de,active:P.target.checked})),type:"checkbox"}),o.jsx("span",{children:"Account active"})]}):null,A?o.jsx("p",{className:"memory-editor-error",children:A}):null,o.jsxs("div",{className:"memory-editor-actions",children:[o.jsx("button",{className:"memory-dialog-button",onClick:X,type:"button",children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button primary",disabled:b||!g.username.trim()||d==="new"&&g.password.length<8||d!=="new"&&g.password.length>0&&g.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,w?o.jsx("div",{className:"memory-editor-overlay",onClick:()=>S(null),role:"presentation",children:o.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:P=>P.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("strong",{children:"Delete User"}),o.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>S(null),title:"Close",type:"button",children:"×"})]}),o.jsxs("p",{children:["Delete ",o.jsx("strong",{children:w.username}),". Users that own workspaces must be disabled instead."]}),A?o.jsx("p",{className:"memory-editor-error",children:A}):null,o.jsxs("div",{className:"memory-delete-actions",children:[o.jsx("button",{className:"memory-dialog-button",onClick:()=>S(null),type:"button",children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(w.id).then(()=>S(null)).catch(P=>z(vt(P).message))},type:"button",children:"Delete"})]})]})}):null]})}function RT({codexReleasedAt:e,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:h,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:w,onUpdateCodexCli:S}){var z;const A=d==="workspace";return o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"settings-section-header",children:[o.jsxs("div",{children:[o.jsx("h3",{children:"Runtime"}),o.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),A?o.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),o.jsxs("form",{className:"settings-form runtime-form",onSubmit:w,children:[o.jsxs("label",{className:fo(A,Li(r.model,u.model,m==null?void 0:m.sources.model)),children:[o.jsx(co,{globalValue:Ux(u.model,c),isWorkspaceScope:A,label:"Model",settingKey:"model",source:Li(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),o.jsx(rp,{"aria-label":"Runtime model",onChange:L=>b({...r,model:L}),options:H2(c,r.model),value:r.model||((z=c.find(L=>L.isDefault))==null?void 0:z.model)||""})]}),o.jsxs("label",{className:fo(A,Li(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[o.jsx(co,{globalValue:Ix(u.reasoningEffort),isWorkspaceScope:A,label:"Reasoning effort",settingKey:"reasoningEffort",source:Li(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),o.jsx(rp,{"aria-label":"Runtime reasoning effort",onChange:L=>b({...r,reasoningEffort:L}),options:lT,value:r.reasoningEffort})]}),o.jsxs("label",{className:fo(A,Li(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[o.jsx(co,{globalValue:qx(u.sandbox),isWorkspaceScope:A,label:"Permission mode",settingKey:"sandbox",source:Li(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),o.jsx(rp,{"aria-label":"Permission mode",onChange:L=>b({...r,sandbox:L}),options:aT,value:r.sandbox})]}),o.jsxs("label",{className:fo(A,Li(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[o.jsxs("span",{children:[o.jsx(co,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:A,label:"Fast mode",settingKey:"fastMode",source:Li(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:x}),o.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),o.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:L=>b({...r,fastMode:L.target.checked}),type:"checkbox"})]}),o.jsxs("label",{className:fo(A,Li(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),"settings-toggle-field"),children:[o.jsxs("span",{children:[o.jsx(co,{globalValue:u.notifyEnabled?"On":"Off",isWorkspaceScope:A,label:"Profuse notification",settingKey:"notifyEnabled",source:Li(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),onReset:x}),o.jsx("small",{children:"Send DingTalk notification when a turn finishes or fails"})]}),o.jsx("input",{"aria-label":"Enable Profuse notification",checked:r.notifyEnabled,onChange:L=>b({...r,notifyEnabled:L.target.checked}),type:"checkbox"})]}),o.jsxs("dl",{className:"runtime-summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Current"}),o.jsxs("dd",{children:["Model ",Ux(h.model,c),", reasoning"," ",Ix(h.reasoningEffort),", Fast mode"," ",h.fastMode?"on":"off",", permission"," ",qx(h.sandbox),", notification"," ",h.notifyEnabled?"on":"off","."]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Codex CLI"}),o.jsxs("dd",{className:"runtime-version-value",children:[o.jsx("span",{children:Ip(i,e)}),o.jsx("button",{className:"runtime-update-button",disabled:a,onClick:S,type:"button",children:a?"Updating...":"Check update"})]})]})]}),o.jsx("div",{className:"settings-form-actions",children:o.jsx("button",{type:"submit",children:A?"Save workspace overrides":"Save global runtime"})})]})]})}function co({globalValue:e,isWorkspaceScope:i,label:a,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return o.jsxs("span",{className:"runtime-field-label",children:[o.jsx("span",{children:a}),i?o.jsxs("span",{className:"runtime-field-meta",children:[o.jsx("span",{className:d?"override":"inherited",children:d?"Workspace override":`Inherited: ${e}`}),d?o.jsx("button",{type:"button",onClick:()=>c(r),children:"Reset"}):null]}):null]})}function rp({"aria-label":e,onChange:i,options:a,value:r}){const[u,c]=O.useState(!1),d=O.useRef(null),h=a.find(g=>g.value===r)??a[0]??null;return O.useEffect(()=>{if(!u)return;function g(b){var x;(x=d.current)!=null&&x.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),o.jsxs("div",{className:"runtime-select",ref:d,children:[o.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[o.jsx("span",{children:(h==null?void 0:h.label)??r}),o.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?o.jsx("div",{className:"runtime-select-menu",role:"listbox",children:a.map(g=>o.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Li(e,i,a){return e!==i?"workspace":a}function fo(e,i,a="settings-wide-field"){return[a,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function zT({baseSettings:e,scope:i,workspaceSettings:a,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",h=d?a.items:e.items,g=d?c:u;return o.jsxs(o.Fragment,{children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),o.jsx("p",{children:d?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),d?o.jsxs("section",{className:"settings-readonly-block",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Base Memory"}),o.jsx("span",{children:"Read-only in workspace scope"})]}),o.jsx(IT,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,o.jsx("div",{className:"memory-manager-shell",children:o.jsx(LT,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:h,onSaveItems:g,title:""})})]})}function LT({ariaLabel:e,emptyText:i,items:a,onSaveItems:r,title:u}){var K;const[c,d]=O.useState(jo(a)),[h,g]=O.useState(null),[m,b]=O.useState({key:"",value:""}),[x,w]=O.useState(null),[S,A]=O.useState(null),[z,L]=O.useState(null);O.useEffect(()=>{d(jo(a))},[a]),O.useEffect(()=>{if(h===null)return;const ee=Q=>{Q.key==="Escape"&&(P(),A(null))};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[h]);async function D(ee,Q){L(Q);try{const H=await r(ee);return d(jo(H)),H}finally{L(null)}}function X(){A(null),w(null),b({key:"",value:""}),g("new")}function G(ee){const Q=c[ee];Q&&(A(null),w(null),b({...Q}),g(ee))}function P(){g(null),w(null),b({key:"",value:""})}async function de(ee){const Q=c[ee],H=(Q==null?void 0:Q.key)||`${ee}`;await D(c.filter((oe,fe)=>fe!==ee),`delete:${H}`),A(null)}async function _(ee){ee.preventDefault(),ee.stopPropagation();const Q=m.key.trim(),H=YN(Q);if(H){w(H);return}const oe=m.value.trim();if(!oe){w("Value is required.");return}const fe=h==="new"?-1:h;if(c.some((me,re)=>re!==fe&&me.key.trim()===Q)){w(`Key "${Q}" already exists. Each memory key must be unique.`);return}const Se={...m,key:Q,value:oe};h==="new"?await D([...c,Se],"add"):typeof h=="number"&&await D(c.map((me,re)=>re===h?Se:me),`save:${h}`),P()}return o.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[o.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?o.jsx("span",{children:u}):null,o.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:X,children:"+"})]}),c.length?o.jsx("div",{className:"memory-items-grid",children:c.map((ee,Q)=>o.jsxs("div",{className:"memory-item-display",children:[o.jsxs("pre",{"aria-label":`Memory item ${ee.key}`,children:[o.jsx("span",{className:"memory-tag",children:`<${ee.key}>`}),`
|
|
85
|
+
`,o.jsx("span",{children:ee.value}),`
|
|
86
|
+
`,o.jsx("span",{className:"memory-tag",children:`</${ee.key}>`})]}),o.jsxs("div",{className:"memory-item-actions",children:[o.jsx("button",{"aria-label":`Edit memory item ${ee.key||Q+1}`,className:"memory-icon-button memory-item-edit",disabled:z!==null,title:"Edit",type:"button",onClick:()=>G(Q),children:"✎"}),o.jsx("button",{"aria-label":`Delete memory item ${ee.key||Q+1}`,className:"memory-icon-button memory-item-delete",disabled:z!==null,title:"Delete",type:"button",onClick:()=>A(Q),children:"×"})]})]},`${Q}-${ee.key}`))}):o.jsx("p",{className:"settings-note",children:i}),h!==null?o.jsx("div",{className:"memory-editor-overlay",onClick:P,role:"presentation",children:o.jsxs("form",{"aria-label":h==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:ee=>ee.stopPropagation(),onSubmit:ee=>void _(ee),children:[o.jsxs("header",{children:[o.jsx("strong",{children:h==="new"?"Add Memory":"Edit Memory"}),o.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:P,children:"×"})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Key"}),o.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:ee=>b(Q=>({...Q,key:ee.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Value · up to 1000 tokens"}),o.jsx("textarea",{onChange:ee=>b(Q=>({...Q,value:ee.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),x?o.jsx("p",{className:"memory-editor-error",children:x}):null,o.jsxs("div",{className:"memory-editor-actions",children:[o.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:P,children:"Cancel"}),o.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:z!==null,type:"submit",children:z==="add"||z!=null&&z.startsWith("save:")?"Saving...":"Save"})]})]})}):null,S!==null?o.jsx("div",{className:"memory-editor-overlay",onClick:()=>A(null),role:"presentation",children:o.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:ee=>ee.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("strong",{children:"Delete Memory"}),o.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>A(null),children:"×"})]}),o.jsxs("p",{children:["Delete"," ",o.jsx("code",{children:((K=c[S])==null?void 0:K.key)||`item ${S+1}`}),"?"]}),o.jsxs("div",{className:"memory-delete-actions",children:[o.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:z!==null,type:"button",onClick:()=>A(null),children:"Cancel"}),o.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:z!==null,type:"button",onClick:()=>void de(S),children:"Delete"})]})]})}):null]})}function IT({emptyText:e,items:i}){const a=jo(i);return a.length?o.jsx("div",{className:"memory-items-list",children:a.map(r=>o.jsx("div",{className:"memory-item-display memory-item-readonly",children:o.jsxs("pre",{"aria-label":`Memory item ${r.key}`,children:[o.jsx("span",{className:"memory-tag",children:`<${r.key}>`}),`
|
|
87
|
+
`,o.jsx("span",{children:r.value}),`
|
|
88
|
+
`,o.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):o.jsx("p",{className:"settings-note",children:e})}function UT({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:h,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:w,onSubmitEnvironment:S,onValueVisibleChange:A,revealedEnvironmentKeys:z}){const L=i!==null&&z.has(i),D=u==="workspace",X=D?c:r,[G,P]=O.useState(!1);function de(){h(),b({description:"",key:"",value:""}),A(!1),P(!0)}function _(Q){x(Q),A(!1),P(!0)}function K(){P(!1),h(),A(!1)}function ee(Q){S(Q),P(!1)}return o.jsxs(o.Fragment,{children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:D?"Workspace Environment":"Base Environment"}),o.jsx("p",{children:D?"Workspace variables are stored in this workspace and are merged with base variables for new runs.":"Base variables are injected into every new workspace run. Existing runs keep the environment they started with."})]})}),D?o.jsxs("section",{className:"settings-readonly-block",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Base Environment"}),o.jsx("span",{children:"Read-only in workspace scope"})]}),o.jsx(dx,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,o.jsxs("section",{className:"environment-manager",children:[o.jsx("div",{className:"memory-items-editor-header actions-only",children:o.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:de,children:"+"})}),o.jsx(dx,{emptyText:D?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:Q=>g(Q),onEdit:_,variables:X})]}),G?o.jsx("div",{className:"memory-editor-overlay",onClick:K,role:"presentation",children:o.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:Q=>Q.stopPropagation(),onSubmit:ee,children:[o.jsxs("header",{children:[o.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),o.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:K,children:"×"})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Key"}),o.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:Q=>b({...a,key:Q.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:a.key})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Value"}),o.jsxs("span",{className:"environment-value-field",children:[o.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:Q=>b({...a,value:Q.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:a.value}),o.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!L&&!a.value){w(i),A(!0);return}A(!d)},title:d?"Hide value":"Show value",type:"button",children:d?o.jsx(cN,{}):o.jsx(uN,{})})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Description"}),o.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:Q=>b({...a,description:Q.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:a.description})]}),o.jsxs("div",{className:"memory-editor-actions",children:[o.jsx("button",{className:"memory-dialog-button",type:"button",onClick:K,children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button primary",disabled:!a.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?o.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:o.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:Q=>Q.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("strong",{children:"Delete Environment"}),o.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),o.jsxs("p",{children:["Delete ",o.jsx("code",{children:e}),"?"]}),o.jsxs("div",{className:"memory-delete-actions",children:[o.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),o.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function dx({emptyText:e,onDelete:i,onEdit:a,readonly:r=!1,variables:u}){return u.length===0?o.jsx("p",{className:"settings-note",children:e}):o.jsx("div",{className:r?"environment-list readonly":"environment-list",children:u.map(c=>o.jsxs("div",{className:r?"environment-row readonly":"environment-row",children:[o.jsxs("div",{className:"environment-row-main",children:[o.jsxs("pre",{"aria-label":`Environment variable ${c.key}`,children:[o.jsx("span",{className:"memory-tag",children:c.key}),"=",c.hasValue?"••••••":"",c.description?o.jsx("span",{className:"environment-comment",children:` # ${c.description}`}):null]}),o.jsxs("span",{children:[c.hasValue?"configured":"empty"," · updated"," ",Ze(c.updatedAt)]})]}),r?o.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):o.jsxs("div",{className:"environment-row-actions",children:[o.jsx("button",{"aria-label":`Edit ${c.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>a==null?void 0:a(c),title:"Edit",type:"button",children:"✎"}),o.jsx("button",{"aria-label":`Delete ${c.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>i==null?void 0:i(c.key),title:"Delete",type:"button",children:"×"})]})]},c.key))})}function sv({items:e,onDelete:i,onEdit:a}){const[r,u]=O.useState(null),[c,d]=O.useState(null);return e.length===0?o.jsxs("section",{className:"knowledge-empty",children:[o.jsx("h4",{children:"No knowledge registered"}),o.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):o.jsx("div",{className:"knowledge-list",children:e.map(h=>o.jsxs("article",{className:"knowledge-row",children:[o.jsxs("div",{className:"knowledge-row-main",children:[o.jsxs("header",{children:[o.jsx("strong",{children:h.name}),o.jsx("span",{children:qT(h.kind)}),o.jsx("span",{className:GT(h.status),children:HT(h.status)})]}),o.jsx("p",{children:h.purpose||h.description||"No purpose set."}),o.jsxs("div",{className:"knowledge-paths",children:[o.jsx("code",{children:h.digestPath}),o.jsx("code",{children:h.skillPath}),o.jsx("code",{children:h.fetch.scriptPath})]}),h.fetch.requiredEnv.length>0?o.jsx("div",{className:"knowledge-envs",children:h.fetch.requiredEnv.map(g=>o.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===h.id?o.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,o.jsxs("small",{children:[h.attention," · ",$T(h.refreshPolicy)," · updated ",Ze(h.updatedAt)]})]}),o.jsx("div",{className:"environment-row-actions",children:r===h.id?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"danger",onClick:()=>{i(h.id),u(null)},type:"button",children:"Delete"}),o.jsx("button",{onClick:()=>u(null),type:"button",children:"Cancel"})]}):o.jsxs(o.Fragment,{children:[o.jsx("button",{"aria-label":`Check ${h.name}`,onClick:()=>d(h.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),o.jsx("button",{"aria-label":`Edit ${h.name}`,onClick:()=>a(h),title:"Edit knowledge",type:"button",children:o.jsx(zc,{})}),o.jsx("button",{"aria-label":`Delete ${h.name}`,onClick:()=>u(h.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},h.id))})}function BT({draft:e,items:i,scope:a,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:h,onSubmit:g}){return a==="workspace"?o.jsxs(o.Fragment,{children:[o.jsx("header",{className:"settings-section-header",children:o.jsxs("div",{children:[o.jsx("h3",{children:"Workspace Knowledge"}),o.jsxs("p",{children:["Long-lived source-backed material for ",r??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),o.jsx(sv,{items:i,onDelete:c,onEdit:h}),e.id?o.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[o.jsxs("div",{className:"knowledge-form-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Edit metadata"}),o.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),o.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),o.jsxs("div",{className:"knowledge-form-grid",children:[o.jsxs("label",{children:[o.jsx("span",{children:"Name"}),o.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...e,name:b.target.value}),value:e.name})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Kind"}),o.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...e,kind:b.target.value}),value:e.kind,children:[o.jsx("option",{value:"source",children:"Source"}),o.jsx("option",{value:"skill",children:"Skill"}),o.jsx("option",{value:"reference",children:"Reference"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Status"}),o.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...e,status:b.target.value}),value:e.status,children:[o.jsx("option",{value:"draft",children:"Draft"}),o.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),o.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),o.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),o.jsx("option",{value:"ready",children:"Ready"}),o.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Attention"}),o.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...e,attention:b.target.value}),value:e.attention,children:[o.jsx("option",{value:"none",children:"None"}),o.jsx("option",{value:"tracked",children:"Tracked"}),o.jsx("option",{value:"watch",children:"Watch"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Refresh"}),o.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...e,refreshPolicy:b.target.value}),value:e.refreshPolicy,children:[o.jsx("option",{value:"manual",children:"Manual"}),o.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),o.jsxs("label",{className:"settings-wide-field",children:[o.jsx("span",{children:"Purpose"}),o.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...e,purpose:b.target.value}),rows:2,value:e.purpose})]}),o.jsxs("label",{className:"settings-wide-field",children:[o.jsx("span",{children:"Content"}),o.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...e,description:b.target.value}),rows:2,value:e.description})]}),o.jsxs("label",{className:"settings-wide-field",children:[o.jsx("span",{children:"Source clues"}),o.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...e,sourceCluesText:b.target.value}),rows:4,value:e.sourceCluesText})]}),o.jsxs("label",{className:"settings-wide-field",children:[o.jsx("span",{children:"Required environment"}),o.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...e,requiredEnvText:b.target.value}),rows:3,value:e.requiredEnvText})]}),o.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),o.jsx("div",{className:"settings-form-actions",children:o.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):o.jsxs("section",{className:"settings-empty-section",children:[o.jsx("h3",{children:"Workspace Knowledge"}),o.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function qT(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function HT(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function $T(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function GT(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 We({label:e,value:i,mono:a=!1}){return o.jsxs("div",{className:"context-field",children:[o.jsx("span",{children:e}),o.jsx("strong",{className:a?"mono":void 0,title:i,children:i})]})}function VT({onRefresh:e,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=O.useMemo(()=>Object.entries(i.context).map(([d,h])=>[d,YT(h)]).sort(([d],[h])=>{const g=r.indexOf(d),m=r.indexOf(h);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(h)}),[i.context]),c=d=>{var h;(h=document.getElementById(fx(d)))==null||h.scrollIntoView({behavior:"smooth",block:"start"})};return o.jsxs("div",{className:"additional-context-preview",children:[o.jsx("div",{className:"additional-context-header",children:o.jsxs("div",{className:"additional-context-meta",children:[o.jsxs("span",{children:["Generated ",Ze(i.generatedAt)]}),o.jsxs("span",{children:[Qn(u.length)," keys"]}),o.jsx("button",{disabled:a,onClick:e,type:"button",children:a?"Rendering...":"Refresh"})]})}),o.jsxs("div",{className:"additional-context-toc",children:[o.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),o.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>o.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),o.jsx("div",{className:"additional-context-list",children:u.map(([d,h])=>o.jsxs("section",{className:"additional-context-item",id:fx(d),children:[o.jsxs("header",{children:[o.jsxs("code",{children:["<",d,">"]}),o.jsxs("span",{children:[Qn(h.length)," chars"]})]}),o.jsx("pre",{children:h})]},d))})]})}function fx(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function YT(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 FT({summary:e}){return o.jsxs("div",{className:"thread-read-summary",children:[o.jsxs("section",{className:"thread-read-summary-grid",children:[o.jsx(We,{label:"Thread",value:e.id,mono:!0}),o.jsx(We,{label:"Session",value:e.sessionId,mono:!0}),o.jsx(We,{label:"Status",value:e.status}),o.jsx(We,{label:"Source",value:e.source}),o.jsx(We,{label:"Created",value:ho(e.createdAt)}),o.jsx(We,{label:"Updated",value:ho(e.updatedAt)}),o.jsx(We,{label:"Recency",value:ho(e.recencyAt)}),o.jsx(We,{label:"Turns",value:Qn(e.turnCount),mono:!0}),o.jsx(We,{label:"Items",value:Qn(e.itemCount),mono:!0}),o.jsx(We,{label:"User / agent",value:`${Qn(e.userMessageCount)} / ${Qn(e.agentMessageCount)}`,mono:!0}),o.jsx(We,{label:"Compactions",value:`${Qn(e.compactionCount)} / ${Qn(e.contextCompactionCount)} context`,mono:!0}),o.jsx(We,{label:"CWD",value:e.cwd,mono:!0}),o.jsx(We,{label:"Path",value:e.path,mono:!0})]}),e.preview?o.jsxs("details",{className:"thread-read-preview",children:[o.jsx("summary",{children:"Preview"}),o.jsx("p",{children:e.preview})]}):null,o.jsxs("section",{className:"thread-read-turns",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Turns"}),o.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),o.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((i,a)=>o.jsxs("details",{className:"thread-read-turn",children:[o.jsxs("summary",{children:[o.jsxs("code",{children:["turn ",a+1]}),o.jsx("span",{title:i.id,children:i.id}),o.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),o.jsxs("div",{className:"thread-read-turn-detail",children:[o.jsxs("div",{className:"thread-read-turn-fields",children:[o.jsx(We,{label:"Status",value:i.status}),o.jsx(We,{label:"Items view",value:i.itemsView}),o.jsx(We,{label:"Started",value:ho(i.startedAt)}),o.jsx(We,{label:"Completed",value:ho(i.completedAt)}),o.jsx(We,{label:"Duration",value:i.durationMs===null?"unknown":To(i.durationMs)}),o.jsx(We,{label:"Item types",value:i.itemTypes||"none"})]}),i.preview?o.jsx("p",{className:"thread-read-turn-preview",children:i.preview}):null,o.jsxs("details",{className:"thread-read-turn-raw",children:[o.jsx("summary",{children:"Turn raw JSON"}),o.jsx("pre",{children:JSON.stringify(i.raw,null,2)})]})]})]},i.id))})]})]})}function mo(e,i,a,r,u,c,d,h,g,m){var b,x;if(e.type==="assistantText")return o.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":Ze(e.createdAt),children:o.jsxs("div",{className:"message-main",children:[o.jsxs("header",{className:"message-header",children:[o.jsx("span",{children:"Seele"}),o.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":Ze(e.createdAt)})]}),o.jsx("div",{className:"message-body",children:o.jsx(mc,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="message")return o.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":Ze(e.message.createdAt),children:o.jsxs("div",{className:"message-main",children:[o.jsxs("header",{className:"message-header",children:[o.jsx("span",{children:W2(e.message.role)}),o.jsx("time",{dateTime:e.message.createdAt,children:Ze(e.message.createdAt)})]}),o.jsx("div",{className:"message-body",children:o.jsx(mc,{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 o.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(S=>o.jsx("article",{className:"message topic-input","data-hover-time":Ze(S.createdAt),children:o.jsxs("div",{className:"topic-input-bubble",children:[o.jsxs("header",{className:"topic-input-header",children:[o.jsxs("span",{className:"topic-input-sender",children:["From ",S.senderName]}),o.jsx("time",{dateTime:S.createdAt,children:Ze(S.createdAt)})]}),o.jsx("div",{className:"topic-input-content message-body",children:o.jsx(mc,{content:S.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},S.id))});const w=Rc({},[e.detail]);return o.jsx("article",{className:"message system","data-hover-time":Ze(e.createdAt),children:o.jsx("div",{className:"message-main",children:o.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"?o.jsx("span",{className:"system-message-icon",children:o.jsx(Rp,{})}):null,o.jsx("span",{className:"system-message-title",children:e.title}),o.jsx("small",{children:w})]})})})}return e.type==="steerMarker"?o.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[o.jsx("span",{children:"Added while running"}),o.jsx("strong",{children:e.content})]}):e.tool.linkedTaskId&&g?o.jsx(uv,{description:e.tool.body,icon:o.jsx(ov,{}),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"?o.jsx(nA,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?o.jsx(eA,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?o.jsx(tA,{tool:e.tool,onRespond:h}):o.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":Ze(e.tool.createdAt),title:Ze(e.tool.createdAt),children:[o.jsxs("summary",{children:[o.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?o.jsx("span",{className:"tool-card-kind-icon",children:o.jsx(Rp,{})}):null,o.jsx("span",{children:e.tool.title})]}),e.tool.meta?o.jsx("small",{children:e.tool.meta}):null]}),o.jsx("code",{children:e.tool.body}),e.tool.output?o.jsx("pre",{children:e.tool.output}):null,(x=e.tool.rawEvents)!=null&&x.length?o.jsxs("details",{className:"tool-raw-details",children:[o.jsx("summary",{children:"Raw events"}),o.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function px(e){return e.type==="message"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&PT(e.tool)}function PT(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 KT(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 WT({group:e,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:h,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:w,onOpenComplexTask:S,onOpenSystemEvent:A}){const z=KT(e.agentItems.filter(px)),L=e.agentItems.some(H=>!px(H)),D=a&&(L||e.turnIds.length>0),X=c?"process":"result",[G,P]=O.useState(X),[de,_]=O.useState(!1),K=G==="result"?z:e.agentItems;O.useEffect(()=>{de||P(X)},[X,de]);const ee=c||D||e.stopped,Q=o.jsxs(o.Fragment,{children:[ee?o.jsx("div",{className:"turn-panel-controls",children:c?o.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):D?o.jsx("button",{"aria-label":G==="result"?"Show process":"Show result",className:"turn-view-toggle",title:G==="result"?"Show process":"Show result",type:"button",onClick:()=>{_(!0),P(H=>H==="result"?(g(e.turnIds),"process"):"result")},children:G==="result"?o.jsx(XT,{}):o.jsx(QT,{})}):null}):null,K.map(H=>o.jsx(O.Fragment,{children:mo(H,i,m,d,u,b,x,w,S,A)},H.id)),G==="result"&&K.length===0?o.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":L?"No reliable final answer captured":"No result yet"}):null,o.jsx(go,{copied:r,content:aA(e.agentItems),id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:rA(e.agentItems),variant:"outside",onCopy:h})]});return e.stopped?o.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[o.jsxs("summary",{children:[o.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),o.jsx("span",{children:"Run stopped by user"})]}),o.jsx("div",{className:ee?"stopped-turn-body has-controls":"stopped-turn-body",children:Q})]}):o.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ee?"has-controls":""].filter(Boolean).join(" "),children:Q})}function XT(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:o.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function QT(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:o.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function ZT(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:o.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function ov(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"15",viewBox:"0 0 24 24",width:"15",children:[o.jsx("circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("circle",{cx:"18",cy:"7",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("circle",{cx:"12",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("path",{d:"m7.8 7 3.1 8.8M16.2 8.2l-3 7.8M8 6.2l8-.1",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function JT(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:o.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function uv({className:e="",description:i,icon:a,onClick:r,timestamp:u,title:c,trailing:d,visibleTitle:h}){return o.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":Ze(u),onClick:r,title:c,type:"button",children:[o.jsx("span",{className:"compact-timeline-link-icon",children:a}),o.jsxs("span",{className:"compact-timeline-link-copy",children:[o.jsx("strong",{children:h}),o.jsx("small",{children:i})]}),d?o.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function eA({conversation:e,tool:i,onRespond:a}){var L;const r=Ce((L=i.workspaceChangePayload)==null?void 0:L.content)||i.body,[u,c]=O.useState(r),[d,h]=O.useState(null),[g,m]=O.useState("source"),[b,x]=O.useState(!1),w=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),S=i.meta==="saved"||i.meta==="declined"?i.meta:w?"pending":"preparing",A=S==="pending";O.useEffect(()=>{c(r)},[r]);async function z(D){h(D);try{await a(i,D,D==="accept"?{content:u}:void 0)&&x(!1)}finally{h(null)}}return o.jsxs(o.Fragment,{children:[o.jsx(uv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:o.jsx(zc,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:o.jsx("span",{className:`responsibility-request-status ${S}`,children:S}),visibleTitle:i.title}),b?o.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:o.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:D=>D.stopPropagation(),role:"dialog",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),o.jsxs("p",{children:["Workspace change · ",Ze(i.createdAt)]})]}),o.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),o.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[o.jsxs("div",{className:"responsibility-proposal-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Proposed responsibility"}),o.jsx("p",{children:w?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),o.jsx("span",{children:S})]}),i.responsibilityReason?o.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,A?o.jsxs("div",{className:"responsibility-proposal-editor",children:[o.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[o.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),o.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?o.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:D=>c(D.target.value),rows:12,value:u}):o.jsx("div",{className:"message-body responsibility-markdown-preview",children:sa(u,e)})]}):o.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:sa(u,e)})]}),o.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:A?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void z("decline"),children:d==="decline"?"Rejecting...":"Reject"}),o.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void z("accept"),children:d==="accept"?"Saving...":"Save"})]}):o.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function tA({tool:e,onRespond:i}){const[a,r]=O.useState(e.body),[u,c]=O.useState(null),[d,h]=O.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=hx(a);return O.useEffect(()=>{r(e.body)},[e.body]),o.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":Ze(e.createdAt),title:Ze(e.createdAt),children:[o.jsxs("div",{className:"responsibility-proposal-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:e.title}),o.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),o.jsx("span",{children:g})]}),m?o.jsxs("div",{className:"responsibility-proposal-editor",children:[o.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[o.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>h("source"),children:"JSON"}),o.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>h("preview"),children:"Preview"})]}),d==="source"?o.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:a}):b?o.jsx(mx,{value:b}):o.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?o.jsx(mx,{value:b,saved:!0}):o.jsx("pre",{className:"knowledge-proposal-raw",children:a}),m?o.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[o.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{hx(a)&&(c("accept"),Promise.resolve(i(e,"accept",a)).finally(()=>c(null)))},children:u==="accept"?"Saving...":"Save"}),o.jsx("button",{className:"reject",disabled:!!u,type:"button",onClick:()=>{c("decline"),Promise.resolve(i(e,"decline",a)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function hx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function sp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function mx({value:e,saved:i}){return o.jsx("div",{className:`knowledge-proposal-preview${i?" saved":""}`,children:o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Name"}),o.jsx("dd",{children:sp(e.name)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Purpose"}),o.jsx("dd",{children:sp(e.purpose)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Content"}),o.jsx("dd",{children:sp(e.content??e.description)})]})]})})}function nA({tool:e,onRespondApproval:i}){var w;const a=x2(e),[r,u]=O.useState(!1),[c,d]=O.useState("script"),h=a==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=Cc(e.body)?null:e.body,m=g?S2(g):null,b=m?`${iA(a)} · ${m}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",x=b2(e,a);return o.jsxs("article",{className:`tool-card command ${a}`,"data-hover-time":Ze(e.createdAt),title:Ze(e.createdAt),children:[o.jsxs("div",{className:"tool-command-bar",children:[o.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(S=>!S),children:[o.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),o.jsx("span",{children:b}),o.jsx("small",{className:"tool-command-badge",children:x})]}),r?o.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[o.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),o.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(w=e.rawEvents)!=null&&w.length?o.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,h?o.jsxs("div",{className:"tool-approval-actions",children:[o.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),o.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?o.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?o.jsx(gx,{content:g}):o.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?o.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[o.jsx("p",{className:"tool-command-result-meta",children:v2(e,a)}),e.output?o.jsx(gx,{content:e.output}):o.jsx("p",{className:"tool-output-pending",children:a==="running"?"Waiting for output...":a==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):o.jsx(lA,{events:e.rawEvents??[]}):null]})}function iA(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function gx({content:e}){const[i,a]=O.useState(!1),r=k2(e,ox);return o.jsxs("div",{className:"tool-content-block",children:[o.jsx("pre",{className:"tool-content-code",children:i?e:w2(e,ox)}),r?o.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function lA({events:e}){return o.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:o.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function go({copied:e,content:i,id:a,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?o.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?o.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:o.jsx(Cv,{})}):null,o.jsx("time",{dateTime:u,children:Ze(u)}),o.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(a,i),title:e?"Copied":"Copy",type:"button",children:e?o.jsx("span",{"aria-hidden":"true",children:"Copied"}):o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[o.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),o.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function yo(e){return e.type==="message"?Ka(e.message.content):e.type==="assistantText"?Ka(e.content):e.type==="system"?[e.title,e.fullDetail??e.detail].filter(i=>!!(i!=null&&i.trim())).join(`
|
|
89
|
+
|
|
90
|
+
`):""}function aA(e){return e.map(yo).filter(i=>i.trim()).join(`
|
|
91
|
+
|
|
92
|
+
`)}function rA(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 sA({usage:e}){return e?o.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>o.jsx(uA,{label:oA(i.windowDurationMins),window:i},`${i.windowDurationMins}:${i.resetsAt}`))}):o.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:o.jsx("strong",{children:"--"})})}function oA(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function uA({label:e,window:i}){const a=uh(i.usedPercent),r=ch(a),u=`${e} usage ${L2(a)} · resets ${I2(i.resetsAt)}`;return o.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${a}%`},tabIndex:0,children:o.jsxs("strong",{children:[Math.round(a),"%"]})})}function cA(e,i,a,r,u,c){const d=[...e].sort(So),h=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.sequence])),g=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.timelineAt])),m=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.sequence])),b=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.timelineAt])),x=r.filter(_=>_.parentId===null&&_.nodeType==="system_event"),w=x.filter(_=>_.turnId!==null&&_.subtype.startsWith("input:")),S=x.filter(_=>!w.includes(_)),A=new Set(x.flatMap(_=>_.turnId?[_.turnId]:[])),z=BE(i),L=new Map(a.map(_=>[_.id,_])),D=r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>_.turnId),G=[...new Set(r.length>0?[...D,...u?[u]:[]]:[...a.map(_=>_.id),...d.flatMap(_=>_.turnId?[_.turnId]:[]),...i.flatMap(_=>_.turnId?[_.turnId]:[])])].map(_=>{var dn,bn,jt,vn;const K=L.get(_),ee=d.filter(ze=>ze.turnId===_),Q=ee.filter(ze=>ze.role==="user").sort((ze,Gt)=>{const Jn=b.get(ze.id)??ze.createdAt,Un=b.get(Gt.id)??Gt.createdAt;return Jn.localeCompare(Un)||So(ze,Gt)}),H=ee.filter(ze=>ze.role==="assistant"),oe=i.filter(ze=>ze.turnId===_).sort(So),fe=`turn:${_}`,Se=r.filter(ze=>ze.parentId===fe).sort((ze,Gt)=>ze.sequence-Gt.sequence),me=(K==null?void 0:K.origin)??z.get(_),re=w.filter(ze=>ze.turnId===_).sort((ze,Gt)=>ze.timelineAt.localeCompare(Gt.timelineAt)||ze.sequence-Gt.sequence).map(ze=>yx(ze,void 0,c)),$=me==="timeline_event"?[]:r.length>0?bA(Se,oe,wo([_],u),c):fv(oe,wo([_],u),c),ae=H.map(po),xe=Se.find(ze=>ze.subtype==="server.complex_task.plan_updated"),Te=oe.find(ze=>ze.event==="server.complex_task.plan_updated"),N=(xe==null?void 0:xe.detail)??(Te==null?void 0:Te.data),T=ce(ce(N).task),q=ce(T.currentPlan),E=Ce(q.planMarkdown),te=hA(xA($,ae),E),ge=oe.find(ze=>ze.event==="server.wakeup.started"),he=ce(ge==null?void 0:ge.data),be=typeof he.instruction=="string"?he.instruction.trim():"",Le=me==="timeline_event"?oe[0]:void 0,He=A.has(_)?null:Le?cv(Le,(K==null?void 0:K.startedAt)??new Date(0).toISOString()):mA(me)?{id:`system-${_}`,type:"system",createdAt:(K==null?void 0:K.startedAt)??((dn=oe[0])==null?void 0:dn.createdAt)??new Date(0).toISOString(),title:gA(me??"system"),detail:yA(me??"system",be),fullDetail:be||void 0}:null,At=MA(oe),St=(Q[0]?b.get(Q[0].id):(bn=w.find(ze=>ze.turnId===_))==null?void 0:bn.timelineAt)??g.get(_)??(K==null?void 0:K.startedAt)??((jt=ee[0])==null?void 0:jt.createdAt)??((vn=oe[0])==null?void 0:vn.createdAt)??new Date(0).toISOString();return{id:`turn-${_}`,turnIds:[_],user:He??(Q[0]?po(Q[0]):null),followupUsers:Q.slice(1).map(po),acceptedSystemInputs:re,agentItems:te,activity:At??(wo([_],u)?{id:-1,title:te.some(ze=>ze.type==="assistantText"&&ze.streaming)?"Writing response":"Working",createdAt:St,tone:"running"}:null),notificationFailure:DA(oe),stopped:oe.some(hv),trailingSystemItems:[],sortAt:St,sortSequence:h.get(_)??null}}),P=d.filter(_=>!_.turnId);G.push(...P.map(_=>({id:`message-${_.id}`,turnIds:[],user:_.role==="user"?po(_):null,followupUsers:[],agentItems:_.role==="assistant"?[po(_)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(_.id)??_.createdAt,sortSequence:m.get(_.id)??null})));const de=new Map(i.map(_=>[String(_.id),_]));return G.push(...S.map(_=>({id:_.id,turnIds:[],user:yx(_,_.entityType==="event"&&_.entityId?de.get(_.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:_.timelineAt,sortSequence:_.sequence}))),G.sort((_,K)=>{const ee=_.sortAt.localeCompare(K.sortAt);return ee!==0?ee:_.sortSequence!==null||K.sortSequence!==null?(_.sortSequence??Number.MAX_SAFE_INTEGER)-(K.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:_,...K})=>K)}function yx(e,i,a){var g,m;if(i||e.entityType==="event")return cv(i??Mp(e),e.createdAt);const r=ce(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=Np(r,a),x=dA(r.messages,a),w=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(A=>typeof A=="string"&&A.trim().length>0):[],S=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(S),"","**From**","",w.length>0?w.map(A=>{const z=a.get(A)??A;return`${Ya(z)} (\`${A}\`)`}).join(", "):"Unknown"].join(`
|
|
93
|
+
`)}}const u=Ce(r.complexTaskId)||Ce(ce(r.task).id)||void 0,c=Wb(e.title,e.subtype),d=Rc(r,[e.summary,e.contentMarkdown]),h=[`## ${Ya(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(`
|
|
94
|
+
`):""].filter(Boolean).join(`
|
|
95
|
+
`);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:h||void 0,linkedTaskId:u}}function dA(e,i){if(!Array.isArray(e))return[];const a=new Set,r=[];for(const u of e){const c=ce(u),d=Ce(c.id),h=Ce(c.senderWorkspaceId),g=Ce(c.contentMarkdown).trim(),m=Ce(c.createdAt);!d||a.has(d)||!h||!g||!m||(a.add(d),r.push({id:d,senderWorkspaceId:h,senderName:i.get(h)??(Ce(c.senderTitleSnapshot)||h),contentMarkdown:g,createdAt:m}))}return r}function cv(e,i){return e.event==="server.collaboration.topic_created"?fA(e,i):pA(e,i)}function fA(e,i){const a=ce(ce(e.data).topic),r=Ce(a.title).trim()||"Untitled Topic",u=Ce(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(ce):[],d=Ce(a.ownerWorkspaceId),h=c.find(x=>Ce(x.role)==="owner"||Ce(x.workspaceId)===d),g=Ce(h==null?void 0:h.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>Ce(x.role)!=="owner"&&Ce(x.status)==="active"),b=m.length?m.map(x=>{const w=Ce(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${Ya(w)} (\`${Ce(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",Ya(r),"","**描述**","",Ya(u),"","**Owner Workspace**","",`${Ya(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
|
|
96
|
+
`)}}function pA(e,i){const a=ce(e.data),r=Wb(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:r,detail:Rc(a),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${Ya(r)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(e.data??null,null,2),"```"].join(`
|
|
97
|
+
`)}}function hA(e,i){const a=i.trim();return a?e.filter(r=>r.type==="assistantText"?Ka(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?Ka(r.message.content).trim()!==a:!0):e}function mA(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function gA(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function yA(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?Rv(i,20):"Auto resumed"}function xA(e,i){if(e.some(u=>u.type==="assistantText"))return jc(e);if(i.length===0)return e;const a=[...i],r=[];for(const u of e)u.type==="tool"&&ah(u.tool)&&lh(a,u.tool)||r.push(u);return jc([...r,...a])}function bA(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=vA(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(yl(x),x)}if(a)for(const m of i)wA(e,m)||c.set(yl(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(yl(m),m);const h=fv([...c.values()].sort(So),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())){h.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:kA(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:a&&m.status==="running"});continue}m.nodeType==="operation"&&h.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:SA(m,r)})}return jc(h)}function vA(e,i,a){if(e.entityType==="event"&&e.entityId){const r=a.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[Mp(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>dv(u)===e.entityId);return r.length>0?r:[Mp(e)]}return[]}function Mp(e){const i=ce(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 wA(e,i){const a=i.id===void 0?null:String(i.id),r=dv(i);return e.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function dv(e){if(e.event!=="codex.notification")return null;const i=ce(e.data),a=ce(i.params),r=ce(a.item);return Ce(r.id)||Ce(a.itemId)||null}function kA(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function SA(e,i){var r,u;const a=ce(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Np(a,i).title:e.title||zv(e.subtype),body:e.subtype==="input:collaboration_notice"?Np(a,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||Av(a),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function fv(e,i,a){const r=[],u=new Map,c=new Map,d=new Map;for(const h of e){if(h.event==="server.workspace_change.decision"||h.event==="server.responsibility.decision"){CA(r,h);continue}if(h.event==="server.knowledge.decision"){EA(r,h);continue}if(hv(h)){_A(r);continue}if(h.event==="server.steer"){const A=ce(h.data),z=typeof A.message=="string"?A.message.trim():"";r.push({id:`steer-${h.id}`,type:"steerMarker",createdAt:h.createdAt??new Date().toISOString(),content:z||"Additional input",messageId:typeof A.messageId=="string"?A.messageId:void 0});continue}const g=V2(h.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=G2(h.data);if(m!=null&&m.text){const A=m.itemId?d.get(m.itemId)??m.phase:m.phase,z=m.itemId??`phase:${A}`,L=`${u.get(z)??""}${m.text}`,D=vv(L),X=c.get(z)??"",G=D.startsWith(X)?D.slice(X.length):D;if(u.set(z,L),c.set(z,D),G){const P=r[r.length-1];(P==null?void 0:P.type)==="assistantText"&&AA(P,m.itemId,A)?(P.content+=G,P.itemId=P.itemId??m.itemId,P.streamKey=P.streamKey??z,P.streaming=i):r.push({id:`assistant-event-${h.id}`,type:"assistantText",createdAt:h.createdAt??new Date().toISOString(),content:G,phase:A,itemId:m.itemId,streamKey:z,streaming:i})}continue}const b=Y2(h.data);if(b!=null&&b.text){const A=Ka(b.text),z=b.itemId??`phase:${b.phase}`,L=NA(r,b.itemId,b.phase);if(L>=0){const D=r[L];D.type==="assistantText"&&(A?(D.content=A,D.phase=b.phase,D.itemId=D.itemId??b.itemId,D.streamKey=D.streamKey??z,D.streaming=!1,jA(r,L,b.itemId)):r.splice(L,1))}else A&&r.push({id:`assistant-completed-${h.id}`,type:"assistantText",createdAt:h.createdAt??new Date().toISOString(),content:A,phase:b.phase,itemId:b.itemId,streamKey:z,streaming:!1});continue}const x=h2(h,a);if(x){x.rawEvents=[h];const A=bx(r,x);if(A>=0){vx(r[A],x);continue}if(ah(x)&&lh(r,x)||x.kind==="command"&&x.meta==="running"&&Cc(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const w=m2(h);if(w){w.rawEvents=[h];const A=bx(r,w);if(A>=0){vx(r[A],w);continue}r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w});continue}const S=g2(h);S&&(S.rawEvents=[h],r.push({id:`tool-${S.id}`,type:"tool",createdAt:S.createdAt,tool:S}))}return jc(r)}function jA(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 CA(e,i){const a=ce(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=ce(a.payload),d=Ce(c.content)||(typeof a.responsibility=="string"?a.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let h=e.length-1;h>=0;h-=1){const g=e[h];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){g.tool={...g.tool,title:u==="accept"?"Workspace change applied":"Workspace change declined",meta:u==="accept"?"saved":"declined",body:d??g.tool.body,workspaceChangePayload:u==="accept"&&Object.keys(c).length>0?c:g.tool.workspaceChangePayload};return}}}function EA(e,i){const a=ce(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=ce(a.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=e.length-1;d>=0;d-=1){const h=e[d];if(h.type==="tool"&&h.tool.kind==="knowledge"&&h.tool.knowledgeProposalId===r){h.tool={...h.tool,title:u==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:u==="accept"?"saved":"declined",body:u==="accept"&&Object.keys(c).length>0?JSON.stringify(c,null,2):h.tool.body};return}}}function lh(e,i){const a=pv(i);if(typeof a!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!xx(d,i))continue;const h=Ka(d.content);h!==d.content&&(e[c]={...d,content:h})}let r=0,u=-1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!xx(d,i))continue;u=c;const h=r,g=h+d.content.length;if(r=g,a>=g)continue;const m=Math.max(0,Math.min(d.content.length,a-h)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),w=[];return b&&w.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),w.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&w.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...w),!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 xx(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function jc(e){const i=[],a=[];for(const c of e){if(c.type==="tool"&&ah(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)lh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return TA([...u,...r])}function ah(e){return typeof pv(e)=="number"}function pv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function TA(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 AA(e,i,a){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===a}function NA(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 hv(e){return e.event==="server.stop"||e.event==="server.stopped"}function _A(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 DA(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.event!=="server.notification.failed")continue;const r=ce(a.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function MA(e){for(let i=e.length-1;i>=0;i-=1){const a=Lv(e[i]);if(a)return a}return null}function bx(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 vx(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"&&Cc(i.body)&&!Cc(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:_2(e.tool.output,i.output),rawEvents:OA(e.tool.rawEvents,i.rawEvents)}}function OA(e,i){const a=[...e??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=yl(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 wx(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=>mv(u)?!r.some(c=>RA(c,u)):!0)}function kx(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 Sx(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 mv(e){return e.id.startsWith("local-")}function RA(e,i){if(mv(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 op(e,i){const a=new Map,r=new Map;for(const c of[...e,...i]){const d=yl(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const h=gv(c,d);return h!==0?h:(r.get(yl(c))??0)-(r.get(yl(d))??0)})}function up(e,i){const a=yl(i),r=e.findIndex(c=>yl(c)===a);if(r<0)return[...e,i];if(zA(e[r],i))return e;const u=[...e];return u[r]=i,u}function zA(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 yl(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function So(e,i){const a=gv(e,i);return a!==0?a:LA(e.id,i.id)}function gv(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 LA(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 cp(e,i){const a=ce(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 mc=O.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const h=r?vv(i):Ka(i),g=a&&!r?VA(h,a):[];return o.jsxs(o.Fragment,{children:[r?o.jsx(BA,{content:h,conversation:a}):sa(h,a),g.length>0?o.jsx("div",{className:"artifact-preview-list",children:g.map(m=>o.jsx(GA,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},IA);function IA(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)}const UA=2;function BA({content:e,conversation:i}){const a=O.useRef(null),[r,u]=O.useState(null),{committedBlocks:c,activeBlock:d}=qA(e);return O.useLayoutEffect(()=>{const h=a.current;if(!h)return;const g=parseFloat(window.getComputedStyle(h).lineHeight)||28,m=h.scrollHeight;u(b=>{const x=g*UA,w=Math.min(m,x);return b!==null&&w<=b?b:w})},[e]),o.jsxs("div",{className:"streaming-message-content",ref:a,style:r===null?void 0:{minHeight:r},children:[c.map((h,g)=>o.jsx(O.Fragment,{children:sa(h,i)},`${g}:${h.length}`)),d?o.jsx("p",{className:"streaming-active-line",children:d}):null]})}function qA(e){const i=$A(e),a=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:HA(a),activeBlock:r}}function HA(e){const i=[];let a=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const h of c){if(!h)continue;const g=h.trim(),m=d;if(d+=h.length,/^\s*(```|~~~)/.test(h)){r=!r,r||(cc(i,e.slice(a,d)),a=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(h)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(h)){u=!0;continue}u&&(cc(i,e.slice(a,m)),a=m,u=!1),g===""&&(cc(i,e.slice(a,d)),a=d)}return a<e.length&&cc(i,e.slice(a)),i}function cc(e,i){i.trim()&&e.push(i)}function $A(e){const i=e.lastIndexOf(`
|
|
98
|
+
`);if(i<0)return 0;const a=[0];for(let u=0;u<e.length;u+=1)e[u]===`
|
|
99
|
+
`&&u+1<e.length&&a.push(u+1);let r=-1;for(const u of a){const c=e.indexOf(`
|
|
100
|
+
`,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 GA({artifact:e,onPreview:i,onCopyUrl:a,copied:r}){return e?o.jsxs("figure",{className:"artifact-preview",children:[o.jsx("button",{className:"artifact-preview-media",onClick:()=>i(e),type:"button",children:o.jsx("img",{alt:e.name,src:e.url})}),o.jsxs("figcaption",{children:[o.jsx("span",{children:e.name}),o.jsxs("div",{className:"artifact-preview-actions",children:[o.jsx("button",{onClick:()=>i(e),type:"button",children:"Preview"}),o.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),o.jsx("button",{onClick:()=>a(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function VA(e,i){const a=new Map;for(const r of YA(e)){const u=yv(r);if(u){const c=xv(u).toLowerCase(),d=a.get(c);(!d||KA(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>FA(r,i)).filter(r=>r!==null)}function YA(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 FA(e,i){const a=yv(e);if(!a||!PA(a))return null;const r=bv(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:xv(r),url:ye(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function yv(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function PA(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function xv(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function bv(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 KA(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function Ka(e){return e.trim()}function vv(e){return e.trim()}function dp(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function WA(e){return{a({children:i,href:a}){if(!a)return o.jsx(o.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(a),u=!r&&e?XA(a,e):null,c=u??a,d=r||!!u;return o.jsx("a",{className:"markdown-link",href:c,rel:d?"noreferrer":void 0,target:d?"_blank":void 0,children:i})},img(){return null},pre({children:i}){const a=JA(i);return a?rh(a.language)==="mermaid"?o.jsx(eN,{code:a.code}):o.jsx(iN,{code:a.code,language:a.language}):o.jsx("pre",{children:i})},table({children:i}){return o.jsx("div",{className:"markdown-table-wrap",children:o.jsx("table",{className:"markdown-table",children:i})})},td({align:i,children:a}){return o.jsx("td",{style:jx(i),children:a})},th({align:i,children:a}){return o.jsx("th",{style:jx(i),children:a})}}}function XA(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const[a]=e.split("#",1),[r]=a.split("?",1),u=QA(r);if(!u)return null;const c=bv(u,i.workspacePath);return ye(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function QA(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function jx(e){return e&&e!=="char"?{textAlign:e}:void 0}function sa(e,i){const a=ZA(e);return o.jsx(Cj,{components:WA(i),remarkPlugins:[UE],skipHtml:!0,children:a})}function ZA(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
|
|
101
|
+
$2`)}function JA(e){var c;const i=O.Children.toArray(e),a=i.length===1&&O.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:Op(a.props.children).replace(/\n$/,""),language:u}}function Op(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(Op).join(""):O.isValidElement(e)?Op(e.props.children):""}const wv="github-light",fp=new Map,pp=new Map;let hp=null,mp=null;const kv=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function rh(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 Sv(e){const i=rh(e);return!i||i==="text"||i==="txt"?"text":kv.has(i)?i:"text"}function eN({code:e}){const a=`seele-mermaid-${O.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=O.useState(!1),[c,d]=O.useState(()=>pp.get(e)??null),[h,g]=O.useState(null);O.useEffect(()=>{let b=!1,x;const w=pp.get(e);return w?(d(w),g(null),()=>{b=!0}):(g(null),d(null),tN(a,e).then(S=>{b||(x!==void 0&&window.clearTimeout(x),pp.set(e,S),d(S),g(null))},S=>{if(!b){const A=S instanceof Error?S.message:String(S);x=window.setTimeout(()=>{b||g(A)},iT)}}),()=>{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 o.jsxs("figure",{className:`mermaid-block${h?" error":""}`,children:[o.jsx("span",{className:"code-block-kind",children:"mermaid"}),o.jsx("div",{className:"code-block-tools",children:o.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:o.jsx(jv,{})})}),c?o.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):h?o.jsxs("div",{className:"mermaid-error",children:[o.jsx("strong",{children:"Mermaid render failed"}),o.jsx("pre",{children:h}),o.jsx("code",{children:e})]}):o.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function tN(e,i){return(await(await nN()).render(e,i)).svg}function nN(){return mp||(mp=kt(()=>import("./mermaid.core-DTg-GtLV.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})),mp}function iN({code:e,language:i,reserveHeight:a=!1}){const[r,u]=O.useState(!1),[c,d]=O.useState(()=>{if(!Tx(i))return null;const m=Ex(e,i);return fp.get(m)??null}),h=a?{"--code-block-min-height":`${mT(e)}px`}:void 0;O.useEffect(()=>{let m=!1;if(!Tx(i))return d(null),()=>{m=!0};const b=Ex(e,i),x=fp.get(b);return x?(d(x),()=>{m=!0}):(d(null),dN(e,i).then(w=>{fp.set(b,w),m||d(w)}).catch(w=>{console.warn("Failed to highlight code block",w),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return o.jsxs("figure",{className:"code-block",style:h,children:[i?o.jsx("span",{className:"code-block-kind",children:i}):null,o.jsx("div",{className:"code-block-tools",children:o.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:o.jsx(jv,{})})}),c?o.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):o.jsx("pre",{children:o.jsx("code",{children:e})})]})}function jv(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[o.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),o.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function lN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[o.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),o.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),o.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Cv(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),o.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),o.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function aN(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:o.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function rN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),o.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),o.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),o.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function Cx(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function sN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),o.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Rp(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[o.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),o.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function zc(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[o.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),o.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function oN(){return o.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:o.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function uN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),o.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function cN(){return o.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[o.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),o.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Ex(e,i){return`${wv}:${Sv(i)}:${e}`}function Tx(e){const i=rh(e);return!!i&&kv.has(i)}async function dN(e,i){return(await fN()).codeToHtml(e,{lang:Sv(i),theme:wv})}function fN(){return hp||(hp=pN()),hp}async function pN(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:h},{default:g},{default:m},{default:b},{default:x},{default:w},{default:S},{default:A},{default:z},{default:L},{default:D},{default:X},{default:G},{default:P},{default:de}]=await Promise.all([kt(()=>import("./core-DQSoOJXF.js"),[],import.meta.url),kt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),kt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),kt(()=>import("./bash-BELqPA7S.js").then(_=>_.b),[],import.meta.url),kt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),kt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),kt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),kt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),kt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),kt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),kt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),kt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),kt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),kt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),kt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),kt(()=>import("./bash-BELqPA7S.js").then(_=>_.s),[],import.meta.url),kt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),kt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),kt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),kt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),kt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),kt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[a],langs:[r,u,c,d,h,g,m,b,x,w,S,A,z,L,D,X,G,P,de]})}async function Ax(){const e=ye("conversations"),i=await fetch(e);return await De(i,{url:e}),(await i.json()).conversations}async function hN(){const e=ye("workspace-states"),i=await fetch(e);return await De(i,{url:e}),(await i.json()).workspaces}async function Nx(){const e=ye("collaboration/topics"),i=await fetch(e);return await De(i,{url:e}),(await i.json()).topics}async function dc(e){const i=ye(`collaboration/topics/${e}/messages?limit=100`),a=await fetch(i);return await De(a,{url:i}),(await a.json()).messages}async function mN(e){const i=ye("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await De(a,{method:"POST",url:i}),(await a.json()).topic}async function gN(e,i){const a=ye(`collaboration/topics/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await De(r,{method:"PATCH",url:a}),(await r.json()).topic}async function yN(e,i){const a=ye(`collaboration/topics/${e}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await De(r,{method:"POST",url:a}),(await r.json()).topic}async function xN(e){const i=ye(`conversations/${e}/read`),a=await fetch(i,{method:"POST"});await De(a,{method:"POST",url:i})}async function _x(){const e=ye("workspace-groups"),i=await fetch(e);return await De(i,{url:e}),(await i.json()).groups}async function bN(e){const i=ye("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await De(a,{method:"POST",url:i}),(await a.json()).group}async function vN(e,i){const a=ye(`workspace-groups/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await De(r,{method:"PATCH",url:a}),(await r.json()).group}async function wN(e){const i=ye(`workspace-groups/${e}`),a=await fetch(i,{method:"DELETE"});return await De(a,{method:"DELETE",url:i}),await a.json()}async function kN(){const e=ye("settings/environment"),i=await fetch(e);return await De(i,{url:e}),(await i.json()).variables}async function SN(e){const i=ye(`conversations/${e}/settings/environment`),a=await fetch(i);return await De(a,{url:i}),(await a.json()).variables}async function jN(e){const i=ye(`conversations/${e}/knowledge`),a=await fetch(i);return await De(a,{url:i}),(await a.json()).items}async function CN(){const e=ye("settings/runtime"),i=await fetch(e);return await De(i,{url:e}),(await i.json()).settings}async function EN(){const e=ye("settings/runtime/codex"),i=await fetch(e);return await De(i,{url:e}),await i.json()}async function TN(e=!0){const i=ye(`settings/runtime/models?refresh=${e?"1":"0"}`),a=await fetch(i);return await De(a,{url:i}),await a.json()}async function AN(e=!1){const i=ye(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),a=await fetch(i);return await De(a,{url:i}),await a.json()}async function NN(){const e=ye("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await De(i,{method:"POST",url:e}),(await i.json()).job}async function _N(e){const i=ye(`conversations/${e}/settings/runtime`),a=await fetch(i);return await De(a,{url:i}),(await a.json()).settings}async function DN(){const e=ye("settings/memory"),i=await fetch(e);return await De(i,{url:e}),await i.json()}async function MN(e){const i=ye("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await De(a,{method:"PUT",url:i}),(await a.json()).settings}async function Dx(e,i){const a=ye(`conversations/${e}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await De(r,{method:"PUT",url:a}),await r.json()}async function ON(e,i){const a=ye(`conversations/${e}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await De(r,{method:"POST",url:a}),await r.json()}async function RN(e){const i=ye(`conversations/${e}/runtime/reset-preview`),a=await fetch(i);return await De(a,{url:i}),await a.json()}async function zN(e,i){const a=ye(`conversations/${e}/runtime/reset-selection`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await De(r,{method:"PUT",url:a})}async function LN(e){const i=ye(`conversations/${e}/runtime/thread-read`),a=await fetch(i);return await De(a,{url:i}),(await a.json()).result}async function IN(e){const i=ye(`conversations/${e}/runtime/token-usage`),a=await fetch(i);await De(a,{url:i});const r=await a.json();return r.event?Iv(r.event):null}async function UN(e){const i=ye(`conversations/${e}/runtime/additional-context`),a=await fetch(i);return await De(a,{url:i}),await a.json()}async function BN(e){const i=ye(`conversations/${e}/runtime/compactions`),a=await fetch(i);return await De(a,{url:i}),(await a.json()).compactions}function qN(e,i){return{model:e.model===i.model?null:e.model,reasoningEffort:e.reasoningEffort===i.reasoningEffort?null:e.reasoningEffort,fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox,notifyEnabled:e.notifyEnabled===i.notifyEnabled?null:e.notifyEnabled}}function HN(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:GN(e.sourceCluesText),requiredEnv:VN(e.requiredEnvText)}}function $N(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(`
|
|
102
|
+
`),requiredEnvText:e.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
|
|
103
|
+
`)}}function GN(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 VN(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 Mx(e,i){const a=Ox(i.attention)-Ox(e.attention);return a!==0?a:i.updatedAt.localeCompare(e.updatedAt)}function Ox(e){return e==="watch"?2:e==="tracked"?1:0}function jo(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function YN(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 FN(e){return jo(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
|
|
104
|
+
`)}async function PN(e){const i=ye("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await De(a,{method:"PUT",url:i}),await a.json()}async function KN(e,i,a){const r=ye("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:e,value:i})});return await De(u,{method:"PUT",url:r}),(await u.json()).variable}async function WN(e,i,a,r){const u=ye(`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 De(c,{method:"PUT",url:u}),await c.json()}async function XN(e){const i=ye(`settings/environment/${encodeURIComponent(e)}/reveal`),a=await fetch(i);return await De(a,{url:i}),(await a.json()).variable.value}async function QN(e,i){const a=ye(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await De(r,{url:a}),(await r.json()).variable.value}async function ZN(e){const i=ye(`settings/environment/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});await De(a,{method:"DELETE",url:i})}async function JN(e,i){const a=ye(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await De(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function e2(e,i){const a=ye(`conversations/${e}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await De(r,{method:"POST",url:a}),(await r.json()).item}async function t2(e,i,a){const r=ye(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await De(u,{method:"PATCH",url:r}),(await u.json()).item}async function n2(e,i){const a=ye(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await De(r,{method:"DELETE",url:a})}async function i2(){const e=ye("meta"),i=await fetch(e);return await De(i,{url:e}),await i.json()}async function l2(e){const i=ye(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),a=await fetch(i);return await De(a,{url:i}),(await a.json()).usage??null}async function a2(e,i){const a=ye("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await De(r,{method:"POST",url:a}),(await r.json()).conversation}async function r2(e){const i=ye(`conversations/${e}/complex-task`),a=await fetch(i);return await De(a,{url:i}),(await a.json()).task}async function s2(e,i){const a=ye(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await De(r,{url:a}),(await r.json()).task}async function o2(e,i){const a=ye(`conversations/${e}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await De(r,{method:"POST",url:a}),(await r.json()).task}async function u2(e,i,a){const r=ye(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await De(u,{method:"POST",url:r}),await u.json()}async function c2(e){const i=ye(`conversations/${e}/clone/retry`),a=await fetch(i,{method:"POST"});return await De(a,{method:"POST",url:i}),await a.json()}async function Rx(e,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??Xb)),i.before&&a.set("before",i.before);const r=ye(`conversations/${e}?${a}`),u=await fetch(r);return await De(u,{url:r}),(await u.json()).conversation}async function d2(e,i){const a=ye(`conversations/${e}/turns/${i}/history-events`),r=await fetch(a);return await De(r,{url:a}),(await r.json()).events}async function fc(e,i){const a=ye(`conversations/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await De(r,{method:"PATCH",url:a}),(await r.json()).conversation}async function f2(e){const i=ye(`conversations/${e}`),a=await fetch(i,{method:"DELETE"});await De(a,{method:"DELETE",url:i})}function p2(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function Ev(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function h2(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:z2(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=ce(e.data),d=Ce(c.toolCallId),h=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||h!==null){const g=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=Ce(c.audience),x=Ce(c.recipientWorkspaceId),w=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(L=>typeof L=="string"):Array.isArray(c.recipients)?c.recipients.filter(L=>typeof L=="string"):[],S=w.filter(L=>L!=="ALL").map(L=>i.get(L)).filter(L=>!!L);let A="Topic";S.length>0?A=Ev(S):w.length===1?A=w[0]==="ALL"?"Topic participants":ua(w[0]):w.length>1?A=`${w.length} workspaces`:b==="public"||b==="all"?A="Topic participants":b==="owner"&&(A="Topic owner");const z=Ce(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${A}`,body:z?`Topic ${ua(z)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${h}`,meta:g?"pending send":m?"done":"failed",output:g||m?Ce(c.contentMarkdown)||void 0:Ce(c.reason)||void 0,topicAction:"send"}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=ce(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=ce(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=ce(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",w=Array.isArray(b.options)?b.options.map(S=>{const A=ce(S);return typeof A.label=="string"?`- ${A.label}${typeof A.description=="string"?`: ${A.description}`:""}`:""}).filter(Boolean).join(`
|
|
105
|
+
`):"";return w?`${x}
|
|
106
|
+
|
|
107
|
+
${w}`:x}).join(`
|
|
108
|
+
|
|
109
|
+
`);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=ce(e.data);if(Ce(c.actionType)==="seele_workspace_change"){const d=ce(c.payload),h=ce(d.payload),g=Ce(d.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:Mv(g,h),createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:g,workspaceChangePayload:h}}}if(e.event==="codex.dynamic_tool_request"){const c=ce(e.data),d=ce(c.params),h=Ce(d.tool)||"dynamic tool",g=ce(d.arguments);return{id:e.id,kind:h==="seele_topics"?"collaboration":h==="seele_workspace_change"?"workspaceChange":"activity",title:_v(h,!1,g),body:Dv(h,g),createdAt:e.createdAt??new Date().toISOString(),itemId:Ce(d.callId)||void 0,meta:"running",topicAction:h==="seele_topics"?Tv(g.action):void 0,workspaceChangeType:h==="seele_workspace_change"&&Ce(g.type)||void 0,workspaceChangePayload:h==="seele_workspace_change"?ce(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=ce(e.data),d=ce(c.payload),h=Ce(d.content)||Ce(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:h,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:h}}}if(e.event==="server.knowledge.proposed"){const c=ce(e.data),d=ce(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=ce(e.data),d=ce(c.task),h=ce(d.currentPlan),g=ce(c.update),m=Ce(g.operation),b=typeof h.version=="number"?`v${h.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=ce(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=ce(e.data),d=e.event==="runtime.command.completed",h=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:d?h!==null&&h!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?gc(c.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?h!==null?`exit ${h}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const c=ce(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:zp(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=ce(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=R2(c.requestId),h=ce(c.params),g=typeof h.command=="string"?h.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof h.itemId=="string"?h.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof h.turnId=="string"?h.turnId:void 0,approvalReason:typeof h.reason=="string"?h.reason:void 0}}}if(e.event!=="codex.notification")return null;const a=ce(e.data),r=a.method,u=ce(a.params);if(r==="item/started"){const c=ce(u.item);if(c.type==="commandExecution"){const h=c.status==="inProgress"&&c.processId===null;return{id:e.id,kind:"command",title:h?"Command waiting for approval":"Seele ran command",body:gc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:h?"approval":"running"}}const d=Tc(c);if(d)return{id:e.id,kind:"file",title:"Seele changed file",body:d,createdAt:e.createdAt??new Date().toISOString(),meta:"started"}}if(r==="item/completed"){const c=ce(u.item);if(c.type==="commandExecution"){const h=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:h!==null&&h!==0?"Command failed":"Command completed",body:gc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:h!==null?`exit ${h}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=Tc(c);if(d)return{id:e.id,kind:"file",title:"File updated",body:d,createdAt:e.createdAt??new Date().toISOString(),meta:"done"}}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 m2(e){if(e.event!=="codex.notification")return null;const i=ce(e.data),a=i.method;if(a!=="item/started"&&a!=="item/completed")return null;const r=ce(i.params),u=ce(r.item),c=typeof u.type=="string"?u.type:"item";if(Nv(c)||Tc(u))return null;const d=a==="item/completed",h=ce(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?_v(g,d,h):d?`Finished ${oa(c)}`:`Working on ${oa(c)}`,body:g?Dv(g,h):Ov(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:d?y2(u):"running",topicAction:g==="seele_topics"?Tv(h.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&Ce(h.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?ce(h.payload):void 0}}function Tv(e){return e==="read"||e==="history"||e==="send"?e:void 0}function g2(e){if(Lv(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=YE(e);return i?{id:e.id,kind:"activity",title:zv(i),body:Av(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function Av(e){const i=ce(e);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return Rv(i[a].trim(),180);return"Event details are available"}function Nv(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function y2(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function oa(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function _v(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")return i?"Wakeup change ready":"Updating workspace wakeup";if(e==="seele_workspace_change")return i?"Workspace change proposed":"Preparing workspace change";const r=oa(e);return i?`Finished ${r}`:`Running ${r}`}function Dv(e,i){if(e==="seele_topics"){const a=Ce(i.topicId);return a?`Topic ${ua(a)}`:"Topic"}if(e==="seele_wakeup")return"Schedule, replace, or cancel the current wakeup";if(e==="seele_workspace_change"){const a=Ce(i.type)||"workspace";return Mv(a,ce(i.payload))}return oa(e)}function Mv(e,i){return e==="responsibility"?Ce(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function Ov(e,i){for(const a of["title","name","description","text","summary"])if(typeof e[a]=="string"&&e[a].trim())return Kr(e[a].trim(),160);return typeof e.id=="string"?`${oa(i)} ${ua(e.id)}`:oa(i)}function x2(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 b2(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function v2(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 w2(e,i){const a=e.split(/\r?\n/),u=a.slice(0,i).join(`
|
|
110
|
+
`);return a.length>i?`${u}
|
|
111
|
+
...`:u}function k2(e,i){return e?e.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function Cc(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function S2(e){const i=e.trim();return!i||i.includes(`
|
|
112
|
+
`)?null:Kr(i,120)}function Kr(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 Rv(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function zv(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 Lv(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=ce(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 ${ua(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=ce(e.data);return{id:e.id,title:"Codex compacting context",detail:zp(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=ce(e.data);return{id:e.id,title:"Codex context compacted",detail:zp(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=ce(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=ce(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?Kr(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=ce(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=ce(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?Kr(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const a=ce(e.data),r=a.method,u=ce(a.params);if(r==="item/started"||r==="item/completed"){const c=ce(u.item),d=typeof c.type=="string"?c.type:"item",h=r==="item/completed";if(d==="commandExecution")return{id:e.id,title:h?"Command completed":"Running command",detail:Kr(gc(c.command),96),createdAt:i,tone:h?"done":"running"};if(d==="contextCompaction")return{id:e.id,title:h?"Codex context compacted":"Codex compacting context",detail:h?void 0:"Current runtime thread is being compacted",createdAt:i,tone:h?"done":"running"};const g=Tc(c);if(g)return{id:e.id,title:h?"File update finished":"Editing file",detail:Kr(g,96),createdAt:i,tone:h?"done":"running"};if(!Nv(d))return{id:e.id,title:h?`Finished ${oa(d)}`:`Working on ${oa(d)}`,detail:Ov(c,d),createdAt:i,tone:h?"done":"running"}}if(r==="thread/status/changed"){const c=ce(u.status),d=Array.isArray(c.activeFlags)?c.activeFlags:[];if(c.type==="active"&&d.some(h=>h==="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=ce(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?To(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=ce(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${Lx(d)}`:`Finished ${Lx(d)}`,detail:typeof c.durationMs=="number"?To(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function zp(e,i){const a=Ec(e.before),r=Ec(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${To(c)}`)}else u.push("Codex triggered");if(a&&r){u.push(`context ${Va(a)} → ${Va(r)}`);const c=a.totalTokens-r.totalTokens;c>0&&u.push(`released ~${sh(c)} tokens`)}else a&&u.push(`context ${Va(a)}`);return u.join(" · ")}function j2(e){const i=Ec(e.before),a=Ec(e.after),r=i&&a?i.totalTokens-a.totalTokens:null;let u="Unavailable";return i&&a?u=`${Va(i)} → ${Va(a)}`:i?u=`${Va(i)} → unavailable`:a&&(u=`unavailable → ${Va(a)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":To(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${sh(r)} tokens`:"No decrease observed"}]}function Ec(e){const i=ce(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function Va(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${sh(e.totalTokens)} tokens`}function sh(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function C2(e){let i=null;for(const a of e)for(const r of a.events){const u=A2(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function zx(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.updatedAt)>Date.parse(i.updatedAt))?a:i,null)}function E2(e){let i=null;for(const a of e){const r=Iv(a);r&&(!i||So(a,i)>0)&&(i=r)}return i}function Iv(e){if(e.event!=="codex.notification")return null;const i=ce(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const a=ce(i.params),r=ce(a.tokenUsage),u=ce(r.last),c=ce(r.total),d=Object.keys(u).length>0?u:c,h=ci(d.totalTokens);return h===null?null:{totalTokens:h,inputTokens:ci(d.inputTokens),cachedInputTokens:ci(d.cachedInputTokens),outputTokens:ci(d.outputTokens),reasoningOutputTokens:ci(d.reasoningOutputTokens),modelContextWindow:ci(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function T2(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.createdAt)>Date.parse(i.createdAt))?a:i,null)}function Uv(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function A2(e){if(e.event!=="codex.notification")return null;const i=ce(e.data);if(i.method!=="account/rateLimits/updated")return null;const a=ce(i.params),r=ce(a.rateLimits),u=[r.primary,r.secondary].map(c=>N2(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function N2(e){const i=ce(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 _2(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function gc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function Tc(e){const i=e.path??e.file??e.filename;return typeof i=="string"?i:null}function ce(e){return e&&typeof e=="object"?e:{}}function ci(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Ce(e){return typeof e=="string"?e:""}function Ya(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function D2(e){const i=ce(e),a=ce(i.thread);if(!Object.keys(a).length)return null;const r=Array.isArray(a.turns)?a.turns:[],u=[];let c=0,d=0,h=0,g=0,m=0;return r.forEach((b,x)=>{const w=ce(b),S=Ce(w.id)||`turn-${x+1}`,A=Array.isArray(w.items)?w.items:[];c+=A.length,u.push(M2(w,S)),A.forEach(z=>{const L=ce(z),D=Ce(L.type);D==="userMessage"?d+=1:D==="agentMessage"?h+=1:D==="compaction"?g+=1:D==="contextCompaction"&&(m+=1)})}),{id:Ce(a.id),sessionId:Ce(a.sessionId),status:Bv(a.status),source:oh(a.source),cwd:Ce(a.cwd),path:Ce(a.path),preview:Ce(a.preview),createdAt:ci(a.createdAt),updatedAt:ci(a.updatedAt),recencyAt:ci(a.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:h,compactionCount:g,contextCompactionCount:m,turns:u}}function M2(e,i){const a=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(a.map(c=>Ce(ce(c).type)).filter(c=>c.length>0))).join(", "),u=O2(a.map(c=>Lp(c)).filter(Boolean).join(" "),220);return{id:i,status:Bv(e.status),itemsView:Ce(e.itemsView)||"unknown",itemCount:a.length,startedAt:ci(e.startedAt),completedAt:ci(e.completedAt),durationMs:ci(e.durationMs),itemTypes:r,preview:u,raw:e}}function Lp(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Lp).filter(Boolean).join(`
|
|
113
|
+
`);if(!e||typeof e!="object")return"";const i=e,a=Ce(i.text),r=Lp(i.content);return[a,r].filter(Boolean).join(`
|
|
114
|
+
`)}function Bv(e){const i=ce(e);return Ce(i.type)||oh(e)}function O2(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}...`:a}function ho(e){return e===null?"unknown":Ze(e*1e3)}function R2(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function oh(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function z2(e){if(typeof e=="string")return e;const i=ce(e),a=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return a&&r?`${a}
|
|
115
|
+
|
|
116
|
+
${r}`:a||r||oh(e)}function Lx(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function To(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function L2(e){return`${Math.round(e)}%`}function Qn(e){return new Intl.NumberFormat("en-US").format(e)}function yc(e){return e===null?"unknown":Qn(e)}function uh(e){return Math.max(0,Math.min(100,Math.round(e)))}function ch(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function I2(e){return Ze(e*1e3)}function Ze(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(h=>h.type===c))==null?void 0:d.value)??""};return`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`}function U2(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 Ix(e){return e==="minimal"?"Minimal":e==="low"?"Low":e==="medium"?"Medium":e==="high"?"High":e==="xhigh"?"Extra high":"Medium"}function Ux(e,i){const a=e?i.find(r=>r.model===e):i.find(r=>r.isDefault);return a?`${a.displayName}${a.isDefault?" (default)":""}`:e||"Unavailable"}function Lc(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function Ip(e,i){const a=Lc(e);return i?`${a} (${Ze(i)})`:a}function B2(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(Lc(e))}`}function q2(e,i){const a=Bx(e),r=Bx(i);if(!a||!r)return!1;for(let u=0;u<a.core.length;u+=1)if(a.core[u]!==r.core[u])return a.core[u]>r.core[u];return a.prerelease===r.prerelease?!1:a.prerelease?r.prerelease?a.prerelease.localeCompare(r.prerelease,void 0,{numeric:!0})>0:!1:!0}function Bx(e){if(!e)return null;const i=Lc(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 H2(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 gp(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 h=u.split(`
|
|
117
|
+
|
|
118
|
+
`);u=h.pop()??"";for(const g of h){const m=$2(g);m&&i(m)}}}function $2(e){const i=e.split(`
|
|
119
|
+
`),a=i.find(d=>d.startsWith("event: ")),r=i.filter(d=>d.startsWith("data: ")).map(d=>d.slice(6));if(!a||r.length===0)return null;const u=a.slice(7),c=r.join(`
|
|
120
|
+
`);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function G2(e){var r,u,c,d,h;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:(h=i.params)==null?void 0:h.itemId}:null}function V2(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 Y2(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 Fr(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 Wr(e){return e.length<=6?e:e.slice(0,6)}function ua(e){return e.slice(0,8)}function qx(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function Hx(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function yp(e,...i){return i.includes(e)}function F2(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 P2(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 xc(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 K2(e,i){return`waiting ${Ac(e,i)}`}function Ac(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 bc(e,i=null,a=Date.now()){if(e==="waiting")return i?K2(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 $x(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function W2(e){return e==="assistant"?"Seele":"You"}const X2=document.getElementById("root"),qv=window.__seeleCodexRoot??pk.createRoot(X2);window.__seeleCodexRoot=qv;n_();qv.render(o.jsx(O.StrictMode,{children:o.jsx(Q2,{})}));function Q2(){const[e,i]=O.useState(null),[a,r]=O.useState("admin"),[u,c]=O.useState(""),[d,h]=O.useState(!1),[g,m]=O.useState("");O.useEffect(()=>{Gx().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),m("Unable to reach Seele.")})},[]),O.useEffect(()=>{const w=()=>{i({enabled:!0,authenticated:!1,user:null}),c(""),m("Your session has expired. Sign in again.")};return window.addEventListener(_p,w),()=>window.removeEventListener(_p,w)},[]);async function b(w){w.preventDefault(),h(!0),m("");try{const S=await fetch(ye("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a,password:u})});if(!S.ok){m(S.status===401?"Incorrect username or password.":S.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}c(""),i(await Gx())}catch{m("Unable to reach Seele.")}finally{h(!1)}}async function x(){await fetch(ye("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}if(!e)return o.jsx("main",{className:"auth-shell",children:o.jsx("span",{className:"auth-loading",children:"Loading Seele..."})});if(!e.enabled||e.authenticated){const w=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return o.jsx(CT,{authEnabled:e.enabled,currentUser:w,onLogout:x})}return o.jsx("main",{className:"auth-shell",children:o.jsxs("section",{className:"auth-panel",children:[o.jsxs("header",{children:[o.jsx("p",{children:"Seele"}),o.jsx("h1",{children:"Sign in"})]}),o.jsxs("form",{onSubmit:b,children:[o.jsxs("label",{children:[o.jsx("span",{children:"Username"}),o.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:w=>r(w.target.value),value:a})]}),o.jsxs("label",{children:[o.jsx("span",{children:"Password"}),o.jsx("input",{autoComplete:"current-password",onChange:w=>c(w.target.value),type:"password",value:u})]}),g?o.jsx("p",{className:"auth-error",role:"alert",children:g}):null,o.jsx("button",{disabled:d||!a||!u,type:"submit",children:d?"Signing in...":"Sign in"})]})]})})}async function Gx(){const e=await fetch(ye("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function Z2(){const e=ye("admin/users"),i=await fetch(e);if(!i.ok)throw await Wt(i,{url:e});return(await i.json()).users}async function J2(e){const i=ye("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw await Wt(a,{method:"POST",url:i});return(await a.json()).user}async function e_(e,i){const a=ye(`admin/users/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Wt(r,{method:"PATCH",url:a});return(await r.json()).user}async function t_(e){const i=ye(`admin/users/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await Wt(a,{method:"DELETE",url:i})}function n_(){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;return a.status===401&&!r.includes("/api/auth/")&&window.dispatchEvent(new Event(_p)),a},window.__seeleAuthFetchInstalled=!0}export{kt as _,hk as a,_k as b,Qy as c,Ek as f,Vx as g,Nk as h,qp as s,bk as w};
|