@seele00/seele 0.1.83 → 0.1.85

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.
Files changed (71) hide show
  1. package/libexec/seele-server +0 -0
  2. package/libexec/seele-worker +0 -0
  3. package/package.json +1 -1
  4. package/scripts/deploy/bootstrap.sh +5 -0
  5. package/scripts/deploy/seele.env.example +5 -0
  6. package/scripts/deploy/start.sh +6 -0
  7. package/web/dist/assets/{abnfDiagram-VRR7QNED-Cn82GDUS.js → abnfDiagram-VRR7QNED-CxStPboB.js} +1 -1
  8. package/web/dist/assets/{arc-tvzVPzI1.js → arc-iMpxHDQ5.js} +1 -1
  9. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-Cug2O1nQ.js → architectureDiagram-ZJ3FMSHR-CGZNQX8d.js} +1 -1
  10. package/web/dist/assets/{blockDiagram-677ZJIJ3-BTY5v-bJ.js → blockDiagram-677ZJIJ3-D5_tolBV.js} +1 -1
  11. package/web/dist/assets/{c4Diagram-LMCZKHZV-BJNs5aP7.js → c4Diagram-LMCZKHZV-fBEwXGX_.js} +1 -1
  12. package/web/dist/assets/channel-CxTOaBHA.js +1 -0
  13. package/web/dist/assets/{chunk-2Q5K7J3B-KUp4Sfig.js → chunk-2Q5K7J3B-DJeJe5Hs.js} +1 -1
  14. package/web/dist/assets/{chunk-32BRIVSS-jhUOt53y.js → chunk-32BRIVSS-Cr5j1IkQ.js} +1 -1
  15. package/web/dist/assets/{chunk-5VM5RSS4-fbmjU875.js → chunk-5VM5RSS4-2mN5upnG.js} +1 -1
  16. package/web/dist/assets/{chunk-EX3LRPZG-dLJ1kP4d.js → chunk-EX3LRPZG-DTl5iz0X.js} +1 -1
  17. package/web/dist/assets/{chunk-JWPE2WC7-BymZCx_g.js → chunk-JWPE2WC7-CuA3yig7.js} +1 -1
  18. package/web/dist/assets/{chunk-MOJQB5TN-V5eq-FPV.js → chunk-MOJQB5TN-Bg5jMZB_.js} +1 -1
  19. package/web/dist/assets/{chunk-RYQCIY6F-CUZrQZic.js → chunk-RYQCIY6F-Sjn_s3N9.js} +1 -1
  20. package/web/dist/assets/{chunk-V7JOEXUC-DKtMKi_U.js → chunk-V7JOEXUC-CjT1YIRs.js} +1 -1
  21. package/web/dist/assets/{chunk-VR4S4FIN-m7bLxESu.js → chunk-VR4S4FIN-Do7r7Yjk.js} +1 -1
  22. package/web/dist/assets/{chunk-XXDRQBXY-Bm8U0C_y.js → chunk-XXDRQBXY-BuKudVOz.js} +1 -1
  23. package/web/dist/assets/classDiagram-OUVF2IWQ-Dr0rIDV_.js +1 -0
  24. package/web/dist/assets/classDiagram-v2-EOCWNBFH-Dr0rIDV_.js +1 -0
  25. package/web/dist/assets/{core-DZprx5_4.js → core-CFlkiNAr.js} +1 -1
  26. package/web/dist/assets/{cose-bilkent-JH36ORCC-CRol0mO8.js → cose-bilkent-JH36ORCC-DGko4tXb.js} +1 -1
  27. package/web/dist/assets/{cynefin-VYW2F7L2-CduHc_GB.js → cynefin-VYW2F7L2-CzImzjF0.js} +1 -1
  28. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-O4-pgQRf.js → cynefinDiagram-TSTJHNR4-Dzbk8mp4.js} +1 -1
  29. package/web/dist/assets/{dagre-VKFMJZFB-6RlGLc6K.js → dagre-VKFMJZFB-CRNZEJlb.js} +1 -1
  30. package/web/dist/assets/{diagram-FQU43EPY-DwVefQ40.js → diagram-FQU43EPY-CUS5SXEq.js} +1 -1
  31. package/web/dist/assets/{diagram-G47NLZAW-uaeb9mN8.js → diagram-G47NLZAW-CRq9Dg91.js} +1 -1
  32. package/web/dist/assets/{diagram-NH7WQ7WH-BA1gZXQp.js → diagram-NH7WQ7WH-DIyLZXUy.js} +1 -1
  33. package/web/dist/assets/{diagram-OA4YK3LP-RiXBC9vL.js → diagram-OA4YK3LP-D5OxkbcV.js} +1 -1
  34. package/web/dist/assets/{diagram-WEI45ONY-C5XA4fXX.js → diagram-WEI45ONY-B0nnoYPZ.js} +1 -1
  35. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-DROC9QBd.js → ebnfDiagram-CCIWWBDH-BWtLFIo6.js} +1 -1
  36. package/web/dist/assets/{erDiagram-Q63AITRT-BkyyKzdB.js → erDiagram-Q63AITRT-B_M--n6q.js} +1 -1
  37. package/web/dist/assets/{flowDiagram-23GEKE2U-BVVr-tA3.js → flowDiagram-23GEKE2U-1hLRAsnr.js} +1 -1
  38. package/web/dist/assets/{ganttDiagram-NO4QXBWP-BucvJsRK.js → ganttDiagram-NO4QXBWP-8cQAbHo-.js} +1 -1
  39. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-CTWOvGF7.js → gitGraphDiagram-IHSO6WYX-BdbdVOjZ.js} +1 -1
  40. package/web/dist/assets/{index-DgrjxWzj.js → index-BQk6Hfgh.js} +63 -63
  41. package/web/dist/assets/index-CRJhQRiY.css +1 -0
  42. package/web/dist/assets/{infoDiagram-FWYZ7A6U-DA64ocY1.js → infoDiagram-FWYZ7A6U-B1PfvCT-.js} +1 -1
  43. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-SPklidfq.js → ishikawaDiagram-FXEZZL3T-D_wtlGRy.js} +1 -1
  44. package/web/dist/assets/{journeyDiagram-5HDEW3XC-WU_Zdtdz.js → journeyDiagram-5HDEW3XC-CJHhRbYu.js} +1 -1
  45. package/web/dist/assets/{kanban-definition-HUTT4EX6-CgR-5gc1.js → kanban-definition-HUTT4EX6-D9y8At3A.js} +1 -1
  46. package/web/dist/assets/{linear-DHHRPNuH.js → linear-Csby_JJ8.js} +1 -1
  47. package/web/dist/assets/{mermaid.core-Cfkt_OK7.js → mermaid.core-D4jIbQQz.js} +4 -4
  48. package/web/dist/assets/{mindmap-definition-LN4V7U3C-CyqJjiIC.js → mindmap-definition-LN4V7U3C-8KScnKcF.js} +1 -1
  49. package/web/dist/assets/{pegDiagram-2B236MQR-fdl4s8s4.js → pegDiagram-2B236MQR-CWUKMGJ6.js} +1 -1
  50. package/web/dist/assets/{pieDiagram-ENE6RG2P-Cd09hRaD.js → pieDiagram-ENE6RG2P-mDq2BGfF.js} +1 -1
  51. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-Dr4Pvd2O.js → quadrantDiagram-ABIIQ3AL-BlfmPnDO.js} +1 -1
  52. package/web/dist/assets/{railroadDiagram-RFXS5EU6-ioTcW5MC.js → railroadDiagram-RFXS5EU6-Bwrd5zq1.js} +1 -1
  53. package/web/dist/assets/{requirementDiagram-TGXJPOKE-BMdn1GKi.js → requirementDiagram-TGXJPOKE-C0cCtaXg.js} +1 -1
  54. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-1eNINUr3.js → sankeyDiagram-HTMAVEWB-BMcBlrHP.js} +1 -1
  55. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-Dn3Dnu3a.js → sequenceDiagram-DBY2YBRQ-2mI19G6y.js} +1 -1
  56. package/web/dist/assets/{sizeCapture-X5ZJPWSS-CKxtjR5U.js → sizeCapture-X5ZJPWSS-BNYJEDXz.js} +1 -1
  57. package/web/dist/assets/{stateDiagram-2N3HPSRC-CY-CAphh.js → stateDiagram-2N3HPSRC-DfN4C6xs.js} +1 -1
  58. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-BqCtwZuy.js +1 -0
  59. package/web/dist/assets/{swimlanes-5IMT3BWC-BCIdl1Px.js → swimlanes-5IMT3BWC-BNLjiXOf.js} +2 -2
  60. package/web/dist/assets/swimlanesDiagram-G3AALYLV-PODZFy0z.js +8 -0
  61. package/web/dist/assets/{timeline-definition-FHXFAJF6-Dgx4LDKM.js → timeline-definition-FHXFAJF6-CTTAwxy3.js} +1 -1
  62. package/web/dist/assets/{vennDiagram-L72KCM5P-CwFN0xIC.js → vennDiagram-L72KCM5P-Bz9pwnJi.js} +1 -1
  63. package/web/dist/assets/{wardleyDiagram-EHGQE667-C52Q_jPT.js → wardleyDiagram-EHGQE667-B0kQ5kbZ.js} +1 -1
  64. package/web/dist/assets/{xychartDiagram-FW5EYKEG-Bw9uUEwU.js → xychartDiagram-FW5EYKEG-3-kO1eh6.js} +1 -1
  65. package/web/dist/index.html +2 -2
  66. package/web/dist/assets/channel-CVJCW_yj.js +0 -1
  67. package/web/dist/assets/classDiagram-OUVF2IWQ-CQb4XPro.js +0 -1
  68. package/web/dist/assets/classDiagram-v2-EOCWNBFH-CQb4XPro.js +0 -1
  69. package/web/dist/assets/index-BFFpeTtD.css +0 -1
  70. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-CvbeoI99.js +0 -1
  71. package/web/dist/assets/swimlanesDiagram-G3AALYLV-BOf8ibsG.js +0 -8
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js"])))=>i.map(i=>d[i]);
2
- var Tk=Object.defineProperty;var Ek=(e,i,l)=>i in e?Tk(e,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[i]=l;var bc=(e,i,l)=>Ek(e,typeof i!="symbol"?i+"":i,l);(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 l(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=l(u);fetch(u.href,c)}})();const Ak="modulepreload",Nk=function(e,i){return new URL(e,i).href},xy={},kt=function(i,l,r){let u=Promise.resolve();if(l&&l.length>0){let d=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(k=>({status:"fulfilled",value:k}),k=>({status:"rejected",reason:k}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(l.map(b=>{if(b=Nk(b,r),b in xy)return;xy[b]=!0;const x=b.endsWith(".css"),k=x?'[rel="stylesheet"]':"";if(!!r)for(let O=p.length-1;O>=0;O--){const U=p[O];if(U.href===b&&(!x||U.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${k}`))return;const E=document.createElement("link");if(E.rel=x?"stylesheet":Ak,x||(E.as="script"),E.crossOrigin="",E.href=b,m&&E.setAttribute("nonce",m),document.head.appendChild(E),x)return new Promise((O,U)=>{E.addEventListener("load",O),E.addEventListener("error",()=>U(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return u.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return i().catch(c)})};function ub(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qf={exports:{}},yo={};/**
2
+ var Nk=Object.defineProperty;var _k=(e,i,l)=>i in e?Nk(e,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[i]=l;var bc=(e,i,l)=>_k(e,typeof i!="symbol"?i+"":i,l);(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 l(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=l(u);fetch(u.href,c)}})();const Dk="modulepreload",Rk=function(e,i){return new URL(e,i).href},vy={},kt=function(i,l,r){let u=Promise.resolve();if(l&&l.length>0){let d=function(b){return Promise.all(b.map(y=>Promise.resolve(y).then(k=>({status:"fulfilled",value:k}),k=>({status:"rejected",reason:k}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(l.map(b=>{if(b=Rk(b,r),b in vy)return;vy[b]=!0;const y=b.endsWith(".css"),k=y?'[rel="stylesheet"]':"";if(!!r)for(let R=p.length-1;R>=0;R--){const z=p[R];if(z.href===b&&(!y||z.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${k}`))return;const T=document.createElement("link");if(T.rel=y?"stylesheet":Dk,y||(T.as="script"),T.crossOrigin="",T.href=b,m&&T.setAttribute("nonce",m),document.head.appendChild(T),y)return new Promise((R,z)=>{T.addEventListener("load",R),T.addEventListener("error",()=>z(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return u.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return i().catch(c)})};function db(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qf={exports:{}},yo={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
5
5
  *
@@ -7,7 +7,7 @@ var Tk=Object.defineProperty;var Ek=(e,i,l)=>i in e?Tk(e,i,{enumerable:!0,config
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var by;function _k(){if(by)return yo;by=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function l(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 p in u)p!=="key"&&(c[p]=u[p])}else c=u;return u=c.ref,{$$typeof:e,type:r,key:d,ref:u!==void 0?u:null,props:c}}return yo.Fragment=i,yo.jsx=l,yo.jsxs=l,yo}var vy;function Dk(){return vy||(vy=1,qf.exports=_k()),qf.exports}var s=Dk(),Hf={exports:{}},qe={};/**
10
+ */var wy;function Mk(){if(wy)return yo;wy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function l(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 p in u)p!=="key"&&(c[p]=u[p])}else c=u;return u=c.ref,{$$typeof:e,type:r,key:d,ref:u!==void 0?u:null,props:c}}return yo.Fragment=i,yo.jsx=l,yo.jsxs=l,yo}var ky;function Ok(){return ky||(ky=1,qf.exports=Mk()),qf.exports}var s=Ok(),Hf={exports:{}},qe={};/**
11
11
  * @license React
12
12
  * react.production.js
13
13
  *
@@ -15,7 +15,7 @@ var Tk=Object.defineProperty;var Ek=(e,i,l)=>i in e?Tk(e,i,{enumerable:!0,config
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var wy;function Mk(){if(wy)return qe;wy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),k=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=k&&A[k]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,U={};function _(A,z,C){this.props=A,this.context=z,this.refs=U,this.updater=C||E}_.prototype.isReactComponent={},_.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,z,"setState")},_.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function F(){}F.prototype=_.prototype;function q(A,z,C){this.props=A,this.context=z,this.refs=U,this.updater=C||E}var Y=q.prototype=new F;Y.constructor=q,O(Y,_.prototype),Y.isPureReactComponent=!0;var se=Array.isArray;function N(){}var X={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function ee(A,z,C){var K=C.ref;return{$$typeof:e,type:A,key:z,ref:K!==void 0?K:null,props:C}}function L(A,z){return ee(A.type,z,A.props)}function te(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function ce(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(C){return z[C]})}var Ee=/\/+/g;function ge(A,z){return typeof A=="object"&&A!==null&&A.key!=null?ce(""+A.key):z.toString(36)}function ue(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(N,N):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function G(A,z,C,K,me){var Z=typeof A;(Z==="undefined"||Z==="boolean")&&(A=null);var xe=!1;if(A===null)xe=!0;else switch(Z){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(A.$$typeof){case e:case i:xe=!0;break;case b:return xe=A._init,G(xe(A._payload),z,C,K,me)}}if(xe)return me=me(A),xe=K===""?"."+ge(A,0):K,se(me)?(C="",xe!=null&&(C=xe.replace(Ee,"$&/")+"/"),G(me,z,C,"",function(Ot){return Ot})):me!=null&&(te(me)&&(me=L(me,C+(me.key==null||A&&A.key===me.key?"":(""+me.key).replace(Ee,"$&/")+"/")+xe)),z.push(me)),1;xe=0;var Le=K===""?".":K+":";if(se(A))for(var Xe=0;Xe<A.length;Xe++)K=A[Xe],Z=Le+ge(K,Xe),xe+=G(K,z,C,Z,me);else if(Xe=w(A),typeof Xe=="function")for(A=Xe.call(A),Xe=0;!(K=A.next()).done;)K=K.value,Z=Le+ge(K,Xe++),xe+=G(K,z,C,Z,me);else if(Z==="object"){if(typeof A.then=="function")return G(ue(A),z,C,K,me);throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return xe}function oe(A,z,C){if(A==null)return A;var K=[],me=0;return G(A,K,"","",function(Z){return z.call(C,Z,me++)}),K}function ye(A){if(A._status===-1){var z=A._result;z=z(),z.then(function(C){(A._status===0||A._status===-1)&&(A._status=1,A._result=C)},function(C){(A._status===0||A._status===-1)&&(A._status=2,A._result=C)}),A._status===-1&&(A._status=0,A._result=z)}if(A._status===1)return A._result.default;throw A._result}var De=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},R={map:oe,forEach:function(A,z,C){oe(A,function(){z.apply(this,arguments)},C)},count:function(A){var z=0;return oe(A,function(){z++}),z},toArray:function(A){return oe(A,function(z){return z})||[]},only:function(A){if(!te(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return qe.Activity=x,qe.Children=R,qe.Component=_,qe.Fragment=l,qe.Profiler=u,qe.PureComponent=q,qe.StrictMode=r,qe.Suspense=g,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,qe.__COMPILER_RUNTIME={__proto__:null,c:function(A){return X.H.useMemoCache(A)}},qe.cache=function(A){return function(){return A.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(A,z,C){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var K=O({},A.props),me=A.key;if(z!=null)for(Z in z.key!==void 0&&(me=""+z.key),z)!ae.call(z,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&z.ref===void 0||(K[Z]=z[Z]);var Z=arguments.length-2;if(Z===1)K.children=C;else if(1<Z){for(var xe=Array(Z),Le=0;Le<Z;Le++)xe[Le]=arguments[Le+2];K.children=xe}return ee(A.type,me,K)},qe.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:c,_context:A},A},qe.createElement=function(A,z,C){var K,me={},Z=null;if(z!=null)for(K in z.key!==void 0&&(Z=""+z.key),z)ae.call(z,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(me[K]=z[K]);var xe=arguments.length-2;if(xe===1)me.children=C;else if(1<xe){for(var Le=Array(xe),Xe=0;Xe<xe;Xe++)Le[Xe]=arguments[Xe+2];me.children=Le}if(A&&A.defaultProps)for(K in xe=A.defaultProps,xe)me[K]===void 0&&(me[K]=xe[K]);return ee(A,Z,me)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(A){return{$$typeof:p,render:A}},qe.isValidElement=te,qe.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:ye}},qe.memo=function(A,z){return{$$typeof:m,type:A,compare:z===void 0?null:z}},qe.startTransition=function(A){var z=X.T,C={};X.T=C;try{var K=A(),me=X.S;me!==null&&me(C,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(N,De)}catch(Z){De(Z)}finally{z!==null&&C.types!==null&&(z.types=C.types),X.T=z}},qe.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},qe.use=function(A){return X.H.use(A)},qe.useActionState=function(A,z,C){return X.H.useActionState(A,z,C)},qe.useCallback=function(A,z){return X.H.useCallback(A,z)},qe.useContext=function(A){return X.H.useContext(A)},qe.useDebugValue=function(){},qe.useDeferredValue=function(A,z){return X.H.useDeferredValue(A,z)},qe.useEffect=function(A,z){return X.H.useEffect(A,z)},qe.useEffectEvent=function(A){return X.H.useEffectEvent(A)},qe.useId=function(){return X.H.useId()},qe.useImperativeHandle=function(A,z,C){return X.H.useImperativeHandle(A,z,C)},qe.useInsertionEffect=function(A,z){return X.H.useInsertionEffect(A,z)},qe.useLayoutEffect=function(A,z){return X.H.useLayoutEffect(A,z)},qe.useMemo=function(A,z){return X.H.useMemo(A,z)},qe.useOptimistic=function(A,z){return X.H.useOptimistic(A,z)},qe.useReducer=function(A,z,C){return X.H.useReducer(A,z,C)},qe.useRef=function(A){return X.H.useRef(A)},qe.useState=function(A){return X.H.useState(A)},qe.useSyncExternalStore=function(A,z,C){return X.H.useSyncExternalStore(A,z,C)},qe.useTransition=function(){return X.H.useTransition()},qe.version="19.2.7",qe}var ky;function eh(){return ky||(ky=1,Hf.exports=Mk()),Hf.exports}var D=eh(),$f={exports:{}},xo={},Gf={exports:{}},Vf={};/**
18
+ */var jy;function zk(){if(jy)return qe;jy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),k=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=k&&A[k]||A["@@iterator"],typeof A=="function"?A:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,z={};function N(A,L,C){this.props=A,this.context=L,this.refs=z,this.updater=C||T}N.prototype.isReactComponent={},N.prototype.setState=function(A,L){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,L,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function G(){}G.prototype=N.prototype;function B(A,L,C){this.props=A,this.context=L,this.refs=z,this.updater=C||T}var P=B.prototype=new G;P.constructor=B,R(P,N.prototype),P.isPureReactComponent=!0;var se=Array.isArray;function _(){}var X={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function ee(A,L,C){var K=C.ref;return{$$typeof:e,type:A,key:L,ref:K!==void 0?K:null,props:C}}function I(A,L){return ee(A.type,L,A.props)}function te(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function ce(A){var L={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(C){return L[C]})}var Ee=/\/+/g;function ge(A,L){return typeof A=="object"&&A!==null&&A.key!=null?ce(""+A.key):L.toString(36)}function ue(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(_,_):(A.status="pending",A.then(function(L){A.status==="pending"&&(A.status="fulfilled",A.value=L)},function(L){A.status==="pending"&&(A.status="rejected",A.reason=L)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function V(A,L,C,K,me){var Z=typeof A;(Z==="undefined"||Z==="boolean")&&(A=null);var xe=!1;if(A===null)xe=!0;else switch(Z){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(A.$$typeof){case e:case i:xe=!0;break;case b:return xe=A._init,V(xe(A._payload),L,C,K,me)}}if(xe)return me=me(A),xe=K===""?"."+ge(A,0):K,se(me)?(C="",xe!=null&&(C=xe.replace(Ee,"$&/")+"/"),V(me,L,C,"",function(Ot){return Ot})):me!=null&&(te(me)&&(me=I(me,C+(me.key==null||A&&A.key===me.key?"":(""+me.key).replace(Ee,"$&/")+"/")+xe)),L.push(me)),1;xe=0;var Le=K===""?".":K+":";if(se(A))for(var Xe=0;Xe<A.length;Xe++)K=A[Xe],Z=Le+ge(K,Xe),xe+=V(K,L,C,Z,me);else if(Xe=w(A),typeof Xe=="function")for(A=Xe.call(A),Xe=0;!(K=A.next()).done;)K=K.value,Z=Le+ge(K,Xe++),xe+=V(K,L,C,Z,me);else if(Z==="object"){if(typeof A.then=="function")return V(ue(A),L,C,K,me);throw L=String(A),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return xe}function oe(A,L,C){if(A==null)return A;var K=[],me=0;return V(A,K,"","",function(Z){return L.call(C,Z,me++)}),K}function ye(A){if(A._status===-1){var L=A._result;L=L(),L.then(function(C){(A._status===0||A._status===-1)&&(A._status=1,A._result=C)},function(C){(A._status===0||A._status===-1)&&(A._status=2,A._result=C)}),A._status===-1&&(A._status=0,A._result=L)}if(A._status===1)return A._result.default;throw A._result}var De=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},O={map:oe,forEach:function(A,L,C){oe(A,function(){L.apply(this,arguments)},C)},count:function(A){var L=0;return oe(A,function(){L++}),L},toArray:function(A){return oe(A,function(L){return L})||[]},only:function(A){if(!te(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return qe.Activity=y,qe.Children=O,qe.Component=N,qe.Fragment=l,qe.Profiler=u,qe.PureComponent=B,qe.StrictMode=r,qe.Suspense=g,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,qe.__COMPILER_RUNTIME={__proto__:null,c:function(A){return X.H.useMemoCache(A)}},qe.cache=function(A){return function(){return A.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(A,L,C){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var K=R({},A.props),me=A.key;if(L!=null)for(Z in L.key!==void 0&&(me=""+L.key),L)!ae.call(L,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&L.ref===void 0||(K[Z]=L[Z]);var Z=arguments.length-2;if(Z===1)K.children=C;else if(1<Z){for(var xe=Array(Z),Le=0;Le<Z;Le++)xe[Le]=arguments[Le+2];K.children=xe}return ee(A.type,me,K)},qe.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:c,_context:A},A},qe.createElement=function(A,L,C){var K,me={},Z=null;if(L!=null)for(K in L.key!==void 0&&(Z=""+L.key),L)ae.call(L,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(me[K]=L[K]);var xe=arguments.length-2;if(xe===1)me.children=C;else if(1<xe){for(var Le=Array(xe),Xe=0;Xe<xe;Xe++)Le[Xe]=arguments[Xe+2];me.children=Le}if(A&&A.defaultProps)for(K in xe=A.defaultProps,xe)me[K]===void 0&&(me[K]=xe[K]);return ee(A,Z,me)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(A){return{$$typeof:p,render:A}},qe.isValidElement=te,qe.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:ye}},qe.memo=function(A,L){return{$$typeof:m,type:A,compare:L===void 0?null:L}},qe.startTransition=function(A){var L=X.T,C={};X.T=C;try{var K=A(),me=X.S;me!==null&&me(C,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(_,De)}catch(Z){De(Z)}finally{L!==null&&C.types!==null&&(L.types=C.types),X.T=L}},qe.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},qe.use=function(A){return X.H.use(A)},qe.useActionState=function(A,L,C){return X.H.useActionState(A,L,C)},qe.useCallback=function(A,L){return X.H.useCallback(A,L)},qe.useContext=function(A){return X.H.useContext(A)},qe.useDebugValue=function(){},qe.useDeferredValue=function(A,L){return X.H.useDeferredValue(A,L)},qe.useEffect=function(A,L){return X.H.useEffect(A,L)},qe.useEffectEvent=function(A){return X.H.useEffectEvent(A)},qe.useId=function(){return X.H.useId()},qe.useImperativeHandle=function(A,L,C){return X.H.useImperativeHandle(A,L,C)},qe.useInsertionEffect=function(A,L){return X.H.useInsertionEffect(A,L)},qe.useLayoutEffect=function(A,L){return X.H.useLayoutEffect(A,L)},qe.useMemo=function(A,L){return X.H.useMemo(A,L)},qe.useOptimistic=function(A,L){return X.H.useOptimistic(A,L)},qe.useReducer=function(A,L,C){return X.H.useReducer(A,L,C)},qe.useRef=function(A){return X.H.useRef(A)},qe.useState=function(A){return X.H.useState(A)},qe.useSyncExternalStore=function(A,L,C){return X.H.useSyncExternalStore(A,L,C)},qe.useTransition=function(){return X.H.useTransition()},qe.version="19.2.7",qe}var Sy;function th(){return Sy||(Sy=1,Hf.exports=zk()),Hf.exports}var D=th(),$f={exports:{}},xo={},Gf={exports:{}},Vf={};/**
19
19
  * @license React
20
20
  * scheduler.production.js
21
21
  *
@@ -23,7 +23,7 @@ var Tk=Object.defineProperty;var Ek=(e,i,l)=>i in e?Tk(e,i,{enumerable:!0,config
23
23
  *
24
24
  * This source code is licensed under the MIT license found in the
25
25
  * LICENSE file in the root directory of this source tree.
26
- */var Sy;function Rk(){return Sy||(Sy=1,(function(e){function i(G,oe){var ye=G.length;G.push(oe);e:for(;0<ye;){var De=ye-1>>>1,R=G[De];if(0<u(R,oe))G[De]=oe,G[ye]=R,ye=De;else break e}}function l(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var oe=G[0],ye=G.pop();if(ye!==oe){G[0]=ye;e:for(var De=0,R=G.length,A=R>>>1;De<A;){var z=2*(De+1)-1,C=G[z],K=z+1,me=G[K];if(0>u(C,ye))K<R&&0>u(me,C)?(G[De]=me,G[K]=ye,De=K):(G[De]=C,G[z]=ye,De=z);else if(K<R&&0>u(me,ye))G[De]=me,G[K]=ye,De=K;else break e}}return oe}function u(G,oe){var ye=G.sortIndex-oe.sortIndex;return ye!==0?ye:G.id-oe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var g=[],m=[],b=1,x=null,k=3,w=!1,E=!1,O=!1,U=!1,_=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function Y(G){for(var oe=l(m);oe!==null;){if(oe.callback===null)r(m);else if(oe.startTime<=G)r(m),oe.sortIndex=oe.expirationTime,i(g,oe);else break;oe=l(m)}}function se(G){if(O=!1,Y(G),!E)if(l(g)!==null)E=!0,N||(N=!0,ce());else{var oe=l(m);oe!==null&&ue(se,oe.startTime-G)}}var N=!1,X=-1,ae=5,ee=-1;function L(){return U?!0:!(e.unstable_now()-ee<ae)}function te(){if(U=!1,N){var G=e.unstable_now();ee=G;var oe=!0;try{e:{E=!1,O&&(O=!1,F(X),X=-1),w=!0;var ye=k;try{t:{for(Y(G),x=l(g);x!==null&&!(x.expirationTime>G&&L());){var De=x.callback;if(typeof De=="function"){x.callback=null,k=x.priorityLevel;var R=De(x.expirationTime<=G);if(G=e.unstable_now(),typeof R=="function"){x.callback=R,Y(G),oe=!0;break t}x===l(g)&&r(g),Y(G)}else r(g);x=l(g)}if(x!==null)oe=!0;else{var A=l(m);A!==null&&ue(se,A.startTime-G),oe=!1}}break e}finally{x=null,k=ye,w=!1}oe=void 0}}finally{oe?ce():N=!1}}}var ce;if(typeof q=="function")ce=function(){q(te)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,ge=Ee.port2;Ee.port1.onmessage=te,ce=function(){ge.postMessage(null)}}else ce=function(){_(te,0)};function ue(G,oe){X=_(function(){G(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_next=function(G){switch(k){case 1:case 2:case 3:var oe=3;break;default:oe=k}var ye=k;k=oe;try{return G()}finally{k=ye}},e.unstable_requestPaint=function(){U=!0},e.unstable_runWithPriority=function(G,oe){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ye=k;k=G;try{return oe()}finally{k=ye}},e.unstable_scheduleCallback=function(G,oe,ye){var De=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?De+ye:De):ye=De,G){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=ye+R,G={id:b++,callback:oe,priorityLevel:G,startTime:ye,expirationTime:R,sortIndex:-1},ye>De?(G.sortIndex=ye,i(m,G),l(g)===null&&G===l(m)&&(O?(F(X),X=-1):O=!0,ue(se,ye-De))):(G.sortIndex=R,i(g,G),E||w||(E=!0,N||(N=!0,ce()))),G},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(G){var oe=k;return function(){var ye=k;k=oe;try{return G.apply(this,arguments)}finally{k=ye}}}})(Vf)),Vf}var jy;function Ok(){return jy||(jy=1,Gf.exports=Rk()),Gf.exports}var Yf={exports:{}},fn={};/**
26
+ */var Cy;function Lk(){return Cy||(Cy=1,(function(e){function i(V,oe){var ye=V.length;V.push(oe);e:for(;0<ye;){var De=ye-1>>>1,O=V[De];if(0<u(O,oe))V[De]=oe,V[ye]=O,ye=De;else break e}}function l(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var oe=V[0],ye=V.pop();if(ye!==oe){V[0]=ye;e:for(var De=0,O=V.length,A=O>>>1;De<A;){var L=2*(De+1)-1,C=V[L],K=L+1,me=V[K];if(0>u(C,ye))K<O&&0>u(me,C)?(V[De]=me,V[K]=ye,De=K):(V[De]=C,V[L]=ye,De=L);else if(K<O&&0>u(me,ye))V[De]=me,V[K]=ye,De=K;else break e}}return oe}function u(V,oe){var ye=V.sortIndex-oe.sortIndex;return ye!==0?ye:V.id-oe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var g=[],m=[],b=1,y=null,k=3,w=!1,T=!1,R=!1,z=!1,N=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function P(V){for(var oe=l(m);oe!==null;){if(oe.callback===null)r(m);else if(oe.startTime<=V)r(m),oe.sortIndex=oe.expirationTime,i(g,oe);else break;oe=l(m)}}function se(V){if(R=!1,P(V),!T)if(l(g)!==null)T=!0,_||(_=!0,ce());else{var oe=l(m);oe!==null&&ue(se,oe.startTime-V)}}var _=!1,X=-1,ae=5,ee=-1;function I(){return z?!0:!(e.unstable_now()-ee<ae)}function te(){if(z=!1,_){var V=e.unstable_now();ee=V;var oe=!0;try{e:{T=!1,R&&(R=!1,G(X),X=-1),w=!0;var ye=k;try{t:{for(P(V),y=l(g);y!==null&&!(y.expirationTime>V&&I());){var De=y.callback;if(typeof De=="function"){y.callback=null,k=y.priorityLevel;var O=De(y.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){y.callback=O,P(V),oe=!0;break t}y===l(g)&&r(g),P(V)}else r(g);y=l(g)}if(y!==null)oe=!0;else{var A=l(m);A!==null&&ue(se,A.startTime-V),oe=!1}}break e}finally{y=null,k=ye,w=!1}oe=void 0}}finally{oe?ce():_=!1}}}var ce;if(typeof B=="function")ce=function(){B(te)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,ge=Ee.port2;Ee.port1.onmessage=te,ce=function(){ge.postMessage(null)}}else ce=function(){N(te,0)};function ue(V,oe){X=N(function(){V(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_next=function(V){switch(k){case 1:case 2:case 3:var oe=3;break;default:oe=k}var ye=k;k=oe;try{return V()}finally{k=ye}},e.unstable_requestPaint=function(){z=!0},e.unstable_runWithPriority=function(V,oe){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ye=k;k=V;try{return oe()}finally{k=ye}},e.unstable_scheduleCallback=function(V,oe,ye){var De=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?De+ye:De):ye=De,V){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=ye+O,V={id:b++,callback:oe,priorityLevel:V,startTime:ye,expirationTime:O,sortIndex:-1},ye>De?(V.sortIndex=ye,i(m,V),l(g)===null&&V===l(m)&&(R?(G(X),X=-1):R=!0,ue(se,ye-De))):(V.sortIndex=O,i(g,V),T||w||(T=!0,_||(_=!0,ce()))),V},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(V){var oe=k;return function(){var ye=k;k=oe;try{return V.apply(this,arguments)}finally{k=ye}}}})(Vf)),Vf}var Ty;function Ik(){return Ty||(Ty=1,Gf.exports=Lk()),Gf.exports}var Pf={exports:{}},fn={};/**
27
27
  * @license React
28
28
  * react-dom.production.js
29
29
  *
@@ -31,7 +31,7 @@ var Tk=Object.defineProperty;var Ek=(e,i,l)=>i in e?Tk(e,i,{enumerable:!0,config
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
34
- */var Cy;function zk(){if(Cy)return fn;Cy=1;var e=eh();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 l(){}var r={d:{f:l,r:function(){throw Error(i(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fn.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)},fn.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()}},fn.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))},fn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},fn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin),k=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:k,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:k,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},fn.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(g)},fn.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin);r.d.L(g,b,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},fn.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(m.as,m.crossOrigin);r.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(g)},fn.requestFormReset=function(g){r.d.r(g)},fn.unstable_batchedUpdates=function(g,m){return g(m)},fn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},fn.useFormStatus=function(){return d.H.useHostTransitionStatus()},fn.version="19.2.7",fn}var Ty;function Lk(){if(Ty)return Yf.exports;Ty=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(),Yf.exports=zk(),Yf.exports}/**
34
+ */var Ey;function Uk(){if(Ey)return fn;Ey=1;var e=th();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 l(){}var r={d:{f:l,r:function(){throw Error(i(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:y==null?null:""+y,children:g,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fn.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)},fn.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()}},fn.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))},fn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},fn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,y=p(b,m.crossOrigin),k=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:k,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:y,integrity:k,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},fn.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(g)},fn.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,y=p(b,m.crossOrigin);r.d.L(g,b,{crossOrigin:y,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})}},fn.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(m.as,m.crossOrigin);r.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(g)},fn.requestFormReset=function(g){r.d.r(g)},fn.unstable_batchedUpdates=function(g,m){return g(m)},fn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},fn.useFormStatus=function(){return d.H.useHostTransitionStatus()},fn.version="19.2.7",fn}var Ay;function Bk(){if(Ay)return Pf.exports;Ay=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(),Pf.exports=Uk(),Pf.exports}/**
35
35
  * @license React
36
36
  * react-dom-client.production.js
37
37
  *
@@ -39,92 +39,92 @@ var Tk=Object.defineProperty;var Ek=(e,i,l)=>i in e?Tk(e,i,{enumerable:!0,config
39
39
  *
40
40
  * This source code is licensed under the MIT license found in the
41
41
  * LICENSE file in the root directory of this source tree.
42
- */var Ey;function Ik(){if(Ey)return xo;Ey=1;var e=Ok(),i=eh(),l=Lk();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+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,a=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(a=n.return),t=n.return;while(t)}return n.tag===3?a:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var a=t,o=n;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){a=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(a.return!==o.return)a=f,o=h;else{for(var v=!1,T=f.child;T;){if(T===a){v=!0,a=f,o=h;break}if(T===o){v=!0,o=f,a=h;break}T=T.sibling}if(!v){for(T=h.child;T;){if(T===a){v=!0,a=h,o=f;break}if(T===o){v=!0,o=h,a=f;break}T=T.sibling}if(!v)throw Error(r(189))}}if(a.alternate!==o)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?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,k=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),q=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ce(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Ee=Symbol.for("react.client.reference");function ge(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ee?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case O:return"Fragment";case _:return"Profiler";case U:return"StrictMode";case se:return"Suspense";case N:return"SuspenseList";case ee:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case q:return t.displayName||"Context";case F:return(t._context.displayName||"Context")+".Consumer";case Y:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return n=t.displayName||null,n!==null?n:ge(t.type)||"Memo";case ae:n=t._payload,t=t._init;try{return ge(t(n))}catch{}}return null}var ue=Array.isArray,G=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},De=[],R=-1;function A(t){return{current:t}}function z(t){0>R||(t.current=De[R],De[R]=null,R--)}function C(t,n){R++,De[R]=t.current,t.current=n}var K=A(null),me=A(null),Z=A(null),xe=A(null);function Le(t,n){switch(C(Z,n),C(me,t),C(K,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Hg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Hg(n),t=$g(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(K),C(K,t)}function Xe(){z(K),z(me),z(Z)}function Ot(t){t.memoizedState!==null&&C(xe,t);var n=K.current,a=$g(n,t.type);n!==a&&(C(me,t),C(K,a))}function Ft(t){me.current===t&&(z(K),z(me)),xe.current===t&&(z(xe),po._currentValue=ye)}var Ye,Et;function Jt(t){if(Ye===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);Ye=n&&n[1]||"",Et=-1<a.stack.indexOf(`
42
+ */var Ny;function qk(){if(Ny)return xo;Ny=1;var e=Ik(),i=th(),l=Bk();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+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,a=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(a=n.return),t=n.return;while(t)}return n.tag===3?a:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var a=t,o=n;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){a=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(a.return!==o.return)a=f,o=h;else{for(var v=!1,E=f.child;E;){if(E===a){v=!0,a=f,o=h;break}if(E===o){v=!0,o=f,a=h;break}E=E.sibling}if(!v){for(E=h.child;E;){if(E===a){v=!0,a=h,o=f;break}if(E===o){v=!0,o=h,a=f;break}E=E.sibling}if(!v)throw Error(r(189))}}if(a.alternate!==o)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?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 y=Object.assign,k=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),B=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ce(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Ee=Symbol.for("react.client.reference");function ge(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ee?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case N:return"Profiler";case z:return"StrictMode";case se:return"Suspense";case _:return"SuspenseList";case ee:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case B:return t.displayName||"Context";case G: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 X:return n=t.displayName||null,n!==null?n:ge(t.type)||"Memo";case ae:n=t._payload,t=t._init;try{return ge(t(n))}catch{}}return null}var ue=Array.isArray,V=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},De=[],O=-1;function A(t){return{current:t}}function L(t){0>O||(t.current=De[O],De[O]=null,O--)}function C(t,n){O++,De[O]=t.current,t.current=n}var K=A(null),me=A(null),Z=A(null),xe=A(null);function Le(t,n){switch(C(Z,n),C(me,t),C(K,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Gg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Gg(n),t=Vg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}L(K),C(K,t)}function Xe(){L(K),L(me),L(Z)}function Ot(t){t.memoizedState!==null&&C(xe,t);var n=K.current,a=Vg(n,t.type);n!==a&&(C(me,t),C(K,a))}function Wt(t){me.current===t&&(L(K),L(me)),xe.current===t&&(L(xe),po._currentValue=ye)}var Ye,Et;function Jt(t){if(Ye===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);Ye=n&&n[1]||"",Et=-1<a.stack.indexOf(`
43
43
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Ye+t+Et}var zt=!1;function rn(t,n){if(!t||zt)return"";zt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Q){var W=Q}Reflect.construct(t,[],re)}else{try{re.call()}catch(Q){W=Q}t.call(re.prototype)}}else{try{throw Error()}catch(Q){W=Q}(re=t())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Q){if(Q&&W&&typeof Q.stack=="string")return[Q.stack,W.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),v=h[0],T=h[1];if(v&&T){var I=v.split(`
45
- `),P=T.split(`
46
- `);for(f=o=0;o<I.length&&!I[o].includes("DetermineComponentFrameRoot");)o++;for(;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;if(o===I.length||f===P.length)for(o=I.length-1,f=P.length-1;1<=o&&0<=f&&I[o]!==P[f];)f--;for(;1<=o&&0<=f;o--,f--)if(I[o]!==P[f]){if(o!==1||f!==1)do if(o--,f--,0>f||I[o]!==P[f]){var ie=`
47
- `+I[o].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",t.displayName)),ie}while(1<=o&&0<=f);break}}}finally{zt=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Jt(a):""}function ze(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 rn(t.type,!1);case 11:return rn(t.type.render,!1);case 1:return rn(t.type,!0);case 31:return Jt("Activity");default:return""}}function wt(t){try{var n="",a=null;do n+=ze(t,a),a=t,t=t.return;while(t);return n}catch(o){return`
44
+ `+Ye+t+Et}var zt=!1;function rn(t,n){if(!t||zt)return"";zt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Q){var W=Q}Reflect.construct(t,[],re)}else{try{re.call()}catch(Q){W=Q}t.call(re.prototype)}}else{try{throw Error()}catch(Q){W=Q}(re=t())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Q){if(Q&&W&&typeof Q.stack=="string")return[Q.stack,W.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),v=h[0],E=h[1];if(v&&E){var U=v.split(`
45
+ `),F=E.split(`
46
+ `);for(f=o=0;o<U.length&&!U[o].includes("DetermineComponentFrameRoot");)o++;for(;f<F.length&&!F[f].includes("DetermineComponentFrameRoot");)f++;if(o===U.length||f===F.length)for(o=U.length-1,f=F.length-1;1<=o&&0<=f&&U[o]!==F[f];)f--;for(;1<=o&&0<=f;o--,f--)if(U[o]!==F[f]){if(o!==1||f!==1)do if(o--,f--,0>f||U[o]!==F[f]){var ie=`
47
+ `+U[o].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",t.displayName)),ie}while(1<=o&&0<=f);break}}}finally{zt=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Jt(a):""}function ze(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 rn(t.type,!1);case 11:return rn(t.type.render,!1);case 1:return rn(t.type,!0);case 31:return Jt("Activity");default:return""}}function wt(t){try{var n="",a=null;do n+=ze(t,a),a=t,t=t.return;while(t);return n}catch(o){return`
48
48
  Error generating stack: `+o.message+`
49
- `+o.stack}}var sn=Object.prototype.hasOwnProperty,wn=e.unstable_scheduleCallback,gi=e.unstable_cancelCallback,yi=e.unstable_shouldYield,Di=e.unstable_requestPaint,Lt=e.unstable_now,Ml=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,he=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Ae=e.unstable_LowPriority,Ie=e.unstable_IdlePriority,At=e.log,mn=e.unstable_setDisableYieldValue,tt=null,St=null;function on(t){if(typeof At=="function"&&mn(t),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(tt,t)}catch{}}var rt=Math.clz32?Math.clz32:Qc,Mi=Math.log,qn=Math.LN2;function Qc(t){return t>>>=0,t===0?32:31-(Mi(t)/qn|0)|0}var Ea=256,Aa=262144,Rl=4194304;function Vt(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 xi(t,n,a){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var T=o&134217727;return T!==0?(o=T&~h,o!==0?f=Vt(o):(v&=T,v!==0?f=Vt(v):a||(a=T&~t,a!==0&&(f=Vt(a))))):(T=o&~h,T!==0?f=Vt(T):v!==0?f=Vt(v):a||(a=o&~t,a!==0&&(f=Vt(a)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:f}function ot(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Na(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 Fo(){var t=Rl;return Rl<<=1,(Rl&62914560)===0&&(Rl=4194304),t}function tl(t){for(var n=[],a=0;31>a;a++)n.push(t);return n}function Ol(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function _a(t,n,a,o,f,h){var v=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var T=t.entanglements,I=t.expirationTimes,P=t.hiddenUpdates;for(a=v&~a;0<a;){var ie=31-rt(a),re=1<<ie;T[ie]=0,I[ie]=-1;var W=P[ie];if(W!==null)for(P[ie]=null,ie=0;ie<W.length;ie++){var Q=W[ie];Q!==null&&(Q.lane&=-536870913)}a&=~re}o!==0&&Wo(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function Wo(t,n,a){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-rt(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|a&261930}function cs(t,n){var a=t.entangledLanes|=n;for(t=t.entanglements;a;){var o=31-rt(a),f=1<<o;f&n|t[o]&n&&(t[o]|=n),a&=~f}}function Ko(t,n){var a=n&-n;return a=(a&42)!==0?1:fr(a),(a&(t.suspendedLanes|n))!==0?0:a}function fr(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 ds(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function pr(){var t=oe.p;return t!==0?t:(t=window.event,t===void 0?32:dy(t.type))}function Xo(t,n){var a=oe.p;try{return oe.p=t,n()}finally{oe.p=a}}var kn=Math.random().toString(36).slice(2),bt="__reactFiber$"+kn,Nt="__reactProps$"+kn,Hn="__reactContainer$"+kn,Ri="__reactEvents$"+kn,fs="__reactListeners$"+kn,hr="__reactHandles$"+kn,Qo="__reactResources$"+kn,bi="__reactMarker$"+kn;function Da(t){delete t[bt],delete t[Nt],delete t[Ri],delete t[fs],delete t[hr]}function Oi(t){var n=t[bt];if(n)return n;for(var a=t.parentNode;a;){if(n=a[Hn]||a[bt]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(t=Kg(t);t!==null;){if(a=t[bt])return a;t=Kg(t)}return n}t=a,a=t.parentNode}return null}function zi(t){if(t=t[bt]||t[Hn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function nl(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function zl(t){var n=t[Qo];return n||(n=t[Qo]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function _t(t){t[bi]=!0}var vi=new Set,mr={};function Li(t,n){Ll(t,n),Ll(t+"Capture",n)}function Ll(t,n){for(mr[t]=n,t=0;t<n.length;t++)vi.add(n[t])}var Zc=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),il={},Zo={};function Jo(t){return sn.call(Zo,t)?!0:sn.call(il,t)?!1:Zc.test(t)?Zo[t]=!0:(il[t]=!0,!1)}function $n(t,n,a){if(Jo(n))if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+a)}}function ii(t,n,a){if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+a)}}function wi(t,n,a,o){if(o===null)t.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(n,a,""+o)}}function Dt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Il(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function eu(t,n,a){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,h=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){a=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(v){a=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Gn(t){if(!t._valueTracker){var n=Il(t)?"checked":"value";t._valueTracker=eu(t,n,""+t[n])}}function li(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var a=n.getValue(),o="";return t&&(o=Il(t)?t.checked?"true":"false":t.value),t=o,t!==a?(n.setValue(t),!0):!1}function ai(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 tu=/[\n"\\]/g;function Wt(t){return t.replace(tu,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function gr(t,n,a,o,f,h,v,T){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Dt(n)):t.value!==""+Dt(n)&&(t.value=""+Dt(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?ps(t,v,Dt(n)):a!=null?ps(t,v,Dt(a)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+Dt(T):t.removeAttribute("name")}function Ul(t,n,a,o,f,h,v,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Gn(t);return}a=a!=null?""+Dt(a):"",n=n!=null?""+Dt(n):a,T||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=T?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),Gn(t)}function ps(t,n,a){n==="number"&&ai(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function ki(t,n,a,o){if(t=t.options,n){n={};for(var f=0;f<a.length;f++)n["$"+a[f]]=!0;for(a=0;a<t.length;a++)f=n.hasOwnProperty("$"+t[a].value),t[a].selected!==f&&(t[a].selected=f),f&&o&&(t[a].defaultSelected=!0)}else{for(a=""+Dt(a),n=null,f=0;f<t.length;f++){if(t[f].value===a){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function Bl(t,n,a){if(n!=null&&(n=""+Dt(n),n!==t.value&&(t.value=n),a==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=a!=null?""+Dt(a):""}function yr(t,n,a,o){if(n==null){if(o!=null){if(a!=null)throw Error(r(92));if(ue(o)){if(1<o.length)throw Error(r(93));o=o[0]}a=o}a==null&&(a=""),n=a}a=Dt(n),t.defaultValue=a,o=t.textContent,o===a&&o!==""&&o!==null&&(t.value=o),Gn(t)}function Ii(t,n){if(n){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=n;return}}t.textContent=n}var nu=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 Ma(t,n,a){var o=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,a):typeof a!="number"||a===0||nu.has(n)?n==="float"?t.cssFloat=a:t[n]=(""+a).trim():t[n]=a+"px"}function Vn(t,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&a[f]!==o&&Ma(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&Ma(t,h,n[h])}function ri(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 hs=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"]]),Ra=/^[\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 ql(t){return Ra.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Yn(){}var ms=null;function Oa(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ll=null,Hl=null;function Ui(t){var n=zi(t);if(n&&(t=n.stateNode)){var a=t[Nt]||null;e:switch(t=n.stateNode,n.type){case"input":if(gr(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Wt(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var o=a[n];if(o!==t&&o.form===t.form){var f=o[Nt]||null;if(!f)throw Error(r(90));gr(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<a.length;n++)o=a[n],o.form===t.form&&li(o)}break e;case"textarea":Bl(t,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&ki(t,!!a.multiple,n,!1)}}}var gs=!1;function ys(t,n,a){if(gs)return t(n,a);gs=!0;try{var o=t(n);return o}finally{if(gs=!1,(ll!==null||Hl!==null)&&(Qu(),ll&&(n=ll,t=Hl,Hl=ll=null,Ui(n),t)))for(n=0;n<t.length;n++)Ui(t[n])}}function Bi(t,n){var a=t.stateNode;if(a===null)return null;var o=a[Nt]||null;if(o===null)return null;a=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xr=!1;if(si)try{var oi={};Object.defineProperty(oi,"passive",{get:function(){xr=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{xr=!1}var Pn=null,br=null,qi=null;function vr(){if(qi)return qi;var t,n=br,a=n.length,o,f="value"in Pn?Pn.value:Pn.textContent,h=f.length;for(t=0;t<a&&n[t]===f[t];t++);var v=a-t;for(o=1;o<=v&&n[a-o]===f[h-o];o++);return qi=f.slice(t,1<o?1-o:void 0)}function $l(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 Gl(){return!0}function xs(){return!1}function en(t){function n(a,o,f,h,v){this._reactName=a,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var T in t)t.hasOwnProperty(T)&&(a=t[T],this[T]=a?a(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Gl:xs,this.isPropagationStopped=xs,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Gl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Gl)},persist:function(){},isPersistent:Gl}),n}var un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=en(un),It=x({},un,{view:0,detail:0}),wr=en(It),Vl,al,ui,rl=x({},It,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yl,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!==ui&&(ui&&t.type==="mousemove"?(Vl=t.screenX-ui.screenX,al=t.screenY-ui.screenY):al=Vl=0,ui=t),Vl)},movementY:function(t){return"movementY"in t?t.movementY:al}}),za=en(rl),bs=x({},rl,{dataTransfer:0}),vs=en(bs),Ne=x({},It,{relatedTarget:0}),kr=en(Ne),Si=x({},un,{animationName:0,elapsedTime:0,pseudoElement:0}),Kt=en(Si),ws=x({},un,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),La=en(ws),lt=x({},un,{data:0}),sl=en(lt),Sr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ia={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"},Ua={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ks(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Ua[t])?!!n[t]:!1}function Yl(){return ks}var Jc=x({},It,{key:function(t){if(t.key){var n=Sr[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=$l(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Ia[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yl,charCode:function(t){return t.type==="keypress"?$l(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?$l(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ed=en(Jc),Ba=x({},rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ss=en(Ba),js=x({},It,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yl}),Cs=en(js),Ts=x({},un,{propertyName:0,elapsedTime:0,pseudoElement:0}),Es=en(Ts),jr=x({},rl,{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}),td=en(jr),qa=x({},un,{newState:0,oldState:0}),nd=en(qa),id=[9,13,27,32],As=si&&"CompositionEvent"in window,ol=null;si&&"documentMode"in document&&(ol=document.documentMode);var ul=si&&"TextEvent"in window&&!ol,Pl=si&&(!As||ol&&8<ol&&11>=ol),Se=" ",iu=!1;function cn(t,n){switch(t){case"keyup":return id.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lu(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fl=!1;function Cr(t,n){switch(t){case"compositionend":return lu(n);case"keypress":return n.which!==32?null:(iu=!0,Se);case"textInput":return t=n.data,t===Se&&iu?null:t;default:return null}}function ld(t,n){if(Fl)return t==="compositionend"||!As&&cn(t,n)?(t=vr(),qi=br=Pn=null,Fl=!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 Pl&&n.locale!=="ko"?null:n.data;default:return null}}var au={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 Tr(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!au[t.type]:n==="textarea"}function ru(t,n,a,o){ll?Hl?Hl.push(o):Hl=[o]:ll=o,n=lc(n,"onChange"),0<n.length&&(a=new gn("onChange","change",null,a,o),t.push({event:a,listeners:n}))}var Hi=null,cl=null;function Ns(t){zg(t,0)}function Er(t){var n=nl(t);if(li(n))return t}function Ar(t,n){if(t==="change")return n}var su=!1;if(si){var _s;if(si){var Ha="oninput"in document;if(!Ha){var Nr=document.createElement("div");Nr.setAttribute("oninput","return;"),Ha=typeof Nr.oninput=="function"}_s=Ha}else _s=!1;su=_s&&(!document.documentMode||9<document.documentMode)}function ou(){Hi&&(Hi.detachEvent("onpropertychange",uu),cl=Hi=null)}function uu(t){if(t.propertyName==="value"&&Er(cl)){var n=[];ru(n,cl,t,Oa(t)),ys(Ns,n)}}function cu(t,n,a){t==="focusin"?(ou(),Hi=n,cl=a,Hi.attachEvent("onpropertychange",uu)):t==="focusout"&&ou()}function ad(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Er(cl)}function rd(t,n){if(t==="click")return Er(n)}function sd(t,n){if(t==="input"||t==="change")return Er(n)}function od(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var yn=typeof Object.is=="function"?Object.is:od;function $a(t,n){if(yn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var f=a[o];if(!sn.call(n,f)||!yn(t[f],n[f]))return!1}return!0}function du(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function fu(t,n){var a=du(t);t=0;for(var o;a;){if(a.nodeType===3){if(o=t+a.textContent.length,t<=n&&o>=n)return{node:a,offset:n-t};t=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=du(a)}}function pu(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?pu(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function hu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=ai(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=ai(t.document)}return n}function Ds(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 ud=si&&"documentMode"in document&&11>=document.documentMode,Wl=null,Ms=null,Ga=null,Rs=!1;function mu(t,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Rs||Wl==null||Wl!==ai(o)||(o=Wl,"selectionStart"in o&&Ds(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ga&&$a(Ga,o)||(Ga=o,o=lc(Ms,"onSelect"),0<o.length&&(n=new gn("onSelect","select",null,n,a),t.push({event:n,listeners:o}),n.target=Wl)))}function dl(t,n){var a={};return a[t.toLowerCase()]=n.toLowerCase(),a["Webkit"+t]="webkit"+n,a["Moz"+t]="moz"+n,a}var fl={animationend:dl("Animation","AnimationEnd"),animationiteration:dl("Animation","AnimationIteration"),animationstart:dl("Animation","AnimationStart"),transitionrun:dl("Transition","TransitionRun"),transitionstart:dl("Transition","TransitionStart"),transitioncancel:dl("Transition","TransitionCancel"),transitionend:dl("Transition","TransitionEnd")},Fn={},_r={};si&&(_r=document.createElement("div").style,"AnimationEvent"in window||(delete fl.animationend.animation,delete fl.animationiteration.animation,delete fl.animationstart.animation),"TransitionEvent"in window||delete fl.transitionend.transition);function $i(t){if(Fn[t])return Fn[t];if(!fl[t])return t;var n=fl[t],a;for(a in n)if(n.hasOwnProperty(a)&&a in _r)return Fn[t]=n[a];return t}var Kl=$i("animationend"),Gi=$i("animationiteration"),gu=$i("animationstart"),cd=$i("transitionrun"),dd=$i("transitionstart"),fd=$i("transitioncancel"),yu=$i("transitionend"),xu=new Map,Dr="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(" ");Dr.push("scrollEnd");function Sn(t,n){xu.set(t,n),Li(n,[t])}var Mr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},jn=[],Xl=0,Vi=0;function pl(){for(var t=Xl,n=Vi=Xl=0;n<t;){var a=jn[n];jn[n++]=null;var o=jn[n];jn[n++]=null;var f=jn[n];jn[n++]=null;var h=jn[n];if(jn[n++]=null,o!==null&&f!==null){var v=o.pending;v===null?f.next=f:(f.next=v.next,v.next=f),o.pending=f}h!==0&&bu(a,f,h)}}function Rr(t,n,a,o){jn[Xl++]=t,jn[Xl++]=n,jn[Xl++]=a,jn[Xl++]=o,Vi|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Os(t,n,a,o){return Rr(t,n,a,o),Va(t)}function Yi(t,n){return Rr(t,null,null,n),Va(t)}function bu(t,n,a){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a);for(var f=!1,h=t.return;h!==null;)h.childLanes|=a,o=h.alternate,o!==null&&(o.childLanes|=a),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-rt(a),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=a|536870912),h):null}function Va(t){if(50<ao)throw ao=0,cf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Ql={};function pd(t,n,a,o){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xn(t,n,a,o){return new pd(t,n,a,o)}function zs(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ji(t,n){var a=t.alternate;return a===null?(a=xn(t.tag,n,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=n,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,n=t.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function vu(t,n){t.flags&=65011714;var a=t.alternate;return a===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=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,n=a.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Or(t,n,a,o,f,h){var v=0;if(o=t,typeof t=="function")zs(t)&&(v=1);else if(typeof t=="string")v=hk(t,a,K.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ee:return t=xn(31,a,n,f),t.elementType=ee,t.lanes=h,t;case O:return hl(a.children,f,h,n);case U:v=8,f|=24;break;case _:return t=xn(12,a,n,f|2),t.elementType=_,t.lanes=h,t;case se:return t=xn(13,a,n,f),t.elementType=se,t.lanes=h,t;case N:return t=xn(19,a,n,f),t.elementType=N,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case q:v=10;break e;case F:v=9;break e;case Y:v=11;break e;case X:v=14;break e;case ae:v=16,o=null;break e}v=29,a=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=xn(v,a,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function hl(t,n,a,o){return t=xn(7,t,o,n),t.lanes=a,t}function Ls(t,n,a){return t=xn(6,t,null,n),t.lanes=a,t}function wu(t){var n=xn(18,null,null,0);return n.stateNode=t,n}function Is(t,n,a){return n=xn(4,t.children!==null?t.children:[],t.key,n),n.lanes=a,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var ku=new WeakMap;function Cn(t,n){if(typeof t=="object"&&t!==null){var a=ku.get(t);return a!==void 0?a:(n={value:t,source:n,stack:wt(n)},ku.set(t,n),n)}return{value:t,source:n,stack:wt(n)}}var Ci=[],Zl=0,Jl=null,Ya=0,Tn=[],tn=0,dn=null,En=1,Wn="";function Kn(t,n){Ci[Zl++]=Ya,Ci[Zl++]=Jl,Jl=t,Ya=n}function Us(t,n,a){Tn[tn++]=En,Tn[tn++]=Wn,Tn[tn++]=dn,dn=t;var o=En;t=Wn;var f=32-rt(o)-1;o&=~(1<<f),a+=1;var h=32-rt(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,En=1<<32-rt(n)+f|a<<f|o,Wn=h+t}else En=1<<h|a<<f|o,Wn=t}function ea(t){t.return!==null&&(Kn(t,1),Us(t,1,0))}function Bs(t){for(;t===Jl;)Jl=Ci[--Zl],Ci[Zl]=null,Ya=Ci[--Zl],Ci[Zl]=null;for(;t===dn;)dn=Tn[--tn],Tn[tn]=null,Wn=Tn[--tn],Tn[tn]=null,En=Tn[--tn],Tn[tn]=null}function Su(t,n){Tn[tn++]=En,Tn[tn++]=Wn,Tn[tn++]=dn,En=n.id,Wn=n.overflow,dn=t}var Yt=null,ht=null,Ve=!1,An=null,Nn=!1,ml=Error(r(519));function _n(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ci(Cn(n,t)),ml}function ta(t){var n=t.stateNode,a=t.type,o=t.memoizedProps;switch(n[bt]=t,n[Nt]=o,a){case"dialog":Fe("cancel",n),Fe("close",n);break;case"iframe":case"object":case"embed":Fe("load",n);break;case"video":case"audio":for(a=0;a<so.length;a++)Fe(so[a],n);break;case"source":Fe("error",n);break;case"img":case"image":case"link":Fe("error",n),Fe("load",n);break;case"details":Fe("toggle",n);break;case"input":Fe("invalid",n),Ul(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Fe("invalid",n);break;case"textarea":Fe("invalid",n),yr(n,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||o.suppressHydrationWarning===!0||Bg(n.textContent,a)?(o.popover!=null&&(Fe("beforetoggle",n),Fe("toggle",n)),o.onScroll!=null&&Fe("scroll",n),o.onScrollEnd!=null&&Fe("scrollend",n),o.onClick!=null&&(n.onclick=Yn),n=!0):n=!1,n||_n(t,!0)}function ju(t){for(Yt=t.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:Yt=Yt.return}}function na(t){if(t!==Yt)return!1;if(!Ve)return ju(t),Ve=!0,!1;var n=t.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Cf(t.type,t.memoizedProps)),a=!a),a&&ht&&_n(t),ju(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ht=Wg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ht=Wg(t)}else n===27?(n=ht,ga(t.type)?(t=_f,_f=null,ht=t):ht=n):ht=Yt?fi(t.stateNode.nextSibling):null;return!0}function gl(){ht=Yt=null,Ve=!1}function st(){var t=An;return t!==null&&(zn===null?zn=t:zn.push.apply(zn,t),An=null),t}function ci(t){An===null?An=[t]:An.push(t)}var Dn=A(null),yl=null,nn=null;function Pi(t,n,a){C(Dn,n._currentValue),n._currentValue=a}function Ti(t){t._currentValue=Dn.current,z(Dn)}function qs(t,n,a){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===a)break;t=t.return}}function Pa(t,n,a,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=f;for(var I=0;I<n.length;I++)if(T.context===n[I]){h.lanes|=a,T=h.alternate,T!==null&&(T.lanes|=a),qs(h.return,a,t),o||(v=null);break e}h=T.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=a,h=v.alternate,h!==null&&(h.lanes|=a),qs(v,a,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 ia(t,n,a,o){t=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var T=f.type;yn(f.pendingProps.value,v.value)||(t!==null?t.push(T):t=[T])}}else if(f===xe.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(po):t=[po])}f=f.return}t!==null&&Pa(n,t,a,o),n.flags|=262144}function zr(t){for(t=t.firstContext;t!==null;){if(!yn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function xl(t){yl=t,nn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ut(t){return Hs(yl,t)}function Fa(t,n){return yl===null&&xl(t),Hs(t,n)}function Hs(t,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},nn===null){if(t===null)throw Error(r(308));nn=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else nn=nn.next=n;return a}var Cu=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(a,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(a){return a()})}},y=e.unstable_scheduleCallback,S=e.unstable_NormalPriority,j={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function M(){return{controller:new Cu,data:new Map,refCount:0}}function B(t){t.refCount--,t.refCount===0&&y(S,function(){t.controller.abort()})}var J=null,be=0,Ue=0,Ce=null;function je(t,n){if(J===null){var a=J=[];be=0,Ue=gf(),Ce={status:"pending",value:void 0,then:function(o){a.push(o)}}}return be++,n.then(Xt,Xt),n}function Xt(){if(--be===0&&J!==null){Ce!==null&&(Ce.status="fulfilled");var t=J;J=null,Ue=0,Ce=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function jt(t,n){var a=[],o={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<a.length;f++)(0,a[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),o}var Wa=G.S;G.S=function(t,n){ug=Lt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&je(t,n),Wa!==null&&Wa(t,n)};var Bt=A(null);function Ei(){var t=Bt.current;return t!==null?t:mt.pooledCache}function Fi(t,n){n===null?C(Bt,Bt.current):C(Bt,n.pool)}function Lr(){var t=Ei();return t===null?null:{parent:j._currentValue,pool:t}}var Ir=Error(r(460)),hd=Error(r(474)),Tu=Error(r(542)),Eu={then:function(){}};function Ah(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Nh(t,n,a){switch(a=t[a],a===void 0?t.push(n):a!==n&&(n.then(Yn,Yn),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Dh(t),t;default:if(typeof n.status=="string")n.then(Yn,Yn);else{if(t=mt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Dh(t),t}throw Xa=n,Ir}}function Ka(t){try{var n=t._init;return n(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Xa=a,Ir):a}}var Xa=null;function _h(){if(Xa===null)throw Error(r(459));var t=Xa;return Xa=null,t}function Dh(t){if(t===Ir||t===Tu)throw Error(r(483))}var Ur=null,$s=0;function Au(t){var n=$s;return $s+=1,Ur===null&&(Ur=[]),Nh(Ur,t,n)}function Gs(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Nu(t,n){throw n.$$typeof===k?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Mh(t){function n($,H){if(t){var V=$.deletions;V===null?($.deletions=[H],$.flags|=16):V.push(H)}}function a($,H){if(!t)return null;for(;H!==null;)n($,H),H=H.sibling;return null}function o($){for(var H=new Map;$!==null;)$.key!==null?H.set($.key,$):H.set($.index,$),$=$.sibling;return H}function f($,H){return $=ji($,H),$.index=0,$.sibling=null,$}function h($,H,V){return $.index=V,t?(V=$.alternate,V!==null?(V=V.index,V<H?($.flags|=67108866,H):V):($.flags|=67108866,H)):($.flags|=1048576,H)}function v($){return t&&$.alternate===null&&($.flags|=67108866),$}function T($,H,V,le){return H===null||H.tag!==6?(H=Ls(V,$.mode,le),H.return=$,H):(H=f(H,V),H.return=$,H)}function I($,H,V,le){var _e=V.type;return _e===O?ie($,H,V.props.children,le,V.key):H!==null&&(H.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&Ka(_e)===H.type)?(H=f(H,V.props),Gs(H,V),H.return=$,H):(H=Or(V.type,V.key,V.props,null,$.mode,le),Gs(H,V),H.return=$,H)}function P($,H,V,le){return H===null||H.tag!==4||H.stateNode.containerInfo!==V.containerInfo||H.stateNode.implementation!==V.implementation?(H=Is(V,$.mode,le),H.return=$,H):(H=f(H,V.children||[]),H.return=$,H)}function ie($,H,V,le,_e){return H===null||H.tag!==7?(H=hl(V,$.mode,le,_e),H.return=$,H):(H=f(H,V),H.return=$,H)}function re($,H,V){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Ls(""+H,$.mode,V),H.return=$,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return V=Or(H.type,H.key,H.props,null,$.mode,V),Gs(V,H),V.return=$,V;case E:return H=Is(H,$.mode,V),H.return=$,H;case ae:return H=Ka(H),re($,H,V)}if(ue(H)||ce(H))return H=hl(H,$.mode,V,null),H.return=$,H;if(typeof H.then=="function")return re($,Au(H),V);if(H.$$typeof===q)return re($,Fa($,H),V);Nu($,H)}return null}function W($,H,V,le){var _e=H!==null?H.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return _e!==null?null:T($,H,""+V,le);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case w:return V.key===_e?I($,H,V,le):null;case E:return V.key===_e?P($,H,V,le):null;case ae:return V=Ka(V),W($,H,V,le)}if(ue(V)||ce(V))return _e!==null?null:ie($,H,V,le,null);if(typeof V.then=="function")return W($,H,Au(V),le);if(V.$$typeof===q)return W($,H,Fa($,V),le);Nu($,V)}return null}function Q($,H,V,le,_e){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return $=$.get(V)||null,T(H,$,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return $=$.get(le.key===null?V:le.key)||null,I(H,$,le,_e);case E:return $=$.get(le.key===null?V:le.key)||null,P(H,$,le,_e);case ae:return le=Ka(le),Q($,H,V,le,_e)}if(ue(le)||ce(le))return $=$.get(V)||null,ie(H,$,le,_e,null);if(typeof le.then=="function")return Q($,H,V,Au(le),_e);if(le.$$typeof===q)return Q($,H,V,Fa(H,le),_e);Nu(H,le)}return null}function ve($,H,V,le){for(var _e=null,nt=null,Te=H,Ge=H=0,Ze=null;Te!==null&&Ge<V.length;Ge++){Te.index>Ge?(Ze=Te,Te=null):Ze=Te.sibling;var it=W($,Te,V[Ge],le);if(it===null){Te===null&&(Te=Ze);break}t&&Te&&it.alternate===null&&n($,Te),H=h(it,H,Ge),nt===null?_e=it:nt.sibling=it,nt=it,Te=Ze}if(Ge===V.length)return a($,Te),Ve&&Kn($,Ge),_e;if(Te===null){for(;Ge<V.length;Ge++)Te=re($,V[Ge],le),Te!==null&&(H=h(Te,H,Ge),nt===null?_e=Te:nt.sibling=Te,nt=Te);return Ve&&Kn($,Ge),_e}for(Te=o(Te);Ge<V.length;Ge++)Ze=Q(Te,$,Ge,V[Ge],le),Ze!==null&&(t&&Ze.alternate!==null&&Te.delete(Ze.key===null?Ge:Ze.key),H=h(Ze,H,Ge),nt===null?_e=Ze:nt.sibling=Ze,nt=Ze);return t&&Te.forEach(function(wa){return n($,wa)}),Ve&&Kn($,Ge),_e}function Oe($,H,V,le){if(V==null)throw Error(r(151));for(var _e=null,nt=null,Te=H,Ge=H=0,Ze=null,it=V.next();Te!==null&&!it.done;Ge++,it=V.next()){Te.index>Ge?(Ze=Te,Te=null):Ze=Te.sibling;var wa=W($,Te,it.value,le);if(wa===null){Te===null&&(Te=Ze);break}t&&Te&&wa.alternate===null&&n($,Te),H=h(wa,H,Ge),nt===null?_e=wa:nt.sibling=wa,nt=wa,Te=Ze}if(it.done)return a($,Te),Ve&&Kn($,Ge),_e;if(Te===null){for(;!it.done;Ge++,it=V.next())it=re($,it.value,le),it!==null&&(H=h(it,H,Ge),nt===null?_e=it:nt.sibling=it,nt=it);return Ve&&Kn($,Ge),_e}for(Te=o(Te);!it.done;Ge++,it=V.next())it=Q(Te,$,Ge,it.value,le),it!==null&&(t&&it.alternate!==null&&Te.delete(it.key===null?Ge:it.key),H=h(it,H,Ge),nt===null?_e=it:nt.sibling=it,nt=it);return t&&Te.forEach(function(Ck){return n($,Ck)}),Ve&&Kn($,Ge),_e}function pt($,H,V,le){if(typeof V=="object"&&V!==null&&V.type===O&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case w:e:{for(var _e=V.key;H!==null;){if(H.key===_e){if(_e=V.type,_e===O){if(H.tag===7){a($,H.sibling),le=f(H,V.props.children),le.return=$,$=le;break e}}else if(H.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&Ka(_e)===H.type){a($,H.sibling),le=f(H,V.props),Gs(le,V),le.return=$,$=le;break e}a($,H);break}else n($,H);H=H.sibling}V.type===O?(le=hl(V.props.children,$.mode,le,V.key),le.return=$,$=le):(le=Or(V.type,V.key,V.props,null,$.mode,le),Gs(le,V),le.return=$,$=le)}return v($);case E:e:{for(_e=V.key;H!==null;){if(H.key===_e)if(H.tag===4&&H.stateNode.containerInfo===V.containerInfo&&H.stateNode.implementation===V.implementation){a($,H.sibling),le=f(H,V.children||[]),le.return=$,$=le;break e}else{a($,H);break}else n($,H);H=H.sibling}le=Is(V,$.mode,le),le.return=$,$=le}return v($);case ae:return V=Ka(V),pt($,H,V,le)}if(ue(V))return ve($,H,V,le);if(ce(V)){if(_e=ce(V),typeof _e!="function")throw Error(r(150));return V=_e.call(V),Oe($,H,V,le)}if(typeof V.then=="function")return pt($,H,Au(V),le);if(V.$$typeof===q)return pt($,H,Fa($,V),le);Nu($,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,H!==null&&H.tag===6?(a($,H.sibling),le=f(H,V),le.return=$,$=le):(a($,H),le=Ls(V,$.mode,le),le.return=$,$=le),v($)):a($,H)}return function($,H,V,le){try{$s=0;var _e=pt($,H,V,le);return Ur=null,_e}catch(Te){if(Te===Ir||Te===Tu)throw Te;var nt=xn(29,Te,null,$.mode);return nt.lanes=le,nt.return=$,nt}finally{}}}var Qa=Mh(!0),Rh=Mh(!1),la=!1;function md(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gd(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 aa(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ra(t,n,a){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(at&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=Va(t),bu(t,null,a),n}return Rr(t,o,n,a),Va(t)}function Vs(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,cs(t,a)}}function yd(t,n){var a=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,a=a.next}while(a!==null);h===null?f=h=n:h=h.next=n}else f=h=n;a={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var xd=!1;function Ys(){if(xd){var t=Ce;if(t!==null)throw t}}function Ps(t,n,a,o){xd=!1;var f=t.updateQueue;la=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var I=T,P=I.next;I.next=null,v===null?h=P:v.next=P,v=I;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,T=ie.lastBaseUpdate,T!==v&&(T===null?ie.firstBaseUpdate=P:T.next=P,ie.lastBaseUpdate=I))}if(h!==null){var re=f.baseState;v=0,ie=P=I=null,T=h;do{var W=T.lane&-536870913,Q=W!==T.lane;if(Q?(Qe&W)===W:(o&W)===W){W!==0&&W===Ue&&(xd=!0),ie!==null&&(ie=ie.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ve=t,Oe=T;W=n;var pt=a;switch(Oe.tag){case 1:if(ve=Oe.payload,typeof ve=="function"){re=ve.call(pt,re,W);break e}re=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Oe.payload,W=typeof ve=="function"?ve.call(pt,re,W):ve,W==null)break e;re=x({},re,W);break e;case 2:la=!0}}W=T.callback,W!==null&&(t.flags|=64,Q&&(t.flags|=8192),Q=f.callbacks,Q===null?f.callbacks=[W]:Q.push(W))}else Q={lane:W,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ie===null?(P=ie=Q,I=re):ie=ie.next=Q,v|=W;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;Q=T,T=Q.next,Q.next=null,f.lastBaseUpdate=Q,f.shared.pending=null}}while(!0);ie===null&&(I=re),f.baseState=I,f.firstBaseUpdate=P,f.lastBaseUpdate=ie,h===null&&(f.shared.lanes=0),da|=v,t.lanes=v,t.memoizedState=re}}function Oh(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function zh(t,n){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Oh(a[t],n)}var Br=A(null),_u=A(0);function Lh(t,n){t=El,C(_u,t),C(Br,n),El=t|n.baseLanes}function bd(){C(_u,El),C(Br,Br.current)}function vd(){El=_u.current,z(Br),z(_u)}var Xn=A(null),di=null;function sa(t){var n=t.alternate;C(Mt,Mt.current&1),C(Xn,t),di===null&&(n===null||Br.current!==null||n.memoizedState!==null)&&(di=t)}function wd(t){C(Mt,Mt.current),C(Xn,t),di===null&&(di=t)}function Ih(t){t.tag===22?(C(Mt,Mt.current),C(Xn,t),di===null&&(di=t)):oa()}function oa(){C(Mt,Mt.current),C(Xn,Xn.current)}function Qn(t){z(Xn),di===t&&(di=null),z(Mt)}var Mt=A(0);function Du(t){for(var n=t;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Af(a)||Nf(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===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 bl=0,He=null,dt=null,qt=null,Mu=!1,qr=!1,Za=!1,Ru=0,Fs=0,Hr=null,mw=0;function Ct(){throw Error(r(321))}function kd(t,n){if(n===null)return!1;for(var a=0;a<n.length&&a<t.length;a++)if(!yn(t[a],n[a]))return!1;return!0}function Sd(t,n,a,o,f,h){return bl=h,He=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,G.H=t===null||t.memoizedState===null?vm:Ud,Za=!1,h=a(o,f),Za=!1,qr&&(h=Bh(n,a,o,f)),Uh(t),h}function Uh(t){G.H=Xs;var n=dt!==null&&dt.next!==null;if(bl=0,qt=dt=He=null,Mu=!1,Fs=0,Hr=null,n)throw Error(r(300));t===null||Ht||(t=t.dependencies,t!==null&&zr(t)&&(Ht=!0))}function Bh(t,n,a,o){He=t;var f=0;do{if(qr&&(Hr=null),Fs=0,qr=!1,25<=f)throw Error(r(301));if(f+=1,qt=dt=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}G.H=wm,h=n(a,o)}while(qr);return h}function gw(){var t=G.H,n=t.useState()[0];return n=typeof n.then=="function"?Ws(n):n,t=t.useState()[0],(dt!==null?dt.memoizedState:null)!==t&&(He.flags|=1024),n}function jd(){var t=Ru!==0;return Ru=0,t}function Cd(t,n,a){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~a}function Td(t){if(Mu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Mu=!1}bl=0,qt=dt=He=null,qr=!1,Fs=Ru=0,Hr=null}function bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?He.memoizedState=qt=t:qt=qt.next=t,qt}function Rt(){if(dt===null){var t=He.alternate;t=t!==null?t.memoizedState:null}else t=dt.next;var n=qt===null?He.memoizedState:qt.next;if(n!==null)qt=n,dt=t;else{if(t===null)throw He.alternate===null?Error(r(467)):Error(r(310));dt=t,t={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},qt===null?He.memoizedState=qt=t:qt=qt.next=t}return qt}function Ou(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ws(t){var n=Fs;return Fs+=1,Hr===null&&(Hr=[]),t=Nh(Hr,t,n),n=He,(qt===null?n.memoizedState:qt.next)===null&&(n=n.alternate,G.H=n===null||n.memoizedState===null?vm:Ud),t}function zu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ws(t);if(t.$$typeof===q)return Ut(t)}throw Error(r(438,String(t)))}function Ed(t){var n=null,a=He.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var o=He.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Ou(),He.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(t),o=0;o<t;o++)a[o]=L;return n.index++,a}function vl(t,n){return typeof n=="function"?n(t):n}function Lu(t){var n=Rt();return Ad(n,dt,t)}function Ad(t,n,a){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=a;var f=t.baseQueue,h=o.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}n.baseQueue=f=h,o.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{n=f.next;var T=v=null,I=null,P=n,ie=!1;do{var re=P.lane&-536870913;if(re!==P.lane?(Qe&re)===re:(bl&re)===re){var W=P.revertLane;if(W===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),re===Ue&&(ie=!0);else if((bl&W)===W){P=P.next,W===Ue&&(ie=!0);continue}else re={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(T=I=re,v=h):I=I.next=re,He.lanes|=W,da|=W;re=P.action,Za&&a(h,re),h=P.hasEagerState?P.eagerState:a(h,re)}else W={lane:re,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(T=I=W,v=h):I=I.next=W,He.lanes|=re,da|=re;P=P.next}while(P!==null&&P!==n);if(I===null?v=h:I.next=T,!yn(h,t.memoizedState)&&(Ht=!0,ie&&(a=Ce,a!==null)))throw a;t.memoizedState=h,t.baseState=v,t.baseQueue=I,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Nd(t){var n=Rt(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=t;var o=a.dispatch,f=a.pending,h=n.memoizedState;if(f!==null){a.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);yn(h,n.memoizedState)||(Ht=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,o]}function qh(t,n,a){var o=He,f=Rt(),h=Ve;if(h){if(a===void 0)throw Error(r(407));a=a()}else a=n();var v=!yn((dt||f).memoizedState,a);if(v&&(f.memoizedState=a,Ht=!0),f=f.queue,Md(Gh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||qt!==null&&qt.memoizedState.tag&1){if(o.flags|=2048,$r(9,{destroy:void 0},$h.bind(null,o,f,a,n),null),mt===null)throw Error(r(349));h||(bl&127)!==0||Hh(o,n,a)}return a}function Hh(t,n,a){t.flags|=16384,t={getSnapshot:n,value:a},n=He.updateQueue,n===null?(n=Ou(),He.updateQueue=n,n.stores=[t]):(a=n.stores,a===null?n.stores=[t]:a.push(t))}function $h(t,n,a,o){n.value=a,n.getSnapshot=o,Vh(n)&&Yh(t)}function Gh(t,n,a){return a(function(){Vh(n)&&Yh(t)})}function Vh(t){var n=t.getSnapshot;t=t.value;try{var a=n();return!yn(t,a)}catch{return!0}}function Yh(t){var n=Yi(t,2);n!==null&&Ln(n,t,2)}function _d(t){var n=bn();if(typeof t=="function"){var a=t;if(t=a(),Za){on(!0);try{a()}finally{on(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:t},n}function Ph(t,n,a,o){return t.baseState=a,Ad(t,dt,typeof o=="function"?o:vl)}function yw(t,n,a,o,f){if(Bu(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};G.T!==null?a(!0):h.isTransition=!1,o(h),a=n.pending,a===null?(h.next=n.pending=h,Fh(n,h)):(h.next=a.next,n.pending=a.next=h)}}function Fh(t,n){var a=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=G.T,v={};G.T=v;try{var T=a(f,o),I=G.S;I!==null&&I(v,T),Wh(t,n,T)}catch(P){Dd(t,n,P)}finally{h!==null&&v.types!==null&&(h.types=v.types),G.T=h}}else try{h=a(f,o),Wh(t,n,h)}catch(P){Dd(t,n,P)}}function Wh(t,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Kh(t,n,o)},function(o){return Dd(t,n,o)}):Kh(t,n,a)}function Kh(t,n,a){n.status="fulfilled",n.value=a,Xh(n),t.state=a,n=t.pending,n!==null&&(a=n.next,a===n?t.pending=null:(a=a.next,n.next=a,Fh(t,a)))}function Dd(t,n,a){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=a,Xh(n),n=n.next;while(n!==o)}t.action=null}function Xh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Qh(t,n){return n}function Zh(t,n){if(Ve){var a=mt.formState;if(a!==null){e:{var o=He;if(Ve){if(ht){t:{for(var f=ht,h=Nn;f.nodeType!==8;){if(!h){f=null;break t}if(f=fi(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){ht=fi(f.nextSibling),o=f.data==="F!";break e}}_n(o)}o=!1}o&&(n=a[0])}}return a=bn(),a.memoizedState=a.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qh,lastRenderedState:n},a.queue=o,a=ym.bind(null,He,o),o.dispatch=a,o=_d(!1),h=Id.bind(null,He,!1,o.queue),o=bn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,a=yw.bind(null,He,f,h,a),f.dispatch=a,o.memoizedState=t,[n,a,!1]}function Jh(t){var n=Rt();return em(n,dt,t)}function em(t,n,a){if(n=Ad(t,n,Qh)[0],t=Lu(vl)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Ws(n)}catch(v){throw v===Ir?Tu:v}else o=n;n=Rt();var f=n.queue,h=f.dispatch;return a!==n.memoizedState&&(He.flags|=2048,$r(9,{destroy:void 0},xw.bind(null,f,a),null)),[o,h,t]}function xw(t,n){t.action=n}function tm(t){var n=Rt(),a=dt;if(a!==null)return em(n,a,t);Rt(),n=n.memoizedState,a=Rt();var o=a.queue.dispatch;return a.memoizedState=t,[n,o,!1]}function $r(t,n,a,o){return t={tag:t,create:a,deps:o,inst:n,next:null},n=He.updateQueue,n===null&&(n=Ou(),He.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=t.next=t:(o=a.next,a.next=t,t.next=o,n.lastEffect=t),t}function nm(){return Rt().memoizedState}function Iu(t,n,a,o){var f=bn();He.flags|=t,f.memoizedState=$r(1|n,{destroy:void 0},a,o===void 0?null:o)}function Uu(t,n,a,o){var f=Rt();o=o===void 0?null:o;var h=f.memoizedState.inst;dt!==null&&o!==null&&kd(o,dt.memoizedState.deps)?f.memoizedState=$r(n,h,a,o):(He.flags|=t,f.memoizedState=$r(1|n,h,a,o))}function im(t,n){Iu(8390656,8,t,n)}function Md(t,n){Uu(2048,8,t,n)}function bw(t){He.flags|=4;var n=He.updateQueue;if(n===null)n=Ou(),He.updateQueue=n,n.events=[t];else{var a=n.events;a===null?n.events=[t]:a.push(t)}}function lm(t){var n=Rt().memoizedState;return bw({ref:n,nextImpl:t}),function(){if((at&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function am(t,n){return Uu(4,2,t,n)}function rm(t,n){return Uu(4,4,t,n)}function sm(t,n){if(typeof n=="function"){t=t();var a=n(t);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function om(t,n,a){a=a!=null?a.concat([t]):null,Uu(4,4,sm.bind(null,n,t),a)}function Rd(){}function um(t,n){var a=Rt();n=n===void 0?null:n;var o=a.memoizedState;return n!==null&&kd(n,o[1])?o[0]:(a.memoizedState=[t,n],t)}function cm(t,n){var a=Rt();n=n===void 0?null:n;var o=a.memoizedState;if(n!==null&&kd(n,o[1]))return o[0];if(o=t(),Za){on(!0);try{t()}finally{on(!1)}}return a.memoizedState=[o,n],o}function Od(t,n,a){return a===void 0||(bl&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=a,t=dg(),He.lanes|=t,da|=t,a)}function dm(t,n,a,o){return yn(a,n)?a:Br.current!==null?(t=Od(t,a,o),yn(t,n)||(Ht=!0),t):(bl&42)===0||(bl&1073741824)!==0&&(Qe&261930)===0?(Ht=!0,t.memoizedState=a):(t=dg(),He.lanes|=t,da|=t,n)}function fm(t,n,a,o,f){var h=oe.p;oe.p=h!==0&&8>h?h:8;var v=G.T,T={};G.T=T,Id(t,!1,n,a);try{var I=f(),P=G.S;if(P!==null&&P(T,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ie=jt(I,o);Ks(t,n,ie,ei(t))}else Ks(t,n,o,ei(t))}catch(re){Ks(t,n,{then:function(){},status:"rejected",reason:re},ei())}finally{oe.p=h,v!==null&&T.types!==null&&(v.types=T.types),G.T=v}}function vw(){}function zd(t,n,a,o){if(t.tag!==5)throw Error(r(476));var f=pm(t).queue;fm(t,f,n,ye,a===null?vw:function(){return hm(t),a(o)})}function pm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:ye},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function hm(t){var n=pm(t);n.next===null&&(n=t.alternate.memoizedState),Ks(t,n.next.queue,{},ei())}function Ld(){return Ut(po)}function mm(){return Rt().memoizedState}function gm(){return Rt().memoizedState}function ww(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=ei();t=aa(a);var o=ra(n,t,a);o!==null&&(Ln(o,n,a),Vs(o,n,a)),n={cache:M()},t.payload=n;return}n=n.return}}function kw(t,n,a){var o=ei();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bu(t)?xm(n,a):(a=Os(t,n,a,o),a!==null&&(Ln(a,t,o),bm(a,n,o)))}function ym(t,n,a){var o=ei();Ks(t,n,a,o)}function Ks(t,n,a,o){var f={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Bu(t))xm(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,T=h(v,a);if(f.hasEagerState=!0,f.eagerState=T,yn(T,v))return Rr(t,n,f,0),mt===null&&pl(),!1}catch{}finally{}if(a=Os(t,n,f,o),a!==null)return Ln(a,t,o),bm(a,n,o),!0}return!1}function Id(t,n,a,o){if(o={lane:2,revertLane:gf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Bu(t)){if(n)throw Error(r(479))}else n=Os(t,a,o,2),n!==null&&Ln(n,t,2)}function Bu(t){var n=t.alternate;return t===He||n!==null&&n===He}function xm(t,n){qr=Mu=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function bm(t,n,a){if((a&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,cs(t,a)}}var Xs={readContext:Ut,use:zu,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Xs.useEffectEvent=Ct;var vm={readContext:Ut,use:zu,useCallback:function(t,n){return bn().memoizedState=[t,n===void 0?null:n],t},useContext:Ut,useEffect:im,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,Iu(4194308,4,sm.bind(null,n,t),a)},useLayoutEffect:function(t,n){return Iu(4194308,4,t,n)},useInsertionEffect:function(t,n){Iu(4,2,t,n)},useMemo:function(t,n){var a=bn();n=n===void 0?null:n;var o=t();if(Za){on(!0);try{t()}finally{on(!1)}}return a.memoizedState=[o,n],o},useReducer:function(t,n,a){var o=bn();if(a!==void 0){var f=a(n);if(Za){on(!0);try{a(n)}finally{on(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=kw.bind(null,He,t),[o.memoizedState,t]},useRef:function(t){var n=bn();return t={current:t},n.memoizedState=t},useState:function(t){t=_d(t);var n=t.queue,a=ym.bind(null,He,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:Rd,useDeferredValue:function(t,n){var a=bn();return Od(a,t,n)},useTransition:function(){var t=_d(!1);return t=fm.bind(null,He,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var o=He,f=bn();if(Ve){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),mt===null)throw Error(r(349));(Qe&127)!==0||Hh(o,n,a)}f.memoizedState=a;var h={value:a,getSnapshot:n};return f.queue=h,im(Gh.bind(null,o,h,t),[t]),o.flags|=2048,$r(9,{destroy:void 0},$h.bind(null,o,h,a,n),null),a},useId:function(){var t=bn(),n=mt.identifierPrefix;if(Ve){var a=Wn,o=En;a=(o&~(1<<32-rt(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Ru++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=mw++,n="_"+n+"r_"+a.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Ld,useFormState:Zh,useActionState:Zh,useOptimistic:function(t){var n=bn();n.memoizedState=n.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Id.bind(null,He,!0,a),a.dispatch=n,[t,n]},useMemoCache:Ed,useCacheRefresh:function(){return bn().memoizedState=ww.bind(null,He)},useEffectEvent:function(t){var n=bn(),a={impl:t};return n.memoizedState=a,function(){if((at&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Ud={readContext:Ut,use:zu,useCallback:um,useContext:Ut,useEffect:Md,useImperativeHandle:om,useInsertionEffect:am,useLayoutEffect:rm,useMemo:cm,useReducer:Lu,useRef:nm,useState:function(){return Lu(vl)},useDebugValue:Rd,useDeferredValue:function(t,n){var a=Rt();return dm(a,dt.memoizedState,t,n)},useTransition:function(){var t=Lu(vl)[0],n=Rt().memoizedState;return[typeof t=="boolean"?t:Ws(t),n]},useSyncExternalStore:qh,useId:mm,useHostTransitionStatus:Ld,useFormState:Jh,useActionState:Jh,useOptimistic:function(t,n){var a=Rt();return Ph(a,dt,t,n)},useMemoCache:Ed,useCacheRefresh:gm};Ud.useEffectEvent=lm;var wm={readContext:Ut,use:zu,useCallback:um,useContext:Ut,useEffect:Md,useImperativeHandle:om,useInsertionEffect:am,useLayoutEffect:rm,useMemo:cm,useReducer:Nd,useRef:nm,useState:function(){return Nd(vl)},useDebugValue:Rd,useDeferredValue:function(t,n){var a=Rt();return dt===null?Od(a,t,n):dm(a,dt.memoizedState,t,n)},useTransition:function(){var t=Nd(vl)[0],n=Rt().memoizedState;return[typeof t=="boolean"?t:Ws(t),n]},useSyncExternalStore:qh,useId:mm,useHostTransitionStatus:Ld,useFormState:tm,useActionState:tm,useOptimistic:function(t,n){var a=Rt();return dt!==null?Ph(a,dt,t,n):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Ed,useCacheRefresh:gm};wm.useEffectEvent=lm;function Bd(t,n,a,o){n=t.memoizedState,a=a(o,n),a=a==null?n:x({},n,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var qd={enqueueSetState:function(t,n,a){t=t._reactInternals;var o=ei(),f=aa(o);f.payload=n,a!=null&&(f.callback=a),n=ra(t,f,o),n!==null&&(Ln(n,t,o),Vs(n,t,o))},enqueueReplaceState:function(t,n,a){t=t._reactInternals;var o=ei(),f=aa(o);f.tag=1,f.payload=n,a!=null&&(f.callback=a),n=ra(t,f,o),n!==null&&(Ln(n,t,o),Vs(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var a=ei(),o=aa(a);o.tag=2,n!=null&&(o.callback=n),n=ra(t,o,a),n!==null&&(Ln(n,t,a),Vs(n,t,a))}};function km(t,n,a,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!$a(a,o)||!$a(f,h):!0}function Sm(t,n,a,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,o),n.state!==t&&qd.enqueueReplaceState(n,n.state,null)}function Ja(t,n){var a=n;if("ref"in n){a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}if(t=t.defaultProps){a===n&&(a=x({},a));for(var f in t)a[f]===void 0&&(a[f]=t[f])}return a}function jm(t){Mr(t)}function Cm(t){console.error(t)}function Tm(t){Mr(t)}function qu(t,n){try{var a=t.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Em(t,n,a){try{var o=t.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Hd(t,n,a){return a=aa(a),a.tag=3,a.payload={element:null},a.callback=function(){qu(t,n)},a}function Am(t){return t=aa(t),t.tag=3,t}function Nm(t,n,a,o){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){Em(n,a,o)}}var v=a.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Em(n,a,o),typeof f!="function"&&(fa===null?fa=new Set([this]):fa.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function Sw(t,n,a,o,f){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=a.alternate,n!==null&&ia(n,a,f,!0),a=Xn.current,a!==null){switch(a.tag){case 31:case 13:return di===null?Zu():a.alternate===null&&Tt===0&&(Tt=3),a.flags&=-257,a.flags|=65536,a.lanes=f,o===Eu?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([o]):n.add(o),pf(t,o,f)),!1;case 22:return a.flags|=65536,o===Eu?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([o]):a.add(o)),pf(t,o,f)),!1}throw Error(r(435,a.tag))}return pf(t,o,f),Zu(),!1}if(Ve)return n=Xn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==ml&&(t=Error(r(422),{cause:o}),ci(Cn(t,a)))):(o!==ml&&(n=Error(r(423),{cause:o}),ci(Cn(n,a))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Cn(o,a),f=Hd(t.stateNode,o,f),yd(t,f),Tt!==4&&(Tt=2)),!1;var h=Error(r(520),{cause:o});if(h=Cn(h,a),lo===null?lo=[h]:lo.push(h),Tt!==4&&(Tt=2),n===null)return!0;o=Cn(o,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,t=f&-f,a.lanes|=t,t=Hd(a.stateNode,o,t),yd(a,t),!1;case 1:if(n=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(fa===null||!fa.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=Am(f),Nm(f,t,a,o),yd(a,f),!1}a=a.return}while(a!==null);return!1}var $d=Error(r(461)),Ht=!1;function ln(t,n,a,o){n.child=t===null?Rh(n,null,a,o):Qa(n,t.child,a,o)}function _m(t,n,a,o,f){a=a.render;var h=n.ref;if("ref"in o){var v={};for(var T in o)T!=="ref"&&(v[T]=o[T])}else v=o;return xl(n),o=Sd(t,n,a,v,h,f),T=jd(),t!==null&&!Ht?(Cd(t,n,f),wl(t,n,f)):(Ve&&T&&ea(n),n.flags|=1,ln(t,n,o,f),n.child)}function Dm(t,n,a,o,f){if(t===null){var h=a.type;return typeof h=="function"&&!zs(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,Mm(t,n,h,o,f)):(t=Or(a.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!Xd(t,f)){var v=h.memoizedProps;if(a=a.compare,a=a!==null?a:$a,a(v,o)&&t.ref===n.ref)return wl(t,n,f)}return n.flags|=1,t=ji(h,o),t.ref=n.ref,t.return=n,n.child=t}function Mm(t,n,a,o,f){if(t!==null){var h=t.memoizedProps;if($a(h,o)&&t.ref===n.ref)if(Ht=!1,n.pendingProps=o=h,Xd(t,f))(t.flags&131072)!==0&&(Ht=!0);else return n.lanes=t.lanes,wl(t,n,f)}return Gd(t,n,a,o,f)}function Rm(t,n,a,o){var f=o.children,h=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|a:a,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~h}else o=0,n.child=null;return Om(t,n,h,a,o)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Fi(n,h!==null?h.cachePool:null),h!==null?Lh(n,h):bd(),Ih(n);else return o=n.lanes=536870912,Om(t,n,h!==null?h.baseLanes|a:a,a,o)}else h!==null?(Fi(n,h.cachePool),Lh(n,h),oa(),n.memoizedState=null):(t!==null&&Fi(n,null),bd(),oa());return ln(t,n,f,a),n.child}function Qs(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Om(t,n,a,o,f){var h=Ei();return h=h===null?null:{parent:j._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},t!==null&&Fi(n,null),bd(),Ih(n),t!==null&&ia(t,n,o,!0),n.childLanes=f,null}function Hu(t,n){return n=Gu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function zm(t,n,a){return Qa(n,t.child,null,a),t=Hu(n,n.pendingProps),t.flags|=2,Qn(n),n.memoizedState=null,t}function jw(t,n,a){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ve){if(o.mode==="hidden")return t=Hu(n,o),n.lanes=536870912,Qs(null,t);if(wd(n),(t=ht)?(t=Fg(t,Nn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:dn!==null?{id:En,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},a=wu(t),a.return=n,n.child=a,Yt=n,ht=null)):t=null,t===null)throw _n(n);return n.lanes=536870912,null}return Hu(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(wd(n),f)if(n.flags&256)n.flags&=-257,n=zm(t,n,a);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ht||ia(t,n,a,!1),f=(a&t.childLanes)!==0,Ht||f){if(o=mt,o!==null&&(v=Ko(o,a),v!==0&&v!==h.retryLane))throw h.retryLane=v,Yi(t,v),Ln(o,t,v),$d;Zu(),n=zm(t,n,a)}else t=h.treeContext,ht=fi(v.nextSibling),Yt=n,Ve=!0,An=null,Nn=!1,t!==null&&Su(n,t),n=Hu(n,o),n.flags|=4096;return n}return t=ji(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function $u(t,n){var a=n.ref;if(a===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(t===null||t.ref!==a)&&(n.flags|=4194816)}}function Gd(t,n,a,o,f){return xl(n),a=Sd(t,n,a,o,void 0,f),o=jd(),t!==null&&!Ht?(Cd(t,n,f),wl(t,n,f)):(Ve&&o&&ea(n),n.flags|=1,ln(t,n,a,f),n.child)}function Lm(t,n,a,o,f,h){return xl(n),n.updateQueue=null,a=Bh(n,o,a,f),Uh(t),o=jd(),t!==null&&!Ht?(Cd(t,n,h),wl(t,n,h)):(Ve&&o&&ea(n),n.flags|=1,ln(t,n,a,h),n.child)}function Im(t,n,a,o,f){if(xl(n),n.stateNode===null){var h=Ql,v=a.contextType;typeof v=="object"&&v!==null&&(h=Ut(v)),h=new a(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=qd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},md(n),v=a.contextType,h.context=typeof v=="object"&&v!==null?Ut(v):Ql,h.state=n.memoizedState,v=a.getDerivedStateFromProps,typeof v=="function"&&(Bd(n,a,v,o),h.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&qd.enqueueReplaceState(h,h.state,null),Ps(n,o,h,f),Ys(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var T=n.memoizedProps,I=Ja(a,T);h.props=I;var P=h.context,ie=a.contextType;v=Ql,typeof ie=="object"&&ie!==null&&(v=Ut(ie));var re=a.getDerivedStateFromProps;ie=typeof re=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=n.pendingProps!==T,ie||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||P!==v)&&Sm(n,h,o,v),la=!1;var W=n.memoizedState;h.state=W,Ps(n,o,h,f),Ys(),P=n.memoizedState,T||W!==P||la?(typeof re=="function"&&(Bd(n,a,re,o),P=n.memoizedState),(I=la||km(n,a,I,o,W,P,v))?(ie||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=P),h.props=o,h.state=P,h.context=v,o=I):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,gd(t,n),v=n.memoizedProps,ie=Ja(a,v),h.props=ie,re=n.pendingProps,W=h.context,P=a.contextType,I=Ql,typeof P=="object"&&P!==null&&(I=Ut(P)),T=a.getDerivedStateFromProps,(P=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==re||W!==I)&&Sm(n,h,o,I),la=!1,W=n.memoizedState,h.state=W,Ps(n,o,h,f),Ys();var Q=n.memoizedState;v!==re||W!==Q||la||t!==null&&t.dependencies!==null&&zr(t.dependencies)?(typeof T=="function"&&(Bd(n,a,T,o),Q=n.memoizedState),(ie=la||km(n,a,ie,o,W,Q,I)||t!==null&&t.dependencies!==null&&zr(t.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Q,I),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Q,I)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Q),h.props=o,h.state=Q,h.context=I,o=ie):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,$u(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=Qa(n,t.child,null,f),n.child=Qa(n,null,a,f)):ln(t,n,a,f),n.memoizedState=h.state,t=n.child):t=wl(t,n,f),t}function Um(t,n,a,o){return gl(),n.flags|=256,ln(t,n,a,o),n.child}var Vd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yd(t){return{baseLanes:t,cachePool:Lr()}}function Pd(t,n,a){return t=t!==null?t.childLanes&~a:0,n&&(t|=Jn),t}function Bm(t,n,a){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(Mt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ve){if(f?sa(n):oa(),(t=ht)?(t=Fg(t,Nn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:dn!==null?{id:En,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},a=wu(t),a.return=n,n.child=a,Yt=n,ht=null)):t=null,t===null)throw _n(n);return Nf(t)?n.lanes=32:n.lanes=536870912,null}var T=o.children;return o=o.fallback,f?(oa(),f=n.mode,T=Gu({mode:"hidden",children:T},f),o=hl(o,f,a,null),T.return=n,o.return=n,T.sibling=o,n.child=T,o=n.child,o.memoizedState=Yd(a),o.childLanes=Pd(t,v,a),n.memoizedState=Vd,Qs(null,o)):(sa(n),Fd(n,T))}var I=t.memoizedState;if(I!==null&&(T=I.dehydrated,T!==null)){if(h)n.flags&256?(sa(n),n.flags&=-257,n=Wd(t,n,a)):n.memoizedState!==null?(oa(),n.child=t.child,n.flags|=128,n=null):(oa(),T=o.fallback,f=n.mode,o=Gu({mode:"visible",children:o.children},f),T=hl(T,f,a,null),T.flags|=2,o.return=n,T.return=n,o.sibling=T,n.child=o,Qa(n,t.child,null,a),o=n.child,o.memoizedState=Yd(a),o.childLanes=Pd(t,v,a),n.memoizedState=Vd,n=Qs(null,o));else if(sa(n),Nf(T)){if(v=T.nextSibling&&T.nextSibling.dataset,v)var P=v.dgst;v=P,o=Error(r(419)),o.stack="",o.digest=v,ci({value:o,source:null,stack:null}),n=Wd(t,n,a)}else if(Ht||ia(t,n,a,!1),v=(a&t.childLanes)!==0,Ht||v){if(v=mt,v!==null&&(o=Ko(v,a),o!==0&&o!==I.retryLane))throw I.retryLane=o,Yi(t,o),Ln(v,t,o),$d;Af(T)||Zu(),n=Wd(t,n,a)}else Af(T)?(n.flags|=192,n.child=t.child,n=null):(t=I.treeContext,ht=fi(T.nextSibling),Yt=n,Ve=!0,An=null,Nn=!1,t!==null&&Su(n,t),n=Fd(n,o.children),n.flags|=4096);return n}return f?(oa(),T=o.fallback,f=n.mode,I=t.child,P=I.sibling,o=ji(I,{mode:"hidden",children:o.children}),o.subtreeFlags=I.subtreeFlags&65011712,P!==null?T=ji(P,T):(T=hl(T,f,a,null),T.flags|=2),T.return=n,o.return=n,o.sibling=T,n.child=o,Qs(null,o),o=n.child,T=t.child.memoizedState,T===null?T=Yd(a):(f=T.cachePool,f!==null?(I=j._currentValue,f=f.parent!==I?{parent:I,pool:I}:f):f=Lr(),T={baseLanes:T.baseLanes|a,cachePool:f}),o.memoizedState=T,o.childLanes=Pd(t,v,a),n.memoizedState=Vd,Qs(t.child,o)):(sa(n),a=t.child,t=a.sibling,a=ji(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=a,n.memoizedState=null,a)}function Fd(t,n){return n=Gu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Gu(t,n){return t=xn(22,t,null,n),t.lanes=0,t}function Wd(t,n,a){return Qa(n,t.child,null,a),t=Fd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function qm(t,n,a){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),qs(t.return,n,a)}function Kd(t,n,a,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=a,v.tailMode=f,v.treeForkCount=h)}function Hm(t,n,a){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=Mt.current,T=(v&2)!==0;if(T?(v=v&1|2,n.flags|=128):v&=1,C(Mt,v),ln(t,n,o,a),o=Ve?Ya:0,!T&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&qm(t,a,n);else if(t.tag===19)qm(t,a,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(a=n.child,f=null;a!==null;)t=a.alternate,t!==null&&Du(t)===null&&(f=a),a=a.sibling;a=f,a===null?(f=n.child,n.child=null):(f=a.sibling,a.sibling=null),Kd(n,!1,f,a,h,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Du(t)===null){n.child=f;break}t=f.sibling,f.sibling=a,a=f,f=t}Kd(n,!0,a,null,h,o);break;case"together":Kd(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function wl(t,n,a){if(t!==null&&(n.dependencies=t.dependencies),da|=n.lanes,(a&n.childLanes)===0)if(t!==null){if(ia(t,n,a,!1),(a&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,a=ji(t,t.pendingProps),n.child=a,a.return=n;t.sibling!==null;)t=t.sibling,a=a.sibling=ji(t,t.pendingProps),a.return=n;a.sibling=null}return n.child}function Xd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&zr(t)))}function Cw(t,n,a){switch(n.tag){case 3:Le(n,n.stateNode.containerInfo),Pi(n,j,t.memoizedState.cache),gl();break;case 27:case 5:Ot(n);break;case 4:Le(n,n.stateNode.containerInfo);break;case 10:Pi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,wd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(sa(n),n.flags|=128,null):(a&n.child.childLanes)!==0?Bm(t,n,a):(sa(n),t=wl(t,n,a),t!==null?t.sibling:null);sa(n);break;case 19:var f=(t.flags&128)!==0;if(o=(a&n.childLanes)!==0,o||(ia(t,n,a,!1),o=(a&n.childLanes)!==0),f){if(o)return Hm(t,n,a);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(Mt,Mt.current),o)break;return null;case 22:return n.lanes=0,Rm(t,n,a,n.pendingProps);case 24:Pi(n,j,t.memoizedState.cache)}return wl(t,n,a)}function $m(t,n,a){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ht=!0;else{if(!Xd(t,a)&&(n.flags&128)===0)return Ht=!1,Cw(t,n,a);Ht=(t.flags&131072)!==0}else Ht=!1,Ve&&(n.flags&1048576)!==0&&Us(n,Ya,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Ka(n.elementType),n.type=t,typeof t=="function")zs(t)?(o=Ja(t,o),n.tag=1,n=Im(null,n,t,o,a)):(n.tag=0,n=Gd(null,n,t,o,a));else{if(t!=null){var f=t.$$typeof;if(f===Y){n.tag=11,n=_m(null,n,t,o,a);break e}else if(f===X){n.tag=14,n=Dm(null,n,t,o,a);break e}}throw n=ge(t)||t,Error(r(306,n,""))}}return n;case 0:return Gd(t,n,n.type,n.pendingProps,a);case 1:return o=n.type,f=Ja(o,n.pendingProps),Im(t,n,o,f,a);case 3:e:{if(Le(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,gd(t,n),Ps(n,o,null,a);var v=n.memoizedState;if(o=v.cache,Pi(n,j,o),o!==h.cache&&Pa(n,[j],a,!0),Ys(),o=v.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=Um(t,n,o,a);break e}else if(o!==f){f=Cn(Error(r(424)),n),ci(f),n=Um(t,n,o,a);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ht=fi(t.firstChild),Yt=n,Ve=!0,An=null,Nn=!0,a=Rh(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(gl(),o===f){n=wl(t,n,a);break e}ln(t,n,o,a)}n=n.child}return n;case 26:return $u(t,n),t===null?(a=Jg(n.type,null,n.pendingProps,null))?n.memoizedState=a:Ve||(a=n.type,t=n.pendingProps,o=ac(Z.current).createElement(a),o[bt]=n,o[Nt]=t,an(o,a,t),_t(o),n.stateNode=o):n.memoizedState=Jg(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ot(n),t===null&&Ve&&(o=n.stateNode=Xg(n.type,n.pendingProps,Z.current),Yt=n,Nn=!0,f=ht,ga(n.type)?(_f=f,ht=fi(o.firstChild)):ht=f),ln(t,n,n.pendingProps.children,a),$u(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ve&&((f=o=ht)&&(o=tk(o,n.type,n.pendingProps,Nn),o!==null?(n.stateNode=o,Yt=n,ht=fi(o.firstChild),Nn=!1,f=!0):f=!1),f||_n(n)),Ot(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,Cf(f,h)?o=null:v!==null&&Cf(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=Sd(t,n,gw,null,null,a),po._currentValue=f),$u(t,n),ln(t,n,o,a),n.child;case 6:return t===null&&Ve&&((t=a=ht)&&(a=nk(a,n.pendingProps,Nn),a!==null?(n.stateNode=a,Yt=n,ht=null,t=!0):t=!1),t||_n(n)),null;case 13:return Bm(t,n,a);case 4:return Le(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=Qa(n,null,o,a):ln(t,n,o,a),n.child;case 11:return _m(t,n,n.type,n.pendingProps,a);case 7:return ln(t,n,n.pendingProps,a),n.child;case 8:return ln(t,n,n.pendingProps.children,a),n.child;case 12:return ln(t,n,n.pendingProps.children,a),n.child;case 10:return o=n.pendingProps,Pi(n,n.type,o.value),ln(t,n,o.children,a),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,xl(n),f=Ut(f),o=o(f),n.flags|=1,ln(t,n,o,a),n.child;case 14:return Dm(t,n,n.type,n.pendingProps,a);case 15:return Mm(t,n,n.type,n.pendingProps,a);case 19:return Hm(t,n,a);case 31:return jw(t,n,a);case 22:return Rm(t,n,a,n.pendingProps);case 24:return xl(n),o=Ut(j),t===null?(f=Ei(),f===null&&(f=mt,h=M(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),n.memoizedState={parent:o,cache:f},md(n),Pi(n,j,f)):((t.lanes&a)!==0&&(gd(t,n),Ps(n,null,null,a),Ys()),f=t.memoizedState,h=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Pi(n,j,o)):(o=h.cache,Pi(n,j,o),o!==f.cache&&Pa(n,[j],a,!0))),ln(t,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function kl(t){t.flags|=4}function Qd(t,n,a,o,f){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(mg())t.flags|=8192;else throw Xa=Eu,hd}else t.flags&=-16777217}function Gm(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ly(n))if(mg())t.flags|=8192;else throw Xa=Eu,hd}function Vu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Fo():536870912,t.lanes|=n,Pr|=n)}function Zs(t,n){if(!Ve)switch(t.tailMode){case"hidden":n=t.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function xt(t){var n=t.alternate!==null&&t.alternate.child===t.child,a=0,o=0;if(n)for(var f=t.child;f!==null;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=a,n}function Tw(t,n,a){var o=n.pendingProps;switch(Bs(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(n),null;case 1:return xt(n),null;case 3:return a=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Ti(j),Xe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(na(n)?kl(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,st())),xt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(kl(n),h!==null?(xt(n),Gm(n,h)):(xt(n),Qd(n,f,null,o,a))):h?h!==t.memoizedState?(kl(n),xt(n),Gm(n,h)):(xt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&kl(n),xt(n),Qd(n,f,t,o,a)),null;case 27:if(Ft(n),a=Z.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&kl(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}t=K.current,na(n)?ta(n):(t=Xg(f,o,a),n.stateNode=t,kl(n))}return xt(n),null;case 5:if(Ft(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&kl(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}if(h=K.current,na(n))ta(n);else{var v=ac(Z.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}h[bt]=n,h[Nt]=o;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=h;e:switch(an(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&kl(n)}}return xt(n),Qd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,a),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&kl(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=Z.current,na(n)){if(t=n.stateNode,a=n.memoizedProps,o=null,f=Yt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[bt]=n,t=!!(t.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||Bg(t.nodeValue,a)),t||_n(n,!0)}else t=ac(t).createTextNode(o),t[bt]=n,n.stateNode=t}return xt(n),null;case 31:if(a=n.memoizedState,t===null||t.memoizedState!==null){if(o=na(n),a!==null){if(t===null){if(!o)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[bt]=n}else gl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),t=!1}else a=st(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return n.flags&256?(Qn(n),n):(Qn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return xt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=na(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[bt]=n}else gl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),f=!1}else f=st(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Qn(n),n):(Qn(n),null)}return Qn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,t=t!==null&&t.memoizedState!==null,a&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),a!==t&&a&&(n.child.flags|=8192),Vu(n,n.updateQueue),xt(n),null);case 4:return Xe(),t===null&&vf(n.stateNode.containerInfo),xt(n),null;case 10:return Ti(n.type),xt(n),null;case 19:if(z(Mt),o=n.memoizedState,o===null)return xt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)Zs(o,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Du(t),h!==null){for(n.flags|=128,Zs(o,!1),t=h.updateQueue,n.updateQueue=t,Vu(n,t),n.subtreeFlags=0,t=a,a=n.child;a!==null;)vu(a,t),a=a.sibling;return C(Mt,Mt.current&1|2),Ve&&Kn(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Lt()>Ku&&(n.flags|=128,f=!0,Zs(o,!1),n.lanes=4194304)}else{if(!f)if(t=Du(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Vu(n,t),Zs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ve)return xt(n),null}else 2*Lt()-o.renderingStartTime>Ku&&a!==536870912&&(n.flags|=128,f=!0,Zs(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Lt(),t.sibling=null,a=Mt.current,C(Mt,f?a&1|2:a&1),Ve&&Kn(n,o.treeForkCount),t):(xt(n),null);case 22:case 23:return Qn(n),vd(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(xt(n),n.subtreeFlags&6&&(n.flags|=8192)):xt(n),a=n.updateQueue,a!==null&&Vu(n,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),t!==null&&z(Bt),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Ti(j),xt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function Ew(t,n){switch(Bs(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Ti(j),Xe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Ft(n),null;case 31:if(n.memoizedState!==null){if(Qn(n),n.alternate===null)throw Error(r(340));gl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Qn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));gl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return z(Mt),null;case 4:return Xe(),null;case 10:return Ti(n.type),null;case 22:case 23:return Qn(n),vd(),t!==null&&z(Bt),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Ti(j),null;case 25:return null;default:return null}}function Vm(t,n){switch(Bs(n),n.tag){case 3:Ti(j),Xe();break;case 26:case 27:case 5:Ft(n);break;case 4:Xe();break;case 31:n.memoizedState!==null&&Qn(n);break;case 13:Qn(n);break;case 19:z(Mt);break;case 10:Ti(n.type);break;case 22:case 23:Qn(n),vd(),t!==null&&z(Bt);break;case 24:Ti(j)}}function Js(t,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var f=o.next;a=f;do{if((a.tag&t)===t){o=void 0;var h=a.create,v=a.inst;o=h(),v.destroy=o}a=a.next}while(a!==f)}}catch(T){ct(n,n.return,T)}}function ua(t,n,a){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var v=o.inst,T=v.destroy;if(T!==void 0){v.destroy=void 0,f=n;var I=a,P=T;try{P()}catch(ie){ct(f,I,ie)}}}o=o.next}while(o!==h)}}catch(ie){ct(n,n.return,ie)}}function Ym(t){var n=t.updateQueue;if(n!==null){var a=t.stateNode;try{zh(n,a)}catch(o){ct(t,t.return,o)}}}function Pm(t,n,a){a.props=Ja(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(o){ct(t,n,o)}}function eo(t,n){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof a=="function"?t.refCleanup=a(o):a.current=o}}catch(f){ct(t,n,f)}}function Wi(t,n){var a=t.ref,o=t.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(f){ct(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){ct(t,n,f)}else a.current=null}function Fm(t){var n=t.type,a=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(f){ct(t,t.return,f)}}function Zd(t,n,a){try{var o=t.stateNode;Kw(o,t.type,a,n),o[Nt]=n}catch(f){ct(t,t.return,f)}}function Wm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ga(t.type)||t.tag===4}function Jd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Wm(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&&ga(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 ef(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(t),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=Yn));else if(o!==4&&(o===27&&ga(t.type)&&(a=t.stateNode,n=null),t=t.child,t!==null))for(ef(t,n,a),t=t.sibling;t!==null;)ef(t,n,a),t=t.sibling}function Yu(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?a.insertBefore(t,n):a.appendChild(t);else if(o!==4&&(o===27&&ga(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Yu(t,n,a),t=t.sibling;t!==null;)Yu(t,n,a),t=t.sibling}function Km(t){var n=t.stateNode,a=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);an(n,o,a),n[bt]=t,n[Nt]=a}catch(h){ct(t,t.return,h)}}var Sl=!1,$t=!1,tf=!1,Xm=typeof WeakSet=="function"?WeakSet:Set,Qt=null;function Aw(t,n){if(t=t.containerInfo,Sf=fc,t=hu(t),Ds(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var v=0,T=-1,I=-1,P=0,ie=0,re=t,W=null;t:for(;;){for(var Q;re!==a||f!==0&&re.nodeType!==3||(T=v+f),re!==h||o!==0&&re.nodeType!==3||(I=v+o),re.nodeType===3&&(v+=re.nodeValue.length),(Q=re.firstChild)!==null;)W=re,re=Q;for(;;){if(re===t)break t;if(W===a&&++P===f&&(T=v),W===h&&++ie===o&&(I=v),(Q=re.nextSibling)!==null)break;re=W,W=re.parentNode}re=Q}a=T===-1||I===-1?null:{start:T,end:I}}else a=null}a=a||{start:0,end:0}}else a=null;for(jf={focusedElem:t,selectionRange:a},fc=!1,Qt=n;Qt!==null;)if(n=Qt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Qt=t;else for(;Qt!==null;){switch(n=Qt,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)f=t[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,a=n,f=h.memoizedProps,h=h.memoizedState,o=a.stateNode;try{var ve=Ja(a.type,f);t=o.getSnapshotBeforeUpdate(ve,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(Oe){ct(a,a.return,Oe)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,a=t.nodeType,a===9)Ef(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ef(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,Qt=t;break}Qt=n.return}}function Qm(t,n,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(t,a),o&4&&Js(5,a);break;case 1:if(Cl(t,a),o&4)if(t=a.stateNode,n===null)try{t.componentDidMount()}catch(v){ct(a,a.return,v)}else{var f=Ja(a.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ct(a,a.return,v)}}o&64&&Ym(a),o&512&&eo(a,a.return);break;case 3:if(Cl(t,a),o&64&&(t=a.updateQueue,t!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{zh(t,n)}catch(v){ct(a,a.return,v)}}break;case 27:n===null&&o&4&&Km(a);case 26:case 5:Cl(t,a),n===null&&o&4&&Fm(a),o&512&&eo(a,a.return);break;case 12:Cl(t,a);break;case 31:Cl(t,a),o&4&&eg(t,a);break;case 13:Cl(t,a),o&4&&tg(t,a),o&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=Iw.bind(null,a),ik(t,a))));break;case 22:if(o=a.memoizedState!==null||Sl,!o){n=n!==null&&n.memoizedState!==null||$t,f=Sl;var h=$t;Sl=o,($t=n)&&!h?Tl(t,a,(a.subtreeFlags&8772)!==0):Cl(t,a),Sl=f,$t=h}break;case 30:break;default:Cl(t,a)}}function Zm(t){var n=t.alternate;n!==null&&(t.alternate=null,Zm(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Da(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 vt=null,Mn=!1;function jl(t,n,a){for(a=a.child;a!==null;)Jm(t,n,a),a=a.sibling}function Jm(t,n,a){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(tt,a)}catch{}switch(a.tag){case 26:$t||Wi(a,n),jl(t,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:$t||Wi(a,n);var o=vt,f=Mn;ga(a.type)&&(vt=a.stateNode,Mn=!1),jl(t,n,a),uo(a.stateNode),vt=o,Mn=f;break;case 5:$t||Wi(a,n);case 6:if(o=vt,f=Mn,vt=null,jl(t,n,a),vt=o,Mn=f,vt!==null)if(Mn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(a.stateNode)}catch(h){ct(a,n,h)}else try{vt.removeChild(a.stateNode)}catch(h){ct(a,n,h)}break;case 18:vt!==null&&(Mn?(t=vt,Yg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),es(t)):Yg(vt,a.stateNode));break;case 4:o=vt,f=Mn,vt=a.stateNode.containerInfo,Mn=!0,jl(t,n,a),vt=o,Mn=f;break;case 0:case 11:case 14:case 15:ua(2,a,n),$t||ua(4,a,n),jl(t,n,a);break;case 1:$t||(Wi(a,n),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Pm(a,n,o)),jl(t,n,a);break;case 21:jl(t,n,a);break;case 22:$t=(o=$t)||a.memoizedState!==null,jl(t,n,a),$t=o;break;default:jl(t,n,a)}}function eg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{es(t)}catch(a){ct(n,n.return,a)}}}function tg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{es(t)}catch(a){ct(n,n.return,a)}}function Nw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Xm),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Xm),n;default:throw Error(r(435,t.tag))}}function Pu(t,n){var a=Nw(t);n.forEach(function(o){if(!a.has(o)){a.add(o);var f=Uw.bind(null,t,o);o.then(f,f)}})}function Rn(t,n){var a=n.deletions;if(a!==null)for(var o=0;o<a.length;o++){var f=a[o],h=t,v=n,T=v;e:for(;T!==null;){switch(T.tag){case 27:if(ga(T.type)){vt=T.stateNode,Mn=!1;break e}break;case 5:vt=T.stateNode,Mn=!1;break e;case 3:case 4:vt=T.stateNode.containerInfo,Mn=!0;break e}T=T.return}if(vt===null)throw Error(r(160));Jm(h,v,f),vt=null,Mn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)ng(n,t),n=n.sibling}var Ai=null;function ng(t,n){var a=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Rn(n,t),On(t),o&4&&(ua(3,t,t.return),Js(3,t),ua(5,t,t.return));break;case 1:Rn(n,t),On(t),o&512&&($t||a===null||Wi(a,a.return)),o&64&&Sl&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var f=Ai;if(Rn(n,t),On(t),o&512&&($t||a===null||Wi(a,a.return)),o&4){var h=a!==null?a.memoizedState:null;if(o=t.memoizedState,a===null)if(o===null)if(t.stateNode===null){e:{o=t.type,a=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[bi]||h[bt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),an(h,o,a),h[bt]=t,_t(h),o=h;break e;case"link":var v=ny("link","href",f).get(o+(a.href||""));if(v){for(var T=0;T<v.length;T++)if(h=v[T],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){v.splice(T,1);break t}}h=f.createElement(o),an(h,o,a),f.head.appendChild(h);break;case"meta":if(v=ny("meta","content",f).get(o+(a.content||""))){for(T=0;T<v.length;T++)if(h=v[T],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){v.splice(T,1);break t}}h=f.createElement(o),an(h,o,a),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[bt]=t,_t(h),o=h}t.stateNode=o}else iy(f,t.type,t.stateNode);else t.stateNode=ty(f,o,t.memoizedProps);else h!==o?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,o===null?iy(f,t.type,t.stateNode):ty(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Zd(t,t.memoizedProps,a.memoizedProps)}break;case 27:Rn(n,t),On(t),o&512&&($t||a===null||Wi(a,a.return)),a!==null&&o&4&&Zd(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Rn(n,t),On(t),o&512&&($t||a===null||Wi(a,a.return)),t.flags&32){f=t.stateNode;try{Ii(f,"")}catch(ve){ct(t,t.return,ve)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,Zd(t,f,a!==null?a.memoizedProps:f)),o&1024&&(tf=!0);break;case 6:if(Rn(n,t),On(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,a=t.stateNode;try{a.nodeValue=o}catch(ve){ct(t,t.return,ve)}}break;case 3:if(oc=null,f=Ai,Ai=rc(n.containerInfo),Rn(n,t),Ai=f,On(t),o&4&&a!==null&&a.memoizedState.isDehydrated)try{es(n.containerInfo)}catch(ve){ct(t,t.return,ve)}tf&&(tf=!1,ig(t));break;case 4:o=Ai,Ai=rc(t.stateNode.containerInfo),Rn(n,t),On(t),Ai=o;break;case 12:Rn(n,t),On(t);break;case 31:Rn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Pu(t,o)));break;case 13:Rn(n,t),On(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Wu=Lt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Pu(t,o)));break;case 22:f=t.memoizedState!==null;var I=a!==null&&a.memoizedState!==null,P=Sl,ie=$t;if(Sl=P||f,$t=ie||I,Rn(n,t),$t=ie,Sl=P,On(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(a===null||I||Sl||$t||er(t)),a=null,n=t;;){if(n.tag===5||n.tag===26){if(a===null){I=a=n;try{if(h=I.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{T=I.stateNode;var re=I.memoizedProps.style,W=re!=null&&re.hasOwnProperty("display")?re.display:null;T.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(ve){ct(I,I.return,ve)}}}else if(n.tag===6){if(a===null){I=n;try{I.stateNode.nodeValue=f?"":I.memoizedProps}catch(ve){ct(I,I.return,ve)}}}else if(n.tag===18){if(a===null){I=n;try{var Q=I.stateNode;f?Pg(Q,!0):Pg(I.stateNode,!1)}catch(ve){ct(I,I.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;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,Pu(t,a))));break;case 19:Rn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Pu(t,o)));break;case 30:break;case 21:break;default:Rn(n,t),On(t)}}function On(t){var n=t.flags;if(n&2){try{for(var a,o=t.return;o!==null;){if(Wm(o)){a=o;break}o=o.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var f=a.stateNode,h=Jd(t);Yu(t,h,f);break;case 5:var v=a.stateNode;a.flags&32&&(Ii(v,""),a.flags&=-33);var T=Jd(t);Yu(t,T,v);break;case 3:case 4:var I=a.stateNode.containerInfo,P=Jd(t);ef(t,P,I);break;default:throw Error(r(161))}}catch(ie){ct(t,t.return,ie)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function ig(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;ig(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Cl(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Qm(t,n.alternate,n),n=n.sibling}function er(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:ua(4,n,n.return),er(n);break;case 1:Wi(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Pm(n,n.return,a),er(n);break;case 27:uo(n.stateNode);case 26:case 5:Wi(n,n.return),er(n);break;case 22:n.memoizedState===null&&er(n);break;case 30:er(n);break;default:er(n)}t=t.sibling}}function Tl(t,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,h=n,v=h.flags;switch(h.tag){case 0:case 11:case 15:Tl(f,h,a),Js(4,h);break;case 1:if(Tl(f,h,a),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){ct(o,o.return,P)}if(o=h,f=o.updateQueue,f!==null){var T=o.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)Oh(I[f],T)}catch(P){ct(o,o.return,P)}}a&&v&64&&Ym(h),eo(h,h.return);break;case 27:Km(h);case 26:case 5:Tl(f,h,a),a&&o===null&&v&4&&Fm(h),eo(h,h.return);break;case 12:Tl(f,h,a);break;case 31:Tl(f,h,a),a&&v&4&&eg(f,h);break;case 13:Tl(f,h,a),a&&v&4&&tg(f,h);break;case 22:h.memoizedState===null&&Tl(f,h,a),eo(h,h.return);break;case 30:break;default:Tl(f,h,a)}n=n.sibling}}function nf(t,n){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&B(a))}function lf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&B(t))}function Ni(t,n,a,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)lg(t,n,a,o),n=n.sibling}function lg(t,n,a,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:Ni(t,n,a,o),f&2048&&Js(9,n);break;case 1:Ni(t,n,a,o);break;case 3:Ni(t,n,a,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&B(t)));break;case 12:if(f&2048){Ni(t,n,a,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,T=h.onPostCommit;typeof T=="function"&&T(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){ct(n,n.return,I)}}else Ni(t,n,a,o);break;case 31:Ni(t,n,a,o);break;case 13:Ni(t,n,a,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?Ni(t,n,a,o):to(t,n):h._visibility&2?Ni(t,n,a,o):(h._visibility|=2,Gr(t,n,a,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&nf(v,n);break;case 24:Ni(t,n,a,o),f&2048&&lf(n.alternate,n);break;default:Ni(t,n,a,o)}}function Gr(t,n,a,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,T=a,I=o,P=v.flags;switch(v.tag){case 0:case 11:case 15:Gr(h,v,T,I,f),Js(8,v);break;case 23:break;case 22:var ie=v.stateNode;v.memoizedState!==null?ie._visibility&2?Gr(h,v,T,I,f):to(h,v):(ie._visibility|=2,Gr(h,v,T,I,f)),f&&P&2048&&nf(v.alternate,v);break;case 24:Gr(h,v,T,I,f),f&&P&2048&&lf(v.alternate,v);break;default:Gr(h,v,T,I,f)}n=n.sibling}}function to(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=t,o=n,f=o.flags;switch(o.tag){case 22:to(a,o),f&2048&&nf(o.alternate,o);break;case 24:to(a,o),f&2048&&lf(o.alternate,o);break;default:to(a,o)}n=n.sibling}}var no=8192;function Vr(t,n,a){if(t.subtreeFlags&no)for(t=t.child;t!==null;)ag(t,n,a),t=t.sibling}function ag(t,n,a){switch(t.tag){case 26:Vr(t,n,a),t.flags&no&&t.memoizedState!==null&&mk(a,Ai,t.memoizedState,t.memoizedProps);break;case 5:Vr(t,n,a);break;case 3:case 4:var o=Ai;Ai=rc(t.stateNode.containerInfo),Vr(t,n,a),Ai=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=no,no=16777216,Vr(t,n,a),no=o):Vr(t,n,a));break;default:Vr(t,n,a)}}function rg(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 io(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Qt=o,og(o,t)}rg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sg(t),t=t.sibling}function sg(t){switch(t.tag){case 0:case 11:case 15:io(t),t.flags&2048&&ua(9,t,t.return);break;case 3:io(t);break;case 12:io(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Fu(t)):io(t);break;default:io(t)}}function Fu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Qt=o,og(o,t)}rg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:ua(8,n,n.return),Fu(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,Fu(n));break;default:Fu(n)}t=t.sibling}}function og(t,n){for(;Qt!==null;){var a=Qt;switch(a.tag){case 0:case 11:case 15:ua(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:B(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,Qt=o;else e:for(a=t;Qt!==null;){o=Qt;var f=o.sibling,h=o.return;if(Zm(o),o===a){Qt=null;break e}if(f!==null){f.return=h,Qt=f;break e}Qt=h}}}var _w={getCacheForType:function(t){var n=Ut(j),a=n.data.get(t);return a===void 0&&(a=t(),n.data.set(t,a)),a},cacheSignal:function(){return Ut(j).controller.signal}},Dw=typeof WeakMap=="function"?WeakMap:Map,at=0,mt=null,Pe=null,Qe=0,ut=0,Zn=null,ca=!1,Yr=!1,af=!1,El=0,Tt=0,da=0,tr=0,rf=0,Jn=0,Pr=0,lo=null,zn=null,sf=!1,Wu=0,ug=0,Ku=1/0,Xu=null,fa=null,Pt=0,pa=null,Fr=null,Al=0,of=0,uf=null,cg=null,ao=0,cf=null;function ei(){return(at&2)!==0&&Qe!==0?Qe&-Qe:G.T!==null?gf():pr()}function dg(){if(Jn===0)if((Qe&536870912)===0||Ve){var t=Aa;Aa<<=1,(Aa&3932160)===0&&(Aa=262144),Jn=t}else Jn=536870912;return t=Xn.current,t!==null&&(t.flags|=32),Jn}function Ln(t,n,a){(t===mt&&(ut===2||ut===9)||t.cancelPendingCommit!==null)&&(Wr(t,0),ha(t,Qe,Jn,!1)),Ol(t,a),((at&2)===0||t!==mt)&&(t===mt&&((at&2)===0&&(tr|=a),Tt===4&&ha(t,Qe,Jn,!1)),Ki(t))}function fg(t,n,a){if((at&6)!==0)throw Error(r(327));var o=!a&&(n&127)===0&&(n&t.expiredLanes)===0||ot(t,n),f=o?Ow(t,n):ff(t,n,!0),h=o;do{if(f===0){Yr&&!o&&ha(t,n,0,!1);break}else{if(a=t.current.alternate,h&&!Mw(a)){f=ff(t,n,!1),h=!1;continue}if(f===2){if(h=n,t.errorRecoveryDisabledLanes&h)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var T=t;f=lo;var I=T.current.memoizedState.isDehydrated;if(I&&(Wr(T,v).flags|=256),v=ff(T,v,!1),v!==2){if(af&&!I){T.errorRecoveryDisabledLanes|=h,tr|=h,f=4;break e}h=zn,zn=f,h!==null&&(zn===null?zn=h:zn.push.apply(zn,h))}f=v}if(h=!1,f!==2)continue}}if(f===1){Wr(t,0),ha(t,n,0,!0);break}e:{switch(o=t,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:ha(o,n,Jn,!ca);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Wu+300-Lt(),10<f)){if(ha(o,n,Jn,!ca),xi(o,0,!0)!==0)break e;Al=n,o.timeoutHandle=Gg(pg.bind(null,o,a,zn,Xu,sf,n,Jn,tr,Pr,ca,h,"Throttled",-0,0),f);break e}pg(o,a,zn,Xu,sf,n,Jn,tr,Pr,ca,h,null,-0,0)}}break}while(!0);Ki(t)}function pg(t,n,a,o,f,h,v,T,I,P,ie,re,W,Q){if(t.timeoutHandle=-1,re=n.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yn},ag(n,h,re);var ve=(h&62914560)===h?Wu-Lt():(h&4194048)===h?ug-Lt():0;if(ve=gk(re,ve),ve!==null){Al=h,t.cancelPendingCommit=ve(wg.bind(null,t,n,h,a,o,f,v,T,I,ie,re,null,W,Q)),ha(t,h,v,!P);return}}wg(t,n,h,a,o,f,v,T,I)}function Mw(t){for(var n=t;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var f=a[o],h=f.getSnapshot;f=f.value;try{if(!yn(h(),f))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;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 ha(t,n,a,o){n&=~rf,n&=~tr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-rt(f),v=1<<h;o[h]=-1,f&=~v}a!==0&&Wo(t,a,n)}function Qu(){return(at&6)===0?(ro(0),!1):!0}function df(){if(Pe!==null){if(ut===0)var t=Pe.return;else t=Pe,nn=yl=null,Td(t),Ur=null,$s=0,t=Pe;for(;t!==null;)Vm(t.alternate,t),t=t.return;Pe=null}}function Wr(t,n){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,Zw(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Al=0,df(),mt=t,Pe=a=ji(t.current,null),Qe=n,ut=0,Zn=null,ca=!1,Yr=ot(t,n),af=!1,Pr=Jn=rf=tr=da=Tt=0,zn=lo=null,sf=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var f=31-rt(o),h=1<<f;n|=t[f],o&=~h}return El=n,pl(),a}function hg(t,n){He=null,G.H=Xs,n===Ir||n===Tu?(n=_h(),ut=3):n===hd?(n=_h(),ut=4):ut=n===$d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Zn=n,Pe===null&&(Tt=1,qu(t,Cn(n,t.current)))}function mg(){var t=Xn.current;return t===null?!0:(Qe&4194048)===Qe?di===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===di:!1}function gg(){var t=G.H;return G.H=Xs,t===null?Xs:t}function yg(){var t=G.A;return G.A=_w,t}function Zu(){Tt=4,ca||(Qe&4194048)!==Qe&&Xn.current!==null||(Yr=!0),(da&134217727)===0&&(tr&134217727)===0||mt===null||ha(mt,Qe,Jn,!1)}function ff(t,n,a){var o=at;at|=2;var f=gg(),h=yg();(mt!==t||Qe!==n)&&(Xu=null,Wr(t,n)),n=!1;var v=Tt;e:do try{if(ut!==0&&Pe!==null){var T=Pe,I=Zn;switch(ut){case 8:df(),v=6;break e;case 3:case 2:case 9:case 6:Xn.current===null&&(n=!0);var P=ut;if(ut=0,Zn=null,Kr(t,T,I,P),a&&Yr){v=0;break e}break;default:P=ut,ut=0,Zn=null,Kr(t,T,I,P)}}Rw(),v=Tt;break}catch(ie){hg(t,ie)}while(!0);return n&&t.shellSuspendCounter++,nn=yl=null,at=o,G.H=f,G.A=h,Pe===null&&(mt=null,Qe=0,pl()),v}function Rw(){for(;Pe!==null;)xg(Pe)}function Ow(t,n){var a=at;at|=2;var o=gg(),f=yg();mt!==t||Qe!==n?(Xu=null,Ku=Lt()+500,Wr(t,n)):Yr=ot(t,n);e:do try{if(ut!==0&&Pe!==null){n=Pe;var h=Zn;t:switch(ut){case 1:ut=0,Zn=null,Kr(t,n,h,1);break;case 2:case 9:if(Ah(h)){ut=0,Zn=null,bg(n);break}n=function(){ut!==2&&ut!==9||mt!==t||(ut=7),Ki(t)},h.then(n,n);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:Ah(h)?(ut=0,Zn=null,bg(n)):(ut=0,Zn=null,Kr(t,n,h,7));break;case 5:var v=null;switch(Pe.tag){case 26:v=Pe.memoizedState;case 5:case 27:var T=Pe;if(v?ly(v):T.stateNode.complete){ut=0,Zn=null;var I=T.sibling;if(I!==null)Pe=I;else{var P=T.return;P!==null?(Pe=P,Ju(P)):Pe=null}break t}}ut=0,Zn=null,Kr(t,n,h,5);break;case 6:ut=0,Zn=null,Kr(t,n,h,6);break;case 8:df(),Tt=6;break e;default:throw Error(r(462))}}zw();break}catch(ie){hg(t,ie)}while(!0);return nn=yl=null,G.H=o,G.A=f,at=a,Pe!==null?0:(mt=null,Qe=0,pl(),Tt)}function zw(){for(;Pe!==null&&!yi();)xg(Pe)}function xg(t){var n=$m(t.alternate,t,El);t.memoizedProps=t.pendingProps,n===null?Ju(t):Pe=n}function bg(t){var n=t,a=n.alternate;switch(n.tag){case 15:case 0:n=Lm(a,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=Lm(a,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:Td(n);default:Vm(a,n),n=Pe=vu(n,El),n=$m(a,n,El)}t.memoizedProps=t.pendingProps,n===null?Ju(t):Pe=n}function Kr(t,n,a,o){nn=yl=null,Td(n),Ur=null,$s=0;var f=n.return;try{if(Sw(t,f,n,a,Qe)){Tt=1,qu(t,Cn(a,t.current)),Pe=null;return}}catch(h){if(f!==null)throw Pe=f,h;Tt=1,qu(t,Cn(a,t.current)),Pe=null;return}n.flags&32768?(Ve||o===1?t=!0:Yr||(Qe&536870912)!==0?t=!1:(ca=t=!0,(o===2||o===9||o===3||o===6)&&(o=Xn.current,o!==null&&o.tag===13&&(o.flags|=16384))),vg(n,t)):Ju(n)}function Ju(t){var n=t;do{if((n.flags&32768)!==0){vg(n,ca);return}t=n.return;var a=Tw(n.alternate,n,El);if(a!==null){Pe=a;return}if(n=n.sibling,n!==null){Pe=n;return}Pe=n=t}while(n!==null);Tt===0&&(Tt=5)}function vg(t,n){do{var a=Ew(t.alternate,t);if(a!==null){a.flags&=32767,Pe=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(t=t.sibling,t!==null)){Pe=t;return}Pe=t=a}while(t!==null);Tt=6,Pe=null}function wg(t,n,a,o,f,h,v,T,I){t.cancelPendingCommit=null;do ec();while(Pt!==0);if((at&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Vi,_a(t,a,h,v,T,I),t===mt&&(Pe=mt=null,Qe=0),Fr=n,pa=t,Al=a,of=h,uf=f,cg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Bw(Me,function(){return Tg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=G.T,G.T=null,f=oe.p,oe.p=2,v=at,at|=4;try{Aw(t,n,a)}finally{at=v,oe.p=f,G.T=o}}Pt=1,kg(),Sg(),jg()}}function kg(){if(Pt===1){Pt=0;var t=pa,n=Fr,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=G.T,G.T=null;var o=oe.p;oe.p=2;var f=at;at|=4;try{ng(n,t);var h=jf,v=hu(t.containerInfo),T=h.focusedElem,I=h.selectionRange;if(v!==T&&T&&T.ownerDocument&&pu(T.ownerDocument.documentElement,T)){if(I!==null&&Ds(T)){var P=I.start,ie=I.end;if(ie===void 0&&(ie=P),"selectionStart"in T)T.selectionStart=P,T.selectionEnd=Math.min(ie,T.value.length);else{var re=T.ownerDocument||document,W=re&&re.defaultView||window;if(W.getSelection){var Q=W.getSelection(),ve=T.textContent.length,Oe=Math.min(I.start,ve),pt=I.end===void 0?Oe:Math.min(I.end,ve);!Q.extend&&Oe>pt&&(v=pt,pt=Oe,Oe=v);var $=fu(T,Oe),H=fu(T,pt);if($&&H&&(Q.rangeCount!==1||Q.anchorNode!==$.node||Q.anchorOffset!==$.offset||Q.focusNode!==H.node||Q.focusOffset!==H.offset)){var V=re.createRange();V.setStart($.node,$.offset),Q.removeAllRanges(),Oe>pt?(Q.addRange(V),Q.extend(H.node,H.offset)):(V.setEnd(H.node,H.offset),Q.addRange(V))}}}}for(re=[],Q=T;Q=Q.parentNode;)Q.nodeType===1&&re.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<re.length;T++){var le=re[T];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}fc=!!Sf,jf=Sf=null}finally{at=f,oe.p=o,G.T=a}}t.current=n,Pt=2}}function Sg(){if(Pt===2){Pt=0;var t=pa,n=Fr,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=G.T,G.T=null;var o=oe.p;oe.p=2;var f=at;at|=4;try{Qm(t,n.alternate,n)}finally{at=f,oe.p=o,G.T=a}}Pt=3}}function jg(){if(Pt===4||Pt===3){Pt=0,Di();var t=pa,n=Fr,a=Al,o=cg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Pt=5:(Pt=0,Fr=pa=null,Cg(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(fa=null),ds(a),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(tt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=G.T,f=oe.p,oe.p=2,G.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var T=o[v];h(T.value,{componentStack:T.stack})}}finally{G.T=n,oe.p=f}}(Al&3)!==0&&ec(),Ki(t),f=t.pendingLanes,(a&261930)!==0&&(f&42)!==0?t===cf?ao++:(ao=0,cf=t):ao=0,ro(0)}}function Cg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,B(n)))}function ec(){return kg(),Sg(),jg(),Tg()}function Tg(){if(Pt!==5)return!1;var t=pa,n=of;of=0;var a=ds(Al),o=G.T,f=oe.p;try{oe.p=32>a?32:a,G.T=null,a=uf,uf=null;var h=pa,v=Al;if(Pt=0,Fr=pa=null,Al=0,(at&6)!==0)throw Error(r(331));var T=at;if(at|=4,sg(h.current),lg(h,h.current,v,a),at=T,ro(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(tt,h)}catch{}return!0}finally{oe.p=f,G.T=o,Cg(t,n)}}function Eg(t,n,a){n=Cn(a,n),n=Hd(t.stateNode,n,2),t=ra(t,n,2),t!==null&&(Ol(t,2),Ki(t))}function ct(t,n,a){if(t.tag===3)Eg(t,t,a);else for(;n!==null;){if(n.tag===3){Eg(n,t,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(fa===null||!fa.has(o))){t=Cn(a,t),a=Am(2),o=ra(n,a,2),o!==null&&(Nm(a,o,n,t),Ol(o,2),Ki(o));break}}n=n.return}}function pf(t,n,a){var o=t.pingCache;if(o===null){o=t.pingCache=new Dw;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(a)||(af=!0,f.add(a),t=Lw.bind(null,t,n,a),n.then(t,t))}function Lw(t,n,a){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,mt===t&&(Qe&a)===a&&(Tt===4||Tt===3&&(Qe&62914560)===Qe&&300>Lt()-Wu?(at&2)===0&&Wr(t,0):rf|=a,Pr===Qe&&(Pr=0)),Ki(t)}function Ag(t,n){n===0&&(n=Fo()),t=Yi(t,n),t!==null&&(Ol(t,n),Ki(t))}function Iw(t){var n=t.memoizedState,a=0;n!==null&&(a=n.retryLane),Ag(t,a)}function Uw(t,n){var a=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(a=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),Ag(t,a)}function Bw(t,n){return wn(t,n)}var tc=null,Xr=null,hf=!1,nc=!1,mf=!1,ma=0;function Ki(t){t!==Xr&&t.next===null&&(Xr===null?tc=Xr=t:Xr=Xr.next=t),nc=!0,hf||(hf=!0,Hw())}function ro(t,n){if(!mf&&nc){mf=!0;do for(var a=!1,o=tc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-rt(42|t)+1)-1,h&=f&~(v&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,Mg(o,h))}else h=Qe,h=xi(o,o===mt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||ot(o,h)||(a=!0,Mg(o,h));o=o.next}while(a);mf=!1}}function qw(){Ng()}function Ng(){nc=hf=!1;var t=0;ma!==0&&Qw()&&(t=ma);for(var n=Lt(),a=null,o=tc;o!==null;){var f=o.next,h=_g(o,n);h===0?(o.next=null,a===null?tc=f:a.next=f,f===null&&(Xr=a)):(a=o,(t!==0||(h&3)!==0)&&(nc=!0)),o=f}Pt!==0&&Pt!==5||ro(t),ma!==0&&(ma=0)}function _g(t,n){for(var a=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-rt(h),T=1<<v,I=f[v];I===-1?((T&a)===0||(T&o)!==0)&&(f[v]=Na(T,n)):I<=n&&(t.expiredLanes|=T),h&=~T}if(n=mt,a=Qe,a=xi(t,t===n?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,a===0||t===n&&(ut===2||ut===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&gi(o),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||ot(t,a)){if(n=a&-a,n===t.callbackPriority)return n;switch(o!==null&&gi(o),ds(a)){case 2:case 8:a=he;break;case 32:a=Me;break;case 268435456:a=Ie;break;default:a=Me}return o=Dg.bind(null,t),a=wn(a,o),t.callbackPriority=n,t.callbackNode=a,n}return o!==null&&o!==null&&gi(o),t.callbackPriority=2,t.callbackNode=null,2}function Dg(t,n){if(Pt!==0&&Pt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(ec()&&t.callbackNode!==a)return null;var o=Qe;return o=xi(t,t===mt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(fg(t,o,n),_g(t,Lt()),t.callbackNode!=null&&t.callbackNode===a?Dg.bind(null,t):null)}function Mg(t,n){if(ec())return null;fg(t,n,!0)}function Hw(){Jw(function(){(at&6)!==0?wn(ne,qw):Ng()})}function gf(){if(ma===0){var t=Ue;t===0&&(t=Ea,Ea<<=1,(Ea&261888)===0&&(Ea=256)),ma=t}return ma}function Rg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ql(""+t)}function Og(t,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,t.id&&a.setAttribute("form",t.id),n.parentNode.insertBefore(a,n),t=new FormData(t),a.parentNode.removeChild(a),t}function $w(t,n,a,o,f){if(n==="submit"&&a&&a.stateNode===f){var h=Rg((f[Nt]||null).action),v=o.submitter;v&&(n=(n=v[Nt]||null)?Rg(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var T=new gn("action","action",null,o,f);t.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ma!==0){var I=v?Og(f,v):new FormData(f);zd(a,{pending:!0,data:I,method:f.method,action:h},null,I)}}else typeof h=="function"&&(T.preventDefault(),I=v?Og(f,v):new FormData(f),zd(a,{pending:!0,data:I,method:f.method,action:h},h,I))},currentTarget:f}]})}}for(var yf=0;yf<Dr.length;yf++){var xf=Dr[yf],Gw=xf.toLowerCase(),Vw=xf[0].toUpperCase()+xf.slice(1);Sn(Gw,"on"+Vw)}Sn(Kl,"onAnimationEnd"),Sn(Gi,"onAnimationIteration"),Sn(gu,"onAnimationStart"),Sn("dblclick","onDoubleClick"),Sn("focusin","onFocus"),Sn("focusout","onBlur"),Sn(cd,"onTransitionRun"),Sn(dd,"onTransitionStart"),Sn(fd,"onTransitionCancel"),Sn(yu,"onTransitionEnd"),Ll("onMouseEnter",["mouseout","mouseover"]),Ll("onMouseLeave",["mouseout","mouseover"]),Ll("onPointerEnter",["pointerout","pointerover"]),Ll("onPointerLeave",["pointerout","pointerover"]),Li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Li("onBeforeInput",["compositionend","keypress","textInput","paste"]),Li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var so="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(" "),Yw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(so));function zg(t,n){n=(n&4)!==0;for(var a=0;a<t.length;a++){var o=t[a],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var T=o[v],I=T.instance,P=T.currentTarget;if(T=T.listener,I!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=P;try{h(f)}catch(ie){Mr(ie)}f.currentTarget=null,h=I}else for(v=0;v<o.length;v++){if(T=o[v],I=T.instance,P=T.currentTarget,T=T.listener,I!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=P;try{h(f)}catch(ie){Mr(ie)}f.currentTarget=null,h=I}}}}function Fe(t,n){var a=n[Ri];a===void 0&&(a=n[Ri]=new Set);var o=t+"__bubble";a.has(o)||(Lg(n,t,2,!1),a.add(o))}function bf(t,n,a){var o=0;n&&(o|=4),Lg(a,t,o,n)}var ic="_reactListening"+Math.random().toString(36).slice(2);function vf(t){if(!t[ic]){t[ic]=!0,vi.forEach(function(a){a!=="selectionchange"&&(Yw.has(a)||bf(a,!1,t),bf(a,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[ic]||(n[ic]=!0,bf("selectionchange",!1,n))}}function Lg(t,n,a,o){switch(dy(n)){case 2:var f=bk;break;case 8:f=vk;break;default:f=zf}a=f.bind(null,n,a,t),f=void 0,!xr||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,a,{capture:!0,passive:f}):t.addEventListener(n,a,!0):f!==void 0?t.addEventListener(n,a,{passive:f}):t.addEventListener(n,a,!1)}function wf(t,n,a,o,f){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var T=o.stateNode.containerInfo;if(T===f)break;if(v===4)for(v=o.return;v!==null;){var I=v.tag;if((I===3||I===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;T!==null;){if(v=Oi(T),v===null)return;if(I=v.tag,I===5||I===6||I===26||I===27){o=h=v;continue e}T=T.parentNode}}o=o.return}ys(function(){var P=h,ie=Oa(a),re=[];e:{var W=xu.get(t);if(W!==void 0){var Q=gn,ve=t;switch(t){case"keypress":if($l(a)===0)break e;case"keydown":case"keyup":Q=ed;break;case"focusin":ve="focus",Q=kr;break;case"focusout":ve="blur",Q=kr;break;case"beforeblur":case"afterblur":Q=kr;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=za;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=vs;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Cs;break;case Kl:case Gi:case gu:Q=Kt;break;case yu:Q=Es;break;case"scroll":case"scrollend":Q=wr;break;case"wheel":Q=td;break;case"copy":case"cut":case"paste":Q=La;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Ss;break;case"toggle":case"beforetoggle":Q=nd}var Oe=(n&4)!==0,pt=!Oe&&(t==="scroll"||t==="scrollend"),$=Oe?W!==null?W+"Capture":null:W;Oe=[];for(var H=P,V;H!==null;){var le=H;if(V=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||V===null||$===null||(le=Bi(H,$),le!=null&&Oe.push(oo(H,le,V))),pt)break;H=H.return}0<Oe.length&&(W=new Q(W,ve,null,a,ie),re.push({event:W,listeners:Oe}))}}if((n&7)===0){e:{if(W=t==="mouseover"||t==="pointerover",Q=t==="mouseout"||t==="pointerout",W&&a!==ms&&(ve=a.relatedTarget||a.fromElement)&&(Oi(ve)||ve[Hn]))break e;if((Q||W)&&(W=ie.window===ie?ie:(W=ie.ownerDocument)?W.defaultView||W.parentWindow:window,Q?(ve=a.relatedTarget||a.toElement,Q=P,ve=ve?Oi(ve):null,ve!==null&&(pt=c(ve),Oe=ve.tag,ve!==pt||Oe!==5&&Oe!==27&&Oe!==6)&&(ve=null)):(Q=null,ve=P),Q!==ve)){if(Oe=za,le="onMouseLeave",$="onMouseEnter",H="mouse",(t==="pointerout"||t==="pointerover")&&(Oe=Ss,le="onPointerLeave",$="onPointerEnter",H="pointer"),pt=Q==null?W:nl(Q),V=ve==null?W:nl(ve),W=new Oe(le,H+"leave",Q,a,ie),W.target=pt,W.relatedTarget=V,le=null,Oi(ie)===P&&(Oe=new Oe($,H+"enter",ve,a,ie),Oe.target=V,Oe.relatedTarget=pt,le=Oe),pt=le,Q&&ve)t:{for(Oe=Pw,$=Q,H=ve,V=0,le=$;le;le=Oe(le))V++;le=0;for(var _e=H;_e;_e=Oe(_e))le++;for(;0<V-le;)$=Oe($),V--;for(;0<le-V;)H=Oe(H),le--;for(;V--;){if($===H||H!==null&&$===H.alternate){Oe=$;break t}$=Oe($),H=Oe(H)}Oe=null}else Oe=null;Q!==null&&Ig(re,W,Q,Oe,!1),ve!==null&&pt!==null&&Ig(re,pt,ve,Oe,!0)}}e:{if(W=P?nl(P):window,Q=W.nodeName&&W.nodeName.toLowerCase(),Q==="select"||Q==="input"&&W.type==="file")var nt=Ar;else if(Tr(W))if(su)nt=sd;else{nt=ad;var Te=cu}else Q=W.nodeName,!Q||Q.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?P&&ri(P.elementType)&&(nt=Ar):nt=rd;if(nt&&(nt=nt(t,P))){ru(re,nt,a,ie);break e}Te&&Te(t,W,P),t==="focusout"&&P&&W.type==="number"&&P.memoizedProps.value!=null&&ps(W,"number",W.value)}switch(Te=P?nl(P):window,t){case"focusin":(Tr(Te)||Te.contentEditable==="true")&&(Wl=Te,Ms=P,Ga=null);break;case"focusout":Ga=Ms=Wl=null;break;case"mousedown":Rs=!0;break;case"contextmenu":case"mouseup":case"dragend":Rs=!1,mu(re,a,ie);break;case"selectionchange":if(ud)break;case"keydown":case"keyup":mu(re,a,ie)}var Ge;if(As)e:{switch(t){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Fl?cn(t,a)&&(Ze="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Ze="onCompositionStart");Ze&&(Pl&&a.locale!=="ko"&&(Fl||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Fl&&(Ge=vr()):(Pn=ie,br="value"in Pn?Pn.value:Pn.textContent,Fl=!0)),Te=lc(P,Ze),0<Te.length&&(Ze=new sl(Ze,t,null,a,ie),re.push({event:Ze,listeners:Te}),Ge?Ze.data=Ge:(Ge=lu(a),Ge!==null&&(Ze.data=Ge)))),(Ge=ul?Cr(t,a):ld(t,a))&&(Ze=lc(P,"onBeforeInput"),0<Ze.length&&(Te=new sl("onBeforeInput","beforeinput",null,a,ie),re.push({event:Te,listeners:Ze}),Te.data=Ge)),$w(re,t,P,a,ie)}zg(re,n)})}function oo(t,n,a){return{instance:t,listener:n,currentTarget:a}}function lc(t,n){for(var a=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Bi(t,a),f!=null&&o.unshift(oo(t,f,h)),f=Bi(t,n),f!=null&&o.push(oo(t,f,h))),t.tag===3)return o;t=t.return}return[]}function Pw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ig(t,n,a,o,f){for(var h=n._reactName,v=[];a!==null&&a!==o;){var T=a,I=T.alternate,P=T.stateNode;if(T=T.tag,I!==null&&I===o)break;T!==5&&T!==26&&T!==27||P===null||(I=P,f?(P=Bi(a,h),P!=null&&v.unshift(oo(a,P,I))):f||(P=Bi(a,h),P!=null&&v.push(oo(a,P,I)))),a=a.return}v.length!==0&&t.push({event:n,listeners:v})}var Fw=/\r\n?/g,Ww=/\u0000|\uFFFD/g;function Ug(t){return(typeof t=="string"?t:""+t).replace(Fw,`
50
- `).replace(Ww,"")}function Bg(t,n){return n=Ug(n),Ug(t)===n}function ft(t,n,a,o,f,h){switch(a){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Ii(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Ii(t,""+o);break;case"className":ii(t,"class",o);break;case"tabIndex":ii(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ii(t,a,o);break;case"style":Vn(t,o,h);break;case"data":if(n!=="object"){ii(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||a!=="href")){t.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=ql(""+o),t.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(a==="formAction"?(n!=="input"&&ft(t,n,"name",f.name,f,null),ft(t,n,"formEncType",f.formEncType,f,null),ft(t,n,"formMethod",f.formMethod,f,null),ft(t,n,"formTarget",f.formTarget,f,null)):(ft(t,n,"encType",f.encType,f,null),ft(t,n,"method",f.method,f,null),ft(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=ql(""+o),t.setAttribute(a,o);break;case"onClick":o!=null&&(t.onclick=Yn);break;case"onScroll":o!=null&&Fe("scroll",t);break;case"onScrollEnd":o!=null&&Fe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=a}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}a=ql(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""+o):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":o===!0?t.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,o):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(a,o):t.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(a):t.setAttribute(a,o);break;case"popover":Fe("beforetoggle",t),Fe("toggle",t),$n(t,"popover",o);break;case"xlinkActuate":wi(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":wi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":wi(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":wi(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":wi(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":wi(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":wi(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":wi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":wi(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":$n(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=hs.get(a)||a,$n(t,a,o))}}function kf(t,n,a,o,f,h){switch(a){case"style":Vn(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=a}}break;case"children":typeof o=="string"?Ii(t,o):(typeof o=="number"||typeof o=="bigint")&&Ii(t,""+o);break;case"onScroll":o!=null&&Fe("scroll",t);break;case"onScrollEnd":o!=null&&Fe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Yn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),n=a.slice(2,f?a.length-7:void 0),h=t[Nt]||null,h=h!=null?h[a]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(n,o,f);break e}a in t?t[a]=o:o===!0?t.setAttribute(a,""):$n(t,a,o)}}}function an(t,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",t),Fe("load",t);var o=!1,f=!1,h;for(h in a)if(a.hasOwnProperty(h)){var v=a[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,h,v,a,null)}}f&&ft(t,n,"srcSet",a.srcSet,a,null),o&&ft(t,n,"src",a.src,a,null);return;case"input":Fe("invalid",t);var T=h=v=f=null,I=null,P=null;for(o in a)if(a.hasOwnProperty(o)){var ie=a[o];if(ie!=null)switch(o){case"name":f=ie;break;case"type":v=ie;break;case"checked":I=ie;break;case"defaultChecked":P=ie;break;case"value":h=ie;break;case"defaultValue":T=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,n));break;default:ft(t,n,o,ie,a,null)}}Ul(t,h,T,I,P,v,f,!1);return;case"select":Fe("invalid",t),o=v=h=null;for(f in a)if(a.hasOwnProperty(f)&&(T=a[f],T!=null))switch(f){case"value":h=T;break;case"defaultValue":v=T;break;case"multiple":o=T;default:ft(t,n,f,T,a,null)}n=h,a=v,t.multiple=!!o,n!=null?ki(t,!!o,n,!1):a!=null&&ki(t,!!o,a,!0);return;case"textarea":Fe("invalid",t),h=f=o=null;for(v in a)if(a.hasOwnProperty(v)&&(T=a[v],T!=null))switch(v){case"value":o=T;break;case"defaultValue":f=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:ft(t,n,v,T,a,null)}yr(t,o,f,h);return;case"option":for(I in a)if(a.hasOwnProperty(I)&&(o=a[I],o!=null))switch(I){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ft(t,n,I,o,a,null)}return;case"dialog":Fe("beforetoggle",t),Fe("toggle",t),Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":Fe("load",t);break;case"video":case"audio":for(o=0;o<so.length;o++)Fe(so[o],t);break;case"image":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"embed":case"source":case"link":Fe("error",t),Fe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in a)if(a.hasOwnProperty(P)&&(o=a[P],o!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,P,o,a,null)}return;default:if(ri(n)){for(ie in a)a.hasOwnProperty(ie)&&(o=a[ie],o!==void 0&&kf(t,n,ie,o,a,void 0));return}}for(T in a)a.hasOwnProperty(T)&&(o=a[T],o!=null&&ft(t,n,T,o,a,null))}function Kw(t,n,a,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,T=null,I=null,P=null,ie=null;for(Q in a){var re=a[Q];if(a.hasOwnProperty(Q)&&re!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":I=re;default:o.hasOwnProperty(Q)||ft(t,n,Q,null,o,re)}}for(var W in o){var Q=o[W];if(re=a[W],o.hasOwnProperty(W)&&(Q!=null||re!=null))switch(W){case"type":h=Q;break;case"name":f=Q;break;case"checked":P=Q;break;case"defaultChecked":ie=Q;break;case"value":v=Q;break;case"defaultValue":T=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,n));break;default:Q!==re&&ft(t,n,W,Q,o,re)}}gr(t,v,T,I,P,ie,h,f);return;case"select":Q=v=T=W=null;for(h in a)if(I=a[h],a.hasOwnProperty(h)&&I!=null)switch(h){case"value":break;case"multiple":Q=I;default:o.hasOwnProperty(h)||ft(t,n,h,null,o,I)}for(f in o)if(h=o[f],I=a[f],o.hasOwnProperty(f)&&(h!=null||I!=null))switch(f){case"value":W=h;break;case"defaultValue":T=h;break;case"multiple":v=h;default:h!==I&&ft(t,n,f,h,o,I)}n=T,a=v,o=Q,W!=null?ki(t,!!a,W,!1):!!o!=!!a&&(n!=null?ki(t,!!a,n,!0):ki(t,!!a,a?[]:"",!1));return;case"textarea":Q=W=null;for(T in a)if(f=a[T],a.hasOwnProperty(T)&&f!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ft(t,n,T,null,o,f)}for(v in o)if(f=o[v],h=a[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":W=f;break;case"defaultValue":Q=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&ft(t,n,v,f,o,h)}Bl(t,W,Q);return;case"option":for(var ve in a)if(W=a[ve],a.hasOwnProperty(ve)&&W!=null&&!o.hasOwnProperty(ve))switch(ve){case"selected":t.selected=!1;break;default:ft(t,n,ve,null,o,W)}for(I in o)if(W=o[I],Q=a[I],o.hasOwnProperty(I)&&W!==Q&&(W!=null||Q!=null))switch(I){case"selected":t.selected=W&&typeof W!="function"&&typeof W!="symbol";break;default:ft(t,n,I,W,o,Q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in a)W=a[Oe],a.hasOwnProperty(Oe)&&W!=null&&!o.hasOwnProperty(Oe)&&ft(t,n,Oe,null,o,W);for(P in o)if(W=o[P],Q=a[P],o.hasOwnProperty(P)&&W!==Q&&(W!=null||Q!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,n));break;default:ft(t,n,P,W,o,Q)}return;default:if(ri(n)){for(var pt in a)W=a[pt],a.hasOwnProperty(pt)&&W!==void 0&&!o.hasOwnProperty(pt)&&kf(t,n,pt,void 0,o,W);for(ie in o)W=o[ie],Q=a[ie],!o.hasOwnProperty(ie)||W===Q||W===void 0&&Q===void 0||kf(t,n,ie,W,o,Q);return}}for(var $ in a)W=a[$],a.hasOwnProperty($)&&W!=null&&!o.hasOwnProperty($)&&ft(t,n,$,null,o,W);for(re in o)W=o[re],Q=a[re],!o.hasOwnProperty(re)||W===Q||W==null&&Q==null||ft(t,n,re,W,o,Q)}function qg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var f=a[o],h=f.transferSize,v=f.initiatorType,T=f.duration;if(h&&T&&qg(v)){for(v=0,T=f.responseEnd,o+=1;o<a.length;o++){var I=a[o],P=I.startTime;if(P>T)break;var ie=I.transferSize,re=I.initiatorType;ie&&qg(re)&&(I=I.responseEnd,v+=ie*(I<T?1:(T-P)/(I-P)))}if(--o,n+=8*(h+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Sf=null,jf=null;function ac(t){return t.nodeType===9?t:t.ownerDocument}function Hg(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 $g(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 Cf(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 Tf=null;function Qw(){var t=window.event;return t&&t.type==="popstate"?t===Tf?!1:(Tf=t,!0):(Tf=null,!1)}var Gg=typeof setTimeout=="function"?setTimeout:void 0,Zw=typeof clearTimeout=="function"?clearTimeout:void 0,Vg=typeof Promise=="function"?Promise:void 0,Jw=typeof queueMicrotask=="function"?queueMicrotask:typeof Vg<"u"?function(t){return Vg.resolve(null).then(t).catch(ek)}:Gg;function ek(t){setTimeout(function(){throw t})}function ga(t){return t==="head"}function Yg(t,n){var a=n,o=0;do{var f=a.nextSibling;if(t.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(o===0){t.removeChild(f),es(n);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")uo(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,uo(a);for(var h=a.firstChild;h;){var v=h.nextSibling,T=h.nodeName;h[bi]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=v}}else a==="body"&&uo(t.ownerDocument.body);a=f}while(a);es(n)}function Pg(t,n){var a=t;t=0;do{var o=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=o}while(a)}function Ef(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Ef(a),Da(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function tk(t,n,a,o){for(;t.nodeType===1;){var f=a;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[bi])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=fi(t.nextSibling),t===null)break}return null}function nk(t,n,a){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=fi(t.nextSibling),t===null))return null;return t}function Fg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=fi(t.nextSibling),t===null))return null;return t}function Af(t){return t.data==="$?"||t.data==="$~"}function Nf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ik(t,n){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||a.readyState!=="loading")n();else{var o=function(){n(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function fi(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 _f=null;function Wg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(n===0)return fi(t.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}t=t.nextSibling}return null}function Kg(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return t;n--}else a!=="/$"&&a!=="/&"||n++}t=t.previousSibling}return null}function Xg(t,n,a){switch(n=ac(a),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 uo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Da(t)}var pi=new Map,Qg=new Set;function rc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Nl=oe.d;oe.d={f:lk,r:ak,D:rk,C:sk,L:ok,m:uk,X:dk,S:ck,M:fk};function lk(){var t=Nl.f(),n=Qu();return t||n}function ak(t){var n=zi(t);n!==null&&n.tag===5&&n.type==="form"?hm(n):Nl.r(t)}var Qr=typeof document>"u"?null:document;function Zg(t,n,a){var o=Qr;if(o&&typeof n=="string"&&n){var f=Wt(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),Qg.has(f)||(Qg.add(f),t={rel:t,crossOrigin:a,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),an(n,"link",t),_t(n),o.head.appendChild(n)))}}function rk(t){Nl.D(t),Zg("dns-prefetch",t,null)}function sk(t,n){Nl.C(t,n),Zg("preconnect",t,n)}function ok(t,n,a){Nl.L(t,n,a);var o=Qr;if(o&&t&&n){var f='link[rel="preload"][as="'+Wt(n)+'"]';n==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+Wt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+Wt(a.imageSizes)+'"]')):f+='[href="'+Wt(t)+'"]';var h=f;switch(n){case"style":h=Zr(t);break;case"script":h=Jr(t)}pi.has(h)||(t=x({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:t,as:n},a),pi.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(co(h))||n==="script"&&o.querySelector(fo(h))||(n=o.createElement("link"),an(n,"link",t),_t(n),o.head.appendChild(n)))}}function uk(t,n){Nl.m(t,n);var a=Qr;if(a&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Wt(o)+'"][href="'+Wt(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Jr(t)}if(!pi.has(h)&&(t=x({rel:"modulepreload",href:t},n),pi.set(h,t),a.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fo(h)))return}o=a.createElement("link"),an(o,"link",t),_t(o),a.head.appendChild(o)}}}function ck(t,n,a){Nl.S(t,n,a);var o=Qr;if(o&&t){var f=zl(o).hoistableStyles,h=Zr(t);n=n||"default";var v=f.get(h);if(!v){var T={loading:0,preload:null};if(v=o.querySelector(co(h)))T.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},a),(a=pi.get(h))&&Df(t,a);var I=v=o.createElement("link");_t(I),an(I,"link",t),I._p=new Promise(function(P,ie){I.onload=P,I.onerror=ie}),I.addEventListener("load",function(){T.loading|=1}),I.addEventListener("error",function(){T.loading|=2}),T.loading|=4,sc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:T},f.set(h,v)}}}function dk(t,n){Nl.X(t,n);var a=Qr;if(a&&t){var o=zl(a).hoistableScripts,f=Jr(t),h=o.get(f);h||(h=a.querySelector(fo(f)),h||(t=x({src:t,async:!0},n),(n=pi.get(f))&&Mf(t,n),h=a.createElement("script"),_t(h),an(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function fk(t,n){Nl.M(t,n);var a=Qr;if(a&&t){var o=zl(a).hoistableScripts,f=Jr(t),h=o.get(f);h||(h=a.querySelector(fo(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=pi.get(f))&&Mf(t,n),h=a.createElement("script"),_t(h),an(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Jg(t,n,a,o){var f=(f=Z.current)?rc(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=Zr(a.href),a=zl(f).hoistableStyles,o=a.get(n),o||(o={type:"style",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Zr(a.href);var h=zl(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(co(t)))&&!h._p&&(v.instance=h,v.state.loading=5),pi.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},pi.set(t,a),h||pk(f,t,a,v.state))),n&&o===null)throw Error(r(528,""));return v}if(n&&o!==null)throw Error(r(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Jr(a),a=zl(f).hoistableScripts,o=a.get(n),o||(o={type:"script",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Zr(t){return'href="'+Wt(t)+'"'}function co(t){return'link[rel="stylesheet"]['+t+"]"}function ey(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function pk(t,n,a,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),an(n,"link",a),_t(n),t.head.appendChild(n))}function Jr(t){return'[src="'+Wt(t)+'"]'}function fo(t){return"script[async]"+t}function ty(t,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Wt(a.href)+'"]');if(o)return n.instance=o,_t(o),o;var f=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),_t(o),an(o,"style",f),sc(o,a.precedence,t),n.instance=o;case"stylesheet":f=Zr(a.href);var h=t.querySelector(co(f));if(h)return n.state.loading|=4,n.instance=h,_t(h),h;o=ey(a),(f=pi.get(f))&&Df(o,f),h=(t.ownerDocument||t).createElement("link"),_t(h);var v=h;return v._p=new Promise(function(T,I){v.onload=T,v.onerror=I}),an(h,"link",o),n.state.loading|=4,sc(h,a.precedence,t),n.instance=h;case"script":return h=Jr(a.src),(f=t.querySelector(fo(h)))?(n.instance=f,_t(f),f):(o=a,(f=pi.get(h))&&(o=x({},a),Mf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),_t(f),an(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,sc(o,a.precedence,t));return n.instance}function sc(t,n,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,v=0;v<o.length;v++){var T=o[v];if(T.dataset.precedence===n)h=T;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(t,n.firstChild))}function Df(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Mf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var oc=null;function ny(t,n,a){if(oc===null){var o=new Map,f=oc=new Map;f.set(a,o)}else f=oc,o=f.get(a),o||(o=new Map,f.set(a,o));if(o.has(t))return o;for(o.set(t,null),a=a.getElementsByTagName(t),f=0;f<a.length;f++){var h=a[f];if(!(h[bi]||h[bt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var T=o.get(v);T?T.push(h):o.set(v,[h])}}return o}function iy(t,n,a){t=t.ownerDocument||t,t.head.insertBefore(a,n==="title"?t.querySelector("head > title"):null)}function hk(t,n,a){if(a===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 ly(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function mk(t,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=Zr(o.href),h=n.querySelector(co(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=uc.bind(t),n.then(t,t)),a.state.loading|=4,a.instance=h,_t(h);return}h=n.ownerDocument||n,o=ey(o),(f=pi.get(f))&&Df(o,f),h=h.createElement("link"),_t(h);var v=h;v._p=new Promise(function(T,I){v.onload=T,v.onerror=I}),an(h,"link",o),a.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=uc.bind(t),n.addEventListener("load",a),n.addEventListener("error",a))}}var Rf=0;function gk(t,n){return t.stylesheets&&t.count===0&&dc(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var o=setTimeout(function(){if(t.stylesheets&&dc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&Rf===0&&(Rf=62500*Xw());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&dc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>Rf?50:800)+n);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var cc=null;function dc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,cc=new Map,n.forEach(yk,t),cc=null,uc.call(t))}function yk(t,n){if(!(n.state.loading&4)){var a=cc.get(t);if(a)var o=a.get(null);else{a=new Map,cc.set(t,a);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var v=f[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(a.set(v.dataset.precedence,v),o=v)}o&&a.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=a.get(v)||o,h===o&&a.set(null,f),a.set(v,f),this.count++,o=uc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),h?h.parentNode.insertBefore(f,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var po={$$typeof:q,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function xk(t,n,a,o,f,h,v,T,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=tl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tl(0),this.hiddenUpdates=tl(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function ay(t,n,a,o,f,h,v,T,I,P,ie,re){return t=new xk(t,n,a,v,I,P,ie,re,T),n=1,h===!0&&(n|=24),h=xn(3,null,null,n),t.current=h,h.stateNode=t,n=M(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:a,cache:n},md(h),t}function ry(t){return t?(t=Ql,t):Ql}function sy(t,n,a,o,f,h){f=ry(f),o.context===null?o.context=f:o.pendingContext=f,o=aa(n),o.payload={element:a},h=h===void 0?null:h,h!==null&&(o.callback=h),a=ra(t,o,n),a!==null&&(Ln(a,t,n),Vs(a,t,n))}function oy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<n?a:n}}function Of(t,n){oy(t,n),(t=t.alternate)&&oy(t,n)}function uy(t){if(t.tag===13||t.tag===31){var n=Yi(t,67108864);n!==null&&Ln(n,t,67108864),Of(t,67108864)}}function cy(t){if(t.tag===13||t.tag===31){var n=ei();n=fr(n);var a=Yi(t,n);a!==null&&Ln(a,t,n),Of(t,n)}}var fc=!0;function bk(t,n,a,o){var f=G.T;G.T=null;var h=oe.p;try{oe.p=2,zf(t,n,a,o)}finally{oe.p=h,G.T=f}}function vk(t,n,a,o){var f=G.T;G.T=null;var h=oe.p;try{oe.p=8,zf(t,n,a,o)}finally{oe.p=h,G.T=f}}function zf(t,n,a,o){if(fc){var f=Lf(o);if(f===null)wf(t,n,o,pc,a),fy(t,o);else if(kk(f,t,n,a,o))o.stopPropagation();else if(fy(t,o),n&4&&-1<wk.indexOf(t)){for(;f!==null;){var h=zi(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=Vt(h.pendingLanes);if(v!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;v;){var I=1<<31-rt(v);T.entanglements[1]|=I,v&=~I}Ki(h),(at&6)===0&&(Ku=Lt()+500,ro(0))}}break;case 31:case 13:T=Yi(h,2),T!==null&&Ln(T,h,2),Qu(),Of(h,2)}if(h=Lf(o),h===null&&wf(t,n,o,pc,a),h===f)break;f=h}f!==null&&o.stopPropagation()}else wf(t,n,o,null,a)}}function Lf(t){return t=Oa(t),If(t)}var pc=null;function If(t){if(pc=null,t=Oi(t),t!==null){var n=c(t);if(n===null)t=null;else{var a=n.tag;if(a===13){if(t=d(n),t!==null)return t;t=null}else if(a===31){if(t=p(n),t!==null)return t;t=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return pc=t,null}function dy(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(Ml()){case ne:return 2;case he:return 8;case Me:case Ae:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Uf=!1,ya=null,xa=null,ba=null,ho=new Map,mo=new Map,va=[],wk="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 fy(t,n){switch(t){case"focusin":case"focusout":ya=null;break;case"dragenter":case"dragleave":xa=null;break;case"mouseover":case"mouseout":ba=null;break;case"pointerover":case"pointerout":ho.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":mo.delete(n.pointerId)}}function go(t,n,a,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:a,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=zi(n),n!==null&&uy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function kk(t,n,a,o,f){switch(n){case"focusin":return ya=go(ya,t,n,a,o,f),!0;case"dragenter":return xa=go(xa,t,n,a,o,f),!0;case"mouseover":return ba=go(ba,t,n,a,o,f),!0;case"pointerover":var h=f.pointerId;return ho.set(h,go(ho.get(h)||null,t,n,a,o,f)),!0;case"gotpointercapture":return h=f.pointerId,mo.set(h,go(mo.get(h)||null,t,n,a,o,f)),!0}return!1}function py(t){var n=Oi(t.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=d(a),n!==null){t.blockedOn=n,Xo(t.priority,function(){cy(a)});return}}else if(n===31){if(n=p(a),n!==null){t.blockedOn=n,Xo(t.priority,function(){cy(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function hc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var a=Lf(t.nativeEvent);if(a===null){a=t.nativeEvent;var o=new a.constructor(a.type,a);ms=o,a.target.dispatchEvent(o),ms=null}else return n=zi(a),n!==null&&uy(n),t.blockedOn=a,!1;n.shift()}return!0}function hy(t,n,a){hc(t)&&a.delete(n)}function Sk(){Uf=!1,ya!==null&&hc(ya)&&(ya=null),xa!==null&&hc(xa)&&(xa=null),ba!==null&&hc(ba)&&(ba=null),ho.forEach(hy),mo.forEach(hy)}function mc(t,n){t.blockedOn===n&&(t.blockedOn=null,Uf||(Uf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Sk)))}var gc=null;function my(t){gc!==t&&(gc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gc===t&&(gc=null);for(var n=0;n<t.length;n+=3){var a=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(If(o||a)===null)continue;break}var h=zi(a);h!==null&&(t.splice(n,3),n-=3,zd(h,{pending:!0,data:f,method:a.method,action:o},o,f))}}))}function es(t){function n(I){return mc(I,t)}ya!==null&&mc(ya,t),xa!==null&&mc(xa,t),ba!==null&&mc(ba,t),ho.forEach(n),mo.forEach(n);for(var a=0;a<va.length;a++){var o=va[a];o.blockedOn===t&&(o.blockedOn=null)}for(;0<va.length&&(a=va[0],a.blockedOn===null);)py(a),a.blockedOn===null&&va.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var f=a[o],h=a[o+1],v=f[Nt]||null;if(typeof h=="function")v||my(a);else if(v){var T=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[Nt]||null)T=v.formAction;else if(If(f)!==null)continue}else T=v.action;typeof T=="function"?a[o+1]=T:(a.splice(o,3),o-=3),my(a)}}}function gy(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Bf(t){this._internalRoot=t}yc.prototype.render=Bf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,o=ei();sy(a,o,t,n,null,null)},yc.prototype.unmount=Bf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;sy(t.current,2,null,t,null,null),Qu(),n[Hn]=null}};function yc(t){this._internalRoot=t}yc.prototype.unstable_scheduleHydration=function(t){if(t){var n=pr();t={blockedOn:null,target:t,priority:n};for(var a=0;a<va.length&&n!==0&&n<va[a].priority;a++);va.splice(a,0,t),a===0&&py(t)}};var yy=i.version;if(yy!=="19.2.7")throw Error(r(527,yy,"19.2.7"));oe.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=m(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var jk={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xc.isDisabled&&xc.supportsFiber)try{tt=xc.inject(jk),St=xc}catch{}}return xo.createRoot=function(t,n){if(!u(t))throw Error(r(299));var a=!1,o="",f=jm,h=Cm,v=Tm;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=ay(t,1,!1,null,null,a,o,null,f,h,v,gy),t[Hn]=n.current,vf(t),new Bf(n)},xo.hydrateRoot=function(t,n,a){if(!u(t))throw Error(r(299));var o=!1,f="",h=jm,v=Cm,T=Tm,I=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError),a.formState!==void 0&&(I=a.formState)),n=ay(t,1,!0,n,a??null,o,f,I,h,v,T,gy),n.context=ry(null),a=n.current,o=ei(),o=fr(o),f=aa(o),f.callback=null,ra(a,f,o),a=o,n.current.lanes=a,Ol(n,a),Ki(n),t[Hn]=n.current,vf(t),new yc(n)},xo.version="19.2.7",xo}var Ay;function Uk(){if(Ay)return $f.exports;Ay=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(),$f.exports=Ik(),$f.exports}var Bk=Uk();function qk(e,i){const l=i||{};return(e[e.length-1]===""?[...e,""]:e).join((l.padRight?" ":"")+","+(l.padLeft===!1?"":" ")).trim()}const Hk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$k=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gk={};function Ny(e,i){return(Gk.jsx?$k:Hk).test(e)}const Vk=/[ \t\n\f\r]/g;function Yk(e){return typeof e=="object"?e.type==="text"?_y(e.value):!1:_y(e)}function _y(e){return e.replace(Vk,"")===""}class Vo{constructor(i,l,r){this.normal=l,this.property=i,r&&(this.space=r)}}Vo.prototype.normal={};Vo.prototype.property={};Vo.prototype.space=void 0;function cb(e,i){const l={},r={};for(const u of e)Object.assign(l,u.property),Object.assign(r,u.normal);return new Vo(l,r,i)}function Dp(e){return e.toLowerCase()}class Bn{constructor(i,l){this.attribute=l,this.property=i}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let Pk=0;const Be=dr(),Gt=dr(),Mp=dr(),de=dr(),gt=dr(),sr=dr(),ti=dr();function dr(){return 2**++Pk}const Rp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:Gt,commaOrSpaceSeparated:ti,commaSeparated:sr,number:de,overloadedBoolean:Mp,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),Pf=Object.keys(Rp);class th extends Bn{constructor(i,l,r,u){let c=-1;if(super(i,l),Dy(this,"space",u),typeof r=="number")for(;++c<Pf.length;){const d=Pf[c];Dy(this,Pf[c],(r&Rp[d])===Rp[d])}}}th.prototype.defined=!0;function Dy(e,i,l){l&&(e[i]=l)}function os(e){const i={},l={};for(const[r,u]of Object.entries(e.properties)){const c=new th(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,l[Dp(r)]=r,l[Dp(c.attribute)]=r}return new Vo(i,l,e.space)}const db=os({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:gt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:de,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:gt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Gt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function fb(e,i){return i in e?e[i]:i}function pb(e,i){return fb(e,i.toLowerCase())}const Fk=os({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:sr,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alpha:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:gt,autoFocus:Be,autoPlay:Be,blocking:gt,capture:null,charSet:null,checked:Be,cite:null,className:gt,closedBy:null,colorSpace:null,cols:de,colSpan:de,command:null,commandFor:null,content:null,contentEditable:Gt,controls:Be,controlsList:gt,coords:de|sr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:Mp,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:gt,height:de,hidden:Mp,high:de,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:gt,itemRef:gt,itemScope:Be,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,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:Be,optimum:de,pattern:null,ping:gt,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:gt,required:Be,reversed:Be,rows:de,rowSpan:de,sandbox:gt,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootCustomElementRegistry:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shadowRootSerializable:Be,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:Gt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Be,disablePictureInPicture:Be,disableRemotePlayback:Be,exportParts:sr,part:gt,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:pb}),Wk=os({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:ti,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:gt,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:sr,g2:sr,glyphName:sr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:ti,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ti,rev:ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ti,requiredFeatures:ti,requiredFonts:ti,requiredFormats:ti,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:ti,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ti,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ti,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fb}),hb=os({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()}}),mb=os({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pb}),gb=os({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),Kk={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"},Xk=/[A-Z]/g,My=/-[a-z]/g,Qk=/^data[-\w.:]+$/i;function Zk(e,i){const l=Dp(i);let r=i,u=Bn;if(l in e.normal)return e.property[e.normal[l]];if(l.length>4&&l.slice(0,4)==="data"&&Qk.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(My,eS);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!My.test(c)){let d=c.replace(Xk,Jk);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=th}return new u(r,i)}function Jk(e){return"-"+e.toLowerCase()}function eS(e){return e.charAt(1).toUpperCase()}const tS=cb([db,Fk,hb,mb,gb],"html"),nh=cb([db,Wk,hb,mb,gb],"svg");function nS(e){return e.join(" ").trim()}var ts={},Ff,Ry;function iS(){if(Ry)return Ff;Ry=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,l=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
51
- `,m="/",b="*",x="",k="comment",w="declaration";function E(U,_){if(typeof U!="string")throw new TypeError("First argument must be a string");if(!U)return[];_=_||{};var F=1,q=1;function Y(ge){var ue=ge.match(i);ue&&(F+=ue.length);var G=ge.lastIndexOf(g);q=~G?ge.length-G:q+ge.length}function se(){var ge={line:F,column:q};return function(ue){return ue.position=new N(ge),ee(),ue}}function N(ge){this.start=ge,this.end={line:F,column:q},this.source=_.source}N.prototype.content=U;function X(ge){var ue=new Error(_.source+":"+F+":"+q+": "+ge);if(ue.reason=ge,ue.filename=_.source,ue.line=F,ue.column=q,ue.source=U,!_.silent)throw ue}function ae(ge){var ue=ge.exec(U);if(ue){var G=ue[0];return Y(G),U=U.slice(G.length),ue}}function ee(){ae(l)}function L(ge){var ue;for(ge=ge||[];ue=te();)ue!==!1&&ge.push(ue);return ge}function te(){var ge=se();if(!(m!=U.charAt(0)||b!=U.charAt(1))){for(var ue=2;x!=U.charAt(ue)&&(b!=U.charAt(ue)||m!=U.charAt(ue+1));)++ue;if(ue+=2,x===U.charAt(ue-1))return X("End of comment missing");var G=U.slice(2,ue-2);return q+=2,Y(G),U=U.slice(ue),q+=2,ge({type:k,comment:G})}}function ce(){var ge=se(),ue=ae(r);if(ue){if(te(),!ae(u))return X("property missing ':'");var G=ae(c),oe=ge({type:w,property:O(ue[0].replace(e,x)),value:G?O(G[0].replace(e,x)):x});return ae(d),oe}}function Ee(){var ge=[];L(ge);for(var ue;ue=ce();)ue!==!1&&(ge.push(ue),L(ge));return ge}return ee(),Ee()}function O(U){return U?U.replace(p,x):x}return Ff=E,Ff}var Oy;function lS(){if(Oy)return ts;Oy=1;var e=ts&&ts.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ts,"__esModule",{value:!0}),ts.default=l;const i=e(iS());function l(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return ts}var bo={},zy;function aS(){if(zy)return bo;zy=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,l=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(m){return!m||l.test(m)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=function(m,b){return"".concat(b,"-")},g=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(u,p):m=m.replace(r,p),m.replace(i,d))};return bo.camelCase=g,bo}var vo,Ly;function rS(){if(Ly)return vo;Ly=1;var e=vo&&vo.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(lS()),l=aS();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,g){p&&g&&(d[(0,l.camelCase)(p,c)]=g)}),d}return r.default=r,vo=r,vo}var sS=rS();const oS=ub(sS),yb=xb("end"),ih=xb("start");function xb(e){return i;function i(l){const r=l&&l.position&&l.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 uS(e){const i=ih(e),l=yb(e);if(i&&l)return{start:i,end:l}}function Oo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Iy(e.position):"start"in e||"end"in e?Iy(e):"line"in e||"column"in e?Op(e):""}function Op(e){return Uy(e&&e.line)+":"+Uy(e&&e.column)}function Iy(e){return Op(e&&e.start)+"-"+Op(e&&e.end)}function Uy(e){return e&&typeof e=="number"?e:1}class hn extends Error{constructor(i,l,r){super(),typeof l=="string"&&(r=l,l=void 0);let u="",c={},d=!1;if(l&&("line"in l&&"column"in l?c={place:l}:"start"in l&&"end"in l?c={place:l}:"type"in l?c={ancestors:[l],place:l.position}:c={...l}),typeof i=="string"?u=i:!c.cause&&i&&(d=!0,u=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?c.ruleId=r:(c.source=r.slice(0,g),c.ruleId=r.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const p=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=p?p.line:void 0,this.name=Oo(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}hn.prototype.file="";hn.prototype.name="";hn.prototype.reason="";hn.prototype.message="";hn.prototype.stack="";hn.prototype.column=void 0;hn.prototype.line=void 0;hn.prototype.ancestors=void 0;hn.prototype.cause=void 0;hn.prototype.fatal=void 0;hn.prototype.place=void 0;hn.prototype.ruleId=void 0;hn.prototype.source=void 0;const lh={}.hasOwnProperty,cS=new Map,dS=/[A-Z]/g,fS=new Set(["table","tbody","thead","tfoot","tr"]),pS=new Set(["td","th"]),bb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hS(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const l=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=kS(l,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=wS(l,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:l,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?nh:tS,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=vb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function vb(e,i,l){if(i.type==="element")return mS(e,i,l);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return gS(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return xS(e,i,l);if(i.type==="mdxjsEsm")return yS(e,i);if(i.type==="root")return bS(e,i,l);if(i.type==="text")return vS(e,i)}function mS(e,i,l){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=nh,e.schema=u),e.ancestors.push(i);const c=kb(e,i.tagName,!1),d=SS(e,i);let p=rh(e,i);return fS.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!Yk(g):!0})),wb(e,d,c,i),ah(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,l)}function gS(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)}$o(e,i.position)}function yS(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);$o(e,i.position)}function xS(e,i,l){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=nh,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:kb(e,i.name,!0),d=jS(e,i),p=rh(e,i);return wb(e,d,c,i),ah(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,l)}function bS(e,i,l){const r={};return ah(r,rh(e,i)),e.create(i,e.Fragment,r,l)}function vS(e,i){return i.value}function wb(e,i,l,r){typeof l!="string"&&l!==e.Fragment&&e.passNode&&(i.node=r)}function ah(e,i){if(i.length>0){const l=i.length>1?i:i[0];l&&(e.children=l)}}function wS(e,i,l){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?l:i;return p?m(c,d,p):m(c,d)}}function kS(e,i){return l;function l(r,u,c,d){const p=Array.isArray(c.children),g=ih(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function SS(e,i){const l={};let r,u;for(u in i.properties)if(u!=="children"&&lh.call(i.properties,u)){const c=CS(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&pS.has(i.tagName)?r=p:l[d]=p}}if(r){const c=l.style||(l.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return l}function jS(e,i){const l={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const p=d.properties[0];p.type,Object.assign(l,e.evaluater.evaluateExpression(p.argument))}else $o(e,i.position);else{const u=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const p=r.value.data.estree.body[0];p.type,c=e.evaluater.evaluateExpression(p.expression)}else $o(e,i.position);else c=r.value===null?!0:r.value;l[u]=c}return l}function rh(e,i){const l=[];let r=-1;const u=e.passKeys?new Map:cS;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.passKeys){const g=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(g){const m=u.get(g)||0;d=g+"-"+m,u.set(g,m+1)}}const p=vb(e,c,d);p!==void 0&&l.push(p)}return l}function CS(e,i,l){const r=Zk(e.schema,i);if(!(l==null||typeof l=="number"&&Number.isNaN(l))){if(Array.isArray(l)&&(l=r.commaSeparated?qk(l):nS(l)),r.property==="style"){let u=typeof l=="object"?l:TS(e,String(l));return e.stylePropertyNameCase==="css"&&(u=ES(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?Kk[r.property]||r.property:r.attribute,l]}}function TS(e,i){try{return oS(i,{reactCompat:!0})}catch(l){if(e.ignoreInvalidStyle)return{};const r=l,u=new hn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=e.filePath||void 0,u.url=bb+"#cannot-parse-style-attribute",u}}function kb(e,i,l){let r;if(!l)r={type:"Literal",value:i};else if(i.includes(".")){const u=i.split(".");let c=-1,d;for(;++c<u.length;){const p=Ny(u[c])?{type:"Identifier",name:u[c]}:{type:"Literal",value:u[c]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(c&&p.type==="Literal"),optional:!1}:p}r=d}else r=Ny(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return lh.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);$o(e)}function $o(e,i){const l=new hn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=bb+"#cannot-handle-mdx-estrees-without-createevaluater",l}function ES(e){const i={};let l;for(l in e)lh.call(e,l)&&(i[AS(l)]=e[l]);return i}function AS(e){let i=e.replace(dS,NS);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function NS(e){return"-"+e.toLowerCase()}const Wf={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"]},_S={};function sh(e,i){const l=_S,r=typeof l.includeImageAlt=="boolean"?l.includeImageAlt:!0,u=typeof l.includeHtml=="boolean"?l.includeHtml:!0;return Sb(e,r,u)}function Sb(e,i,l){if(DS(e)){if("value"in e)return e.type==="html"&&!l?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return By(e.children,i,l)}return Array.isArray(e)?By(e,i,l):""}function By(e,i,l){const r=[];let u=-1;for(;++u<e.length;)r[u]=Sb(e[u],i,l);return r.join("")}function DS(e){return!!(e&&typeof e=="object")}const qy=document.createElement("i");function oh(e){const i="&"+e+";";qy.innerHTML=i;const l=qy.textContent;return l.charCodeAt(l.length-1)===59&&e!=="semi"||l===i?!1:l}function ni(e,i,l,r){const u=e.length;let c=0,d;if(i<0?i=-i>u?0:u+i:i=i>u?u:i,l=l>0?l:0,r.length<1e4)d=Array.from(r),d.unshift(i,l),e.splice(...d);else for(l&&e.splice(i,l);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function hi(e,i){return e.length>0?(ni(e,e.length,0,i),e):i}const Hy={}.hasOwnProperty;function jb(e){const i={};let l=-1;for(;++l<e.length;)MS(i,e[l]);return i}function MS(e,i){let l;for(l in i){const u=(Hy.call(e,l)?e[l]:void 0)||(e[l]={}),c=i[l];let d;if(c)for(d in c){Hy.call(u,d)||(u[d]=[]);const p=c[d];RS(u[d],Array.isArray(p)?p:p?[p]:[])}}}function RS(e,i){let l=-1;const r=[];for(;++l<i.length;)(i[l].add==="after"?e:r).push(i[l]);ni(e,0,0,r)}function Cb(e,i){const l=Number.parseInt(e,i);return l<9||l===11||l>13&&l<32||l>126&&l<160||l>55295&&l<57344||l>64975&&l<65008||(l&65535)===65535||(l&65535)===65534||l>1114111?"�":String.fromCodePoint(l)}function _i(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vn=Ta(/[A-Za-z]/),pn=Ta(/[\dA-Za-z]/),OS=Ta(/[#-'*+\--9=?A-Z^-~]/);function zc(e){return e!==null&&(e<32||e===127)}const zp=Ta(/\d/),zS=Ta(/[\dA-Fa-f]/),LS=Ta(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Gc=Ta(new RegExp("\\p{P}|\\p{S}","u")),or=Ta(/\s/);function Ta(e){return i;function i(l){return l!==null&&l>-1&&e.test(String.fromCharCode(l))}}function us(e){const i=[];let l=-1,r=0,u=0;for(;++l<e.length;){const c=e.charCodeAt(l);let d="";if(c===37&&pn(e.charCodeAt(l+1))&&pn(e.charCodeAt(l+2)))u=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const p=e.charCodeAt(l+1);c<56320&&p>56319&&p<57344?(d=String.fromCharCode(c,p),u=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(e.slice(r,l),encodeURIComponent(d)),r=l+u+1,d=""),u&&(l+=u,u=0)}return i.join("")+e.slice(r)}function et(e,i,l,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return Ke(g)?(e.enter(l),p(g)):i(g)}function p(g){return Ke(g)&&c++<u?(e.consume(g),p):(e.exit(l),i(g))}}const IS={tokenize:US};function US(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let l;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),et(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const g=e.enter("chunkText",{contentType:"text",previous:l});return l&&(l.next=g),l=g,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return Re(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const BS={tokenize:qS},$y={tokenize:HS};function qS(e){const i=this,l=[];let r=0,u,c,d;return p;function p(q){if(r<l.length){const Y=l[r];return i.containerState=Y[1],e.attempt(Y[0].continuation,g,m)(q)}return m(q)}function g(q){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&F();const Y=i.events.length;let se=Y,N;for(;se--;)if(i.events[se][0]==="exit"&&i.events[se][1].type==="chunkFlow"){N=i.events[se][1].end;break}_(r);let X=Y;for(;X<i.events.length;)i.events[X][1].end={...N},X++;return ni(i.events,se+1,0,i.events.slice(Y)),i.events.length=X,m(q)}return p(q)}function m(q){if(r===l.length){if(!u)return k(q);if(u.currentConstruct&&u.currentConstruct.concrete)return E(q);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check($y,b,x)(q)}function b(q){return u&&F(),_(r),k(q)}function x(q){return i.parser.lazy[i.now().line]=r!==l.length,d=i.now().offset,E(q)}function k(q){return i.containerState={},e.attempt($y,w,E)(q)}function w(q){return r++,l.push([i.currentConstruct,i.containerState]),k(q)}function E(q){if(q===null){u&&F(),_(0),e.consume(q);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),O(q)}function O(q){if(q===null){U(e.exit("chunkFlow"),!0),_(0),e.consume(q);return}return Re(q)?(e.consume(q),U(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume(q),O)}function U(q,Y){const se=i.sliceStream(q);if(Y&&se.push(null),q.previous=c,c&&(c.next=q),c=q,u.defineSkip(q.start),u.write(se),i.parser.lazy[q.start.line]){let N=u.events.length;for(;N--;)if(u.events[N][1].start.offset<d&&(!u.events[N][1].end||u.events[N][1].end.offset>d))return;const X=i.events.length;let ae=X,ee,L;for(;ae--;)if(i.events[ae][0]==="exit"&&i.events[ae][1].type==="chunkFlow"){if(ee){L=i.events[ae][1].end;break}ee=!0}for(_(r),N=X;N<i.events.length;)i.events[N][1].end={...L},N++;ni(i.events,ae+1,0,i.events.slice(X)),i.events.length=N}}function _(q){let Y=l.length;for(;Y-- >q;){const se=l[Y];i.containerState=se[1],se[0].exit.call(i,e)}l.length=q}function F(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function HS(e,i,l){return et(e,e.attempt(this.parser.constructs.document,i,l),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rs(e){if(e===null||yt(e)||or(e))return 1;if(Gc(e))return 2}function Vc(e,i,l){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,l),r.push(c))}return i}const Lp={name:"attention",resolveAll:$S,tokenize:GS};function $S(e,i){let l=-1,r,u,c,d,p,g,m,b;for(;++l<e.length;)if(e[l][0]==="enter"&&e[l][1].type==="attentionSequence"&&e[l][1]._close){for(r=l;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[l][1]).charCodeAt(0)){if((e[r][1]._close||e[l][1]._open)&&(e[l][1].end.offset-e[l][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[l][1].end.offset-e[l][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[l][1].end.offset-e[l][1].start.offset>1?2:1;const x={...e[r][1].end},k={...e[l][1].start};Gy(x,-g),Gy(k,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[l][1].start},end:k},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[l][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[l][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=hi(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=hi(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=hi(m,Vc(i.parser.constructs.insideSpan.null,e.slice(r+1,l),i)),m=hi(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[l][1].end.offset-e[l][1].start.offset?(b=2,m=hi(m,[["enter",e[l][1],i],["exit",e[l][1],i]])):b=0,ni(e,r-1,l-r+3,m),l=r+m.length-b-2;break}}for(l=-1;++l<e.length;)e[l][1].type==="attentionSequence"&&(e[l][1].type="data");return e}function GS(e,i){const l=this.parser.constructs.attentionMarkers.null,r=this.previous,u=rs(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=rs(g),x=!b||b===2&&u||l.includes(g),k=!u||u===2&&b||l.includes(r);return m._open=!!(c===42?x:x&&(u||!k)),m._close=!!(c===42?k:k&&(b||!x)),i(g)}}function Gy(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const VS={name:"autolink",tokenize:YS};function YS(e,i,l){let r=0;return u;function u(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(w){return vn(w)?(e.consume(w),d):w===64?l(w):m(w)}function d(w){return w===43||w===45||w===46||pn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||pn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||zc(w)?l(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):OS(w)?(e.consume(w),m):l(w)}function b(w){return pn(w)?x(w):l(w)}function x(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):k(w)}function k(w){if((w===45||pn(w))&&r++<63){const E=w===45?k:x;return e.consume(w),E}return l(w)}}const Yo={partial:!0,tokenize:PS};function PS(e,i,l){return r;function r(c){return Ke(c)?et(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Re(c)?i(c):l(c)}}const Tb={continuation:{tokenize:WS},exit:KS,name:"blockQuote",tokenize:FS};function FS(e,i,l){const r=this;return u;function u(d){if(d===62){const p=r.containerState;return p.open||(e.enter("blockQuote",{_container:!0}),p.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return l(d)}function c(d){return Ke(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function WS(e,i,l){const r=this;return u;function u(d){return Ke(d)?et(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(Tb,i,l)(d)}}function KS(e){e.exit("blockQuote")}const Eb={name:"characterEscape",tokenize:XS};function XS(e,i,l){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return LS(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):l(c)}}const Ab={name:"characterReference",tokenize:QS};function QS(e,i,l){const r=this;let u=0,c,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),g}function g(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=pn,b(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=zS,b):(e.enter("characterReferenceValue"),c=7,d=zp,b(x))}function b(x){if(x===59&&u){const k=e.exit("characterReferenceValue");return d===pn&&!oh(r.sliceSerialize(k))?l(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&u++<c?(e.consume(x),b):l(x)}}const Vy={partial:!0,tokenize:JS},Yy={concrete:!0,name:"codeFenced",tokenize:ZS};function ZS(e,i,l){const r=this,u={partial:!0,tokenize:se};let c=0,d=0,p;return g;function g(N){return m(N)}function m(N){const X=r.events[r.events.length-1];return c=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,p=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(N)}function b(N){return N===p?(d++,e.consume(N),b):d<3?l(N):(e.exit("codeFencedFenceSequence"),Ke(N)?et(e,x,"whitespace")(N):x(N))}function x(N){return N===null||Re(N)?(e.exit("codeFencedFence"),r.interrupt?i(N):e.check(Vy,O,Y)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),k(N))}function k(N){return N===null||Re(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(N)):Ke(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,w,"whitespace")(N)):N===96&&N===p?l(N):(e.consume(N),k)}function w(N){return N===null||Re(N)?x(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(N))}function E(N){return N===null||Re(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(N)):N===96&&N===p?l(N):(e.consume(N),E)}function O(N){return e.attempt(u,Y,U)(N)}function U(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),_}function _(N){return c>0&&Ke(N)?et(e,F,"linePrefix",c+1)(N):F(N)}function F(N){return N===null||Re(N)?e.check(Vy,O,Y)(N):(e.enter("codeFlowValue"),q(N))}function q(N){return N===null||Re(N)?(e.exit("codeFlowValue"),F(N)):(e.consume(N),q)}function Y(N){return e.exit("codeFenced"),i(N)}function se(N,X,ae){let ee=0;return L;function L(ue){return N.enter("lineEnding"),N.consume(ue),N.exit("lineEnding"),te}function te(ue){return N.enter("codeFencedFence"),Ke(ue)?et(N,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):ce(ue)}function ce(ue){return ue===p?(N.enter("codeFencedFenceSequence"),Ee(ue)):ae(ue)}function Ee(ue){return ue===p?(ee++,N.consume(ue),Ee):ee>=d?(N.exit("codeFencedFenceSequence"),Ke(ue)?et(N,ge,"whitespace")(ue):ge(ue)):ae(ue)}function ge(ue){return ue===null||Re(ue)?(N.exit("codeFencedFence"),X(ue)):ae(ue)}}}function JS(e,i,l){const r=this;return u;function u(d){return d===null?l(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?l(d):i(d)}}const Kf={name:"codeIndented",tokenize:t0},e0={partial:!0,tokenize:n0};function t0(e,i,l){const r=this;return u;function u(m){return e.enter("codeIndented"),et(e,c,"linePrefix",5)(m)}function c(m){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(m):l(m)}function d(m){return m===null?g(m):Re(m)?e.attempt(e0,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||Re(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function n0(e,i,l){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?l(d):Re(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):et(e,c,"linePrefix",5)(d)}function c(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):Re(d)?u(d):l(d)}}const i0={name:"codeText",previous:a0,resolve:l0,tokenize:r0};function l0(e){let i=e.length-4,l=3,r,u;if((e[l][1].type==="lineEnding"||e[l][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=l;++r<i;)if(e[r][1].type==="codeTextData"){e[l][1].type="codeTextPadding",e[i][1].type="codeTextPadding",l+=2,i-=2;break}}for(r=l-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 a0(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function r0(e,i,l){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),g(x))}function g(x){return x===null?l(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),g):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):Re(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||Re(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 s0{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,l){const r=l??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,l,r){const u=l||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&wo(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),wo(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),wo(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 l=this.left.splice(i,Number.POSITIVE_INFINITY);wo(this.right,l.reverse())}else{const l=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);wo(this.left,l.reverse())}}}function wo(e,i){let l=0;if(i.length<1e4)e.push(...i);else for(;l<i.length;)e.push(...i.slice(l,l+1e4)),l+=1e4}function Nb(e){const i={};let l=-1,r,u,c,d,p,g,m;const b=new s0(e);for(;++l<b.length;){for(;l in i;)l=i[l];if(r=b.get(l),l&&r[1].type==="chunkFlow"&&b.get(l-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,o0(b,l)),l=i[l],m=!0);else if(r[1]._container){for(c=l,u=void 0;c--;)if(d=b.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),d[1].type="lineEnding",u=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;u&&(r[1].end={...b.get(u)[1].start},p=b.slice(u,l),p.unshift(r),b.splice(u,l-u+1,p))}}return ni(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function o0(e,i){const l=e.get(i)[1],r=e.get(i)[2];let u=i-1;const c=[];let d=l._tokenizer;d||(d=r.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,g=[],m={};let b,x,k=-1,w=l,E=0,O=0;const U=[O];for(;w;){for(;e.get(++u)[1]!==w;);c.push(u),w._tokenizer||(b=r.sliceStream(w),w.next||b.push(null),x&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=w,w=w.next}for(w=l;++k<p.length;)p[k][0]==="exit"&&p[k-1][0]==="enter"&&p[k][1].type===p[k-1][1].type&&p[k][1].start.line!==p[k][1].end.line&&(O=k+1,U.push(O),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):U.pop(),k=U.length;k--;){const _=p.slice(U[k],U[k+1]),F=c.pop();g.push([F,F+_.length-1]),e.splice(F,2,_)}for(g.reverse(),k=-1;++k<g.length;)m[E+g[k][0]]=E+g[k][1],E+=g[k][1]-g[k][0]-1;return m}const u0={resolve:d0,tokenize:f0},c0={partial:!0,tokenize:p0};function d0(e){return Nb(e),e}function f0(e,i){let l;return r;function r(p){return e.enter("content"),l=e.enter("chunkContent",{contentType:"content"}),u(p)}function u(p){return p===null?c(p):Re(p)?e.check(c0,d,c)(p):(e.consume(p),u)}function c(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),l.next=e.enter("chunkContent",{contentType:"content",previous:l}),l=l.next,u}}function p0(e,i,l){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),et(e,c,"linePrefix")}function c(d){if(d===null||Re(d))return l(d);const p=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):e.interrupt(r.parser.constructs.flow,l,i)(d)}}function _b(e,i,l,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(_){return _===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(_),e.exit(c),k):_===null||_===32||_===41||zc(_)?l(_):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),O(_))}function k(_){return _===62?(e.enter(c),e.consume(_),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===62?(e.exit("chunkString"),e.exit(p),k(_)):_===null||_===60||Re(_)?l(_):(e.consume(_),_===92?E:w)}function E(_){return _===60||_===62||_===92?(e.consume(_),w):w(_)}function O(_){return!b&&(_===null||_===41||yt(_))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(_)):b<m&&_===40?(e.consume(_),b++,O):_===41?(e.consume(_),b--,O):_===null||_===32||_===40||zc(_)?l(_):(e.consume(_),_===92?U:O)}function U(_){return _===40||_===41||_===92?(e.consume(_),O):O(_)}}function Db(e,i,l,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?l(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):Re(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||w===91||w===93||Re(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!Ke(w)),w===92?k:x)}function k(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Mb(e,i,l,r,u,c){let d;return p;function p(k){return k===34||k===39||k===40?(e.enter(r),e.enter(u),e.consume(k),e.exit(u),d=k===40?41:k,g):l(k)}function g(k){return k===d?(e.enter(u),e.consume(k),e.exit(u),e.exit(r),i):(e.enter(c),m(k))}function m(k){return k===d?(e.exit(c),g(d)):k===null?l(k):Re(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),et(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===d||k===null||Re(k)?(e.exit("chunkString"),m(k)):(e.consume(k),k===92?x:b)}function x(k){return k===d||k===92?(e.consume(k),b):b(k)}}function zo(e,i){let l;return r;function r(u){return Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l=!0,r):Ke(u)?et(e,r,l?"linePrefix":"lineSuffix")(u):i(u)}}const h0={name:"definition",tokenize:g0},m0={partial:!0,tokenize:y0};function g0(e,i,l){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return Db.call(r,e,p,l,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=_i(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),g):l(w)}function g(w){return yt(w)?zo(e,m)(w):m(w)}function m(w){return _b(e,b,l,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(m0,x,x)(w)}function x(w){return Ke(w)?et(e,k,"whitespace")(w):k(w)}function k(w){return w===null||Re(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):l(w)}}function y0(e,i,l){return r;function r(p){return yt(p)?zo(e,u)(p):l(p)}function u(p){return Mb(e,c,l,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return Ke(p)?et(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Re(p)?i(p):l(p)}}const x0={name:"hardBreakEscape",tokenize:b0};function b0(e,i,l){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Re(c)?(e.exit("hardBreakEscape"),i(c)):l(c)}}const v0={name:"headingAtx",resolve:w0,tokenize:k0};function w0(e,i){let l=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),l-2>r&&e[l][1].type==="whitespace"&&(l-=2),e[l][1].type==="atxHeadingSequence"&&(r===l-1||l-4>r&&e[l-2][1].type==="whitespace")&&(l-=r+1===l?2:4),l>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[l][1].end},c={type:"chunkText",start:e[r][1].start,end:e[l][1].end,contentType:"text"},ni(e,r,l-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function k0(e,i,l){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||yt(b)?(e.exit("atxHeadingSequence"),p(b)):l(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Re(b)?(e.exit("atxHeading"),i(b)):Ke(b)?et(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||yt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const S0=["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"],Py=["pre","script","style","textarea"],j0={concrete:!0,name:"htmlFlow",resolveTo:E0,tokenize:A0},C0={partial:!0,tokenize:_0},T0={partial:!0,tokenize:N0};function E0(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 A0(e,i,l){const r=this;let u,c,d,p,g;return m;function m(C){return b(C)}function b(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),x}function x(C){return C===33?(e.consume(C),k):C===47?(e.consume(C),c=!0,O):C===63?(e.consume(C),u=3,r.interrupt?i:R):vn(C)?(e.consume(C),d=String.fromCharCode(C),U):l(C)}function k(C){return C===45?(e.consume(C),u=2,w):C===91?(e.consume(C),u=5,p=0,E):vn(C)?(e.consume(C),u=4,r.interrupt?i:R):l(C)}function w(C){return C===45?(e.consume(C),r.interrupt?i:R):l(C)}function E(C){const K="CDATA[";return C===K.charCodeAt(p++)?(e.consume(C),p===K.length?r.interrupt?i:ce:E):l(C)}function O(C){return vn(C)?(e.consume(C),d=String.fromCharCode(C),U):l(C)}function U(C){if(C===null||C===47||C===62||yt(C)){const K=C===47,me=d.toLowerCase();return!K&&!c&&Py.includes(me)?(u=1,r.interrupt?i(C):ce(C)):S0.includes(d.toLowerCase())?(u=6,K?(e.consume(C),_):r.interrupt?i(C):ce(C)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?l(C):c?F(C):q(C))}return C===45||pn(C)?(e.consume(C),d+=String.fromCharCode(C),U):l(C)}function _(C){return C===62?(e.consume(C),r.interrupt?i:ce):l(C)}function F(C){return Ke(C)?(e.consume(C),F):L(C)}function q(C){return C===47?(e.consume(C),L):C===58||C===95||vn(C)?(e.consume(C),Y):Ke(C)?(e.consume(C),q):L(C)}function Y(C){return C===45||C===46||C===58||C===95||pn(C)?(e.consume(C),Y):se(C)}function se(C){return C===61?(e.consume(C),N):Ke(C)?(e.consume(C),se):q(C)}function N(C){return C===null||C===60||C===61||C===62||C===96?l(C):C===34||C===39?(e.consume(C),g=C,X):Ke(C)?(e.consume(C),N):ae(C)}function X(C){return C===g?(e.consume(C),g=null,ee):C===null||Re(C)?l(C):(e.consume(C),X)}function ae(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||yt(C)?se(C):(e.consume(C),ae)}function ee(C){return C===47||C===62||Ke(C)?q(C):l(C)}function L(C){return C===62?(e.consume(C),te):l(C)}function te(C){return C===null||Re(C)?ce(C):Ke(C)?(e.consume(C),te):l(C)}function ce(C){return C===45&&u===2?(e.consume(C),G):C===60&&u===1?(e.consume(C),oe):C===62&&u===4?(e.consume(C),A):C===63&&u===3?(e.consume(C),R):C===93&&u===5?(e.consume(C),De):Re(C)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(C0,z,Ee)(C)):C===null||Re(C)?(e.exit("htmlFlowData"),Ee(C)):(e.consume(C),ce)}function Ee(C){return e.check(T0,ge,z)(C)}function ge(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ue}function ue(C){return C===null||Re(C)?Ee(C):(e.enter("htmlFlowData"),ce(C))}function G(C){return C===45?(e.consume(C),R):ce(C)}function oe(C){return C===47?(e.consume(C),d="",ye):ce(C)}function ye(C){if(C===62){const K=d.toLowerCase();return Py.includes(K)?(e.consume(C),A):ce(C)}return vn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),ye):ce(C)}function De(C){return C===93?(e.consume(C),R):ce(C)}function R(C){return C===62?(e.consume(C),A):C===45&&u===2?(e.consume(C),R):ce(C)}function A(C){return C===null||Re(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),A)}function z(C){return e.exit("htmlFlow"),i(C)}}function N0(e,i,l){const r=this;return u;function u(d){return Re(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):l(d)}function c(d){return r.parser.lazy[r.now().line]?l(d):i(d)}}function _0(e,i,l){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(Yo,i,l)}}const D0={name:"htmlText",tokenize:M0};function M0(e,i,l){const r=this;let u,c,d;return p;function p(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),g}function g(R){return R===33?(e.consume(R),m):R===47?(e.consume(R),se):R===63?(e.consume(R),q):vn(R)?(e.consume(R),ae):l(R)}function m(R){return R===45?(e.consume(R),b):R===91?(e.consume(R),c=0,E):vn(R)?(e.consume(R),F):l(R)}function b(R){return R===45?(e.consume(R),w):l(R)}function x(R){return R===null?l(R):R===45?(e.consume(R),k):Re(R)?(d=x,oe(R)):(e.consume(R),x)}function k(R){return R===45?(e.consume(R),w):x(R)}function w(R){return R===62?G(R):R===45?k(R):x(R)}function E(R){const A="CDATA[";return R===A.charCodeAt(c++)?(e.consume(R),c===A.length?O:E):l(R)}function O(R){return R===null?l(R):R===93?(e.consume(R),U):Re(R)?(d=O,oe(R)):(e.consume(R),O)}function U(R){return R===93?(e.consume(R),_):O(R)}function _(R){return R===62?G(R):R===93?(e.consume(R),_):O(R)}function F(R){return R===null||R===62?G(R):Re(R)?(d=F,oe(R)):(e.consume(R),F)}function q(R){return R===null?l(R):R===63?(e.consume(R),Y):Re(R)?(d=q,oe(R)):(e.consume(R),q)}function Y(R){return R===62?G(R):q(R)}function se(R){return vn(R)?(e.consume(R),N):l(R)}function N(R){return R===45||pn(R)?(e.consume(R),N):X(R)}function X(R){return Re(R)?(d=X,oe(R)):Ke(R)?(e.consume(R),X):G(R)}function ae(R){return R===45||pn(R)?(e.consume(R),ae):R===47||R===62||yt(R)?ee(R):l(R)}function ee(R){return R===47?(e.consume(R),G):R===58||R===95||vn(R)?(e.consume(R),L):Re(R)?(d=ee,oe(R)):Ke(R)?(e.consume(R),ee):G(R)}function L(R){return R===45||R===46||R===58||R===95||pn(R)?(e.consume(R),L):te(R)}function te(R){return R===61?(e.consume(R),ce):Re(R)?(d=te,oe(R)):Ke(R)?(e.consume(R),te):ee(R)}function ce(R){return R===null||R===60||R===61||R===62||R===96?l(R):R===34||R===39?(e.consume(R),u=R,Ee):Re(R)?(d=ce,oe(R)):Ke(R)?(e.consume(R),ce):(e.consume(R),ge)}function Ee(R){return R===u?(e.consume(R),u=void 0,ue):R===null?l(R):Re(R)?(d=Ee,oe(R)):(e.consume(R),Ee)}function ge(R){return R===null||R===34||R===39||R===60||R===61||R===96?l(R):R===47||R===62||yt(R)?ee(R):(e.consume(R),ge)}function ue(R){return R===47||R===62||yt(R)?ee(R):l(R)}function G(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),i):l(R)}function oe(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),ye}function ye(R){return Ke(R)?et(e,De,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):De(R)}function De(R){return e.enter("htmlTextData"),d(R)}}const uh={name:"labelEnd",resolveAll:L0,resolveTo:I0,tokenize:U0},R0={tokenize:B0},O0={tokenize:q0},z0={tokenize:H0};function L0(e){let i=-1;const l=[];for(;++i<e.length;){const r=e[i][1];if(l.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!==l.length&&ni(e,0,e.length,l),e}function I0(e,i){let l=e.length,r=0,u,c,d,p;for(;l--;)if(u=e[l][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[l][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[l][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=l,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(d=l);const g={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=hi(p,e.slice(c+1,c+r+3)),p=hi(p,[["enter",b,i]]),p=hi(p,Vc(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=hi(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=hi(p,e.slice(d+1)),p=hi(p,[["exit",g,i]]),ni(e,c,e.length,p),e}function U0(e,i,l){const r=this;let u=r.events.length,c,d;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){c=r.events[u][1];break}return p;function p(k){return c?c._inactive?x(k):(d=r.parser.defined.includes(_i(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(k),e.exit("labelMarker"),e.exit("labelEnd"),g):l(k)}function g(k){return k===40?e.attempt(R0,b,d?b:x)(k):k===91?e.attempt(O0,b,d?m:x)(k):d?b(k):x(k)}function m(k){return e.attempt(z0,b,x)(k)}function b(k){return i(k)}function x(k){return c._balanced=!0,l(k)}}function B0(e,i,l){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),u}function u(x){return yt(x)?zo(e,c)(x):c(x)}function c(x){return x===41?b(x):_b(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return yt(x)?zo(e,g)(x):b(x)}function p(x){return l(x)}function g(x){return x===34||x===39||x===40?Mb(e,m,l,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return yt(x)?zo(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):l(x)}}function q0(e,i,l){const r=this;return u;function u(p){return Db.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(_i(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):l(p)}function d(p){return l(p)}}function H0(e,i,l){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):l(c)}}const $0={name:"labelStartImage",resolveAll:uh.resolveAll,tokenize:G0};function G0(e,i,l){const r=this;return u;function u(p){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(p),e.exit("labelImageMarker"),c}function c(p){return p===91?(e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelImage"),d):l(p)}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?l(p):i(p)}}const V0={name:"labelStartLink",resolveAll:uh.resolveAll,tokenize:Y0};function Y0(e,i,l){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?l(d):i(d)}}const Xf={name:"lineEnding",tokenize:P0};function P0(e,i){return l;function l(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,i,"linePrefix")}}const Nc={name:"thematicBreak",tokenize:F0};function F0(e,i,l){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Re(m))?(e.exit("thematicBreak"),i(m)):l(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),Ke(m)?et(e,p,"whitespace")(m):p(m))}}const In={continuation:{tokenize:Q0},exit:J0,name:"list",tokenize:X0},W0={partial:!0,tokenize:ej},K0={partial:!0,tokenize:Z0};function X0(e,i,l){const r=this,u=r.events[r.events.length-1];let c=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,d=0;return p;function p(w){const E=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:zp(w)){if(r.containerState.type||(r.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Nc,l,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return l(w)}function g(w){return zp(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):l(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(Yo,r.interrupt?l:b,e.attempt(W0,k,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,k(w)}function x(w){return Ke(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),k):l(w)}function k(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function Q0(e,i,l){const r=this;return r.containerState._closeFlow=void 0,e.check(Yo,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(e,i,"listItemIndent",r.containerState.size+1)(p)}function c(p){return r.containerState.furtherBlankLines||!Ke(p)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(p)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(K0,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(In,i,l),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function Z0(e,i,l){const r=this;return et(e,u,"listItemIndent",r.containerState.size+1);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(c):l(c)}}function J0(e){e.exit(this.containerState.type)}function ej(e,i,l){const r=this;return et(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!Ke(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):l(c)}}const Fy={name:"setextUnderline",resolveTo:tj,tokenize:nj};function tj(e,i){let l=e.length,r,u,c;for(;l--;)if(e[l][0]==="enter"){if(e[l][1].type==="content"){r=l;break}e[l][1].type==="paragraph"&&(u=l)}else e[l][1].type==="content"&&e.splice(l,1),!c&&e[l][1].type==="definition"&&(c=l);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 nj(e,i,l){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)):l(m)}function d(m){return e.enter("setextHeadingLineSequence"),p(m)}function p(m){return m===u?(e.consume(m),p):(e.exit("setextHeadingLineSequence"),Ke(m)?et(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Re(m)?(e.exit("setextHeadingLine"),i(m)):l(m)}}const ij={tokenize:lj};function lj(e){const i=this,l=e.attempt(Yo,r,e.attempt(this.parser.constructs.flowInitial,u,et(e,e.attempt(this.parser.constructs.flow,u,e.attempt(u0,u)),"linePrefix")));return l;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,l}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,l}}const aj={resolveAll:Ob()},rj=Rb("string"),sj=Rb("text");function Rb(e){return{resolveAll:Ob(e==="text"?oj:void 0),tokenize:i};function i(l){const r=this,u=this.parser.constructs[e],c=l.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(b){if(b===null){l.consume(b);return}return l.enter("data"),l.consume(b),g}function g(b){return m(b)?(l.exit("data"),c(b)):(l.consume(b),g)}function m(b){if(b===null)return!0;const x=u[b];let k=-1;if(x)for(;++k<x.length;){const w=x[k];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Ob(e){return i;function i(l,r){let u=-1,c;for(;++u<=l.length;)c===void 0?l[u]&&l[u][1].type==="data"&&(c=u,u++):(!l[u]||l[u][1].type!=="data")&&(u!==c+2&&(l[c][1].end=l[u-1][1].end,l.splice(c+2,u-c-2),u=c+2),c=void 0);return e?e(l,r):l}}function oj(e,i){let l=0;for(;++l<=e.length;)if((l===e.length||e[l][1].type==="lineEnding")&&e[l-1][1].type==="data"){const r=e[l-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&l===e.length&&(p=0),p){const m={type:l===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(l,0,["enter",m,i],["exit",m,i]),l+=2)}l++}return e}const uj={42:In,43:In,45:In,48:In,49:In,50:In,51:In,52:In,53:In,54:In,55:In,56:In,57:In,62:Tb},cj={91:h0},dj={[-2]:Kf,[-1]:Kf,32:Kf},fj={35:v0,42:Nc,45:[Fy,Nc],60:j0,61:Fy,95:Nc,96:Yy,126:Yy},pj={38:Ab,92:Eb},hj={[-5]:Xf,[-4]:Xf,[-3]:Xf,33:$0,38:Ab,42:Lp,60:[VS,D0],91:V0,92:[x0,Eb],93:uh,95:Lp,96:i0},mj={null:[Lp,aj]},gj={null:[42,95]},yj={null:[]},xj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gj,contentInitial:cj,disable:yj,document:uj,flow:fj,flowInitial:dj,insideSpan:mj,string:pj,text:hj},Symbol.toStringTag,{value:"Module"}));function bj(e,i,l){let r={_bufferIndex:-1,_index:0,line:l&&l.line||1,column:l&&l.column||1,offset:l&&l.offset||0};const u={},c=[];let d=[],p=[];const g={attempt:X(se),check:X(N),consume:F,enter:q,exit:Y,interrupt:X(N,{interrupt:!0})},m={code:null,containerState:{},defineSkip:O,events:[],now:E,parser:e,previous:null,sliceSerialize:k,sliceStream:w,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(te){return d=hi(d,te),U(),d[d.length-1]!==null?[]:(ae(i,0),m.events=Vc(c,m.events,m),m.events)}function k(te,ce){return wj(w(te),ce)}function w(te){return vj(d,te)}function E(){const{_bufferIndex:te,_index:ce,line:Ee,column:ge,offset:ue}=r;return{_bufferIndex:te,_index:ce,line:Ee,column:ge,offset:ue}}function O(te){u[te.line]=te.column,L()}function U(){let te;for(;r._index<d.length;){const ce=d[r._index];if(typeof ce=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<ce.length;)_(ce.charCodeAt(r._bufferIndex));else _(ce)}}function _(te){b=b(te)}function F(te){Re(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,L()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=te}function q(te,ce){const Ee=ce||{};return Ee.type=te,Ee.start=E(),m.events.push(["enter",Ee,m]),p.push(Ee),Ee}function Y(te){const ce=p.pop();return ce.end=E(),m.events.push(["exit",ce,m]),ce}function se(te,ce){ae(te,ce.from)}function N(te,ce){ce.restore()}function X(te,ce){return Ee;function Ee(ge,ue,G){let oe,ye,De,R;return Array.isArray(ge)?z(ge):"tokenize"in ge?z([ge]):A(ge);function A(Z){return xe;function xe(Le){const Xe=Le!==null&&Z[Le],Ot=Le!==null&&Z.null,Ft=[...Array.isArray(Xe)?Xe:Xe?[Xe]:[],...Array.isArray(Ot)?Ot:Ot?[Ot]:[]];return z(Ft)(Le)}}function z(Z){return oe=Z,ye=0,Z.length===0?G:C(Z[ye])}function C(Z){return xe;function xe(Le){return R=ee(),De=Z,Z.partial||(m.currentConstruct=Z),Z.name&&m.parser.constructs.disable.null.includes(Z.name)?me():Z.tokenize.call(ce?Object.assign(Object.create(m),ce):m,g,K,me)(Le)}}function K(Z){return te(De,R),ue}function me(Z){return R.restore(),++ye<oe.length?C(oe[ye]):G}}}function ae(te,ce){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&ni(m.events,ce,m.events.length-ce,te.resolve(m.events.slice(ce),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function ee(){const te=E(),ce=m.previous,Ee=m.currentConstruct,ge=m.events.length,ue=Array.from(p);return{from:ge,restore:G};function G(){r=te,m.previous=ce,m.currentConstruct=Ee,m.events.length=ge,p=ue,L()}}function L(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function vj(e,i){const l=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(l===u)d=[e[l].slice(r,c)];else{if(d=e.slice(l,u),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}c>0&&d.push(e[u].slice(0,c))}return d}function wj(e,i){let l=-1;const r=[];let u;for(;++l<e.length;){const c=e[l];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
49
+ `+o.stack}}var sn=Object.prototype.hasOwnProperty,wn=e.unstable_scheduleCallback,gi=e.unstable_cancelCallback,yi=e.unstable_shouldYield,Di=e.unstable_requestPaint,Lt=e.unstable_now,Rl=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,he=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Ae=e.unstable_LowPriority,Ie=e.unstable_IdlePriority,At=e.log,mn=e.unstable_setDisableYieldValue,tt=null,jt=null;function on(t){if(typeof At=="function"&&mn(t),jt&&typeof jt.setStrictMode=="function")try{jt.setStrictMode(tt,t)}catch{}}var rt=Math.clz32?Math.clz32:Qc,Ri=Math.log,qn=Math.LN2;function Qc(t){return t>>>=0,t===0?32:31-(Ri(t)/qn|0)|0}var Ea=256,Aa=262144,Ml=4194304;function Pt(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 xi(t,n,a){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var E=o&134217727;return E!==0?(o=E&~h,o!==0?f=Pt(o):(v&=E,v!==0?f=Pt(v):a||(a=E&~t,a!==0&&(f=Pt(a))))):(E=o&~h,E!==0?f=Pt(E):v!==0?f=Pt(v):a||(a=o&~t,a!==0&&(f=Pt(a)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:f}function ot(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Na(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 Fo(){var t=Ml;return Ml<<=1,(Ml&62914560)===0&&(Ml=4194304),t}function tl(t){for(var n=[],a=0;31>a;a++)n.push(t);return n}function Ol(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function _a(t,n,a,o,f,h){var v=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var E=t.entanglements,U=t.expirationTimes,F=t.hiddenUpdates;for(a=v&~a;0<a;){var ie=31-rt(a),re=1<<ie;E[ie]=0,U[ie]=-1;var W=F[ie];if(W!==null)for(F[ie]=null,ie=0;ie<W.length;ie++){var Q=W[ie];Q!==null&&(Q.lane&=-536870913)}a&=~re}o!==0&&Wo(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function Wo(t,n,a){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-rt(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|a&261930}function cs(t,n){var a=t.entangledLanes|=n;for(t=t.entanglements;a;){var o=31-rt(a),f=1<<o;f&n|t[o]&n&&(t[o]|=n),a&=~f}}function Ko(t,n){var a=n&-n;return a=(a&42)!==0?1:fr(a),(a&(t.suspendedLanes|n))!==0?0:a}function fr(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 ds(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function pr(){var t=oe.p;return t!==0?t:(t=window.event,t===void 0?32:py(t.type))}function Xo(t,n){var a=oe.p;try{return oe.p=t,n()}finally{oe.p=a}}var kn=Math.random().toString(36).slice(2),bt="__reactFiber$"+kn,Nt="__reactProps$"+kn,Hn="__reactContainer$"+kn,Mi="__reactEvents$"+kn,fs="__reactListeners$"+kn,hr="__reactHandles$"+kn,Qo="__reactResources$"+kn,bi="__reactMarker$"+kn;function Da(t){delete t[bt],delete t[Nt],delete t[Mi],delete t[fs],delete t[hr]}function Oi(t){var n=t[bt];if(n)return n;for(var a=t.parentNode;a;){if(n=a[Hn]||a[bt]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(t=Qg(t);t!==null;){if(a=t[bt])return a;t=Qg(t)}return n}t=a,a=t.parentNode}return null}function zi(t){if(t=t[bt]||t[Hn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function nl(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function zl(t){var n=t[Qo];return n||(n=t[Qo]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function _t(t){t[bi]=!0}var vi=new Set,mr={};function Li(t,n){Ll(t,n),Ll(t+"Capture",n)}function Ll(t,n){for(mr[t]=n,t=0;t<n.length;t++)vi.add(n[t])}var Zc=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),il={},Zo={};function Jo(t){return sn.call(Zo,t)?!0:sn.call(il,t)?!1:Zc.test(t)?Zo[t]=!0:(il[t]=!0,!1)}function $n(t,n,a){if(Jo(n))if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+a)}}function ii(t,n,a){if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+a)}}function wi(t,n,a,o){if(o===null)t.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(n,a,""+o)}}function Dt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Il(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function eu(t,n,a){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,h=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){a=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(v){a=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Gn(t){if(!t._valueTracker){var n=Il(t)?"checked":"value";t._valueTracker=eu(t,n,""+t[n])}}function li(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var a=n.getValue(),o="";return t&&(o=Il(t)?t.checked?"true":"false":t.value),t=o,t!==a?(n.setValue(t),!0):!1}function ai(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 tu=/[\n"\\]/g;function Kt(t){return t.replace(tu,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function gr(t,n,a,o,f,h,v,E){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=""+Dt(n)):t.value!==""+Dt(n)&&(t.value=""+Dt(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?ps(t,v,Dt(n)):a!=null?ps(t,v,Dt(a)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+Dt(E):t.removeAttribute("name")}function Ul(t,n,a,o,f,h,v,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Gn(t);return}a=a!=null?""+Dt(a):"",n=n!=null?""+Dt(n):a,E||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=E?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),Gn(t)}function ps(t,n,a){n==="number"&&ai(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function ki(t,n,a,o){if(t=t.options,n){n={};for(var f=0;f<a.length;f++)n["$"+a[f]]=!0;for(a=0;a<t.length;a++)f=n.hasOwnProperty("$"+t[a].value),t[a].selected!==f&&(t[a].selected=f),f&&o&&(t[a].defaultSelected=!0)}else{for(a=""+Dt(a),n=null,f=0;f<t.length;f++){if(t[f].value===a){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function Bl(t,n,a){if(n!=null&&(n=""+Dt(n),n!==t.value&&(t.value=n),a==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=a!=null?""+Dt(a):""}function yr(t,n,a,o){if(n==null){if(o!=null){if(a!=null)throw Error(r(92));if(ue(o)){if(1<o.length)throw Error(r(93));o=o[0]}a=o}a==null&&(a=""),n=a}a=Dt(n),t.defaultValue=a,o=t.textContent,o===a&&o!==""&&o!==null&&(t.value=o),Gn(t)}function Ii(t,n){if(n){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=n;return}}t.textContent=n}var nu=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 Ra(t,n,a){var o=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,a):typeof a!="number"||a===0||nu.has(n)?n==="float"?t.cssFloat=a:t[n]=(""+a).trim():t[n]=a+"px"}function Vn(t,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&a[f]!==o&&Ra(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&Ra(t,h,n[h])}function ri(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 hs=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"]]),Ma=/^[\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 ql(t){return Ma.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Pn(){}var ms=null;function Oa(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ll=null,Hl=null;function Ui(t){var n=zi(t);if(n&&(t=n.stateNode)){var a=t[Nt]||null;e:switch(t=n.stateNode,n.type){case"input":if(gr(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Kt(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var o=a[n];if(o!==t&&o.form===t.form){var f=o[Nt]||null;if(!f)throw Error(r(90));gr(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<a.length;n++)o=a[n],o.form===t.form&&li(o)}break e;case"textarea":Bl(t,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&ki(t,!!a.multiple,n,!1)}}}var gs=!1;function ys(t,n,a){if(gs)return t(n,a);gs=!0;try{var o=t(n);return o}finally{if(gs=!1,(ll!==null||Hl!==null)&&(Qu(),ll&&(n=ll,t=Hl,Hl=ll=null,Ui(n),t)))for(n=0;n<t.length;n++)Ui(t[n])}}function Bi(t,n){var a=t.stateNode;if(a===null)return null;var o=a[Nt]||null;if(o===null)return null;a=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xr=!1;if(si)try{var oi={};Object.defineProperty(oi,"passive",{get:function(){xr=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{xr=!1}var Yn=null,br=null,qi=null;function vr(){if(qi)return qi;var t,n=br,a=n.length,o,f="value"in Yn?Yn.value:Yn.textContent,h=f.length;for(t=0;t<a&&n[t]===f[t];t++);var v=a-t;for(o=1;o<=v&&n[a-o]===f[h-o];o++);return qi=f.slice(t,1<o?1-o:void 0)}function $l(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 Gl(){return!0}function xs(){return!1}function en(t){function n(a,o,f,h,v){this._reactName=a,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(a=t[E],this[E]=a?a(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Gl:xs,this.isPropagationStopped=xs,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Gl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Gl)},persist:function(){},isPersistent:Gl}),n}var un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=en(un),It=y({},un,{view:0,detail:0}),wr=en(It),Vl,al,ui,rl=y({},It,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pl,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!==ui&&(ui&&t.type==="mousemove"?(Vl=t.screenX-ui.screenX,al=t.screenY-ui.screenY):al=Vl=0,ui=t),Vl)},movementY:function(t){return"movementY"in t?t.movementY:al}}),za=en(rl),bs=y({},rl,{dataTransfer:0}),vs=en(bs),Ne=y({},It,{relatedTarget:0}),kr=en(Ne),ji=y({},un,{animationName:0,elapsedTime:0,pseudoElement:0}),Xt=en(ji),ws=y({},un,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),La=en(ws),lt=y({},un,{data:0}),sl=en(lt),jr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ia={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"},Ua={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ks(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Ua[t])?!!n[t]:!1}function Pl(){return ks}var Jc=y({},It,{key:function(t){if(t.key){var n=jr[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=$l(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Ia[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pl,charCode:function(t){return t.type==="keypress"?$l(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?$l(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ed=en(Jc),Ba=y({},rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),js=en(Ba),Ss=y({},It,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pl}),Cs=en(Ss),Ts=y({},un,{propertyName:0,elapsedTime:0,pseudoElement:0}),Es=en(Ts),Sr=y({},rl,{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}),td=en(Sr),qa=y({},un,{newState:0,oldState:0}),nd=en(qa),id=[9,13,27,32],As=si&&"CompositionEvent"in window,ol=null;si&&"documentMode"in document&&(ol=document.documentMode);var ul=si&&"TextEvent"in window&&!ol,Yl=si&&(!As||ol&&8<ol&&11>=ol),je=" ",iu=!1;function cn(t,n){switch(t){case"keyup":return id.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lu(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fl=!1;function Cr(t,n){switch(t){case"compositionend":return lu(n);case"keypress":return n.which!==32?null:(iu=!0,je);case"textInput":return t=n.data,t===je&&iu?null:t;default:return null}}function ld(t,n){if(Fl)return t==="compositionend"||!As&&cn(t,n)?(t=vr(),qi=br=Yn=null,Fl=!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 Yl&&n.locale!=="ko"?null:n.data;default:return null}}var au={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 Tr(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!au[t.type]:n==="textarea"}function ru(t,n,a,o){ll?Hl?Hl.push(o):Hl=[o]:ll=o,n=lc(n,"onChange"),0<n.length&&(a=new gn("onChange","change",null,a,o),t.push({event:a,listeners:n}))}var Hi=null,cl=null;function Ns(t){Ig(t,0)}function Er(t){var n=nl(t);if(li(n))return t}function Ar(t,n){if(t==="change")return n}var su=!1;if(si){var _s;if(si){var Ha="oninput"in document;if(!Ha){var Nr=document.createElement("div");Nr.setAttribute("oninput","return;"),Ha=typeof Nr.oninput=="function"}_s=Ha}else _s=!1;su=_s&&(!document.documentMode||9<document.documentMode)}function ou(){Hi&&(Hi.detachEvent("onpropertychange",uu),cl=Hi=null)}function uu(t){if(t.propertyName==="value"&&Er(cl)){var n=[];ru(n,cl,t,Oa(t)),ys(Ns,n)}}function cu(t,n,a){t==="focusin"?(ou(),Hi=n,cl=a,Hi.attachEvent("onpropertychange",uu)):t==="focusout"&&ou()}function ad(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Er(cl)}function rd(t,n){if(t==="click")return Er(n)}function sd(t,n){if(t==="input"||t==="change")return Er(n)}function od(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var yn=typeof Object.is=="function"?Object.is:od;function $a(t,n){if(yn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var f=a[o];if(!sn.call(n,f)||!yn(t[f],n[f]))return!1}return!0}function du(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function fu(t,n){var a=du(t);t=0;for(var o;a;){if(a.nodeType===3){if(o=t+a.textContent.length,t<=n&&o>=n)return{node:a,offset:n-t};t=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=du(a)}}function pu(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?pu(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function hu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=ai(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=ai(t.document)}return n}function Ds(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 ud=si&&"documentMode"in document&&11>=document.documentMode,Wl=null,Rs=null,Ga=null,Ms=!1;function mu(t,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ms||Wl==null||Wl!==ai(o)||(o=Wl,"selectionStart"in o&&Ds(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ga&&$a(Ga,o)||(Ga=o,o=lc(Rs,"onSelect"),0<o.length&&(n=new gn("onSelect","select",null,n,a),t.push({event:n,listeners:o}),n.target=Wl)))}function dl(t,n){var a={};return a[t.toLowerCase()]=n.toLowerCase(),a["Webkit"+t]="webkit"+n,a["Moz"+t]="moz"+n,a}var fl={animationend:dl("Animation","AnimationEnd"),animationiteration:dl("Animation","AnimationIteration"),animationstart:dl("Animation","AnimationStart"),transitionrun:dl("Transition","TransitionRun"),transitionstart:dl("Transition","TransitionStart"),transitioncancel:dl("Transition","TransitionCancel"),transitionend:dl("Transition","TransitionEnd")},Fn={},_r={};si&&(_r=document.createElement("div").style,"AnimationEvent"in window||(delete fl.animationend.animation,delete fl.animationiteration.animation,delete fl.animationstart.animation),"TransitionEvent"in window||delete fl.transitionend.transition);function $i(t){if(Fn[t])return Fn[t];if(!fl[t])return t;var n=fl[t],a;for(a in n)if(n.hasOwnProperty(a)&&a in _r)return Fn[t]=n[a];return t}var Kl=$i("animationend"),Gi=$i("animationiteration"),gu=$i("animationstart"),cd=$i("transitionrun"),dd=$i("transitionstart"),fd=$i("transitioncancel"),yu=$i("transitionend"),xu=new Map,Dr="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(" ");Dr.push("scrollEnd");function jn(t,n){xu.set(t,n),Li(n,[t])}var Rr=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)},Sn=[],Xl=0,Vi=0;function pl(){for(var t=Xl,n=Vi=Xl=0;n<t;){var a=Sn[n];Sn[n++]=null;var o=Sn[n];Sn[n++]=null;var f=Sn[n];Sn[n++]=null;var h=Sn[n];if(Sn[n++]=null,o!==null&&f!==null){var v=o.pending;v===null?f.next=f:(f.next=v.next,v.next=f),o.pending=f}h!==0&&bu(a,f,h)}}function Mr(t,n,a,o){Sn[Xl++]=t,Sn[Xl++]=n,Sn[Xl++]=a,Sn[Xl++]=o,Vi|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Os(t,n,a,o){return Mr(t,n,a,o),Va(t)}function Pi(t,n){return Mr(t,null,null,n),Va(t)}function bu(t,n,a){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a);for(var f=!1,h=t.return;h!==null;)h.childLanes|=a,o=h.alternate,o!==null&&(o.childLanes|=a),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-rt(a),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=a|536870912),h):null}function Va(t){if(50<ao)throw ao=0,cf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Ql={};function pd(t,n,a,o){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xn(t,n,a,o){return new pd(t,n,a,o)}function zs(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Si(t,n){var a=t.alternate;return a===null?(a=xn(t.tag,n,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=n,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,n=t.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function vu(t,n){t.flags&=65011714;var a=t.alternate;return a===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=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,n=a.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Or(t,n,a,o,f,h){var v=0;if(o=t,typeof t=="function")zs(t)&&(v=1);else if(typeof t=="string")v=yk(t,a,K.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ee:return t=xn(31,a,n,f),t.elementType=ee,t.lanes=h,t;case R:return hl(a.children,f,h,n);case z:v=8,f|=24;break;case N:return t=xn(12,a,n,f|2),t.elementType=N,t.lanes=h,t;case se:return t=xn(13,a,n,f),t.elementType=se,t.lanes=h,t;case _:return t=xn(19,a,n,f),t.elementType=_,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case B:v=10;break e;case G:v=9;break e;case P:v=11;break e;case X:v=14;break e;case ae:v=16,o=null;break e}v=29,a=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=xn(v,a,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function hl(t,n,a,o){return t=xn(7,t,o,n),t.lanes=a,t}function Ls(t,n,a){return t=xn(6,t,null,n),t.lanes=a,t}function wu(t){var n=xn(18,null,null,0);return n.stateNode=t,n}function Is(t,n,a){return n=xn(4,t.children!==null?t.children:[],t.key,n),n.lanes=a,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var ku=new WeakMap;function Cn(t,n){if(typeof t=="object"&&t!==null){var a=ku.get(t);return a!==void 0?a:(n={value:t,source:n,stack:wt(n)},ku.set(t,n),n)}return{value:t,source:n,stack:wt(n)}}var Ci=[],Zl=0,Jl=null,Pa=0,Tn=[],tn=0,dn=null,En=1,Wn="";function Kn(t,n){Ci[Zl++]=Pa,Ci[Zl++]=Jl,Jl=t,Pa=n}function Us(t,n,a){Tn[tn++]=En,Tn[tn++]=Wn,Tn[tn++]=dn,dn=t;var o=En;t=Wn;var f=32-rt(o)-1;o&=~(1<<f),a+=1;var h=32-rt(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,En=1<<32-rt(n)+f|a<<f|o,Wn=h+t}else En=1<<h|a<<f|o,Wn=t}function ea(t){t.return!==null&&(Kn(t,1),Us(t,1,0))}function Bs(t){for(;t===Jl;)Jl=Ci[--Zl],Ci[Zl]=null,Pa=Ci[--Zl],Ci[Zl]=null;for(;t===dn;)dn=Tn[--tn],Tn[tn]=null,Wn=Tn[--tn],Tn[tn]=null,En=Tn[--tn],Tn[tn]=null}function ju(t,n){Tn[tn++]=En,Tn[tn++]=Wn,Tn[tn++]=dn,En=n.id,Wn=n.overflow,dn=t}var Yt=null,ht=null,Pe=!1,An=null,Nn=!1,ml=Error(r(519));function _n(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ci(Cn(n,t)),ml}function ta(t){var n=t.stateNode,a=t.type,o=t.memoizedProps;switch(n[bt]=t,n[Nt]=o,a){case"dialog":We("cancel",n),We("close",n);break;case"iframe":case"object":case"embed":We("load",n);break;case"video":case"audio":for(a=0;a<so.length;a++)We(so[a],n);break;case"source":We("error",n);break;case"img":case"image":case"link":We("error",n),We("load",n);break;case"details":We("toggle",n);break;case"input":We("invalid",n),Ul(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":We("invalid",n);break;case"textarea":We("invalid",n),yr(n,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||o.suppressHydrationWarning===!0||Hg(n.textContent,a)?(o.popover!=null&&(We("beforetoggle",n),We("toggle",n)),o.onScroll!=null&&We("scroll",n),o.onScrollEnd!=null&&We("scrollend",n),o.onClick!=null&&(n.onclick=Pn),n=!0):n=!1,n||_n(t,!0)}function Su(t){for(Yt=t.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:Yt=Yt.return}}function na(t){if(t!==Yt)return!1;if(!Pe)return Su(t),Pe=!0,!1;var n=t.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Cf(t.type,t.memoizedProps)),a=!a),a&&ht&&_n(t),Su(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ht=Xg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ht=Xg(t)}else n===27?(n=ht,ga(t.type)?(t=_f,_f=null,ht=t):ht=n):ht=Yt?fi(t.stateNode.nextSibling):null;return!0}function gl(){ht=Yt=null,Pe=!1}function st(){var t=An;return t!==null&&(zn===null?zn=t:zn.push.apply(zn,t),An=null),t}function ci(t){An===null?An=[t]:An.push(t)}var Dn=A(null),yl=null,nn=null;function Yi(t,n,a){C(Dn,n._currentValue),n._currentValue=a}function Ti(t){t._currentValue=Dn.current,L(Dn)}function qs(t,n,a){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===a)break;t=t.return}}function Ya(t,n,a,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var E=h;h=f;for(var U=0;U<n.length;U++)if(E.context===n[U]){h.lanes|=a,E=h.alternate,E!==null&&(E.lanes|=a),qs(h.return,a,t),o||(v=null);break e}h=E.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=a,h=v.alternate,h!==null&&(h.lanes|=a),qs(v,a,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 ia(t,n,a,o){t=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var E=f.type;yn(f.pendingProps.value,v.value)||(t!==null?t.push(E):t=[E])}}else if(f===xe.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(po):t=[po])}f=f.return}t!==null&&Ya(n,t,a,o),n.flags|=262144}function zr(t){for(t=t.firstContext;t!==null;){if(!yn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function xl(t){yl=t,nn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ut(t){return Hs(yl,t)}function Fa(t,n){return yl===null&&xl(t),Hs(t,n)}function Hs(t,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},nn===null){if(t===null)throw Error(r(308));nn=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else nn=nn.next=n;return a}var Cu=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(a,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(a){return a()})}},x=e.unstable_scheduleCallback,j=e.unstable_NormalPriority,S={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function M(){return{controller:new Cu,data:new Map,refCount:0}}function q(t){t.refCount--,t.refCount===0&&x(j,function(){t.controller.abort()})}var J=null,be=0,Ue=0,Ce=null;function Se(t,n){if(J===null){var a=J=[];be=0,Ue=gf(),Ce={status:"pending",value:void 0,then:function(o){a.push(o)}}}return be++,n.then(Qt,Qt),n}function Qt(){if(--be===0&&J!==null){Ce!==null&&(Ce.status="fulfilled");var t=J;J=null,Ue=0,Ce=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function St(t,n){var a=[],o={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<a.length;f++)(0,a[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),o}var Wa=V.S;V.S=function(t,n){dg=Lt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Se(t,n),Wa!==null&&Wa(t,n)};var Bt=A(null);function Ei(){var t=Bt.current;return t!==null?t:mt.pooledCache}function Fi(t,n){n===null?C(Bt,Bt.current):C(Bt,n.pool)}function Lr(){var t=Ei();return t===null?null:{parent:S._currentValue,pool:t}}var Ir=Error(r(460)),hd=Error(r(474)),Tu=Error(r(542)),Eu={then:function(){}};function _h(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Dh(t,n,a){switch(a=t[a],a===void 0?t.push(n):a!==n&&(n.then(Pn,Pn),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Mh(t),t;default:if(typeof n.status=="string")n.then(Pn,Pn);else{if(t=mt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Mh(t),t}throw Xa=n,Ir}}function Ka(t){try{var n=t._init;return n(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Xa=a,Ir):a}}var Xa=null;function Rh(){if(Xa===null)throw Error(r(459));var t=Xa;return Xa=null,t}function Mh(t){if(t===Ir||t===Tu)throw Error(r(483))}var Ur=null,$s=0;function Au(t){var n=$s;return $s+=1,Ur===null&&(Ur=[]),Dh(Ur,t,n)}function Gs(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Nu(t,n){throw n.$$typeof===k?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Oh(t){function n($,H){if(t){var Y=$.deletions;Y===null?($.deletions=[H],$.flags|=16):Y.push(H)}}function a($,H){if(!t)return null;for(;H!==null;)n($,H),H=H.sibling;return null}function o($){for(var H=new Map;$!==null;)$.key!==null?H.set($.key,$):H.set($.index,$),$=$.sibling;return H}function f($,H){return $=Si($,H),$.index=0,$.sibling=null,$}function h($,H,Y){return $.index=Y,t?(Y=$.alternate,Y!==null?(Y=Y.index,Y<H?($.flags|=67108866,H):Y):($.flags|=67108866,H)):($.flags|=1048576,H)}function v($){return t&&$.alternate===null&&($.flags|=67108866),$}function E($,H,Y,le){return H===null||H.tag!==6?(H=Ls(Y,$.mode,le),H.return=$,H):(H=f(H,Y),H.return=$,H)}function U($,H,Y,le){var _e=Y.type;return _e===R?ie($,H,Y.props.children,le,Y.key):H!==null&&(H.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&Ka(_e)===H.type)?(H=f(H,Y.props),Gs(H,Y),H.return=$,H):(H=Or(Y.type,Y.key,Y.props,null,$.mode,le),Gs(H,Y),H.return=$,H)}function F($,H,Y,le){return H===null||H.tag!==4||H.stateNode.containerInfo!==Y.containerInfo||H.stateNode.implementation!==Y.implementation?(H=Is(Y,$.mode,le),H.return=$,H):(H=f(H,Y.children||[]),H.return=$,H)}function ie($,H,Y,le,_e){return H===null||H.tag!==7?(H=hl(Y,$.mode,le,_e),H.return=$,H):(H=f(H,Y),H.return=$,H)}function re($,H,Y){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Ls(""+H,$.mode,Y),H.return=$,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return Y=Or(H.type,H.key,H.props,null,$.mode,Y),Gs(Y,H),Y.return=$,Y;case T:return H=Is(H,$.mode,Y),H.return=$,H;case ae:return H=Ka(H),re($,H,Y)}if(ue(H)||ce(H))return H=hl(H,$.mode,Y,null),H.return=$,H;if(typeof H.then=="function")return re($,Au(H),Y);if(H.$$typeof===B)return re($,Fa($,H),Y);Nu($,H)}return null}function W($,H,Y,le){var _e=H!==null?H.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return _e!==null?null:E($,H,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===_e?U($,H,Y,le):null;case T:return Y.key===_e?F($,H,Y,le):null;case ae:return Y=Ka(Y),W($,H,Y,le)}if(ue(Y)||ce(Y))return _e!==null?null:ie($,H,Y,le,null);if(typeof Y.then=="function")return W($,H,Au(Y),le);if(Y.$$typeof===B)return W($,H,Fa($,Y),le);Nu($,Y)}return null}function Q($,H,Y,le,_e){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return $=$.get(Y)||null,E(H,$,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return $=$.get(le.key===null?Y:le.key)||null,U(H,$,le,_e);case T:return $=$.get(le.key===null?Y:le.key)||null,F(H,$,le,_e);case ae:return le=Ka(le),Q($,H,Y,le,_e)}if(ue(le)||ce(le))return $=$.get(Y)||null,ie(H,$,le,_e,null);if(typeof le.then=="function")return Q($,H,Y,Au(le),_e);if(le.$$typeof===B)return Q($,H,Y,Fa(H,le),_e);Nu(H,le)}return null}function ve($,H,Y,le){for(var _e=null,nt=null,Te=H,Ge=H=0,Ze=null;Te!==null&&Ge<Y.length;Ge++){Te.index>Ge?(Ze=Te,Te=null):Ze=Te.sibling;var it=W($,Te,Y[Ge],le);if(it===null){Te===null&&(Te=Ze);break}t&&Te&&it.alternate===null&&n($,Te),H=h(it,H,Ge),nt===null?_e=it:nt.sibling=it,nt=it,Te=Ze}if(Ge===Y.length)return a($,Te),Pe&&Kn($,Ge),_e;if(Te===null){for(;Ge<Y.length;Ge++)Te=re($,Y[Ge],le),Te!==null&&(H=h(Te,H,Ge),nt===null?_e=Te:nt.sibling=Te,nt=Te);return Pe&&Kn($,Ge),_e}for(Te=o(Te);Ge<Y.length;Ge++)Ze=Q(Te,$,Ge,Y[Ge],le),Ze!==null&&(t&&Ze.alternate!==null&&Te.delete(Ze.key===null?Ge:Ze.key),H=h(Ze,H,Ge),nt===null?_e=Ze:nt.sibling=Ze,nt=Ze);return t&&Te.forEach(function(wa){return n($,wa)}),Pe&&Kn($,Ge),_e}function Oe($,H,Y,le){if(Y==null)throw Error(r(151));for(var _e=null,nt=null,Te=H,Ge=H=0,Ze=null,it=Y.next();Te!==null&&!it.done;Ge++,it=Y.next()){Te.index>Ge?(Ze=Te,Te=null):Ze=Te.sibling;var wa=W($,Te,it.value,le);if(wa===null){Te===null&&(Te=Ze);break}t&&Te&&wa.alternate===null&&n($,Te),H=h(wa,H,Ge),nt===null?_e=wa:nt.sibling=wa,nt=wa,Te=Ze}if(it.done)return a($,Te),Pe&&Kn($,Ge),_e;if(Te===null){for(;!it.done;Ge++,it=Y.next())it=re($,it.value,le),it!==null&&(H=h(it,H,Ge),nt===null?_e=it:nt.sibling=it,nt=it);return Pe&&Kn($,Ge),_e}for(Te=o(Te);!it.done;Ge++,it=Y.next())it=Q(Te,$,Ge,it.value,le),it!==null&&(t&&it.alternate!==null&&Te.delete(it.key===null?Ge:it.key),H=h(it,H,Ge),nt===null?_e=it:nt.sibling=it,nt=it);return t&&Te.forEach(function(Ak){return n($,Ak)}),Pe&&Kn($,Ge),_e}function pt($,H,Y,le){if(typeof Y=="object"&&Y!==null&&Y.type===R&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var _e=Y.key;H!==null;){if(H.key===_e){if(_e=Y.type,_e===R){if(H.tag===7){a($,H.sibling),le=f(H,Y.props.children),le.return=$,$=le;break e}}else if(H.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&Ka(_e)===H.type){a($,H.sibling),le=f(H,Y.props),Gs(le,Y),le.return=$,$=le;break e}a($,H);break}else n($,H);H=H.sibling}Y.type===R?(le=hl(Y.props.children,$.mode,le,Y.key),le.return=$,$=le):(le=Or(Y.type,Y.key,Y.props,null,$.mode,le),Gs(le,Y),le.return=$,$=le)}return v($);case T:e:{for(_e=Y.key;H!==null;){if(H.key===_e)if(H.tag===4&&H.stateNode.containerInfo===Y.containerInfo&&H.stateNode.implementation===Y.implementation){a($,H.sibling),le=f(H,Y.children||[]),le.return=$,$=le;break e}else{a($,H);break}else n($,H);H=H.sibling}le=Is(Y,$.mode,le),le.return=$,$=le}return v($);case ae:return Y=Ka(Y),pt($,H,Y,le)}if(ue(Y))return ve($,H,Y,le);if(ce(Y)){if(_e=ce(Y),typeof _e!="function")throw Error(r(150));return Y=_e.call(Y),Oe($,H,Y,le)}if(typeof Y.then=="function")return pt($,H,Au(Y),le);if(Y.$$typeof===B)return pt($,H,Fa($,Y),le);Nu($,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,H!==null&&H.tag===6?(a($,H.sibling),le=f(H,Y),le.return=$,$=le):(a($,H),le=Ls(Y,$.mode,le),le.return=$,$=le),v($)):a($,H)}return function($,H,Y,le){try{$s=0;var _e=pt($,H,Y,le);return Ur=null,_e}catch(Te){if(Te===Ir||Te===Tu)throw Te;var nt=xn(29,Te,null,$.mode);return nt.lanes=le,nt.return=$,nt}finally{}}}var Qa=Oh(!0),zh=Oh(!1),la=!1;function md(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gd(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 aa(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ra(t,n,a){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(at&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=Va(t),bu(t,null,a),n}return Mr(t,o,n,a),Va(t)}function Vs(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,cs(t,a)}}function yd(t,n){var a=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,a=a.next}while(a!==null);h===null?f=h=n:h=h.next=n}else f=h=n;a={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var xd=!1;function Ps(){if(xd){var t=Ce;if(t!==null)throw t}}function Ys(t,n,a,o){xd=!1;var f=t.updateQueue;la=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var U=E,F=U.next;U.next=null,v===null?h=F:v.next=F,v=U;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,E=ie.lastBaseUpdate,E!==v&&(E===null?ie.firstBaseUpdate=F:E.next=F,ie.lastBaseUpdate=U))}if(h!==null){var re=f.baseState;v=0,ie=F=U=null,E=h;do{var W=E.lane&-536870913,Q=W!==E.lane;if(Q?(Qe&W)===W:(o&W)===W){W!==0&&W===Ue&&(xd=!0),ie!==null&&(ie=ie.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var ve=t,Oe=E;W=n;var pt=a;switch(Oe.tag){case 1:if(ve=Oe.payload,typeof ve=="function"){re=ve.call(pt,re,W);break e}re=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Oe.payload,W=typeof ve=="function"?ve.call(pt,re,W):ve,W==null)break e;re=y({},re,W);break e;case 2:la=!0}}W=E.callback,W!==null&&(t.flags|=64,Q&&(t.flags|=8192),Q=f.callbacks,Q===null?f.callbacks=[W]:Q.push(W))}else Q={lane:W,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ie===null?(F=ie=Q,U=re):ie=ie.next=Q,v|=W;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;Q=E,E=Q.next,Q.next=null,f.lastBaseUpdate=Q,f.shared.pending=null}}while(!0);ie===null&&(U=re),f.baseState=U,f.firstBaseUpdate=F,f.lastBaseUpdate=ie,h===null&&(f.shared.lanes=0),da|=v,t.lanes=v,t.memoizedState=re}}function Lh(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Ih(t,n){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Lh(a[t],n)}var Br=A(null),_u=A(0);function Uh(t,n){t=El,C(_u,t),C(Br,n),El=t|n.baseLanes}function bd(){C(_u,El),C(Br,Br.current)}function vd(){El=_u.current,L(Br),L(_u)}var Xn=A(null),di=null;function sa(t){var n=t.alternate;C(Rt,Rt.current&1),C(Xn,t),di===null&&(n===null||Br.current!==null||n.memoizedState!==null)&&(di=t)}function wd(t){C(Rt,Rt.current),C(Xn,t),di===null&&(di=t)}function Bh(t){t.tag===22?(C(Rt,Rt.current),C(Xn,t),di===null&&(di=t)):oa()}function oa(){C(Rt,Rt.current),C(Xn,Xn.current)}function Qn(t){L(Xn),di===t&&(di=null),L(Rt)}var Rt=A(0);function Du(t){for(var n=t;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Af(a)||Nf(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===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 bl=0,He=null,dt=null,qt=null,Ru=!1,qr=!1,Za=!1,Mu=0,Fs=0,Hr=null,xw=0;function Ct(){throw Error(r(321))}function kd(t,n){if(n===null)return!1;for(var a=0;a<n.length&&a<t.length;a++)if(!yn(t[a],n[a]))return!1;return!0}function jd(t,n,a,o,f,h){return bl=h,He=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=t===null||t.memoizedState===null?km:Ud,Za=!1,h=a(o,f),Za=!1,qr&&(h=Hh(n,a,o,f)),qh(t),h}function qh(t){V.H=Xs;var n=dt!==null&&dt.next!==null;if(bl=0,qt=dt=He=null,Ru=!1,Fs=0,Hr=null,n)throw Error(r(300));t===null||Ht||(t=t.dependencies,t!==null&&zr(t)&&(Ht=!0))}function Hh(t,n,a,o){He=t;var f=0;do{if(qr&&(Hr=null),Fs=0,qr=!1,25<=f)throw Error(r(301));if(f+=1,qt=dt=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}V.H=jm,h=n(a,o)}while(qr);return h}function bw(){var t=V.H,n=t.useState()[0];return n=typeof n.then=="function"?Ws(n):n,t=t.useState()[0],(dt!==null?dt.memoizedState:null)!==t&&(He.flags|=1024),n}function Sd(){var t=Mu!==0;return Mu=0,t}function Cd(t,n,a){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~a}function Td(t){if(Ru){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Ru=!1}bl=0,qt=dt=He=null,qr=!1,Fs=Mu=0,Hr=null}function bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?He.memoizedState=qt=t:qt=qt.next=t,qt}function Mt(){if(dt===null){var t=He.alternate;t=t!==null?t.memoizedState:null}else t=dt.next;var n=qt===null?He.memoizedState:qt.next;if(n!==null)qt=n,dt=t;else{if(t===null)throw He.alternate===null?Error(r(467)):Error(r(310));dt=t,t={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},qt===null?He.memoizedState=qt=t:qt=qt.next=t}return qt}function Ou(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ws(t){var n=Fs;return Fs+=1,Hr===null&&(Hr=[]),t=Dh(Hr,t,n),n=He,(qt===null?n.memoizedState:qt.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?km:Ud),t}function zu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ws(t);if(t.$$typeof===B)return Ut(t)}throw Error(r(438,String(t)))}function Ed(t){var n=null,a=He.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var o=He.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Ou(),He.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(t),o=0;o<t;o++)a[o]=I;return n.index++,a}function vl(t,n){return typeof n=="function"?n(t):n}function Lu(t){var n=Mt();return Ad(n,dt,t)}function Ad(t,n,a){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=a;var f=t.baseQueue,h=o.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}n.baseQueue=f=h,o.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{n=f.next;var E=v=null,U=null,F=n,ie=!1;do{var re=F.lane&-536870913;if(re!==F.lane?(Qe&re)===re:(bl&re)===re){var W=F.revertLane;if(W===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),re===Ue&&(ie=!0);else if((bl&W)===W){F=F.next,W===Ue&&(ie=!0);continue}else re={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},U===null?(E=U=re,v=h):U=U.next=re,He.lanes|=W,da|=W;re=F.action,Za&&a(h,re),h=F.hasEagerState?F.eagerState:a(h,re)}else W={lane:re,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},U===null?(E=U=W,v=h):U=U.next=W,He.lanes|=re,da|=re;F=F.next}while(F!==null&&F!==n);if(U===null?v=h:U.next=E,!yn(h,t.memoizedState)&&(Ht=!0,ie&&(a=Ce,a!==null)))throw a;t.memoizedState=h,t.baseState=v,t.baseQueue=U,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Nd(t){var n=Mt(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=t;var o=a.dispatch,f=a.pending,h=n.memoizedState;if(f!==null){a.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);yn(h,n.memoizedState)||(Ht=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,o]}function $h(t,n,a){var o=He,f=Mt(),h=Pe;if(h){if(a===void 0)throw Error(r(407));a=a()}else a=n();var v=!yn((dt||f).memoizedState,a);if(v&&(f.memoizedState=a,Ht=!0),f=f.queue,Rd(Ph.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||qt!==null&&qt.memoizedState.tag&1){if(o.flags|=2048,$r(9,{destroy:void 0},Vh.bind(null,o,f,a,n),null),mt===null)throw Error(r(349));h||(bl&127)!==0||Gh(o,n,a)}return a}function Gh(t,n,a){t.flags|=16384,t={getSnapshot:n,value:a},n=He.updateQueue,n===null?(n=Ou(),He.updateQueue=n,n.stores=[t]):(a=n.stores,a===null?n.stores=[t]:a.push(t))}function Vh(t,n,a,o){n.value=a,n.getSnapshot=o,Yh(n)&&Fh(t)}function Ph(t,n,a){return a(function(){Yh(n)&&Fh(t)})}function Yh(t){var n=t.getSnapshot;t=t.value;try{var a=n();return!yn(t,a)}catch{return!0}}function Fh(t){var n=Pi(t,2);n!==null&&Ln(n,t,2)}function _d(t){var n=bn();if(typeof t=="function"){var a=t;if(t=a(),Za){on(!0);try{a()}finally{on(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:t},n}function Wh(t,n,a,o){return t.baseState=a,Ad(t,dt,typeof o=="function"?o:vl)}function vw(t,n,a,o,f){if(Bu(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};V.T!==null?a(!0):h.isTransition=!1,o(h),a=n.pending,a===null?(h.next=n.pending=h,Kh(n,h)):(h.next=a.next,n.pending=a.next=h)}}function Kh(t,n){var a=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=V.T,v={};V.T=v;try{var E=a(f,o),U=V.S;U!==null&&U(v,E),Xh(t,n,E)}catch(F){Dd(t,n,F)}finally{h!==null&&v.types!==null&&(h.types=v.types),V.T=h}}else try{h=a(f,o),Xh(t,n,h)}catch(F){Dd(t,n,F)}}function Xh(t,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Qh(t,n,o)},function(o){return Dd(t,n,o)}):Qh(t,n,a)}function Qh(t,n,a){n.status="fulfilled",n.value=a,Zh(n),t.state=a,n=t.pending,n!==null&&(a=n.next,a===n?t.pending=null:(a=a.next,n.next=a,Kh(t,a)))}function Dd(t,n,a){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=a,Zh(n),n=n.next;while(n!==o)}t.action=null}function Zh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Jh(t,n){return n}function em(t,n){if(Pe){var a=mt.formState;if(a!==null){e:{var o=He;if(Pe){if(ht){t:{for(var f=ht,h=Nn;f.nodeType!==8;){if(!h){f=null;break t}if(f=fi(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){ht=fi(f.nextSibling),o=f.data==="F!";break e}}_n(o)}o=!1}o&&(n=a[0])}}return a=bn(),a.memoizedState=a.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jh,lastRenderedState:n},a.queue=o,a=bm.bind(null,He,o),o.dispatch=a,o=_d(!1),h=Id.bind(null,He,!1,o.queue),o=bn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,a=vw.bind(null,He,f,h,a),f.dispatch=a,o.memoizedState=t,[n,a,!1]}function tm(t){var n=Mt();return nm(n,dt,t)}function nm(t,n,a){if(n=Ad(t,n,Jh)[0],t=Lu(vl)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Ws(n)}catch(v){throw v===Ir?Tu:v}else o=n;n=Mt();var f=n.queue,h=f.dispatch;return a!==n.memoizedState&&(He.flags|=2048,$r(9,{destroy:void 0},ww.bind(null,f,a),null)),[o,h,t]}function ww(t,n){t.action=n}function im(t){var n=Mt(),a=dt;if(a!==null)return nm(n,a,t);Mt(),n=n.memoizedState,a=Mt();var o=a.queue.dispatch;return a.memoizedState=t,[n,o,!1]}function $r(t,n,a,o){return t={tag:t,create:a,deps:o,inst:n,next:null},n=He.updateQueue,n===null&&(n=Ou(),He.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=t.next=t:(o=a.next,a.next=t,t.next=o,n.lastEffect=t),t}function lm(){return Mt().memoizedState}function Iu(t,n,a,o){var f=bn();He.flags|=t,f.memoizedState=$r(1|n,{destroy:void 0},a,o===void 0?null:o)}function Uu(t,n,a,o){var f=Mt();o=o===void 0?null:o;var h=f.memoizedState.inst;dt!==null&&o!==null&&kd(o,dt.memoizedState.deps)?f.memoizedState=$r(n,h,a,o):(He.flags|=t,f.memoizedState=$r(1|n,h,a,o))}function am(t,n){Iu(8390656,8,t,n)}function Rd(t,n){Uu(2048,8,t,n)}function kw(t){He.flags|=4;var n=He.updateQueue;if(n===null)n=Ou(),He.updateQueue=n,n.events=[t];else{var a=n.events;a===null?n.events=[t]:a.push(t)}}function rm(t){var n=Mt().memoizedState;return kw({ref:n,nextImpl:t}),function(){if((at&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function sm(t,n){return Uu(4,2,t,n)}function om(t,n){return Uu(4,4,t,n)}function um(t,n){if(typeof n=="function"){t=t();var a=n(t);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function cm(t,n,a){a=a!=null?a.concat([t]):null,Uu(4,4,um.bind(null,n,t),a)}function Md(){}function dm(t,n){var a=Mt();n=n===void 0?null:n;var o=a.memoizedState;return n!==null&&kd(n,o[1])?o[0]:(a.memoizedState=[t,n],t)}function fm(t,n){var a=Mt();n=n===void 0?null:n;var o=a.memoizedState;if(n!==null&&kd(n,o[1]))return o[0];if(o=t(),Za){on(!0);try{t()}finally{on(!1)}}return a.memoizedState=[o,n],o}function Od(t,n,a){return a===void 0||(bl&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=a,t=pg(),He.lanes|=t,da|=t,a)}function pm(t,n,a,o){return yn(a,n)?a:Br.current!==null?(t=Od(t,a,o),yn(t,n)||(Ht=!0),t):(bl&42)===0||(bl&1073741824)!==0&&(Qe&261930)===0?(Ht=!0,t.memoizedState=a):(t=pg(),He.lanes|=t,da|=t,n)}function hm(t,n,a,o,f){var h=oe.p;oe.p=h!==0&&8>h?h:8;var v=V.T,E={};V.T=E,Id(t,!1,n,a);try{var U=f(),F=V.S;if(F!==null&&F(E,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ie=St(U,o);Ks(t,n,ie,ei(t))}else Ks(t,n,o,ei(t))}catch(re){Ks(t,n,{then:function(){},status:"rejected",reason:re},ei())}finally{oe.p=h,v!==null&&E.types!==null&&(v.types=E.types),V.T=v}}function jw(){}function zd(t,n,a,o){if(t.tag!==5)throw Error(r(476));var f=mm(t).queue;hm(t,f,n,ye,a===null?jw:function(){return gm(t),a(o)})}function mm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:ye},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function gm(t){var n=mm(t);n.next===null&&(n=t.alternate.memoizedState),Ks(t,n.next.queue,{},ei())}function Ld(){return Ut(po)}function ym(){return Mt().memoizedState}function xm(){return Mt().memoizedState}function Sw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=ei();t=aa(a);var o=ra(n,t,a);o!==null&&(Ln(o,n,a),Vs(o,n,a)),n={cache:M()},t.payload=n;return}n=n.return}}function Cw(t,n,a){var o=ei();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bu(t)?vm(n,a):(a=Os(t,n,a,o),a!==null&&(Ln(a,t,o),wm(a,n,o)))}function bm(t,n,a){var o=ei();Ks(t,n,a,o)}function Ks(t,n,a,o){var f={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Bu(t))vm(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,E=h(v,a);if(f.hasEagerState=!0,f.eagerState=E,yn(E,v))return Mr(t,n,f,0),mt===null&&pl(),!1}catch{}finally{}if(a=Os(t,n,f,o),a!==null)return Ln(a,t,o),wm(a,n,o),!0}return!1}function Id(t,n,a,o){if(o={lane:2,revertLane:gf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Bu(t)){if(n)throw Error(r(479))}else n=Os(t,a,o,2),n!==null&&Ln(n,t,2)}function Bu(t){var n=t.alternate;return t===He||n!==null&&n===He}function vm(t,n){qr=Ru=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function wm(t,n,a){if((a&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,cs(t,a)}}var Xs={readContext:Ut,use:zu,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Xs.useEffectEvent=Ct;var km={readContext:Ut,use:zu,useCallback:function(t,n){return bn().memoizedState=[t,n===void 0?null:n],t},useContext:Ut,useEffect:am,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,Iu(4194308,4,um.bind(null,n,t),a)},useLayoutEffect:function(t,n){return Iu(4194308,4,t,n)},useInsertionEffect:function(t,n){Iu(4,2,t,n)},useMemo:function(t,n){var a=bn();n=n===void 0?null:n;var o=t();if(Za){on(!0);try{t()}finally{on(!1)}}return a.memoizedState=[o,n],o},useReducer:function(t,n,a){var o=bn();if(a!==void 0){var f=a(n);if(Za){on(!0);try{a(n)}finally{on(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=Cw.bind(null,He,t),[o.memoizedState,t]},useRef:function(t){var n=bn();return t={current:t},n.memoizedState=t},useState:function(t){t=_d(t);var n=t.queue,a=bm.bind(null,He,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:Md,useDeferredValue:function(t,n){var a=bn();return Od(a,t,n)},useTransition:function(){var t=_d(!1);return t=hm.bind(null,He,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var o=He,f=bn();if(Pe){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),mt===null)throw Error(r(349));(Qe&127)!==0||Gh(o,n,a)}f.memoizedState=a;var h={value:a,getSnapshot:n};return f.queue=h,am(Ph.bind(null,o,h,t),[t]),o.flags|=2048,$r(9,{destroy:void 0},Vh.bind(null,o,h,a,n),null),a},useId:function(){var t=bn(),n=mt.identifierPrefix;if(Pe){var a=Wn,o=En;a=(o&~(1<<32-rt(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Mu++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=xw++,n="_"+n+"r_"+a.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Ld,useFormState:em,useActionState:em,useOptimistic:function(t){var n=bn();n.memoizedState=n.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Id.bind(null,He,!0,a),a.dispatch=n,[t,n]},useMemoCache:Ed,useCacheRefresh:function(){return bn().memoizedState=Sw.bind(null,He)},useEffectEvent:function(t){var n=bn(),a={impl:t};return n.memoizedState=a,function(){if((at&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Ud={readContext:Ut,use:zu,useCallback:dm,useContext:Ut,useEffect:Rd,useImperativeHandle:cm,useInsertionEffect:sm,useLayoutEffect:om,useMemo:fm,useReducer:Lu,useRef:lm,useState:function(){return Lu(vl)},useDebugValue:Md,useDeferredValue:function(t,n){var a=Mt();return pm(a,dt.memoizedState,t,n)},useTransition:function(){var t=Lu(vl)[0],n=Mt().memoizedState;return[typeof t=="boolean"?t:Ws(t),n]},useSyncExternalStore:$h,useId:ym,useHostTransitionStatus:Ld,useFormState:tm,useActionState:tm,useOptimistic:function(t,n){var a=Mt();return Wh(a,dt,t,n)},useMemoCache:Ed,useCacheRefresh:xm};Ud.useEffectEvent=rm;var jm={readContext:Ut,use:zu,useCallback:dm,useContext:Ut,useEffect:Rd,useImperativeHandle:cm,useInsertionEffect:sm,useLayoutEffect:om,useMemo:fm,useReducer:Nd,useRef:lm,useState:function(){return Nd(vl)},useDebugValue:Md,useDeferredValue:function(t,n){var a=Mt();return dt===null?Od(a,t,n):pm(a,dt.memoizedState,t,n)},useTransition:function(){var t=Nd(vl)[0],n=Mt().memoizedState;return[typeof t=="boolean"?t:Ws(t),n]},useSyncExternalStore:$h,useId:ym,useHostTransitionStatus:Ld,useFormState:im,useActionState:im,useOptimistic:function(t,n){var a=Mt();return dt!==null?Wh(a,dt,t,n):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Ed,useCacheRefresh:xm};jm.useEffectEvent=rm;function Bd(t,n,a,o){n=t.memoizedState,a=a(o,n),a=a==null?n:y({},n,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var qd={enqueueSetState:function(t,n,a){t=t._reactInternals;var o=ei(),f=aa(o);f.payload=n,a!=null&&(f.callback=a),n=ra(t,f,o),n!==null&&(Ln(n,t,o),Vs(n,t,o))},enqueueReplaceState:function(t,n,a){t=t._reactInternals;var o=ei(),f=aa(o);f.tag=1,f.payload=n,a!=null&&(f.callback=a),n=ra(t,f,o),n!==null&&(Ln(n,t,o),Vs(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var a=ei(),o=aa(a);o.tag=2,n!=null&&(o.callback=n),n=ra(t,o,a),n!==null&&(Ln(n,t,a),Vs(n,t,a))}};function Sm(t,n,a,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!$a(a,o)||!$a(f,h):!0}function Cm(t,n,a,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,o),n.state!==t&&qd.enqueueReplaceState(n,n.state,null)}function Ja(t,n){var a=n;if("ref"in n){a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}if(t=t.defaultProps){a===n&&(a=y({},a));for(var f in t)a[f]===void 0&&(a[f]=t[f])}return a}function Tm(t){Rr(t)}function Em(t){console.error(t)}function Am(t){Rr(t)}function qu(t,n){try{var a=t.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Nm(t,n,a){try{var o=t.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Hd(t,n,a){return a=aa(a),a.tag=3,a.payload={element:null},a.callback=function(){qu(t,n)},a}function _m(t){return t=aa(t),t.tag=3,t}function Dm(t,n,a,o){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){Nm(n,a,o)}}var v=a.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Nm(n,a,o),typeof f!="function"&&(fa===null?fa=new Set([this]):fa.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})})}function Tw(t,n,a,o,f){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=a.alternate,n!==null&&ia(n,a,f,!0),a=Xn.current,a!==null){switch(a.tag){case 31:case 13:return di===null?Zu():a.alternate===null&&Tt===0&&(Tt=3),a.flags&=-257,a.flags|=65536,a.lanes=f,o===Eu?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([o]):n.add(o),pf(t,o,f)),!1;case 22:return a.flags|=65536,o===Eu?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([o]):a.add(o)),pf(t,o,f)),!1}throw Error(r(435,a.tag))}return pf(t,o,f),Zu(),!1}if(Pe)return n=Xn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==ml&&(t=Error(r(422),{cause:o}),ci(Cn(t,a)))):(o!==ml&&(n=Error(r(423),{cause:o}),ci(Cn(n,a))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Cn(o,a),f=Hd(t.stateNode,o,f),yd(t,f),Tt!==4&&(Tt=2)),!1;var h=Error(r(520),{cause:o});if(h=Cn(h,a),lo===null?lo=[h]:lo.push(h),Tt!==4&&(Tt=2),n===null)return!0;o=Cn(o,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,t=f&-f,a.lanes|=t,t=Hd(a.stateNode,o,t),yd(a,t),!1;case 1:if(n=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(fa===null||!fa.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=_m(f),Dm(f,t,a,o),yd(a,f),!1}a=a.return}while(a!==null);return!1}var $d=Error(r(461)),Ht=!1;function ln(t,n,a,o){n.child=t===null?zh(n,null,a,o):Qa(n,t.child,a,o)}function Rm(t,n,a,o,f){a=a.render;var h=n.ref;if("ref"in o){var v={};for(var E in o)E!=="ref"&&(v[E]=o[E])}else v=o;return xl(n),o=jd(t,n,a,v,h,f),E=Sd(),t!==null&&!Ht?(Cd(t,n,f),wl(t,n,f)):(Pe&&E&&ea(n),n.flags|=1,ln(t,n,o,f),n.child)}function Mm(t,n,a,o,f){if(t===null){var h=a.type;return typeof h=="function"&&!zs(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,Om(t,n,h,o,f)):(t=Or(a.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!Xd(t,f)){var v=h.memoizedProps;if(a=a.compare,a=a!==null?a:$a,a(v,o)&&t.ref===n.ref)return wl(t,n,f)}return n.flags|=1,t=Si(h,o),t.ref=n.ref,t.return=n,n.child=t}function Om(t,n,a,o,f){if(t!==null){var h=t.memoizedProps;if($a(h,o)&&t.ref===n.ref)if(Ht=!1,n.pendingProps=o=h,Xd(t,f))(t.flags&131072)!==0&&(Ht=!0);else return n.lanes=t.lanes,wl(t,n,f)}return Gd(t,n,a,o,f)}function zm(t,n,a,o){var f=o.children,h=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|a:a,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~h}else o=0,n.child=null;return Lm(t,n,h,a,o)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Fi(n,h!==null?h.cachePool:null),h!==null?Uh(n,h):bd(),Bh(n);else return o=n.lanes=536870912,Lm(t,n,h!==null?h.baseLanes|a:a,a,o)}else h!==null?(Fi(n,h.cachePool),Uh(n,h),oa(),n.memoizedState=null):(t!==null&&Fi(n,null),bd(),oa());return ln(t,n,f,a),n.child}function Qs(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Lm(t,n,a,o,f){var h=Ei();return h=h===null?null:{parent:S._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},t!==null&&Fi(n,null),bd(),Bh(n),t!==null&&ia(t,n,o,!0),n.childLanes=f,null}function Hu(t,n){return n=Gu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Im(t,n,a){return Qa(n,t.child,null,a),t=Hu(n,n.pendingProps),t.flags|=2,Qn(n),n.memoizedState=null,t}function Ew(t,n,a){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Pe){if(o.mode==="hidden")return t=Hu(n,o),n.lanes=536870912,Qs(null,t);if(wd(n),(t=ht)?(t=Kg(t,Nn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:dn!==null?{id:En,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},a=wu(t),a.return=n,n.child=a,Yt=n,ht=null)):t=null,t===null)throw _n(n);return n.lanes=536870912,null}return Hu(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(wd(n),f)if(n.flags&256)n.flags&=-257,n=Im(t,n,a);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ht||ia(t,n,a,!1),f=(a&t.childLanes)!==0,Ht||f){if(o=mt,o!==null&&(v=Ko(o,a),v!==0&&v!==h.retryLane))throw h.retryLane=v,Pi(t,v),Ln(o,t,v),$d;Zu(),n=Im(t,n,a)}else t=h.treeContext,ht=fi(v.nextSibling),Yt=n,Pe=!0,An=null,Nn=!1,t!==null&&ju(n,t),n=Hu(n,o),n.flags|=4096;return n}return t=Si(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function $u(t,n){var a=n.ref;if(a===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(t===null||t.ref!==a)&&(n.flags|=4194816)}}function Gd(t,n,a,o,f){return xl(n),a=jd(t,n,a,o,void 0,f),o=Sd(),t!==null&&!Ht?(Cd(t,n,f),wl(t,n,f)):(Pe&&o&&ea(n),n.flags|=1,ln(t,n,a,f),n.child)}function Um(t,n,a,o,f,h){return xl(n),n.updateQueue=null,a=Hh(n,o,a,f),qh(t),o=Sd(),t!==null&&!Ht?(Cd(t,n,h),wl(t,n,h)):(Pe&&o&&ea(n),n.flags|=1,ln(t,n,a,h),n.child)}function Bm(t,n,a,o,f){if(xl(n),n.stateNode===null){var h=Ql,v=a.contextType;typeof v=="object"&&v!==null&&(h=Ut(v)),h=new a(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=qd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},md(n),v=a.contextType,h.context=typeof v=="object"&&v!==null?Ut(v):Ql,h.state=n.memoizedState,v=a.getDerivedStateFromProps,typeof v=="function"&&(Bd(n,a,v,o),h.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&qd.enqueueReplaceState(h,h.state,null),Ys(n,o,h,f),Ps(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var E=n.memoizedProps,U=Ja(a,E);h.props=U;var F=h.context,ie=a.contextType;v=Ql,typeof ie=="object"&&ie!==null&&(v=Ut(ie));var re=a.getDerivedStateFromProps;ie=typeof re=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,ie||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||F!==v)&&Cm(n,h,o,v),la=!1;var W=n.memoizedState;h.state=W,Ys(n,o,h,f),Ps(),F=n.memoizedState,E||W!==F||la?(typeof re=="function"&&(Bd(n,a,re,o),F=n.memoizedState),(U=la||Sm(n,a,U,o,W,F,v))?(ie||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=F),h.props=o,h.state=F,h.context=v,o=U):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,gd(t,n),v=n.memoizedProps,ie=Ja(a,v),h.props=ie,re=n.pendingProps,W=h.context,F=a.contextType,U=Ql,typeof F=="object"&&F!==null&&(U=Ut(F)),E=a.getDerivedStateFromProps,(F=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==re||W!==U)&&Cm(n,h,o,U),la=!1,W=n.memoizedState,h.state=W,Ys(n,o,h,f),Ps();var Q=n.memoizedState;v!==re||W!==Q||la||t!==null&&t.dependencies!==null&&zr(t.dependencies)?(typeof E=="function"&&(Bd(n,a,E,o),Q=n.memoizedState),(ie=la||Sm(n,a,ie,o,W,Q,U)||t!==null&&t.dependencies!==null&&zr(t.dependencies))?(F||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Q,U),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Q,U)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Q),h.props=o,h.state=Q,h.context=U,o=ie):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,$u(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=Qa(n,t.child,null,f),n.child=Qa(n,null,a,f)):ln(t,n,a,f),n.memoizedState=h.state,t=n.child):t=wl(t,n,f),t}function qm(t,n,a,o){return gl(),n.flags|=256,ln(t,n,a,o),n.child}var Vd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pd(t){return{baseLanes:t,cachePool:Lr()}}function Yd(t,n,a){return t=t!==null?t.childLanes&~a:0,n&&(t|=Jn),t}function Hm(t,n,a){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(Rt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Pe){if(f?sa(n):oa(),(t=ht)?(t=Kg(t,Nn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:dn!==null?{id:En,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},a=wu(t),a.return=n,n.child=a,Yt=n,ht=null)):t=null,t===null)throw _n(n);return Nf(t)?n.lanes=32:n.lanes=536870912,null}var E=o.children;return o=o.fallback,f?(oa(),f=n.mode,E=Gu({mode:"hidden",children:E},f),o=hl(o,f,a,null),E.return=n,o.return=n,E.sibling=o,n.child=E,o=n.child,o.memoizedState=Pd(a),o.childLanes=Yd(t,v,a),n.memoizedState=Vd,Qs(null,o)):(sa(n),Fd(n,E))}var U=t.memoizedState;if(U!==null&&(E=U.dehydrated,E!==null)){if(h)n.flags&256?(sa(n),n.flags&=-257,n=Wd(t,n,a)):n.memoizedState!==null?(oa(),n.child=t.child,n.flags|=128,n=null):(oa(),E=o.fallback,f=n.mode,o=Gu({mode:"visible",children:o.children},f),E=hl(E,f,a,null),E.flags|=2,o.return=n,E.return=n,o.sibling=E,n.child=o,Qa(n,t.child,null,a),o=n.child,o.memoizedState=Pd(a),o.childLanes=Yd(t,v,a),n.memoizedState=Vd,n=Qs(null,o));else if(sa(n),Nf(E)){if(v=E.nextSibling&&E.nextSibling.dataset,v)var F=v.dgst;v=F,o=Error(r(419)),o.stack="",o.digest=v,ci({value:o,source:null,stack:null}),n=Wd(t,n,a)}else if(Ht||ia(t,n,a,!1),v=(a&t.childLanes)!==0,Ht||v){if(v=mt,v!==null&&(o=Ko(v,a),o!==0&&o!==U.retryLane))throw U.retryLane=o,Pi(t,o),Ln(v,t,o),$d;Af(E)||Zu(),n=Wd(t,n,a)}else Af(E)?(n.flags|=192,n.child=t.child,n=null):(t=U.treeContext,ht=fi(E.nextSibling),Yt=n,Pe=!0,An=null,Nn=!1,t!==null&&ju(n,t),n=Fd(n,o.children),n.flags|=4096);return n}return f?(oa(),E=o.fallback,f=n.mode,U=t.child,F=U.sibling,o=Si(U,{mode:"hidden",children:o.children}),o.subtreeFlags=U.subtreeFlags&65011712,F!==null?E=Si(F,E):(E=hl(E,f,a,null),E.flags|=2),E.return=n,o.return=n,o.sibling=E,n.child=o,Qs(null,o),o=n.child,E=t.child.memoizedState,E===null?E=Pd(a):(f=E.cachePool,f!==null?(U=S._currentValue,f=f.parent!==U?{parent:U,pool:U}:f):f=Lr(),E={baseLanes:E.baseLanes|a,cachePool:f}),o.memoizedState=E,o.childLanes=Yd(t,v,a),n.memoizedState=Vd,Qs(t.child,o)):(sa(n),a=t.child,t=a.sibling,a=Si(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=a,n.memoizedState=null,a)}function Fd(t,n){return n=Gu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Gu(t,n){return t=xn(22,t,null,n),t.lanes=0,t}function Wd(t,n,a){return Qa(n,t.child,null,a),t=Fd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function $m(t,n,a){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),qs(t.return,n,a)}function Kd(t,n,a,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=a,v.tailMode=f,v.treeForkCount=h)}function Gm(t,n,a){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=Rt.current,E=(v&2)!==0;if(E?(v=v&1|2,n.flags|=128):v&=1,C(Rt,v),ln(t,n,o,a),o=Pe?Pa:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$m(t,a,n);else if(t.tag===19)$m(t,a,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(a=n.child,f=null;a!==null;)t=a.alternate,t!==null&&Du(t)===null&&(f=a),a=a.sibling;a=f,a===null?(f=n.child,n.child=null):(f=a.sibling,a.sibling=null),Kd(n,!1,f,a,h,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Du(t)===null){n.child=f;break}t=f.sibling,f.sibling=a,a=f,f=t}Kd(n,!0,a,null,h,o);break;case"together":Kd(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function wl(t,n,a){if(t!==null&&(n.dependencies=t.dependencies),da|=n.lanes,(a&n.childLanes)===0)if(t!==null){if(ia(t,n,a,!1),(a&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,a=Si(t,t.pendingProps),n.child=a,a.return=n;t.sibling!==null;)t=t.sibling,a=a.sibling=Si(t,t.pendingProps),a.return=n;a.sibling=null}return n.child}function Xd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&zr(t)))}function Aw(t,n,a){switch(n.tag){case 3:Le(n,n.stateNode.containerInfo),Yi(n,S,t.memoizedState.cache),gl();break;case 27:case 5:Ot(n);break;case 4:Le(n,n.stateNode.containerInfo);break;case 10:Yi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,wd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(sa(n),n.flags|=128,null):(a&n.child.childLanes)!==0?Hm(t,n,a):(sa(n),t=wl(t,n,a),t!==null?t.sibling:null);sa(n);break;case 19:var f=(t.flags&128)!==0;if(o=(a&n.childLanes)!==0,o||(ia(t,n,a,!1),o=(a&n.childLanes)!==0),f){if(o)return Gm(t,n,a);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(Rt,Rt.current),o)break;return null;case 22:return n.lanes=0,zm(t,n,a,n.pendingProps);case 24:Yi(n,S,t.memoizedState.cache)}return wl(t,n,a)}function Vm(t,n,a){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ht=!0;else{if(!Xd(t,a)&&(n.flags&128)===0)return Ht=!1,Aw(t,n,a);Ht=(t.flags&131072)!==0}else Ht=!1,Pe&&(n.flags&1048576)!==0&&Us(n,Pa,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Ka(n.elementType),n.type=t,typeof t=="function")zs(t)?(o=Ja(t,o),n.tag=1,n=Bm(null,n,t,o,a)):(n.tag=0,n=Gd(null,n,t,o,a));else{if(t!=null){var f=t.$$typeof;if(f===P){n.tag=11,n=Rm(null,n,t,o,a);break e}else if(f===X){n.tag=14,n=Mm(null,n,t,o,a);break e}}throw n=ge(t)||t,Error(r(306,n,""))}}return n;case 0:return Gd(t,n,n.type,n.pendingProps,a);case 1:return o=n.type,f=Ja(o,n.pendingProps),Bm(t,n,o,f,a);case 3:e:{if(Le(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,gd(t,n),Ys(n,o,null,a);var v=n.memoizedState;if(o=v.cache,Yi(n,S,o),o!==h.cache&&Ya(n,[S],a,!0),Ps(),o=v.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=qm(t,n,o,a);break e}else if(o!==f){f=Cn(Error(r(424)),n),ci(f),n=qm(t,n,o,a);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ht=fi(t.firstChild),Yt=n,Pe=!0,An=null,Nn=!0,a=zh(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(gl(),o===f){n=wl(t,n,a);break e}ln(t,n,o,a)}n=n.child}return n;case 26:return $u(t,n),t===null?(a=ty(n.type,null,n.pendingProps,null))?n.memoizedState=a:Pe||(a=n.type,t=n.pendingProps,o=ac(Z.current).createElement(a),o[bt]=n,o[Nt]=t,an(o,a,t),_t(o),n.stateNode=o):n.memoizedState=ty(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ot(n),t===null&&Pe&&(o=n.stateNode=Zg(n.type,n.pendingProps,Z.current),Yt=n,Nn=!0,f=ht,ga(n.type)?(_f=f,ht=fi(o.firstChild)):ht=f),ln(t,n,n.pendingProps.children,a),$u(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Pe&&((f=o=ht)&&(o=lk(o,n.type,n.pendingProps,Nn),o!==null?(n.stateNode=o,Yt=n,ht=fi(o.firstChild),Nn=!1,f=!0):f=!1),f||_n(n)),Ot(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,Cf(f,h)?o=null:v!==null&&Cf(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=jd(t,n,bw,null,null,a),po._currentValue=f),$u(t,n),ln(t,n,o,a),n.child;case 6:return t===null&&Pe&&((t=a=ht)&&(a=ak(a,n.pendingProps,Nn),a!==null?(n.stateNode=a,Yt=n,ht=null,t=!0):t=!1),t||_n(n)),null;case 13:return Hm(t,n,a);case 4:return Le(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=Qa(n,null,o,a):ln(t,n,o,a),n.child;case 11:return Rm(t,n,n.type,n.pendingProps,a);case 7:return ln(t,n,n.pendingProps,a),n.child;case 8:return ln(t,n,n.pendingProps.children,a),n.child;case 12:return ln(t,n,n.pendingProps.children,a),n.child;case 10:return o=n.pendingProps,Yi(n,n.type,o.value),ln(t,n,o.children,a),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,xl(n),f=Ut(f),o=o(f),n.flags|=1,ln(t,n,o,a),n.child;case 14:return Mm(t,n,n.type,n.pendingProps,a);case 15:return Om(t,n,n.type,n.pendingProps,a);case 19:return Gm(t,n,a);case 31:return Ew(t,n,a);case 22:return zm(t,n,a,n.pendingProps);case 24:return xl(n),o=Ut(S),t===null?(f=Ei(),f===null&&(f=mt,h=M(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),n.memoizedState={parent:o,cache:f},md(n),Yi(n,S,f)):((t.lanes&a)!==0&&(gd(t,n),Ys(n,null,null,a),Ps()),f=t.memoizedState,h=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Yi(n,S,o)):(o=h.cache,Yi(n,S,o),o!==f.cache&&Ya(n,[S],a,!0))),ln(t,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function kl(t){t.flags|=4}function Qd(t,n,a,o,f){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(yg())t.flags|=8192;else throw Xa=Eu,hd}else t.flags&=-16777217}function Pm(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ry(n))if(yg())t.flags|=8192;else throw Xa=Eu,hd}function Vu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Fo():536870912,t.lanes|=n,Yr|=n)}function Zs(t,n){if(!Pe)switch(t.tailMode){case"hidden":n=t.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function xt(t){var n=t.alternate!==null&&t.alternate.child===t.child,a=0,o=0;if(n)for(var f=t.child;f!==null;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=a,n}function Nw(t,n,a){var o=n.pendingProps;switch(Bs(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(n),null;case 1:return xt(n),null;case 3:return a=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Ti(S),Xe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(na(n)?kl(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,st())),xt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(kl(n),h!==null?(xt(n),Pm(n,h)):(xt(n),Qd(n,f,null,o,a))):h?h!==t.memoizedState?(kl(n),xt(n),Pm(n,h)):(xt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&kl(n),xt(n),Qd(n,f,t,o,a)),null;case 27:if(Wt(n),a=Z.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&kl(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}t=K.current,na(n)?ta(n):(t=Zg(f,o,a),n.stateNode=t,kl(n))}return xt(n),null;case 5:if(Wt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&kl(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}if(h=K.current,na(n))ta(n);else{var v=ac(Z.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}h[bt]=n,h[Nt]=o;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=h;e:switch(an(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&kl(n)}}return xt(n),Qd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,a),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&kl(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=Z.current,na(n)){if(t=n.stateNode,a=n.memoizedProps,o=null,f=Yt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[bt]=n,t=!!(t.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||Hg(t.nodeValue,a)),t||_n(n,!0)}else t=ac(t).createTextNode(o),t[bt]=n,n.stateNode=t}return xt(n),null;case 31:if(a=n.memoizedState,t===null||t.memoizedState!==null){if(o=na(n),a!==null){if(t===null){if(!o)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[bt]=n}else gl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),t=!1}else a=st(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return n.flags&256?(Qn(n),n):(Qn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return xt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=na(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[bt]=n}else gl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),f=!1}else f=st(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Qn(n),n):(Qn(n),null)}return Qn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,t=t!==null&&t.memoizedState!==null,a&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),a!==t&&a&&(n.child.flags|=8192),Vu(n,n.updateQueue),xt(n),null);case 4:return Xe(),t===null&&vf(n.stateNode.containerInfo),xt(n),null;case 10:return Ti(n.type),xt(n),null;case 19:if(L(Rt),o=n.memoizedState,o===null)return xt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)Zs(o,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Du(t),h!==null){for(n.flags|=128,Zs(o,!1),t=h.updateQueue,n.updateQueue=t,Vu(n,t),n.subtreeFlags=0,t=a,a=n.child;a!==null;)vu(a,t),a=a.sibling;return C(Rt,Rt.current&1|2),Pe&&Kn(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Lt()>Ku&&(n.flags|=128,f=!0,Zs(o,!1),n.lanes=4194304)}else{if(!f)if(t=Du(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Vu(n,t),Zs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Pe)return xt(n),null}else 2*Lt()-o.renderingStartTime>Ku&&a!==536870912&&(n.flags|=128,f=!0,Zs(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Lt(),t.sibling=null,a=Rt.current,C(Rt,f?a&1|2:a&1),Pe&&Kn(n,o.treeForkCount),t):(xt(n),null);case 22:case 23:return Qn(n),vd(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(xt(n),n.subtreeFlags&6&&(n.flags|=8192)):xt(n),a=n.updateQueue,a!==null&&Vu(n,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),t!==null&&L(Bt),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Ti(S),xt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function _w(t,n){switch(Bs(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Ti(S),Xe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Wt(n),null;case 31:if(n.memoizedState!==null){if(Qn(n),n.alternate===null)throw Error(r(340));gl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Qn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));gl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return L(Rt),null;case 4:return Xe(),null;case 10:return Ti(n.type),null;case 22:case 23:return Qn(n),vd(),t!==null&&L(Bt),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Ti(S),null;case 25:return null;default:return null}}function Ym(t,n){switch(Bs(n),n.tag){case 3:Ti(S),Xe();break;case 26:case 27:case 5:Wt(n);break;case 4:Xe();break;case 31:n.memoizedState!==null&&Qn(n);break;case 13:Qn(n);break;case 19:L(Rt);break;case 10:Ti(n.type);break;case 22:case 23:Qn(n),vd(),t!==null&&L(Bt);break;case 24:Ti(S)}}function Js(t,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var f=o.next;a=f;do{if((a.tag&t)===t){o=void 0;var h=a.create,v=a.inst;o=h(),v.destroy=o}a=a.next}while(a!==f)}}catch(E){ct(n,n.return,E)}}function ua(t,n,a){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var v=o.inst,E=v.destroy;if(E!==void 0){v.destroy=void 0,f=n;var U=a,F=E;try{F()}catch(ie){ct(f,U,ie)}}}o=o.next}while(o!==h)}}catch(ie){ct(n,n.return,ie)}}function Fm(t){var n=t.updateQueue;if(n!==null){var a=t.stateNode;try{Ih(n,a)}catch(o){ct(t,t.return,o)}}}function Wm(t,n,a){a.props=Ja(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(o){ct(t,n,o)}}function eo(t,n){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof a=="function"?t.refCleanup=a(o):a.current=o}}catch(f){ct(t,n,f)}}function Wi(t,n){var a=t.ref,o=t.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(f){ct(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){ct(t,n,f)}else a.current=null}function Km(t){var n=t.type,a=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(f){ct(t,t.return,f)}}function Zd(t,n,a){try{var o=t.stateNode;Zw(o,t.type,a,n),o[Nt]=n}catch(f){ct(t,t.return,f)}}function Xm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ga(t.type)||t.tag===4}function Jd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Xm(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&&ga(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 ef(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(t),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=Pn));else if(o!==4&&(o===27&&ga(t.type)&&(a=t.stateNode,n=null),t=t.child,t!==null))for(ef(t,n,a),t=t.sibling;t!==null;)ef(t,n,a),t=t.sibling}function Pu(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?a.insertBefore(t,n):a.appendChild(t);else if(o!==4&&(o===27&&ga(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Pu(t,n,a),t=t.sibling;t!==null;)Pu(t,n,a),t=t.sibling}function Qm(t){var n=t.stateNode,a=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);an(n,o,a),n[bt]=t,n[Nt]=a}catch(h){ct(t,t.return,h)}}var jl=!1,$t=!1,tf=!1,Zm=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function Dw(t,n){if(t=t.containerInfo,jf=fc,t=hu(t),Ds(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var v=0,E=-1,U=-1,F=0,ie=0,re=t,W=null;t:for(;;){for(var Q;re!==a||f!==0&&re.nodeType!==3||(E=v+f),re!==h||o!==0&&re.nodeType!==3||(U=v+o),re.nodeType===3&&(v+=re.nodeValue.length),(Q=re.firstChild)!==null;)W=re,re=Q;for(;;){if(re===t)break t;if(W===a&&++F===f&&(E=v),W===h&&++ie===o&&(U=v),(Q=re.nextSibling)!==null)break;re=W,W=re.parentNode}re=Q}a=E===-1||U===-1?null:{start:E,end:U}}else a=null}a=a||{start:0,end:0}}else a=null;for(Sf={focusedElem:t,selectionRange:a},fc=!1,Zt=n;Zt!==null;)if(n=Zt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Zt=t;else for(;Zt!==null;){switch(n=Zt,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)f=t[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,a=n,f=h.memoizedProps,h=h.memoizedState,o=a.stateNode;try{var ve=Ja(a.type,f);t=o.getSnapshotBeforeUpdate(ve,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(Oe){ct(a,a.return,Oe)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,a=t.nodeType,a===9)Ef(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ef(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=n.sibling,t!==null){t.return=n.return,Zt=t;break}Zt=n.return}}function Jm(t,n,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(t,a),o&4&&Js(5,a);break;case 1:if(Cl(t,a),o&4)if(t=a.stateNode,n===null)try{t.componentDidMount()}catch(v){ct(a,a.return,v)}else{var f=Ja(a.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ct(a,a.return,v)}}o&64&&Fm(a),o&512&&eo(a,a.return);break;case 3:if(Cl(t,a),o&64&&(t=a.updateQueue,t!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Ih(t,n)}catch(v){ct(a,a.return,v)}}break;case 27:n===null&&o&4&&Qm(a);case 26:case 5:Cl(t,a),n===null&&o&4&&Km(a),o&512&&eo(a,a.return);break;case 12:Cl(t,a);break;case 31:Cl(t,a),o&4&&ng(t,a);break;case 13:Cl(t,a),o&4&&ig(t,a),o&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=qw.bind(null,a),rk(t,a))));break;case 22:if(o=a.memoizedState!==null||jl,!o){n=n!==null&&n.memoizedState!==null||$t,f=jl;var h=$t;jl=o,($t=n)&&!h?Tl(t,a,(a.subtreeFlags&8772)!==0):Cl(t,a),jl=f,$t=h}break;case 30:break;default:Cl(t,a)}}function eg(t){var n=t.alternate;n!==null&&(t.alternate=null,eg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Da(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 vt=null,Rn=!1;function Sl(t,n,a){for(a=a.child;a!==null;)tg(t,n,a),a=a.sibling}function tg(t,n,a){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(tt,a)}catch{}switch(a.tag){case 26:$t||Wi(a,n),Sl(t,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:$t||Wi(a,n);var o=vt,f=Rn;ga(a.type)&&(vt=a.stateNode,Rn=!1),Sl(t,n,a),uo(a.stateNode),vt=o,Rn=f;break;case 5:$t||Wi(a,n);case 6:if(o=vt,f=Rn,vt=null,Sl(t,n,a),vt=o,Rn=f,vt!==null)if(Rn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(a.stateNode)}catch(h){ct(a,n,h)}else try{vt.removeChild(a.stateNode)}catch(h){ct(a,n,h)}break;case 18:vt!==null&&(Rn?(t=vt,Fg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),es(t)):Fg(vt,a.stateNode));break;case 4:o=vt,f=Rn,vt=a.stateNode.containerInfo,Rn=!0,Sl(t,n,a),vt=o,Rn=f;break;case 0:case 11:case 14:case 15:ua(2,a,n),$t||ua(4,a,n),Sl(t,n,a);break;case 1:$t||(Wi(a,n),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Wm(a,n,o)),Sl(t,n,a);break;case 21:Sl(t,n,a);break;case 22:$t=(o=$t)||a.memoizedState!==null,Sl(t,n,a),$t=o;break;default:Sl(t,n,a)}}function ng(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{es(t)}catch(a){ct(n,n.return,a)}}}function ig(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{es(t)}catch(a){ct(n,n.return,a)}}function Rw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Zm),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Zm),n;default:throw Error(r(435,t.tag))}}function Yu(t,n){var a=Rw(t);n.forEach(function(o){if(!a.has(o)){a.add(o);var f=Hw.bind(null,t,o);o.then(f,f)}})}function Mn(t,n){var a=n.deletions;if(a!==null)for(var o=0;o<a.length;o++){var f=a[o],h=t,v=n,E=v;e:for(;E!==null;){switch(E.tag){case 27:if(ga(E.type)){vt=E.stateNode,Rn=!1;break e}break;case 5:vt=E.stateNode,Rn=!1;break e;case 3:case 4:vt=E.stateNode.containerInfo,Rn=!0;break e}E=E.return}if(vt===null)throw Error(r(160));tg(h,v,f),vt=null,Rn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)lg(n,t),n=n.sibling}var Ai=null;function lg(t,n){var a=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Mn(n,t),On(t),o&4&&(ua(3,t,t.return),Js(3,t),ua(5,t,t.return));break;case 1:Mn(n,t),On(t),o&512&&($t||a===null||Wi(a,a.return)),o&64&&jl&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var f=Ai;if(Mn(n,t),On(t),o&512&&($t||a===null||Wi(a,a.return)),o&4){var h=a!==null?a.memoizedState:null;if(o=t.memoizedState,a===null)if(o===null)if(t.stateNode===null){e:{o=t.type,a=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[bi]||h[bt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),an(h,o,a),h[bt]=t,_t(h),o=h;break e;case"link":var v=ly("link","href",f).get(o+(a.href||""));if(v){for(var E=0;E<v.length;E++)if(h=v[E],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){v.splice(E,1);break t}}h=f.createElement(o),an(h,o,a),f.head.appendChild(h);break;case"meta":if(v=ly("meta","content",f).get(o+(a.content||""))){for(E=0;E<v.length;E++)if(h=v[E],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){v.splice(E,1);break t}}h=f.createElement(o),an(h,o,a),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[bt]=t,_t(h),o=h}t.stateNode=o}else ay(f,t.type,t.stateNode);else t.stateNode=iy(f,o,t.memoizedProps);else h!==o?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,o===null?ay(f,t.type,t.stateNode):iy(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Zd(t,t.memoizedProps,a.memoizedProps)}break;case 27:Mn(n,t),On(t),o&512&&($t||a===null||Wi(a,a.return)),a!==null&&o&4&&Zd(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Mn(n,t),On(t),o&512&&($t||a===null||Wi(a,a.return)),t.flags&32){f=t.stateNode;try{Ii(f,"")}catch(ve){ct(t,t.return,ve)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,Zd(t,f,a!==null?a.memoizedProps:f)),o&1024&&(tf=!0);break;case 6:if(Mn(n,t),On(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,a=t.stateNode;try{a.nodeValue=o}catch(ve){ct(t,t.return,ve)}}break;case 3:if(oc=null,f=Ai,Ai=rc(n.containerInfo),Mn(n,t),Ai=f,On(t),o&4&&a!==null&&a.memoizedState.isDehydrated)try{es(n.containerInfo)}catch(ve){ct(t,t.return,ve)}tf&&(tf=!1,ag(t));break;case 4:o=Ai,Ai=rc(t.stateNode.containerInfo),Mn(n,t),On(t),Ai=o;break;case 12:Mn(n,t),On(t);break;case 31:Mn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Yu(t,o)));break;case 13:Mn(n,t),On(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Wu=Lt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Yu(t,o)));break;case 22:f=t.memoizedState!==null;var U=a!==null&&a.memoizedState!==null,F=jl,ie=$t;if(jl=F||f,$t=ie||U,Mn(n,t),$t=ie,jl=F,On(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(a===null||U||jl||$t||er(t)),a=null,n=t;;){if(n.tag===5||n.tag===26){if(a===null){U=a=n;try{if(h=U.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{E=U.stateNode;var re=U.memoizedProps.style,W=re!=null&&re.hasOwnProperty("display")?re.display:null;E.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(ve){ct(U,U.return,ve)}}}else if(n.tag===6){if(a===null){U=n;try{U.stateNode.nodeValue=f?"":U.memoizedProps}catch(ve){ct(U,U.return,ve)}}}else if(n.tag===18){if(a===null){U=n;try{var Q=U.stateNode;f?Wg(Q,!0):Wg(U.stateNode,!1)}catch(ve){ct(U,U.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;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,Yu(t,a))));break;case 19:Mn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Yu(t,o)));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 a,o=t.return;o!==null;){if(Xm(o)){a=o;break}o=o.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var f=a.stateNode,h=Jd(t);Pu(t,h,f);break;case 5:var v=a.stateNode;a.flags&32&&(Ii(v,""),a.flags&=-33);var E=Jd(t);Pu(t,E,v);break;case 3:case 4:var U=a.stateNode.containerInfo,F=Jd(t);ef(t,F,U);break;default:throw Error(r(161))}}catch(ie){ct(t,t.return,ie)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function ag(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;ag(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Cl(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Jm(t,n.alternate,n),n=n.sibling}function er(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:ua(4,n,n.return),er(n);break;case 1:Wi(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Wm(n,n.return,a),er(n);break;case 27:uo(n.stateNode);case 26:case 5:Wi(n,n.return),er(n);break;case 22:n.memoizedState===null&&er(n);break;case 30:er(n);break;default:er(n)}t=t.sibling}}function Tl(t,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,h=n,v=h.flags;switch(h.tag){case 0:case 11:case 15:Tl(f,h,a),Js(4,h);break;case 1:if(Tl(f,h,a),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(F){ct(o,o.return,F)}if(o=h,f=o.updateQueue,f!==null){var E=o.stateNode;try{var U=f.shared.hiddenCallbacks;if(U!==null)for(f.shared.hiddenCallbacks=null,f=0;f<U.length;f++)Lh(U[f],E)}catch(F){ct(o,o.return,F)}}a&&v&64&&Fm(h),eo(h,h.return);break;case 27:Qm(h);case 26:case 5:Tl(f,h,a),a&&o===null&&v&4&&Km(h),eo(h,h.return);break;case 12:Tl(f,h,a);break;case 31:Tl(f,h,a),a&&v&4&&ng(f,h);break;case 13:Tl(f,h,a),a&&v&4&&ig(f,h);break;case 22:h.memoizedState===null&&Tl(f,h,a),eo(h,h.return);break;case 30:break;default:Tl(f,h,a)}n=n.sibling}}function nf(t,n){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&q(a))}function lf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&q(t))}function Ni(t,n,a,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)rg(t,n,a,o),n=n.sibling}function rg(t,n,a,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:Ni(t,n,a,o),f&2048&&Js(9,n);break;case 1:Ni(t,n,a,o);break;case 3:Ni(t,n,a,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&q(t)));break;case 12:if(f&2048){Ni(t,n,a,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,E=h.onPostCommit;typeof E=="function"&&E(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){ct(n,n.return,U)}}else Ni(t,n,a,o);break;case 31:Ni(t,n,a,o);break;case 13:Ni(t,n,a,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?Ni(t,n,a,o):to(t,n):h._visibility&2?Ni(t,n,a,o):(h._visibility|=2,Gr(t,n,a,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&nf(v,n);break;case 24:Ni(t,n,a,o),f&2048&&lf(n.alternate,n);break;default:Ni(t,n,a,o)}}function Gr(t,n,a,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,E=a,U=o,F=v.flags;switch(v.tag){case 0:case 11:case 15:Gr(h,v,E,U,f),Js(8,v);break;case 23:break;case 22:var ie=v.stateNode;v.memoizedState!==null?ie._visibility&2?Gr(h,v,E,U,f):to(h,v):(ie._visibility|=2,Gr(h,v,E,U,f)),f&&F&2048&&nf(v.alternate,v);break;case 24:Gr(h,v,E,U,f),f&&F&2048&&lf(v.alternate,v);break;default:Gr(h,v,E,U,f)}n=n.sibling}}function to(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=t,o=n,f=o.flags;switch(o.tag){case 22:to(a,o),f&2048&&nf(o.alternate,o);break;case 24:to(a,o),f&2048&&lf(o.alternate,o);break;default:to(a,o)}n=n.sibling}}var no=8192;function Vr(t,n,a){if(t.subtreeFlags&no)for(t=t.child;t!==null;)sg(t,n,a),t=t.sibling}function sg(t,n,a){switch(t.tag){case 26:Vr(t,n,a),t.flags&no&&t.memoizedState!==null&&xk(a,Ai,t.memoizedState,t.memoizedProps);break;case 5:Vr(t,n,a);break;case 3:case 4:var o=Ai;Ai=rc(t.stateNode.containerInfo),Vr(t,n,a),Ai=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=no,no=16777216,Vr(t,n,a),no=o):Vr(t,n,a));break;default:Vr(t,n,a)}}function og(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 io(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Zt=o,cg(o,t)}og(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ug(t),t=t.sibling}function ug(t){switch(t.tag){case 0:case 11:case 15:io(t),t.flags&2048&&ua(9,t,t.return);break;case 3:io(t);break;case 12:io(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Fu(t)):io(t);break;default:io(t)}}function Fu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Zt=o,cg(o,t)}og(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:ua(8,n,n.return),Fu(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,Fu(n));break;default:Fu(n)}t=t.sibling}}function cg(t,n){for(;Zt!==null;){var a=Zt;switch(a.tag){case 0:case 11:case 15:ua(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:q(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,Zt=o;else e:for(a=t;Zt!==null;){o=Zt;var f=o.sibling,h=o.return;if(eg(o),o===a){Zt=null;break e}if(f!==null){f.return=h,Zt=f;break e}Zt=h}}}var Mw={getCacheForType:function(t){var n=Ut(S),a=n.data.get(t);return a===void 0&&(a=t(),n.data.set(t,a)),a},cacheSignal:function(){return Ut(S).controller.signal}},Ow=typeof WeakMap=="function"?WeakMap:Map,at=0,mt=null,Fe=null,Qe=0,ut=0,Zn=null,ca=!1,Pr=!1,af=!1,El=0,Tt=0,da=0,tr=0,rf=0,Jn=0,Yr=0,lo=null,zn=null,sf=!1,Wu=0,dg=0,Ku=1/0,Xu=null,fa=null,Ft=0,pa=null,Fr=null,Al=0,of=0,uf=null,fg=null,ao=0,cf=null;function ei(){return(at&2)!==0&&Qe!==0?Qe&-Qe:V.T!==null?gf():pr()}function pg(){if(Jn===0)if((Qe&536870912)===0||Pe){var t=Aa;Aa<<=1,(Aa&3932160)===0&&(Aa=262144),Jn=t}else Jn=536870912;return t=Xn.current,t!==null&&(t.flags|=32),Jn}function Ln(t,n,a){(t===mt&&(ut===2||ut===9)||t.cancelPendingCommit!==null)&&(Wr(t,0),ha(t,Qe,Jn,!1)),Ol(t,a),((at&2)===0||t!==mt)&&(t===mt&&((at&2)===0&&(tr|=a),Tt===4&&ha(t,Qe,Jn,!1)),Ki(t))}function hg(t,n,a){if((at&6)!==0)throw Error(r(327));var o=!a&&(n&127)===0&&(n&t.expiredLanes)===0||ot(t,n),f=o?Iw(t,n):ff(t,n,!0),h=o;do{if(f===0){Pr&&!o&&ha(t,n,0,!1);break}else{if(a=t.current.alternate,h&&!zw(a)){f=ff(t,n,!1),h=!1;continue}if(f===2){if(h=n,t.errorRecoveryDisabledLanes&h)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var E=t;f=lo;var U=E.current.memoizedState.isDehydrated;if(U&&(Wr(E,v).flags|=256),v=ff(E,v,!1),v!==2){if(af&&!U){E.errorRecoveryDisabledLanes|=h,tr|=h,f=4;break e}h=zn,zn=f,h!==null&&(zn===null?zn=h:zn.push.apply(zn,h))}f=v}if(h=!1,f!==2)continue}}if(f===1){Wr(t,0),ha(t,n,0,!0);break}e:{switch(o=t,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:ha(o,n,Jn,!ca);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Wu+300-Lt(),10<f)){if(ha(o,n,Jn,!ca),xi(o,0,!0)!==0)break e;Al=n,o.timeoutHandle=Pg(mg.bind(null,o,a,zn,Xu,sf,n,Jn,tr,Yr,ca,h,"Throttled",-0,0),f);break e}mg(o,a,zn,Xu,sf,n,Jn,tr,Yr,ca,h,null,-0,0)}}break}while(!0);Ki(t)}function mg(t,n,a,o,f,h,v,E,U,F,ie,re,W,Q){if(t.timeoutHandle=-1,re=n.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pn},sg(n,h,re);var ve=(h&62914560)===h?Wu-Lt():(h&4194048)===h?dg-Lt():0;if(ve=bk(re,ve),ve!==null){Al=h,t.cancelPendingCommit=ve(jg.bind(null,t,n,h,a,o,f,v,E,U,ie,re,null,W,Q)),ha(t,h,v,!F);return}}jg(t,n,h,a,o,f,v,E,U)}function zw(t){for(var n=t;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var f=a[o],h=f.getSnapshot;f=f.value;try{if(!yn(h(),f))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;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 ha(t,n,a,o){n&=~rf,n&=~tr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-rt(f),v=1<<h;o[h]=-1,f&=~v}a!==0&&Wo(t,a,n)}function Qu(){return(at&6)===0?(ro(0),!1):!0}function df(){if(Fe!==null){if(ut===0)var t=Fe.return;else t=Fe,nn=yl=null,Td(t),Ur=null,$s=0,t=Fe;for(;t!==null;)Ym(t.alternate,t),t=t.return;Fe=null}}function Wr(t,n){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,tk(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Al=0,df(),mt=t,Fe=a=Si(t.current,null),Qe=n,ut=0,Zn=null,ca=!1,Pr=ot(t,n),af=!1,Yr=Jn=rf=tr=da=Tt=0,zn=lo=null,sf=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var f=31-rt(o),h=1<<f;n|=t[f],o&=~h}return El=n,pl(),a}function gg(t,n){He=null,V.H=Xs,n===Ir||n===Tu?(n=Rh(),ut=3):n===hd?(n=Rh(),ut=4):ut=n===$d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Zn=n,Fe===null&&(Tt=1,qu(t,Cn(n,t.current)))}function yg(){var t=Xn.current;return t===null?!0:(Qe&4194048)===Qe?di===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===di:!1}function xg(){var t=V.H;return V.H=Xs,t===null?Xs:t}function bg(){var t=V.A;return V.A=Mw,t}function Zu(){Tt=4,ca||(Qe&4194048)!==Qe&&Xn.current!==null||(Pr=!0),(da&134217727)===0&&(tr&134217727)===0||mt===null||ha(mt,Qe,Jn,!1)}function ff(t,n,a){var o=at;at|=2;var f=xg(),h=bg();(mt!==t||Qe!==n)&&(Xu=null,Wr(t,n)),n=!1;var v=Tt;e:do try{if(ut!==0&&Fe!==null){var E=Fe,U=Zn;switch(ut){case 8:df(),v=6;break e;case 3:case 2:case 9:case 6:Xn.current===null&&(n=!0);var F=ut;if(ut=0,Zn=null,Kr(t,E,U,F),a&&Pr){v=0;break e}break;default:F=ut,ut=0,Zn=null,Kr(t,E,U,F)}}Lw(),v=Tt;break}catch(ie){gg(t,ie)}while(!0);return n&&t.shellSuspendCounter++,nn=yl=null,at=o,V.H=f,V.A=h,Fe===null&&(mt=null,Qe=0,pl()),v}function Lw(){for(;Fe!==null;)vg(Fe)}function Iw(t,n){var a=at;at|=2;var o=xg(),f=bg();mt!==t||Qe!==n?(Xu=null,Ku=Lt()+500,Wr(t,n)):Pr=ot(t,n);e:do try{if(ut!==0&&Fe!==null){n=Fe;var h=Zn;t:switch(ut){case 1:ut=0,Zn=null,Kr(t,n,h,1);break;case 2:case 9:if(_h(h)){ut=0,Zn=null,wg(n);break}n=function(){ut!==2&&ut!==9||mt!==t||(ut=7),Ki(t)},h.then(n,n);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:_h(h)?(ut=0,Zn=null,wg(n)):(ut=0,Zn=null,Kr(t,n,h,7));break;case 5:var v=null;switch(Fe.tag){case 26:v=Fe.memoizedState;case 5:case 27:var E=Fe;if(v?ry(v):E.stateNode.complete){ut=0,Zn=null;var U=E.sibling;if(U!==null)Fe=U;else{var F=E.return;F!==null?(Fe=F,Ju(F)):Fe=null}break t}}ut=0,Zn=null,Kr(t,n,h,5);break;case 6:ut=0,Zn=null,Kr(t,n,h,6);break;case 8:df(),Tt=6;break e;default:throw Error(r(462))}}Uw();break}catch(ie){gg(t,ie)}while(!0);return nn=yl=null,V.H=o,V.A=f,at=a,Fe!==null?0:(mt=null,Qe=0,pl(),Tt)}function Uw(){for(;Fe!==null&&!yi();)vg(Fe)}function vg(t){var n=Vm(t.alternate,t,El);t.memoizedProps=t.pendingProps,n===null?Ju(t):Fe=n}function wg(t){var n=t,a=n.alternate;switch(n.tag){case 15:case 0:n=Um(a,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=Um(a,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:Td(n);default:Ym(a,n),n=Fe=vu(n,El),n=Vm(a,n,El)}t.memoizedProps=t.pendingProps,n===null?Ju(t):Fe=n}function Kr(t,n,a,o){nn=yl=null,Td(n),Ur=null,$s=0;var f=n.return;try{if(Tw(t,f,n,a,Qe)){Tt=1,qu(t,Cn(a,t.current)),Fe=null;return}}catch(h){if(f!==null)throw Fe=f,h;Tt=1,qu(t,Cn(a,t.current)),Fe=null;return}n.flags&32768?(Pe||o===1?t=!0:Pr||(Qe&536870912)!==0?t=!1:(ca=t=!0,(o===2||o===9||o===3||o===6)&&(o=Xn.current,o!==null&&o.tag===13&&(o.flags|=16384))),kg(n,t)):Ju(n)}function Ju(t){var n=t;do{if((n.flags&32768)!==0){kg(n,ca);return}t=n.return;var a=Nw(n.alternate,n,El);if(a!==null){Fe=a;return}if(n=n.sibling,n!==null){Fe=n;return}Fe=n=t}while(n!==null);Tt===0&&(Tt=5)}function kg(t,n){do{var a=_w(t.alternate,t);if(a!==null){a.flags&=32767,Fe=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(t=t.sibling,t!==null)){Fe=t;return}Fe=t=a}while(t!==null);Tt=6,Fe=null}function jg(t,n,a,o,f,h,v,E,U){t.cancelPendingCommit=null;do ec();while(Ft!==0);if((at&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Vi,_a(t,a,h,v,E,U),t===mt&&(Fe=mt=null,Qe=0),Fr=n,pa=t,Al=a,of=h,uf=f,fg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,$w(Re,function(){return Ag(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=V.T,V.T=null,f=oe.p,oe.p=2,v=at,at|=4;try{Dw(t,n,a)}finally{at=v,oe.p=f,V.T=o}}Ft=1,Sg(),Cg(),Tg()}}function Sg(){if(Ft===1){Ft=0;var t=pa,n=Fr,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=V.T,V.T=null;var o=oe.p;oe.p=2;var f=at;at|=4;try{lg(n,t);var h=Sf,v=hu(t.containerInfo),E=h.focusedElem,U=h.selectionRange;if(v!==E&&E&&E.ownerDocument&&pu(E.ownerDocument.documentElement,E)){if(U!==null&&Ds(E)){var F=U.start,ie=U.end;if(ie===void 0&&(ie=F),"selectionStart"in E)E.selectionStart=F,E.selectionEnd=Math.min(ie,E.value.length);else{var re=E.ownerDocument||document,W=re&&re.defaultView||window;if(W.getSelection){var Q=W.getSelection(),ve=E.textContent.length,Oe=Math.min(U.start,ve),pt=U.end===void 0?Oe:Math.min(U.end,ve);!Q.extend&&Oe>pt&&(v=pt,pt=Oe,Oe=v);var $=fu(E,Oe),H=fu(E,pt);if($&&H&&(Q.rangeCount!==1||Q.anchorNode!==$.node||Q.anchorOffset!==$.offset||Q.focusNode!==H.node||Q.focusOffset!==H.offset)){var Y=re.createRange();Y.setStart($.node,$.offset),Q.removeAllRanges(),Oe>pt?(Q.addRange(Y),Q.extend(H.node,H.offset)):(Y.setEnd(H.node,H.offset),Q.addRange(Y))}}}}for(re=[],Q=E;Q=Q.parentNode;)Q.nodeType===1&&re.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<re.length;E++){var le=re[E];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}fc=!!jf,Sf=jf=null}finally{at=f,oe.p=o,V.T=a}}t.current=n,Ft=2}}function Cg(){if(Ft===2){Ft=0;var t=pa,n=Fr,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=V.T,V.T=null;var o=oe.p;oe.p=2;var f=at;at|=4;try{Jm(t,n.alternate,n)}finally{at=f,oe.p=o,V.T=a}}Ft=3}}function Tg(){if(Ft===4||Ft===3){Ft=0,Di();var t=pa,n=Fr,a=Al,o=fg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ft=5:(Ft=0,Fr=pa=null,Eg(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(fa=null),ds(a),n=n.stateNode,jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(tt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=V.T,f=oe.p,oe.p=2,V.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var E=o[v];h(E.value,{componentStack:E.stack})}}finally{V.T=n,oe.p=f}}(Al&3)!==0&&ec(),Ki(t),f=t.pendingLanes,(a&261930)!==0&&(f&42)!==0?t===cf?ao++:(ao=0,cf=t):ao=0,ro(0)}}function Eg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,q(n)))}function ec(){return Sg(),Cg(),Tg(),Ag()}function Ag(){if(Ft!==5)return!1;var t=pa,n=of;of=0;var a=ds(Al),o=V.T,f=oe.p;try{oe.p=32>a?32:a,V.T=null,a=uf,uf=null;var h=pa,v=Al;if(Ft=0,Fr=pa=null,Al=0,(at&6)!==0)throw Error(r(331));var E=at;if(at|=4,ug(h.current),rg(h,h.current,v,a),at=E,ro(0,!1),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(tt,h)}catch{}return!0}finally{oe.p=f,V.T=o,Eg(t,n)}}function Ng(t,n,a){n=Cn(a,n),n=Hd(t.stateNode,n,2),t=ra(t,n,2),t!==null&&(Ol(t,2),Ki(t))}function ct(t,n,a){if(t.tag===3)Ng(t,t,a);else for(;n!==null;){if(n.tag===3){Ng(n,t,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(fa===null||!fa.has(o))){t=Cn(a,t),a=_m(2),o=ra(n,a,2),o!==null&&(Dm(a,o,n,t),Ol(o,2),Ki(o));break}}n=n.return}}function pf(t,n,a){var o=t.pingCache;if(o===null){o=t.pingCache=new Ow;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(a)||(af=!0,f.add(a),t=Bw.bind(null,t,n,a),n.then(t,t))}function Bw(t,n,a){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,mt===t&&(Qe&a)===a&&(Tt===4||Tt===3&&(Qe&62914560)===Qe&&300>Lt()-Wu?(at&2)===0&&Wr(t,0):rf|=a,Yr===Qe&&(Yr=0)),Ki(t)}function _g(t,n){n===0&&(n=Fo()),t=Pi(t,n),t!==null&&(Ol(t,n),Ki(t))}function qw(t){var n=t.memoizedState,a=0;n!==null&&(a=n.retryLane),_g(t,a)}function Hw(t,n){var a=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(a=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),_g(t,a)}function $w(t,n){return wn(t,n)}var tc=null,Xr=null,hf=!1,nc=!1,mf=!1,ma=0;function Ki(t){t!==Xr&&t.next===null&&(Xr===null?tc=Xr=t:Xr=Xr.next=t),nc=!0,hf||(hf=!0,Vw())}function ro(t,n){if(!mf&&nc){mf=!0;do for(var a=!1,o=tc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,E=o.pingedLanes;h=(1<<31-rt(42|t)+1)-1,h&=f&~(v&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,Og(o,h))}else h=Qe,h=xi(o,o===mt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||ot(o,h)||(a=!0,Og(o,h));o=o.next}while(a);mf=!1}}function Gw(){Dg()}function Dg(){nc=hf=!1;var t=0;ma!==0&&ek()&&(t=ma);for(var n=Lt(),a=null,o=tc;o!==null;){var f=o.next,h=Rg(o,n);h===0?(o.next=null,a===null?tc=f:a.next=f,f===null&&(Xr=a)):(a=o,(t!==0||(h&3)!==0)&&(nc=!0)),o=f}Ft!==0&&Ft!==5||ro(t),ma!==0&&(ma=0)}function Rg(t,n){for(var a=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-rt(h),E=1<<v,U=f[v];U===-1?((E&a)===0||(E&o)!==0)&&(f[v]=Na(E,n)):U<=n&&(t.expiredLanes|=E),h&=~E}if(n=mt,a=Qe,a=xi(t,t===n?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,a===0||t===n&&(ut===2||ut===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&gi(o),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||ot(t,a)){if(n=a&-a,n===t.callbackPriority)return n;switch(o!==null&&gi(o),ds(a)){case 2:case 8:a=he;break;case 32:a=Re;break;case 268435456:a=Ie;break;default:a=Re}return o=Mg.bind(null,t),a=wn(a,o),t.callbackPriority=n,t.callbackNode=a,n}return o!==null&&o!==null&&gi(o),t.callbackPriority=2,t.callbackNode=null,2}function Mg(t,n){if(Ft!==0&&Ft!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(ec()&&t.callbackNode!==a)return null;var o=Qe;return o=xi(t,t===mt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(hg(t,o,n),Rg(t,Lt()),t.callbackNode!=null&&t.callbackNode===a?Mg.bind(null,t):null)}function Og(t,n){if(ec())return null;hg(t,n,!0)}function Vw(){nk(function(){(at&6)!==0?wn(ne,Gw):Dg()})}function gf(){if(ma===0){var t=Ue;t===0&&(t=Ea,Ea<<=1,(Ea&261888)===0&&(Ea=256)),ma=t}return ma}function zg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ql(""+t)}function Lg(t,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,t.id&&a.setAttribute("form",t.id),n.parentNode.insertBefore(a,n),t=new FormData(t),a.parentNode.removeChild(a),t}function Pw(t,n,a,o,f){if(n==="submit"&&a&&a.stateNode===f){var h=zg((f[Nt]||null).action),v=o.submitter;v&&(n=(n=v[Nt]||null)?zg(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var E=new gn("action","action",null,o,f);t.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ma!==0){var U=v?Lg(f,v):new FormData(f);zd(a,{pending:!0,data:U,method:f.method,action:h},null,U)}}else typeof h=="function"&&(E.preventDefault(),U=v?Lg(f,v):new FormData(f),zd(a,{pending:!0,data:U,method:f.method,action:h},h,U))},currentTarget:f}]})}}for(var yf=0;yf<Dr.length;yf++){var xf=Dr[yf],Yw=xf.toLowerCase(),Fw=xf[0].toUpperCase()+xf.slice(1);jn(Yw,"on"+Fw)}jn(Kl,"onAnimationEnd"),jn(Gi,"onAnimationIteration"),jn(gu,"onAnimationStart"),jn("dblclick","onDoubleClick"),jn("focusin","onFocus"),jn("focusout","onBlur"),jn(cd,"onTransitionRun"),jn(dd,"onTransitionStart"),jn(fd,"onTransitionCancel"),jn(yu,"onTransitionEnd"),Ll("onMouseEnter",["mouseout","mouseover"]),Ll("onMouseLeave",["mouseout","mouseover"]),Ll("onPointerEnter",["pointerout","pointerover"]),Ll("onPointerLeave",["pointerout","pointerover"]),Li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Li("onBeforeInput",["compositionend","keypress","textInput","paste"]),Li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var so="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(" "),Ww=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(so));function Ig(t,n){n=(n&4)!==0;for(var a=0;a<t.length;a++){var o=t[a],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var E=o[v],U=E.instance,F=E.currentTarget;if(E=E.listener,U!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=F;try{h(f)}catch(ie){Rr(ie)}f.currentTarget=null,h=U}else for(v=0;v<o.length;v++){if(E=o[v],U=E.instance,F=E.currentTarget,E=E.listener,U!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=F;try{h(f)}catch(ie){Rr(ie)}f.currentTarget=null,h=U}}}}function We(t,n){var a=n[Mi];a===void 0&&(a=n[Mi]=new Set);var o=t+"__bubble";a.has(o)||(Ug(n,t,2,!1),a.add(o))}function bf(t,n,a){var o=0;n&&(o|=4),Ug(a,t,o,n)}var ic="_reactListening"+Math.random().toString(36).slice(2);function vf(t){if(!t[ic]){t[ic]=!0,vi.forEach(function(a){a!=="selectionchange"&&(Ww.has(a)||bf(a,!1,t),bf(a,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[ic]||(n[ic]=!0,bf("selectionchange",!1,n))}}function Ug(t,n,a,o){switch(py(n)){case 2:var f=kk;break;case 8:f=jk;break;default:f=zf}a=f.bind(null,n,a,t),f=void 0,!xr||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,a,{capture:!0,passive:f}):t.addEventListener(n,a,!0):f!==void 0?t.addEventListener(n,a,{passive:f}):t.addEventListener(n,a,!1)}function wf(t,n,a,o,f){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var E=o.stateNode.containerInfo;if(E===f)break;if(v===4)for(v=o.return;v!==null;){var U=v.tag;if((U===3||U===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;E!==null;){if(v=Oi(E),v===null)return;if(U=v.tag,U===5||U===6||U===26||U===27){o=h=v;continue e}E=E.parentNode}}o=o.return}ys(function(){var F=h,ie=Oa(a),re=[];e:{var W=xu.get(t);if(W!==void 0){var Q=gn,ve=t;switch(t){case"keypress":if($l(a)===0)break e;case"keydown":case"keyup":Q=ed;break;case"focusin":ve="focus",Q=kr;break;case"focusout":ve="blur",Q=kr;break;case"beforeblur":case"afterblur":Q=kr;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=za;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=vs;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Cs;break;case Kl:case Gi:case gu:Q=Xt;break;case yu:Q=Es;break;case"scroll":case"scrollend":Q=wr;break;case"wheel":Q=td;break;case"copy":case"cut":case"paste":Q=La;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=js;break;case"toggle":case"beforetoggle":Q=nd}var Oe=(n&4)!==0,pt=!Oe&&(t==="scroll"||t==="scrollend"),$=Oe?W!==null?W+"Capture":null:W;Oe=[];for(var H=F,Y;H!==null;){var le=H;if(Y=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Y===null||$===null||(le=Bi(H,$),le!=null&&Oe.push(oo(H,le,Y))),pt)break;H=H.return}0<Oe.length&&(W=new Q(W,ve,null,a,ie),re.push({event:W,listeners:Oe}))}}if((n&7)===0){e:{if(W=t==="mouseover"||t==="pointerover",Q=t==="mouseout"||t==="pointerout",W&&a!==ms&&(ve=a.relatedTarget||a.fromElement)&&(Oi(ve)||ve[Hn]))break e;if((Q||W)&&(W=ie.window===ie?ie:(W=ie.ownerDocument)?W.defaultView||W.parentWindow:window,Q?(ve=a.relatedTarget||a.toElement,Q=F,ve=ve?Oi(ve):null,ve!==null&&(pt=c(ve),Oe=ve.tag,ve!==pt||Oe!==5&&Oe!==27&&Oe!==6)&&(ve=null)):(Q=null,ve=F),Q!==ve)){if(Oe=za,le="onMouseLeave",$="onMouseEnter",H="mouse",(t==="pointerout"||t==="pointerover")&&(Oe=js,le="onPointerLeave",$="onPointerEnter",H="pointer"),pt=Q==null?W:nl(Q),Y=ve==null?W:nl(ve),W=new Oe(le,H+"leave",Q,a,ie),W.target=pt,W.relatedTarget=Y,le=null,Oi(ie)===F&&(Oe=new Oe($,H+"enter",ve,a,ie),Oe.target=Y,Oe.relatedTarget=pt,le=Oe),pt=le,Q&&ve)t:{for(Oe=Kw,$=Q,H=ve,Y=0,le=$;le;le=Oe(le))Y++;le=0;for(var _e=H;_e;_e=Oe(_e))le++;for(;0<Y-le;)$=Oe($),Y--;for(;0<le-Y;)H=Oe(H),le--;for(;Y--;){if($===H||H!==null&&$===H.alternate){Oe=$;break t}$=Oe($),H=Oe(H)}Oe=null}else Oe=null;Q!==null&&Bg(re,W,Q,Oe,!1),ve!==null&&pt!==null&&Bg(re,pt,ve,Oe,!0)}}e:{if(W=F?nl(F):window,Q=W.nodeName&&W.nodeName.toLowerCase(),Q==="select"||Q==="input"&&W.type==="file")var nt=Ar;else if(Tr(W))if(su)nt=sd;else{nt=ad;var Te=cu}else Q=W.nodeName,!Q||Q.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?F&&ri(F.elementType)&&(nt=Ar):nt=rd;if(nt&&(nt=nt(t,F))){ru(re,nt,a,ie);break e}Te&&Te(t,W,F),t==="focusout"&&F&&W.type==="number"&&F.memoizedProps.value!=null&&ps(W,"number",W.value)}switch(Te=F?nl(F):window,t){case"focusin":(Tr(Te)||Te.contentEditable==="true")&&(Wl=Te,Rs=F,Ga=null);break;case"focusout":Ga=Rs=Wl=null;break;case"mousedown":Ms=!0;break;case"contextmenu":case"mouseup":case"dragend":Ms=!1,mu(re,a,ie);break;case"selectionchange":if(ud)break;case"keydown":case"keyup":mu(re,a,ie)}var Ge;if(As)e:{switch(t){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Fl?cn(t,a)&&(Ze="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Ze="onCompositionStart");Ze&&(Yl&&a.locale!=="ko"&&(Fl||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Fl&&(Ge=vr()):(Yn=ie,br="value"in Yn?Yn.value:Yn.textContent,Fl=!0)),Te=lc(F,Ze),0<Te.length&&(Ze=new sl(Ze,t,null,a,ie),re.push({event:Ze,listeners:Te}),Ge?Ze.data=Ge:(Ge=lu(a),Ge!==null&&(Ze.data=Ge)))),(Ge=ul?Cr(t,a):ld(t,a))&&(Ze=lc(F,"onBeforeInput"),0<Ze.length&&(Te=new sl("onBeforeInput","beforeinput",null,a,ie),re.push({event:Te,listeners:Ze}),Te.data=Ge)),Pw(re,t,F,a,ie)}Ig(re,n)})}function oo(t,n,a){return{instance:t,listener:n,currentTarget:a}}function lc(t,n){for(var a=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Bi(t,a),f!=null&&o.unshift(oo(t,f,h)),f=Bi(t,n),f!=null&&o.push(oo(t,f,h))),t.tag===3)return o;t=t.return}return[]}function Kw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Bg(t,n,a,o,f){for(var h=n._reactName,v=[];a!==null&&a!==o;){var E=a,U=E.alternate,F=E.stateNode;if(E=E.tag,U!==null&&U===o)break;E!==5&&E!==26&&E!==27||F===null||(U=F,f?(F=Bi(a,h),F!=null&&v.unshift(oo(a,F,U))):f||(F=Bi(a,h),F!=null&&v.push(oo(a,F,U)))),a=a.return}v.length!==0&&t.push({event:n,listeners:v})}var Xw=/\r\n?/g,Qw=/\u0000|\uFFFD/g;function qg(t){return(typeof t=="string"?t:""+t).replace(Xw,`
50
+ `).replace(Qw,"")}function Hg(t,n){return n=qg(n),qg(t)===n}function ft(t,n,a,o,f,h){switch(a){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Ii(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Ii(t,""+o);break;case"className":ii(t,"class",o);break;case"tabIndex":ii(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ii(t,a,o);break;case"style":Vn(t,o,h);break;case"data":if(n!=="object"){ii(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||a!=="href")){t.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=ql(""+o),t.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(a==="formAction"?(n!=="input"&&ft(t,n,"name",f.name,f,null),ft(t,n,"formEncType",f.formEncType,f,null),ft(t,n,"formMethod",f.formMethod,f,null),ft(t,n,"formTarget",f.formTarget,f,null)):(ft(t,n,"encType",f.encType,f,null),ft(t,n,"method",f.method,f,null),ft(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=ql(""+o),t.setAttribute(a,o);break;case"onClick":o!=null&&(t.onclick=Pn);break;case"onScroll":o!=null&&We("scroll",t);break;case"onScrollEnd":o!=null&&We("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=a}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}a=ql(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""+o):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":o===!0?t.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,o):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(a,o):t.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(a):t.setAttribute(a,o);break;case"popover":We("beforetoggle",t),We("toggle",t),$n(t,"popover",o);break;case"xlinkActuate":wi(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":wi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":wi(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":wi(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":wi(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":wi(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":wi(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":wi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":wi(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":$n(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=hs.get(a)||a,$n(t,a,o))}}function kf(t,n,a,o,f,h){switch(a){case"style":Vn(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=a}}break;case"children":typeof o=="string"?Ii(t,o):(typeof o=="number"||typeof o=="bigint")&&Ii(t,""+o);break;case"onScroll":o!=null&&We("scroll",t);break;case"onScrollEnd":o!=null&&We("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Pn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),n=a.slice(2,f?a.length-7:void 0),h=t[Nt]||null,h=h!=null?h[a]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(n,o,f);break e}a in t?t[a]=o:o===!0?t.setAttribute(a,""):$n(t,a,o)}}}function an(t,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",t),We("load",t);var o=!1,f=!1,h;for(h in a)if(a.hasOwnProperty(h)){var v=a[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,h,v,a,null)}}f&&ft(t,n,"srcSet",a.srcSet,a,null),o&&ft(t,n,"src",a.src,a,null);return;case"input":We("invalid",t);var E=h=v=f=null,U=null,F=null;for(o in a)if(a.hasOwnProperty(o)){var ie=a[o];if(ie!=null)switch(o){case"name":f=ie;break;case"type":v=ie;break;case"checked":U=ie;break;case"defaultChecked":F=ie;break;case"value":h=ie;break;case"defaultValue":E=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,n));break;default:ft(t,n,o,ie,a,null)}}Ul(t,h,E,U,F,v,f,!1);return;case"select":We("invalid",t),o=v=h=null;for(f in a)if(a.hasOwnProperty(f)&&(E=a[f],E!=null))switch(f){case"value":h=E;break;case"defaultValue":v=E;break;case"multiple":o=E;default:ft(t,n,f,E,a,null)}n=h,a=v,t.multiple=!!o,n!=null?ki(t,!!o,n,!1):a!=null&&ki(t,!!o,a,!0);return;case"textarea":We("invalid",t),h=f=o=null;for(v in a)if(a.hasOwnProperty(v)&&(E=a[v],E!=null))switch(v){case"value":o=E;break;case"defaultValue":f=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:ft(t,n,v,E,a,null)}yr(t,o,f,h);return;case"option":for(U in a)if(a.hasOwnProperty(U)&&(o=a[U],o!=null))switch(U){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ft(t,n,U,o,a,null)}return;case"dialog":We("beforetoggle",t),We("toggle",t),We("cancel",t),We("close",t);break;case"iframe":case"object":We("load",t);break;case"video":case"audio":for(o=0;o<so.length;o++)We(so[o],t);break;case"image":We("error",t),We("load",t);break;case"details":We("toggle",t);break;case"embed":case"source":case"link":We("error",t),We("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in a)if(a.hasOwnProperty(F)&&(o=a[F],o!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,F,o,a,null)}return;default:if(ri(n)){for(ie in a)a.hasOwnProperty(ie)&&(o=a[ie],o!==void 0&&kf(t,n,ie,o,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(o=a[E],o!=null&&ft(t,n,E,o,a,null))}function Zw(t,n,a,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,E=null,U=null,F=null,ie=null;for(Q in a){var re=a[Q];if(a.hasOwnProperty(Q)&&re!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":U=re;default:o.hasOwnProperty(Q)||ft(t,n,Q,null,o,re)}}for(var W in o){var Q=o[W];if(re=a[W],o.hasOwnProperty(W)&&(Q!=null||re!=null))switch(W){case"type":h=Q;break;case"name":f=Q;break;case"checked":F=Q;break;case"defaultChecked":ie=Q;break;case"value":v=Q;break;case"defaultValue":E=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,n));break;default:Q!==re&&ft(t,n,W,Q,o,re)}}gr(t,v,E,U,F,ie,h,f);return;case"select":Q=v=E=W=null;for(h in a)if(U=a[h],a.hasOwnProperty(h)&&U!=null)switch(h){case"value":break;case"multiple":Q=U;default:o.hasOwnProperty(h)||ft(t,n,h,null,o,U)}for(f in o)if(h=o[f],U=a[f],o.hasOwnProperty(f)&&(h!=null||U!=null))switch(f){case"value":W=h;break;case"defaultValue":E=h;break;case"multiple":v=h;default:h!==U&&ft(t,n,f,h,o,U)}n=E,a=v,o=Q,W!=null?ki(t,!!a,W,!1):!!o!=!!a&&(n!=null?ki(t,!!a,n,!0):ki(t,!!a,a?[]:"",!1));return;case"textarea":Q=W=null;for(E in a)if(f=a[E],a.hasOwnProperty(E)&&f!=null&&!o.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:ft(t,n,E,null,o,f)}for(v in o)if(f=o[v],h=a[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":W=f;break;case"defaultValue":Q=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&ft(t,n,v,f,o,h)}Bl(t,W,Q);return;case"option":for(var ve in a)if(W=a[ve],a.hasOwnProperty(ve)&&W!=null&&!o.hasOwnProperty(ve))switch(ve){case"selected":t.selected=!1;break;default:ft(t,n,ve,null,o,W)}for(U in o)if(W=o[U],Q=a[U],o.hasOwnProperty(U)&&W!==Q&&(W!=null||Q!=null))switch(U){case"selected":t.selected=W&&typeof W!="function"&&typeof W!="symbol";break;default:ft(t,n,U,W,o,Q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in a)W=a[Oe],a.hasOwnProperty(Oe)&&W!=null&&!o.hasOwnProperty(Oe)&&ft(t,n,Oe,null,o,W);for(F in o)if(W=o[F],Q=a[F],o.hasOwnProperty(F)&&W!==Q&&(W!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,n));break;default:ft(t,n,F,W,o,Q)}return;default:if(ri(n)){for(var pt in a)W=a[pt],a.hasOwnProperty(pt)&&W!==void 0&&!o.hasOwnProperty(pt)&&kf(t,n,pt,void 0,o,W);for(ie in o)W=o[ie],Q=a[ie],!o.hasOwnProperty(ie)||W===Q||W===void 0&&Q===void 0||kf(t,n,ie,W,o,Q);return}}for(var $ in a)W=a[$],a.hasOwnProperty($)&&W!=null&&!o.hasOwnProperty($)&&ft(t,n,$,null,o,W);for(re in o)W=o[re],Q=a[re],!o.hasOwnProperty(re)||W===Q||W==null&&Q==null||ft(t,n,re,W,o,Q)}function $g(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,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var f=a[o],h=f.transferSize,v=f.initiatorType,E=f.duration;if(h&&E&&$g(v)){for(v=0,E=f.responseEnd,o+=1;o<a.length;o++){var U=a[o],F=U.startTime;if(F>E)break;var ie=U.transferSize,re=U.initiatorType;ie&&$g(re)&&(U=U.responseEnd,v+=ie*(U<E?1:(E-F)/(U-F)))}if(--o,n+=8*(h+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var jf=null,Sf=null;function ac(t){return t.nodeType===9?t:t.ownerDocument}function Gg(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 Vg(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 Cf(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 Tf=null;function ek(){var t=window.event;return t&&t.type==="popstate"?t===Tf?!1:(Tf=t,!0):(Tf=null,!1)}var Pg=typeof setTimeout=="function"?setTimeout:void 0,tk=typeof clearTimeout=="function"?clearTimeout:void 0,Yg=typeof Promise=="function"?Promise:void 0,nk=typeof queueMicrotask=="function"?queueMicrotask:typeof Yg<"u"?function(t){return Yg.resolve(null).then(t).catch(ik)}:Pg;function ik(t){setTimeout(function(){throw t})}function ga(t){return t==="head"}function Fg(t,n){var a=n,o=0;do{var f=a.nextSibling;if(t.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(o===0){t.removeChild(f),es(n);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")uo(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,uo(a);for(var h=a.firstChild;h;){var v=h.nextSibling,E=h.nodeName;h[bi]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=v}}else a==="body"&&uo(t.ownerDocument.body);a=f}while(a);es(n)}function Wg(t,n){var a=t;t=0;do{var o=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=o}while(a)}function Ef(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Ef(a),Da(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function lk(t,n,a,o){for(;t.nodeType===1;){var f=a;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[bi])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=fi(t.nextSibling),t===null)break}return null}function ak(t,n,a){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=fi(t.nextSibling),t===null))return null;return t}function Kg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=fi(t.nextSibling),t===null))return null;return t}function Af(t){return t.data==="$?"||t.data==="$~"}function Nf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function rk(t,n){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||a.readyState!=="loading")n();else{var o=function(){n(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function fi(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 _f=null;function Xg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(n===0)return fi(t.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}t=t.nextSibling}return null}function Qg(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return t;n--}else a!=="/$"&&a!=="/&"||n++}t=t.previousSibling}return null}function Zg(t,n,a){switch(n=ac(a),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 uo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Da(t)}var pi=new Map,Jg=new Set;function rc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Nl=oe.d;oe.d={f:sk,r:ok,D:uk,C:ck,L:dk,m:fk,X:hk,S:pk,M:mk};function sk(){var t=Nl.f(),n=Qu();return t||n}function ok(t){var n=zi(t);n!==null&&n.tag===5&&n.type==="form"?gm(n):Nl.r(t)}var Qr=typeof document>"u"?null:document;function ey(t,n,a){var o=Qr;if(o&&typeof n=="string"&&n){var f=Kt(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),Jg.has(f)||(Jg.add(f),t={rel:t,crossOrigin:a,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),an(n,"link",t),_t(n),o.head.appendChild(n)))}}function uk(t){Nl.D(t),ey("dns-prefetch",t,null)}function ck(t,n){Nl.C(t,n),ey("preconnect",t,n)}function dk(t,n,a){Nl.L(t,n,a);var o=Qr;if(o&&t&&n){var f='link[rel="preload"][as="'+Kt(n)+'"]';n==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+Kt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+Kt(a.imageSizes)+'"]')):f+='[href="'+Kt(t)+'"]';var h=f;switch(n){case"style":h=Zr(t);break;case"script":h=Jr(t)}pi.has(h)||(t=y({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:t,as:n},a),pi.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(co(h))||n==="script"&&o.querySelector(fo(h))||(n=o.createElement("link"),an(n,"link",t),_t(n),o.head.appendChild(n)))}}function fk(t,n){Nl.m(t,n);var a=Qr;if(a&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Kt(o)+'"][href="'+Kt(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Jr(t)}if(!pi.has(h)&&(t=y({rel:"modulepreload",href:t},n),pi.set(h,t),a.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fo(h)))return}o=a.createElement("link"),an(o,"link",t),_t(o),a.head.appendChild(o)}}}function pk(t,n,a){Nl.S(t,n,a);var o=Qr;if(o&&t){var f=zl(o).hoistableStyles,h=Zr(t);n=n||"default";var v=f.get(h);if(!v){var E={loading:0,preload:null};if(v=o.querySelector(co(h)))E.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":n},a),(a=pi.get(h))&&Df(t,a);var U=v=o.createElement("link");_t(U),an(U,"link",t),U._p=new Promise(function(F,ie){U.onload=F,U.onerror=ie}),U.addEventListener("load",function(){E.loading|=1}),U.addEventListener("error",function(){E.loading|=2}),E.loading|=4,sc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:E},f.set(h,v)}}}function hk(t,n){Nl.X(t,n);var a=Qr;if(a&&t){var o=zl(a).hoistableScripts,f=Jr(t),h=o.get(f);h||(h=a.querySelector(fo(f)),h||(t=y({src:t,async:!0},n),(n=pi.get(f))&&Rf(t,n),h=a.createElement("script"),_t(h),an(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function mk(t,n){Nl.M(t,n);var a=Qr;if(a&&t){var o=zl(a).hoistableScripts,f=Jr(t),h=o.get(f);h||(h=a.querySelector(fo(f)),h||(t=y({src:t,async:!0,type:"module"},n),(n=pi.get(f))&&Rf(t,n),h=a.createElement("script"),_t(h),an(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function ty(t,n,a,o){var f=(f=Z.current)?rc(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=Zr(a.href),a=zl(f).hoistableStyles,o=a.get(n),o||(o={type:"style",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Zr(a.href);var h=zl(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(co(t)))&&!h._p&&(v.instance=h,v.state.loading=5),pi.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},pi.set(t,a),h||gk(f,t,a,v.state))),n&&o===null)throw Error(r(528,""));return v}if(n&&o!==null)throw Error(r(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Jr(a),a=zl(f).hoistableScripts,o=a.get(n),o||(o={type:"script",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Zr(t){return'href="'+Kt(t)+'"'}function co(t){return'link[rel="stylesheet"]['+t+"]"}function ny(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function gk(t,n,a,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),an(n,"link",a),_t(n),t.head.appendChild(n))}function Jr(t){return'[src="'+Kt(t)+'"]'}function fo(t){return"script[async]"+t}function iy(t,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Kt(a.href)+'"]');if(o)return n.instance=o,_t(o),o;var f=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),_t(o),an(o,"style",f),sc(o,a.precedence,t),n.instance=o;case"stylesheet":f=Zr(a.href);var h=t.querySelector(co(f));if(h)return n.state.loading|=4,n.instance=h,_t(h),h;o=ny(a),(f=pi.get(f))&&Df(o,f),h=(t.ownerDocument||t).createElement("link"),_t(h);var v=h;return v._p=new Promise(function(E,U){v.onload=E,v.onerror=U}),an(h,"link",o),n.state.loading|=4,sc(h,a.precedence,t),n.instance=h;case"script":return h=Jr(a.src),(f=t.querySelector(fo(h)))?(n.instance=f,_t(f),f):(o=a,(f=pi.get(h))&&(o=y({},a),Rf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),_t(f),an(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,sc(o,a.precedence,t));return n.instance}function sc(t,n,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,v=0;v<o.length;v++){var E=o[v];if(E.dataset.precedence===n)h=E;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(t,n.firstChild))}function Df(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Rf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var oc=null;function ly(t,n,a){if(oc===null){var o=new Map,f=oc=new Map;f.set(a,o)}else f=oc,o=f.get(a),o||(o=new Map,f.set(a,o));if(o.has(t))return o;for(o.set(t,null),a=a.getElementsByTagName(t),f=0;f<a.length;f++){var h=a[f];if(!(h[bi]||h[bt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var E=o.get(v);E?E.push(h):o.set(v,[h])}}return o}function ay(t,n,a){t=t.ownerDocument||t,t.head.insertBefore(a,n==="title"?t.querySelector("head > title"):null)}function yk(t,n,a){if(a===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 ry(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function xk(t,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=Zr(o.href),h=n.querySelector(co(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=uc.bind(t),n.then(t,t)),a.state.loading|=4,a.instance=h,_t(h);return}h=n.ownerDocument||n,o=ny(o),(f=pi.get(f))&&Df(o,f),h=h.createElement("link"),_t(h);var v=h;v._p=new Promise(function(E,U){v.onload=E,v.onerror=U}),an(h,"link",o),a.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=uc.bind(t),n.addEventListener("load",a),n.addEventListener("error",a))}}var Mf=0;function bk(t,n){return t.stylesheets&&t.count===0&&dc(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var o=setTimeout(function(){if(t.stylesheets&&dc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&Mf===0&&(Mf=62500*Jw());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&dc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>Mf?50:800)+n);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var cc=null;function dc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,cc=new Map,n.forEach(vk,t),cc=null,uc.call(t))}function vk(t,n){if(!(n.state.loading&4)){var a=cc.get(t);if(a)var o=a.get(null);else{a=new Map,cc.set(t,a);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var v=f[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(a.set(v.dataset.precedence,v),o=v)}o&&a.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=a.get(v)||o,h===o&&a.set(null,f),a.set(v,f),this.count++,o=uc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),h?h.parentNode.insertBefore(f,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var po={$$typeof:B,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function wk(t,n,a,o,f,h,v,E,U){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=tl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tl(0),this.hiddenUpdates=tl(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function sy(t,n,a,o,f,h,v,E,U,F,ie,re){return t=new wk(t,n,a,v,U,F,ie,re,E),n=1,h===!0&&(n|=24),h=xn(3,null,null,n),t.current=h,h.stateNode=t,n=M(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:a,cache:n},md(h),t}function oy(t){return t?(t=Ql,t):Ql}function uy(t,n,a,o,f,h){f=oy(f),o.context===null?o.context=f:o.pendingContext=f,o=aa(n),o.payload={element:a},h=h===void 0?null:h,h!==null&&(o.callback=h),a=ra(t,o,n),a!==null&&(Ln(a,t,n),Vs(a,t,n))}function cy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<n?a:n}}function Of(t,n){cy(t,n),(t=t.alternate)&&cy(t,n)}function dy(t){if(t.tag===13||t.tag===31){var n=Pi(t,67108864);n!==null&&Ln(n,t,67108864),Of(t,67108864)}}function fy(t){if(t.tag===13||t.tag===31){var n=ei();n=fr(n);var a=Pi(t,n);a!==null&&Ln(a,t,n),Of(t,n)}}var fc=!0;function kk(t,n,a,o){var f=V.T;V.T=null;var h=oe.p;try{oe.p=2,zf(t,n,a,o)}finally{oe.p=h,V.T=f}}function jk(t,n,a,o){var f=V.T;V.T=null;var h=oe.p;try{oe.p=8,zf(t,n,a,o)}finally{oe.p=h,V.T=f}}function zf(t,n,a,o){if(fc){var f=Lf(o);if(f===null)wf(t,n,o,pc,a),hy(t,o);else if(Ck(f,t,n,a,o))o.stopPropagation();else if(hy(t,o),n&4&&-1<Sk.indexOf(t)){for(;f!==null;){var h=zi(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=Pt(h.pendingLanes);if(v!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;v;){var U=1<<31-rt(v);E.entanglements[1]|=U,v&=~U}Ki(h),(at&6)===0&&(Ku=Lt()+500,ro(0))}}break;case 31:case 13:E=Pi(h,2),E!==null&&Ln(E,h,2),Qu(),Of(h,2)}if(h=Lf(o),h===null&&wf(t,n,o,pc,a),h===f)break;f=h}f!==null&&o.stopPropagation()}else wf(t,n,o,null,a)}}function Lf(t){return t=Oa(t),If(t)}var pc=null;function If(t){if(pc=null,t=Oi(t),t!==null){var n=c(t);if(n===null)t=null;else{var a=n.tag;if(a===13){if(t=d(n),t!==null)return t;t=null}else if(a===31){if(t=p(n),t!==null)return t;t=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return pc=t,null}function py(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(Rl()){case ne:return 2;case he:return 8;case Re:case Ae:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Uf=!1,ya=null,xa=null,ba=null,ho=new Map,mo=new Map,va=[],Sk="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 hy(t,n){switch(t){case"focusin":case"focusout":ya=null;break;case"dragenter":case"dragleave":xa=null;break;case"mouseover":case"mouseout":ba=null;break;case"pointerover":case"pointerout":ho.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":mo.delete(n.pointerId)}}function go(t,n,a,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:a,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=zi(n),n!==null&&dy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function Ck(t,n,a,o,f){switch(n){case"focusin":return ya=go(ya,t,n,a,o,f),!0;case"dragenter":return xa=go(xa,t,n,a,o,f),!0;case"mouseover":return ba=go(ba,t,n,a,o,f),!0;case"pointerover":var h=f.pointerId;return ho.set(h,go(ho.get(h)||null,t,n,a,o,f)),!0;case"gotpointercapture":return h=f.pointerId,mo.set(h,go(mo.get(h)||null,t,n,a,o,f)),!0}return!1}function my(t){var n=Oi(t.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=d(a),n!==null){t.blockedOn=n,Xo(t.priority,function(){fy(a)});return}}else if(n===31){if(n=p(a),n!==null){t.blockedOn=n,Xo(t.priority,function(){fy(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function hc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var a=Lf(t.nativeEvent);if(a===null){a=t.nativeEvent;var o=new a.constructor(a.type,a);ms=o,a.target.dispatchEvent(o),ms=null}else return n=zi(a),n!==null&&dy(n),t.blockedOn=a,!1;n.shift()}return!0}function gy(t,n,a){hc(t)&&a.delete(n)}function Tk(){Uf=!1,ya!==null&&hc(ya)&&(ya=null),xa!==null&&hc(xa)&&(xa=null),ba!==null&&hc(ba)&&(ba=null),ho.forEach(gy),mo.forEach(gy)}function mc(t,n){t.blockedOn===n&&(t.blockedOn=null,Uf||(Uf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Tk)))}var gc=null;function yy(t){gc!==t&&(gc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gc===t&&(gc=null);for(var n=0;n<t.length;n+=3){var a=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(If(o||a)===null)continue;break}var h=zi(a);h!==null&&(t.splice(n,3),n-=3,zd(h,{pending:!0,data:f,method:a.method,action:o},o,f))}}))}function es(t){function n(U){return mc(U,t)}ya!==null&&mc(ya,t),xa!==null&&mc(xa,t),ba!==null&&mc(ba,t),ho.forEach(n),mo.forEach(n);for(var a=0;a<va.length;a++){var o=va[a];o.blockedOn===t&&(o.blockedOn=null)}for(;0<va.length&&(a=va[0],a.blockedOn===null);)my(a),a.blockedOn===null&&va.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var f=a[o],h=a[o+1],v=f[Nt]||null;if(typeof h=="function")v||yy(a);else if(v){var E=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[Nt]||null)E=v.formAction;else if(If(f)!==null)continue}else E=v.action;typeof E=="function"?a[o+1]=E:(a.splice(o,3),o-=3),yy(a)}}}function xy(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Bf(t){this._internalRoot=t}yc.prototype.render=Bf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,o=ei();uy(a,o,t,n,null,null)},yc.prototype.unmount=Bf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;uy(t.current,2,null,t,null,null),Qu(),n[Hn]=null}};function yc(t){this._internalRoot=t}yc.prototype.unstable_scheduleHydration=function(t){if(t){var n=pr();t={blockedOn:null,target:t,priority:n};for(var a=0;a<va.length&&n!==0&&n<va[a].priority;a++);va.splice(a,0,t),a===0&&my(t)}};var by=i.version;if(by!=="19.2.7")throw Error(r(527,by,"19.2.7"));oe.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=m(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var Ek={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xc.isDisabled&&xc.supportsFiber)try{tt=xc.inject(Ek),jt=xc}catch{}}return xo.createRoot=function(t,n){if(!u(t))throw Error(r(299));var a=!1,o="",f=Tm,h=Em,v=Am;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=sy(t,1,!1,null,null,a,o,null,f,h,v,xy),t[Hn]=n.current,vf(t),new Bf(n)},xo.hydrateRoot=function(t,n,a){if(!u(t))throw Error(r(299));var o=!1,f="",h=Tm,v=Em,E=Am,U=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(U=a.formState)),n=sy(t,1,!0,n,a??null,o,f,U,h,v,E,xy),n.context=oy(null),a=n.current,o=ei(),o=fr(o),f=aa(o),f.callback=null,ra(a,f,o),a=o,n.current.lanes=a,Ol(n,a),Ki(n),t[Hn]=n.current,vf(t),new yc(n)},xo.version="19.2.7",xo}var _y;function Hk(){if(_y)return $f.exports;_y=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(),$f.exports=qk(),$f.exports}var $k=Hk();function Gk(e,i){const l=i||{};return(e[e.length-1]===""?[...e,""]:e).join((l.padRight?" ":"")+","+(l.padLeft===!1?"":" ")).trim()}const Vk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yk={};function Dy(e,i){return(Yk.jsx?Pk:Vk).test(e)}const Fk=/[ \t\n\f\r]/g;function Wk(e){return typeof e=="object"?e.type==="text"?Ry(e.value):!1:Ry(e)}function Ry(e){return e.replace(Fk,"")===""}class Vo{constructor(i,l,r){this.normal=l,this.property=i,r&&(this.space=r)}}Vo.prototype.normal={};Vo.prototype.property={};Vo.prototype.space=void 0;function fb(e,i){const l={},r={};for(const u of e)Object.assign(l,u.property),Object.assign(r,u.normal);return new Vo(l,r,i)}function Dp(e){return e.toLowerCase()}class Bn{constructor(i,l){this.attribute=l,this.property=i}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let Kk=0;const Be=dr(),Gt=dr(),Rp=dr(),de=dr(),gt=dr(),sr=dr(),ti=dr();function dr(){return 2**++Kk}const Mp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:Gt,commaOrSpaceSeparated:ti,commaSeparated:sr,number:de,overloadedBoolean:Rp,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),Yf=Object.keys(Mp);class nh extends Bn{constructor(i,l,r,u){let c=-1;if(super(i,l),My(this,"space",u),typeof r=="number")for(;++c<Yf.length;){const d=Yf[c];My(this,Yf[c],(r&Mp[d])===Mp[d])}}}nh.prototype.defined=!0;function My(e,i,l){l&&(e[i]=l)}function os(e){const i={},l={};for(const[r,u]of Object.entries(e.properties)){const c=new nh(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,l[Dp(r)]=r,l[Dp(c.attribute)]=r}return new Vo(i,l,e.space)}const pb=os({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:gt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:de,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:gt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Gt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function hb(e,i){return i in e?e[i]:i}function mb(e,i){return hb(e,i.toLowerCase())}const Xk=os({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:sr,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alpha:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:gt,autoFocus:Be,autoPlay:Be,blocking:gt,capture:null,charSet:null,checked:Be,cite:null,className:gt,closedBy:null,colorSpace:null,cols:de,colSpan:de,command:null,commandFor:null,content:null,contentEditable:Gt,controls:Be,controlsList:gt,coords:de|sr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:Rp,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:gt,height:de,hidden:Rp,high:de,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:gt,itemRef:gt,itemScope:Be,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,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:Be,optimum:de,pattern:null,ping:gt,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:gt,required:Be,reversed:Be,rows:de,rowSpan:de,sandbox:gt,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootCustomElementRegistry:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shadowRootSerializable:Be,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:Gt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Be,disablePictureInPicture:Be,disableRemotePlayback:Be,exportParts:sr,part:gt,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:mb}),Qk=os({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:ti,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:gt,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:sr,g2:sr,glyphName:sr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:ti,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ti,rev:ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ti,requiredFeatures:ti,requiredFonts:ti,requiredFormats:ti,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:ti,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ti,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ti,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hb}),gb=os({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()}}),yb=os({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mb}),xb=os({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),Zk={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,Oy=/-[a-z]/g,ej=/^data[-\w.:]+$/i;function tj(e,i){const l=Dp(i);let r=i,u=Bn;if(l in e.normal)return e.property[e.normal[l]];if(l.length>4&&l.slice(0,4)==="data"&&ej.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(Oy,ij);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!Oy.test(c)){let d=c.replace(Jk,nj);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=nh}return new u(r,i)}function nj(e){return"-"+e.toLowerCase()}function ij(e){return e.charAt(1).toUpperCase()}const lj=fb([pb,Xk,gb,yb,xb],"html"),ih=fb([pb,Qk,gb,yb,xb],"svg");function aj(e){return e.join(" ").trim()}var ts={},Ff,zy;function rj(){if(zy)return Ff;zy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,l=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
51
+ `,m="/",b="*",y="",k="comment",w="declaration";function T(z,N){if(typeof z!="string")throw new TypeError("First argument must be a string");if(!z)return[];N=N||{};var G=1,B=1;function P(ge){var ue=ge.match(i);ue&&(G+=ue.length);var V=ge.lastIndexOf(g);B=~V?ge.length-V:B+ge.length}function se(){var ge={line:G,column:B};return function(ue){return ue.position=new _(ge),ee(),ue}}function _(ge){this.start=ge,this.end={line:G,column:B},this.source=N.source}_.prototype.content=z;function X(ge){var ue=new Error(N.source+":"+G+":"+B+": "+ge);if(ue.reason=ge,ue.filename=N.source,ue.line=G,ue.column=B,ue.source=z,!N.silent)throw ue}function ae(ge){var ue=ge.exec(z);if(ue){var V=ue[0];return P(V),z=z.slice(V.length),ue}}function ee(){ae(l)}function I(ge){var ue;for(ge=ge||[];ue=te();)ue!==!1&&ge.push(ue);return ge}function te(){var ge=se();if(!(m!=z.charAt(0)||b!=z.charAt(1))){for(var ue=2;y!=z.charAt(ue)&&(b!=z.charAt(ue)||m!=z.charAt(ue+1));)++ue;if(ue+=2,y===z.charAt(ue-1))return X("End of comment missing");var V=z.slice(2,ue-2);return B+=2,P(V),z=z.slice(ue),B+=2,ge({type:k,comment:V})}}function ce(){var ge=se(),ue=ae(r);if(ue){if(te(),!ae(u))return X("property missing ':'");var V=ae(c),oe=ge({type:w,property:R(ue[0].replace(e,y)),value:V?R(V[0].replace(e,y)):y});return ae(d),oe}}function Ee(){var ge=[];I(ge);for(var ue;ue=ce();)ue!==!1&&(ge.push(ue),I(ge));return ge}return ee(),Ee()}function R(z){return z?z.replace(p,y):y}return Ff=T,Ff}var Ly;function sj(){if(Ly)return ts;Ly=1;var e=ts&&ts.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ts,"__esModule",{value:!0}),ts.default=l;const i=e(rj());function l(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return ts}var bo={},Iy;function oj(){if(Iy)return bo;Iy=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,l=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(m){return!m||l.test(m)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=function(m,b){return"".concat(b,"-")},g=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(u,p):m=m.replace(r,p),m.replace(i,d))};return bo.camelCase=g,bo}var vo,Uy;function uj(){if(Uy)return vo;Uy=1;var e=vo&&vo.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(sj()),l=oj();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,g){p&&g&&(d[(0,l.camelCase)(p,c)]=g)}),d}return r.default=r,vo=r,vo}var cj=uj();const dj=db(cj),bb=vb("end"),lh=vb("start");function vb(e){return i;function i(l){const r=l&&l.position&&l.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 fj(e){const i=lh(e),l=bb(e);if(i&&l)return{start:i,end:l}}function Oo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?By(e.position):"start"in e||"end"in e?By(e):"line"in e||"column"in e?Op(e):""}function Op(e){return qy(e&&e.line)+":"+qy(e&&e.column)}function By(e){return Op(e&&e.start)+"-"+Op(e&&e.end)}function qy(e){return e&&typeof e=="number"?e:1}class hn extends Error{constructor(i,l,r){super(),typeof l=="string"&&(r=l,l=void 0);let u="",c={},d=!1;if(l&&("line"in l&&"column"in l?c={place:l}:"start"in l&&"end"in l?c={place:l}:"type"in l?c={ancestors:[l],place:l.position}:c={...l}),typeof i=="string"?u=i:!c.cause&&i&&(d=!0,u=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?c.ruleId=r:(c.source=r.slice(0,g),c.ruleId=r.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const p=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=p?p.line:void 0,this.name=Oo(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}hn.prototype.file="";hn.prototype.name="";hn.prototype.reason="";hn.prototype.message="";hn.prototype.stack="";hn.prototype.column=void 0;hn.prototype.line=void 0;hn.prototype.ancestors=void 0;hn.prototype.cause=void 0;hn.prototype.fatal=void 0;hn.prototype.place=void 0;hn.prototype.ruleId=void 0;hn.prototype.source=void 0;const ah={}.hasOwnProperty,pj=new Map,hj=/[A-Z]/g,mj=new Set(["table","tbody","thead","tfoot","tr"]),gj=new Set(["td","th"]),wb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yj(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const l=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=Cj(l,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=Sj(l,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:l,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?ih:lj,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=kb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function kb(e,i,l){if(i.type==="element")return xj(e,i,l);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return bj(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return wj(e,i,l);if(i.type==="mdxjsEsm")return vj(e,i);if(i.type==="root")return kj(e,i,l);if(i.type==="text")return jj(e,i)}function xj(e,i,l){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=ih,e.schema=u),e.ancestors.push(i);const c=Sb(e,i.tagName,!1),d=Tj(e,i);let p=sh(e,i);return mj.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!Wk(g):!0})),jb(e,d,c,i),rh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,l)}function bj(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)}$o(e,i.position)}function vj(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);$o(e,i.position)}function wj(e,i,l){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=ih,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:Sb(e,i.name,!0),d=Ej(e,i),p=sh(e,i);return jb(e,d,c,i),rh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,l)}function kj(e,i,l){const r={};return rh(r,sh(e,i)),e.create(i,e.Fragment,r,l)}function jj(e,i){return i.value}function jb(e,i,l,r){typeof l!="string"&&l!==e.Fragment&&e.passNode&&(i.node=r)}function rh(e,i){if(i.length>0){const l=i.length>1?i:i[0];l&&(e.children=l)}}function Sj(e,i,l){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?l:i;return p?m(c,d,p):m(c,d)}}function Cj(e,i){return l;function l(r,u,c,d){const p=Array.isArray(c.children),g=lh(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function Tj(e,i){const l={};let r,u;for(u in i.properties)if(u!=="children"&&ah.call(i.properties,u)){const c=Aj(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&gj.has(i.tagName)?r=p:l[d]=p}}if(r){const c=l.style||(l.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return l}function Ej(e,i){const l={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const p=d.properties[0];p.type,Object.assign(l,e.evaluater.evaluateExpression(p.argument))}else $o(e,i.position);else{const u=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const p=r.value.data.estree.body[0];p.type,c=e.evaluater.evaluateExpression(p.expression)}else $o(e,i.position);else c=r.value===null?!0:r.value;l[u]=c}return l}function sh(e,i){const l=[];let r=-1;const u=e.passKeys?new Map:pj;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.passKeys){const g=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(g){const m=u.get(g)||0;d=g+"-"+m,u.set(g,m+1)}}const p=kb(e,c,d);p!==void 0&&l.push(p)}return l}function Aj(e,i,l){const r=tj(e.schema,i);if(!(l==null||typeof l=="number"&&Number.isNaN(l))){if(Array.isArray(l)&&(l=r.commaSeparated?Gk(l):aj(l)),r.property==="style"){let u=typeof l=="object"?l:Nj(e,String(l));return e.stylePropertyNameCase==="css"&&(u=_j(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?Zk[r.property]||r.property:r.attribute,l]}}function Nj(e,i){try{return dj(i,{reactCompat:!0})}catch(l){if(e.ignoreInvalidStyle)return{};const r=l,u=new hn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=e.filePath||void 0,u.url=wb+"#cannot-parse-style-attribute",u}}function Sb(e,i,l){let r;if(!l)r={type:"Literal",value:i};else if(i.includes(".")){const u=i.split(".");let c=-1,d;for(;++c<u.length;){const p=Dy(u[c])?{type:"Identifier",name:u[c]}:{type:"Literal",value:u[c]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(c&&p.type==="Literal"),optional:!1}:p}r=d}else r=Dy(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return ah.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);$o(e)}function $o(e,i){const l=new hn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=wb+"#cannot-handle-mdx-estrees-without-createevaluater",l}function _j(e){const i={};let l;for(l in e)ah.call(e,l)&&(i[Dj(l)]=e[l]);return i}function Dj(e){let i=e.replace(hj,Rj);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Rj(e){return"-"+e.toLowerCase()}const Wf={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"]},Mj={};function oh(e,i){const l=Mj,r=typeof l.includeImageAlt=="boolean"?l.includeImageAlt:!0,u=typeof l.includeHtml=="boolean"?l.includeHtml:!0;return Cb(e,r,u)}function Cb(e,i,l){if(Oj(e)){if("value"in e)return e.type==="html"&&!l?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Hy(e.children,i,l)}return Array.isArray(e)?Hy(e,i,l):""}function Hy(e,i,l){const r=[];let u=-1;for(;++u<e.length;)r[u]=Cb(e[u],i,l);return r.join("")}function Oj(e){return!!(e&&typeof e=="object")}const $y=document.createElement("i");function uh(e){const i="&"+e+";";$y.innerHTML=i;const l=$y.textContent;return l.charCodeAt(l.length-1)===59&&e!=="semi"||l===i?!1:l}function ni(e,i,l,r){const u=e.length;let c=0,d;if(i<0?i=-i>u?0:u+i:i=i>u?u:i,l=l>0?l:0,r.length<1e4)d=Array.from(r),d.unshift(i,l),e.splice(...d);else for(l&&e.splice(i,l);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function hi(e,i){return e.length>0?(ni(e,e.length,0,i),e):i}const Gy={}.hasOwnProperty;function Tb(e){const i={};let l=-1;for(;++l<e.length;)zj(i,e[l]);return i}function zj(e,i){let l;for(l in i){const u=(Gy.call(e,l)?e[l]:void 0)||(e[l]={}),c=i[l];let d;if(c)for(d in c){Gy.call(u,d)||(u[d]=[]);const p=c[d];Lj(u[d],Array.isArray(p)?p:p?[p]:[])}}}function Lj(e,i){let l=-1;const r=[];for(;++l<i.length;)(i[l].add==="after"?e:r).push(i[l]);ni(e,0,0,r)}function Eb(e,i){const l=Number.parseInt(e,i);return l<9||l===11||l>13&&l<32||l>126&&l<160||l>55295&&l<57344||l>64975&&l<65008||(l&65535)===65535||(l&65535)===65534||l>1114111?"�":String.fromCodePoint(l)}function _i(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vn=Ta(/[A-Za-z]/),pn=Ta(/[\dA-Za-z]/),Ij=Ta(/[#-'*+\--9=?A-Z^-~]/);function zc(e){return e!==null&&(e<32||e===127)}const zp=Ta(/\d/),Uj=Ta(/[\dA-Fa-f]/),Bj=Ta(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Gc=Ta(new RegExp("\\p{P}|\\p{S}","u")),or=Ta(/\s/);function Ta(e){return i;function i(l){return l!==null&&l>-1&&e.test(String.fromCharCode(l))}}function us(e){const i=[];let l=-1,r=0,u=0;for(;++l<e.length;){const c=e.charCodeAt(l);let d="";if(c===37&&pn(e.charCodeAt(l+1))&&pn(e.charCodeAt(l+2)))u=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const p=e.charCodeAt(l+1);c<56320&&p>56319&&p<57344?(d=String.fromCharCode(c,p),u=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(e.slice(r,l),encodeURIComponent(d)),r=l+u+1,d=""),u&&(l+=u,u=0)}return i.join("")+e.slice(r)}function et(e,i,l,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return Ke(g)?(e.enter(l),p(g)):i(g)}function p(g){return Ke(g)&&c++<u?(e.consume(g),p):(e.exit(l),i(g))}}const qj={tokenize:Hj};function Hj(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let l;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),et(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const g=e.enter("chunkText",{contentType:"text",previous:l});return l&&(l.next=g),l=g,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return Me(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const $j={tokenize:Gj},Vy={tokenize:Vj};function Gj(e){const i=this,l=[];let r=0,u,c,d;return p;function p(B){if(r<l.length){const P=l[r];return i.containerState=P[1],e.attempt(P[0].continuation,g,m)(B)}return m(B)}function g(B){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&G();const P=i.events.length;let se=P,_;for(;se--;)if(i.events[se][0]==="exit"&&i.events[se][1].type==="chunkFlow"){_=i.events[se][1].end;break}N(r);let X=P;for(;X<i.events.length;)i.events[X][1].end={..._},X++;return ni(i.events,se+1,0,i.events.slice(P)),i.events.length=X,m(B)}return p(B)}function m(B){if(r===l.length){if(!u)return k(B);if(u.currentConstruct&&u.currentConstruct.concrete)return T(B);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Vy,b,y)(B)}function b(B){return u&&G(),N(r),k(B)}function y(B){return i.parser.lazy[i.now().line]=r!==l.length,d=i.now().offset,T(B)}function k(B){return i.containerState={},e.attempt(Vy,w,T)(B)}function w(B){return r++,l.push([i.currentConstruct,i.containerState]),k(B)}function T(B){if(B===null){u&&G(),N(0),e.consume(B);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),R(B)}function R(B){if(B===null){z(e.exit("chunkFlow"),!0),N(0),e.consume(B);return}return Me(B)?(e.consume(B),z(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume(B),R)}function z(B,P){const se=i.sliceStream(B);if(P&&se.push(null),B.previous=c,c&&(c.next=B),c=B,u.defineSkip(B.start),u.write(se),i.parser.lazy[B.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 X=i.events.length;let ae=X,ee,I;for(;ae--;)if(i.events[ae][0]==="exit"&&i.events[ae][1].type==="chunkFlow"){if(ee){I=i.events[ae][1].end;break}ee=!0}for(N(r),_=X;_<i.events.length;)i.events[_][1].end={...I},_++;ni(i.events,ae+1,0,i.events.slice(X)),i.events.length=_}}function N(B){let P=l.length;for(;P-- >B;){const se=l[P];i.containerState=se[1],se[0].exit.call(i,e)}l.length=B}function G(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function Vj(e,i,l){return et(e,e.attempt(this.parser.constructs.document,i,l),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rs(e){if(e===null||yt(e)||or(e))return 1;if(Gc(e))return 2}function Vc(e,i,l){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,l),r.push(c))}return i}const Lp={name:"attention",resolveAll:Pj,tokenize:Yj};function Pj(e,i){let l=-1,r,u,c,d,p,g,m,b;for(;++l<e.length;)if(e[l][0]==="enter"&&e[l][1].type==="attentionSequence"&&e[l][1]._close){for(r=l;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[l][1]).charCodeAt(0)){if((e[r][1]._close||e[l][1]._open)&&(e[l][1].end.offset-e[l][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[l][1].end.offset-e[l][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[l][1].end.offset-e[l][1].start.offset>1?2:1;const y={...e[r][1].end},k={...e[l][1].start};Py(y,-g),Py(k,g),d={type:g>1?"strongSequence":"emphasisSequence",start:y,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[l][1].start},end:k},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[l][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[l][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=hi(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=hi(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=hi(m,Vc(i.parser.constructs.insideSpan.null,e.slice(r+1,l),i)),m=hi(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[l][1].end.offset-e[l][1].start.offset?(b=2,m=hi(m,[["enter",e[l][1],i],["exit",e[l][1],i]])):b=0,ni(e,r-1,l-r+3,m),l=r+m.length-b-2;break}}for(l=-1;++l<e.length;)e[l][1].type==="attentionSequence"&&(e[l][1].type="data");return e}function Yj(e,i){const l=this.parser.constructs.attentionMarkers.null,r=this.previous,u=rs(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=rs(g),y=!b||b===2&&u||l.includes(g),k=!u||u===2&&b||l.includes(r);return m._open=!!(c===42?y:y&&(u||!k)),m._close=!!(c===42?k:k&&(b||!y)),i(g)}}function Py(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const Fj={name:"autolink",tokenize:Wj};function Wj(e,i,l){let r=0;return u;function u(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(w){return vn(w)?(e.consume(w),d):w===64?l(w):m(w)}function d(w){return w===43||w===45||w===46||pn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||pn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||zc(w)?l(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):Ij(w)?(e.consume(w),m):l(w)}function b(w){return pn(w)?y(w):l(w)}function y(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):k(w)}function k(w){if((w===45||pn(w))&&r++<63){const T=w===45?k:y;return e.consume(w),T}return l(w)}}const Po={partial:!0,tokenize:Kj};function Kj(e,i,l){return r;function r(c){return Ke(c)?et(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Me(c)?i(c):l(c)}}const Ab={continuation:{tokenize:Qj},exit:Zj,name:"blockQuote",tokenize:Xj};function Xj(e,i,l){const r=this;return u;function u(d){if(d===62){const p=r.containerState;return p.open||(e.enter("blockQuote",{_container:!0}),p.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return l(d)}function c(d){return Ke(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function Qj(e,i,l){const r=this;return u;function u(d){return Ke(d)?et(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(Ab,i,l)(d)}}function Zj(e){e.exit("blockQuote")}const Nb={name:"characterEscape",tokenize:Jj};function Jj(e,i,l){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return Bj(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):l(c)}}const _b={name:"characterReference",tokenize:eS};function eS(e,i,l){const r=this;let u=0,c,d;return p;function p(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),g}function g(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=pn,b(y))}function m(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=Uj,b):(e.enter("characterReferenceValue"),c=7,d=zp,b(y))}function b(y){if(y===59&&u){const k=e.exit("characterReferenceValue");return d===pn&&!uh(r.sliceSerialize(k))?l(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(y)&&u++<c?(e.consume(y),b):l(y)}}const Yy={partial:!0,tokenize:nS},Fy={concrete:!0,name:"codeFenced",tokenize:tS};function tS(e,i,l){const r=this,u={partial:!0,tokenize:se};let c=0,d=0,p;return g;function g(_){return m(_)}function m(_){const X=r.events[r.events.length-1];return c=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,p=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(_)}function b(_){return _===p?(d++,e.consume(_),b):d<3?l(_):(e.exit("codeFencedFenceSequence"),Ke(_)?et(e,y,"whitespace")(_):y(_))}function y(_){return _===null||Me(_)?(e.exit("codeFencedFence"),r.interrupt?i(_):e.check(Yy,R,P)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),k(_))}function k(_){return _===null||Me(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(_)):Ke(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,w,"whitespace")(_)):_===96&&_===p?l(_):(e.consume(_),k)}function w(_){return _===null||Me(_)?y(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),T(_))}function T(_){return _===null||Me(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(_)):_===96&&_===p?l(_):(e.consume(_),T)}function R(_){return e.attempt(u,P,z)(_)}function z(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),N}function N(_){return c>0&&Ke(_)?et(e,G,"linePrefix",c+1)(_):G(_)}function G(_){return _===null||Me(_)?e.check(Yy,R,P)(_):(e.enter("codeFlowValue"),B(_))}function B(_){return _===null||Me(_)?(e.exit("codeFlowValue"),G(_)):(e.consume(_),B)}function P(_){return e.exit("codeFenced"),i(_)}function se(_,X,ae){let ee=0;return I;function I(ue){return _.enter("lineEnding"),_.consume(ue),_.exit("lineEnding"),te}function te(ue){return _.enter("codeFencedFence"),Ke(ue)?et(_,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):ce(ue)}function ce(ue){return ue===p?(_.enter("codeFencedFenceSequence"),Ee(ue)):ae(ue)}function Ee(ue){return ue===p?(ee++,_.consume(ue),Ee):ee>=d?(_.exit("codeFencedFenceSequence"),Ke(ue)?et(_,ge,"whitespace")(ue):ge(ue)):ae(ue)}function ge(ue){return ue===null||Me(ue)?(_.exit("codeFencedFence"),X(ue)):ae(ue)}}}function nS(e,i,l){const r=this;return u;function u(d){return d===null?l(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?l(d):i(d)}}const Kf={name:"codeIndented",tokenize:lS},iS={partial:!0,tokenize:aS};function lS(e,i,l){const r=this;return u;function u(m){return e.enter("codeIndented"),et(e,c,"linePrefix",5)(m)}function c(m){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(m):l(m)}function d(m){return m===null?g(m):Me(m)?e.attempt(iS,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||Me(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function aS(e,i,l){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?l(d):Me(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):et(e,c,"linePrefix",5)(d)}function c(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):Me(d)?u(d):l(d)}}const rS={name:"codeText",previous:oS,resolve:sS,tokenize:uS};function sS(e){let i=e.length-4,l=3,r,u;if((e[l][1].type==="lineEnding"||e[l][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=l;++r<i;)if(e[r][1].type==="codeTextData"){e[l][1].type="codeTextPadding",e[i][1].type="codeTextPadding",l+=2,i-=2;break}}for(r=l-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 oS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uS(e,i,l){let r=0,u,c;return d;function d(y){return e.enter("codeText"),e.enter("codeTextSequence"),p(y)}function p(y){return y===96?(e.consume(y),r++,p):(e.exit("codeTextSequence"),g(y))}function g(y){return y===null?l(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),g):y===96?(c=e.enter("codeTextSequence"),u=0,b(y)):Me(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("codeTextData"),m(y))}function m(y){return y===null||y===32||y===96||Me(y)?(e.exit("codeTextData"),g(y)):(e.consume(y),m)}function b(y){return y===96?(e.consume(y),u++,b):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(y)):(c.type="codeTextData",m(y))}}class cS{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,l){const r=l??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,l,r){const u=l||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&wo(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),wo(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),wo(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 l=this.left.splice(i,Number.POSITIVE_INFINITY);wo(this.right,l.reverse())}else{const l=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);wo(this.left,l.reverse())}}}function wo(e,i){let l=0;if(i.length<1e4)e.push(...i);else for(;l<i.length;)e.push(...i.slice(l,l+1e4)),l+=1e4}function Db(e){const i={};let l=-1,r,u,c,d,p,g,m;const b=new cS(e);for(;++l<b.length;){for(;l in i;)l=i[l];if(r=b.get(l),l&&r[1].type==="chunkFlow"&&b.get(l-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,dS(b,l)),l=i[l],m=!0);else if(r[1]._container){for(c=l,u=void 0;c--;)if(d=b.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),d[1].type="lineEnding",u=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;u&&(r[1].end={...b.get(u)[1].start},p=b.slice(u,l),p.unshift(r),b.splice(u,l-u+1,p))}}return ni(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function dS(e,i){const l=e.get(i)[1],r=e.get(i)[2];let u=i-1;const c=[];let d=l._tokenizer;d||(d=r.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,g=[],m={};let b,y,k=-1,w=l,T=0,R=0;const z=[R];for(;w;){for(;e.get(++u)[1]!==w;);c.push(u),w._tokenizer||(b=r.sliceStream(w),w.next||b.push(null),y&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),y=w,w=w.next}for(w=l;++k<p.length;)p[k][0]==="exit"&&p[k-1][0]==="enter"&&p[k][1].type===p[k-1][1].type&&p[k][1].start.line!==p[k][1].end.line&&(R=k+1,z.push(R),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):z.pop(),k=z.length;k--;){const N=p.slice(z[k],z[k+1]),G=c.pop();g.push([G,G+N.length-1]),e.splice(G,2,N)}for(g.reverse(),k=-1;++k<g.length;)m[T+g[k][0]]=T+g[k][1],T+=g[k][1]-g[k][0]-1;return m}const fS={resolve:hS,tokenize:mS},pS={partial:!0,tokenize:gS};function hS(e){return Db(e),e}function mS(e,i){let l;return r;function r(p){return e.enter("content"),l=e.enter("chunkContent",{contentType:"content"}),u(p)}function u(p){return p===null?c(p):Me(p)?e.check(pS,d,c)(p):(e.consume(p),u)}function c(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),l.next=e.enter("chunkContent",{contentType:"content",previous:l}),l=l.next,u}}function gS(e,i,l){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),et(e,c,"linePrefix")}function c(d){if(d===null||Me(d))return l(d);const p=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):e.interrupt(r.parser.constructs.flow,l,i)(d)}}function Rb(e,i,l,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return y;function y(N){return N===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(N),e.exit(c),k):N===null||N===32||N===41||zc(N)?l(N):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),R(N))}function k(N){return N===62?(e.enter(c),e.consume(N),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===62?(e.exit("chunkString"),e.exit(p),k(N)):N===null||N===60||Me(N)?l(N):(e.consume(N),N===92?T:w)}function T(N){return N===60||N===62||N===92?(e.consume(N),w):w(N)}function R(N){return!b&&(N===null||N===41||yt(N))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(N)):b<m&&N===40?(e.consume(N),b++,R):N===41?(e.consume(N),b--,R):N===null||N===32||N===40||zc(N)?l(N):(e.consume(N),N===92?z:R)}function z(N){return N===40||N===41||N===92?(e.consume(N),R):R(N)}}function Mb(e,i,l,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?l(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):Me(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===null||w===91||w===93||Me(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!Ke(w)),w===92?k:y)}function k(w){return w===91||w===92||w===93?(e.consume(w),p++,y):y(w)}}function Ob(e,i,l,r,u,c){let d;return p;function p(k){return k===34||k===39||k===40?(e.enter(r),e.enter(u),e.consume(k),e.exit(u),d=k===40?41:k,g):l(k)}function g(k){return k===d?(e.enter(u),e.consume(k),e.exit(u),e.exit(r),i):(e.enter(c),m(k))}function m(k){return k===d?(e.exit(c),g(d)):k===null?l(k):Me(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),et(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===d||k===null||Me(k)?(e.exit("chunkString"),m(k)):(e.consume(k),k===92?y:b)}function y(k){return k===d||k===92?(e.consume(k),b):b(k)}}function zo(e,i){let l;return r;function r(u){return Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l=!0,r):Ke(u)?et(e,r,l?"linePrefix":"lineSuffix")(u):i(u)}}const yS={name:"definition",tokenize:bS},xS={partial:!0,tokenize:vS};function bS(e,i,l){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return Mb.call(r,e,p,l,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=_i(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),g):l(w)}function g(w){return yt(w)?zo(e,m)(w):m(w)}function m(w){return Rb(e,b,l,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(xS,y,y)(w)}function y(w){return Ke(w)?et(e,k,"whitespace")(w):k(w)}function k(w){return w===null||Me(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):l(w)}}function vS(e,i,l){return r;function r(p){return yt(p)?zo(e,u)(p):l(p)}function u(p){return Ob(e,c,l,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return Ke(p)?et(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Me(p)?i(p):l(p)}}const wS={name:"hardBreakEscape",tokenize:kS};function kS(e,i,l){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Me(c)?(e.exit("hardBreakEscape"),i(c)):l(c)}}const jS={name:"headingAtx",resolve:SS,tokenize:CS};function SS(e,i){let l=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),l-2>r&&e[l][1].type==="whitespace"&&(l-=2),e[l][1].type==="atxHeadingSequence"&&(r===l-1||l-4>r&&e[l-2][1].type==="whitespace")&&(l-=r+1===l?2:4),l>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[l][1].end},c={type:"chunkText",start:e[r][1].start,end:e[l][1].end,contentType:"text"},ni(e,r,l-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function CS(e,i,l){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||yt(b)?(e.exit("atxHeadingSequence"),p(b)):l(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Me(b)?(e.exit("atxHeading"),i(b)):Ke(b)?et(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||yt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const TS=["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"],Wy=["pre","script","style","textarea"],ES={concrete:!0,name:"htmlFlow",resolveTo:_S,tokenize:DS},AS={partial:!0,tokenize:MS},NS={partial:!0,tokenize:RS};function _S(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 DS(e,i,l){const r=this;let u,c,d,p,g;return m;function m(C){return b(C)}function b(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),y}function y(C){return C===33?(e.consume(C),k):C===47?(e.consume(C),c=!0,R):C===63?(e.consume(C),u=3,r.interrupt?i:O):vn(C)?(e.consume(C),d=String.fromCharCode(C),z):l(C)}function k(C){return C===45?(e.consume(C),u=2,w):C===91?(e.consume(C),u=5,p=0,T):vn(C)?(e.consume(C),u=4,r.interrupt?i:O):l(C)}function w(C){return C===45?(e.consume(C),r.interrupt?i:O):l(C)}function T(C){const K="CDATA[";return C===K.charCodeAt(p++)?(e.consume(C),p===K.length?r.interrupt?i:ce:T):l(C)}function R(C){return vn(C)?(e.consume(C),d=String.fromCharCode(C),z):l(C)}function z(C){if(C===null||C===47||C===62||yt(C)){const K=C===47,me=d.toLowerCase();return!K&&!c&&Wy.includes(me)?(u=1,r.interrupt?i(C):ce(C)):TS.includes(d.toLowerCase())?(u=6,K?(e.consume(C),N):r.interrupt?i(C):ce(C)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?l(C):c?G(C):B(C))}return C===45||pn(C)?(e.consume(C),d+=String.fromCharCode(C),z):l(C)}function N(C){return C===62?(e.consume(C),r.interrupt?i:ce):l(C)}function G(C){return Ke(C)?(e.consume(C),G):I(C)}function B(C){return C===47?(e.consume(C),I):C===58||C===95||vn(C)?(e.consume(C),P):Ke(C)?(e.consume(C),B):I(C)}function P(C){return C===45||C===46||C===58||C===95||pn(C)?(e.consume(C),P):se(C)}function se(C){return C===61?(e.consume(C),_):Ke(C)?(e.consume(C),se):B(C)}function _(C){return C===null||C===60||C===61||C===62||C===96?l(C):C===34||C===39?(e.consume(C),g=C,X):Ke(C)?(e.consume(C),_):ae(C)}function X(C){return C===g?(e.consume(C),g=null,ee):C===null||Me(C)?l(C):(e.consume(C),X)}function ae(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||yt(C)?se(C):(e.consume(C),ae)}function ee(C){return C===47||C===62||Ke(C)?B(C):l(C)}function I(C){return C===62?(e.consume(C),te):l(C)}function te(C){return C===null||Me(C)?ce(C):Ke(C)?(e.consume(C),te):l(C)}function ce(C){return C===45&&u===2?(e.consume(C),V):C===60&&u===1?(e.consume(C),oe):C===62&&u===4?(e.consume(C),A):C===63&&u===3?(e.consume(C),O):C===93&&u===5?(e.consume(C),De):Me(C)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(AS,L,Ee)(C)):C===null||Me(C)?(e.exit("htmlFlowData"),Ee(C)):(e.consume(C),ce)}function Ee(C){return e.check(NS,ge,L)(C)}function ge(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ue}function ue(C){return C===null||Me(C)?Ee(C):(e.enter("htmlFlowData"),ce(C))}function V(C){return C===45?(e.consume(C),O):ce(C)}function oe(C){return C===47?(e.consume(C),d="",ye):ce(C)}function ye(C){if(C===62){const K=d.toLowerCase();return Wy.includes(K)?(e.consume(C),A):ce(C)}return vn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),ye):ce(C)}function De(C){return C===93?(e.consume(C),O):ce(C)}function O(C){return C===62?(e.consume(C),A):C===45&&u===2?(e.consume(C),O):ce(C)}function A(C){return C===null||Me(C)?(e.exit("htmlFlowData"),L(C)):(e.consume(C),A)}function L(C){return e.exit("htmlFlow"),i(C)}}function RS(e,i,l){const r=this;return u;function u(d){return Me(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):l(d)}function c(d){return r.parser.lazy[r.now().line]?l(d):i(d)}}function MS(e,i,l){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(Po,i,l)}}const OS={name:"htmlText",tokenize:zS};function zS(e,i,l){const r=this;let u,c,d;return p;function p(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),se):O===63?(e.consume(O),B):vn(O)?(e.consume(O),ae):l(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,T):vn(O)?(e.consume(O),G):l(O)}function b(O){return O===45?(e.consume(O),w):l(O)}function y(O){return O===null?l(O):O===45?(e.consume(O),k):Me(O)?(d=y,oe(O)):(e.consume(O),y)}function k(O){return O===45?(e.consume(O),w):y(O)}function w(O){return O===62?V(O):O===45?k(O):y(O)}function T(O){const A="CDATA[";return O===A.charCodeAt(c++)?(e.consume(O),c===A.length?R:T):l(O)}function R(O){return O===null?l(O):O===93?(e.consume(O),z):Me(O)?(d=R,oe(O)):(e.consume(O),R)}function z(O){return O===93?(e.consume(O),N):R(O)}function N(O){return O===62?V(O):O===93?(e.consume(O),N):R(O)}function G(O){return O===null||O===62?V(O):Me(O)?(d=G,oe(O)):(e.consume(O),G)}function B(O){return O===null?l(O):O===63?(e.consume(O),P):Me(O)?(d=B,oe(O)):(e.consume(O),B)}function P(O){return O===62?V(O):B(O)}function se(O){return vn(O)?(e.consume(O),_):l(O)}function _(O){return O===45||pn(O)?(e.consume(O),_):X(O)}function X(O){return Me(O)?(d=X,oe(O)):Ke(O)?(e.consume(O),X):V(O)}function ae(O){return O===45||pn(O)?(e.consume(O),ae):O===47||O===62||yt(O)?ee(O):l(O)}function ee(O){return O===47?(e.consume(O),V):O===58||O===95||vn(O)?(e.consume(O),I):Me(O)?(d=ee,oe(O)):Ke(O)?(e.consume(O),ee):V(O)}function I(O){return O===45||O===46||O===58||O===95||pn(O)?(e.consume(O),I):te(O)}function te(O){return O===61?(e.consume(O),ce):Me(O)?(d=te,oe(O)):Ke(O)?(e.consume(O),te):ee(O)}function ce(O){return O===null||O===60||O===61||O===62||O===96?l(O):O===34||O===39?(e.consume(O),u=O,Ee):Me(O)?(d=ce,oe(O)):Ke(O)?(e.consume(O),ce):(e.consume(O),ge)}function Ee(O){return O===u?(e.consume(O),u=void 0,ue):O===null?l(O):Me(O)?(d=Ee,oe(O)):(e.consume(O),Ee)}function ge(O){return O===null||O===34||O===39||O===60||O===61||O===96?l(O):O===47||O===62||yt(O)?ee(O):(e.consume(O),ge)}function ue(O){return O===47||O===62||yt(O)?ee(O):l(O)}function V(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):l(O)}function oe(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ye}function ye(O){return Ke(O)?et(e,De,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):De(O)}function De(O){return e.enter("htmlTextData"),d(O)}}const ch={name:"labelEnd",resolveAll:BS,resolveTo:qS,tokenize:HS},LS={tokenize:$S},IS={tokenize:GS},US={tokenize:VS};function BS(e){let i=-1;const l=[];for(;++i<e.length;){const r=e[i][1];if(l.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!==l.length&&ni(e,0,e.length,l),e}function qS(e,i){let l=e.length,r=0,u,c,d,p;for(;l--;)if(u=e[l][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[l][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[l][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=l,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(d=l);const g={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=hi(p,e.slice(c+1,c+r+3)),p=hi(p,[["enter",b,i]]),p=hi(p,Vc(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=hi(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=hi(p,e.slice(d+1)),p=hi(p,[["exit",g,i]]),ni(e,c,e.length,p),e}function HS(e,i,l){const r=this;let u=r.events.length,c,d;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){c=r.events[u][1];break}return p;function p(k){return c?c._inactive?y(k):(d=r.parser.defined.includes(_i(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(k),e.exit("labelMarker"),e.exit("labelEnd"),g):l(k)}function g(k){return k===40?e.attempt(LS,b,d?b:y)(k):k===91?e.attempt(IS,b,d?m:y)(k):d?b(k):y(k)}function m(k){return e.attempt(US,b,y)(k)}function b(k){return i(k)}function y(k){return c._balanced=!0,l(k)}}function $S(e,i,l){return r;function r(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),u}function u(y){return yt(y)?zo(e,c)(y):c(y)}function c(y){return y===41?b(y):Rb(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function d(y){return yt(y)?zo(e,g)(y):b(y)}function p(y){return l(y)}function g(y){return y===34||y===39||y===40?Ob(e,m,l,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):b(y)}function m(y){return yt(y)?zo(e,b)(y):b(y)}function b(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),i):l(y)}}function GS(e,i,l){const r=this;return u;function u(p){return Mb.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(_i(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):l(p)}function d(p){return l(p)}}function VS(e,i,l){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):l(c)}}const PS={name:"labelStartImage",resolveAll:ch.resolveAll,tokenize:YS};function YS(e,i,l){const r=this;return u;function u(p){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(p),e.exit("labelImageMarker"),c}function c(p){return p===91?(e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelImage"),d):l(p)}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?l(p):i(p)}}const FS={name:"labelStartLink",resolveAll:ch.resolveAll,tokenize:WS};function WS(e,i,l){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?l(d):i(d)}}const Xf={name:"lineEnding",tokenize:KS};function KS(e,i){return l;function l(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,i,"linePrefix")}}const Nc={name:"thematicBreak",tokenize:XS};function XS(e,i,l){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Me(m))?(e.exit("thematicBreak"),i(m)):l(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),Ke(m)?et(e,p,"whitespace")(m):p(m))}}const In={continuation:{tokenize:e0},exit:n0,name:"list",tokenize:JS},QS={partial:!0,tokenize:i0},ZS={partial:!0,tokenize:t0};function JS(e,i,l){const r=this,u=r.events[r.events.length-1];let c=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,d=0;return p;function p(w){const T=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:zp(w)){if(r.containerState.type||(r.containerState.type=T,e.enter(T,{_container:!0})),T==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Nc,l,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return l(w)}function g(w){return zp(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):l(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(Po,r.interrupt?l:b,e.attempt(QS,k,y))}function b(w){return r.containerState.initialBlankLine=!0,c++,k(w)}function y(w){return Ke(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),k):l(w)}function k(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function e0(e,i,l){const r=this;return r.containerState._closeFlow=void 0,e.check(Po,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(e,i,"listItemIndent",r.containerState.size+1)(p)}function c(p){return r.containerState.furtherBlankLines||!Ke(p)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(p)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ZS,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(In,i,l),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function t0(e,i,l){const r=this;return et(e,u,"listItemIndent",r.containerState.size+1);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(c):l(c)}}function n0(e){e.exit(this.containerState.type)}function i0(e,i,l){const r=this;return et(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!Ke(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):l(c)}}const Ky={name:"setextUnderline",resolveTo:l0,tokenize:a0};function l0(e,i){let l=e.length,r,u,c;for(;l--;)if(e[l][0]==="enter"){if(e[l][1].type==="content"){r=l;break}e[l][1].type==="paragraph"&&(u=l)}else e[l][1].type==="content"&&e.splice(l,1),!c&&e[l][1].type==="definition"&&(c=l);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 a0(e,i,l){const r=this;let u;return c;function c(m){let b=r.events.length,y;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){y=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||y)?(e.enter("setextHeadingLine"),u=m,d(m)):l(m)}function d(m){return e.enter("setextHeadingLineSequence"),p(m)}function p(m){return m===u?(e.consume(m),p):(e.exit("setextHeadingLineSequence"),Ke(m)?et(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Me(m)?(e.exit("setextHeadingLine"),i(m)):l(m)}}const r0={tokenize:s0};function s0(e){const i=this,l=e.attempt(Po,r,e.attempt(this.parser.constructs.flowInitial,u,et(e,e.attempt(this.parser.constructs.flow,u,e.attempt(fS,u)),"linePrefix")));return l;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,l}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,l}}const o0={resolveAll:Lb()},u0=zb("string"),c0=zb("text");function zb(e){return{resolveAll:Lb(e==="text"?d0:void 0),tokenize:i};function i(l){const r=this,u=this.parser.constructs[e],c=l.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(b){if(b===null){l.consume(b);return}return l.enter("data"),l.consume(b),g}function g(b){return m(b)?(l.exit("data"),c(b)):(l.consume(b),g)}function m(b){if(b===null)return!0;const y=u[b];let k=-1;if(y)for(;++k<y.length;){const w=y[k];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Lb(e){return i;function i(l,r){let u=-1,c;for(;++u<=l.length;)c===void 0?l[u]&&l[u][1].type==="data"&&(c=u,u++):(!l[u]||l[u][1].type!=="data")&&(u!==c+2&&(l[c][1].end=l[u-1][1].end,l.splice(c+2,u-c-2),u=c+2),c=void 0);return e?e(l,r):l}}function d0(e,i){let l=0;for(;++l<=e.length;)if((l===e.length||e[l][1].type==="lineEnding")&&e[l-1][1].type==="data"){const r=e[l-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&l===e.length&&(p=0),p){const m={type:l===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(l,0,["enter",m,i],["exit",m,i]),l+=2)}l++}return e}const f0={42:In,43:In,45:In,48:In,49:In,50:In,51:In,52:In,53:In,54:In,55:In,56:In,57:In,62:Ab},p0={91:yS},h0={[-2]:Kf,[-1]:Kf,32:Kf},m0={35:jS,42:Nc,45:[Ky,Nc],60:ES,61:Ky,95:Nc,96:Fy,126:Fy},g0={38:_b,92:Nb},y0={[-5]:Xf,[-4]:Xf,[-3]:Xf,33:PS,38:_b,42:Lp,60:[Fj,OS],91:FS,92:[wS,Nb],93:ch,95:Lp,96:rS},x0={null:[Lp,o0]},b0={null:[42,95]},v0={null:[]},w0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:b0,contentInitial:p0,disable:v0,document:f0,flow:m0,flowInitial:h0,insideSpan:x0,string:g0,text:y0},Symbol.toStringTag,{value:"Module"}));function k0(e,i,l){let r={_bufferIndex:-1,_index:0,line:l&&l.line||1,column:l&&l.column||1,offset:l&&l.offset||0};const u={},c=[];let d=[],p=[];const g={attempt:X(se),check:X(_),consume:G,enter:B,exit:P,interrupt:X(_,{interrupt:!0})},m={code:null,containerState:{},defineSkip:R,events:[],now:T,parser:e,previous:null,sliceSerialize:k,sliceStream:w,write:y};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function y(te){return d=hi(d,te),z(),d[d.length-1]!==null?[]:(ae(i,0),m.events=Vc(c,m.events,m),m.events)}function k(te,ce){return S0(w(te),ce)}function w(te){return j0(d,te)}function T(){const{_bufferIndex:te,_index:ce,line:Ee,column:ge,offset:ue}=r;return{_bufferIndex:te,_index:ce,line:Ee,column:ge,offset:ue}}function R(te){u[te.line]=te.column,I()}function z(){let te;for(;r._index<d.length;){const ce=d[r._index];if(typeof ce=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<ce.length;)N(ce.charCodeAt(r._bufferIndex));else N(ce)}}function N(te){b=b(te)}function G(te){Me(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,I()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=te}function B(te,ce){const Ee=ce||{};return Ee.type=te,Ee.start=T(),m.events.push(["enter",Ee,m]),p.push(Ee),Ee}function P(te){const ce=p.pop();return ce.end=T(),m.events.push(["exit",ce,m]),ce}function se(te,ce){ae(te,ce.from)}function _(te,ce){ce.restore()}function X(te,ce){return Ee;function Ee(ge,ue,V){let oe,ye,De,O;return Array.isArray(ge)?L(ge):"tokenize"in ge?L([ge]):A(ge);function A(Z){return xe;function xe(Le){const Xe=Le!==null&&Z[Le],Ot=Le!==null&&Z.null,Wt=[...Array.isArray(Xe)?Xe:Xe?[Xe]:[],...Array.isArray(Ot)?Ot:Ot?[Ot]:[]];return L(Wt)(Le)}}function L(Z){return oe=Z,ye=0,Z.length===0?V:C(Z[ye])}function C(Z){return xe;function xe(Le){return O=ee(),De=Z,Z.partial||(m.currentConstruct=Z),Z.name&&m.parser.constructs.disable.null.includes(Z.name)?me():Z.tokenize.call(ce?Object.assign(Object.create(m),ce):m,g,K,me)(Le)}}function K(Z){return te(De,O),ue}function me(Z){return O.restore(),++ye<oe.length?C(oe[ye]):V}}}function ae(te,ce){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&ni(m.events,ce,m.events.length-ce,te.resolve(m.events.slice(ce),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function ee(){const te=T(),ce=m.previous,Ee=m.currentConstruct,ge=m.events.length,ue=Array.from(p);return{from:ge,restore:V};function V(){r=te,m.previous=ce,m.currentConstruct=Ee,m.events.length=ge,p=ue,I()}}function I(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function j0(e,i){const l=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(l===u)d=[e[l].slice(r,c)];else{if(d=e.slice(l,u),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}c>0&&d.push(e[u].slice(0,c))}return d}function S0(e,i){let l=-1;const r=[];let u;for(;++l<e.length;){const c=e[l];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
52
52
  `;break}case-3:{d=`\r
53
- `;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&u)continue;d=" ";break}default:d=String.fromCharCode(c)}u=c===-2,r.push(d)}return r.join("")}function kj(e){const r={constructs:jb([xj,...(e||{}).extensions||[]]),content:u(IS),defined:[],document:u(BS),flow:u(ij),lazy:{},string:u(rj),text:u(sj)};return r;function u(c){return d;function d(p){return bj(r,c,p)}}}function Sj(e){for(;!Nb(e););return e}const Wy=/[\0\t\n\r]/g;function jj(){let e=1,i="",l=!0,r;return u;function u(c,d,p){const g=[];let m,b,x,k,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),x=0,i="",l&&(c.charCodeAt(0)===65279&&x++,l=void 0);x<c.length;){if(Wy.lastIndex=x,m=Wy.exec(c),k=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(k),!m){i=c.slice(x);break}if(w===10&&x===k&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<k&&(g.push(c.slice(x,k)),e+=k-x),w){case 0:{g.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,g.push(-2);e++<b;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}x=k+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const Cj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Tj(e){return e.replace(Cj,Ej)}function Ej(e,i,l){if(i)return i;if(l.charCodeAt(0)===35){const u=l.charCodeAt(1),c=u===120||u===88;return Cb(l.slice(c?2:1),c?16:10)}return oh(l)||e}const zb={}.hasOwnProperty;function Aj(e,i,l){return i&&typeof i=="object"&&(l=i,i=void 0),Nj(l)(Sj(kj(l).document().write(jj()(e,i,!0))))}function Nj(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(sn),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:c(zt),blockQuote:c(Ot),characterEscape:ee,characterReference:ee,codeFenced:c(Ft),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(Ft,d),codeText:c(Ye,d),codeTextData:ee,data:ee,codeFlowValue:ee,definition:c(Et),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(Jt),hardBreakEscape:c(rn),hardBreakTrailing:c(rn),htmlFlow:c(ze,d),htmlFlowData:ee,htmlText:c(ze,d),htmlTextData:ee,image:c(wt),label:d,link:c(sn),listItem:c(gi),listItemValue:k,listOrdered:c(wn,x),listUnordered:c(wn),paragraph:c(yi),reference:C,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(zt),strong:c(Di),thematicBreak:c(Ml)},exit:{atxHeading:g(),atxHeadingSequence:se,autolink:g(),autolinkEmail:Xe,autolinkProtocol:Le,blockQuote:g(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:Z,characterReference:xe,codeFenced:g(U),codeFencedFence:O,codeFencedFenceInfo:w,codeFencedFenceMeta:E,codeFlowValue:L,codeIndented:g(_),codeText:g(ue),codeTextData:L,data:L,definition:g(),definitionDestinationString:Y,definitionLabelString:F,definitionTitleString:q,emphasis:g(),hardBreakEscape:g(ce),hardBreakTrailing:g(ce),htmlFlow:g(Ee),htmlFlowData:L,htmlText:g(ge),htmlTextData:L,image:g(oe),label:De,labelText:ye,lineEnding:te,link:g(G),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:K,resourceDestinationString:R,resourceTitleString:A,resource:z,setextHeading:g(ae),setextHeadingLineSequence:X,setextHeadingText:N,strong:g(),thematicBreak:g()}};Lb(i,(e||{}).mdastExtensions||[]);const l={};return r;function r(ne){let he={type:"root",children:[]};const Me={stack:[he],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:l},Ae=[];let Ie=-1;for(;++Ie<ne.length;)if(ne[Ie][1].type==="listOrdered"||ne[Ie][1].type==="listUnordered")if(ne[Ie][0]==="enter")Ae.push(Ie);else{const At=Ae.pop();Ie=u(ne,At,Ie)}for(Ie=-1;++Ie<ne.length;){const At=i[ne[Ie][0]];zb.call(At,ne[Ie][1].type)&&At[ne[Ie][1].type].call(Object.assign({sliceSerialize:ne[Ie][2].sliceSerialize},Me),ne[Ie][1])}if(Me.tokenStack.length>0){const At=Me.tokenStack[Me.tokenStack.length-1];(At[1]||Ky).call(Me,void 0,At[0])}for(he.position={start:ka(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ka(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<i.transforms.length;)he=i.transforms[Ie](he)||he;return he}function u(ne,he,Me){let Ae=he-1,Ie=-1,At=!1,mn,tt,St,on;for(;++Ae<=Me;){const rt=ne[Ae];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Ie++:Ie--,on=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(mn&&!on&&!Ie&&!St&&(St=Ae),on=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:on=void 0}if(!Ie&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Ie===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(mn){let Mi=Ae;for(tt=void 0;Mi--;){const qn=ne[Mi];if(qn[1].type==="lineEnding"||qn[1].type==="lineEndingBlank"){if(qn[0]==="exit")continue;tt&&(ne[tt][1].type="lineEndingBlank",At=!0),qn[1].type="lineEnding",tt=Mi}else if(!(qn[1].type==="linePrefix"||qn[1].type==="blockQuotePrefix"||qn[1].type==="blockQuotePrefixWhitespace"||qn[1].type==="blockQuoteMarker"||qn[1].type==="listItemIndent"))break}St&&(!tt||St<tt)&&(mn._spread=!0),mn.end=Object.assign({},tt?ne[tt][1].start:rt[1].end),ne.splice(tt||Ae,0,["exit",mn,rt[2]]),Ae++,Me++}if(rt[1].type==="listItemPrefix"){const Mi={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};mn=Mi,ne.splice(Ae,0,["enter",Mi,rt[2]]),Ae++,Me++,St=void 0,on=!0}}}return ne[he][1]._spread=At,Me}function c(ne,he){return Me;function Me(Ae){p.call(this,ne(Ae),Ae),he&&he.call(this,Ae)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ne,he,Me){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([he,Me||void 0]),ne.position={start:ka(he.start),end:void 0}}function g(ne){return he;function he(Me){ne&&ne.call(this,Me),m.call(this,Me)}}function m(ne,he){const Me=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==ne.type&&(he?he.call(this,ne,Ae[0]):(Ae[1]||Ky).call(this,ne,Ae[0]));else throw new Error("Cannot close `"+ne.type+"` ("+Oo({start:ne.start,end:ne.end})+"): it’s not open");Me.position.end=ka(ne.end)}function b(){return sh(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function k(ne){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.lang=ne}function E(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.meta=ne}function O(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function U(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne.replace(/(\r?\n|\r)$/g,"")}function F(ne){const he=this.resume(),Me=this.stack[this.stack.length-1];Me.label=he,Me.identifier=_i(this.sliceSerialize(ne)).toLowerCase()}function q(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.title=ne}function Y(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.url=ne}function se(ne){const he=this.stack[this.stack.length-1];if(!he.depth){const Me=this.sliceSerialize(ne).length;he.depth=Me}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function X(ne){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function ae(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ne){const Me=this.stack[this.stack.length-1].children;let Ae=Me[Me.length-1];(!Ae||Ae.type!=="text")&&(Ae=Lt(),Ae.position={start:ka(ne.start),end:void 0},Me.push(Ae)),this.stack.push(Ae)}function L(ne){const he=this.stack.pop();he.value+=this.sliceSerialize(ne),he.position.end=ka(ne.end)}function te(ne){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=he.children[he.children.length-1];Me.position.end=ka(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(he.type)&&(ee.call(this,ne),L.call(this,ne))}function ce(){this.data.atHardBreak=!0}function Ee(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne}function ge(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne}function ue(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne}function G(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=he,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function oe(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=he,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function ye(ne){const he=this.sliceSerialize(ne),Me=this.stack[this.stack.length-2];Me.label=Tj(he),Me.identifier=_i(he).toLowerCase()}function De(){const ne=this.stack[this.stack.length-1],he=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Ae=ne.children;Me.children=Ae}else Me.alt=he}function R(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.url=ne}function A(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.title=ne}function z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function K(ne){const he=this.resume(),Me=this.stack[this.stack.length-1];Me.label=he,Me.identifier=_i(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function me(ne){this.data.characterReferenceType=ne.type}function Z(ne){const he=this.sliceSerialize(ne),Me=this.data.characterReferenceType;let Ae;Me?(Ae=Cb(he,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=oh(he);const Ie=this.stack[this.stack.length-1];Ie.value+=Ae}function xe(ne){const he=this.stack.pop();he.position.end=ka(ne.end)}function Le(ne){L.call(this,ne);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(ne)}function Xe(ne){L.call(this,ne);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(ne)}function Ot(){return{type:"blockquote",children:[]}}function Ft(){return{type:"code",lang:null,meta:null,value:""}}function Ye(){return{type:"inlineCode",value:""}}function Et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Jt(){return{type:"emphasis",children:[]}}function zt(){return{type:"heading",depth:0,children:[]}}function rn(){return{type:"break"}}function ze(){return{type:"html",value:""}}function wt(){return{type:"image",title:null,url:"",alt:null}}function sn(){return{type:"link",title:null,url:"",children:[]}}function wn(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function gi(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function yi(){return{type:"paragraph",children:[]}}function Di(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function Ml(){return{type:"thematicBreak"}}}function ka(e){return{line:e.line,column:e.column,offset:e.offset}}function Lb(e,i){let l=-1;for(;++l<i.length;){const r=i[l];Array.isArray(r)?Lb(e,r):_j(e,r)}}function _j(e,i){let l;for(l in i)if(zb.call(i,l))switch(l){case"canContainEols":{const r=i[l];r&&e[l].push(...r);break}case"transforms":{const r=i[l];r&&e[l].push(...r);break}case"enter":case"exit":{const r=i[l];r&&Object.assign(e[l],r);break}}}function Ky(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Oo({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Oo({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Oo({start:i.start,end:i.end})+") is still open")}function Dj(e){const i=this;i.parser=l;function l(r){return Aj(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function Mj(e,i){const l={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,l),e.applyData(i,l)}function Rj(e,i){const l={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,l),[e.applyData(i,l),{type:"text",value:`
54
- `}]}function Oj(e,i){const l=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:l}]};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 zj(e,i){const l={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function Lj(e,i){const l={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function Ij(e,i){const l=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=us(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,p+=1,e.footnoteCounts.set(r,p);const g={type:"element",tagName:"a",properties:{href:"#"+l+"fn-"+u,id:l+"fnref-"+u+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function Uj(e,i){const l={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function Bj(e,i){if(e.options.allowDangerousHtml){const l={type:"raw",value:i.value};return e.patch(i,l),e.applyData(i,l)}}function Ib(e,i){const l=i.referenceType;let r="]";if(l==="collapsed"?r+="[]":l==="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 qj(e,i){const l=String(i.identifier).toUpperCase(),r=e.definitionById.get(l);if(!r)return Ib(e,i);const u={src:us(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 Hj(e,i){const l={src:us(i.url)};i.alt!==null&&i.alt!==void 0&&(l.alt=i.alt),i.title!==null&&i.title!==void 0&&(l.title=i.title);const r={type:"element",tagName:"img",properties:l,children:[]};return e.patch(i,r),e.applyData(i,r)}function $j(e,i){const l={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,l);const r={type:"element",tagName:"code",properties:{},children:[l]};return e.patch(i,r),e.applyData(i,r)}function Gj(e,i){const l=String(i.identifier).toUpperCase(),r=e.definitionById.get(l);if(!r)return Ib(e,i);const u={href:us(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 Vj(e,i){const l={href:us(i.url)};i.title!==null&&i.title!==void 0&&(l.title=i.title);const r={type:"element",tagName:"a",properties:l,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function Yj(e,i,l){const r=e.all(i),u=l?Pj(l):Ub(i),c={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let x;b&&b.type==="element"&&b.tagName==="p"?x=b:(x={type:"element",tagName:"p",properties:{},children:[]},r.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const b=r[p];(u||p!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
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 C0(e){const r={constructs:Tb([w0,...(e||{}).extensions||[]]),content:u(qj),defined:[],document:u($j),flow:u(r0),lazy:{},string:u(u0),text:u(c0)};return r;function u(c){return d;function d(p){return k0(r,c,p)}}}function T0(e){for(;!Db(e););return e}const Xy=/[\0\t\n\r]/g;function E0(){let e=1,i="",l=!0,r;return u;function u(c,d,p){const g=[];let m,b,y,k,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),y=0,i="",l&&(c.charCodeAt(0)===65279&&y++,l=void 0);y<c.length;){if(Xy.lastIndex=y,m=Xy.exec(c),k=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(k),!m){i=c.slice(y);break}if(w===10&&y===k&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),y<k&&(g.push(c.slice(y,k)),e+=k-y),w){case 0:{g.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,g.push(-2);e++<b;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}y=k+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const A0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function N0(e){return e.replace(A0,_0)}function _0(e,i,l){if(i)return i;if(l.charCodeAt(0)===35){const u=l.charCodeAt(1),c=u===120||u===88;return Eb(l.slice(c?2:1),c?16:10)}return uh(l)||e}const Ib={}.hasOwnProperty;function D0(e,i,l){return i&&typeof i=="object"&&(l=i,i=void 0),R0(l)(T0(C0(l).document().write(E0()(e,i,!0))))}function R0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(sn),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:c(zt),blockQuote:c(Ot),characterEscape:ee,characterReference:ee,codeFenced:c(Wt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(Wt,d),codeText:c(Ye,d),codeTextData:ee,data:ee,codeFlowValue:ee,definition:c(Et),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(Jt),hardBreakEscape:c(rn),hardBreakTrailing:c(rn),htmlFlow:c(ze,d),htmlFlowData:ee,htmlText:c(ze,d),htmlTextData:ee,image:c(wt),label:d,link:c(sn),listItem:c(gi),listItemValue:k,listOrdered:c(wn,y),listUnordered:c(wn),paragraph:c(yi),reference:C,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(zt),strong:c(Di),thematicBreak:c(Rl)},exit:{atxHeading:g(),atxHeadingSequence:se,autolink:g(),autolinkEmail:Xe,autolinkProtocol:Le,blockQuote:g(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:Z,characterReference:xe,codeFenced:g(z),codeFencedFence:R,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:I,codeIndented:g(N),codeText:g(ue),codeTextData:I,data:I,definition:g(),definitionDestinationString:P,definitionLabelString:G,definitionTitleString:B,emphasis:g(),hardBreakEscape:g(ce),hardBreakTrailing:g(ce),htmlFlow:g(Ee),htmlFlowData:I,htmlText:g(ge),htmlTextData:I,image:g(oe),label:De,labelText:ye,lineEnding:te,link:g(V),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:K,resourceDestinationString:O,resourceTitleString:A,resource:L,setextHeading:g(ae),setextHeadingLineSequence:X,setextHeadingText:_,strong:g(),thematicBreak:g()}};Ub(i,(e||{}).mdastExtensions||[]);const l={};return r;function r(ne){let he={type:"root",children:[]};const Re={stack:[he],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:l},Ae=[];let Ie=-1;for(;++Ie<ne.length;)if(ne[Ie][1].type==="listOrdered"||ne[Ie][1].type==="listUnordered")if(ne[Ie][0]==="enter")Ae.push(Ie);else{const At=Ae.pop();Ie=u(ne,At,Ie)}for(Ie=-1;++Ie<ne.length;){const At=i[ne[Ie][0]];Ib.call(At,ne[Ie][1].type)&&At[ne[Ie][1].type].call(Object.assign({sliceSerialize:ne[Ie][2].sliceSerialize},Re),ne[Ie][1])}if(Re.tokenStack.length>0){const At=Re.tokenStack[Re.tokenStack.length-1];(At[1]||Qy).call(Re,void 0,At[0])}for(he.position={start:ka(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ka(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<i.transforms.length;)he=i.transforms[Ie](he)||he;return he}function u(ne,he,Re){let Ae=he-1,Ie=-1,At=!1,mn,tt,jt,on;for(;++Ae<=Re;){const rt=ne[Ae];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Ie++:Ie--,on=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(mn&&!on&&!Ie&&!jt&&(jt=Ae),on=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:on=void 0}if(!Ie&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Ie===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(mn){let Ri=Ae;for(tt=void 0;Ri--;){const qn=ne[Ri];if(qn[1].type==="lineEnding"||qn[1].type==="lineEndingBlank"){if(qn[0]==="exit")continue;tt&&(ne[tt][1].type="lineEndingBlank",At=!0),qn[1].type="lineEnding",tt=Ri}else if(!(qn[1].type==="linePrefix"||qn[1].type==="blockQuotePrefix"||qn[1].type==="blockQuotePrefixWhitespace"||qn[1].type==="blockQuoteMarker"||qn[1].type==="listItemIndent"))break}jt&&(!tt||jt<tt)&&(mn._spread=!0),mn.end=Object.assign({},tt?ne[tt][1].start:rt[1].end),ne.splice(tt||Ae,0,["exit",mn,rt[2]]),Ae++,Re++}if(rt[1].type==="listItemPrefix"){const Ri={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};mn=Ri,ne.splice(Ae,0,["enter",Ri,rt[2]]),Ae++,Re++,jt=void 0,on=!0}}}return ne[he][1]._spread=At,Re}function c(ne,he){return Re;function Re(Ae){p.call(this,ne(Ae),Ae),he&&he.call(this,Ae)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ne,he,Re){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([he,Re||void 0]),ne.position={start:ka(he.start),end:void 0}}function g(ne){return he;function he(Re){ne&&ne.call(this,Re),m.call(this,Re)}}function m(ne,he){const Re=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==ne.type&&(he?he.call(this,ne,Ae[0]):(Ae[1]||Qy).call(this,ne,Ae[0]));else throw new Error("Cannot close `"+ne.type+"` ("+Oo({start:ne.start,end:ne.end})+"): it’s not open");Re.position.end=ka(ne.end)}function b(){return oh(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function k(ne){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.lang=ne}function T(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.meta=ne}function R(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function z(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne.replace(/(\r?\n|\r)$/g,"")}function G(ne){const he=this.resume(),Re=this.stack[this.stack.length-1];Re.label=he,Re.identifier=_i(this.sliceSerialize(ne)).toLowerCase()}function B(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.title=ne}function P(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.url=ne}function se(ne){const he=this.stack[this.stack.length-1];if(!he.depth){const Re=this.sliceSerialize(ne).length;he.depth=Re}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function X(ne){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function ae(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ne){const Re=this.stack[this.stack.length-1].children;let Ae=Re[Re.length-1];(!Ae||Ae.type!=="text")&&(Ae=Lt(),Ae.position={start:ka(ne.start),end:void 0},Re.push(Ae)),this.stack.push(Ae)}function I(ne){const he=this.stack.pop();he.value+=this.sliceSerialize(ne),he.position.end=ka(ne.end)}function te(ne){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=he.children[he.children.length-1];Re.position.end=ka(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(he.type)&&(ee.call(this,ne),I.call(this,ne))}function ce(){this.data.atHardBreak=!0}function Ee(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne}function ge(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne}function ue(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.value=ne}function V(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=he,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function oe(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=he,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function ye(ne){const he=this.sliceSerialize(ne),Re=this.stack[this.stack.length-2];Re.label=N0(he),Re.identifier=_i(he).toLowerCase()}function De(){const ne=this.stack[this.stack.length-1],he=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const Ae=ne.children;Re.children=Ae}else Re.alt=he}function O(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.url=ne}function A(){const ne=this.resume(),he=this.stack[this.stack.length-1];he.title=ne}function L(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function K(ne){const he=this.resume(),Re=this.stack[this.stack.length-1];Re.label=he,Re.identifier=_i(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function me(ne){this.data.characterReferenceType=ne.type}function Z(ne){const he=this.sliceSerialize(ne),Re=this.data.characterReferenceType;let Ae;Re?(Ae=Eb(he,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=uh(he);const Ie=this.stack[this.stack.length-1];Ie.value+=Ae}function xe(ne){const he=this.stack.pop();he.position.end=ka(ne.end)}function Le(ne){I.call(this,ne);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(ne)}function Xe(ne){I.call(this,ne);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(ne)}function Ot(){return{type:"blockquote",children:[]}}function Wt(){return{type:"code",lang:null,meta:null,value:""}}function Ye(){return{type:"inlineCode",value:""}}function Et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Jt(){return{type:"emphasis",children:[]}}function zt(){return{type:"heading",depth:0,children:[]}}function rn(){return{type:"break"}}function ze(){return{type:"html",value:""}}function wt(){return{type:"image",title:null,url:"",alt:null}}function sn(){return{type:"link",title:null,url:"",children:[]}}function wn(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function gi(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function yi(){return{type:"paragraph",children:[]}}function Di(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function Rl(){return{type:"thematicBreak"}}}function ka(e){return{line:e.line,column:e.column,offset:e.offset}}function Ub(e,i){let l=-1;for(;++l<i.length;){const r=i[l];Array.isArray(r)?Ub(e,r):M0(e,r)}}function M0(e,i){let l;for(l in i)if(Ib.call(i,l))switch(l){case"canContainEols":{const r=i[l];r&&e[l].push(...r);break}case"transforms":{const r=i[l];r&&e[l].push(...r);break}case"enter":case"exit":{const r=i[l];r&&Object.assign(e[l],r);break}}}function Qy(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Oo({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Oo({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Oo({start:i.start,end:i.end})+") is still open")}function O0(e){const i=this;i.parser=l;function l(r){return D0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function z0(e,i){const l={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,l),e.applyData(i,l)}function L0(e,i){const l={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,l),[e.applyData(i,l),{type:"text",value:`
54
+ `}]}function I0(e,i){const l=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:l}]};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 U0(e,i){const l={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function B0(e,i){const l={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function q0(e,i){const l=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=us(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,p+=1,e.footnoteCounts.set(r,p);const g={type:"element",tagName:"a",properties:{href:"#"+l+"fn-"+u,id:l+"fnref-"+u+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function H0(e,i){const l={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function $0(e,i){if(e.options.allowDangerousHtml){const l={type:"raw",value:i.value};return e.patch(i,l),e.applyData(i,l)}}function Bb(e,i){const l=i.referenceType;let r="]";if(l==="collapsed"?r+="[]":l==="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 G0(e,i){const l=String(i.identifier).toUpperCase(),r=e.definitionById.get(l);if(!r)return Bb(e,i);const u={src:us(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 V0(e,i){const l={src:us(i.url)};i.alt!==null&&i.alt!==void 0&&(l.alt=i.alt),i.title!==null&&i.title!==void 0&&(l.title=i.title);const r={type:"element",tagName:"img",properties:l,children:[]};return e.patch(i,r),e.applyData(i,r)}function P0(e,i){const l={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,l);const r={type:"element",tagName:"code",properties:{},children:[l]};return e.patch(i,r),e.applyData(i,r)}function Y0(e,i){const l=String(i.identifier).toUpperCase(),r=e.definitionById.get(l);if(!r)return Bb(e,i);const u={href:us(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 F0(e,i){const l={href:us(i.url)};i.title!==null&&i.title!==void 0&&(l.title=i.title);const r={type:"element",tagName:"a",properties:l,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function W0(e,i,l){const r=e.all(i),u=l?K0(l):qb(i),c={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let y;b&&b.type==="element"&&b.tagName==="p"?y=b:(y={type:"element",tagName:"p",properties:{},children:[]},r.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const b=r[p];(u||p!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
56
56
  `}),b.type==="element"&&b.tagName==="p"&&!u?d.push(...b.children):d.push(b)}const g=r[r.length-1];g&&(u||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
57
- `});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function Pj(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const l=e.children;let r=-1;for(;!i&&++r<l.length;)i=Ub(l[r])}return i}function Ub(e){const i=e.spread;return i??e.children.length>1}function Fj(e,i){const l={},r=e.all(i);let u=-1;for(typeof i.start=="number"&&i.start!==1&&(l.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")){l.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:l,children:e.wrap(r,!0)};return e.patch(i,c),e.applyData(i,c)}function Wj(e,i){const l={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function Kj(e,i){const l={type:"root",children:e.wrap(e.all(i))};return e.patch(i,l),e.applyData(i,l)}function Xj(e,i){const l={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function Qj(e,i){const l=e.all(i),r=l.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(l.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(l,!0)},p=ih(i.children[1]),g=yb(i.children[i.children.length-1]);p&&g&&(d.position={start:p,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(u,!0)};return e.patch(i,c),e.applyData(i,c)}function Zj(e,i,l){const r=l?l.children:void 0,c=(r?r.indexOf(i):1)===0?"th":"td",d=l&&l.type==="table"?l.align:void 0,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const x=i.children[g],k={},w=d?d[g]:void 0;w&&(k.align=w);let E={type:"element",tagName:c,properties:k,children:[]};x&&(E.children=e.all(x),e.patch(x,E),E=e.applyData(x,E)),m.push(E)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function Jj(e,i){const l={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}const Xy=9,Qy=32;function e1(e){const i=String(e),l=/\r?\n|\r/g;let r=l.exec(i),u=0;const c=[];for(;r;)c.push(Zy(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=l.exec(i);return c.push(Zy(i.slice(u),u>0,!1)),c.join("")}function Zy(e,i,l){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===Xy||c===Qy;)r++,c=e.codePointAt(r)}if(l){let c=e.codePointAt(u-1);for(;c===Xy||c===Qy;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function t1(e,i){const l={type:"text",value:e1(String(i.value))};return e.patch(i,l),e.applyData(i,l)}function n1(e,i){const l={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,l),e.applyData(i,l)}const i1={blockquote:Mj,break:Rj,code:Oj,delete:zj,emphasis:Lj,footnoteReference:Ij,heading:Uj,html:Bj,imageReference:qj,image:Hj,inlineCode:$j,linkReference:Gj,link:Vj,listItem:Yj,list:Fj,paragraph:Wj,root:Kj,strong:Xj,table:Qj,tableCell:Jj,tableRow:Zj,text:t1,thematicBreak:n1,toml:vc,yaml:vc,definition:vc,footnoteDefinition:vc};function vc(){}const Bb=-1,Yc=0,Lo=1,Lc=2,ch=3,dh=4,fh=5,ph=6,qb=7,Hb=8,l1=typeof self=="object"?self:globalThis,Jy=(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 l1[e](i)},a1=(e,i)=>{const l=(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 Yc:case Bb:return l(d,u);case Lo:{const p=l([],u);for(const g of d)p.push(r(g));return p}case Lc:{const p=l({},u);for(const[g,m]of d)p[r(g)]=r(m);return p}case ch:return l(new Date(d),u);case dh:{const{source:p,flags:g}=d;return l(new RegExp(p,g),u)}case fh:{const p=l(new Map,u);for(const[g,m]of d)p.set(r(g),r(m));return p}case ph:{const p=l(new Set,u);for(const g of d)p.add(r(g));return p}case qb:{const{name:p,message:g}=d;return l(Jy(p,g),u)}case Hb:return l(BigInt(d),u);case"BigInt":return l(Object(BigInt(d)),u);case"ArrayBuffer":return l(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:p}=new Uint8Array(d);return l(new DataView(p),d)}}return l(Jy(c,d),u)};return r},ex=e=>a1(new Map,e)(0),lr="",{toString:r1}={},{keys:s1}=Object,ko=e=>{const i=typeof e;if(i!=="object"||!e)return[Yc,i];const l=r1.call(e).slice(8,-1);switch(l){case"Array":return[Lo,lr];case"Object":return[Lc,lr];case"Date":return[ch,lr];case"RegExp":return[dh,lr];case"Map":return[fh,lr];case"Set":return[ph,lr];case"DataView":return[Lo,l]}return l.includes("Array")?[Lo,l]:l.includes("Error")?[qb,l]:[Lc,l]},wc=([e,i])=>e===Yc&&(i==="function"||i==="symbol"),o1=(e,i,l,r)=>{const u=(d,p)=>{const g=r.push(d)-1;return l.set(p,g),g},c=d=>{if(l.has(d))return l.get(d);let[p,g]=ko(d);switch(p){case Yc:{let b=d;switch(g){case"bigint":p=Hb,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([Bb],d)}return u([p,b],d)}case Lo:{if(g){let k=d;return g==="DataView"?k=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(k=new Uint8Array(d)),u([g,[...k]],d)}const b=[],x=u([p,b],d);for(const k of d)b.push(c(k));return x}case Lc:{if(g)switch(g){case"BigInt":return u([g,d.toString()],d);case"Boolean":case"Number":case"String":return u([g,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const b=[],x=u([p,b],d);for(const k of s1(d))(e||!wc(ko(d[k])))&&b.push([c(k),c(d[k])]);return x}case ch:return u([p,isNaN(d.getTime())?lr:d.toISOString()],d);case dh:{const{source:b,flags:x}=d;return u([p,{source:b,flags:x}],d)}case fh:{const b=[],x=u([p,b],d);for(const[k,w]of d)(e||!(wc(ko(k))||wc(ko(w))))&&b.push([c(k),c(w)]);return x}case ph:{const b=[],x=u([p,b],d);for(const k of d)(e||!wc(ko(k)))&&b.push(c(k));return x}}const{message:m}=d;return u([p,{name:g,message:m}],d)};return c},tx=(e,{json:i,lossy:l}={})=>{const r=[];return o1(!(i||l),!!i,new Map,r)(e),r},Ic=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?ex(tx(e,i)):structuredClone(e):(e,i)=>ex(tx(e,i));function u1(e,i){const l=[{type:"text",value:"↩"}];return i>1&&l.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),l}function c1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function d1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=e.options.footnoteBackContent||u1,r=e.options.footnoteBackLabel||c1,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let g=-1;for(;++g<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[g]);if(!m)continue;const b=e.all(m),x=String(m.identifier).toUpperCase(),k=us(x.toLowerCase());let w=0;const E=[],O=e.footnoteCounts.get(x);for(;O!==void 0&&++w<=O;){E.length>0&&E.push({type:"text",value:" "});let F=typeof l=="string"?l:l(g,w);typeof F=="string"&&(F={type:"text",value:F}),E.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+k+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,w),className:["data-footnote-backref"]},children:Array.isArray(F)?F:[F]})}const U=b[b.length-1];if(U&&U.type==="element"&&U.tagName==="p"){const F=U.children[U.children.length-1];F&&F.type==="text"?F.value+=" ":U.children.push({type:"text",value:" "}),U.children.push(...E)}else b.push(...E);const _={type:"element",tagName:"li",properties:{id:i+"fn-"+k},children:e.wrap(b,!0)};e.patch(m,_),p.push(_)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Ic(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
57
+ `});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function K0(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const l=e.children;let r=-1;for(;!i&&++r<l.length;)i=qb(l[r])}return i}function qb(e){const i=e.spread;return i??e.children.length>1}function X0(e,i){const l={},r=e.all(i);let u=-1;for(typeof i.start=="number"&&i.start!==1&&(l.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")){l.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:l,children:e.wrap(r,!0)};return e.patch(i,c),e.applyData(i,c)}function Q0(e,i){const l={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function Z0(e,i){const l={type:"root",children:e.wrap(e.all(i))};return e.patch(i,l),e.applyData(i,l)}function J0(e,i){const l={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function e1(e,i){const l=e.all(i),r=l.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(l.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(l,!0)},p=lh(i.children[1]),g=bb(i.children[i.children.length-1]);p&&g&&(d.position={start:p,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(u,!0)};return e.patch(i,c),e.applyData(i,c)}function t1(e,i,l){const r=l?l.children:void 0,c=(r?r.indexOf(i):1)===0?"th":"td",d=l&&l.type==="table"?l.align:void 0,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const y=i.children[g],k={},w=d?d[g]:void 0;w&&(k.align=w);let T={type:"element",tagName:c,properties:k,children:[]};y&&(T.children=e.all(y),e.patch(y,T),T=e.applyData(y,T)),m.push(T)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function n1(e,i){const l={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}const Zy=9,Jy=32;function i1(e){const i=String(e),l=/\r?\n|\r/g;let r=l.exec(i),u=0;const c=[];for(;r;)c.push(ex(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=l.exec(i);return c.push(ex(i.slice(u),u>0,!1)),c.join("")}function ex(e,i,l){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===Zy||c===Jy;)r++,c=e.codePointAt(r)}if(l){let c=e.codePointAt(u-1);for(;c===Zy||c===Jy;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function l1(e,i){const l={type:"text",value:i1(String(i.value))};return e.patch(i,l),e.applyData(i,l)}function a1(e,i){const l={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,l),e.applyData(i,l)}const r1={blockquote:z0,break:L0,code:I0,delete:U0,emphasis:B0,footnoteReference:q0,heading:H0,html:$0,imageReference:G0,image:V0,inlineCode:P0,linkReference:Y0,link:F0,listItem:W0,list:X0,paragraph:Q0,root:Z0,strong:J0,table:e1,tableCell:n1,tableRow:t1,text:l1,thematicBreak:a1,toml:vc,yaml:vc,definition:vc,footnoteDefinition:vc};function vc(){}const Hb=-1,Pc=0,Lo=1,Lc=2,dh=3,fh=4,ph=5,hh=6,$b=7,Gb=8,s1=typeof self=="object"?self:globalThis,tx=(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 s1[e](i)},o1=(e,i)=>{const l=(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 Pc:case Hb:return l(d,u);case Lo:{const p=l([],u);for(const g of d)p.push(r(g));return p}case Lc:{const p=l({},u);for(const[g,m]of d)p[r(g)]=r(m);return p}case dh:return l(new Date(d),u);case fh:{const{source:p,flags:g}=d;return l(new RegExp(p,g),u)}case ph:{const p=l(new Map,u);for(const[g,m]of d)p.set(r(g),r(m));return p}case hh:{const p=l(new Set,u);for(const g of d)p.add(r(g));return p}case $b:{const{name:p,message:g}=d;return l(tx(p,g),u)}case Gb:return l(BigInt(d),u);case"BigInt":return l(Object(BigInt(d)),u);case"ArrayBuffer":return l(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:p}=new Uint8Array(d);return l(new DataView(p),d)}}return l(tx(c,d),u)};return r},nx=e=>o1(new Map,e)(0),lr="",{toString:u1}={},{keys:c1}=Object,ko=e=>{const i=typeof e;if(i!=="object"||!e)return[Pc,i];const l=u1.call(e).slice(8,-1);switch(l){case"Array":return[Lo,lr];case"Object":return[Lc,lr];case"Date":return[dh,lr];case"RegExp":return[fh,lr];case"Map":return[ph,lr];case"Set":return[hh,lr];case"DataView":return[Lo,l]}return l.includes("Array")?[Lo,l]:l.includes("Error")?[$b,l]:[Lc,l]},wc=([e,i])=>e===Pc&&(i==="function"||i==="symbol"),d1=(e,i,l,r)=>{const u=(d,p)=>{const g=r.push(d)-1;return l.set(p,g),g},c=d=>{if(l.has(d))return l.get(d);let[p,g]=ko(d);switch(p){case Pc:{let b=d;switch(g){case"bigint":p=Gb,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([Hb],d)}return u([p,b],d)}case Lo:{if(g){let k=d;return g==="DataView"?k=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(k=new Uint8Array(d)),u([g,[...k]],d)}const b=[],y=u([p,b],d);for(const k of d)b.push(c(k));return y}case Lc:{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=[],y=u([p,b],d);for(const k of c1(d))(e||!wc(ko(d[k])))&&b.push([c(k),c(d[k])]);return y}case dh:return u([p,isNaN(d.getTime())?lr:d.toISOString()],d);case fh:{const{source:b,flags:y}=d;return u([p,{source:b,flags:y}],d)}case ph:{const b=[],y=u([p,b],d);for(const[k,w]of d)(e||!(wc(ko(k))||wc(ko(w))))&&b.push([c(k),c(w)]);return y}case hh:{const b=[],y=u([p,b],d);for(const k of d)(e||!wc(ko(k)))&&b.push(c(k));return y}}const{message:m}=d;return u([p,{name:g,message:m}],d)};return c},ix=(e,{json:i,lossy:l}={})=>{const r=[];return d1(!(i||l),!!i,new Map,r)(e),r},Ic=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?nx(ix(e,i)):structuredClone(e):(e,i)=>nx(ix(e,i));function f1(e,i){const l=[{type:"text",value:"↩"}];return i>1&&l.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),l}function p1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function h1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=e.options.footnoteBackContent||f1,r=e.options.footnoteBackLabel||p1,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let g=-1;for(;++g<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[g]);if(!m)continue;const b=e.all(m),y=String(m.identifier).toUpperCase(),k=us(y.toLowerCase());let w=0;const T=[],R=e.footnoteCounts.get(y);for(;R!==void 0&&++w<=R;){T.length>0&&T.push({type:"text",value:" "});let G=typeof l=="string"?l:l(g,w);typeof G=="string"&&(G={type:"text",value:G}),T.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+k+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,w),className:["data-footnote-backref"]},children:Array.isArray(G)?G:[G]})}const z=b[b.length-1];if(z&&z.type==="element"&&z.tagName==="p"){const G=z.children[z.children.length-1];G&&G.type==="text"?G.value+=" ":z.children.push({type:"text",value:" "}),z.children.push(...T)}else b.push(...T);const N={type:"element",tagName:"li",properties:{id:i+"fn-"+k},children:e.wrap(b,!0)};e.patch(m,N),p.push(N)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Ic(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
58
58
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(p,!0)},{type:"text",value:`
59
- `}]}}const Pc=(function(e){if(e==null)return m1;if(typeof e=="function")return Fc(e);if(typeof e=="object")return Array.isArray(e)?f1(e):p1(e);if(typeof e=="string")return h1(e);throw new Error("Expected function, string, or object as test")});function f1(e){const i=[];let l=-1;for(;++l<e.length;)i[l]=Pc(e[l]);return Fc(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function p1(e){const i=e;return Fc(l);function l(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function h1(e){return Fc(i);function i(l){return l&&l.type===e}}function Fc(e){return i;function i(l,r,u){return!!(g1(l)&&e.call(this,l,typeof r=="number"?r:void 0,u||void 0))}}function m1(){return!0}function g1(e){return e!==null&&typeof e=="object"&&"type"in e}const $b=[],y1=!0,Ip=!1,x1="skip";function Gb(e,i,l,r){let u;typeof i=="function"&&typeof l!="function"?(r=l,l=i):u=i;const c=Pc(u),d=r?-1:1;p(e,void 0,[])();function p(g,m,b){const x=g&&typeof g=="object"?g:{};if(typeof x.type=="string"){const w=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(k,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return k;function k(){let w=$b,E,O,U;if((!i||c(g,m,b[b.length-1]||void 0))&&(w=b1(l(g,b)),w[0]===Ip))return w;if("children"in g&&g.children){const _=g;if(_.children&&w[0]!==x1)for(O=(r?_.children.length:-1)+d,U=b.concat(_);O>-1&&O<_.children.length;){const F=_.children[O];if(E=p(F,O,U)(),E[0]===Ip)return E;O=typeof E[1]=="number"?E[1]:O+d}}return w}}}function b1(e){return Array.isArray(e)?e:typeof e=="number"?[y1,e]:e==null?$b:[e]}function hh(e,i,l,r){let u,c,d;typeof i=="function"&&typeof l!="function"?(c=void 0,d=i,u=l):(c=i,d=l,u=r),Gb(e,c,p,u);function p(g,m){const b=m[m.length-1],x=b?b.children.indexOf(g):void 0;return d(g,x,b)}}const Up={}.hasOwnProperty,v1={};function w1(e,i){const l=i||v1,r=new Map,u=new Map,c=new Map,d={...i1,...l.handlers},p={all:m,applyData:S1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:l,patch:k1,wrap:C1};return hh(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,k=String(b.identifier).toUpperCase();x.has(k)||x.set(k,b)}}),p;function g(b,x){const k=b.type,w=p.handlers[k];if(Up.call(p.handlers,k)&&w)return w(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(k)){if("children"in b){const{children:O,...U}=b,_=Ic(U);return _.children=p.all(b),_}return Ic(b)}return(p.options.unknownHandler||j1)(p,b,x)}function m(b){const x=[];if("children"in b){const k=b.children;let w=-1;for(;++w<k.length;){const E=p.one(k[w],b);if(E){if(w&&k[w-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=nx(E.value)),!Array.isArray(E)&&E.type==="element")){const O=E.children[0];O&&O.type==="text"&&(O.value=nx(O.value))}Array.isArray(E)?x.push(...E):x.push(E)}}}return x}}function k1(e,i){e.position&&(i.position=uS(e))}function S1(e,i){let l=i;if(e&&e.data){const r=e.data.hName,u=e.data.hChildren,c=e.data.hProperties;if(typeof r=="string")if(l.type==="element")l.tagName=r;else{const d="children"in l?l.children:[l];l={type:"element",tagName:r,properties:{},children:d}}l.type==="element"&&c&&Object.assign(l.properties,Ic(c)),"children"in l&&l.children&&u!==null&&u!==void 0&&(l.children=u)}return l}function j1(e,i){const l=i.data||{},r="value"in i&&!(Up.call(l,"hProperties")||Up.call(l,"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 C1(e,i){const l=[];let r=-1;for(i&&l.push({type:"text",value:`
59
+ `}]}}const Yc=(function(e){if(e==null)return x1;if(typeof e=="function")return Fc(e);if(typeof e=="object")return Array.isArray(e)?m1(e):g1(e);if(typeof e=="string")return y1(e);throw new Error("Expected function, string, or object as test")});function m1(e){const i=[];let l=-1;for(;++l<e.length;)i[l]=Yc(e[l]);return Fc(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function g1(e){const i=e;return Fc(l);function l(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function y1(e){return Fc(i);function i(l){return l&&l.type===e}}function Fc(e){return i;function i(l,r,u){return!!(b1(l)&&e.call(this,l,typeof r=="number"?r:void 0,u||void 0))}}function x1(){return!0}function b1(e){return e!==null&&typeof e=="object"&&"type"in e}const Vb=[],v1=!0,Ip=!1,w1="skip";function Pb(e,i,l,r){let u;typeof i=="function"&&typeof l!="function"?(r=l,l=i):u=i;const c=Yc(u),d=r?-1:1;p(e,void 0,[])();function p(g,m,b){const y=g&&typeof g=="object"?g:{};if(typeof y.type=="string"){const w=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(k,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return k;function k(){let w=Vb,T,R,z;if((!i||c(g,m,b[b.length-1]||void 0))&&(w=k1(l(g,b)),w[0]===Ip))return w;if("children"in g&&g.children){const N=g;if(N.children&&w[0]!==w1)for(R=(r?N.children.length:-1)+d,z=b.concat(N);R>-1&&R<N.children.length;){const G=N.children[R];if(T=p(G,R,z)(),T[0]===Ip)return T;R=typeof T[1]=="number"?T[1]:R+d}}return w}}}function k1(e){return Array.isArray(e)?e:typeof e=="number"?[v1,e]:e==null?Vb:[e]}function mh(e,i,l,r){let u,c,d;typeof i=="function"&&typeof l!="function"?(c=void 0,d=i,u=l):(c=i,d=l,u=r),Pb(e,c,p,u);function p(g,m){const b=m[m.length-1],y=b?b.children.indexOf(g):void 0;return d(g,y,b)}}const Up={}.hasOwnProperty,j1={};function S1(e,i){const l=i||j1,r=new Map,u=new Map,c=new Map,d={...r1,...l.handlers},p={all:m,applyData:T1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:l,patch:C1,wrap:A1};return mh(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const y=b.type==="definition"?r:u,k=String(b.identifier).toUpperCase();y.has(k)||y.set(k,b)}}),p;function g(b,y){const k=b.type,w=p.handlers[k];if(Up.call(p.handlers,k)&&w)return w(p,b,y);if(p.options.passThrough&&p.options.passThrough.includes(k)){if("children"in b){const{children:R,...z}=b,N=Ic(z);return N.children=p.all(b),N}return Ic(b)}return(p.options.unknownHandler||E1)(p,b,y)}function m(b){const y=[];if("children"in b){const k=b.children;let w=-1;for(;++w<k.length;){const T=p.one(k[w],b);if(T){if(w&&k[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=lx(T.value)),!Array.isArray(T)&&T.type==="element")){const R=T.children[0];R&&R.type==="text"&&(R.value=lx(R.value))}Array.isArray(T)?y.push(...T):y.push(T)}}}return y}}function C1(e,i){e.position&&(i.position=fj(e))}function T1(e,i){let l=i;if(e&&e.data){const r=e.data.hName,u=e.data.hChildren,c=e.data.hProperties;if(typeof r=="string")if(l.type==="element")l.tagName=r;else{const d="children"in l?l.children:[l];l={type:"element",tagName:r,properties:{},children:d}}l.type==="element"&&c&&Object.assign(l.properties,Ic(c)),"children"in l&&l.children&&u!==null&&u!==void 0&&(l.children=u)}return l}function E1(e,i){const l=i.data||{},r="value"in i&&!(Up.call(l,"hProperties")||Up.call(l,"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 A1(e,i){const l=[];let r=-1;for(i&&l.push({type:"text",value:`
60
60
  `});++r<e.length;)r&&l.push({type:"text",value:`
61
61
  `}),l.push(e[r]);return i&&e.length>0&&l.push({type:"text",value:`
62
- `}),l}function nx(e){let i=0,l=e.charCodeAt(i);for(;l===9||l===32;)i++,l=e.charCodeAt(i);return e.slice(i)}function ix(e,i){const l=w1(e,i),r=l.one(e,void 0),u=d1(l),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return u&&c.children.push({type:"text",value:`
63
- `},u),c}function T1(e,i){return e&&"run"in e?async function(l,r){const u=ix(l,{file:r,...i});await e.run(u,r)}:function(l,r){return ix(l,{file:r,...e||i})}}function lx(e){if(e)throw e}var Qf,ax;function E1(){if(ax)return Qf;ax=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,l=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 k;for(k in m);return typeof k>"u"||e.call(m,k)},d=function(m,b){l&&b.name==="__proto__"?l(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},p=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return Qf=function g(){var m,b,x,k,w,E,O=arguments[0],U=1,_=arguments.length,F=!1;for(typeof O=="boolean"&&(F=O,O=arguments[1]||{},U=2),(O==null||typeof O!="object"&&typeof O!="function")&&(O={});U<_;++U)if(m=arguments[U],m!=null)for(b in m)x=p(O,b),k=p(m,b),O!==k&&(F&&k&&(c(k)||(w=u(k)))?(w?(w=!1,E=x&&u(x)?x:[]):E=x&&c(x)?x:{},d(O,{name:b,newValue:g(F,E,k)})):typeof k<"u"&&d(O,{name:b,newValue:k}));return O},Qf}var A1=E1();const Zf=ub(A1);function Bp(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 N1(){const e=[],i={run:l,use:r};return i;function l(...u){let c=-1;const d=u.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...u);function p(g,...m){const b=e[++c];let x=-1;if(g){d(g);return}for(;++x<u.length;)(m[x]===null||m[x]===void 0)&&(m[x]=u[x]);u=m,b?_1(b,p)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function _1(e,i){let l;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&l)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){l||(l=!0,i(d,...p))}function c(d){u(null,d)}}const Qi={basename:D1,dirname:M1,extname:R1,join:O1,sep:"/"};function D1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Po(e);let l=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){l=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":e.slice(l,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){l=u+1;break}}else d<0&&(c=!0,d=u+1),p>-1&&(e.codePointAt(u)===i.codePointAt(p--)?p<0&&(r=u):(p=-1,r=d));return l===r?r=d:r<0&&(r=e.length),e.slice(l,r)}function M1(e){if(Po(e),e.length===0)return".";let i=-1,l=e.length,r;for(;--l;)if(e.codePointAt(l)===47){if(r){i=l;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function R1(e){Po(e);let i=e.length,l=-1,r=0,u=-1,c=0,d;for(;i--;){const p=e.codePointAt(i);if(p===47){if(d){r=i+1;break}continue}l<0&&(d=!0,l=i+1),p===46?u<0?u=i:c!==1&&(c=1):u>-1&&(c=-1)}return u<0||l<0||c===0||c===1&&u===l-1&&u===r+1?"":e.slice(u,l)}function O1(...e){let i=-1,l;for(;++i<e.length;)Po(e[i]),e[i]&&(l=l===void 0?e[i]:l+"/"+e[i]);return l===void 0?".":z1(l)}function z1(e){Po(e);const i=e.codePointAt(0)===47;let l=L1(e,!i);return l.length===0&&!i&&(l="."),l.length>0&&e.codePointAt(e.length-1)===47&&(l+="/"),i?"/"+l:l}function L1(e,i){let l="",r=0,u=-1,c=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===47){if(!(u===d-1||c===1))if(u!==d-1&&c===2){if(l.length<2||r!==2||l.codePointAt(l.length-1)!==46||l.codePointAt(l.length-2)!==46){if(l.length>2){if(g=l.lastIndexOf("/"),g!==l.length-1){g<0?(l="",r=0):(l=l.slice(0,g),r=l.length-1-l.lastIndexOf("/")),u=d,c=0;continue}}else if(l.length>0){l="",r=0,u=d,c=0;continue}}i&&(l=l.length>0?l+"/..":"..",r=2)}else l.length>0?l+="/"+e.slice(u+1,d):l=e.slice(u+1,d),r=d-u-1;u=d,c=0}else p===46&&c>-1?c++:c=-1}return l}function Po(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const I1={cwd:U1};function U1(){return"/"}function qp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function B1(e){if(typeof e=="string")e=new URL(e);else if(!qp(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 q1(e)}function q1(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 l=-1;for(;++l<i.length;)if(i.codePointAt(l)===37&&i.codePointAt(l+1)===50){const r=i.codePointAt(l+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 Jf=["history","path","basename","stem","extname","dirname"];class Vb{constructor(i){let l;i?qp(i)?l={path:i}:typeof i=="string"||H1(i)?l={value:i}:l=i:l={},this.cwd="cwd"in l?"":I1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jf.length;){const c=Jf[r];c in l&&l[c]!==void 0&&l[c]!==null&&(this[c]=c==="history"?[...l[c]]:l[c])}let u;for(u in l)Jf.includes(u)||(this[u]=l[u])}get basename(){return typeof this.path=="string"?Qi.basename(this.path):void 0}set basename(i){tp(i,"basename"),ep(i,"basename"),this.path=Qi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Qi.dirname(this.path):void 0}set dirname(i){rx(this.basename,"dirname"),this.path=Qi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Qi.extname(this.path):void 0}set extname(i){if(ep(i,"extname"),rx(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=Qi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){qp(i)&&(i=B1(i)),tp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Qi.basename(this.path,this.extname):void 0}set stem(i){tp(i,"stem"),ep(i,"stem"),this.path=Qi.join(this.dirname||"",i+(this.extname||""))}fail(i,l,r){const u=this.message(i,l,r);throw u.fatal=!0,u}info(i,l,r){const u=this.message(i,l,r);return u.fatal=void 0,u}message(i,l,r){const u=new hn(i,l,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 ep(e,i){if(e&&e.includes(Qi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Qi.sep+"`")}function tp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function rx(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function H1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $1=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),G1={}.hasOwnProperty;class mh extends $1{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=N1()}copy(){const i=new mh;let l=-1;for(;++l<this.attachers.length;){const r=this.attachers[l];i.use(...r)}return i.data(Zf(!0,{},this.namespace)),i}data(i,l){return typeof i=="string"?arguments.length===2?(lp("data",this.frozen),this.namespace[i]=l,this):G1.call(this.namespace,i)&&this.namespace[i]||void 0:i?(lp("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[l,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=l.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 l=kc(i),r=this.parser||this.Parser;return np("parse",r),r(String(l),l)}process(i,l){const r=this;return this.freeze(),np("process",this.parser||this.Parser),ip("process",this.compiler||this.Compiler),l?u(void 0,l):new Promise(u);function u(c,d){const p=kc(i),g=r.parse(p);r.run(g,p,function(b,x,k){if(b||!x||!k)return m(b);const w=x,E=r.stringify(w,k);P1(E)?k.value=E:k.result=E,m(b,k)});function m(b,x){b||!x?d(b):c?c(x):l(void 0,x)}}}processSync(i){let l=!1,r;return this.freeze(),np("processSync",this.parser||this.Parser),ip("processSync",this.compiler||this.Compiler),this.process(i,u),ox("processSync","process",l),r;function u(c,d){l=!0,lx(c),r=d}}run(i,l,r){sx(i),this.freeze();const u=this.transformers;return!r&&typeof l=="function"&&(r=l,l=void 0),r?c(void 0,r):new Promise(c);function c(d,p){const g=kc(l);u.run(i,g,m);function m(b,x,k){const w=x||i;b?p(b):d?d(w):r(void 0,w,k)}}}runSync(i,l){let r=!1,u;return this.run(i,l,c),ox("runSync","run",r),u;function c(d,p){lx(d),u=p,r=!0}}stringify(i,l){this.freeze();const r=kc(l),u=this.compiler||this.Compiler;return ip("stringify",u),sx(i),u(i,r)}use(i,...l){const r=this.attachers,u=this.namespace;if(lp("use",this.frozen),i!=null)if(typeof i=="function")g(i,l);else if(typeof i=="object")Array.isArray(i)?p(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;g(b,x)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");p(m.plugins),m.settings&&(u.settings=Zf(!0,u.settings,m.settings))}function p(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const x=m[b];c(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function g(m,b){let x=-1,k=-1;for(;++x<r.length;)if(r[x][0]===m){k=x;break}if(k===-1)r.push([m,...b]);else if(b.length>0){let[w,...E]=b;const O=r[k][1];Bp(O)&&Bp(w)&&(w=Zf(!0,O,w)),r[k]=[m,w,...E]}}}}const V1=new mh().freeze();function np(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ip(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lp(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 sx(e){if(!Bp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ox(e,i,l){if(!l)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function kc(e){return Y1(e)?e:new Vb(e)}function Y1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function P1(e){return typeof e=="string"||F1(e)}function F1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const W1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ux=[],cx={allowDangerousHtml:!0},K1=/^(https?|ircs?|mailto|xmpp)$/i,X1=[{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 Q1(e){const i=Z1(e),l=J1(e);return eC(i.runSync(i.parse(l),l),e)}function Z1(e){const i=e.rehypePlugins||ux,l=e.remarkPlugins||ux,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cx}:cx;return V1().use(Dj).use(l).use(T1,r).use(i)}function J1(e){const i=e.children||"",l=new Vb;return typeof i=="string"&&(l.value=i),l}function eC(e,i){const l=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||tC;for(const b of X1)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+W1+b.id,void 0);return hh(e,m),hS(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,k){if(b.type==="raw"&&k&&typeof x=="number")return d?k.children.splice(x,1):k.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in Wf)if(Object.hasOwn(Wf,w)&&Object.hasOwn(b.properties,w)){const E=b.properties[w],O=Wf[w];(O===null||O.includes(b.tagName))&&(b.properties[w]=g(String(E||""),w,b))}}if(b.type==="element"){let w=l?!l.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof x=="number"&&(w=!r(b,x,k)),w&&k&&typeof x=="number")return p&&b.children?k.children.splice(x,1,...b.children):k.children.splice(x,1),x}}}function tC(e){const i=e.indexOf(":"),l=e.indexOf("?"),r=e.indexOf("#"),u=e.indexOf("/");return i===-1||u!==-1&&i>u||l!==-1&&i>l||r!==-1&&i>r||K1.test(e.slice(0,i))?e:""}function dx(e,i){const l=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,u=l.indexOf(i);for(;u!==-1;)r++,u=l.indexOf(i,u+i.length);return r}function nC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function iC(e,i,l){const u=Pc((l||{}).ignore||[]),c=lC(i);let d=-1;for(;++d<c.length;)Gb(e,"text",p);function p(m,b){let x=-1,k;for(;++x<b.length;){const w=b[x],E=k?k.children:void 0;if(u(w,E?E.indexOf(w):void 0,k))return;k=w}if(k)return g(m,b)}function g(m,b){const x=b[b.length-1],k=c[d][0],w=c[d][1];let E=0;const U=x.children.indexOf(m);let _=!1,F=[];k.lastIndex=0;let q=k.exec(m.value);for(;q;){const Y=q.index,se={index:q.index,input:q.input,stack:[...b,m]};let N=w(...q,se);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?k.lastIndex=Y+1:(E!==Y&&F.push({type:"text",value:m.value.slice(E,Y)}),Array.isArray(N)?F.push(...N):N&&F.push(N),E=Y+q[0].length,_=!0),!k.global)break;q=k.exec(m.value)}return _?(E<m.value.length&&F.push({type:"text",value:m.value.slice(E)}),x.children.splice(U,1,...F)):F=[m],U+F.length}}function lC(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const l=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<l.length;){const u=l[r];i.push([aC(u[0]),rC(u[1])])}return i}function aC(e){return typeof e=="string"?new RegExp(nC(e),"g"):e}function rC(e){return typeof e=="function"?e:function(){return e}}const ap="phrasing",rp=["autolink","link","image","label"];function sC(){return{transforms:[hC],enter:{literalAutolink:uC,literalAutolinkEmail:sp,literalAutolinkHttp:sp,literalAutolinkWww:sp},exit:{literalAutolink:pC,literalAutolinkEmail:fC,literalAutolinkHttp:cC,literalAutolinkWww:dC}}}function oC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:rp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:rp},{character:":",before:"[ps]",after:"\\/",inConstruct:ap,notInConstruct:rp}]}}function uC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function sp(e){this.config.enter.autolinkProtocol.call(this,e)}function cC(e){this.config.exit.autolinkProtocol.call(this,e)}function dC(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 fC(e){this.config.exit.autolinkEmail.call(this,e)}function pC(e){this.exit(e)}function hC(e){iC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,mC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),gC]],{ignore:["link","linkReference"]})}function mC(e,i,l,r,u){let c="";if(!Yb(u)||(/^w/i.test(i)&&(l=i+l,i="",c="http://"),!yC(l)))return!1;const d=xC(l+r);if(!d[0])return!1;const p={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[p,{type:"text",value:d[1]}]:p}function gC(e,i,l,r){return!Yb(r,!0)||/[-\d_]$/.test(l)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+l,children:[{type:"text",value:i+"@"+l}]}}function yC(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 xC(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let l=i[0],r=l.indexOf(")");const u=dx(e,"(");let c=dx(e,")");for(;r!==-1&&u>c;)e+=l.slice(0,r+1),l=l.slice(r+1),r=l.indexOf(")"),c++;return[e,l]}function Yb(e,i){const l=e.input.charCodeAt(e.index-1);return(e.index===0||or(l)||Gc(l))&&(!i||l!==47)}Pb.peek=EC;function bC(){this.buffer()}function vC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function wC(){this.buffer()}function kC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function SC(e){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=_i(this.sliceSerialize(e)).toLowerCase(),l.label=i}function jC(e){this.exit(e)}function CC(e){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=_i(this.sliceSerialize(e)).toLowerCase(),l.label=i}function TC(e){this.exit(e)}function EC(){return"["}function Pb(e,i,l,r){const u=l.createTracker(r);let c=u.move("[^");const d=l.enter("footnoteReference"),p=l.enter("reference");return c+=u.move(l.safe(l.associationId(e),{after:"]",before:c})),p(),d(),c+=u.move("]"),c}function AC(){return{enter:{gfmFootnoteCallString:bC,gfmFootnoteCall:vC,gfmFootnoteDefinitionLabelString:wC,gfmFootnoteDefinition:kC},exit:{gfmFootnoteCallString:SC,gfmFootnoteCall:jC,gfmFootnoteDefinitionLabelString:CC,gfmFootnoteDefinition:TC}}}function NC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:l,footnoteReference:Pb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function l(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
64
- `:" ")+c.indentLines(c.containerFlow(r,p.current()),i?Fb:_C))),m(),g}}function _C(e,i,l){return i===0?e:Fb(e,i,l)}function Fb(e,i,l){return(l?"":" ")+e}const DC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Wb.peek=LC;function MC(){return{canContainEols:["delete"],enter:{strikethrough:OC},exit:{strikethrough:zC}}}function RC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:DC}],handlers:{delete:Wb}}}function OC(e){this.enter({type:"delete",children:[]},e)}function zC(e){this.exit(e)}function Wb(e,i,l,r){const u=l.createTracker(r),c=l.enter("strikethrough");let d=u.move("~~");return d+=l.containerPhrasing(e,{...u.current(),before:d,after:"~"}),d+=u.move("~~"),c(),d}function LC(){return"~"}function IC(e){return e.length}function UC(e,i){const l=i||{},r=(l.align||[]).concat(),u=l.stringLength||IC,c=[],d=[],p=[],g=[];let m=0,b=-1;for(;++b<e.length;){const O=[],U=[];let _=-1;for(e[b].length>m&&(m=e[b].length);++_<e[b].length;){const F=BC(e[b][_]);if(l.alignDelimiters!==!1){const q=u(F);U[_]=q,(g[_]===void 0||q>g[_])&&(g[_]=q)}O.push(F)}d[b]=O,p[b]=U}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=fx(r[x]);else{const O=fx(r);for(;++x<m;)c[x]=O}x=-1;const k=[],w=[];for(;++x<m;){const O=c[x];let U="",_="";O===99?(U=":",_=":"):O===108?U=":":O===114&&(_=":");let F=l.alignDelimiters===!1?1:Math.max(1,g[x]-U.length-_.length);const q=U+"-".repeat(F)+_;l.alignDelimiters!==!1&&(F=U.length+F+_.length,F>g[x]&&(g[x]=F),w[x]=F),k[x]=q}d.splice(1,0,k),p.splice(1,0,w),b=-1;const E=[];for(;++b<d.length;){const O=d[b],U=p[b];x=-1;const _=[];for(;++x<m;){const F=O[x]||"";let q="",Y="";if(l.alignDelimiters!==!1){const se=g[x]-(U[x]||0),N=c[x];N===114?q=" ".repeat(se):N===99?se%2?(q=" ".repeat(se/2+.5),Y=" ".repeat(se/2-.5)):(q=" ".repeat(se/2),Y=q):Y=" ".repeat(se)}l.delimiterStart!==!1&&!x&&_.push("|"),l.padding!==!1&&!(l.alignDelimiters===!1&&F==="")&&(l.delimiterStart!==!1||x)&&_.push(" "),l.alignDelimiters!==!1&&_.push(q),_.push(F),l.alignDelimiters!==!1&&_.push(Y),l.padding!==!1&&_.push(" "),(l.delimiterEnd!==!1||x!==m-1)&&_.push("|")}E.push(l.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return E.join(`
65
- `)}function BC(e){return e==null?"":String(e)}function fx(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 qC(e,i,l,r){const u=l.enter("blockquote"),c=l.createTracker(r);c.move("> "),c.shift(2);const d=l.indentLines(l.containerFlow(e,c.current()),HC);return u(),d}function HC(e,i,l){return">"+(l?"":" ")+e}function $C(e,i){return px(e,i.inConstruct,!0)&&!px(e,i.notInConstruct,!1)}function px(e,i,l){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return l;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function hx(e,i,l,r){let u=-1;for(;++u<l.unsafe.length;)if(l.unsafe[u].character===`
66
- `&&$C(l.stack,l.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
67
- `}function GC(e,i){const l=String(e);let r=l.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=l.indexOf(i,u);return d}function VC(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 YC(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 PC(e,i,l,r){const u=YC(l),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(VC(e,l)){const x=l.enter("codeIndented"),k=l.indentLines(c,FC);return x(),k}const p=l.createTracker(r),g=u.repeat(Math.max(GC(c,u)+1,3)),m=l.enter("codeFenced");let b=p.move(g);if(e.lang){const x=l.enter(`codeFencedLang${d}`);b+=p.move(l.safe(e.lang,{before:b,after:" ",encode:["`"],...p.current()})),x()}if(e.lang&&e.meta){const x=l.enter(`codeFencedMeta${d}`);b+=p.move(" "),b+=p.move(l.safe(e.meta,{before:b,after:`
68
- `,encode:["`"],...p.current()})),x()}return b+=p.move(`
62
+ `}),l}function lx(e){let i=0,l=e.charCodeAt(i);for(;l===9||l===32;)i++,l=e.charCodeAt(i);return e.slice(i)}function ax(e,i){const l=S1(e,i),r=l.one(e,void 0),u=h1(l),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return u&&c.children.push({type:"text",value:`
63
+ `},u),c}function N1(e,i){return e&&"run"in e?async function(l,r){const u=ax(l,{file:r,...i});await e.run(u,r)}:function(l,r){return ax(l,{file:r,...e||i})}}function rx(e){if(e)throw e}var Qf,sx;function _1(){if(sx)return Qf;sx=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,l=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"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!y)return!1;var k;for(k in m);return typeof k>"u"||e.call(m,k)},d=function(m,b){l&&b.name==="__proto__"?l(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},p=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return Qf=function g(){var m,b,y,k,w,T,R=arguments[0],z=1,N=arguments.length,G=!1;for(typeof R=="boolean"&&(G=R,R=arguments[1]||{},z=2),(R==null||typeof R!="object"&&typeof R!="function")&&(R={});z<N;++z)if(m=arguments[z],m!=null)for(b in m)y=p(R,b),k=p(m,b),R!==k&&(G&&k&&(c(k)||(w=u(k)))?(w?(w=!1,T=y&&u(y)?y:[]):T=y&&c(y)?y:{},d(R,{name:b,newValue:g(G,T,k)})):typeof k<"u"&&d(R,{name:b,newValue:k}));return R},Qf}var D1=_1();const Zf=db(D1);function Bp(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 R1(){const e=[],i={run:l,use:r};return i;function l(...u){let c=-1;const d=u.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...u);function p(g,...m){const b=e[++c];let y=-1;if(g){d(g);return}for(;++y<u.length;)(m[y]===null||m[y]===void 0)&&(m[y]=u[y]);u=m,b?M1(b,p)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function M1(e,i){let l;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&l)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){l||(l=!0,i(d,...p))}function c(d){u(null,d)}}const Qi={basename:O1,dirname:z1,extname:L1,join:I1,sep:"/"};function O1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Yo(e);let l=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){l=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":e.slice(l,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){l=u+1;break}}else d<0&&(c=!0,d=u+1),p>-1&&(e.codePointAt(u)===i.codePointAt(p--)?p<0&&(r=u):(p=-1,r=d));return l===r?r=d:r<0&&(r=e.length),e.slice(l,r)}function z1(e){if(Yo(e),e.length===0)return".";let i=-1,l=e.length,r;for(;--l;)if(e.codePointAt(l)===47){if(r){i=l;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function L1(e){Yo(e);let i=e.length,l=-1,r=0,u=-1,c=0,d;for(;i--;){const p=e.codePointAt(i);if(p===47){if(d){r=i+1;break}continue}l<0&&(d=!0,l=i+1),p===46?u<0?u=i:c!==1&&(c=1):u>-1&&(c=-1)}return u<0||l<0||c===0||c===1&&u===l-1&&u===r+1?"":e.slice(u,l)}function I1(...e){let i=-1,l;for(;++i<e.length;)Yo(e[i]),e[i]&&(l=l===void 0?e[i]:l+"/"+e[i]);return l===void 0?".":U1(l)}function U1(e){Yo(e);const i=e.codePointAt(0)===47;let l=B1(e,!i);return l.length===0&&!i&&(l="."),l.length>0&&e.codePointAt(e.length-1)===47&&(l+="/"),i?"/"+l:l}function B1(e,i){let l="",r=0,u=-1,c=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===47){if(!(u===d-1||c===1))if(u!==d-1&&c===2){if(l.length<2||r!==2||l.codePointAt(l.length-1)!==46||l.codePointAt(l.length-2)!==46){if(l.length>2){if(g=l.lastIndexOf("/"),g!==l.length-1){g<0?(l="",r=0):(l=l.slice(0,g),r=l.length-1-l.lastIndexOf("/")),u=d,c=0;continue}}else if(l.length>0){l="",r=0,u=d,c=0;continue}}i&&(l=l.length>0?l+"/..":"..",r=2)}else l.length>0?l+="/"+e.slice(u+1,d):l=e.slice(u+1,d),r=d-u-1;u=d,c=0}else p===46&&c>-1?c++:c=-1}return l}function Yo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const q1={cwd:H1};function H1(){return"/"}function qp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $1(e){if(typeof e=="string")e=new URL(e);else if(!qp(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 G1(e)}function G1(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 l=-1;for(;++l<i.length;)if(i.codePointAt(l)===37&&i.codePointAt(l+1)===50){const r=i.codePointAt(l+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 Jf=["history","path","basename","stem","extname","dirname"];class Yb{constructor(i){let l;i?qp(i)?l={path:i}:typeof i=="string"||V1(i)?l={value:i}:l=i:l={},this.cwd="cwd"in l?"":q1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jf.length;){const c=Jf[r];c in l&&l[c]!==void 0&&l[c]!==null&&(this[c]=c==="history"?[...l[c]]:l[c])}let u;for(u in l)Jf.includes(u)||(this[u]=l[u])}get basename(){return typeof this.path=="string"?Qi.basename(this.path):void 0}set basename(i){tp(i,"basename"),ep(i,"basename"),this.path=Qi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Qi.dirname(this.path):void 0}set dirname(i){ox(this.basename,"dirname"),this.path=Qi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Qi.extname(this.path):void 0}set extname(i){if(ep(i,"extname"),ox(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=Qi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){qp(i)&&(i=$1(i)),tp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Qi.basename(this.path,this.extname):void 0}set stem(i){tp(i,"stem"),ep(i,"stem"),this.path=Qi.join(this.dirname||"",i+(this.extname||""))}fail(i,l,r){const u=this.message(i,l,r);throw u.fatal=!0,u}info(i,l,r){const u=this.message(i,l,r);return u.fatal=void 0,u}message(i,l,r){const u=new hn(i,l,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 ep(e,i){if(e&&e.includes(Qi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Qi.sep+"`")}function tp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function ox(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function V1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const P1=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),Y1={}.hasOwnProperty;class gh extends P1{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=R1()}copy(){const i=new gh;let l=-1;for(;++l<this.attachers.length;){const r=this.attachers[l];i.use(...r)}return i.data(Zf(!0,{},this.namespace)),i}data(i,l){return typeof i=="string"?arguments.length===2?(lp("data",this.frozen),this.namespace[i]=l,this):Y1.call(this.namespace,i)&&this.namespace[i]||void 0:i?(lp("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[l,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=l.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 l=kc(i),r=this.parser||this.Parser;return np("parse",r),r(String(l),l)}process(i,l){const r=this;return this.freeze(),np("process",this.parser||this.Parser),ip("process",this.compiler||this.Compiler),l?u(void 0,l):new Promise(u);function u(c,d){const p=kc(i),g=r.parse(p);r.run(g,p,function(b,y,k){if(b||!y||!k)return m(b);const w=y,T=r.stringify(w,k);K1(T)?k.value=T:k.result=T,m(b,k)});function m(b,y){b||!y?d(b):c?c(y):l(void 0,y)}}}processSync(i){let l=!1,r;return this.freeze(),np("processSync",this.parser||this.Parser),ip("processSync",this.compiler||this.Compiler),this.process(i,u),cx("processSync","process",l),r;function u(c,d){l=!0,rx(c),r=d}}run(i,l,r){ux(i),this.freeze();const u=this.transformers;return!r&&typeof l=="function"&&(r=l,l=void 0),r?c(void 0,r):new Promise(c);function c(d,p){const g=kc(l);u.run(i,g,m);function m(b,y,k){const w=y||i;b?p(b):d?d(w):r(void 0,w,k)}}}runSync(i,l){let r=!1,u;return this.run(i,l,c),cx("runSync","run",r),u;function c(d,p){rx(d),u=p,r=!0}}stringify(i,l){this.freeze();const r=kc(l),u=this.compiler||this.Compiler;return ip("stringify",u),ux(i),u(i,r)}use(i,...l){const r=this.attachers,u=this.namespace;if(lp("use",this.frozen),i!=null)if(typeof i=="function")g(i,l);else if(typeof i=="object")Array.isArray(i)?p(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...y]=m;g(b,y)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");p(m.plugins),m.settings&&(u.settings=Zf(!0,u.settings,m.settings))}function p(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const y=m[b];c(y)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function g(m,b){let y=-1,k=-1;for(;++y<r.length;)if(r[y][0]===m){k=y;break}if(k===-1)r.push([m,...b]);else if(b.length>0){let[w,...T]=b;const R=r[k][1];Bp(R)&&Bp(w)&&(w=Zf(!0,R,w)),r[k]=[m,w,...T]}}}}const F1=new gh().freeze();function np(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ip(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lp(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 ux(e){if(!Bp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function cx(e,i,l){if(!l)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function kc(e){return W1(e)?e:new Yb(e)}function W1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function K1(e){return typeof e=="string"||X1(e)}function X1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Q1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",dx=[],fx={allowDangerousHtml:!0},Z1=/^(https?|ircs?|mailto|xmpp)$/i,J1=[{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 eC(e){const i=tC(e),l=nC(e);return iC(i.runSync(i.parse(l),l),e)}function tC(e){const i=e.rehypePlugins||dx,l=e.remarkPlugins||dx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fx}:fx;return F1().use(O0).use(l).use(N1,r).use(i)}function nC(e){const i=e.children||"",l=new Yb;return typeof i=="string"&&(l.value=i),l}function iC(e,i){const l=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||lC;for(const b of J1)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+Q1+b.id,void 0);return mh(e,m),yj(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,y,k){if(b.type==="raw"&&k&&typeof y=="number")return d?k.children.splice(y,1):k.children[y]={type:"text",value:b.value},y;if(b.type==="element"){let w;for(w in Wf)if(Object.hasOwn(Wf,w)&&Object.hasOwn(b.properties,w)){const T=b.properties[w],R=Wf[w];(R===null||R.includes(b.tagName))&&(b.properties[w]=g(String(T||""),w,b))}}if(b.type==="element"){let w=l?!l.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof y=="number"&&(w=!r(b,y,k)),w&&k&&typeof y=="number")return p&&b.children?k.children.splice(y,1,...b.children):k.children.splice(y,1),y}}}function lC(e){const i=e.indexOf(":"),l=e.indexOf("?"),r=e.indexOf("#"),u=e.indexOf("/");return i===-1||u!==-1&&i>u||l!==-1&&i>l||r!==-1&&i>r||Z1.test(e.slice(0,i))?e:""}function px(e,i){const l=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,u=l.indexOf(i);for(;u!==-1;)r++,u=l.indexOf(i,u+i.length);return r}function aC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function rC(e,i,l){const u=Yc((l||{}).ignore||[]),c=sC(i);let d=-1;for(;++d<c.length;)Pb(e,"text",p);function p(m,b){let y=-1,k;for(;++y<b.length;){const w=b[y],T=k?k.children:void 0;if(u(w,T?T.indexOf(w):void 0,k))return;k=w}if(k)return g(m,b)}function g(m,b){const y=b[b.length-1],k=c[d][0],w=c[d][1];let T=0;const z=y.children.indexOf(m);let N=!1,G=[];k.lastIndex=0;let B=k.exec(m.value);for(;B;){const P=B.index,se={index:B.index,input:B.input,stack:[...b,m]};let _=w(...B,se);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?k.lastIndex=P+1:(T!==P&&G.push({type:"text",value:m.value.slice(T,P)}),Array.isArray(_)?G.push(..._):_&&G.push(_),T=P+B[0].length,N=!0),!k.global)break;B=k.exec(m.value)}return N?(T<m.value.length&&G.push({type:"text",value:m.value.slice(T)}),y.children.splice(z,1,...G)):G=[m],z+G.length}}function sC(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const l=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<l.length;){const u=l[r];i.push([oC(u[0]),uC(u[1])])}return i}function oC(e){return typeof e=="string"?new RegExp(aC(e),"g"):e}function uC(e){return typeof e=="function"?e:function(){return e}}const ap="phrasing",rp=["autolink","link","image","label"];function cC(){return{transforms:[yC],enter:{literalAutolink:fC,literalAutolinkEmail:sp,literalAutolinkHttp:sp,literalAutolinkWww:sp},exit:{literalAutolink:gC,literalAutolinkEmail:mC,literalAutolinkHttp:pC,literalAutolinkWww:hC}}}function dC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:rp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:rp},{character:":",before:"[ps]",after:"\\/",inConstruct:ap,notInConstruct:rp}]}}function fC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function sp(e){this.config.enter.autolinkProtocol.call(this,e)}function pC(e){this.config.exit.autolinkProtocol.call(this,e)}function hC(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 mC(e){this.config.exit.autolinkEmail.call(this,e)}function gC(e){this.exit(e)}function yC(e){rC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),bC]],{ignore:["link","linkReference"]})}function xC(e,i,l,r,u){let c="";if(!Fb(u)||(/^w/i.test(i)&&(l=i+l,i="",c="http://"),!vC(l)))return!1;const d=wC(l+r);if(!d[0])return!1;const p={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[p,{type:"text",value:d[1]}]:p}function bC(e,i,l,r){return!Fb(r,!0)||/[-\d_]$/.test(l)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+l,children:[{type:"text",value:i+"@"+l}]}}function vC(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 wC(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let l=i[0],r=l.indexOf(")");const u=px(e,"(");let c=px(e,")");for(;r!==-1&&u>c;)e+=l.slice(0,r+1),l=l.slice(r+1),r=l.indexOf(")"),c++;return[e,l]}function Fb(e,i){const l=e.input.charCodeAt(e.index-1);return(e.index===0||or(l)||Gc(l))&&(!i||l!==47)}Wb.peek=_C;function kC(){this.buffer()}function jC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function SC(){this.buffer()}function CC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function TC(e){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=_i(this.sliceSerialize(e)).toLowerCase(),l.label=i}function EC(e){this.exit(e)}function AC(e){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=_i(this.sliceSerialize(e)).toLowerCase(),l.label=i}function NC(e){this.exit(e)}function _C(){return"["}function Wb(e,i,l,r){const u=l.createTracker(r);let c=u.move("[^");const d=l.enter("footnoteReference"),p=l.enter("reference");return c+=u.move(l.safe(l.associationId(e),{after:"]",before:c})),p(),d(),c+=u.move("]"),c}function DC(){return{enter:{gfmFootnoteCallString:kC,gfmFootnoteCall:jC,gfmFootnoteDefinitionLabelString:SC,gfmFootnoteDefinition:CC},exit:{gfmFootnoteCallString:TC,gfmFootnoteCall:EC,gfmFootnoteDefinitionLabelString:AC,gfmFootnoteDefinition:NC}}}function RC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:l,footnoteReference:Wb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function l(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
64
+ `:" ")+c.indentLines(c.containerFlow(r,p.current()),i?Kb:MC))),m(),g}}function MC(e,i,l){return i===0?e:Kb(e,i,l)}function Kb(e,i,l){return(l?"":" ")+e}const OC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Xb.peek=BC;function zC(){return{canContainEols:["delete"],enter:{strikethrough:IC},exit:{strikethrough:UC}}}function LC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:OC}],handlers:{delete:Xb}}}function IC(e){this.enter({type:"delete",children:[]},e)}function UC(e){this.exit(e)}function Xb(e,i,l,r){const u=l.createTracker(r),c=l.enter("strikethrough");let d=u.move("~~");return d+=l.containerPhrasing(e,{...u.current(),before:d,after:"~"}),d+=u.move("~~"),c(),d}function BC(){return"~"}function qC(e){return e.length}function HC(e,i){const l=i||{},r=(l.align||[]).concat(),u=l.stringLength||qC,c=[],d=[],p=[],g=[];let m=0,b=-1;for(;++b<e.length;){const R=[],z=[];let N=-1;for(e[b].length>m&&(m=e[b].length);++N<e[b].length;){const G=$C(e[b][N]);if(l.alignDelimiters!==!1){const B=u(G);z[N]=B,(g[N]===void 0||B>g[N])&&(g[N]=B)}R.push(G)}d[b]=R,p[b]=z}let y=-1;if(typeof r=="object"&&"length"in r)for(;++y<m;)c[y]=hx(r[y]);else{const R=hx(r);for(;++y<m;)c[y]=R}y=-1;const k=[],w=[];for(;++y<m;){const R=c[y];let z="",N="";R===99?(z=":",N=":"):R===108?z=":":R===114&&(N=":");let G=l.alignDelimiters===!1?1:Math.max(1,g[y]-z.length-N.length);const B=z+"-".repeat(G)+N;l.alignDelimiters!==!1&&(G=z.length+G+N.length,G>g[y]&&(g[y]=G),w[y]=G),k[y]=B}d.splice(1,0,k),p.splice(1,0,w),b=-1;const T=[];for(;++b<d.length;){const R=d[b],z=p[b];y=-1;const N=[];for(;++y<m;){const G=R[y]||"";let B="",P="";if(l.alignDelimiters!==!1){const se=g[y]-(z[y]||0),_=c[y];_===114?B=" ".repeat(se):_===99?se%2?(B=" ".repeat(se/2+.5),P=" ".repeat(se/2-.5)):(B=" ".repeat(se/2),P=B):P=" ".repeat(se)}l.delimiterStart!==!1&&!y&&N.push("|"),l.padding!==!1&&!(l.alignDelimiters===!1&&G==="")&&(l.delimiterStart!==!1||y)&&N.push(" "),l.alignDelimiters!==!1&&N.push(B),N.push(G),l.alignDelimiters!==!1&&N.push(P),l.padding!==!1&&N.push(" "),(l.delimiterEnd!==!1||y!==m-1)&&N.push("|")}T.push(l.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return T.join(`
65
+ `)}function $C(e){return e==null?"":String(e)}function hx(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 GC(e,i,l,r){const u=l.enter("blockquote"),c=l.createTracker(r);c.move("> "),c.shift(2);const d=l.indentLines(l.containerFlow(e,c.current()),VC);return u(),d}function VC(e,i,l){return">"+(l?"":" ")+e}function PC(e,i){return mx(e,i.inConstruct,!0)&&!mx(e,i.notInConstruct,!1)}function mx(e,i,l){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return l;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function gx(e,i,l,r){let u=-1;for(;++u<l.unsafe.length;)if(l.unsafe[u].character===`
66
+ `&&PC(l.stack,l.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
67
+ `}function YC(e,i){const l=String(e);let r=l.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=l.indexOf(i,u);return d}function FC(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 WC(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 KC(e,i,l,r){const u=WC(l),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(FC(e,l)){const y=l.enter("codeIndented"),k=l.indentLines(c,XC);return y(),k}const p=l.createTracker(r),g=u.repeat(Math.max(YC(c,u)+1,3)),m=l.enter("codeFenced");let b=p.move(g);if(e.lang){const y=l.enter(`codeFencedLang${d}`);b+=p.move(l.safe(e.lang,{before:b,after:" ",encode:["`"],...p.current()})),y()}if(e.lang&&e.meta){const y=l.enter(`codeFencedMeta${d}`);b+=p.move(" "),b+=p.move(l.safe(e.meta,{before:b,after:`
68
+ `,encode:["`"],...p.current()})),y()}return b+=p.move(`
69
69
  `),c&&(b+=p.move(c+`
70
- `)),b+=p.move(g),m(),b}function FC(e,i,l){return(l?"":" ")+e}function gh(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 WC(e,i,l,r){const u=gh(l),c=u==='"'?"Quote":"Apostrophe",d=l.enter("definition");let p=l.enter("label");const g=l.createTracker(r);let m=g.move("[");return m+=g.move(l.safe(l.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=l.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(l.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=l.enter("destinationRaw"),m+=g.move(l.safe(e.url,{before:m,after:e.title?" ":`
71
- `,...g.current()}))),p(),e.title&&(p=l.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(l.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function KC(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 Go(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Uc(e,i,l){const r=rs(e),u=rs(i);return r===void 0?u===void 0?l==="_"?{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}}Kb.peek=XC;function Kb(e,i,l,r){const u=KC(l),c=l.enter("emphasis"),d=l.createTracker(r),p=d.move(u);let g=d.move(l.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Uc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Go(m)+g.slice(1));const x=g.charCodeAt(g.length-1),k=Uc(r.after.charCodeAt(0),x,u);k.inside&&(g=g.slice(0,-1)+Go(x));const w=d.move(u);return c(),l.attentionEncodeSurroundingInfo={after:k.outside,before:b.outside},p+g+w}function XC(e,i,l){return l.options.emphasis||"*"}function QC(e,i){let l=!1;return hh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return l=!0,Ip}),!!((!e.depth||e.depth<3)&&sh(e)&&(i.options.setext||l))}function ZC(e,i,l,r){const u=Math.max(Math.min(6,e.depth||1),1),c=l.createTracker(r);if(QC(e,l)){const b=l.enter("headingSetext"),x=l.enter("phrasing"),k=l.containerPhrasing(e,{...c.current(),before:`
70
+ `)),b+=p.move(g),m(),b}function XC(e,i,l){return(l?"":" ")+e}function yh(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 QC(e,i,l,r){const u=yh(l),c=u==='"'?"Quote":"Apostrophe",d=l.enter("definition");let p=l.enter("label");const g=l.createTracker(r);let m=g.move("[");return m+=g.move(l.safe(l.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=l.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(l.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=l.enter("destinationRaw"),m+=g.move(l.safe(e.url,{before:m,after:e.title?" ":`
71
+ `,...g.current()}))),p(),e.title&&(p=l.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(l.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function ZC(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 Go(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Uc(e,i,l){const r=rs(e),u=rs(i);return r===void 0?u===void 0?l==="_"?{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}}Qb.peek=JC;function Qb(e,i,l,r){const u=ZC(l),c=l.enter("emphasis"),d=l.createTracker(r),p=d.move(u);let g=d.move(l.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Uc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Go(m)+g.slice(1));const y=g.charCodeAt(g.length-1),k=Uc(r.after.charCodeAt(0),y,u);k.inside&&(g=g.slice(0,-1)+Go(y));const w=d.move(u);return c(),l.attentionEncodeSurroundingInfo={after:k.outside,before:b.outside},p+g+w}function JC(e,i,l){return l.options.emphasis||"*"}function eT(e,i){let l=!1;return mh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return l=!0,Ip}),!!((!e.depth||e.depth<3)&&oh(e)&&(i.options.setext||l))}function tT(e,i,l,r){const u=Math.max(Math.min(6,e.depth||1),1),c=l.createTracker(r);if(eT(e,l)){const b=l.enter("headingSetext"),y=l.enter("phrasing"),k=l.containerPhrasing(e,{...c.current(),before:`
72
72
  `,after:`
73
- `});return x(),b(),k+`
73
+ `});return y(),b(),k+`
74
74
  `+(u===1?"=":"-").repeat(k.length-(Math.max(k.lastIndexOf("\r"),k.lastIndexOf(`
75
75
  `))+1))}const d="#".repeat(u),p=l.enter("headingAtx"),g=l.enter("phrasing");c.move(d+" ");let m=l.containerPhrasing(e,{before:"# ",after:`
76
- `,...c.current()});return/^[\t ]/.test(m)&&(m=Go(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,l.options.closeAtx&&(m+=" "+d),g(),p(),m}Xb.peek=JC;function Xb(e){return e.value||""}function JC(){return"<"}Qb.peek=eT;function Qb(e,i,l,r){const u=gh(l),c=u==='"'?"Quote":"Apostrophe",d=l.enter("image");let p=l.enter("label");const g=l.createTracker(r);let m=g.move("![");return m+=g.move(l.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=l.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(l.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=l.enter("destinationRaw"),m+=g.move(l.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=l.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(l.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function eT(){return"!"}Zb.peek=tT;function Zb(e,i,l,r){const u=e.referenceType,c=l.enter("imageReference");let d=l.enter("label");const p=l.createTracker(r);let g=p.move("![");const m=l.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=l.stack;l.stack=[],d=l.enter("reference");const x=l.safe(l.associationId(e),{before:g,after:"]",...p.current()});return d(),l.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function tT(){return"!"}Jb.peek=nT;function Jb(e,i,l){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<l.unsafe.length;){const d=l.unsafe[c],p=l.compilePattern(d);let g;if(d.atBreak)for(;g=p.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function nT(){return"`"}function ev(e,i){const l=sh(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(l===e.url||"mailto:"+l===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}tv.peek=iT;function tv(e,i,l,r){const u=gh(l),c=u==='"'?"Quote":"Apostrophe",d=l.createTracker(r);let p,g;if(ev(e,l)){const b=l.stack;l.stack=[],p=l.enter("autolink");let x=d.move("<");return x+=d.move(l.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),p(),l.stack=b,x}p=l.enter("link"),g=l.enter("label");let m=d.move("[");return m+=d.move(l.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=l.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(l.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=l.enter("destinationRaw"),m+=d.move(l.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=l.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(l.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function iT(e,i,l){return ev(e,l)?"<":"["}nv.peek=lT;function nv(e,i,l,r){const u=e.referenceType,c=l.enter("linkReference");let d=l.enter("label");const p=l.createTracker(r);let g=p.move("[");const m=l.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=l.stack;l.stack=[],d=l.enter("reference");const x=l.safe(l.associationId(e),{before:g,after:"]",...p.current()});return d(),l.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function lT(){return"["}function yh(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 aT(e){const i=yh(e),l=e.options.bulletOther;if(!l)return i==="*"?"-":"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(l===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+l+"`) to be different");return l}function rT(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 iv(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 sT(e,i,l,r){const u=l.enter("list"),c=l.bulletCurrent;let d=e.ordered?rT(l):yh(l);const p=e.ordered?d==="."?")":".":aT(l);let g=i&&l.bulletLastUsed?d===l.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.children[0])&&l.stack[l.stack.length-1]==="list"&&l.stack[l.stack.length-2]==="listItem"&&l.stack[l.stack.length-3]==="list"&&l.stack[l.stack.length-4]==="listItem"&&l.indexStack[l.indexStack.length-1]===0&&l.indexStack[l.indexStack.length-2]===0&&l.indexStack[l.indexStack.length-3]===0&&(g=!0),iv(l)===d&&b){let x=-1;for(;++x<e.children.length;){const k=e.children[x];if(k&&k.type==="listItem"&&k.children&&k.children[0]&&k.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),l.bulletCurrent=d;const m=l.containerFlow(e,r);return l.bulletLastUsed=d,l.bulletCurrent=c,u(),m}function oT(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 uT(e,i,l,r){const u=oT(l);let c=l.bulletCurrent||yh(l);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(l.options.incrementListMarker===!1?0:i.children.indexOf(e))+c);let d=c.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=l.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=l.enter("listItem"),m=l.indentLines(l.containerFlow(e,p.current()),b);return g(),m;function b(x,k,w){return k?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function cT(e,i,l,r){const u=l.enter("paragraph"),c=l.enter("phrasing"),d=l.containerPhrasing(e,r);return c(),u(),d}const dT=Pc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function fT(e,i,l,r){return(e.children.some(function(d){return dT(d)})?l.containerPhrasing:l.containerFlow).call(l,e,r)}function pT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}lv.peek=hT;function lv(e,i,l,r){const u=pT(l),c=l.enter("strong"),d=l.createTracker(r),p=d.move(u+u);let g=d.move(l.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Uc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Go(m)+g.slice(1));const x=g.charCodeAt(g.length-1),k=Uc(r.after.charCodeAt(0),x,u);k.inside&&(g=g.slice(0,-1)+Go(x));const w=d.move(u+u);return c(),l.attentionEncodeSurroundingInfo={after:k.outside,before:b.outside},p+g+w}function hT(e,i,l){return l.options.strong||"*"}function mT(e,i,l,r){return l.safe(e.value,r)}function gT(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 yT(e,i,l){const r=(iv(l)+(l.options.ruleSpaces?" ":"")).repeat(gT(l));return l.options.ruleSpaces?r.slice(0,-1):r}const av={blockquote:qC,break:hx,code:PC,definition:WC,emphasis:Kb,hardBreak:hx,heading:ZC,html:Xb,image:Qb,imageReference:Zb,inlineCode:Jb,link:tv,linkReference:nv,list:sT,listItem:uT,paragraph:cT,root:fT,strong:lv,text:mT,thematicBreak:yT};function xT(){return{enter:{table:bT,tableData:mx,tableHeader:mx,tableRow:wT},exit:{codeText:kT,table:vT,tableData:op,tableHeader:op,tableRow:op}}}function bT(e){const i=e._align;this.enter({type:"table",align:i.map(function(l){return l==="none"?null:l}),children:[]},e),this.data.inTable=!0}function vT(e){this.exit(e),this.data.inTable=void 0}function wT(e){this.enter({type:"tableRow",children:[]},e)}function op(e){this.exit(e)}function mx(e){this.enter({type:"tableCell",children:[]},e)}function kT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,ST));const l=this.stack[this.stack.length-1];l.type,l.value=i,this.exit(e)}function ST(e,i){return i==="|"?i:e}function jT(e){const i=e||{},l=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=l?" ":"|";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:k,table:d,tableCell:g,tableRow:p}};function d(w,E,O,U){return m(b(w,O,U),w.align)}function p(w,E,O,U){const _=x(w,O,U),F=m([_]);return F.slice(0,F.indexOf(`
78
- `))}function g(w,E,O,U){const _=O.enter("tableCell"),F=O.enter("phrasing"),q=O.containerPhrasing(w,{...U,before:c,after:c});return F(),_(),q}function m(w,E){return UC(w,{align:E,alignDelimiters:r,padding:l,stringLength:u})}function b(w,E,O){const U=w.children;let _=-1;const F=[],q=E.enter("table");for(;++_<U.length;)F[_]=x(U[_],E,O);return q(),F}function x(w,E,O){const U=w.children;let _=-1;const F=[],q=E.enter("tableRow");for(;++_<U.length;)F[_]=g(U[_],w,E,O);return q(),F}function k(w,E,O){let U=av.inlineCode(w,E,O);return O.stack.includes("tableCell")&&(U=U.replace(/\|/g,"\\$&")),U}}function CT(){return{exit:{taskListCheckValueChecked:gx,taskListCheckValueUnchecked:gx,paragraph:ET}}}function TT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:AT}}}function gx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function ET(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const l=this.stack[this.stack.length-1];l.type;const r=l.children[0];if(r&&r.type==="text"){const u=i.children;let c=-1,d;for(;++c<u.length;){const p=u[c];if(p.type==="paragraph"){d=p;break}}d===l&&(r.value=r.value.slice(1),r.value.length===0?l.children.shift():l.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,l.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function AT(e,i,l,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=l.createTracker(r);c&&p.move(d);let g=av.listItem(e,i,l,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function NT(){return[sC(),AC(),MC(),xT(),CT()]}function _T(e){return{extensions:[oC(),NC(e),RC(),jT(e),TT()]}}const DT={tokenize:IT,partial:!0},rv={tokenize:UT,partial:!0},sv={tokenize:BT,partial:!0},ov={tokenize:qT,partial:!0},MT={tokenize:HT,partial:!0},uv={name:"wwwAutolink",tokenize:zT,previous:dv},cv={name:"protocolAutolink",tokenize:LT,previous:fv},Dl={name:"emailAutolink",tokenize:OT,previous:pv},el={};function RT(){return{text:el}}let nr=48;for(;nr<123;)el[nr]=Dl,nr++,nr===58?nr=65:nr===91&&(nr=97);el[43]=Dl;el[45]=Dl;el[46]=Dl;el[95]=Dl;el[72]=[Dl,cv];el[104]=[Dl,cv];el[87]=[Dl,uv];el[119]=[Dl,uv];function OT(e,i,l){const r=this;let u,c;return d;function d(x){return!Hp(x)||!pv.call(r,r.previous)||xh(r.events)?l(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return Hp(x)?(e.consume(x),p):x===64?(e.consume(x),g):l(x)}function g(x){return x===46?e.check(MT,b,m)(x):x===45||x===95||pn(x)?(c=!0,e.consume(x),g):b(x)}function m(x){return e.consume(x),u=!0,g}function b(x){return c&&u&&vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):l(x)}}function zT(e,i,l){const r=this;return u;function u(d){return d!==87&&d!==119||!dv.call(r,r.previous)||xh(r.events)?l(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(DT,e.attempt(rv,e.attempt(sv,c),l),l)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function LT(e,i,l){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&fv.call(r,r.previous)&&!xh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):l(x)}function p(x){if(vn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const k=u.toLowerCase();if(k==="http"||k==="https")return e.consume(x),g}return l(x)}function g(x){return x===47?(e.consume(x),c?m:(c=!0,g)):l(x)}function m(x){return x===null||zc(x)||yt(x)||or(x)||Gc(x)?l(x):e.attempt(rv,e.attempt(sv,b),l)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function IT(e,i,l){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):l(d)}function c(d){return d===null?l(d):i(d)}}function UT(e,i,l){let r,u,c;return d;function d(m){return m===46||m===95?e.check(ov,g,p)(m):m===null||yt(m)||or(m)||m!==45&&Gc(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?l(m):i(m)}}function BT(e,i){let l=0,r=0;return u;function u(d){return d===40?(l++,e.consume(d),u):d===41&&r<l?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(ov,i,c)(d):d===null||yt(d)||or(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function qT(e,i,l){return r;function r(p){return p===33||p===34||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===63||p===95||p===126?(e.consume(p),r):p===38?(e.consume(p),c):p===93?(e.consume(p),u):p===60||p===null||yt(p)||or(p)?i(p):l(p)}function u(p){return p===null||p===40||p===91||yt(p)||or(p)?i(p):r(p)}function c(p){return vn(p)?d(p):l(p)}function d(p){return p===59?(e.consume(p),r):vn(p)?(e.consume(p),d):l(p)}}function HT(e,i,l){return r;function r(c){return e.consume(c),u}function u(c){return pn(c)?l(c):i(c)}}function dv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function fv(e){return!vn(e)}function pv(e){return!(e===47||Hp(e))}function Hp(e){return e===43||e===45||e===46||e===95||pn(e)}function xh(e){let i=e.length,l=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){l=!0;break}if(r._gfmAutolinkLiteralWalkedInto){l=!1;break}}return e.length>0&&!l&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),l}const $T={tokenize:XT,partial:!0};function GT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:FT,continuation:{tokenize:WT},exit:KT}},text:{91:{name:"gfmFootnoteCall",tokenize:PT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:VT,resolveTo:YT}}}}function VT(e,i,l){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const g=r.events[u][1];if(g.type==="labelImage"){d=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return p;function p(g){if(!d||!d._balanced)return l(g);const m=_i(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?l(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function YT(e,i){let l=e.length;for(;l--;)if(e[l][1].type==="labelImage"&&e[l][0]==="enter"){e[l][1];break}e[l+1][1].type="data",e[l+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[l+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[l+3][1].end),end:Object.assign({},e[l+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},p=[e[l+1],e[l+2],["enter",r,i],e[l+3],e[l+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(l,e.length-l+1,...p),e}function PT(e,i,l){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?l(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||yt(x))return l(x);if(x===93){e.exit("chunkString");const k=e.exit("gfmFootnoteCallString");return u.includes(_i(r.sliceSerialize(k)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):l(x)}return yt(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 FT(e,i,l){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return g;function g(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):l(E)}function b(E){if(d>999||E===93&&!p||E===null||E===91||yt(E))return l(E);if(E===93){e.exit("chunkString");const O=e.exit("gfmFootnoteDefinitionLabelString");return c=_i(r.sliceSerialize(O)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),k}return yt(E)||(p=!0),d++,e.consume(E),E===92?x:b}function x(E){return E===91||E===92||E===93?(e.consume(E),d++,b):b(E)}function k(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),u.includes(c)||u.push(c),et(e,w,"gfmFootnoteDefinitionWhitespace")):l(E)}function w(E){return i(E)}}function WT(e,i,l){return e.check(Yo,i,e.attempt($T,i,l))}function KT(e){e.exit("gfmFootnoteDefinition")}function XT(e,i,l){const r=this;return et(e,u,"gfmFootnoteDefinitionIndent",5);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(c):l(c)}}function QT(e){let l=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:u};return l==null&&(l=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(d,p){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},k=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&ni(k,k.length,0,Vc(w,d.slice(m+1,g),p)),ni(k,k.length,0,[["exit",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),ni(d,m-1,g-m+3,k),g=m+k.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,p,g){const m=this.previous,b=this.events;let x=0;return k;function k(E){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(E):(d.enter("strikethroughSequenceTemporary"),w(E))}function w(E){const O=rs(m);if(E===126)return x>1?g(E):(d.consume(E),x++,w);if(x<2&&!l)return g(E);const U=d.exit("strikethroughSequenceTemporary"),_=rs(E);return U._open=!_||_===2&&!!O,U._close=!O||O===2&&!!_,p(E)}}}class ZT{constructor(){this.map=[]}add(i,l,r){JT(this,i,l,r)}consume(i){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let l=this.map.length;const r=[];for(;l>0;)l-=1,r.push(i.slice(this.map[l][0]+this.map[l][1]),this.map[l][2]),i.length=this.map[l][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 JT(e,i,l,r){let u=0;if(!(l===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===i){e.map[u][1]+=l,e.map[u][2].push(...r);return}u+=1}e.map.push([i,l,r])}}function eE(e,i){let l=!1;const r=[];for(;i<e.length;){const u=e[i];if(l){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"&&(l=!0);i+=1}return r}function tE(){return{flow:{null:{name:"table",tokenize:nE,resolveAll:iE}}}}function nE(e,i,l){const r=this;let u=0,c=0,d;return p;function p(L){let te=r.events.length-1;for(;te>-1;){const ge=r.events[te][1].type;if(ge==="lineEnding"||ge==="linePrefix")te--;else break}const ce=te>-1?r.events[te][1].type:null,Ee=ce==="tableHead"||ce==="tableRow"?N:g;return Ee===N&&r.parser.lazy[r.now().line]?l(L):Ee(L)}function g(L){return e.enter("tableHead"),e.enter("tableRow"),m(L)}function m(L){return L===124||(d=!0,c+=1),b(L)}function b(L){return L===null?l(L):Re(L)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),w):l(L):Ke(L)?et(e,b,"whitespace")(L):(c+=1,d&&(d=!1,u+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(L)))}function x(L){return L===null||L===124||yt(L)?(e.exit("data"),b(L)):(e.consume(L),L===92?k:x)}function k(L){return L===92||L===124?(e.consume(L),x):x(L)}function w(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?l(L):(e.enter("tableDelimiterRow"),d=!1,Ke(L)?et(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):E(L))}function E(L){return L===45||L===58?U(L):L===124?(d=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),O):se(L)}function O(L){return Ke(L)?et(e,U,"whitespace")(L):U(L)}function U(L){return L===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),_):L===45?(c+=1,_(L)):L===null||Re(L)?Y(L):se(L)}function _(L){return L===45?(e.enter("tableDelimiterFiller"),F(L)):se(L)}function F(L){return L===45?(e.consume(L),F):L===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),q):(e.exit("tableDelimiterFiller"),q(L))}function q(L){return Ke(L)?et(e,Y,"whitespace")(L):Y(L)}function Y(L){return L===124?E(L):L===null||Re(L)?!d||u!==c?se(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(L)):se(L)}function se(L){return l(L)}function N(L){return e.enter("tableRow"),X(L)}function X(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),X):L===null||Re(L)?(e.exit("tableRow"),i(L)):Ke(L)?et(e,X,"whitespace")(L):(e.enter("data"),ae(L))}function ae(L){return L===null||L===124||yt(L)?(e.exit("data"),X(L)):(e.consume(L),L===92?ee:ae)}function ee(L){return L===92||L===124?(e.consume(L),ae):ae(L)}}function iE(e,i){let l=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,x;const k=new ZT;for(;++l<e.length;){const w=e[l],E=w[1];w[0]==="enter"?E.type==="tableHead"?(p=!1,g!==0&&(yx(k,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},k.add(l,0,[["enter",m,i]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,l+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},k.add(l,0,[["enter",b,i]])),u=E.type==="tableDelimiterRow"?2:b?3:1):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=Sc(k,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=l)):E.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=Sc(k,i,c,u,void 0,x)),c=d,d=[c[1],l,0,0])):E.type==="tableHead"?(p=!0,g=l):E.type==="tableRow"||E.type==="tableDelimiterRow"?(g=l,c[1]!==0?(d[0]=d[1],x=Sc(k,i,c,u,l,x)):d[1]!==0&&(x=Sc(k,i,d,u,l,x)),u=0):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(d[3]=l)}for(g!==0&&yx(k,i,g,m,b),k.consume(i.events),l=-1;++l<i.events.length;){const w=i.events[l];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=eE(i.events,l))}return e}function Sc(e,i,l,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";l[0]!==0&&(c.end=Object.assign({},is(i.events,l[0])),e.add(l[0],0,[["exit",c,i]]));const g=is(i.events,l[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(l[1],0,[["enter",c,i]]),l[2]!==0){const m=is(i.events,l[2]),b=is(i.events,l[3]),x={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(l[2],0,[["enter",x,i]]),r!==2){const k=i.events[l[2]],w=i.events[l[3]];if(k[1].end=Object.assign({},w[1].end),k[1].type="chunkText",k[1].contentType="text",l[3]>l[2]+1){const E=l[2]+1,O=l[3]-l[2]-1;e.add(E,O,[])}}e.add(l[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},is(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function yx(e,i,l,r,u){const c=[],d=is(i.events,l);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),e.add(l+1,0,c)}function is(e,i){const l=e[i],r=l[0]==="enter"?"start":"end";return l[1][r]}const lE={name:"tasklistCheck",tokenize:rE};function aE(){return{text:{91:lE}}}function rE(e,i,l){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?l(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),c)}function c(g){return yt(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):l(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):l(g)}function p(g){return Re(g)?i(g):Ke(g)?e.check({tokenize:sE},i,l)(g):l(g)}}function sE(e,i,l){return et(e,r,"whitespace");function r(u){return u===null?l(u):i(u)}}function oE(e){return jb([RT(),GT(),QT(e),tE(),aE()])}const uE={};function cE(e){const i=this,l=e||uE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(oE(l)),c.push(NT()),d.push(_T(l))}function dE(e){const i=new Map;for(const l of e){if(!l.turnId)continue;if(l.event==="server.wakeup.started"){i.set(l.turnId,"wakeup");continue}if(l.event!=="server.turn")continue;const r=pE(l.data);i.set(l.turnId,typeof r.source=="string"?r.source:"web")}return i}function Io(e,i){return!!(i&&e.includes(i))}function fE(e){var l;if((e==null?void 0:e.status)!=="failed")return null;const i=(l=e.error)==null?void 0:l.trim();return i?{turnId:e.id,content:i,createdAt:e.finishedAt??e.startedAt}:null}function pE(e){return e&&typeof e=="object"?e:{}}const hE=["summary","message","status","instruction","description","reason","error","text"],xx=96,mE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),gE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),yE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),hv=new Set(["item/commandExecution/terminalInteraction"]),xE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function bE(e){if(e.event!=="codex.notification")return!1;const i=Ji(e.data);return typeof i.method=="string"&&hv.has(i.method)}function vE(e){if(gE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||mE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=Ji(e.data),l=typeof i.method=="string"?i.method:"",r=Ji(i.params),u=Ji(r.item),c=typeof u.type=="string"?u.type:"";return!l.startsWith("item/")||hv.has(l)||l.endsWith("/delta")||l.endsWith("/outputDelta")||yE.has(c)?null:l}function mv(e,i){const l=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===l?xE.get(l)??gv(l):r}function ur(e,i=[]){const l=Ji(e),u=[...i,...hE.map(c=>Uo(l[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=xx?u:`${u.slice(0,xx-3)}...`:"查看详情"}function $p(e,i=new Map){const l=Ji(e),r=typeof l.unreadCount=="number"&&l.unreadCount>0?Math.floor(l.unreadCount):0,c=(Array.isArray(l.senderWorkspaceIds)?Array.from(new Set(l.senderWorkspaceIds.filter(g=>typeof g=="string").map(g=>g.trim()).filter(Boolean))):[]).map(g=>i.get(g)??g),d="Messages",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:ur({},[p])}}function wE(e){const i=Ji(e),l=Array.isArray(i.offers)?i.offers.map(Ji).filter(c=>Object.keys(c).length>0):[],r=l.map(c=>{var d;return(d=Uo(c.previewText))==null?void 0:d.trim()}).filter(c=>!!c),u=l.length;return{title:u===1?"New input available":`${u} new inputs available`,detail:ur({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function kE(e){const i=Ji(e),l=Uo(i.actionType)??"",r=Ji(i.payload);return l==="seele_wakeup"||l==="seele_workspace_schedule_wakeup"?{title:(Uo(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:ur(r,[Uo(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:ur(r,[gv(l||"agent action")]),meta:"after turn"}}function gv(e){const l=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return l?l.charAt(0).toUpperCase()+l.slice(1):"System event"}function Uo(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function Ji(e){return e&&typeof e=="object"?e:{}}function Gp(e){const i=Vp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Vp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=TE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=CE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function yv(e,i){const l=vx(e),r=vx(i??"").replace(/\/+$/,"");return r&&(l===r||l.startsWith(`${r}/`))?l.slice(r.length+1)||".":l}function SE(e,i){if(e.length===0)return"File changed";const l=yv(e[0].path,i);return e.length===1?l:`${l} +${e.length-1}`}function jE(e){return e.reduce((i,l)=>({additions:i.additions+l.additions,deletions:i.deletions+l.deletions}),{additions:0,deletions:0})}function CE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:bx(e),deletions:0};if(i==="delete")return{additions:0,deletions:bx(e)};let l=0,r=0;for(const u of e.split(`
79
- `))u.startsWith("+")&&!u.startsWith("+++")?l+=1:u.startsWith("-")&&!u.startsWith("---")&&(r+=1);return{additions:l,deletions:r}}function bx(e){const i=e.split(`
76
+ `,...c.current()});return/^[\t ]/.test(m)&&(m=Go(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,l.options.closeAtx&&(m+=" "+d),g(),p(),m}Zb.peek=nT;function Zb(e){return e.value||""}function nT(){return"<"}Jb.peek=iT;function Jb(e,i,l,r){const u=yh(l),c=u==='"'?"Quote":"Apostrophe",d=l.enter("image");let p=l.enter("label");const g=l.createTracker(r);let m=g.move("![");return m+=g.move(l.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=l.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(l.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=l.enter("destinationRaw"),m+=g.move(l.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=l.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(l.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function iT(){return"!"}ev.peek=lT;function ev(e,i,l,r){const u=e.referenceType,c=l.enter("imageReference");let d=l.enter("label");const p=l.createTracker(r);let g=p.move("![");const m=l.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=l.stack;l.stack=[],d=l.enter("reference");const y=l.safe(l.associationId(e),{before:g,after:"]",...p.current()});return d(),l.stack=b,c(),u==="full"||!m||m!==y?g+=p.move(y+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function lT(){return"!"}tv.peek=aT;function tv(e,i,l){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<l.unsafe.length;){const d=l.unsafe[c],p=l.compilePattern(d);let g;if(d.atBreak)for(;g=p.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function aT(){return"`"}function nv(e,i){const l=oh(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(l===e.url||"mailto:"+l===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}iv.peek=rT;function iv(e,i,l,r){const u=yh(l),c=u==='"'?"Quote":"Apostrophe",d=l.createTracker(r);let p,g;if(nv(e,l)){const b=l.stack;l.stack=[],p=l.enter("autolink");let y=d.move("<");return y+=d.move(l.containerPhrasing(e,{before:y,after:">",...d.current()})),y+=d.move(">"),p(),l.stack=b,y}p=l.enter("link"),g=l.enter("label");let m=d.move("[");return m+=d.move(l.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=l.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(l.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=l.enter("destinationRaw"),m+=d.move(l.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=l.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(l.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function rT(e,i,l){return nv(e,l)?"<":"["}lv.peek=sT;function lv(e,i,l,r){const u=e.referenceType,c=l.enter("linkReference");let d=l.enter("label");const p=l.createTracker(r);let g=p.move("[");const m=l.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=l.stack;l.stack=[],d=l.enter("reference");const y=l.safe(l.associationId(e),{before:g,after:"]",...p.current()});return d(),l.stack=b,c(),u==="full"||!m||m!==y?g+=p.move(y+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function sT(){return"["}function xh(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 oT(e){const i=xh(e),l=e.options.bulletOther;if(!l)return i==="*"?"-":"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(l===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+l+"`) to be different");return l}function uT(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 av(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 cT(e,i,l,r){const u=l.enter("list"),c=l.bulletCurrent;let d=e.ordered?uT(l):xh(l);const p=e.ordered?d==="."?")":".":oT(l);let g=i&&l.bulletLastUsed?d===l.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.children[0])&&l.stack[l.stack.length-1]==="list"&&l.stack[l.stack.length-2]==="listItem"&&l.stack[l.stack.length-3]==="list"&&l.stack[l.stack.length-4]==="listItem"&&l.indexStack[l.indexStack.length-1]===0&&l.indexStack[l.indexStack.length-2]===0&&l.indexStack[l.indexStack.length-3]===0&&(g=!0),av(l)===d&&b){let y=-1;for(;++y<e.children.length;){const k=e.children[y];if(k&&k.type==="listItem"&&k.children&&k.children[0]&&k.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),l.bulletCurrent=d;const m=l.containerFlow(e,r);return l.bulletLastUsed=d,l.bulletCurrent=c,u(),m}function dT(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 fT(e,i,l,r){const u=dT(l);let c=l.bulletCurrent||xh(l);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(l.options.incrementListMarker===!1?0:i.children.indexOf(e))+c);let d=c.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=l.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=l.enter("listItem"),m=l.indentLines(l.containerFlow(e,p.current()),b);return g(),m;function b(y,k,w){return k?(w?"":" ".repeat(d))+y:(w?c:c+" ".repeat(d-c.length))+y}}function pT(e,i,l,r){const u=l.enter("paragraph"),c=l.enter("phrasing"),d=l.containerPhrasing(e,r);return c(),u(),d}const hT=Yc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mT(e,i,l,r){return(e.children.some(function(d){return hT(d)})?l.containerPhrasing:l.containerFlow).call(l,e,r)}function gT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}rv.peek=yT;function rv(e,i,l,r){const u=gT(l),c=l.enter("strong"),d=l.createTracker(r),p=d.move(u+u);let g=d.move(l.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Uc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Go(m)+g.slice(1));const y=g.charCodeAt(g.length-1),k=Uc(r.after.charCodeAt(0),y,u);k.inside&&(g=g.slice(0,-1)+Go(y));const w=d.move(u+u);return c(),l.attentionEncodeSurroundingInfo={after:k.outside,before:b.outside},p+g+w}function yT(e,i,l){return l.options.strong||"*"}function xT(e,i,l,r){return l.safe(e.value,r)}function bT(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 vT(e,i,l){const r=(av(l)+(l.options.ruleSpaces?" ":"")).repeat(bT(l));return l.options.ruleSpaces?r.slice(0,-1):r}const sv={blockquote:GC,break:gx,code:KC,definition:QC,emphasis:Qb,hardBreak:gx,heading:tT,html:Zb,image:Jb,imageReference:ev,inlineCode:tv,link:iv,linkReference:lv,list:cT,listItem:fT,paragraph:pT,root:mT,strong:rv,text:xT,thematicBreak:vT};function wT(){return{enter:{table:kT,tableData:yx,tableHeader:yx,tableRow:ST},exit:{codeText:CT,table:jT,tableData:op,tableHeader:op,tableRow:op}}}function kT(e){const i=e._align;this.enter({type:"table",align:i.map(function(l){return l==="none"?null:l}),children:[]},e),this.data.inTable=!0}function jT(e){this.exit(e),this.data.inTable=void 0}function ST(e){this.enter({type:"tableRow",children:[]},e)}function op(e){this.exit(e)}function yx(e){this.enter({type:"tableCell",children:[]},e)}function CT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,TT));const l=this.stack[this.stack.length-1];l.type,l.value=i,this.exit(e)}function TT(e,i){return i==="|"?i:e}function ET(e){const i=e||{},l=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=l?" ":"|";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:k,table:d,tableCell:g,tableRow:p}};function d(w,T,R,z){return m(b(w,R,z),w.align)}function p(w,T,R,z){const N=y(w,R,z),G=m([N]);return G.slice(0,G.indexOf(`
78
+ `))}function g(w,T,R,z){const N=R.enter("tableCell"),G=R.enter("phrasing"),B=R.containerPhrasing(w,{...z,before:c,after:c});return G(),N(),B}function m(w,T){return HC(w,{align:T,alignDelimiters:r,padding:l,stringLength:u})}function b(w,T,R){const z=w.children;let N=-1;const G=[],B=T.enter("table");for(;++N<z.length;)G[N]=y(z[N],T,R);return B(),G}function y(w,T,R){const z=w.children;let N=-1;const G=[],B=T.enter("tableRow");for(;++N<z.length;)G[N]=g(z[N],w,T,R);return B(),G}function k(w,T,R){let z=sv.inlineCode(w,T,R);return R.stack.includes("tableCell")&&(z=z.replace(/\|/g,"\\$&")),z}}function AT(){return{exit:{taskListCheckValueChecked:xx,taskListCheckValueUnchecked:xx,paragraph:_T}}}function NT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:DT}}}function xx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function _T(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const l=this.stack[this.stack.length-1];l.type;const r=l.children[0];if(r&&r.type==="text"){const u=i.children;let c=-1,d;for(;++c<u.length;){const p=u[c];if(p.type==="paragraph"){d=p;break}}d===l&&(r.value=r.value.slice(1),r.value.length===0?l.children.shift():l.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,l.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function DT(e,i,l,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=l.createTracker(r);c&&p.move(d);let g=sv.listItem(e,i,l,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function RT(){return[cC(),DC(),zC(),wT(),AT()]}function MT(e){return{extensions:[dC(),RC(e),LC(),ET(e),NT()]}}const OT={tokenize:qT,partial:!0},ov={tokenize:HT,partial:!0},uv={tokenize:$T,partial:!0},cv={tokenize:GT,partial:!0},zT={tokenize:VT,partial:!0},dv={name:"wwwAutolink",tokenize:UT,previous:pv},fv={name:"protocolAutolink",tokenize:BT,previous:hv},Dl={name:"emailAutolink",tokenize:IT,previous:mv},el={};function LT(){return{text:el}}let nr=48;for(;nr<123;)el[nr]=Dl,nr++,nr===58?nr=65:nr===91&&(nr=97);el[43]=Dl;el[45]=Dl;el[46]=Dl;el[95]=Dl;el[72]=[Dl,fv];el[104]=[Dl,fv];el[87]=[Dl,dv];el[119]=[Dl,dv];function IT(e,i,l){const r=this;let u,c;return d;function d(y){return!Hp(y)||!mv.call(r,r.previous)||bh(r.events)?l(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(y))}function p(y){return Hp(y)?(e.consume(y),p):y===64?(e.consume(y),g):l(y)}function g(y){return y===46?e.check(zT,b,m)(y):y===45||y===95||pn(y)?(c=!0,e.consume(y),g):b(y)}function m(y){return e.consume(y),u=!0,g}function b(y){return c&&u&&vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(y)):l(y)}}function UT(e,i,l){const r=this;return u;function u(d){return d!==87&&d!==119||!pv.call(r,r.previous)||bh(r.events)?l(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(OT,e.attempt(ov,e.attempt(uv,c),l),l)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function BT(e,i,l){const r=this;let u="",c=!1;return d;function d(y){return(y===72||y===104)&&hv.call(r,r.previous)&&!bh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(y),e.consume(y),p):l(y)}function p(y){if(vn(y)&&u.length<5)return u+=String.fromCodePoint(y),e.consume(y),p;if(y===58){const k=u.toLowerCase();if(k==="http"||k==="https")return e.consume(y),g}return l(y)}function g(y){return y===47?(e.consume(y),c?m:(c=!0,g)):l(y)}function m(y){return y===null||zc(y)||yt(y)||or(y)||Gc(y)?l(y):e.attempt(ov,e.attempt(uv,b),l)(y)}function b(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(y)}}function qT(e,i,l){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):l(d)}function c(d){return d===null?l(d):i(d)}}function HT(e,i,l){let r,u,c;return d;function d(m){return m===46||m===95?e.check(cv,g,p)(m):m===null||yt(m)||or(m)||m!==45&&Gc(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?l(m):i(m)}}function $T(e,i){let l=0,r=0;return u;function u(d){return d===40?(l++,e.consume(d),u):d===41&&r<l?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(cv,i,c)(d):d===null||yt(d)||or(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function GT(e,i,l){return r;function r(p){return p===33||p===34||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===63||p===95||p===126?(e.consume(p),r):p===38?(e.consume(p),c):p===93?(e.consume(p),u):p===60||p===null||yt(p)||or(p)?i(p):l(p)}function u(p){return p===null||p===40||p===91||yt(p)||or(p)?i(p):r(p)}function c(p){return vn(p)?d(p):l(p)}function d(p){return p===59?(e.consume(p),r):vn(p)?(e.consume(p),d):l(p)}}function VT(e,i,l){return r;function r(c){return e.consume(c),u}function u(c){return pn(c)?l(c):i(c)}}function pv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function hv(e){return!vn(e)}function mv(e){return!(e===47||Hp(e))}function Hp(e){return e===43||e===45||e===46||e===95||pn(e)}function bh(e){let i=e.length,l=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){l=!0;break}if(r._gfmAutolinkLiteralWalkedInto){l=!1;break}}return e.length>0&&!l&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),l}const PT={tokenize:JT,partial:!0};function YT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:XT,continuation:{tokenize:QT},exit:ZT}},text:{91:{name:"gfmFootnoteCall",tokenize:KT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:FT,resolveTo:WT}}}}function FT(e,i,l){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const g=r.events[u][1];if(g.type==="labelImage"){d=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return p;function p(g){if(!d||!d._balanced)return l(g);const m=_i(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?l(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function WT(e,i){let l=e.length;for(;l--;)if(e[l][1].type==="labelImage"&&e[l][0]==="enter"){e[l][1];break}e[l+1][1].type="data",e[l+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[l+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[l+3][1].end),end:Object.assign({},e[l+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},p=[e[l+1],e[l+2],["enter",r,i],e[l+3],e[l+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(l,e.length-l+1,...p),e}function KT(e,i,l){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),g}function g(y){return y!==94?l(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(y){if(c>999||y===93&&!d||y===null||y===91||yt(y))return l(y);if(y===93){e.exit("chunkString");const k=e.exit("gfmFootnoteCallString");return u.includes(_i(r.sliceSerialize(k)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):l(y)}return yt(y)||(d=!0),c++,e.consume(y),y===92?b:m}function b(y){return y===91||y===92||y===93?(e.consume(y),c++,m):m(y)}}function XT(e,i,l){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return g;function g(T){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(T){return T===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):l(T)}function b(T){if(d>999||T===93&&!p||T===null||T===91||yt(T))return l(T);if(T===93){e.exit("chunkString");const R=e.exit("gfmFootnoteDefinitionLabelString");return c=_i(r.sliceSerialize(R)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),k}return yt(T)||(p=!0),d++,e.consume(T),T===92?y:b}function y(T){return T===91||T===92||T===93?(e.consume(T),d++,b):b(T)}function k(T){return T===58?(e.enter("definitionMarker"),e.consume(T),e.exit("definitionMarker"),u.includes(c)||u.push(c),et(e,w,"gfmFootnoteDefinitionWhitespace")):l(T)}function w(T){return i(T)}}function QT(e,i,l){return e.check(Po,i,e.attempt(PT,i,l))}function ZT(e){e.exit("gfmFootnoteDefinition")}function JT(e,i,l){const r=this;return et(e,u,"gfmFootnoteDefinitionIndent",5);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(c):l(c)}}function eE(e){let l=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:u};return l==null&&(l=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(d,p){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},y={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},k=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",y,p]],w=p.parser.constructs.insideSpan.null;w&&ni(k,k.length,0,Vc(w,d.slice(m+1,g),p)),ni(k,k.length,0,[["exit",y,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),ni(d,m-1,g-m+3,k),g=m+k.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,p,g){const m=this.previous,b=this.events;let y=0;return k;function k(T){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(T):(d.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const R=rs(m);if(T===126)return y>1?g(T):(d.consume(T),y++,w);if(y<2&&!l)return g(T);const z=d.exit("strikethroughSequenceTemporary"),N=rs(T);return z._open=!N||N===2&&!!R,z._close=!R||R===2&&!!N,p(T)}}}class tE{constructor(){this.map=[]}add(i,l,r){nE(this,i,l,r)}consume(i){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let l=this.map.length;const r=[];for(;l>0;)l-=1,r.push(i.slice(this.map[l][0]+this.map[l][1]),this.map[l][2]),i.length=this.map[l][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 nE(e,i,l,r){let u=0;if(!(l===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===i){e.map[u][1]+=l,e.map[u][2].push(...r);return}u+=1}e.map.push([i,l,r])}}function iE(e,i){let l=!1;const r=[];for(;i<e.length;){const u=e[i];if(l){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"&&(l=!0);i+=1}return r}function lE(){return{flow:{null:{name:"table",tokenize:aE,resolveAll:rE}}}}function aE(e,i,l){const r=this;let u=0,c=0,d;return p;function p(I){let te=r.events.length-1;for(;te>-1;){const ge=r.events[te][1].type;if(ge==="lineEnding"||ge==="linePrefix")te--;else break}const ce=te>-1?r.events[te][1].type:null,Ee=ce==="tableHead"||ce==="tableRow"?_:g;return Ee===_&&r.parser.lazy[r.now().line]?l(I):Ee(I)}function g(I){return e.enter("tableHead"),e.enter("tableRow"),m(I)}function m(I){return I===124||(d=!0,c+=1),b(I)}function b(I){return I===null?l(I):Me(I)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),w):l(I):Ke(I)?et(e,b,"whitespace")(I):(c+=1,d&&(d=!1,u+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),y(I)))}function y(I){return I===null||I===124||yt(I)?(e.exit("data"),b(I)):(e.consume(I),I===92?k:y)}function k(I){return I===92||I===124?(e.consume(I),y):y(I)}function w(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?l(I):(e.enter("tableDelimiterRow"),d=!1,Ke(I)?et(e,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):T(I))}function T(I){return I===45||I===58?z(I):I===124?(d=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),R):se(I)}function R(I){return Ke(I)?et(e,z,"whitespace")(I):z(I)}function z(I){return I===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),N):I===45?(c+=1,N(I)):I===null||Me(I)?P(I):se(I)}function N(I){return I===45?(e.enter("tableDelimiterFiller"),G(I)):se(I)}function G(I){return I===45?(e.consume(I),G):I===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),B):(e.exit("tableDelimiterFiller"),B(I))}function B(I){return Ke(I)?et(e,P,"whitespace")(I):P(I)}function P(I){return I===124?T(I):I===null||Me(I)?!d||u!==c?se(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(I)):se(I)}function se(I){return l(I)}function _(I){return e.enter("tableRow"),X(I)}function X(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),X):I===null||Me(I)?(e.exit("tableRow"),i(I)):Ke(I)?et(e,X,"whitespace")(I):(e.enter("data"),ae(I))}function ae(I){return I===null||I===124||yt(I)?(e.exit("data"),X(I)):(e.consume(I),I===92?ee:ae)}function ee(I){return I===92||I===124?(e.consume(I),ae):ae(I)}}function rE(e,i){let l=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,y;const k=new tE;for(;++l<e.length;){const w=e[l],T=w[1];w[0]==="enter"?T.type==="tableHead"?(p=!1,g!==0&&(bx(k,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},k.add(l,0,[["enter",m,i]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(r=!0,y=void 0,c=[0,0,0,0],d=[0,l+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},k.add(l,0,[["enter",b,i]])),u=T.type==="tableDelimiterRow"?2:b?3:1):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],y=jc(k,i,c,u,void 0,y),c=[0,0,0,0]),d[2]=l)):T.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],y=jc(k,i,c,u,void 0,y)),c=d,d=[c[1],l,0,0])):T.type==="tableHead"?(p=!0,g=l):T.type==="tableRow"||T.type==="tableDelimiterRow"?(g=l,c[1]!==0?(d[0]=d[1],y=jc(k,i,c,u,l,y)):d[1]!==0&&(y=jc(k,i,d,u,l,y)),u=0):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(d[3]=l)}for(g!==0&&bx(k,i,g,m,b),k.consume(i.events),l=-1;++l<i.events.length;){const w=i.events[l];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=iE(i.events,l))}return e}function jc(e,i,l,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";l[0]!==0&&(c.end=Object.assign({},is(i.events,l[0])),e.add(l[0],0,[["exit",c,i]]));const g=is(i.events,l[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(l[1],0,[["enter",c,i]]),l[2]!==0){const m=is(i.events,l[2]),b=is(i.events,l[3]),y={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(l[2],0,[["enter",y,i]]),r!==2){const k=i.events[l[2]],w=i.events[l[3]];if(k[1].end=Object.assign({},w[1].end),k[1].type="chunkText",k[1].contentType="text",l[3]>l[2]+1){const T=l[2]+1,R=l[3]-l[2]-1;e.add(T,R,[])}}e.add(l[3]+1,0,[["exit",y,i]])}return u!==void 0&&(c.end=Object.assign({},is(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function bx(e,i,l,r,u){const c=[],d=is(i.events,l);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),e.add(l+1,0,c)}function is(e,i){const l=e[i],r=l[0]==="enter"?"start":"end";return l[1][r]}const sE={name:"tasklistCheck",tokenize:uE};function oE(){return{text:{91:sE}}}function uE(e,i,l){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?l(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),c)}function c(g){return yt(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):l(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):l(g)}function p(g){return Me(g)?i(g):Ke(g)?e.check({tokenize:cE},i,l)(g):l(g)}}function cE(e,i,l){return et(e,r,"whitespace");function r(u){return u===null?l(u):i(u)}}function dE(e){return Tb([LT(),YT(),eE(e),lE(),oE()])}const fE={};function pE(e){const i=this,l=e||fE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(dE(l)),c.push(RT()),d.push(MT(l))}function hE(e){const i=new Map;for(const l of e){if(!l.turnId)continue;if(l.event==="server.wakeup.started"){i.set(l.turnId,"wakeup");continue}if(l.event!=="server.turn")continue;const r=gE(l.data);i.set(l.turnId,typeof r.source=="string"?r.source:"web")}return i}function Io(e,i){return!!(i&&e.includes(i))}function mE(e){var l;if((e==null?void 0:e.status)!=="failed")return null;const i=(l=e.error)==null?void 0:l.trim();return i?{turnId:e.id,content:i,createdAt:e.finishedAt??e.startedAt}:null}function gE(e){return e&&typeof e=="object"?e:{}}const yE=["summary","message","status","instruction","description","reason","error","text"],vx=96,xE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),bE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),vE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),gv=new Set(["item/commandExecution/terminalInteraction"]),wE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function kE(e){if(e.event!=="codex.notification")return!1;const i=Ji(e.data);return typeof i.method=="string"&&gv.has(i.method)}function jE(e){if(bE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||xE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=Ji(e.data),l=typeof i.method=="string"?i.method:"",r=Ji(i.params),u=Ji(r.item),c=typeof u.type=="string"?u.type:"";return!l.startsWith("item/")||gv.has(l)||l.endsWith("/delta")||l.endsWith("/outputDelta")||vE.has(c)?null:l}function yv(e,i){const l=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===l?wE.get(l)??xv(l):r}function ur(e,i=[]){const l=Ji(e),u=[...i,...yE.map(c=>Uo(l[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=vx?u:`${u.slice(0,vx-3)}...`:"查看详情"}function $p(e,i=new Map){const l=Ji(e),r=typeof l.unreadCount=="number"&&l.unreadCount>0?Math.floor(l.unreadCount):0,c=(Array.isArray(l.senderWorkspaceIds)?Array.from(new Set(l.senderWorkspaceIds.filter(g=>typeof g=="string").map(g=>g.trim()).filter(Boolean))):[]).map(g=>i.get(g)??g),d="Messages",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:ur({},[p])}}function SE(e){const i=Ji(e),l=Array.isArray(i.offers)?i.offers.map(Ji).filter(c=>Object.keys(c).length>0):[],r=l.map(c=>{var d;return(d=Uo(c.previewText))==null?void 0:d.trim()}).filter(c=>!!c),u=l.length;return{title:u===1?"New input available":`${u} new inputs available`,detail:ur({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function CE(e){const i=Ji(e),l=Uo(i.actionType)??"",r=Ji(i.payload);return l==="seele_wakeup"||l==="seele_workspace_schedule_wakeup"?{title:(Uo(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:ur(r,[Uo(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:ur(r,[xv(l||"agent action")]),meta:"after turn"}}function xv(e){const l=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return l?l.charAt(0).toUpperCase()+l.slice(1):"System event"}function Uo(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function Ji(e){return e&&typeof e=="object"?e:{}}function Gp(e){const i=Vp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Vp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=NE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=AE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function bv(e,i){const l=kx(e),r=kx(i??"").replace(/\/+$/,"");return r&&(l===r||l.startsWith(`${r}/`))?l.slice(r.length+1)||".":l}function TE(e,i){if(e.length===0)return"File changed";const l=bv(e[0].path,i);return e.length===1?l:`${l} +${e.length-1}`}function EE(e){return e.reduce((i,l)=>({additions:i.additions+l.additions,deletions:i.deletions+l.deletions}),{additions:0,deletions:0})}function AE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:wx(e),deletions:0};if(i==="delete")return{additions:0,deletions:wx(e)};let l=0,r=0;for(const u of e.split(`
79
+ `))u.startsWith("+")&&!u.startsWith("+++")?l+=1:u.startsWith("-")&&!u.startsWith("---")&&(r+=1);return{additions:l,deletions:r}}function wx(e){const i=e.split(`
80
80
  `).length;return e.endsWith(`
81
- `)?Math.max(0,i-1):i}function TE(e){const i=Vp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function vx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Vp(e){return e&&typeof e=="object"?e:{}}function EE(e,i,l){return l?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}const Yp="seele:authentication-required",xv=12,AE=3e3,Pp="seele.activeWorkspaceId",bv="seele.workspaceOrder",vv="seele.workspaceGroupOrder",wv="seele.workspaceDrafts",kv="seele.collapsedWorkspaceGroups",Sv="seele.sidebarWidth",wx=5,kx=275,NE=236,_E=420,Sx="default",jx=300,DE=3,ME=10,RE=2,OE=13,zE=1.65,LE=20,IE=900;class Zi extends Error{constructor(l,r,u,c){super(l);bc(this,"detail");bc(this,"status");bc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const UE=[{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium (default)"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],BE=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],So={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function pe(e){var l;return`${((l=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:l.content.replace(/\/?$/,"/"))??"/"}api/${e.replace(/^\/+/,"")}`}async function Zt(e,i){const l=await e.text().catch(()=>""),r=`Request failed with ${e.status}`,u=[`${i.method??"GET"} ${i.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),l?`Response: ${l}`:"Response: <empty>"].join(`
82
- `);return new Zi(r,u,e.status,l)}function We(e){return e instanceof Zi?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function ir(e){const i=We(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function ke(e,i){if(!e.ok)throw await Zt(e,i)}function qE(e){return e instanceof Zi&&e.status===410&&e.body.includes('"turn_not_active"')}function HE(e){return e instanceof Zi&&e.status===409&&e.body.includes('"turn_not_running"')}function $E(e){return e instanceof Zi&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Cx(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function GE(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 bh(e){return Math.max(NE,Math.min(_E,Math.round(e)))}function VE(){try{const e=window.localStorage.getItem(Sv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?bh(i):kx}catch{return kx}}function YE(e){try{window.localStorage.setItem(Sv,String(bh(e)))}catch{}}function up(e){jv(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function PE(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function FE(e){if(!e)return;const i=window.getComputedStyle(e),l=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=l*DE+r+u,d=l*ME+r+u;e.style.height="auto";const p=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${p}px`,e.style.overflowY=e.scrollHeight>d?"auto":"hidden"}function WE(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(RE,Math.max(1,i+1))}function KE(e){return Math.ceil(WE(e)*OE*zE+LE)}function jv(e,i){const l=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=l}function XE(e){const i=e.getBoundingClientRect(),l=i.bottom-32,r=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),u=[...r].reverse().find(d=>{const p=d.getBoundingClientRect();return p.top<=l&&p.bottom>=i.top})??r[r.length-1]??null;if(!(u!=null&&u.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const c=u.getBoundingClientRect();return{anchorOffset:l-c.top,anchorTurnId:u.dataset.turnId}}function QE(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(l=>l.dataset.turnId===i)??null:null}function Tx(e,i){jv(e,()=>{const l=QE(e,i.anchorTurnId);if(l&&i.anchorOffset!==null){const u=e.getBoundingClientRect().bottom-32,d=l.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(e.scrollTop+=d);return}e.scrollTop=Math.max(0,e.scrollHeight-i.previousScrollHeight)})}function ZE(e,i){let l=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{l||Tx(e,i)});Tx(e,i),u==null||u.observe(r);const c=window.setTimeout(d,1200);function d(){l||(l=!0,u==null||u.disconnect(),window.clearTimeout(c))}return d}function JE(){try{return window.localStorage.getItem(Pp)}catch{return null}}function cp(e){try{e?window.localStorage.setItem(Pp,e):window.localStorage.removeItem(Pp)}catch{}}function Cv(){try{const e=window.localStorage.getItem(bv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(l=>typeof l=="string"):[]}catch{return[]}}function Tv(){try{const e=window.localStorage.getItem(vv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(l=>typeof l=="string"):[]}catch{return[]}}function Ev(e){try{window.localStorage.setItem(vv,JSON.stringify(e))}catch{}}function _c(e){try{window.localStorage.setItem(bv,JSON.stringify(e))}catch{}}function Av(){try{const e=window.localStorage.getItem(wv),i=e?JSON.parse(e):{};return!i||typeof i!="object"||Array.isArray(i)?{}:Object.fromEntries(Object.entries(i).filter(l=>typeof l[0]=="string"&&typeof l[1]=="string"))}catch{return{}}}function Ex(e){return e?Av()[e]??"":""}function dp(e,i){if(e)try{const l=Av();i?l[e]=i:delete l[e],window.localStorage.setItem(wv,JSON.stringify(l))}catch{}}function eA(){try{const e=window.localStorage.getItem(kv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(l=>typeof l=="string"):[])}catch{return new Set}}function fp(e){try{window.localStorage.setItem(kv,JSON.stringify(Array.from(e)))}catch{}}function jo(e){const i=Cv();if(i.length===0)return e;const l=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=l.get(r.id),d=l.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:0})}function jc(e){const i=Tv();if(i.length===0)return e;const l=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=l.get(r.id),d=l.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 pp(e){const i=new Set(e.map(u=>u.id)),l=Cv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!l.includes(u));_c([...l,...r])}function hp(e){const i=new Set(e.map(u=>u.id)),l=Tv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!l.includes(u));Ev([...l,...r])}function tA(e,i){const l=e.getBoundingClientRect(),r=l.top+l.height/2;return i<r?"before":"after"}function nA(e,i,l,r){if(i===l)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===l);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===l),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function iA(e,i,l){if(i===l)return e;const r=e.findIndex(g=>g.id===i),u=e.findIndex(g=>g.id===l);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(g=>g.id===l);return c.splice(p+1,0,d),c}function lA({authEnabled:e,currentUser:i,onLogout:l}){var Ut,Fa,Hs,Cu;const[r,u]=D.useState(""),[c,d]=D.useState(new Set),[p,g]=D.useState([]),[m,b]=D.useState([]),[x,k]=D.useState(null),[w,E]=D.useState(null),[O,U]=D.useState("simple"),[_,F]=D.useState(null),[q,Y]=D.useState(null),[se,N]=D.useState(null),[X,ae]=D.useState(!1),[ee,L]=D.useState(!1),[te,ce]=D.useState({}),[Ee,ge]=D.useState({}),[ue,G]=D.useState(null),[oe,ye]=D.useState([]),[De,R]=D.useState(null),[A,z]=D.useState(!1),[C,K]=D.useState(null),[me,Z]=D.useState("checking"),[xe,Le]=D.useState(null),[Xe,Ot]=D.useState(!1),[Ft,Ye]=D.useState(null),[Et,Jt]=D.useState(!1),[zt,rn]=D.useState(null),[ze,wt]=D.useState(!1),[sn,wn]=D.useState([]),[gi,yi]=D.useState([]),[Di,Lt]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Ml,ne]=D.useState([]),[he,Me]=D.useState(null),[Ae,Ie]=D.useState(null),[At,mn]=D.useState(!1),[tt,St]=D.useState(null),[on,rt]=D.useState(!1),[Mi,qn]=D.useState(null),[Qc,Ea]=D.useState(!1),[Aa,Rl]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Vt,xi]=D.useState("global"),[ot,Na]=D.useState(null),[Fo,tl]=D.useState(null),[Ol,_a]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Wo,cs]=D.useState({memory:"",items:[]}),[Ko,fr]=D.useState({memory:"",items:[]}),[ds,pr]=D.useState({memory:"",items:[]}),[Xo,kn]=D.useState([]),[bt,Nt]=D.useState(So),[Hn,Ri]=D.useState({description:"",key:"",value:""}),[fs,hr]=D.useState(null),[Qo,bi]=D.useState(()=>new Set),[Da,Oi]=D.useState(!1),[zi,nl]=D.useState(!1),[zl,_t]=D.useState(!1),[vi,mr]=D.useState(null),[Li,Ll]=D.useState(!0),[Zc,il]=D.useState(!1),[Zo,Jo]=D.useState(!1),[$n,ii]=D.useState(null),[wi,Dt]=D.useState(null),[Il,eu]=D.useState(null),[Gn,li]=D.useState(null),[ai,tu]=D.useState(null),[Wt,gr]=D.useState(null),[Ul,ps]=D.useState(()=>new Set),[ki,Bl]=D.useState(null),[yr,Ii]=D.useState(null),[nu,Ma]=D.useState(null),[Vn,ri]=D.useState(null),[hs,Ra]=D.useState(null),[ql,Yn]=D.useState(()=>eA()),[ms,Oa]=D.useState(()=>VE()),[ll,Hl]=D.useState(230),[Ui,gs]=D.useState(()=>Date.now()),ys=D.useRef(null),Bi=D.useRef(null),si=D.useRef(null),xr=D.useRef(null),oi=D.useRef(null),Pn=D.useRef(!0),br=D.useRef(null),qi=D.useRef(null),vr=D.useRef(null),$l=D.useRef(new Set),Gl=D.useRef(!1),xs=D.useRef([]),en=D.useRef(null),un=D.useRef(null),gn=D.useRef(new Map),It=D.useRef(new Map),wr=D.useRef(new Set),Vl=D.useRef(new Map),al=D.useRef(new Map),ui=D.useRef(new Set),rl=D.useRef(null),za=D.useRef(null),bs=D.useRef(!1),vs=D.useRef(!1),Ne=p.find(y=>y.id===x),kr=(Ne==null?void 0:Ne.unreadTurnCount)??0,Si=p.find(y=>y.id===vi),Kt=p.find(y=>y.id===ot),ws=p.find(y=>y.id===ki),La=D.useMemo(()=>{const S=jc(m.length>0?m:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(B=>({id:B.id,title:B.title,conversations:[]})),j=new Map(S.map(B=>[B.id,B])),M=S[0];for(const B of p)(j.get(B.groupId)??M).conversations.push(B);return S.filter(B=>B.conversations.length>0||B.id!=="default")},[p,m]),lt=x!==null?te[x]:null,sl=(lt==null?void 0:lt.messages)??[],Sr=(lt==null?void 0:lt.events)??[],Ia=S_(k_(Sr),x?Ee[x]:null),Ua=uw(Ia),ks=(lt==null?void 0:lt.status)??(Ne==null?void 0:Ne.status)??"idle",Yl=Jp(Ne,ks),Jc=vi!==null?((Ut=te[vi])==null?void 0:Ut.status)??(Si==null?void 0:Si.status)??"idle":"idle",ed=Jp(Si,Jc),Ba=x?It.current.get(x)??null:null,Ss=D.useMemo(()=>new Map(p.map(y=>[y.id,y.title])),[p]),js=D.useMemo(()=>ZA(sl,Sr,(lt==null?void 0:lt.turns)??[],(lt==null?void 0:lt.timelineNodes)??[],Ba,Ss),[Ba,lt==null?void 0:lt.timelineNodes,lt==null?void 0:lt.turns,Sr,sl,Ss]),Cs=D.useMemo(()=>new Set(sl.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[sl]),Ts=x!==null&&Ul.has(x),Es=Ba?(Fa=js.find(y=>Io(y.turnIds,Ba)))==null?void 0:Fa.activity:null,jr=Yl==="running"||Ts?Es&&!u_(Es)?Es:{title:"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,td=!jr&&Yl==="waiting"&&(Ne!=null&&Ne.nextWakeup)?{title:"Scheduled wakeup",detail:$c(Ne.nextWakeup,Ui),createdAt:Ne.nextWakeup.wakeAt,tone:"waiting"}:null,qa=jr??td,nd=D.useMemo(()=>w_(Object.values(te)),[te]),id=eb(C,nd);D.useEffect(()=>{iu(),Fl()},[]),D.useEffect(()=>()=>{oi.current!==null&&window.clearTimeout(oi.current)},[]),D.useEffect(()=>{Cr(!1),Cr(!0);const y=window.setInterval(()=>{Cr(!0)},300*1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{const y=window.setInterval(()=>gs(Date.now()),1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{ui.current=Ul},[Ul]),D.useEffect(()=>{en.current=x},[x]),D.useEffect(()=>{xs.current=p},[p]),D.useEffect(()=>{x&&cp(x)},[x]),D.useLayoutEffect(()=>{if(!x||kr<=0)return;let y=!1;const S=async()=>{if(document.visibilityState==="visible"){g(M=>M.map(B=>B.id===x?{...B,unreadTurnCount:0}:B));try{await r2(x)}catch(M){y||console.error(M)}}},j=()=>void S();return S(),document.addEventListener("visibilitychange",j),()=>{y=!0,document.removeEventListener("visibilitychange",j)}},[x,kr]),D.useEffect(()=>{U("simple"),E(null),x&&(Fn(x),$i(x))},[x]),D.useEffect(()=>{const y=window.setInterval(()=>void lu(),AE);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{u(Ex(x))},[x]),D.useEffect(()=>{!x||ks!=="running"||ui.current.has(x)||Us(x)},[x,ks,Ul]),D.useEffect(()=>{if(!x)return;let y=!1;return R2(x).then(S=>{y||ge(j=>({...j,[x]:S}))}).catch(S=>console.error(S)),()=>{y=!0}},[x]),D.useEffect(()=>{!x&&Vt==="workspace"&&xi("global")},[x,Vt]),D.useEffect(()=>{var y;if(ze){if(!ot&&x){Na(x);return}ot&&!p.some(S=>S.id===ot)&&Na(x??((y=p[0])==null?void 0:y.id)??null)}},[x,p,ze,ot]),D.useEffect(()=>{if(!ze||i.role!=="admin")return;const y=window.setInterval(()=>void Ha(),5e3);return()=>window.clearInterval(y)},[i.role,ze]),D.useEffect(()=>{!ze||Vt!=="workspace"||pr({memory:(Kt==null?void 0:Kt.memory)??"",items:(Kt==null?void 0:Kt.memoryItems)??[]})},[Vt,ze,Kt==null?void 0:Kt.id,Kt==null?void 0:Kt.memory,Kt==null?void 0:Kt.memoryItems]),D.useEffect(()=>{if(!Da)return;x&&Tr(x);const y=S=>{S.key==="Escape"&&Oi(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Da]),D.useEffect(()=>{if(!ze)return;const y=S=>{S.key==="Escape"&&wt(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[ze]),D.useEffect(()=>{var S;if(!zi)return;if(vi&&!p.some(j=>j.id===vi)){mr(x??((S=p[0])==null?void 0:S.id)??null);return}const y=j=>{j.key==="Escape"&&($n?ii(null):nl(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,zi,$n,vi,p]),D.useEffect(()=>{if(!Gn)return;tu(null);const y=S=>{S.key==="Escape"&&li(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Gn]),D.useLayoutEffect(()=>{FE(xr.current)},[r]),D.useLayoutEffect(()=>{const y=si.current;if(!y)return;const S=()=>{const M=y.getBoundingClientRect();Hl(Math.ceil(M.height+44))};S();const j=typeof ResizeObserver>"u"?null:new ResizeObserver(S);return j==null||j.observe(y),window.addEventListener("resize",S),()=>{j==null||j.disconnect(),window.removeEventListener("resize",S)}},[]),D.useLayoutEffect(()=>{var J,be;const y=Bi.current;if(!y)return;const S=br.current!==x;br.current=x,S&&((J=un.current)==null||J.call(un),un.current=null);const j=qi.current;if(j&&j.conversationId===x){(be=un.current)==null||be.call(un),un.current=ZE(y,j),qi.current=null,Pn.current=!1;return}if(!S&&!Pn.current)return;Pn.current=!0,up(y);const M=requestAnimationFrame(()=>up(y)),B=window.setTimeout(()=>up(y),120);return()=>{cancelAnimationFrame(M),window.clearTimeout(B)}},[x,Sr.length,sl.length]);async function As(){var S;const y=Bi.current;y&&(Pn.current=PE(y),!(!x||!((S=lt==null?void 0:lt.history)!=null&&S.hasMoreBefore))&&(lt.loadingOlder||$l.current.has(x)||y.scrollTop>96||await fd(x)))}function ol(y){var j,M;if(y.history)return y.history;const S=((j=y.timelineNodes)==null?void 0:j.filter(B=>B.parentId===null).reduce((B,J)=>B===null||J.timelineAt<B.timelineAt||J.timelineAt===B.timelineAt&&J.sequence<B.sequence?J:B,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((M=y.messages[0])==null?void 0:M.createdAt)??null,oldestTimelineAt:(S==null?void 0:S.timelineAt)??null,oldestTimelineSequence:(S==null?void 0:S.sequence)??null,messageTotal:y.messages.length,eventTotal:y.events.length,loadedMessageCount:y.messages.length,loadedEventCount:y.events.length}}async function ul(y){const S=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(S),tu(y.url)}async function Pl(y,S){await navigator.clipboard.writeText(S),gr(y),oi.current!==null&&window.clearTimeout(oi.current),oi.current=window.setTimeout(()=>{gr(null),oi.current=null},1800)}function Se(y,S,j){const M=Date.now();eu({id:M,tone:y,text:S,detail:j}),window.setTimeout(()=>{eu(B=>(B==null?void 0:B.id)===M?null:B)},j?8e3:2400)}async function iu(){try{const[y,S]=await Promise.all([Vx(),Px()]);Z("connected");const j=jc(S);if(b(j),hp(j),y.length>0){const M=jo(y),B=JE(),J=M.find(be=>be.id===B)??M[0];g(M),pp(M),k(J.id);return}g([]),cp(null),k(null)}catch(y){console.error(y),Z("error")}}async function cn(){const[y,S]=await Promise.all([Vx(),Px()]),j=jo(y),M=jc(S);b(M),hp(M),g(j),pp(j)}async function lu(){if(!Gl.current){Gl.current=!0;try{const y=await n2(),S=xs.current,j=new Set(S.map(Ce=>Ce.id)),M=new Set(y.map(Ce=>Ce.id));if(j.size!==M.size||[...j].some(Ce=>!M.has(Ce))){await cn(),Z("connected");return}const B=en.current,J=B?y.find(Ce=>Ce.id===B)??null:null,be=new Map(y.map(Ce=>[Ce.id,Ce])),Ue=jo(S.map(Ce=>{const je=be.get(Ce.id);return je?{...Ce,status:je.status,statusError:je.statusError,nextWakeup:je.nextWakeup,unreadTurnCount:je.unreadTurnCount,updatedAt:je.updatedAt}:Ce}));g(Ue),pp(Ue),Z("connected"),J&&!ui.current.has(J.id)&&st(J.id,Ce=>({...Ce,status:J.status}))}catch(y){console.error(y),Z("error")}finally{Gl.current=!1}}}async function Fl(){try{const y=await J2();Z("connected"),G(y.version)}catch(y){console.error(y),Z("error")}}async function Cr(y){try{const S=await e_(y);S&&K(j=>eb(j,S))}catch(S){console.error("runtime rate-limit refresh failed",S)}}async function ld(){try{const y=await c2();wn(y),Z("connected")}catch(y){console.error(y),Z("error")}}async function au(y){try{const S=await d2(y);yi(S),Z("connected")}catch(S){console.error(S),yi([]),Z("error")}}async function Tr(y){try{const S=await f2(y);kn(S),Z("connected")}catch(S){console.error(S),kn([]),Z("error")}}async function ru(y){try{const S=await p2();Lt(S),Rl(S),y||(tl(null),_a(S)),Z("connected")}catch(S){console.error(S),Z("error")}}async function Hi(y=!0){try{const S=await k2(y);ne(S.models),Z("connected"),S.refreshing&&window.setTimeout(()=>void Hi(!1),1e3)}catch(S){console.error(S),ne([]),Z("error")}}async function cl(){try{const y=await m2();Me(y.codexVersion),Ie(y.codexReleasedAt),Z("connected")}catch(y){console.error(y),Me(null),Ie(null),Z("error")}}async function Ns(y=!1){y&&Ea(!0);try{const S=await S2(y);St(S.job),qn(S.latest),Z("connected"),S.job&&S.job.status!=="running"&&vr.current===S.job.id&&(vr.current=null,S.job.status==="succeeded"?(await Promise.all([Hi(),cl()]),Se("success",`Codex CLI updated to ${Xc(S.job.currentVersion)}`)):Se("error","Codex CLI update failed",S.job.error??void 0))}catch(S){console.error(S),Z("error")}finally{y&&Ea(!1)}}async function Er(){rt(!0);try{const y=await j2();vr.current=y.id,St(y),Z("connected")}catch(y){console.error(y);const S=We(y);Se("error","Unable to start Codex CLI update",S.detail??S.message)}finally{rt(!1)}}D.useEffect(()=>{if(!At||(tt==null?void 0:tt.status)!=="running")return;const y=window.setInterval(()=>void Ns(),1e3);return()=>window.clearInterval(y)},[At,tt==null?void 0:tt.id,tt==null?void 0:tt.status]);async function Ar(y){try{const S=await C2(y);tl(S),_a(S.effective),Z("connected")}catch(S){console.error(S),tl(null),Z("error")}}async function su(){try{const y=await T2();cs(y),fr(y),Z("connected")}catch(y){console.error(y),Z("error")}}async function _s(){if(i.role!=="admin"){ye([]);return}try{ye(await P_()),Z("connected")}catch(y){console.error(y),Z("error")}}async function Ha(){if(i.role!=="admin"){R(null);return}z(!0);try{R(await h2()),Z("connected")}catch(y){console.error(y),Z("error")}finally{z(!1)}}async function Nr(y=ot){const S=[ld(),ru(y),cl(),Hi(),su()];i.role==="admin"&&(S.push(_s()),S.push(Ha())),y&&(S.push(Ar(y)),S.push(au(y)),S.push(Tr(y))),await Promise.all(S)}function ou(){var S;const y=x??((S=p[0])==null?void 0:S.id)??null;L(!1),Na(y),xi(i.role==="admin"?"global":y?"workspace":"global"),wt(!0),Nr(y)}function uu(){var S;const y=x??((S=p[0])==null?void 0:S.id)??null;Na(y),xi(y?"workspace":"global"),wt(!0),Nr(y)}function cu(){var S;L(!1);const y=x??((S=p[0])==null?void 0:S.id)??null;mr(y),Dt(null),ii(null),nl(!0),y&&ad(y)}async function ad(y){try{const S=await Kv(y);if(!S||S.status!=="running")return;il(!0);const j=await Xv(y,S);Dt(j),await Fn(y),await cn(),j.warmupTurnId&&ea(y,j.warmupTurnId),Se("success","Full-history runtime reset completed")}catch(S){const j=We(S);Se("error","Full-history runtime reset failed",j.message)}finally{il(!1)}}function rd(y){Na(y),xi("workspace"),Ar(y),au(y),Tr(y),Nt(So)}async function sd(y){y.preventDefault();try{if(Vt==="workspace"&&ot){const S=await Kx(ot,L2(Ol,Di));tl(S.settings),_a(S.settings.effective),Dn(S.conversation),Se("success","Workspace settings saved")}else{const S=await _2(Aa);Lt(S),Rl(S),ot&&await Ar(ot),Se("success","Global settings saved")}Z("connected")}catch(S){console.error(S),Z("error");const j=We(S);Se("error","Failed to save runtime settings",j.detail??j.message)}}async function od(){var j;const y=Si;if(!y){Se("error","No workspace selected");return}if((((j=te[y.id])==null?void 0:j.status)??y.status)==="running"){Se("error","Stop the running turn before resetting runtime");return}Jo(!0),Dt(null);try{const M=await Qx(y.id);ii(M),Z("connected")}catch(M){console.error(M),Z("error");const B=We(M);Se("error","Failed to preview runtime reset",B.detail??B.message)}finally{Jo(!1)}}async function yn(y){const S=Si,j=$n;if(!S||!j||j.conversationId!==S.id){Se("error","Reset preview is required");return}il(!0),Dt(null);try{const M=await Xx(S.id,{warmup:Li,previewFingerprint:j.fingerprint,selectedEntryIds:y});Dt(M),ii(null),Z("connected"),await Fn(S.id),await cn(),M.warmupTurnId&&ea(S.id,M.warmupTurnId),Se("success","Runtime thread reset")}catch(M){console.error(M),Z("error");const B=We(M);Se("error","Failed to reset runtime thread",B.detail??B.message)}finally{il(!1)}}async function $a(){var M;const y=Si;if(!y){Se("error","No workspace selected");return}if((((M=te[y.id])==null?void 0:M.status)??y.status)==="running"){Se("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${y.title}" from a blank context?
81
+ `)?Math.max(0,i-1):i}function NE(e){const i=Vp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function kx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Vp(e){return e&&typeof e=="object"?e:{}}function _E(e,i,l){return l?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}const Pp="seele:authentication-required",vv=12,DE=3e3,Yp="seele.activeWorkspaceId",wv="seele.workspaceOrder",kv="seele.workspaceGroupOrder",jv="seele.workspaceDrafts",Sv="seele.collapsedWorkspaceGroups",Cv="seele.sidebarWidth",jx=5,Sx=275,RE=236,ME=420,Cx="default",Tx=300,OE=3,zE=10,LE=2,IE=13,UE=1.65,BE=20,qE=900;class Zi extends Error{constructor(l,r,u,c){super(l);bc(this,"detail");bc(this,"status");bc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const HE=[{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium (default)"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],$E=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],jo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function Tv(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function fe(e){return`${Tv()}api/${e.replace(/^\/+/,"")}`}function vh(e=""){return`${Tv()}${e.replace(/^\/+/,"")}`}async function Vt(e,i){const l=await e.text().catch(()=>""),r=`Request failed with ${e.status}`,u=[`${i.method??"GET"} ${i.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),l?`Response: ${l}`:"Response: <empty>"].join(`
82
+ `);return new Zi(r,u,e.status,l)}function Ve(e){return e instanceof Zi?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function ir(e){const i=Ve(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function ke(e,i){if(!e.ok)throw await Vt(e,i)}function GE(e){return e instanceof Zi&&e.status===410&&e.body.includes('"turn_not_active"')}function VE(e){return e instanceof Zi&&e.status===409&&e.body.includes('"turn_not_running"')}function PE(e){return e instanceof Zi&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Ex(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function YE(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 wh(e){return Math.max(RE,Math.min(ME,Math.round(e)))}function FE(){try{const e=window.localStorage.getItem(Cv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?wh(i):Sx}catch{return Sx}}function WE(e){try{window.localStorage.setItem(Cv,String(wh(e)))}catch{}}function up(e){Ev(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function KE(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function XE(e){if(!e)return;const i=window.getComputedStyle(e),l=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=l*OE+r+u,d=l*zE+r+u;e.style.height="auto";const p=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${p}px`,e.style.overflowY=e.scrollHeight>d?"auto":"hidden"}function QE(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(LE,Math.max(1,i+1))}function ZE(e){return Math.ceil(QE(e)*IE*UE+BE)}function Ev(e,i){const l=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=l}function JE(e){const i=e.getBoundingClientRect(),l=i.bottom-32,r=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),u=[...r].reverse().find(d=>{const p=d.getBoundingClientRect();return p.top<=l&&p.bottom>=i.top})??r[r.length-1]??null;if(!(u!=null&&u.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const c=u.getBoundingClientRect();return{anchorOffset:l-c.top,anchorTurnId:u.dataset.turnId}}function eA(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(l=>l.dataset.turnId===i)??null:null}function Ax(e,i){Ev(e,()=>{const l=eA(e,i.anchorTurnId);if(l&&i.anchorOffset!==null){const u=e.getBoundingClientRect().bottom-32,d=l.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(e.scrollTop+=d);return}e.scrollTop=Math.max(0,e.scrollHeight-i.previousScrollHeight)})}function tA(e,i){let l=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{l||Ax(e,i)});Ax(e,i),u==null||u.observe(r);const c=window.setTimeout(d,1200);function d(){l||(l=!0,u==null||u.disconnect(),window.clearTimeout(c))}return d}function nA(){try{return window.localStorage.getItem(Yp)}catch{return null}}function cp(e){try{e?window.localStorage.setItem(Yp,e):window.localStorage.removeItem(Yp)}catch{}}function Av(){try{const e=window.localStorage.getItem(wv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(l=>typeof l=="string"):[]}catch{return[]}}function Nv(){try{const e=window.localStorage.getItem(kv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(l=>typeof l=="string"):[]}catch{return[]}}function _v(e){try{window.localStorage.setItem(kv,JSON.stringify(e))}catch{}}function _c(e){try{window.localStorage.setItem(wv,JSON.stringify(e))}catch{}}function Dv(){try{const e=window.localStorage.getItem(jv),i=e?JSON.parse(e):{};return!i||typeof i!="object"||Array.isArray(i)?{}:Object.fromEntries(Object.entries(i).filter(l=>typeof l[0]=="string"&&typeof l[1]=="string"))}catch{return{}}}function Nx(e){return e?Dv()[e]??"":""}function dp(e,i){if(e)try{const l=Dv();i?l[e]=i:delete l[e],window.localStorage.setItem(jv,JSON.stringify(l))}catch{}}function iA(){try{const e=window.localStorage.getItem(Sv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(l=>typeof l=="string"):[])}catch{return new Set}}function fp(e){try{window.localStorage.setItem(Sv,JSON.stringify(Array.from(e)))}catch{}}function So(e){const i=Av();if(i.length===0)return e;const l=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=l.get(r.id),d=l.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:0})}function Sc(e){const i=Nv();if(i.length===0)return e;const l=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=l.get(r.id),d=l.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 pp(e){const i=new Set(e.map(u=>u.id)),l=Av().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!l.includes(u));_c([...l,...r])}function hp(e){const i=new Set(e.map(u=>u.id)),l=Nv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!l.includes(u));_v([...l,...r])}function lA(e,i){const l=e.getBoundingClientRect(),r=l.top+l.height/2;return i<r?"before":"after"}function aA(e,i,l,r){if(i===l)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===l);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===l),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function rA(e,i,l){if(i===l)return e;const r=e.findIndex(g=>g.id===i),u=e.findIndex(g=>g.id===l);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(g=>g.id===l);return c.splice(p+1,0,d),c}function sA({authEnabled:e,currentUser:i,onLogout:l}){var Ut,Fa,Hs,Cu;const[r,u]=D.useState(""),[c,d]=D.useState(new Set),[p,g]=D.useState([]),[m,b]=D.useState([]),[y,k]=D.useState(null),[w,T]=D.useState(null),[R,z]=D.useState("simple"),[N,G]=D.useState(null),[B,P]=D.useState(null),[se,_]=D.useState(null),[X,ae]=D.useState(!1),[ee,I]=D.useState(!1),[te,ce]=D.useState({}),[Ee,ge]=D.useState({}),[ue,V]=D.useState(null),[oe,ye]=D.useState([]),[De,O]=D.useState(null),[A,L]=D.useState(!1),[C,K]=D.useState(null),[me,Z]=D.useState("checking"),[xe,Le]=D.useState(null),[Xe,Ot]=D.useState(!1),[Wt,Ye]=D.useState(null),[Et,Jt]=D.useState(!1),[zt,rn]=D.useState(null),[ze,wt]=D.useState(!1),[sn,wn]=D.useState([]),[gi,yi]=D.useState([]),[Di,Lt]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Rl,ne]=D.useState([]),[he,Re]=D.useState(null),[Ae,Ie]=D.useState(null),[At,mn]=D.useState(!1),[tt,jt]=D.useState(null),[on,rt]=D.useState(!1),[Ri,qn]=D.useState(null),[Qc,Ea]=D.useState(!1),[Aa,Ml]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Pt,xi]=D.useState("global"),[ot,Na]=D.useState(null),[Fo,tl]=D.useState(null),[Ol,_a]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Wo,cs]=D.useState({memory:"",items:[]}),[Ko,fr]=D.useState({memory:"",items:[]}),[ds,pr]=D.useState({memory:"",items:[]}),[Xo,kn]=D.useState([]),[bt,Nt]=D.useState(jo),[Hn,Mi]=D.useState({description:"",key:"",value:""}),[fs,hr]=D.useState(null),[Qo,bi]=D.useState(()=>new Set),[Da,Oi]=D.useState(!1),[zi,nl]=D.useState(!1),[zl,_t]=D.useState(!1),[vi,mr]=D.useState(null),[Li,Ll]=D.useState(!0),[Zc,il]=D.useState(!1),[Zo,Jo]=D.useState(!1),[$n,ii]=D.useState(null),[wi,Dt]=D.useState(null),[Il,eu]=D.useState(null),[Gn,li]=D.useState(null),[ai,tu]=D.useState(null),[Kt,gr]=D.useState(null),[Ul,ps]=D.useState(()=>new Set),[ki,Bl]=D.useState(null),[yr,Ii]=D.useState(null),[nu,Ra]=D.useState(null),[Vn,ri]=D.useState(null),[hs,Ma]=D.useState(null),[ql,Pn]=D.useState(()=>iA()),[ms,Oa]=D.useState(()=>FE()),[ll,Hl]=D.useState(230),[Ui,gs]=D.useState(()=>Date.now()),ys=D.useRef(null),Bi=D.useRef(null),si=D.useRef(null),xr=D.useRef(null),oi=D.useRef(null),Yn=D.useRef(!0),br=D.useRef(null),qi=D.useRef(null),vr=D.useRef(null),$l=D.useRef(new Set),Gl=D.useRef(!1),xs=D.useRef([]),en=D.useRef(null),un=D.useRef(null),gn=D.useRef(new Map),It=D.useRef(new Map),wr=D.useRef(new Set),Vl=D.useRef(new Map),al=D.useRef(new Map),ui=D.useRef(new Set),rl=D.useRef(null),za=D.useRef(null),bs=D.useRef(!1),vs=D.useRef(!1),Ne=p.find(x=>x.id===y),kr=(Ne==null?void 0:Ne.unreadTurnCount)??0,ji=p.find(x=>x.id===vi),Xt=p.find(x=>x.id===ot),ws=p.find(x=>x.id===ki),La=D.useMemo(()=>{const j=Sc(m.length>0?m:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(q=>({id:q.id,title:q.title,conversations:[]})),S=new Map(j.map(q=>[q.id,q])),M=j[0];for(const q of p)(S.get(q.groupId)??M).conversations.push(q);return j.filter(q=>q.conversations.length>0||q.id!=="default")},[p,m]),lt=y!==null?te[y]:null,sl=(lt==null?void 0:lt.messages)??[],jr=(lt==null?void 0:lt.events)??[],Ia=T_(C_(jr),y?Ee[y]:null),Ua=fw(Ia),ks=(lt==null?void 0:lt.status)??(Ne==null?void 0:Ne.status)??"idle",Pl=Jp(Ne,ks),Jc=vi!==null?((Ut=te[vi])==null?void 0:Ut.status)??(ji==null?void 0:ji.status)??"idle":"idle",ed=Jp(ji,Jc),Ba=y?It.current.get(y)??null:null,js=D.useMemo(()=>new Map(p.map(x=>[x.id,x.title])),[p]),Ss=D.useMemo(()=>tN(sl,jr,(lt==null?void 0:lt.turns)??[],(lt==null?void 0:lt.timelineNodes)??[],Ba,js),[Ba,lt==null?void 0:lt.timelineNodes,lt==null?void 0:lt.turns,jr,sl,js]),Cs=D.useMemo(()=>new Set(sl.filter(x=>x.origin==="clone"&&x.turnId).map(x=>x.turnId)),[sl]),Ts=y!==null&&Ul.has(y),Es=Ba?(Fa=Ss.find(x=>Io(x.turnIds,Ba)))==null?void 0:Fa.activity:null,Sr=Pl==="running"||Ts?Es&&!f_(Es)?Es:{title:"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,td=!Sr&&Pl==="waiting"&&(Ne!=null&&Ne.nextWakeup)?{title:"Scheduled wakeup",detail:$c(Ne.nextWakeup,Ui),createdAt:Ne.nextWakeup.wakeAt,tone:"waiting"}:null,qa=Sr??td,nd=D.useMemo(()=>S_(Object.values(te)),[te]),id=nb(C,nd);D.useEffect(()=>{iu(),Fl()},[]),D.useEffect(()=>()=>{oi.current!==null&&window.clearTimeout(oi.current)},[]),D.useEffect(()=>{Cr(!1),Cr(!0);const x=window.setInterval(()=>{Cr(!0)},300*1e3);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{const x=window.setInterval(()=>gs(Date.now()),1e3);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{ui.current=Ul},[Ul]),D.useEffect(()=>{en.current=y},[y]),D.useEffect(()=>{xs.current=p},[p]),D.useEffect(()=>{y&&cp(y)},[y]),D.useLayoutEffect(()=>{if(!y||kr<=0)return;let x=!1;const j=async()=>{if(document.visibilityState==="visible"){g(M=>M.map(q=>q.id===y?{...q,unreadTurnCount:0}:q));try{await u2(y)}catch(M){x||console.error(M)}}},S=()=>void j();return j(),document.addEventListener("visibilitychange",S),()=>{x=!0,document.removeEventListener("visibilitychange",S)}},[y,kr]),D.useEffect(()=>{z("simple"),T(null),y&&(Fn(y),$i(y))},[y]),D.useEffect(()=>{const x=window.setInterval(()=>void lu(),DE);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{u(Nx(y))},[y]),D.useEffect(()=>{!y||ks!=="running"||ui.current.has(y)||Us(y)},[y,ks,Ul]),D.useEffect(()=>{if(!y)return;let x=!1;return L2(y).then(j=>{x||ge(S=>({...S,[y]:j}))}).catch(j=>console.error(j)),()=>{x=!0}},[y]),D.useEffect(()=>{!y&&Pt==="workspace"&&xi("global")},[y,Pt]),D.useEffect(()=>{var x;if(ze){if(!ot&&y){Na(y);return}ot&&!p.some(j=>j.id===ot)&&Na(y??((x=p[0])==null?void 0:x.id)??null)}},[y,p,ze,ot]),D.useEffect(()=>{if(!ze||i.role!=="admin")return;const x=window.setInterval(()=>void Ha(),5e3);return()=>window.clearInterval(x)},[i.role,ze]),D.useEffect(()=>{!ze||Pt!=="workspace"||pr({memory:(Xt==null?void 0:Xt.memory)??"",items:(Xt==null?void 0:Xt.memoryItems)??[]})},[Pt,ze,Xt==null?void 0:Xt.id,Xt==null?void 0:Xt.memory,Xt==null?void 0:Xt.memoryItems]),D.useEffect(()=>{if(!Da)return;y&&Tr(y);const x=j=>{j.key==="Escape"&&Oi(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[y,Da]),D.useEffect(()=>{if(!ze)return;const x=j=>{j.key==="Escape"&&wt(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[ze]),D.useEffect(()=>{var j;if(!zi)return;if(vi&&!p.some(S=>S.id===vi)){mr(y??((j=p[0])==null?void 0:j.id)??null);return}const x=S=>{S.key==="Escape"&&($n?ii(null):nl(!1))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[y,zi,$n,vi,p]),D.useEffect(()=>{if(!Gn)return;tu(null);const x=j=>{j.key==="Escape"&&li(null)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[Gn]),D.useLayoutEffect(()=>{XE(xr.current)},[r]),D.useLayoutEffect(()=>{const x=si.current;if(!x)return;const j=()=>{const M=x.getBoundingClientRect();Hl(Math.ceil(M.height+44))};j();const S=typeof ResizeObserver>"u"?null:new ResizeObserver(j);return S==null||S.observe(x),window.addEventListener("resize",j),()=>{S==null||S.disconnect(),window.removeEventListener("resize",j)}},[]),D.useLayoutEffect(()=>{var J,be;const x=Bi.current;if(!x)return;const j=br.current!==y;br.current=y,j&&((J=un.current)==null||J.call(un),un.current=null);const S=qi.current;if(S&&S.conversationId===y){(be=un.current)==null||be.call(un),un.current=tA(x,S),qi.current=null,Yn.current=!1;return}if(!j&&!Yn.current)return;Yn.current=!0,up(x);const M=requestAnimationFrame(()=>up(x)),q=window.setTimeout(()=>up(x),120);return()=>{cancelAnimationFrame(M),window.clearTimeout(q)}},[y,jr.length,sl.length]);async function As(){var j;const x=Bi.current;x&&(Yn.current=KE(x),!(!y||!((j=lt==null?void 0:lt.history)!=null&&j.hasMoreBefore))&&(lt.loadingOlder||$l.current.has(y)||x.scrollTop>96||await fd(y)))}function ol(x){var S,M;if(x.history)return x.history;const j=((S=x.timelineNodes)==null?void 0:S.filter(q=>q.parentId===null).reduce((q,J)=>q===null||J.timelineAt<q.timelineAt||J.timelineAt===q.timelineAt&&J.sequence<q.sequence?J:q,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((M=x.messages[0])==null?void 0:M.createdAt)??null,oldestTimelineAt:(j==null?void 0:j.timelineAt)??null,oldestTimelineSequence:(j==null?void 0:j.sequence)??null,messageTotal:x.messages.length,eventTotal:x.events.length,loadedMessageCount:x.messages.length,loadedEventCount:x.events.length}}async function ul(x){const j=new URL(x.url,window.location.href).toString();await navigator.clipboard.writeText(j),tu(x.url)}async function Yl(x,j){await navigator.clipboard.writeText(j),gr(x),oi.current!==null&&window.clearTimeout(oi.current),oi.current=window.setTimeout(()=>{gr(null),oi.current=null},1800)}function je(x,j,S){const M=Date.now();eu({id:M,tone:x,text:j,detail:S}),window.setTimeout(()=>{eu(q=>(q==null?void 0:q.id)===M?null:q)},S?8e3:2400)}async function iu(){try{const[x,j]=await Promise.all([Yx(),Wx()]);Z("connected");const S=Sc(j);if(b(S),hp(S),x.length>0){const M=So(x),q=nA(),J=M.find(be=>be.id===q)??M[0];g(M),pp(M),k(J.id);return}g([]),cp(null),k(null)}catch(x){console.error(x),Z("error")}}async function cn(){const[x,j]=await Promise.all([Yx(),Wx()]),S=So(x),M=Sc(j);b(M),hp(M),g(S),pp(S)}async function lu(){if(!Gl.current){Gl.current=!0;try{const x=await a2(),j=xs.current,S=new Set(j.map(Ce=>Ce.id)),M=new Set(x.map(Ce=>Ce.id));if(S.size!==M.size||[...S].some(Ce=>!M.has(Ce))){await cn(),Z("connected");return}const q=en.current,J=q?x.find(Ce=>Ce.id===q)??null:null,be=new Map(x.map(Ce=>[Ce.id,Ce])),Ue=So(j.map(Ce=>{const Se=be.get(Ce.id);return Se?{...Ce,status:Se.status,statusError:Se.statusError,nextWakeup:Se.nextWakeup,unreadTurnCount:Se.unreadTurnCount,updatedAt:Se.updatedAt}:Ce}));g(Ue),pp(Ue),Z("connected"),J&&!ui.current.has(J.id)&&st(J.id,Ce=>({...Ce,status:J.status}))}catch(x){console.error(x),Z("error")}finally{Gl.current=!1}}}async function Fl(){try{const x=await n_();Z("connected"),V(x.version)}catch(x){console.error(x),Z("error")}}async function Cr(x){try{const j=await i_(x);j&&K(S=>nb(S,j))}catch(j){console.error("runtime rate-limit refresh failed",j)}}async function ld(){try{const x=await p2();wn(x),Z("connected")}catch(x){console.error(x),Z("error")}}async function au(x){try{const j=await h2(x);yi(j),Z("connected")}catch(j){console.error(j),yi([]),Z("error")}}async function Tr(x){try{const j=await m2(x);kn(j),Z("connected")}catch(j){console.error(j),kn([]),Z("error")}}async function ru(x){try{const j=await g2();Lt(j),Ml(j),x||(tl(null),_a(j)),Z("connected")}catch(j){console.error(j),Z("error")}}async function Hi(x=!0){try{const j=await C2(x);ne(j.models),Z("connected"),j.refreshing&&window.setTimeout(()=>void Hi(!1),1e3)}catch(j){console.error(j),ne([]),Z("error")}}async function cl(){try{const x=await x2();Re(x.codexVersion),Ie(x.codexReleasedAt),Z("connected")}catch(x){console.error(x),Re(null),Ie(null),Z("error")}}async function Ns(x=!1){x&&Ea(!0);try{const j=await T2(x);jt(j.job),qn(j.latest),Z("connected"),j.job&&j.job.status!=="running"&&vr.current===j.job.id&&(vr.current=null,j.job.status==="succeeded"?(await Promise.all([Hi(),cl()]),je("success",`Codex CLI updated to ${Xc(j.job.currentVersion)}`)):je("error","Codex CLI update failed",j.job.error??void 0))}catch(j){console.error(j),Z("error")}finally{x&&Ea(!1)}}async function Er(){rt(!0);try{const x=await E2();vr.current=x.id,jt(x),Z("connected")}catch(x){console.error(x);const j=Ve(x);je("error","Unable to start Codex CLI update",j.detail??j.message)}finally{rt(!1)}}D.useEffect(()=>{if(!At||(tt==null?void 0:tt.status)!=="running")return;const x=window.setInterval(()=>void Ns(),1e3);return()=>window.clearInterval(x)},[At,tt==null?void 0:tt.id,tt==null?void 0:tt.status]);async function Ar(x){try{const j=await A2(x);tl(j),_a(j.effective),Z("connected")}catch(j){console.error(j),tl(null),Z("error")}}async function su(){try{const x=await N2();cs(x),fr(x),Z("connected")}catch(x){console.error(x),Z("error")}}async function _s(){if(i.role!=="admin"){ye([]);return}try{ye(await nD()),Z("connected")}catch(x){console.error(x),Z("error")}}async function Ha(){if(i.role!=="admin"){O(null);return}L(!0);try{O(await y2()),Z("connected")}catch(x){console.error(x),Z("error")}finally{L(!1)}}async function Nr(x=ot){const j=[ld(),ru(x),cl(),Hi(),su()];i.role==="admin"&&(j.push(_s()),j.push(Ha())),x&&(j.push(Ar(x)),j.push(au(x)),j.push(Tr(x))),await Promise.all(j)}function ou(){var j;const x=y??((j=p[0])==null?void 0:j.id)??null;I(!1),Na(x),xi(i.role==="admin"?"global":x?"workspace":"global"),wt(!0),Nr(x)}function uu(){var j;const x=y??((j=p[0])==null?void 0:j.id)??null;Na(x),xi(x?"workspace":"global"),wt(!0),Nr(x)}function cu(){var j;I(!1);const x=y??((j=p[0])==null?void 0:j.id)??null;mr(x),Dt(null),ii(null),nl(!0),x&&ad(x)}async function ad(x){try{const j=await Zv(x);if(!j||j.status!=="running")return;il(!0);const S=await Jv(x,j);Dt(S),await Fn(x),await cn(),S.warmupTurnId&&ea(x,S.warmupTurnId),je("success","Full-history runtime reset completed")}catch(j){const S=Ve(j);je("error","Full-history runtime reset failed",S.message)}finally{il(!1)}}function rd(x){Na(x),xi("workspace"),Ar(x),au(x),Tr(x),Nt(jo)}async function sd(x){x.preventDefault();try{if(Pt==="workspace"&&ot){const j=await Qx(ot,B2(Ol,Di));tl(j.settings),_a(j.settings.effective),Dn(j.conversation),je("success","Workspace settings saved")}else{const j=await M2(Aa);Lt(j),Ml(j),ot&&await Ar(ot),je("success","Global settings saved")}Z("connected")}catch(j){console.error(j),Z("error");const S=Ve(j);je("error","Failed to save runtime settings",S.detail??S.message)}}async function od(){var S;const x=ji;if(!x){je("error","No workspace selected");return}if((((S=te[x.id])==null?void 0:S.status)??x.status)==="running"){je("error","Stop the running turn before resetting runtime");return}Jo(!0),Dt(null);try{const M=await Jx(x.id);ii(M),Z("connected")}catch(M){console.error(M),Z("error");const q=Ve(M);je("error","Failed to preview runtime reset",q.detail??q.message)}finally{Jo(!1)}}async function yn(x){const j=ji,S=$n;if(!j||!S||S.conversationId!==j.id){je("error","Reset preview is required");return}il(!0),Dt(null);try{const M=await Zx(j.id,{warmup:Li,previewFingerprint:S.fingerprint,selectedEntryIds:x});Dt(M),ii(null),Z("connected"),await Fn(j.id),await cn(),M.warmupTurnId&&ea(j.id,M.warmupTurnId),je("success","Runtime thread reset")}catch(M){console.error(M),Z("error");const q=Ve(M);je("error","Failed to reset runtime thread",q.detail??q.message)}finally{il(!1)}}async function $a(){var M;const x=ji;if(!x){je("error","No workspace selected");return}if((((M=te[x.id])==null?void 0:M.status)??x.status)==="running"){je("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${x.title}" from a blank context?
83
83
 
84
- This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){il(!0),Dt(null);try{const B=await Qx(y.id),J=await Xx(y.id,{warmup:!1,previewFingerprint:B.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});Dt(J),ii(null),ot===y.id&&pr({memory:"",items:[]}),Z("connected"),await Fn(y.id),await cn(),Se("success","Workspace started from blank context")}catch(B){console.error(B),Z("error");const J=We(B);Se("error","Failed to clear workspace context",J.detail??J.message)}finally{il(!1)}}}async function du(y){const S=Si,j=$n;if(!S||!j||j.conversationId!==S.id)throw new Error("Reset preview is no longer current.");try{await D2(S.id,{previewFingerprint:j.fingerprint,selectedEntryIds:y}),Z("connected")}catch(M){console.error(M),Z("error");const B=We(M);throw Se("error","Failed to save reset defaults",B.detail??B.message),M}}async function fu(y,S){try{const j=await Kx(y,{[S]:null});tl(j.settings),_a(j.settings.effective),Dn(j.conversation),Z("connected"),Se("success","Workspace override reset")}catch(j){console.error(j),Z("error"),Se("error","Failed to reset workspace override")}}async function pu(y){try{const S=await G2({memory:$2(y),items:y});return cs(S),fr(S),Z("connected"),Se("success","Base memory saved"),S.items}catch(S){throw console.error(S),Z("error"),Se("error","Failed to save memory"),S}}async function hu(y,S){try{const j=await Ac(y,{memoryItems:S});return Dn(j),pr({memory:j.memory,items:j.memoryItems}),Z("connected"),Se("success","Workspace memory saved"),j.memoryItems}catch(j){throw console.error(j),Z("error"),Se("error","Failed to save memory"),j}}async function Ds(y){y.preventDefault();const S=Hn.key.trim();if(S)try{if(Vt==="workspace"&&ot){const j=await Y2(ot,S,Hn.value,Hn.description);yi(M=>[...M.filter(B=>B.key!==j.variable.key),j.variable].sort((B,J)=>B.key.localeCompare(J.key))),Dn(j.conversation)}else{const j=await V2(S,Hn.value,Hn.description);wn(M=>[...M.filter(B=>B.key!==j.key),j].sort((B,J)=>B.key.localeCompare(J.key)))}Se("success",Vt==="workspace"?"Workspace environment saved":"Base environment saved"),Ri({description:"",key:"",value:""}),hr(null),bi(j=>{const M=new Set(j);return M.delete(S),M}),Z("connected")}catch(j){console.error(j),Z("error"),Se("error","Failed to save environment")}}async function ud(y){try{if(Vt==="workspace"&&ot){const S=await K2(ot,y);yi(j=>j.filter(M=>M.key!==y)),Dn(S)}else await W2(y),wn(S=>S.filter(j=>j.key!==y));fs===y&&(Ri({description:"",key:"",value:""}),hr(null),bi(S=>{const j=new Set(S);return j.delete(y),j})),Z("connected"),Se("success",Vt==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(S){console.error(S),Z("error"),Se("error","Failed to delete environment")}}async function Wl(y,S){if(S.preventDefault(),!bt.name.trim()){Se("error","Knowledge name is required");return}const j=I2(bt);try{const M=bt.id?await Q2(y,bt.id,j):await X2(y,j);kn(B=>[...B.filter(J=>J.id!==M.id),M].sort(Zx)),Nt(So),Z("connected"),Se("success","Workspace knowledge saved")}catch(M){console.error(M),Z("error"),Se("error","Failed to save workspace knowledge")}}async function Ms(y,S){try{await Z2(y,S),kn(j=>j.filter(M=>M.id!==S)),bt.id===S&&Nt(So),Z("connected"),Se("success","Workspace knowledge deleted")}catch(j){console.error(j),Z("error"),Se("error","Failed to delete workspace knowledge")}}function Ga(y){xi("workspace"),Nt(U2(y))}function Rs(y){Ri({description:y.description,key:y.key,value:""}),hr(y.key),bi(S=>{const j=new Set(S);return j.delete(y.key),j}),fl(y.key,{preserveTypedValue:!0})}function mu(){const y=fs;Ri({description:"",key:"",value:""}),hr(null),y&&bi(S=>{const j=new Set(S);return j.delete(y),j})}async function dl(y){await fl(y)}async function fl(y,S={}){try{const j=Vt==="workspace"&&ot?await F2(ot,y):await P2(y);Ri(M=>M.key===y&&(!S.preserveTypedValue||M.value.length===0)?{...M,value:j}:M),bi(M=>new Set(M).add(y)),Z("connected")}catch(j){console.error(j),Z("error")}}async function Fn(y){const S=await Ep(y);ju(S)}async function _r(y){try{const S=await Ep(y);gl(S)}catch(S){console.warn("Failed to synchronize timeline before turn stream",S)}}async function $i(y){try{E(await n_(y))}catch(S){console.error(S)}}async function Kl(y){if(x)try{const S=await l_(x,y);E(y==="end"?null:S),y==="end"&&U("simple"),Se("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&Us(x,{waitMs:15e3}),await cn()}catch(S){Se("error","Complex task control failed",We(S).detail??We(S).message)}}async function Gi(y){if(x)try{F(await i_(x,y))}catch(S){const j=We(S);Se("error","Failed to load complex task",j.detail??j.message)}}function gu(){Ne&&N({sourceId:Ne.id,name:`${Ne.title} - Clone`,groupId:Ne.groupId})}async function cd(y){if(y.preventDefault(),!(!se||!se.name.trim())){ae(!0);try{const S=await a_(se.sourceId,se.name.trim(),se.groupId);g(j=>jo([S.conversation,...j])),k(S.conversation.id),N(null),L(!1),Se(S.error?"error":"success",S.error?"Clone created, initialization failed":"Workspace cloned",S.error??void 0)}catch(S){Se("error","Clone failed",We(S).detail??We(S).message)}finally{ae(!1)}}}async function dd(){if(Ne)try{const y=await r_(Ne.id);Dn(y.conversation),Se(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){Se("error","Clone retry failed",We(y).detail??We(y).message)}}async function fd(y,S={}){var Ce,je,Xt;const j=te[y],M=(Ce=j==null?void 0:j.history)==null?void 0:Ce.oldestTimelineAt,B=(je=j==null?void 0:j.history)==null?void 0:je.oldestTimelineSequence,J=M&&B!==null&&B!==void 0?`${M}|${B}`:B==null?(Xt=j==null?void 0:j.history)==null?void 0:Xt.oldestMessageCreatedAt:String(B),be=Bi.current;if(!J||!be)return;if(S.preserveAnchor??!0){const jt=XE(be);qi.current={anchorOffset:jt.anchorOffset,conversationId:y,previousScrollHeight:be.scrollHeight,anchorTurnId:jt.anchorTurnId}}else qi.current=null;$l.current.add(y),st(y,jt=>({...jt,loadingOlder:!0}));try{const jt=await Ep(y,{before:J,limit:xv});na(jt)}catch(jt){console.error(jt),qi.current=null}finally{$l.current.delete(y),st(y,jt=>({...jt,loadingOlder:!1}))}}async function yu(y,S){const j=await t_(y,S||void 0);g(M=>{const B=[j,...M];return _c(B.map(J=>J.id)),B}),k(j.id),L(!1)}function xu(){L(!1),rn({mode:"create",groupId:null,title:""})}function Dr(y){rn({mode:"rename",groupId:y.id,title:y.title})}function Sn(){var y;L(!1),Le({mode:"create",conversationId:null,title:"",groupId:(Ne==null?void 0:Ne.groupId)??((y=m[0])==null?void 0:y.id)})}async function Mr(y){var S;if(y.status!=="running"){Jt(!0);try{await o_(y.id),ce(M=>{const B={...M};return delete B[y.id],B});const j=p.filter(M=>M.id!==y.id);if(_c(j.map(M=>M.id)),dp(y.id,""),g(j),x===y.id){const M=((S=j[0])==null?void 0:S.id)??null;cp(M),k(M)}(xe==null?void 0:xe.conversationId)===y.id&&Vi(),Ye(null),Se("success","Workspace moved to recycle")}catch(j){const M=We(j);Se("error","Failed to move workspace to recycle",M.detail??M.message)}finally{Jt(!1)}}}async function jn(y){if(!(y.id===Sx||!window.confirm(`Delete group "${y.title}"?
84
+ This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){il(!0),Dt(null);try{const q=await Jx(x.id),J=await Zx(x.id,{warmup:!1,previewFingerprint:q.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});Dt(J),ii(null),ot===x.id&&pr({memory:"",items:[]}),Z("connected"),await Fn(x.id),await cn(),je("success","Workspace started from blank context")}catch(q){console.error(q),Z("error");const J=Ve(q);je("error","Failed to clear workspace context",J.detail??J.message)}finally{il(!1)}}}async function du(x){const j=ji,S=$n;if(!j||!S||S.conversationId!==j.id)throw new Error("Reset preview is no longer current.");try{await O2(j.id,{previewFingerprint:S.fingerprint,selectedEntryIds:x}),Z("connected")}catch(M){console.error(M),Z("error");const q=Ve(M);throw je("error","Failed to save reset defaults",q.detail??q.message),M}}async function fu(x,j){try{const S=await Qx(x,{[j]:null});tl(S.settings),_a(S.settings.effective),Dn(S.conversation),Z("connected"),je("success","Workspace override reset")}catch(S){console.error(S),Z("error"),je("error","Failed to reset workspace override")}}async function pu(x){try{const j=await Y2({memory:P2(x),items:x});return cs(j),fr(j),Z("connected"),je("success","Base memory saved"),j.items}catch(j){throw console.error(j),Z("error"),je("error","Failed to save memory"),j}}async function hu(x,j){try{const S=await Ac(x,{memoryItems:j});return Dn(S),pr({memory:S.memory,items:S.memoryItems}),Z("connected"),je("success","Workspace memory saved"),S.memoryItems}catch(S){throw console.error(S),Z("error"),je("error","Failed to save memory"),S}}async function Ds(x){x.preventDefault();const j=Hn.key.trim();if(j)try{if(Pt==="workspace"&&ot){const S=await W2(ot,j,Hn.value,Hn.description);yi(M=>[...M.filter(q=>q.key!==S.variable.key),S.variable].sort((q,J)=>q.key.localeCompare(J.key))),Dn(S.conversation)}else{const S=await F2(j,Hn.value,Hn.description);wn(M=>[...M.filter(q=>q.key!==S.key),S].sort((q,J)=>q.key.localeCompare(J.key)))}je("success",Pt==="workspace"?"Workspace environment saved":"Base environment saved"),Mi({description:"",key:"",value:""}),hr(null),bi(S=>{const M=new Set(S);return M.delete(j),M}),Z("connected")}catch(S){console.error(S),Z("error"),je("error","Failed to save environment")}}async function ud(x){try{if(Pt==="workspace"&&ot){const j=await Z2(ot,x);yi(S=>S.filter(M=>M.key!==x)),Dn(j)}else await Q2(x),wn(j=>j.filter(S=>S.key!==x));fs===x&&(Mi({description:"",key:"",value:""}),hr(null),bi(j=>{const S=new Set(j);return S.delete(x),S})),Z("connected"),je("success",Pt==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(j){console.error(j),Z("error"),je("error","Failed to delete environment")}}async function Wl(x,j){if(j.preventDefault(),!bt.name.trim()){je("error","Knowledge name is required");return}const S=q2(bt);try{const M=bt.id?await e_(x,bt.id,S):await J2(x,S);kn(q=>[...q.filter(J=>J.id!==M.id),M].sort(eb)),Nt(jo),Z("connected"),je("success","Workspace knowledge saved")}catch(M){console.error(M),Z("error"),je("error","Failed to save workspace knowledge")}}async function Rs(x,j){try{await t_(x,j),kn(S=>S.filter(M=>M.id!==j)),bt.id===j&&Nt(jo),Z("connected"),je("success","Workspace knowledge deleted")}catch(S){console.error(S),Z("error"),je("error","Failed to delete workspace knowledge")}}function Ga(x){xi("workspace"),Nt(H2(x))}function Ms(x){Mi({description:x.description,key:x.key,value:""}),hr(x.key),bi(j=>{const S=new Set(j);return S.delete(x.key),S}),fl(x.key,{preserveTypedValue:!0})}function mu(){const x=fs;Mi({description:"",key:"",value:""}),hr(null),x&&bi(j=>{const S=new Set(j);return S.delete(x),S})}async function dl(x){await fl(x)}async function fl(x,j={}){try{const S=Pt==="workspace"&&ot?await X2(ot,x):await K2(x);Mi(M=>M.key===x&&(!j.preserveTypedValue||M.value.length===0)?{...M,value:S}:M),bi(M=>new Set(M).add(x)),Z("connected")}catch(S){console.error(S),Z("error")}}async function Fn(x){const j=await Ep(x);Su(j)}async function _r(x){try{const j=await Ep(x);gl(j)}catch(j){console.warn("Failed to synchronize timeline before turn stream",j)}}async function $i(x){try{T(await a_(x))}catch(j){console.error(j)}}async function Kl(x){if(y)try{const j=await s_(y,x);T(x==="end"?null:j),x==="end"&&z("simple"),je("success",x==="start"?"Complex task started":`Task ${x} accepted`),(x==="start"||x==="resume")&&Us(y,{waitMs:15e3}),await cn()}catch(j){je("error","Complex task control failed",Ve(j).detail??Ve(j).message)}}async function Gi(x){if(y)try{G(await r_(y,x))}catch(j){const S=Ve(j);je("error","Failed to load complex task",S.detail??S.message)}}function gu(){Ne&&_({sourceId:Ne.id,name:`${Ne.title} - Clone`,groupId:Ne.groupId})}async function cd(x){if(x.preventDefault(),!(!se||!se.name.trim())){ae(!0);try{const j=await o_(se.sourceId,se.name.trim(),se.groupId);g(S=>So([j.conversation,...S])),k(j.conversation.id),_(null),I(!1),je(j.error?"error":"success",j.error?"Clone created, initialization failed":"Workspace cloned",j.error??void 0)}catch(j){je("error","Clone failed",Ve(j).detail??Ve(j).message)}finally{ae(!1)}}}async function dd(){if(Ne)try{const x=await u_(Ne.id);Dn(x.conversation),je(x.error?"error":"success",x.error?"Clone retry failed":"Clone initialization restarted",x.error??void 0)}catch(x){je("error","Clone retry failed",Ve(x).detail??Ve(x).message)}}async function fd(x,j={}){var Ce,Se,Qt;const S=te[x],M=(Ce=S==null?void 0:S.history)==null?void 0:Ce.oldestTimelineAt,q=(Se=S==null?void 0:S.history)==null?void 0:Se.oldestTimelineSequence,J=M&&q!==null&&q!==void 0?`${M}|${q}`:q==null?(Qt=S==null?void 0:S.history)==null?void 0:Qt.oldestMessageCreatedAt:String(q),be=Bi.current;if(!J||!be)return;if(j.preserveAnchor??!0){const St=JE(be);qi.current={anchorOffset:St.anchorOffset,conversationId:x,previousScrollHeight:be.scrollHeight,anchorTurnId:St.anchorTurnId}}else qi.current=null;$l.current.add(x),st(x,St=>({...St,loadingOlder:!0}));try{const St=await Ep(x,{before:J,limit:vv});na(St)}catch(St){console.error(St),qi.current=null}finally{$l.current.delete(x),st(x,St=>({...St,loadingOlder:!1}))}}async function yu(x,j){const S=await l_(x,j||void 0);g(M=>{const q=[S,...M];return _c(q.map(J=>J.id)),q}),k(S.id),I(!1)}function xu(){I(!1),rn({mode:"create",groupId:null,title:""})}function Dr(x){rn({mode:"rename",groupId:x.id,title:x.title})}function jn(){var x;I(!1),Le({mode:"create",conversationId:null,title:"",groupId:(Ne==null?void 0:Ne.groupId)??((x=m[0])==null?void 0:x.id)})}async function Rr(x){var j;if(x.status!=="running"){Jt(!0);try{await d_(x.id),ce(M=>{const q={...M};return delete q[x.id],q});const S=p.filter(M=>M.id!==x.id);if(_c(S.map(M=>M.id)),dp(x.id,""),g(S),y===x.id){const M=((j=S[0])==null?void 0:j.id)??null;cp(M),k(M)}(xe==null?void 0:xe.conversationId)===x.id&&Vi(),Ye(null),je("success","Workspace moved to recycle")}catch(S){const M=Ve(S);je("error","Failed to move workspace to recycle",M.detail??M.message)}finally{Jt(!1)}}}async function Sn(x){if(!(x.id===Cx||!window.confirm(`Delete group "${x.title}"?
85
85
 
86
- Workspaces in this group will move to Default.`)))try{const j=await u2(y.id),M=jc(j.groups);b(M),hp(M),g(j.conversations),Yn(B=>{const J=new Set(B);return J.delete(y.id),fp(J),J})}catch(j){console.error(j)}}function Xl(y){Le({mode:"rename",conversationId:y.id,title:y.title})}function Vi(){Ot(!1),Le(null)}function pl(){rn(null)}async function Rr(y,S){const j=S.trim(),M=p.find(J=>J.id===y);if(!M||!j||j===M.title){Vi();return}const B=await Ac(y,{title:j});Dn(B),Vi()}function Os(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function Yi(y){return y instanceof Element&&!!y.closest("input, button")}function bu(y,S){const j=document.elementFromPoint(y,S);return j instanceof HTMLElement?j.closest(".session-item[data-workspace-id]"):null}function Va(y,S){const j=document.elementFromPoint(y,S);return j instanceof HTMLElement?j.closest(".workspace-group[data-group-id]"):null}function Ql(y,S,j){const M=bu(S,j),B=M==null?void 0:M.dataset.workspaceId;if(M&&B&&B!==y){ri({kind:"workspace",id:B,position:tA(M,j)});return}const J=Va(S,j),be=J==null?void 0:J.dataset.groupId;if(!be){ri(null);return}ri({kind:"group",id:be})}function pd(y,S){Yi(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),rl.current={id:S,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function xn(y,S){const j=rl.current;if(!j||j.id!==S||j.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-j.startX,y.clientY-j.startY);if(ki!==S){if(M<wx)return;Bl(S),ri(null)}y.preventDefault(),Ra({x:y.clientX,y:y.clientY}),Ql(S,y.clientX,y.clientY)}async function zs(y,S){var be;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),rl.current=null;const j=ki===S;j&&(bs.current=!0);const M=Vn;if(!j||!M){Bl(null),ri(null),Ra(null);return}const B=p.find(Ue=>Ue.id===S),J=M.kind==="group"?M.id:(be=p.find(Ue=>Ue.id===M.id))==null?void 0:be.groupId;if(!B||!J){Bl(null),ri(null),Ra(null);return}if(g(Ue=>{const Ce=M.kind==="workspace"?nA(Ue.map(je=>je.id===S?{...je,groupId:J}:je),S,M.id,M.position):[...Ue.filter(je=>je.id!==S),{...B,groupId:J}];return _c(Ce.map(je=>je.id)),Ce}),B.groupId!==J)try{const Ue=await Ac(S,{groupId:J});Dn(Ue)}catch(Ue){console.error(Ue),await cn()}Bl(null),ri(null),Ra(null)}function ji(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),rl.current=null,Bl(null),ri(null),Ra(null)}function vu(y,S){y.currentTarget.setPointerCapture(y.pointerId),za.current={id:S,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function Or(y,S){const j=za.current;if(!j||j.id!==S||j.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-j.startX,y.clientY-j.startY);if(yr!==S){if(M<wx)return;Ii(S),Ma(null)}y.preventDefault();const B=Va(y.clientX,y.clientY),J=B==null?void 0:B.dataset.groupId;Ma(J&&J!==S?J:null)}function hl(y,S){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const j=yr===S;j&&(y.preventDefault(),vs.current=!0);const M=nu;j&&M&&b(B=>{const J=iA(B,S,M);return Ev(J.map(be=>be.id)),J}),za.current=null,Ii(null),Ma(null)}function Ls(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),za.current=null,Ii(null),Ma(null)}function wu(y){const S=y.target.value;Le(j=>j&&{...j,title:S})}function Is(y){const S=y.target.value;Le(j=>j&&{...j,groupId:S})}function ku(y){const S=y.target.value;rn(j=>j&&{...j,title:S})}async function Cn(y){if(y.preventDefault(),!xe)return;const S=xe.title.trim();if(S){Ot(!0);try{if(xe.mode==="create"){await yu(S,xe.groupId),Vi();return}xe.conversationId&&await Rr(xe.conversationId,S)}catch(j){console.error(j);const M=We(j);Se("error",xe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",M.detail??M.message)}finally{Ot(!1)}}}function Ci(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),Vi())}async function Zl(y){if(y.preventDefault(),!zt)return;const S=zt.title.trim();if(S)try{if(zt.mode==="rename"){if(!zt.groupId)return;const M=await o2(zt.groupId,{title:S});b(B=>B.map(J=>J.id===M.id?M:J)),pl();return}const j=await s2(S);b(M=>[...M,j]),Yn(M=>{const B=new Set(M);return B.delete(j.id),fp(B),B}),pl()}catch(j){console.error(j)}}function Jl(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),pl())}async function Ya(y){y.preventDefault(),await Wn()}function Tn(y){u(y),dp(x,y)}function tn(y,S){Ex(y).trim()===S&&dp(y,""),x===y&&u(j=>j.trim()===S?"":j)}function dn(y,S){d(j=>{const M=new Set(j);return S?M.add(y):M.delete(y),M})}function En(y){const S=We(y);Se("error","Message was not confirmed",`${S.message}. Your text is still in the composer and can be retried.`)}async function Wn(y={}){const S=r.trim();if(!S)return;if(!x){Sn();return}const j=x,M=It.current.has(j),B=wr.current.has(j);if(B)return;if(Yl==="running"||Ts||M||B){if(y.forceNewTurn&&!w){await Bs(j,S);return}await Su(j,S);return}wr.current.add(j),dn(j,!0);const J=`local-${Date.now()}`;st(j,Ce=>({...Ce,messages:[...Ce.messages,{id:J,role:"user",content:S,createdAt:new Date().toISOString()}],status:"running"})),ci(j,"running"),nn(j,!0);const be=new AbortController;gn.current.set(j,be);let Ue=!1;try{let Ce=null;const je=pe(`conversations/${j}/turns`),Xt=await fetch(je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:S,workMode:O})});if(Xt.ok){const Bt=await Xt.json();if(!Bt.turnId)throw new Error("Turn did not return a turn id");if(Ce=Bt.turnId,(O==="complex"||w)&&($i(j),U("simple")),!Bt.message)throw new Error("Turn did not return the persisted message");An(j,J,Bt.message,Ce),Ue=!0,tn(j,S)}else{const Bt=await GE(Xt);if(Bt){Ce=Bt;const Ei=await Ve(j,Bt,S);if(!Ei.ok)throw await Zt(Ei,{method:"POST",url:pe(`conversations/${j}/turns/${Bt}/steer`)});const Fi=await Ei.json();if(!Fi.message)throw new Error("Steer did not return the persisted message");An(j,J,Fi.message,Bt),Ue=!0,tn(j,S)}else throw await Zt(Xt,{method:"POST",url:je})}if(!Ce)throw await Zt(Xt,{method:"POST",url:je});It.current.set(j,Ce),await ht(j,Ce);const jt=pe(`conversations/${j}/turns/${Ce}/events`),Wa=await fetch(jt,{signal:be.signal});if(!Wa.ok||!Wa.body)throw await Zt(Wa,{method:"GET",url:jt});await _r(j),await Np(Wa.body,Bt=>{const Ei=wp(Bt,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);st(j,Lr=>({...Lr,status:ns(Ei)??Lr.status,events:vp(Lr.events,Ei)}));const Fi=ns(Ei);Fi&&ci(j,Fi)}),await Fn(j),await cn()}catch(Ce){if(kp(Ce))return;Ue||En(Ce);const je=$E(Ce);je&&Se("error","Reset thread required",w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),It.current.has(j)||al.current.delete(j),st(j,Xt=>({...Xt,status:"error",events:[...Xt.events,{id:Xt.events.length+1,event:"client.error",data:je?{message:"Reset thread required",detail:w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:ir(Ce),createdAt:new Date().toISOString()}]})),ci(j,"error"),await cn()}finally{wr.current.delete(j),dn(j,!1),It.current.delete(j),gn.current.get(j)===be&&gn.current.delete(j),nn(j,!1),await Kn(j)}}async function Kn(y){const S=Vl.current.get(y)??[];if(S.length===0)return;const[j,...M]=S;Vl.current.set(y,M),await ea(y,j)}async function Us(y,S={}){if(ui.current.has(y))return;const j=new AbortController;gn.current.set(y,j),nn(y,!0);try{const M=S.waitMs?`?waitMs=${S.waitMs}`:"",B=pe(`conversations/${y}/turns/current/events${M}`),J=await fetch(B,{signal:j.signal});if(!J.ok||!J.body)throw await Zt(J,{method:"GET",url:B});await _r(y),await Np(J.body,be=>{const Ue=wp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Ue.turnId&&!It.current.has(y)&&It.current.set(y,Ue.turnId),st(y,je=>({...je,status:ns(Ue)??je.status,events:vp(je.events,Ue)}));const Ce=ns(Ue);Ce&&ci(y,Ce)}),await Fn(y),await cn()}catch(M){if(!kp(M)){if(HE(M)){await Fn(y),await cn();return}st(y,B=>({...B,status:"error",events:[...B.events,{id:B.events.length+1,event:"client.error",data:ir(M),createdAt:new Date().toISOString()}]}))}}finally{It.current.delete(y),gn.current.get(y)===j&&gn.current.delete(y),nn(y,!1),await Kn(y)}}async function ea(y,S,j={}){if(It.current.has(y)){const B=Vl.current.get(y)??[];B.includes(S)||Vl.current.set(y,[...B,S]);return}const M=new AbortController;gn.current.set(y,M),It.current.set(y,S),nn(y,!0);try{const B=pe(`conversations/${y}/turns/${S}/events`),J=await fetch(B,{signal:M.signal});if(!J.ok||!J.body)throw await Zt(J,{method:"GET",url:B});await _r(y),await Np(J.body,be=>{const Ue=wp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);st(y,je=>({...je,status:ns(Ue)??je.status,events:vp(je.events,Ue)}));const Ce=ns(Ue);Ce&&ci(y,Ce)}),await Fn(y),await cn()}catch(B){if(!kp(B)){if(j.recovered&&qE(B)){await Fn(y),await cn();return}st(y,J=>({...J,status:"error",events:[...J.events,{id:J.events.length+1,event:"client.error",data:ir(B),createdAt:new Date().toISOString()}]}))}}finally{It.current.delete(y),gn.current.get(y)===M&&gn.current.delete(y),nn(y,!1),await Kn(y)}}async function Bs(y,S){dn(y,!0);let j=!1;const M=`local-queued-${Date.now()}`;st(y,B=>({...B,messages:[...B.messages,{id:M,role:"user",content:S,createdAt:new Date().toISOString()}]}));try{const B=pe(`conversations/${y}/turns`),J=await fetch(B,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:S,mode:"queue"})});if(!J.ok)throw await Zt(J,{method:"POST",url:B});const be=await J.json();if(!be.turnId)throw new Error("Queued turn did not return a turn id");if(!be.message)throw new Error("Queued turn did not return the persisted message");An(y,M,be.message,be.turnId),j=!0,tn(y,S),ea(y,be.turnId),await cn(),Se("success",be.queuePosition?`Queued as next turn (${be.queuePosition})`:"Started new turn")}catch(B){j||En(B),st(y,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ir(B),createdAt:new Date().toISOString()}]}))}finally{dn(y,!1)}}async function Su(y,S){dn(y,!0);const j=It.current.get(y),M=`local-steer-${Date.now()}`;if(st(y,B=>({...B,messages:[...B.messages,{id:M,role:"user",content:S,createdAt:new Date().toISOString(),turnId:j??null}],status:"running"})),!j&&wr.current.has(y)){Yt(y,S,M),dn(y,!1);return}try{const B=pe(j?`conversations/${y}/turns/${j}/steer`:`conversations/${y}/turns/steer`),J=await fetch(B,Cx(S));if(!J.ok)throw await Zt(J,{method:"POST",url:B});const be=await J.json();if(!be.message)throw new Error("Steer did not return the persisted message");An(y,M,be.message,j),tn(y,S)}catch(B){En(B),st(y,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ir(B),createdAt:new Date().toISOString()}]}))}finally{dn(y,!1)}}function Yt(y,S,j){const M=al.current.get(y)??[];al.current.set(y,[...M,{message:S,localMessageId:j}])}async function ht(y,S){const j=al.current.get(y)??[];if(j.length!==0){al.current.delete(y);for(const M of j){const B=await Ve(y,S,M.message);if(!B.ok)throw await Zt(B,{method:"POST",url:pe(`conversations/${y}/turns/${S}/steer`)});const J=await B.json();J.message&&An(y,M.localMessageId,J.message,S)}}}async function Ve(y,S,j){return fetch(pe(`conversations/${y}/turns/${S}/steer`),Cx(j))}function An(y,S,j,M){st(y,B=>({...B,messages:yp(B.messages.filter(J=>J.id!==S),[{...j,turnId:M??j.turnId??null}])}))}async function Nn(){var j;if(!x||Yl!=="running"&&!Ts)return;const y=x,S=It.current.get(y);(j=gn.current.get(y))==null||j.abort(),nn(y,!1),st(y,M=>({...M,status:"done",events:[...M.events,{id:M.events.length+1,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),ci(y,"done");try{const M=pe(S?`conversations/${y}/turns/${S}/stop`:`conversations/${y}/turns/interrupt`),B=await fetch(M,{method:"POST"});if(!B.ok&&B.status!==409)throw await Zt(B,{method:"POST",url:M})}catch(M){st(y,B=>({...B,events:[...B.events,{id:B.events.length+1,event:"client.error",data:ir(M),createdAt:new Date().toISOString()}]}))}It.current.delete(y)}async function ml(y,S){if(!x||!y.approvalTurnId||y.approvalRequestId===void 0)return;const j=x;try{const M=pe(`conversations/${j}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),B=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:S})});if(!B.ok)throw await Zt(B,{method:"POST",url:M});st(j,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:S,source:"client"},createdAt:new Date().toISOString()}]}))}catch(M){st(j,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ir(M),createdAt:new Date().toISOString()}]}));const B=We(M);Se("error","Failed to respond to approval",B.detail??B.message)}}async function _n(y,S,j){const M=x,B=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!M||!B)return!1;try{const J=pe(`conversations/${M}/workspace-change-proposals/${encodeURIComponent(B)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:S,payload:S==="accept"?j??y.workspaceChangePayload:void 0})});if(!be.ok)throw await Zt(be,{method:"POST",url:J});const Ue=await be.json();return Dn(Ue.conversation),st(M,Ce=>({...Ce,events:[...Ce.events,{id:`${y.id}:${S}`,event:"server.workspace_change.decision",data:{proposalId:B,changeType:y.workspaceChangeType??"responsibility",decision:S,payload:S==="accept"?j??y.workspaceChangePayload:null},createdAt:new Date().toISOString()}]})),Se("success",S==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(J){console.error(J);const be=We(J);return Se("error","Failed to respond to workspace change proposal",be.detail??be.message),!1}}async function ta(y,S,j){const M=x;if(!(!M||!y.knowledgeProposalId))try{let B;if(S==="accept")try{B=JSON.parse(j??y.body)}catch{Se("error","Knowledge proposal JSON is invalid");return}const J=pe(`conversations/${M}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:S,knowledge:B})});if(!be.ok)throw await Zt(be,{method:"POST",url:J});const Ue=await be.json();kn([...Ue.items??[]].sort(Zx)),st(M,Ce=>({...Ce,events:[...Ce.events,{id:`${y.id}:${S}`,event:"server.knowledge.decision",data:{proposalId:y.knowledgeProposalId,decision:S,knowledge:S==="accept"?Ue.item:null},createdAt:new Date().toISOString()}]})),Se("success",S==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(B){console.error(B);const J=We(B);Se("error","Failed to respond to knowledge proposal",J.detail??J.message)}}function ju(y){ce(S=>{const j=S[y.id],M=y.events.map(B=>({id:B.id,turnId:B.turnId,seq:B.seq,event:B.event,data:B.data,createdAt:B.createdAt}));return{...S,[y.id]:{messages:y.messages,events:Cc(M,(j==null?void 0:j.events)??[]),timelineNodes:bp(y.timelineNodes??[],(j==null?void 0:j.timelineNodes)??[]),turns:xp(y.turns??[],(j==null?void 0:j.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:ol(y),loadingOlder:!1,fullEventTurnIds:(j==null?void 0:j.fullEventTurnIds)??new Set,loadingEventTurnIds:(j==null?void 0:j.loadingEventTurnIds)??new Set}}})}function na(y){const S=ol(y);st(y.id,j=>{var M,B,J;return{...j,messages:yp(y.messages,j.messages),timelineNodes:bp(y.timelineNodes??[],j.timelineNodes),turns:xp(y.turns??[],j.turns),events:Cc(y.events.map(be=>({id:be.id,turnId:be.turnId,seq:be.seq,event:be.event,data:be.data,createdAt:be.createdAt})),j.events),contextVersions:(((M=y.contextVersions)==null?void 0:M.length)??0)>0?y.contextVersions??[]:j.contextVersions,history:{...S,loadedMessageCount:S.loadedMessageCount+(((B=j.history)==null?void 0:B.loadedMessageCount)??j.messages.length),loadedEventCount:S.loadedEventCount+(((J=j.history)==null?void 0:J.loadedEventCount)??j.events.length)},loadingOlder:!1}})}function gl(y){const S=ol(y),j=y.events.map(M=>({id:M.id,turnId:M.turnId,seq:M.seq,event:M.event,data:M.data,createdAt:M.createdAt}));st(y.id,M=>{var B,J,be;return{...M,messages:yp(M.messages,y.messages),timelineNodes:bp(M.timelineNodes,y.timelineNodes??[]),turns:xp(M.turns,y.turns??[]),events:Cc(j,M.events),contextVersions:(((B=y.contextVersions)==null?void 0:B.length)??0)>0?y.contextVersions??[]:M.contextVersions,status:y.status,history:{...M.history??S,messageTotal:S.messageTotal,eventTotal:S.eventTotal,loadedMessageCount:Math.max(((J=M.history)==null?void 0:J.loadedMessageCount)??M.messages.length,M.messages.length,y.messages.length),loadedEventCount:Math.max(((be=M.history)==null?void 0:be.loadedEventCount)??M.events.length,M.events.length,y.events.length)},loadingOlder:!1}})}function st(y,S){ce(j=>{const M=j[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...j,[y]:S(M)}})}function ci(y,S){g(j=>j.map(M=>M.id===y?{...M,status:S,updatedAt:new Date().toISOString()}:M))}function Dn(y){g(S=>jo(S.map(j=>j.id===y.id?{...j,...y}:j)))}async function yl(y,S){const j=S.filter(M=>{const B=te[y];return B&&!B.fullEventTurnIds.has(M)&&!B.loadingEventTurnIds.has(M)});if(j.length!==0){st(y,M=>{const B=new Set(M.loadingEventTurnIds);for(const J of j)B.add(J);return{...M,loadingEventTurnIds:B}});try{const M=await Promise.all(j.map(B=>s_(y,B)));st(y,B=>{const J=new Set(B.fullEventTurnIds),be=new Set(B.loadingEventTurnIds),Ue=M.flatMap((Ce,je)=>{const Xt=j[je];return J.add(Xt),be.delete(Xt),Ce.map(jt=>({id:jt.id,turnId:jt.turnId,seq:jt.seq,event:jt.event,data:jt.data,createdAt:jt.createdAt}))});return{...B,events:Cc(B.events,Ue),fullEventTurnIds:J,loadingEventTurnIds:be}})}catch(M){console.error(M),st(y,B=>{const J=new Set(B.loadingEventTurnIds);for(const be of j)J.delete(be);return{...B,loadingEventTurnIds:J}}),Se("error","Failed to load process details")}}}function nn(y,S){const j=new Set(ui.current);S?j.add(y):j.delete(y),ui.current=j,ps(M=>{const B=new Set(M);return S?B.add(y):B.delete(y),B})}function Pi(y){y.key!=="Enter"||!y.metaKey&&!y.ctrlKey||y.nativeEvent.isComposing||(y.preventDefault(),Wn({forceNewTurn:y.shiftKey}))}function Ti(y){Yn(S=>{const j=new Set(S);return j.has(y)?j.delete(y):j.add(y),fp(j),j})}function qs(y){var S;return EE(y.status,(S=y.nextWakeup)==null?void 0:S.status,Ul.has(y.id))}function Pa(y){var M;const S=(M=ys.current)==null?void 0:M.getBoundingClientRect(),j=S?y-S.left:y;return bh(j)}function ia(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),Oa(Pa(y.clientX))}function zr(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),Oa(Pa(y.clientX)))}function xl(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const S=Pa(y.clientX);Oa(S),YE(S)}return s.jsxs("main",{className:`shell${ee?" mobile-sidebar-open":""}`,ref:ys,style:{"--sidebar-width":`${ms}px`},children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),ue?s.jsxs("span",{children:["v",ue]}):null,s.jsx("span",{"aria-label":sb(me),className:`backend-status ${me}`,"data-label":sb(me)})]}),s.jsxs("div",{className:"sidebar-title-row",children:[s.jsx("h2",{children:"Workspaces"}),e?s.jsx("button",{"aria-label":`Sign out ${i.username}`,className:"sign-out-button",onClick:l,title:`Sign out ${i.username}`,type:"button",children:"Sign out"}):null]})]}),s.jsxs("div",{className:"sidebar-header-actions",children:[s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>L(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:Sn,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:La.map(y=>s.jsxs("section",{className:["workspace-group",yr===y.id?"dragging":"",nu===y.id?"drop-after":"",(Vn==null?void 0:Vn.kind)==="group"&&Vn.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!ql.has(y.id),className:"workspace-group-toggle",onClick:S=>{if(vs.current){S.preventDefault(),vs.current=!1;return}Ti(y.id)},onDoubleClick:S=>{S.preventDefault(),S.stopPropagation(),Dr(y)},onPointerCancel:Ls,onPointerDown:S=>vu(S,y.id),onPointerMove:S=>Or(S,y.id),onPointerUp:S=>hl(S,y.id),type:"button",children:[s.jsx("span",{className:ql.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:S=>{S.preventDefault(),S.stopPropagation(),Dr(y)},title:"Double-click to rename",children:y.title})]}),y.id!==Sx?s.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:S=>{S.stopPropagation(),jn(y)},title:"Delete group",type:"button",children:"×"}):null]}),ql.has(y.id)?null:s.jsx("div",{className:"workspace-group-items",children:y.conversations.map(S=>{const j=qs(S);return s.jsxs("div",{className:["session-item",S.id===x?"active":"",S.id===ki?"dragging":"",(Vn==null?void 0:Vn.kind)==="workspace"&&Vn.id===S.id?`drop-${Vn.position}`:""].filter(Boolean).join(" "),"data-workspace-id":S.id,onClick:M=>{if(bs.current){M.preventDefault(),bs.current=!1;return}k(S.id),L(!1)},onDoubleClick:M=>{Yi(M.target)||(M.preventDefault(),Xl(S))},onKeyDown:M=>{Os(M.target)||M.key==="Enter"&&(k(S.id),L(!1))},onPointerCancel:ji,onPointerDown:M=>pd(M,S.id),onPointerMove:M=>xn(M,S.id),onPointerUp:M=>zs(M,S.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":Oc(j,S.nextWakeup,Ui),className:`session-status ${j}`,title:Oc(j,S.nextWakeup,Ui)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:S.title}),j==="waiting"&&S.nextWakeup?s.jsx("span",{className:"session-countdown",title:Oc(j,S.nextWakeup,Ui),children:$c(S.nextWakeup,Ui)}):null,S.unreadTurnCount>0?s.jsx("span",{"aria-label":`${S.unreadTurnCount} unread turns`,className:"session-unread",title:`${S.unreadTurnCount} unread turns`,children:S.unreadTurnCount>99?"99+":S.unreadTurnCount}):null,j!=="running"?s.jsx("button",{"aria-label":`Delete ${S.title}`,className:"session-delete",onClick:M=>{M.stopPropagation(),Ye(S)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:S.workspacePath,children:["workspaces/",as(S.id)]})]},S.id)})})]},y.id))}),s.jsx("footer",{className:"sidebar-footer",children:s.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[s.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:ou,type:"button",children:s.jsx(Hx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:xu,type:"button",children:s.jsx(WN,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{_t(!0),L(!1)},type:"button",children:s.jsx(Dc,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:cu,type:"button",children:s.jsx(KN,{})}),s.jsx(XA,{usage:id})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>L(!1),tabIndex:ee?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:ia,onPointerMove:zr,onPointerUp:xl,role:"separator",tabIndex:0}),ws&&hs?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${hs.x+12}px, ${hs.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:ws.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",as(ws.id)]})]}):null,xe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Ci,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Ci,onSubmit:y=>void Cn(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:wu,onKeyDown:Ci,value:xe.title}),xe.mode==="create"?s.jsxs(s.Fragment,{children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),s.jsx("select",{id:"workspace-group",onChange:Is,onKeyDown:Ci,value:xe.groupId??((Hs=m[0])==null?void 0:Hs.id)??"",children:m.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:Vi,children:"Cancel"}),s.jsx("button",{disabled:Xe,type:"submit",children:Xe?"Saving...":xe.mode==="create"?"Create":"Save"})]})]})}):null,zt?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Jl,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Jl,onSubmit:y=>void Zl(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),s.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:ku,onKeyDown:Jl,value:zt.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:pl,children:"Cancel"}),s.jsx("button",{type:"submit",children:zt.mode==="create"?"Create":"Save"})]})]})}):null,ze?s.jsx(cA,{currentUser:i,conversations:p,editingEnvironmentKey:fs,environmentDraft:Hn,globalEnvironment:sn,workspaceEnvironment:gi,memorySettings:Wo,memorySettingsDraft:Ko,workspaceMemoryDraft:ds,runtimeSettings:Di,runtimeModels:Ml,runtimeCodexVersion:he,runtimeCodexReleasedAt:Ae,runtimeCodexUpdating:(tt==null?void 0:tt.status)==="running",runtimeSettingsDraft:Aa,runtimeSettingsScope:Vt,settingsWorkspace:Kt,settingsWorkspaceId:ot,systemDiagnostics:De,systemDiagnosticsLoading:A,workspaceGroups:La,workspaceRuntimeSettings:Fo,workspaceRuntimeSettingsDraft:Ol,managedUsers:oe,onCancelEnvironmentEdit:mu,onClose:()=>wt(!1),onCreateUser:async y=>{const S=await F_(y);ye(j=>[...j,S]),Se("success","User created")},onDeleteUser:async y=>{await K_(y),ye(S=>S.filter(j=>j.id!==y)),Se("success","User deleted")},onDeleteEnvironment:y=>void ud(y),onDraftChange:Ri,onEditEnvironment:Rs,onRevealEnvironmentValue:y=>void dl(y),onSaveBaseMemoryItems:y=>pu(y),onSaveResponsibility:async(y,S)=>{try{const j=await Ac(y,{responsibility:S});return Dn(j),Z("connected"),Se("success","Workspace responsibility saved"),j.responsibility}catch(j){throw console.error(j),Z("error"),Se("error","Failed to save workspace responsibility"),j}},onSaveWorkspaceMemoryItems:y=>ot?hu(ot,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:Rl,onGlobalSettingsImported:async()=>{await Nr(ot),Se("success","Global settings imported")},onCodexAccountSwitched:async()=>{await Promise.all([Cr(!0),Hi(!0),cl()]),Se("success","Codex account switched")},onUpdateCodexCli:()=>{mn(!0),Ns(!0)},onRuntimeScopeChange:xi,onSettingsWorkspaceChange:rd,onSubmitRuntimeSettings:y=>void sd(y),onWorkspaceRuntimeDraftChange:_a,onWorkspaceRuntimeReset:y=>ot?void fu(ot,y):void 0,revealedEnvironmentKeys:Qo,onSubmitEnvironment:y=>void Ds(y),onRefreshSystemDiagnostics:()=>void Ha(),onUpdateUser:async(y,S)=>{const j=await W_(y,S);ye(M=>M.map(B=>B.id===j.id?j:B)),Se("success","User updated")}}):null,At?s.jsx(uA,{currentReleasedAt:Ae,currentVersion:he,job:tt,latest:Mi,latestChecking:Qc,starting:on,onClose:()=>mn(!1),onRefresh:()=>void Ns(),onStart:()=>void Er()}):null,Da&&Ne?s.jsx(aA,{conversation:Ne,clockNow:Ui,knowledgeDraft:bt,workspaceKnowledge:Xo,tokenUsage:Ia,onCancelKnowledgeEdit:()=>Nt(So),onDeleteKnowledge:y=>void Ms(Ne.id,y),onEditKnowledge:Ga,onKnowledgeDraftChange:Nt,onSubmitKnowledge:y=>void Wl(Ne.id,y),onClose:()=>Oi(!1)}):null,zl?s.jsx(rA,{conversations:p,onClose:()=>_t(!1),workspaceGroups:La}):null,zi?s.jsx(sA,{busy:Zc,conversation:Si??null,conversationId:vi,preview:($n==null?void 0:$n.conversationId)===vi?$n:null,previewLoading:Zo,result:wi,status:ed,warmup:Li,workspaceGroups:La,onClose:()=>nl(!1),onCancelResetPreview:()=>ii(null),onPreviewReset:()=>void od(),onStartBlankContext:()=>void $a(),onResetRuntime:y=>void yn(y),onSaveResetSelection:du,onWorkspaceChange:y=>{mr(y),Dt(null),ii(null)},onWarmupChange:Ll}):null,se?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!X&&N(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:cd,onMouseDown:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>N(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:se.name,onChange:y=>N(S=>S&&{...S,name:y.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:se.groupId,onChange:y=>N(S=>S&&{...S,groupId:y.target.value}),children:La.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:X,onClick:()=>N(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:X||!se.name.trim(),type:"submit",children:X?"Cloning...":"Clone"})]})]})}):null,_?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>F(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:_.title}),s.jsxs("p",{children:[rb(_.status),_.startedAt&&_.finishedAt?` · ${H_(_.startedAt,_.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>F(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:_.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:_.status==="completed"?"Final plan":"Current plan"}),_.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:Sa(_.currentPlan.planMarkdown,Ne)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:_.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:_.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:_.startedAt?$e(_.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:_.finishedAt?$e(_.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>F(null),type:"button",children:"Close"})})]})}):null,q?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>Y(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:q.title}),s.jsx("p",{children:$e(q.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>Y(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(Ro,{content:q.fullDetail??q.detail??"No additional details.",conversation:Ne,streaming:!1,onPreviewArtifact:li,onCopyArtifactUrl:ul,copiedArtifactUrl:ai})}),s.jsxs("footer",{children:[q.linkedTaskId?s.jsx("button",{onClick:()=>{const y=q.linkedTaskId;Y(null),Gi(y)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>Y(null),type:"button",children:"Close"})]})]})}):null,Ft?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Et||Ye(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Move Workspace to Recycle"}),s.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:Et,onClick:()=>Ye(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:Ft.title})," to recycle?"]}),s.jsx("code",{children:Ft.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Et,onClick:()=>Ye(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Et,onClick:()=>void Mr(Ft),type:"button",children:Et?"Moving...":"Move to recycle"})]})]})}):null,Il?s.jsxs("div",{className:`app-toast ${Il.tone}`,role:"status",children:[s.jsx("strong",{children:Il.text}),Il.detail?s.jsx("pre",{children:Il.detail}):null]}):null,s.jsxs("section",{className:"conversation",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-main",children:[s.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>L(!0),title:"Workspaces",type:"button",children:s.jsx(FN,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Ne==null?void 0:Ne.title)??"New workspace"})}),Ne?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",as(Ne.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Ne?s.jsxs(s.Fragment,{children:[Ne.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:cu,title:`当前 Thread 工具集已过期(${Ne.threadCapabilityVersion} / ${Ne.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(Fv,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:gu,title:"Clone workspace",type:"button",children:s.jsx(PN,{})}),s.jsxs("button",{className:`context-button has-usage ${Eh(Ua??0)}`,onClick:()=>Oi(!0),style:{"--context-usage":`${Kc(Ua??0)}%`},title:Ia&&Ua!==null?`Context ${Math.round(Ua)}% · ${Un(Ia.totalTokens)} / ${Rc(Ia.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(Ua??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:uu,title:"Workspace settings",type:"button",children:s.jsx(Hx,{})})]}):null})]}),w?s.jsxs("section",{className:`complex-task-bar ${w.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void Gi(w.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:w.title}),s.jsx("span",{className:"complex-task-state",children:rb(w.status)}),s.jsx("span",{className:"complex-task-duration",children:q_(w,Ui)})]}),s.jsxs("div",{className:"complex-task-actions",children:[_p(w.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!w.objective||!w.currentPlan,onClick:()=>void Kl("start"),title:w.objective&&w.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,w.status==="active"?s.jsx("button",{onClick:()=>void Kl("pause"),type:"button",children:"Pause"}):null,_p(w.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void Kl("resume"),type:"button",children:"Resume"}):null,_p(w.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void Kl("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void Kl("end"),type:"button",children:"End task"})]})]}):null,(Ne==null?void 0:Ne.status)==="initialization_failed"&&Ne.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:Ne.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void dd(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void As(),ref:Bi,style:{scrollPaddingBottom:ll},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:ll},children:[sl.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("h2",{children:"Start a workspace"})}):null,s.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[Ne!=null&&Ne.cloneLineage&&Cs.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Ne.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",$e(Ne.cloneLineage.snapshotAt)," · ",Ne.cloneLineage.importedMessageCount," messages"]})]}):null,(Cu=lt==null?void 0:lt.history)!=null&&Cu.hasMoreBefore?s.jsx("div",{className:"history-loader",children:lt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,js.map((y,S)=>{var be,Ue,Ce;const j=((be=y.user)==null?void 0:be.type)==="system",M=y.turnIds.some(je=>Cs.has(je)),B=js[S+1],J=M&&(!B||!B.turnIds.some(je=>Cs.has(je)));return s.jsxs(D.Fragment,{children:[s.jsxs("section",{className:`turn-group${M?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?s.jsxs("div",{className:`turn-panel ${j?"system-turn":"user-turn"}`,children:[_o(y.user,Ne,li,ul,ai,ml,_n,ta,Gi,Y),s.jsx(Do,{copied:Wt===`${j?"system":"user"}-${y.id}-bottom`,content:Mo(y.user),id:`${j?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:Pl})]}):null,y.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(je=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),_o(je,Ne,li,ul,ai,ml,_n,ta,Gi,Y),s.jsx(Do,{copied:Wt===`user-${je.id}-bottom`,content:Mo(je),id:`user-${je.id}-bottom`,timestamp:je.createdAt,variant:"outside",onCopy:Pl})]},je.id))}):null,(Ue=y.acceptedSystemInputs)==null?void 0:Ue.map(je=>s.jsxs("div",{className:"turn-panel system-turn",children:[_o(je,Ne,li,ul,ai,ml,_n,ta,Gi,Y),s.jsx(Do,{copied:Wt===`system-${je.id}-bottom`,content:Mo(je),id:`system-${je.id}-bottom`,timestamp:je.createdAt,variant:"outside",onCopy:Pl})]},je.id)),y.agentItems.length>0?s.jsx(LA,{group:y,conversation:Ne,allowProcessView:!M,copiedFooter:Wt===`agent-${y.id}-bottom`,copiedArtifactUrl:ai,running:!M&&Io(y.turnIds,Ba),onCopyArtifactUrl:ul,onCopyBubble:Pl,onPreviewArtifact:li,onLoadProcessDetails:je=>Ne&&!M?yl(Ne.id,je):void 0,onRespondApproval:ml,onRespondWorkspaceChangeProposal:_n,onRespondKnowledgeProposal:ta,onOpenComplexTask:Gi,onOpenSystemEvent:Y}):null,(Ce=y.trailingSystemItems)==null?void 0:Ce.map(je=>s.jsxs("div",{className:"turn-panel system-turn",children:[_o(je,Ne,li,ul,ai,ml,_n,ta,Gi,Y),s.jsx(Do,{copied:Wt===`system-${je.id}-bottom`,content:Mo(je),id:`system-${je.id}-bottom`,timestamp:je.createdAt,variant:"outside",onCopy:Pl})]},je.id))]}),J?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:Ya,ref:si,children:[qa?s.jsxs("div",{className:`global-activity ${qa.tone??"running"}`,children:[jr?s.jsx("button",{"aria-label":"Stop current agent run",className:"turn-stop activity-stop",onClick:()=>void Nn(),title:"Stop current agent run",type:"button",children:s.jsx(BA,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:qa.title}),qa.detail?s.jsx("small",{children:qa.detail}):null]}),jr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":w?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!w||O==="complex",className:`complex-mode-button ${w||O==="complex"?"active":""}`,disabled:!!w,onClick:()=>U(y=>y==="complex"?"simple":"complex"),title:w?"End the current complex task before switching back":O==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(_v,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:w?"Complex task active":O==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{disabled:x!==null&&c.has(x),onChange:y=>Tn(y.target.value),onKeyDown:Pi,placeholder:"Cmd/Ctrl + Enter",ref:xr,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:!r.trim()||x!==null&&c.has(x),type:"submit",children:[s.jsx(qA,{}),s.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),s.jsxs("span",{children:[s.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),Gn?s.jsx("div",{className:"artifact-lightbox",onClick:()=>li(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>li(null),type:"button",children:"×"}),s.jsx("img",{alt:Gn.name,src:Gn.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:Gn.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:Gn.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void ul(Gn),type:"button",children:ai===Gn.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function aA({conversation:e,clockNow:i,knowledgeDraft:l,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,k]=D.useState("overview"),[w,E]=D.useState(!1),[O,U]=D.useState(!1),[_,F]=D.useState(null),[q,Y]=D.useState(null),[se,N]=D.useState(!1),[X,ae]=D.useState(null),[ee,L]=D.useState(null),[te,ce]=D.useState(!1),[Ee,ge]=D.useState(null),[ue,G]=D.useState(null),oe=uw(u),ye=Jp(e,e.status),De=_?E_(_):null;D.useEffect(()=>{E(!1),F(null),Y(null),ae(null),L(null),ge(null),G(null)},[e.id]),D.useEffect(()=>{x==="additionalContext"&&!X&&A()},[x,X]),D.useEffect(()=>{x==="compactions"&&!Ee&&z()},[x,Ee]);const R=()=>{E(!0),U(!0),Y(null),M2(e.id).then(C=>F(C)).catch(C=>{const K=We(C);Y(K.detail?`${K.message}
87
- ${K.detail}`:K.message)}).finally(()=>U(!1))},A=()=>{N(!0),L(null),O2(e.id).then(C=>ae(C)).catch(C=>{const K=We(C);L(K.detail?`${K.message}
88
- ${K.detail}`:K.message)}).finally(()=>N(!1))},z=()=>{ce(!0),G(null),z2(e.id).then(C=>ge(C)).catch(C=>{const K=We(C);G(K.detail?`${K.message}
89
- ${K.detail}`:K.message)}).finally(()=>ce(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:C=>C.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>k("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>k("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>k("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>k("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>k("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>k("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:x==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${ye}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:Oc(ye,e.nextWakeup,i)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(Je,{label:"Wake at",value:Ho(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:$c(e.nextWakeup,i)}):null,s.jsx(Je,{label:"Created by",value:e.nextWakeup.createdBy}),s.jsx(Je,{label:"Attempts",value:`${e.nextWakeup.attemptCount} / ${e.nextWakeup.maxAttempts}`,mono:!0}),s.jsxs("div",{className:"workspace-status-detail-text",children:[s.jsx("span",{children:"Wakeup instruction"}),s.jsx("pre",{children:e.nextWakeup.instruction})]}),e.nextWakeup.error?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Wakeup error"}),s.jsx("pre",{children:e.nextWakeup.error})]}):null]}):null,e.statusError?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Error"}),s.jsx("pre",{children:e.statusError})]}):e.status==="error"||e.status==="initialization_failed"?s.jsx("p",{className:"context-muted",children:"No persisted error detail is available for this status."}):null]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Workspace"}),s.jsx(Je,{label:"Name",value:e.title}),s.jsx(Je,{label:"ID",value:`workspaces/${as(e.id)}`,mono:!0}),s.jsx(Je,{label:"Path",value:e.workspacePath,mono:!0})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Context Assets"}),s.jsx(Je,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),s.jsx(Je,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),s.jsx(Je,{label:"Knowledge",value:`${r.length} item${r.length===1?"":"s"}`})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Current Responsibility"}),e.responsibility.trim()?s.jsx("div",{className:"context-markdown-preview",children:Sa(e.responsibility,e)}):s.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Knowledge Index"}),s.jsx(Nv,{items:r,onDelete:d,onEdit:C=>{p(C),k("knowledge")}})]})]}):x==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:Sa(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(TA,{draft:l,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):x==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Je,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:O,onClick:R,type:"button",children:O?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:O,onClick:()=>E(!1),type:"button",children:"Hide"}):null]})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Token Window"}),u?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Used",value:oe===null?"unknown":`${Math.round(oe)}%`,mono:!0}),s.jsx(Je,{label:"Latest usage",value:u.modelContextWindow?`${Un(u.totalTokens)} / ${Un(u.modelContextWindow)}`:Un(u.totalTokens),mono:!0}),oe!==null?s.jsx("div",{className:`context-token-bar ${Eh(oe)}`,children:s.jsx("span",{style:{width:`${Kc(oe)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${Rc(u.inputTokens)} / ${Rc(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:Rc(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",$e(u.createdAt),"."]})]}):s.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),w?s.jsxs("section",{className:"context-card wide thread-read-panel",children:[s.jsx("h3",{children:"Runtime thread profile"}),s.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),O?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):q?s.jsx("pre",{className:"thread-read-error",children:q}):_?s.jsxs(s.Fragment,{children:[De?s.jsx(RA,{summary:De}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(_,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):x==="compactions"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Context Compactions"}),s.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),s.jsx("button",{className:"context-refresh-button",disabled:te,onClick:z,type:"button",children:te?"Refreshing...":"Refresh"})]}),ue?s.jsx("pre",{className:"thread-read-error",children:ue}):te&&!Ee?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ee!=null&&Ee.length?s.jsx("div",{className:"context-compaction-list",children:Ee.map(C=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:$e(C.completedAt??C.usageObservedAt??C.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${C.status}`,children:C.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:v_(C).map(K=>s.jsxs("div",{children:[s.jsx("dt",{children:K.label}),s.jsx("dd",{children:K.value})]},K.label))}),s.jsxs("small",{children:[Ca(C.id),C.turnId?` · turn ${Ca(C.turnId)}`:""]})]},C.id))}):s.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):s.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Additional Context"}),s.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),se?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):ee?s.jsx("pre",{className:"thread-read-error",children:ee}):X?s.jsx(DA,{preview:X,refreshing:se,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function rA({conversations:e,onClose:i,workspaceGroups:l}){var R;const[r,u]=D.useState([]),[c,d]=D.useState("active"),[p,g]=D.useState(null),[m,b]=D.useState([]),[x,k]=D.useState(!0),[w,E]=D.useState(null),[O,U]=D.useState(null),[_,F]=D.useState(!1),[q,Y]=D.useState(!1),[se,N]=D.useState(new Set),[X,ae]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((R=e[0])==null?void 0:R.id)??"",participantWorkspaceIds:[]}),ee=r.find(A=>A.id===p)??null,L=D.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),te=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),ce=l.map(A=>({...A,conversations:A.conversations.filter(z=>z.id!==X.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Ee=()=>{var A;ae({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),N(new Set),U("create")},ge=()=>{!ee||ee.status!=="active"||(ae({title:ee.title,publicDescription:ee.publicDescription,ownerWorkspaceId:ee.ownerWorkspaceId,participantWorkspaceIds:ee.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),N(new Set),U("edit"))},ue=async(A,z=c)=>{var C;k(!0),E(null);try{const K=await Yx();u(K);const me=K.filter(xe=>z==="archived"?xe.status==="archived":xe.status!=="archived"),Z=(A&&me.some(xe=>xe.id===A)?A:null)??(p&&me.some(xe=>xe.id===p)?p:((C=me[0])==null?void 0:C.id)??null);g(Z),b(Z?await Ec(Z):[])}catch(K){E(K instanceof Zi?K.detail:K instanceof Error?K.message:String(K))}finally{k(!1)}};D.useEffect(()=>{ue()},[]),D.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const z=await Yx();u(z),p&&z.some(C=>C.id===p)&&b(await Ec(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const G=async A=>{g(A),E(null);try{b(await Ec(A))}catch(z){E(z instanceof Zi?z.detail:z instanceof Error?z.message:String(z))}},oe=async A=>{var C;if(A===c)return;d(A),E(null);const z=((C=r.find(K=>A==="archived"?K.status==="archived":K.status!=="archived"))==null?void 0:C.id)??null;if(g(z),!z){b([]);return}try{b(await Ec(z))}catch(K){E(K instanceof Zi?K.detail:K instanceof Error?K.message:String(K))}},ye=async A=>{var z;if(A.preventDefault(),!(!X.title.trim()||!X.ownerWorkspaceId)){Y(!0),E(null);try{const C=O==="edit"&&ee?await l2(ee.id,{expectedVersion:ee.version,title:X.title.trim(),publicDescription:X.publicDescription.trim(),participantWorkspaceIds:X.participantWorkspaceIds}):await i2({...X,title:X.title.trim(),publicDescription:X.publicDescription.trim()});d("active"),U(null),ae({title:"",publicDescription:"",ownerWorkspaceId:((z=e[0])==null?void 0:z.id)??"",participantWorkspaceIds:[]}),await ue(C.id,"active")}catch(C){E(C instanceof Zi?C.detail:C instanceof Error?C.message:String(C))}finally{Y(!1)}}},De=async()=>{if(!(!ee||ee.status!=="active")){Y(!0),E(null);try{const A=await a2(ee.id,ee.version);F(!1),d("active"),await ue(void 0,"active")}catch(A){E(A instanceof Zi?A.detail:A instanceof Error?A.message:String(A))}finally{Y(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"协作"}),s.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),s.jsxs("div",{className:"collaboration-header-actions",children:[s.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Ee,title:"新建 Topic",type:"button",children:"+"}),s.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),w?s.jsx("div",{className:"collaboration-error",children:w}):null,s.jsxs("div",{className:"collaboration-body",children:[s.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[s.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[s.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void oe("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void oe("archived"),role:"tab",type:"button",children:"已归档"})]}),x?s.jsx("p",{children:"正在加载..."}):te.length===0?s.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):te.map(A=>s.jsxs("button",{className:`collaboration-topic-entry${A.id===p?" active":""}`,onClick:()=>void G(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:ee?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:ee.title}),s.jsx("p",{children:ee.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:ee.status}),ee.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${ee.title}`,className:"memory-icon-button",onClick:ge,title:"编辑",type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":`归档 Topic ${ee.title}`,className:"memory-icon-button",onClick:()=>F(!0),title:"归档",type:"button",children:s.jsx(XN,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:ee.members.filter(A=>A.status==="active").map(A=>s.jsxs("span",{children:[A.workspaceTitleSnapshot,s.jsx("small",{children:A.role})]},`${A.workspaceId}-${A.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(A=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:A.senderTitleSnapshot}),s.jsx("span",{children:A.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${Qv(A.recipientWorkspaceIds.map(z=>L.get(z)??Ca(z)))}`}),s.jsx("time",{children:$e(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:Sa(A.contentMarkdown,void 0)})]},A.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),O?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!q&&U(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:ye,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:O==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:O==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>U(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:X.title,onChange:A=>ae(z=>({...z,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:X.publicDescription,onChange:A=>ae(z=>({...z,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:O==="edit",value:X.ownerWorkspaceId,onChange:A=>ae(z=>({...z,ownerWorkspaceId:A.target.value,participantWorkspaceIds:z.participantWorkspaceIds.filter(C=>C!==A.target.value)})),children:l.map(A=>s.jsx("optgroup",{label:A.title,children:A.conversations.map(z=>s.jsx("option",{value:z.id,children:z.title},z.id))},A.id))})]}),s.jsxs("fieldset",{className:"collaboration-participant-groups",children:[s.jsx("legend",{children:"参与工作空间"}),s.jsxs("div",{className:"collaboration-participant-toolbar",children:[s.jsxs("span",{children:[X.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>N(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>N(new Set(ce.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),ce.map(A=>{const z=A.conversations,C=z.filter(me=>X.participantWorkspaceIds.includes(me.id)).length,K=se.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!K,className:"collaboration-group-toggle",onClick:()=>N(me=>{const Z=new Set(me);return Z.has(A.id)?Z.delete(A.id):Z.add(A.id),Z}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:K?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[C,"/",z.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:C===z.length,onChange:()=>ae(me=>{const Z=z.map(Le=>Le.id),xe=new Set(me.participantWorkspaceIds);return Z.every(Le=>xe.has(Le))?Z.forEach(Le=>xe.delete(Le)):Z.forEach(Le=>xe.add(Le)),{...me,participantWorkspaceIds:Array.from(xe)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),K?null:s.jsx("div",{children:z.map(me=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:X.participantWorkspaceIds.includes(me.id),onChange:Z=>ae(xe=>({...xe,participantWorkspaceIds:Z.target.checked?[...xe.participantWorkspaceIds,me.id]:xe.participantWorkspaceIds.filter(Le=>Le!==me.id)})),type:"checkbox"}),s.jsx("span",{children:me.title})]},me.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:q,onClick:()=>U(null),type:"button",children:"取消"}),s.jsx("button",{disabled:q||!X.title.trim()||!X.ownerWorkspaceId,type:"submit",children:q?"正在保存...":O==="edit"?"保存":"创建 Topic"})]})]})}):null,_&&ee?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!q&&F(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>F(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:ee.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:q,onClick:()=>F(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:q,onClick:()=>void De(),type:"button",children:q?"正在归档...":"归档"})]})]})}):null]})})}function sA({busy:e,conversation:i,conversationId:l,preview:r,previewLoading:u,result:c,status:d,warmup:p,workspaceGroups:g,onCancelResetPreview:m,onClose:b,onPreviewReset:x,onStartBlankContext:k,onResetRuntime:w,onSaveResetSelection:E,onWorkspaceChange:O,onWarmupChange:U}){const _=!i||e||d==="running";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:F=>F.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header console-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Console"}),s.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),s.jsxs("div",{className:"console-header-actions",children:[s.jsxs("label",{className:"console-workspace-picker",children:[s.jsx("span",{children:"Workspace"}),s.jsx("select",{disabled:e,onChange:F=>O(F.target.value),value:l??"",children:g.map(F=>s.jsx("optgroup",{label:F.title,children:F.conversations.map(q=>s.jsxs("option",{value:q.id,children:[q.title," · workspaces/",as(q.id)]},q.id))},F.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:b,type:"button",children:"×"})]})]}),s.jsx("div",{className:"console-body",children:s.jsxs("section",{className:"console-card",children:[s.jsxs("div",{className:"console-card-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Runtime"}),s.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),s.jsx("span",{className:`console-status ${d}`,children:d})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:i?`workspaces/${as(i.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:p,onChange:F=>U(F.target.checked),type:"checkbox"}),s.jsxs("span",{children:["Run a warmup turn after reset",s.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),s.jsxs("div",{className:"console-actions",children:[s.jsx("button",{className:"danger",disabled:_||u,onClick:x,type:"button",children:u?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:_||u,onClick:k,type:"button",children:"Clear memory & start blank"}),d==="running"?s.jsx("span",{children:"Stop the running turn before resetting."}):null]}),c?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:c.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),c.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",c.historyBatchCount," chronological batches with ",c.historyCompactionCount," native compactions"]}):null,c.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),r?s.jsx(oA,{busy:e,preview:r,warmup:p,onCancel:m,onConfirm:w,onSaveSelection:E}):null]})})}function oA({busy:e,preview:i,warmup:l,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=D.useState(()=>new Set(i.entries.filter(L=>L.includedByDefault).map(L=>L.id))),[g,m]=D.useState(!1),[b,x]=D.useState(!1),[k,w]=D.useState(null),E=D.useRef(null),O=i.entries.filter(L=>d.has(L.id)),U=O.filter(L=>L.role==="user").length,_=O.length-U,F=i.entries.filter(L=>L.topicRelation!==null).map(L=>L.id),q=F.filter(L=>d.has(L)).length,Y=i.entries.length>0&&d.size===i.entries.length;D.useEffect(()=>{E.current&&(E.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const se=e||b;async function N(L){x(!0),w(null);try{await c(i.entries.filter(te=>L.has(te.id)).map(te=>te.id)),p(L)}catch(te){w(We(te).message)}finally{x(!1)}}function X(L,te){const ce=new Set(d);te?ce.add(L):ce.delete(L),N(ce)}function ae(){const L=new Set(d);F.forEach(te=>L.add(te)),N(L)}function ee(){const L=new Set(d);F.forEach(te=>{L.has(te)?L.delete(te):L.add(te)}),N(L)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:se?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:L=>L.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(L=>!L),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:se,onClick:r,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:Y,disabled:se||i.entries.length===0,onChange:L=>void N(L.target.checked?new Set(i.entries.map(te=>te.id)):new Set),ref:E,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[U," user"]}),s.jsxs("span",{children:[_," assistant"]}),F.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[q," of ",F.length," Topic input + response"]}),s.jsx("button",{disabled:se||q===F.length,onClick:ae,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:se,onClick:ee,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:l?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,k?s.jsx("span",{className:"reset-preview-selection-error",children:k}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((L,te)=>s.jsxs("article",{className:`reset-preview-item ${L.role} ${d.has(L.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${L.role} message ${te+1}`,checked:d.has(L.id),disabled:se,onChange:ce=>X(L.id,ce.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:L.role}),L.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",L.topicRelation]}):null,s.jsx("time",{dateTime:L.createdAt,children:$e(L.createdAt)})]}),s.jsx("pre",{children:L.content})]},L.id)):s.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),s.jsxs("footer",{className:"reset-preview-actions",children:[s.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:se,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:se,onClick:()=>u(i.entries.filter(L=>d.has(L.id)).map(L=>L.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function uA({currentReleasedAt:e,currentVersion:i,job:l,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(l==null?void 0:l.currentVersion)??i,b=r!=null&&r.version&&O_(r.version,m)?R_(r.version):null;return D.useEffect(()=>{const x=k=>{k.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:l?`status-${l.status}`:void 0,children:(l==null?void 0:l.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:Zp(m,(l==null?void 0:l.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?Zp(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?s.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),l?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:$e(l.startedAt)})]}):null]}),r!=null&&r.error?s.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",r.error]}):null,s.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:l!=null&&l.logs.length?l.logs.map((x,k)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:M_(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${k}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.jsx("button",{disabled:c||(l==null?void 0:l.status)==="running",onClick:g,type:"button",children:c?"Starting...":(l==null?void 0:l.status)==="running"?"Updating...":l?"Run again":"Start update"})]})]})})}function cA({currentUser:e,conversations:i,editingEnvironmentKey:l,environmentDraft:r,globalEnvironment:u,workspaceEnvironment:c,memorySettings:d,memorySettingsDraft:p,managedUsers:g,workspaceMemoryDraft:m,runtimeSettings:b,runtimeModels:x,runtimeCodexVersion:k,runtimeCodexReleasedAt:w,runtimeCodexUpdating:E,runtimeSettingsDraft:O,runtimeSettingsScope:U,settingsWorkspace:_,settingsWorkspaceId:F,systemDiagnostics:q,systemDiagnosticsLoading:Y,workspaceGroups:se,workspaceRuntimeSettings:N,workspaceRuntimeSettingsDraft:X,onCancelEnvironmentEdit:ae,onClose:ee,onCreateUser:L,onDeleteUser:te,onDeleteEnvironment:ce,onDraftChange:Ee,onEditEnvironment:ge,onSaveBaseMemoryItems:ue,onSaveResponsibility:G,onSaveWorkspaceMemoryItems:oe,onRevealEnvironmentValue:ye,onRuntimeDraftChange:De,onGlobalSettingsImported:R,onCodexAccountSwitched:A,onUpdateCodexCli:z,onRuntimeScopeChange:C,onSettingsWorkspaceChange:K,onSubmitRuntimeSettings:me,onSubmitEnvironment:Z,onRefreshSystemDiagnostics:xe,onUpdateUser:Le,onWorkspaceRuntimeDraftChange:Xe,onWorkspaceRuntimeReset:Ot,revealedEnvironmentKeys:Ft}){const[Ye,Et]=D.useState("model"),[Jt,zt]=D.useState(!1),[rn,ze]=D.useState(null),[wt,sn]=D.useState(!1),[wn,gi]=D.useState(!1),[yi,Di]=D.useState((_==null?void 0:_.responsibility)??""),[Lt,Ml]=D.useState(!1),ne=D.useRef(null),he=U==="workspace"?Object.values((N==null?void 0:N.sources)??{}).filter(Ae=>Ae==="workspace").length:0,Me=e.role==="admin"&&U==="global"&&(Ye==="model"||Ye==="memory"||Ye==="environment");return D.useEffect(()=>{U==="global"&&sn(!1)},[U]),D.useEffect(()=>{Di((_==null?void 0:_.responsibility)??"")},[_==null?void 0:_.id,_==null?void 0:_.responsibility]),D.useEffect(()=>{if(!wt)return;const Ae=At=>{var tt;const mn=At.target;mn instanceof Node&&((tt=ne.current)!=null&&tt.contains(mn))||sn(!1)},Ie=At=>{At.key==="Escape"&&sn(!1)};return document.addEventListener("pointerdown",Ae,!0),document.addEventListener("keydown",Ie,!0),()=>{document.removeEventListener("pointerdown",Ae,!0),document.removeEventListener("keydown",Ie,!0)}},[wt]),s.jsxs("div",{className:"context-panel-overlay settings-overlay",onClick:ee,role:"presentation",children:[s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:Ae=>Ae.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Ye!=="system"&&Ye!=="users"&&Ye!=="accounts"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":U==="global",className:U==="global"?"active":void 0,onClick:()=>C("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:ne,children:[s.jsx("button",{"aria-checked":U==="workspace","aria-expanded":U==="workspace"?wt:void 0,"aria-label":U==="workspace"?"Settings workspace target":void 0,className:U==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(U!=="workspace"){C("workspace");return}sn(Ae=>!Ae)},role:"radio",type:"button",children:U==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(_==null?void 0:_.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),U==="workspace"&&wt?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:se.map(Ae=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:Ae.title}),Ae.conversations.map(Ie=>s.jsxs("button",{"aria-selected":Ie.id===F,className:Ie.id===F?"selected":void 0,onClick:()=>{K(Ie.id),sn(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ie.title}),s.jsxs("small",{children:["workspaces/",Ie.id]})]},Ie.id))]},Ae.id))}):null]})]}):null]}),s.jsxs("div",{className:"settings-header-actions",children:[Me?s.jsx("button",{className:"settings-transfer-button",onClick:()=>gi(!0),type:"button",children:"Import / Export"}):null,s.jsx("button",{"aria-label":"Close settings panel",onClick:ee,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Ye==="model"?"active":void 0,onClick:()=>Et("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Ye==="responsibility"?"active":void 0,onClick:()=>Et("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Ye==="memory"?"active":void 0,onClick:()=>Et("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Ye==="environment"?"active":void 0,onClick:()=>Et("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Ye==="accounts"?"active":void 0,onClick:()=>Et("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Login + active account"})]}),s.jsxs("button",{className:Ye==="system"?"active":void 0,onClick:()=>Et("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Ye==="users"?"active":void 0,onClick:()=>Et("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Ye!=="system"&&Ye!=="users"&&Ye!=="accounts"?s.jsxs("div",{className:`settings-scope-banner ${U==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:U==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:U==="workspace"?`${(_==null?void 0:_.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Ye==="system"?s.jsx(fA,{conversations:i,diagnostics:q,loading:Y,onRefresh:xe}):Ye==="users"?s.jsx(vA,{currentUser:e,users:g,onCreate:L,onDelete:te,onUpdate:Le}):Ye==="accounts"?s.jsx(bA,{onSwitched:A}):Ye==="model"?s.jsx(wA,{draft:U==="workspace"?X:O,globalSettings:b,models:x,codexVersion:k,codexReleasedAt:w,codexUpdating:E,scope:U,workspaceOverrideCount:he,settings:U==="workspace"?(N==null?void 0:N.effective)??X:b,workspaceSettings:N,onDraftChange:U==="workspace"?Xe:De,onResetWorkspaceSetting:Ot,onSubmit:me,onUpdateCodexCli:z}):Ye==="responsibility"?s.jsx(mA,{draft:yi,saving:Lt,scope:U,workspace:_,onDraftChange:Di,onSubmit:Ae=>{Ae.preventDefault(),Ae.stopPropagation(),!(U!=="workspace"||!_)&&(Ml(!0),G(_.id,yi).then(Ie=>Di(Ie)).finally(()=>Ml(!1)))}}):Ye==="memory"?s.jsx(kA,{baseSettings:d,scope:U,workspaceSettings:m,workspaceName:_==null?void 0:_.title,onSaveBaseItems:ue,onSaveWorkspaceItems:oe}):s.jsx(CA,{deleteConfirmKey:rn,editingEnvironmentKey:l,environmentDraft:r,globalEnvironment:u,scope:U,workspaceEnvironment:c,valueVisible:Jt,onCancelEnvironmentEdit:ae,onDeleteConfirmChange:ze,onDeleteEnvironment:ce,onDraftChange:Ee,onEditEnvironment:ge,onRevealEnvironmentValue:ye,onSubmitEnvironment:Z,onValueVisibleChange:zt,revealedEnvironmentKeys:Ft})]})]})]}),wn?s.jsx(dA,{onClose:()=>gi(!1),onImported:async()=>{await R(),gi(!1)}}):null]})}const Co=[{id:"runtime",label:"Runtime",description:"Model, reasoning, fast mode, sandbox, and notifications"},{id:"environment",label:"Environment",description:"Global environment keys, descriptions, and secret values"},{id:"memory",label:"Memory",description:"Global memory items used as the base workspace context"}];function dA({onClose:e,onImported:i}){const[l,r]=D.useState("export"),[u,c]=D.useState(()=>new Set(Co.map(q=>q.id))),[d,p]=D.useState(""),[g,m]=D.useState(null),[b,x]=D.useState(!1),[k,w]=D.useState(""),E=g?new Set(Co.filter(q=>g[q.id]!==void 0).map(q=>q.id)):new Set;function O(q){r(q),w(""),c(q==="export"?new Set(Co.map(Y=>Y.id)):new Set(E))}function U(q){c(Y=>{const se=new Set(Y);return se.has(q)?se.delete(q):se.add(q),se})}async function _(q){var se;const Y=(se=q.target.files)==null?void 0:se[0];if(q.target.value="",!!Y){w("");try{if(Y.size>5*1024*1024)throw new Error("The settings file is larger than 5 MB.");const N=JSON.parse(await Y.text()),X=Wv(N),ae=new Set(Co.filter(ee=>X[ee.id]!==void 0).map(ee=>ee.id));if(ae.size===0)throw new Error("The file does not contain Runtime, Environment, or Memory.");p(Y.name),m(X),c(ae)}catch(N){p(""),m(null),c(new Set),w(N instanceof Error?N.message:"Invalid settings file.")}}}async function F(){if(u.size===0){w("Select at least one settings category.");return}x(!0),w("");try{if(l==="export"){const q=await E2(u);N2(q),e()}else{if(!g)throw new Error("Choose a Seele global settings file first.");const q={format:g.format,version:g.version,exportedAt:g.exportedAt,...u.has("runtime")?{runtime:g.runtime}:{},...u.has("environment")?{environment:g.environment}:{},...u.has("memory")?{memory:g.memory}:{}};await A2(q),await i()}}catch(q){w(q instanceof Error?q.message:"Settings transfer failed.")}finally{x(!1)}}return s.jsx("div",{className:"memory-editor-overlay",onClick:q=>{q.stopPropagation(),b||e()},role:"presentation",children:s.jsxs("section",{"aria-label":"Import or export global settings","aria-modal":"true",className:"memory-delete-dialog global-transfer-dialog",onClick:q=>q.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Global Settings Transfer"}),s.jsx("button",{"aria-label":"Close global settings transfer",className:"memory-icon-button",disabled:b,onClick:e,type:"button",children:"×"})]}),s.jsxs("div",{className:"global-transfer-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":l==="export",className:l==="export"?"active":void 0,onClick:()=>O("export"),role:"tab",type:"button",children:"Export"}),s.jsx("button",{"aria-selected":l==="import",className:l==="import"?"active":void 0,onClick:()=>O("import"),role:"tab",type:"button",children:"Import"})]}),l==="import"?s.jsxs("label",{className:"global-transfer-file",children:[s.jsx("span",{children:d||"Choose a .json settings file"}),s.jsx("input",{accept:"application/json,.json",disabled:b,onChange:q=>void _(q),type:"file"})]}):s.jsx("p",{children:"Export selected Global settings into one portable JSON file. Environment export includes secret values; store the file securely."}),s.jsx("div",{className:"global-transfer-options",children:Co.map(q=>{const Y=b||l==="import"&&!E.has(q.id);return s.jsxs("label",{className:`global-transfer-option ${Y?"disabled":""}`,children:[s.jsx("input",{checked:u.has(q.id),disabled:Y,onChange:()=>U(q.id),type:"checkbox"}),s.jsxs("span",{children:[s.jsx("strong",{children:q.label}),s.jsx("small",{children:q.description})]})]},q.id)})}),l==="import"&&g?s.jsx("p",{className:"global-transfer-warning",children:"Import replaces the selected Global categories on this deployment. Other settings and all workspace overrides remain unchanged."}):null,k?s.jsx("p",{className:"memory-editor-error",children:k}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:b,onClick:e,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||u.size===0||l==="import"&&!g,onClick:()=>void F(),type:"button",children:b?"Working...":l==="export"?"Export file":"Import selected"})]})]})})}function fA({conversations:e,diagnostics:i,loading:l,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=D.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=D.useState(!1),g=D.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=D.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},x=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),E=document.createElement("a");E.href=w,E.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,E.click(),URL.revokeObjectURL(w)},k=()=>{if(!i||!c.length)return;const w=c[0],E=c.slice(0,5).map(q=>`- ${Ho(q.createdAt)} · ${q.level.toUpperCase()} · ${q.event} · ${q.summary}`).join(`
90
- `),O=JSON.stringify(w,null,2),U=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${Ho(i.generatedAt)}`,"","## Latest incident","","```json",O.slice(0,2500),"```","","## Recent system log","",E,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
91
- `),_=`[System Log] ${w.summary}`.slice(0,180),F=new URL("https://github.com/seele-labs/seele-work/issues/new");F.searchParams.set("title",_),F.searchParams.set("body",U),window.open(F.toString(),"_blank","noopener,noreferrer")};return s.jsxs("section",{className:"system-information-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"System"}),s.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),s.jsx("button",{className:"system-information-refresh",disabled:l,onClick:r,type:"button",children:l?"Refreshing...":"Refresh"})]}),u?s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"system-information-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"LRU pool target"}),s.jsxs("dd",{children:[Un(u.maxRetainedRuntimes)," runtimes"]}),s.jsx("small",{children:u.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Retention policy"}),s.jsxs("dd",{children:["LRU · ",Ap(u.maxIdleSeconds*1e3)," max idle"]}),s.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current pool"}),s.jsxs("dd",{children:[u.activeRuntimeCount," active · ",u.idleRuntimeCount," idle"]}),s.jsxs("small",{children:[u.retainedRuntimeCount," retained runtimes"]})]})]}),s.jsxs("section",{className:"system-runtime-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"Workspace runtimes"}),s.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),s.jsx("time",{dateTime:i==null?void 0:i.generatedAt,children:i?$e(i.generatedAt):""})]}),u.workspaces.length>0?s.jsxs("div",{className:"system-runtime-table",children:[s.jsxs("div",{className:"system-runtime-table-header",children:[s.jsx("span",{children:"Workspace"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Runtime"}),s.jsx("span",{children:"Age"})]}),u.workspaces.map(w=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:g.get(w.workspaceId)??w.workspaceId}),s.jsx("small",{children:w.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${w.turnId?"active":"idle"}`,children:w.lifecycle==="shutting_down"?"Shutting down":w.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:w.turnId?w.state:"Retained"}),s.jsx("small",{children:w.pid===null?"PID unavailable":`PID ${w.pid}`})]}),s.jsx("span",{children:w.idleMs===null?Ap(w.uptimeMs):`${Ap(w.idleMs)} idle`})]},w.workspaceId))]}):s.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),s.jsxs("section",{className:"system-runtime-list system-log-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"System log"}),s.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),s.jsxs("div",{className:"system-log-actions",children:[s.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!c.length,onClick:()=>void b(),title:"Copy system log report",type:"button",children:s.jsx(jh,{})}),s.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!c.length,onClick:x,title:"Download system log report",type:"button",children:s.jsx(pA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:k,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx(hA,{})}),d?s.jsx("small",{children:"Copied"}):null]})]}),c.length?s.jsx("div",{className:"system-log-entries",children:c.map(w=>s.jsxs("details",{className:`system-log-entry ${w.level}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"system-log-level",children:w.level}),s.jsxs("span",{children:[s.jsx("strong",{children:w.summary}),s.jsxs("small",{children:[w.component," · ",Ho(w.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:w.event})]}),w.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[g.get(w.workspaceId)??w.workspaceId," · ",w.workspaceId]})]}):null,w.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:w.turnId})]}):null,w.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:w.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(w.detail,null,2)})]},w.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:l?"Loading system information...":"System information is unavailable."})]})}function pA(){return s.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function hA(){return s.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"M12 7v6m0 4h.01"})]})}function mA({draft:e,saving:i,scope:l,workspace:r,onDraftChange:u,onSubmit:c}){const d=l==="workspace";return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Responsibility"}),s.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),d&&r?s.jsxs("form",{className:"settings-responsibility-form",onSubmit:c,children:[s.jsxs("label",{children:[s.jsx("span",{children:r.title}),s.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:p=>u(p.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:i,type:"submit",children:i?"Saving...":"Save responsibility"})})]}):s.jsx("section",{className:"settings-readonly-block",children:s.jsxs("div",{children:[s.jsx("strong",{children:"Workspace-only setting"}),s.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function gA({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((i,l)=>i.windowDurationMins-l.windowDurationMins).map(i=>{const l=Kc(i.usedPercent),r=Mv(i.windowDurationMins);return s.jsxs("div",{className:"codex-account-usage-window",children:[s.jsxs("div",{children:[s.jsxs("span",{children:[r," used"]}),s.jsx("strong",{children:fw(l)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${l}%`}})}),s.jsxs("small",{children:["Resets ",pw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function yA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function xA(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function bA({onSwitched:e}){var A;const[i,l]=D.useState(null),[r,u]=D.useState(!0),[c,d]=D.useState(!1),[p,g]=D.useState(!1),[m,b]=D.useState(""),[x,k]=D.useState(!1),[w,E]=D.useState(""),[O,U]=D.useState(null),[_,F]=D.useState(null),[q,Y]=D.useState(""),[se,N]=D.useState(null),[X,ae]=D.useState(null),[ee,L]=D.useState(!1);async function te(){var C;const z=await Fx();l(z),((C=z.login)==null?void 0:C.status)==="pending"&&(U(z.login),k(!0))}async function ce(z){d(!0),b("");try{l(await Wx(z))}catch(C){b(We(C).message)}finally{d(!1)}}D.useEffect(()=>{let z=!1;return Fx().then(C=>{var K;z||(l(C),((K=C.login)==null?void 0:K.status)==="pending"&&(U(C.login),k(!0)),C.accounts.length>0&&(d(!0),Wx(!1).then(me=>{z||l(me)}).catch(me=>{z||b(We(me).message)}).finally(()=>{z||d(!1)})))}).catch(C=>{z||b(We(C).message)}).finally(()=>{z||u(!1)}),()=>{z=!0}},[]),D.useEffect(()=>{if(!O||O.status!=="pending")return;let z=!1;const C=window.setInterval(()=>{y2(O.id).then(async K=>{z||(U(K),K.status!=="pending"&&(window.clearInterval(C),K.status==="succeeded"&&(await te(),await ce(!0))))}).catch(K=>{z||b(We(K).message)})},1e3);return()=>{z=!0,window.clearInterval(C)}},[O==null?void 0:O.id,O==null?void 0:O.status]);function Ee(){E(""),U(null),b(""),L(!1),k(!0)}async function ge(z){z.preventDefault(),g(!0),b("");try{U(await g2(w.trim()))}catch(C){b(We(C).message)}finally{g(!1)}}async function ue(){if(!O||O.status!=="pending"){k(!1);return}g(!0),b("");try{const z=await x2(O.id);U(z),k(!1)}catch(z){b(We(z).message)}finally{g(!1)}}function G(z){F(z),Y(z.name),b("")}async function oe(z){if(z.preventDefault(),!_)return;const C=q.trim();if(!C||C===_.name){F(null);return}g(!0),b("");try{await b2(_.id,C),F(null),await te()}catch(K){b(We(K).message)}finally{g(!1)}}async function ye(){var z;if(se){g(!0),b("");try{const C=await w2(se.id);l(C),N(null),await e()}catch(C){const K=We(C);b((z=K.detail)!=null&&z.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":K.detail??K.message)}finally{g(!1)}}}async function De(){if(X){g(!0),b("");try{await v2(X.id),ae(null),await te()}catch(z){b(We(z).detail??We(z).message)}finally{g(!1)}}}const R=(i==null?void 0:i.accounts)??[];return s.jsxs("section",{className:"settings-section codex-accounts-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex Accounts"}),s.jsx("p",{children:"Manage isolated Codex logins. Workspaces do not bind to an account; all work uses the single active account."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||R.length===0,onClick:()=>void ce(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(O==null?void 0:O.status)==="pending",onClick:Ee,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Manual stop-and-switch"}),s.jsx("span",{children:"Switching requires the whole runtime to be idle. Seele stops retained workers, activates the selected credential, then resumes queued work. No automatic switching or parallel accounts."})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,r?s.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!r&&R.length===0?s.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,s.jsx("div",{className:"codex-account-list",children:R.map(z=>{var Z;const C=(i==null?void 0:i.activeAccountId)===z.id,K=(Z=i==null?void 0:i.accountDetails)==null?void 0:Z[z.id],me=[z.email,yA(z.accountType),xA(z.planType)].filter(xe=>!!xe);return s.jsxs("article",{className:C?"codex-account-card active":"codex-account-card",children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:z.name}),C?s.jsx("span",{className:"codex-account-active",children:"Active"}):null]}),s.jsx("small",{children:me.join(" · ")||`Added ${$e(z.createdAt)}`}),K!=null&&K.usage?s.jsx(gA,{usage:K.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),K?s.jsx("small",{className:K.error?"codex-account-detail-error":"codex-account-refreshed",children:K.error?`Refresh issue: ${K.error}`:`Updated ${$e(K.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c,onClick:()=>G(z),type:"button",children:"Rename"}),s.jsx("button",{disabled:p||c||C,onClick:()=>{b(""),N(z)},type:"button",children:C?"In use":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||C,onClick:()=>{b(""),ae(z)},type:"button",children:"Delete"})]})]},z.id)})}),_?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&F(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void oe(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Rename Codex Account"}),s.jsx("button",{"aria-label":"Close account rename",className:"memory-icon-button",disabled:p,onClick:()=>F(null),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:z=>Y(z.target.value),value:q})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>F(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!q.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!O&&k(!1),role:"presentation",children:O?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:O.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void ue(),type:"button",children:"×"})]}),O.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),s.jsxs("div",{className:"codex-device-code",children:[s.jsx("strong",{children:O.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(O.userCode),L(!0),window.setTimeout(()=>L(!1),1500)},type:"button",children:ee?"Copied":"Copy code"})]}),s.jsx("a",{href:O.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),s.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):O.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=O.account)==null?void 0:A.name)??O.accountName})," is persisted and ready. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:O.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void ue(),type:"button",children:O.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void ge(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>k(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates an isolated login profile. Completing login adds it to the list but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:z=>E(z.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>k(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,se?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&N(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>N(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch global execution to ",s.jsx("strong",{children:se.name}),"? This succeeds only when every workspace and goal is idle. Retained Codex workers will be stopped; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>N(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void ye(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,X?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&ae(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Codex Account"}),s.jsx("button",{"aria-label":"Close account deletion",className:"memory-icon-button",disabled:p,onClick:()=>ae(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:X.name})," and its persisted Codex credential from this Seele deployment? This cannot be undone."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>ae(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:p,onClick:()=>void De(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function vA({currentUser:e,users:i,onCreate:l,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=D.useState(null),[g,m]=D.useState(c),[b,x]=D.useState(!1),[k,w]=D.useState(null),[E,O]=D.useState("");function U(){m(c),O(""),p("new")}function _(Y){m({username:Y.username,password:"",role:Y.role,active:Y.active}),O(""),p(Y)}function F(){b||(p(null),O(""))}async function q(Y){if(Y.preventDefault(),!!d){x(!0),O("");try{d==="new"?await l({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),p(null)}catch(se){O(We(se).message)}finally{x(!1)}}}return s.jsxs("section",{className:"settings-section user-management-section",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Users"}),s.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:U,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(Y=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:Y.username}),Y.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",$e(Y.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${Y.role}`,children:Y.role}),s.jsx("span",{className:`user-status ${Y.active?"active":"disabled"}`,children:Y.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${Y.username}`,className:"memory-icon-button",onClick:()=>_(Y),title:"Edit",type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":`Delete user ${Y.username}`,className:"memory-icon-button memory-item-delete",disabled:Y.id===e.id,onClick:()=>{O(""),w(Y)},title:"Delete",type:"button",children:"×"})]})]},Y.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:F,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:Y=>Y.stopPropagation(),onSubmit:Y=>void q(Y),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:F,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:Y=>m(se=>({...se,username:Y.target.value})),placeholder:"Sign-in username",value:g.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:d==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:Y=>m(se=>({...se,password:Y.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:Y=>m(se=>({...se,role:Y.target.value==="admin"?"admin":"user"})),value:g.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:Y=>m(se=>({...se,active:Y.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,E?s.jsx("p",{className:"memory-editor-error",children:E}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:F,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||!g.username.trim()||d==="new"&&g.password.length<8||d!=="new"&&g.password.length>0&&g.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,k?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:Y=>Y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete User"}),s.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>w(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:k.username}),". Users that own workspaces must be disabled instead."]}),E?s.jsx("p",{className:"memory-editor-error",children:E}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>w(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(k.id).then(()=>w(null)).catch(Y=>O(We(Y).message))},type:"button",children:"Delete"})]})]})}):null]})}function wA({codexReleasedAt:e,codexVersion:i,codexUpdating:l,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:k,onUpdateCodexCli:w}){var O;const E=d==="workspace";return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),E?s.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:k,children:[s.jsxs("label",{className:Eo(E,Xi(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(To,{globalValue:ib(u.model,c),isWorkspaceScope:E,label:"Model",settingKey:"model",source:Xi(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(mp,{"aria-label":"Runtime model",onChange:U=>b({...r,model:U}),options:z_(c,r.model),value:r.model||((O=c.find(U=>U.isDefault))==null?void 0:O.model)||""})]}),s.jsxs("label",{className:Eo(E,Xi(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(To,{globalValue:nb(u.reasoningEffort),isWorkspaceScope:E,label:"Reasoning effort",settingKey:"reasoningEffort",source:Xi(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(mp,{"aria-label":"Runtime reasoning effort",onChange:U=>b({...r,reasoningEffort:U}),options:UE,value:r.reasoningEffort})]}),s.jsxs("label",{className:Eo(E,Xi(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(To,{globalValue:ab(u.sandbox),isWorkspaceScope:E,label:"Permission mode",settingKey:"sandbox",source:Xi(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(mp,{"aria-label":"Permission mode",onChange:U=>b({...r,sandbox:U}),options:BE,value:r.sandbox})]}),s.jsxs("label",{className:Eo(E,Xi(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(To,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:E,label:"Fast mode",settingKey:"fastMode",source:Xi(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:x}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:U=>b({...r,fastMode:U.target.checked}),type:"checkbox"})]}),s.jsxs("label",{className:Eo(E,Xi(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(To,{globalValue:u.notifyEnabled?"On":"Off",isWorkspaceScope:E,label:"Profuse notification",settingKey:"notifyEnabled",source:Xi(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),onReset:x}),s.jsx("small",{children:"Send DingTalk notification when a turn finishes or fails"})]}),s.jsx("input",{"aria-label":"Enable Profuse notification",checked:r.notifyEnabled,onChange:U=>b({...r,notifyEnabled:U.target.checked}),type:"checkbox"})]}),s.jsxs("dl",{className:"runtime-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsxs("dd",{children:["Model ",ib(p.model,c),", reasoning"," ",nb(p.reasoningEffort),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",ab(p.sandbox),", notification"," ",p.notifyEnabled?"on":"off","."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:Zp(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:l,onClick:w,type:"button",children:l?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:E?"Save workspace overrides":"Save global runtime"})})]})]})}function To({globalValue:e,isWorkspaceScope:i,label:l,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:l}),i?s.jsxs("span",{className:"runtime-field-meta",children:[s.jsx("span",{className:d?"override":"inherited",children:d?"Workspace override":`Inherited: ${e}`}),d?s.jsx("button",{type:"button",onClick:()=>c(r),children:"Reset"}):null]}):null]})}function mp({"aria-label":e,onChange:i,options:l,value:r}){const[u,c]=D.useState(!1),d=D.useRef(null),p=l.find(g=>g.value===r)??l[0]??null;return D.useEffect(()=>{if(!u)return;function g(b){var x;(x=d.current)!=null&&x.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:l.map(g=>s.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Xi(e,i,l){return e!==i?"workspace":l}function Eo(e,i,l="settings-wide-field"){return[l,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function kA({baseSettings:e,scope:i,workspaceSettings:l,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?l.items:e.items,g=d?c:u;return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),s.jsx("p",{children:d?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),d?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(jA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(SA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function SA({ariaLabel:e,emptyText:i,items:l,onSaveItems:r,title:u}){var X;const[c,d]=D.useState(qo(l)),[p,g]=D.useState(null),[m,b]=D.useState({key:"",value:""}),[x,k]=D.useState(null),[w,E]=D.useState(null),[O,U]=D.useState(null);D.useEffect(()=>{d(qo(l))},[l]),D.useEffect(()=>{if(p===null)return;const ae=ee=>{ee.key==="Escape"&&(Y(),E(null))};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[p]);async function _(ae,ee){U(ee);try{const L=await r(ae);return d(qo(L)),L}finally{U(null)}}function F(){E(null),k(null),b({key:"",value:""}),g("new")}function q(ae){const ee=c[ae];ee&&(E(null),k(null),b({...ee}),g(ae))}function Y(){g(null),k(null),b({key:"",value:""})}async function se(ae){const ee=c[ae],L=(ee==null?void 0:ee.key)||`${ae}`;await _(c.filter((te,ce)=>ce!==ae),`delete:${L}`),E(null)}async function N(ae){ae.preventDefault(),ae.stopPropagation();const ee=m.key.trim(),L=H2(ee);if(L){k(L);return}const te=m.value.trim();if(!te){k("Value is required.");return}const ce=p==="new"?-1:p;if(c.some((ge,ue)=>ue!==ce&&ge.key.trim()===ee)){k(`Key "${ee}" already exists. Each memory key must be unique.`);return}const Ee={...m,key:ee,value:te};p==="new"?await _([...c,Ee],"add"):typeof p=="number"&&await _(c.map((ge,ue)=>ue===p?Ee:ge),`save:${p}`),Y()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:F,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((ae,ee)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${ae.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${ae.key}>`}),`
86
+ Workspaces in this group will move to Default.`)))try{const S=await f2(x.id),M=Sc(S.groups);b(M),hp(M),g(S.conversations),Pn(q=>{const J=new Set(q);return J.delete(x.id),fp(J),J})}catch(S){console.error(S)}}function Xl(x){Le({mode:"rename",conversationId:x.id,title:x.title})}function Vi(){Ot(!1),Le(null)}function pl(){rn(null)}async function Mr(x,j){const S=j.trim(),M=p.find(J=>J.id===x);if(!M||!S||S===M.title){Vi();return}const q=await Ac(x,{title:S});Dn(q),Vi()}function Os(x){return x instanceof HTMLInputElement||x instanceof HTMLTextAreaElement}function Pi(x){return x instanceof Element&&!!x.closest("input, button")}function bu(x,j){const S=document.elementFromPoint(x,j);return S instanceof HTMLElement?S.closest(".session-item[data-workspace-id]"):null}function Va(x,j){const S=document.elementFromPoint(x,j);return S instanceof HTMLElement?S.closest(".workspace-group[data-group-id]"):null}function Ql(x,j,S){const M=bu(j,S),q=M==null?void 0:M.dataset.workspaceId;if(M&&q&&q!==x){ri({kind:"workspace",id:q,position:lA(M,S)});return}const J=Va(j,S),be=J==null?void 0:J.dataset.groupId;if(!be){ri(null);return}ri({kind:"group",id:be})}function pd(x,j){Pi(x.target)||(x.currentTarget.setPointerCapture(x.pointerId),rl.current={id:j,pointerId:x.pointerId,startX:x.clientX,startY:x.clientY})}function xn(x,j){const S=rl.current;if(!S||S.id!==j||S.pointerId!==x.pointerId)return;const M=Math.hypot(x.clientX-S.startX,x.clientY-S.startY);if(ki!==j){if(M<jx)return;Bl(j),ri(null)}x.preventDefault(),Ma({x:x.clientX,y:x.clientY}),Ql(j,x.clientX,x.clientY)}async function zs(x,j){var be;x.preventDefault(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),rl.current=null;const S=ki===j;S&&(bs.current=!0);const M=Vn;if(!S||!M){Bl(null),ri(null),Ma(null);return}const q=p.find(Ue=>Ue.id===j),J=M.kind==="group"?M.id:(be=p.find(Ue=>Ue.id===M.id))==null?void 0:be.groupId;if(!q||!J){Bl(null),ri(null),Ma(null);return}if(g(Ue=>{const Ce=M.kind==="workspace"?aA(Ue.map(Se=>Se.id===j?{...Se,groupId:J}:Se),j,M.id,M.position):[...Ue.filter(Se=>Se.id!==j),{...q,groupId:J}];return _c(Ce.map(Se=>Se.id)),Ce}),q.groupId!==J)try{const Ue=await Ac(j,{groupId:J});Dn(Ue)}catch(Ue){console.error(Ue),await cn()}Bl(null),ri(null),Ma(null)}function Si(x){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),rl.current=null,Bl(null),ri(null),Ma(null)}function vu(x,j){x.currentTarget.setPointerCapture(x.pointerId),za.current={id:j,pointerId:x.pointerId,startX:x.clientX,startY:x.clientY}}function Or(x,j){const S=za.current;if(!S||S.id!==j||S.pointerId!==x.pointerId)return;const M=Math.hypot(x.clientX-S.startX,x.clientY-S.startY);if(yr!==j){if(M<jx)return;Ii(j),Ra(null)}x.preventDefault();const q=Va(x.clientX,x.clientY),J=q==null?void 0:q.dataset.groupId;Ra(J&&J!==j?J:null)}function hl(x,j){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId);const S=yr===j;S&&(x.preventDefault(),vs.current=!0);const M=nu;S&&M&&b(q=>{const J=rA(q,j,M);return _v(J.map(be=>be.id)),J}),za.current=null,Ii(null),Ra(null)}function Ls(x){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),za.current=null,Ii(null),Ra(null)}function wu(x){const j=x.target.value;Le(S=>S&&{...S,title:j})}function Is(x){const j=x.target.value;Le(S=>S&&{...S,groupId:j})}function ku(x){const j=x.target.value;rn(S=>S&&{...S,title:j})}async function Cn(x){if(x.preventDefault(),!xe)return;const j=xe.title.trim();if(j){Ot(!0);try{if(xe.mode==="create"){await yu(j,xe.groupId),Vi();return}xe.conversationId&&await Mr(xe.conversationId,j)}catch(S){console.error(S);const M=Ve(S);je("error",xe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",M.detail??M.message)}finally{Ot(!1)}}}function Ci(x){x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),Vi())}async function Zl(x){if(x.preventDefault(),!zt)return;const j=zt.title.trim();if(j)try{if(zt.mode==="rename"){if(!zt.groupId)return;const M=await d2(zt.groupId,{title:j});b(q=>q.map(J=>J.id===M.id?M:J)),pl();return}const S=await c2(j);b(M=>[...M,S]),Pn(M=>{const q=new Set(M);return q.delete(S.id),fp(q),q}),pl()}catch(S){console.error(S)}}function Jl(x){x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),pl())}async function Pa(x){x.preventDefault(),await Wn()}function Tn(x){u(x),dp(y,x)}function tn(x,j){Nx(x).trim()===j&&dp(x,""),y===x&&u(S=>S.trim()===j?"":S)}function dn(x,j){d(S=>{const M=new Set(S);return j?M.add(x):M.delete(x),M})}function En(x){const j=Ve(x);je("error","Message was not confirmed",`${j.message}. Your text is still in the composer and can be retried.`)}async function Wn(x={}){const j=r.trim();if(!j)return;if(!y){jn();return}const S=y,M=It.current.has(S),q=wr.current.has(S);if(q)return;if(Pl==="running"||Ts||M||q){if(x.forceNewTurn&&!w){await Bs(S,j);return}await ju(S,j);return}wr.current.add(S),dn(S,!0);const J=`local-${Date.now()}`;st(S,Ce=>({...Ce,messages:[...Ce.messages,{id:J,role:"user",content:j,createdAt:new Date().toISOString()}],status:"running"})),ci(S,"running"),nn(S,!0);const be=new AbortController;gn.current.set(S,be);let Ue=!1;try{let Ce=null;const Se=fe(`conversations/${S}/turns`),Qt=await fetch(Se,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:j,workMode:R})});if(Qt.ok){const Bt=await Qt.json();if(!Bt.turnId)throw new Error("Turn did not return a turn id");if(Ce=Bt.turnId,(R==="complex"||w)&&($i(S),z("simple")),!Bt.message)throw new Error("Turn did not return the persisted message");An(S,J,Bt.message,Ce),Ue=!0,tn(S,j)}else{const Bt=await YE(Qt);if(Bt){Ce=Bt;const Ei=await Pe(S,Bt,j);if(!Ei.ok)throw await Vt(Ei,{method:"POST",url:fe(`conversations/${S}/turns/${Bt}/steer`)});const Fi=await Ei.json();if(!Fi.message)throw new Error("Steer did not return the persisted message");An(S,J,Fi.message,Bt),Ue=!0,tn(S,j)}else throw await Vt(Qt,{method:"POST",url:Se})}if(!Ce)throw await Vt(Qt,{method:"POST",url:Se});It.current.set(S,Ce),await ht(S,Ce);const St=fe(`conversations/${S}/turns/${Ce}/events`),Wa=await fetch(St,{signal:be.signal});if(!Wa.ok||!Wa.body)throw await Vt(Wa,{method:"GET",url:St});await _r(S),await Np(Wa.body,Bt=>{const Ei=wp(Bt,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);st(S,Lr=>({...Lr,status:ns(Ei)??Lr.status,events:vp(Lr.events,Ei)}));const Fi=ns(Ei);Fi&&ci(S,Fi)}),await Fn(S),await cn()}catch(Ce){if(kp(Ce))return;Ue||En(Ce);const Se=PE(Ce);Se&&je("error","Reset thread required",w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),It.current.has(S)||al.current.delete(S),st(S,Qt=>({...Qt,status:"error",events:[...Qt.events,{id:Qt.events.length+1,event:"client.error",data:Se?{message:"Reset thread required",detail:w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:ir(Ce),createdAt:new Date().toISOString()}]})),ci(S,"error"),await cn()}finally{wr.current.delete(S),dn(S,!1),It.current.delete(S),gn.current.get(S)===be&&gn.current.delete(S),nn(S,!1),await Kn(S)}}async function Kn(x){const j=Vl.current.get(x)??[];if(j.length===0)return;const[S,...M]=j;Vl.current.set(x,M),await ea(x,S)}async function Us(x,j={}){if(ui.current.has(x))return;const S=new AbortController;gn.current.set(x,S),nn(x,!0);try{const M=j.waitMs?`?waitMs=${j.waitMs}`:"",q=fe(`conversations/${x}/turns/current/events${M}`),J=await fetch(q,{signal:S.signal});if(!J.ok||!J.body)throw await Vt(J,{method:"GET",url:q});await _r(x),await Np(J.body,be=>{const Ue=wp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Ue.turnId&&!It.current.has(x)&&It.current.set(x,Ue.turnId),st(x,Se=>({...Se,status:ns(Ue)??Se.status,events:vp(Se.events,Ue)}));const Ce=ns(Ue);Ce&&ci(x,Ce)}),await Fn(x),await cn()}catch(M){if(!kp(M)){if(VE(M)){await Fn(x),await cn();return}st(x,q=>({...q,status:"error",events:[...q.events,{id:q.events.length+1,event:"client.error",data:ir(M),createdAt:new Date().toISOString()}]}))}}finally{It.current.delete(x),gn.current.get(x)===S&&gn.current.delete(x),nn(x,!1),await Kn(x)}}async function ea(x,j,S={}){if(It.current.has(x)){const q=Vl.current.get(x)??[];q.includes(j)||Vl.current.set(x,[...q,j]);return}const M=new AbortController;gn.current.set(x,M),It.current.set(x,j),nn(x,!0);try{const q=fe(`conversations/${x}/turns/${j}/events`),J=await fetch(q,{signal:M.signal});if(!J.ok||!J.body)throw await Vt(J,{method:"GET",url:q});await _r(x),await Np(J.body,be=>{const Ue=wp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);st(x,Se=>({...Se,status:ns(Ue)??Se.status,events:vp(Se.events,Ue)}));const Ce=ns(Ue);Ce&&ci(x,Ce)}),await Fn(x),await cn()}catch(q){if(!kp(q)){if(S.recovered&&GE(q)){await Fn(x),await cn();return}st(x,J=>({...J,status:"error",events:[...J.events,{id:J.events.length+1,event:"client.error",data:ir(q),createdAt:new Date().toISOString()}]}))}}finally{It.current.delete(x),gn.current.get(x)===M&&gn.current.delete(x),nn(x,!1),await Kn(x)}}async function Bs(x,j){dn(x,!0);let S=!1;const M=`local-queued-${Date.now()}`;st(x,q=>({...q,messages:[...q.messages,{id:M,role:"user",content:j,createdAt:new Date().toISOString()}]}));try{const q=fe(`conversations/${x}/turns`),J=await fetch(q,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:j,mode:"queue"})});if(!J.ok)throw await Vt(J,{method:"POST",url:q});const be=await J.json();if(!be.turnId)throw new Error("Queued turn did not return a turn id");if(!be.message)throw new Error("Queued turn did not return the persisted message");An(x,M,be.message,be.turnId),S=!0,tn(x,j),ea(x,be.turnId),await cn(),je("success",be.queuePosition?`Queued as next turn (${be.queuePosition})`:"Started new turn")}catch(q){S||En(q),st(x,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ir(q),createdAt:new Date().toISOString()}]}))}finally{dn(x,!1)}}async function ju(x,j){dn(x,!0);const S=It.current.get(x),M=`local-steer-${Date.now()}`;if(st(x,q=>({...q,messages:[...q.messages,{id:M,role:"user",content:j,createdAt:new Date().toISOString(),turnId:S??null}],status:"running"})),!S&&wr.current.has(x)){Yt(x,j,M),dn(x,!1);return}try{const q=fe(S?`conversations/${x}/turns/${S}/steer`:`conversations/${x}/turns/steer`),J=await fetch(q,Ex(j));if(!J.ok)throw await Vt(J,{method:"POST",url:q});const be=await J.json();if(!be.message)throw new Error("Steer did not return the persisted message");An(x,M,be.message,S),tn(x,j)}catch(q){En(q),st(x,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ir(q),createdAt:new Date().toISOString()}]}))}finally{dn(x,!1)}}function Yt(x,j,S){const M=al.current.get(x)??[];al.current.set(x,[...M,{message:j,localMessageId:S}])}async function ht(x,j){const S=al.current.get(x)??[];if(S.length!==0){al.current.delete(x);for(const M of S){const q=await Pe(x,j,M.message);if(!q.ok)throw await Vt(q,{method:"POST",url:fe(`conversations/${x}/turns/${j}/steer`)});const J=await q.json();J.message&&An(x,M.localMessageId,J.message,j)}}}async function Pe(x,j,S){return fetch(fe(`conversations/${x}/turns/${j}/steer`),Ex(S))}function An(x,j,S,M){st(x,q=>({...q,messages:yp(q.messages.filter(J=>J.id!==j),[{...S,turnId:M??S.turnId??null}])}))}async function Nn(){var S;if(!y||Pl!=="running"&&!Ts)return;const x=y,j=It.current.get(x);(S=gn.current.get(x))==null||S.abort(),nn(x,!1),st(x,M=>({...M,status:"done",events:[...M.events,{id:M.events.length+1,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),ci(x,"done");try{const M=fe(j?`conversations/${x}/turns/${j}/stop`:`conversations/${x}/turns/interrupt`),q=await fetch(M,{method:"POST"});if(!q.ok&&q.status!==409)throw await Vt(q,{method:"POST",url:M})}catch(M){st(x,q=>({...q,events:[...q.events,{id:q.events.length+1,event:"client.error",data:ir(M),createdAt:new Date().toISOString()}]}))}It.current.delete(x)}async function ml(x,j){if(!y||!x.approvalTurnId||x.approvalRequestId===void 0)return;const S=y;try{const M=fe(`conversations/${S}/turns/${x.approvalTurnId}/approvals/${encodeURIComponent(String(x.approvalRequestId))}`),q=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:j})});if(!q.ok)throw await Vt(q,{method:"POST",url:M});st(S,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"server.approval.decision",data:{requestId:x.approvalRequestId,decision:j,source:"client"},createdAt:new Date().toISOString()}]}))}catch(M){st(S,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ir(M),createdAt:new Date().toISOString()}]}));const q=Ve(M);je("error","Failed to respond to approval",q.detail??q.message)}}async function _n(x,j,S){const M=y,q=x.workspaceChangeProposalId??x.responsibilityProposalId;if(!M||!q)return!1;try{const J=fe(`conversations/${M}/workspace-change-proposals/${encodeURIComponent(q)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:j,payload:j==="accept"?S??x.workspaceChangePayload:void 0})});if(!be.ok)throw await Vt(be,{method:"POST",url:J});const Ue=await be.json();return Dn(Ue.conversation),st(M,Ce=>({...Ce,events:[...Ce.events,{id:`${x.id}:${j}`,event:"server.workspace_change.decision",data:{proposalId:q,changeType:x.workspaceChangeType??"responsibility",decision:j,payload:j==="accept"?S??x.workspaceChangePayload:null},createdAt:new Date().toISOString()}]})),je("success",j==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(J){console.error(J);const be=Ve(J);return je("error","Failed to respond to workspace change proposal",be.detail??be.message),!1}}async function ta(x,j,S){const M=y;if(!(!M||!x.knowledgeProposalId))try{let q;if(j==="accept")try{q=JSON.parse(S??x.body)}catch{je("error","Knowledge proposal JSON is invalid");return}const J=fe(`conversations/${M}/knowledge-proposals/${encodeURIComponent(x.knowledgeProposalId)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:j,knowledge:q})});if(!be.ok)throw await Vt(be,{method:"POST",url:J});const Ue=await be.json();kn([...Ue.items??[]].sort(eb)),st(M,Ce=>({...Ce,events:[...Ce.events,{id:`${x.id}:${j}`,event:"server.knowledge.decision",data:{proposalId:x.knowledgeProposalId,decision:j,knowledge:j==="accept"?Ue.item:null},createdAt:new Date().toISOString()}]})),je("success",j==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(q){console.error(q);const J=Ve(q);je("error","Failed to respond to knowledge proposal",J.detail??J.message)}}function Su(x){ce(j=>{const S=j[x.id],M=x.events.map(q=>({id:q.id,turnId:q.turnId,seq:q.seq,event:q.event,data:q.data,createdAt:q.createdAt}));return{...j,[x.id]:{messages:x.messages,events:Cc(M,(S==null?void 0:S.events)??[]),timelineNodes:bp(x.timelineNodes??[],(S==null?void 0:S.timelineNodes)??[]),turns:xp(x.turns??[],(S==null?void 0:S.turns)??[]),contextVersions:x.contextVersions??[],status:x.status,history:ol(x),loadingOlder:!1,fullEventTurnIds:(S==null?void 0:S.fullEventTurnIds)??new Set,loadingEventTurnIds:(S==null?void 0:S.loadingEventTurnIds)??new Set}}})}function na(x){const j=ol(x);st(x.id,S=>{var M,q,J;return{...S,messages:yp(x.messages,S.messages),timelineNodes:bp(x.timelineNodes??[],S.timelineNodes),turns:xp(x.turns??[],S.turns),events:Cc(x.events.map(be=>({id:be.id,turnId:be.turnId,seq:be.seq,event:be.event,data:be.data,createdAt:be.createdAt})),S.events),contextVersions:(((M=x.contextVersions)==null?void 0:M.length)??0)>0?x.contextVersions??[]:S.contextVersions,history:{...j,loadedMessageCount:j.loadedMessageCount+(((q=S.history)==null?void 0:q.loadedMessageCount)??S.messages.length),loadedEventCount:j.loadedEventCount+(((J=S.history)==null?void 0:J.loadedEventCount)??S.events.length)},loadingOlder:!1}})}function gl(x){const j=ol(x),S=x.events.map(M=>({id:M.id,turnId:M.turnId,seq:M.seq,event:M.event,data:M.data,createdAt:M.createdAt}));st(x.id,M=>{var q,J,be;return{...M,messages:yp(M.messages,x.messages),timelineNodes:bp(M.timelineNodes,x.timelineNodes??[]),turns:xp(M.turns,x.turns??[]),events:Cc(S,M.events),contextVersions:(((q=x.contextVersions)==null?void 0:q.length)??0)>0?x.contextVersions??[]:M.contextVersions,status:x.status,history:{...M.history??j,messageTotal:j.messageTotal,eventTotal:j.eventTotal,loadedMessageCount:Math.max(((J=M.history)==null?void 0:J.loadedMessageCount)??M.messages.length,M.messages.length,x.messages.length),loadedEventCount:Math.max(((be=M.history)==null?void 0:be.loadedEventCount)??M.events.length,M.events.length,x.events.length)},loadingOlder:!1}})}function st(x,j){ce(S=>{const M=S[x]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...S,[x]:j(M)}})}function ci(x,j){g(S=>S.map(M=>M.id===x?{...M,status:j,updatedAt:new Date().toISOString()}:M))}function Dn(x){g(j=>So(j.map(S=>S.id===x.id?{...S,...x}:S)))}async function yl(x,j){const S=j.filter(M=>{const q=te[x];return q&&!q.fullEventTurnIds.has(M)&&!q.loadingEventTurnIds.has(M)});if(S.length!==0){st(x,M=>{const q=new Set(M.loadingEventTurnIds);for(const J of S)q.add(J);return{...M,loadingEventTurnIds:q}});try{const M=await Promise.all(S.map(q=>c_(x,q)));st(x,q=>{const J=new Set(q.fullEventTurnIds),be=new Set(q.loadingEventTurnIds),Ue=M.flatMap((Ce,Se)=>{const Qt=S[Se];return J.add(Qt),be.delete(Qt),Ce.map(St=>({id:St.id,turnId:St.turnId,seq:St.seq,event:St.event,data:St.data,createdAt:St.createdAt}))});return{...q,events:Cc(q.events,Ue),fullEventTurnIds:J,loadingEventTurnIds:be}})}catch(M){console.error(M),st(x,q=>{const J=new Set(q.loadingEventTurnIds);for(const be of S)J.delete(be);return{...q,loadingEventTurnIds:J}}),je("error","Failed to load process details")}}}function nn(x,j){const S=new Set(ui.current);j?S.add(x):S.delete(x),ui.current=S,ps(M=>{const q=new Set(M);return j?q.add(x):q.delete(x),q})}function Yi(x){x.key!=="Enter"||!x.metaKey&&!x.ctrlKey||x.nativeEvent.isComposing||(x.preventDefault(),Wn({forceNewTurn:x.shiftKey}))}function Ti(x){Pn(j=>{const S=new Set(j);return S.has(x)?S.delete(x):S.add(x),fp(S),S})}function qs(x){var j;return _E(x.status,(j=x.nextWakeup)==null?void 0:j.status,Ul.has(x.id))}function Ya(x){var M;const j=(M=ys.current)==null?void 0:M.getBoundingClientRect(),S=j?x-j.left:x;return wh(S)}function ia(x){x.preventDefault(),x.currentTarget.setPointerCapture(x.pointerId),Oa(Ya(x.clientX))}function zr(x){x.currentTarget.hasPointerCapture(x.pointerId)&&(x.preventDefault(),Oa(Ya(x.clientX)))}function xl(x){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId);const j=Ya(x.clientX);Oa(j),WE(j)}return s.jsxs("main",{className:`shell${ee?" mobile-sidebar-open":""}`,ref:ys,style:{"--sidebar-width":`${ms}px`},children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),ue?s.jsxs("span",{children:["v",ue]}):null,s.jsx("span",{"aria-label":ub(me),className:`backend-status ${me}`,"data-label":ub(me)})]}),s.jsxs("div",{className:"sidebar-title-row",children:[s.jsx("h2",{children:"Workspaces"}),e?s.jsx("button",{"aria-label":`Sign out ${i.username}`,className:"sign-out-button",onClick:l,title:`Sign out ${i.username}`,type:"button",children:"Sign out"}):null]})]}),s.jsxs("div",{className:"sidebar-header-actions",children:[s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>I(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:jn,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:La.map(x=>s.jsxs("section",{className:["workspace-group",yr===x.id?"dragging":"",nu===x.id?"drop-after":"",(Vn==null?void 0:Vn.kind)==="group"&&Vn.id===x.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":x.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!ql.has(x.id),className:"workspace-group-toggle",onClick:j=>{if(vs.current){j.preventDefault(),vs.current=!1;return}Ti(x.id)},onDoubleClick:j=>{j.preventDefault(),j.stopPropagation(),Dr(x)},onPointerCancel:Ls,onPointerDown:j=>vu(j,x.id),onPointerMove:j=>Or(j,x.id),onPointerUp:j=>hl(j,x.id),type:"button",children:[s.jsx("span",{className:ql.has(x.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:j=>{j.preventDefault(),j.stopPropagation(),Dr(x)},title:"Double-click to rename",children:x.title})]}),x.id!==Cx?s.jsx("button",{"aria-label":`Delete group ${x.title}`,className:"workspace-group-delete",onClick:j=>{j.stopPropagation(),Sn(x)},title:"Delete group",type:"button",children:"×"}):null]}),ql.has(x.id)?null:s.jsx("div",{className:"workspace-group-items",children:x.conversations.map(j=>{const S=qs(j);return s.jsxs("div",{className:["session-item",j.id===y?"active":"",j.id===ki?"dragging":"",(Vn==null?void 0:Vn.kind)==="workspace"&&Vn.id===j.id?`drop-${Vn.position}`:""].filter(Boolean).join(" "),"data-workspace-id":j.id,onClick:M=>{if(bs.current){M.preventDefault(),bs.current=!1;return}k(j.id),I(!1)},onDoubleClick:M=>{Pi(M.target)||(M.preventDefault(),Xl(j))},onKeyDown:M=>{Os(M.target)||M.key==="Enter"&&(k(j.id),I(!1))},onPointerCancel:Si,onPointerDown:M=>pd(M,j.id),onPointerMove:M=>xn(M,j.id),onPointerUp:M=>zs(M,j.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":Oc(S,j.nextWakeup,Ui),className:`session-status ${S}`,title:Oc(S,j.nextWakeup,Ui)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:j.title}),S==="waiting"&&j.nextWakeup?s.jsx("span",{className:"session-countdown",title:Oc(S,j.nextWakeup,Ui),children:$c(j.nextWakeup,Ui)}):null,j.unreadTurnCount>0?s.jsx("span",{"aria-label":`${j.unreadTurnCount} unread turns`,className:"session-unread",title:`${j.unreadTurnCount} unread turns`,children:j.unreadTurnCount>99?"99+":j.unreadTurnCount}):null,S!=="running"?s.jsx("button",{"aria-label":`Delete ${j.title}`,className:"session-delete",onClick:M=>{M.stopPropagation(),Ye(j)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:j.workspacePath,children:["workspaces/",as(j.id)]})]},j.id)})})]},x.id))}),s.jsx("footer",{className:"sidebar-footer",children:s.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[s.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:ou,type:"button",children:s.jsx(Gx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:xu,type:"button",children:s.jsx(QN,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{_t(!0),I(!1)},type:"button",children:s.jsx(Dc,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:cu,type:"button",children:s.jsx(ZN,{})}),s.jsx(JA,{usage:id})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>I(!1),tabIndex:ee?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:ia,onPointerMove:zr,onPointerUp:xl,role:"separator",tabIndex:0}),ws&&hs?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${hs.x+12}px, ${hs.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:ws.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",as(ws.id)]})]}):null,xe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Ci,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Ci,onSubmit:x=>void Cn(x),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:wu,onKeyDown:Ci,value:xe.title}),xe.mode==="create"?s.jsxs(s.Fragment,{children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),s.jsx("select",{id:"workspace-group",onChange:Is,onKeyDown:Ci,value:xe.groupId??((Hs=m[0])==null?void 0:Hs.id)??"",children:m.map(x=>s.jsx("option",{value:x.id,children:x.title},x.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:Vi,children:"Cancel"}),s.jsx("button",{disabled:Xe,type:"submit",children:Xe?"Saving...":xe.mode==="create"?"Create":"Save"})]})]})}):null,zt?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Jl,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Jl,onSubmit:x=>void Zl(x),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),s.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:ku,onKeyDown:Jl,value:zt.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:pl,children:"Cancel"}),s.jsx("button",{type:"submit",children:zt.mode==="create"?"Create":"Save"})]})]})}):null,ze?s.jsx(pA,{currentUser:i,conversations:p,editingEnvironmentKey:fs,environmentDraft:Hn,globalEnvironment:sn,workspaceEnvironment:gi,memorySettings:Wo,memorySettingsDraft:Ko,workspaceMemoryDraft:ds,runtimeSettings:Di,runtimeModels:Rl,runtimeCodexVersion:he,runtimeCodexReleasedAt:Ae,runtimeCodexUpdating:(tt==null?void 0:tt.status)==="running",runtimeSettingsDraft:Aa,runtimeSettingsScope:Pt,settingsWorkspace:Xt,settingsWorkspaceId:ot,systemDiagnostics:De,systemDiagnosticsLoading:A,workspaceGroups:La,workspaceRuntimeSettings:Fo,workspaceRuntimeSettingsDraft:Ol,managedUsers:oe,onCancelEnvironmentEdit:mu,onClose:()=>wt(!1),onCreateUser:async x=>{const j=await iD(x);ye(S=>[...S,j]),je("success","User created")},onDeleteUser:async x=>{await aD(x),ye(j=>j.filter(S=>S.id!==x)),je("success","User deleted")},onDeleteEnvironment:x=>void ud(x),onDraftChange:Mi,onEditEnvironment:Ms,onRevealEnvironmentValue:x=>void dl(x),onSaveBaseMemoryItems:x=>pu(x),onSaveResponsibility:async(x,j)=>{try{const S=await Ac(x,{responsibility:j});return Dn(S),Z("connected"),je("success","Workspace responsibility saved"),S.responsibility}catch(S){throw console.error(S),Z("error"),je("error","Failed to save workspace responsibility"),S}},onSaveWorkspaceMemoryItems:x=>ot?hu(ot,x):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:Ml,onGlobalSettingsImported:async()=>{await Nr(ot),je("success","Global settings imported")},onCodexAccountSwitched:async()=>{await Promise.all([Cr(!0),Hi(!0),cl()]),je("success","Codex account switched")},onUpdateCodexCli:()=>{mn(!0),Ns(!0)},onRuntimeScopeChange:xi,onSettingsWorkspaceChange:rd,onSubmitRuntimeSettings:x=>void sd(x),onWorkspaceRuntimeDraftChange:_a,onWorkspaceRuntimeReset:x=>ot?void fu(ot,x):void 0,revealedEnvironmentKeys:Qo,onSubmitEnvironment:x=>void Ds(x),onRefreshSystemDiagnostics:()=>void Ha(),onUpdateUser:async(x,j)=>{const S=await lD(x,j);ye(M=>M.map(q=>q.id===S.id?S:q)),je("success","User updated")}}):null,At?s.jsx(fA,{currentReleasedAt:Ae,currentVersion:he,job:tt,latest:Ri,latestChecking:Qc,starting:on,onClose:()=>mn(!1),onRefresh:()=>void Ns(),onStart:()=>void Er()}):null,Da&&Ne?s.jsx(oA,{conversation:Ne,clockNow:Ui,knowledgeDraft:bt,workspaceKnowledge:Xo,tokenUsage:Ia,onCancelKnowledgeEdit:()=>Nt(jo),onDeleteKnowledge:x=>void Rs(Ne.id,x),onEditKnowledge:Ga,onKnowledgeDraftChange:Nt,onSubmitKnowledge:x=>void Wl(Ne.id,x),onClose:()=>Oi(!1)}):null,zl?s.jsx(uA,{conversations:p,onClose:()=>_t(!1),workspaceGroups:La}):null,zi?s.jsx(cA,{busy:Zc,conversation:ji??null,conversationId:vi,preview:($n==null?void 0:$n.conversationId)===vi?$n:null,previewLoading:Zo,result:wi,status:ed,warmup:Li,workspaceGroups:La,onClose:()=>nl(!1),onCancelResetPreview:()=>ii(null),onPreviewReset:()=>void od(),onStartBlankContext:()=>void $a(),onResetRuntime:x=>void yn(x),onSaveResetSelection:du,onWorkspaceChange:x=>{mr(x),Dt(null),ii(null)},onWarmupChange:Ll}):null,se?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!X&&_(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:cd,onMouseDown:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>_(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:se.name,onChange:x=>_(j=>j&&{...j,name:x.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:se.groupId,onChange:x=>_(j=>j&&{...j,groupId:x.target.value}),children:La.map(x=>s.jsx("option",{value:x.id,children:x.title},x.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:X,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:X||!se.name.trim(),type:"submit",children:X?"Cloning...":"Clone"})]})]})}):null,N?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>G(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:x=>x.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:N.title}),s.jsxs("p",{children:[ob(N.status),N.startedAt&&N.finishedAt?` · ${V_(N.startedAt,N.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>G(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:N.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:N.status==="completed"?"Final plan":"Current plan"}),N.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:ja(N.currentPlan.planMarkdown,Ne)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:N.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:N.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:N.startedAt?$e(N.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:N.finishedAt?$e(N.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>G(null),type:"button",children:"Close"})})]})}):null,B?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>P(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:x=>x.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:B.title}),s.jsx("p",{children:$e(B.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>P(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(Mo,{content:B.fullDetail??B.detail??"No additional details.",conversation:Ne,streaming:!1,onPreviewArtifact:li,onCopyArtifactUrl:ul,copiedArtifactUrl:ai})}),s.jsxs("footer",{children:[B.linkedTaskId?s.jsx("button",{onClick:()=>{const x=B.linkedTaskId;P(null),Gi(x)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>P(null),type:"button",children:"Close"})]})]})}):null,Wt?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Et||Ye(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:x=>x.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Move Workspace to Recycle"}),s.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:Et,onClick:()=>Ye(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:Wt.title})," to recycle?"]}),s.jsx("code",{children:Wt.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Et,onClick:()=>Ye(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Et,onClick:()=>void Rr(Wt),type:"button",children:Et?"Moving...":"Move to recycle"})]})]})}):null,Il?s.jsxs("div",{className:`app-toast ${Il.tone}`,role:"status",children:[s.jsx("strong",{children:Il.text}),Il.detail?s.jsx("pre",{children:Il.detail}):null]}):null,s.jsxs("section",{className:"conversation",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-main",children:[s.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>I(!0),title:"Workspaces",type:"button",children:s.jsx(XN,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Ne==null?void 0:Ne.title)??"New workspace"})}),Ne?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",as(Ne.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Ne?s.jsxs(s.Fragment,{children:[Ne.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:cu,title:`当前 Thread 工具集已过期(${Ne.threadCapabilityVersion} / ${Ne.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(Xv,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:gu,title:"Clone workspace",type:"button",children:s.jsx(KN,{})}),s.jsxs("button",{className:`context-button has-usage ${Nh(Ua??0)}`,onClick:()=>Oi(!0),style:{"--context-usage":`${Kc(Ua??0)}%`},title:Ia&&Ua!==null?`Context ${Math.round(Ua)}% · ${Un(Ia.totalTokens)} / ${Mc(Ia.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(Ua??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:uu,title:"Workspace settings",type:"button",children:s.jsx(Gx,{})})]}):null})]}),w?s.jsxs("section",{className:`complex-task-bar ${w.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void Gi(w.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:w.title}),s.jsx("span",{className:"complex-task-state",children:ob(w.status)}),s.jsx("span",{className:"complex-task-duration",children:G_(w,Ui)})]}),s.jsxs("div",{className:"complex-task-actions",children:[_p(w.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!w.objective||!w.currentPlan,onClick:()=>void Kl("start"),title:w.objective&&w.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,w.status==="active"?s.jsx("button",{onClick:()=>void Kl("pause"),type:"button",children:"Pause"}):null,_p(w.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void Kl("resume"),type:"button",children:"Resume"}):null,_p(w.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void Kl("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void Kl("end"),type:"button",children:"End task"})]})]}):null,(Ne==null?void 0:Ne.status)==="initialization_failed"&&Ne.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:Ne.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void dd(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void As(),ref:Bi,style:{scrollPaddingBottom:ll},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:ll},children:[sl.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("h2",{children:"Start a workspace"})}):null,s.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[Ne!=null&&Ne.cloneLineage&&Cs.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Ne.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",$e(Ne.cloneLineage.snapshotAt)," · ",Ne.cloneLineage.importedMessageCount," messages"]})]}):null,(Cu=lt==null?void 0:lt.history)!=null&&Cu.hasMoreBefore?s.jsx("div",{className:"history-loader",children:lt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,Ss.map((x,j)=>{var be,Ue,Ce;const S=((be=x.user)==null?void 0:be.type)==="system",M=x.turnIds.some(Se=>Cs.has(Se)),q=Ss[j+1],J=M&&(!q||!q.turnIds.some(Se=>Cs.has(Se)));return s.jsxs(D.Fragment,{children:[s.jsxs("section",{className:`turn-group${M?" clone-history-turn":""}`,"data-turn-id":x.id,children:[x.user?s.jsxs("div",{className:`turn-panel ${S?"system-turn":"user-turn"}`,children:[_o(x.user,Ne,li,ul,ai,ml,_n,ta,Gi,P),s.jsx(Do,{copied:Kt===`${S?"system":"user"}-${x.id}-bottom`,content:Ro(x.user),id:`${S?"system":"user"}-${x.id}-bottom`,timestamp:x.user.createdAt,variant:"outside",onCopy:Yl})]}):null,x.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:x.followupUsers.map(Se=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),_o(Se,Ne,li,ul,ai,ml,_n,ta,Gi,P),s.jsx(Do,{copied:Kt===`user-${Se.id}-bottom`,content:Ro(Se),id:`user-${Se.id}-bottom`,timestamp:Se.createdAt,variant:"outside",onCopy:Yl})]},Se.id))}):null,(Ue=x.acceptedSystemInputs)==null?void 0:Ue.map(Se=>s.jsxs("div",{className:"turn-panel system-turn",children:[_o(Se,Ne,li,ul,ai,ml,_n,ta,Gi,P),s.jsx(Do,{copied:Kt===`system-${Se.id}-bottom`,content:Ro(Se),id:`system-${Se.id}-bottom`,timestamp:Se.createdAt,variant:"outside",onCopy:Yl})]},Se.id)),x.agentItems.length>0?s.jsx(BA,{group:x,conversation:Ne,allowProcessView:!M,copiedFooter:Kt===`agent-${x.id}-bottom`,copiedArtifactUrl:ai,running:!M&&Io(x.turnIds,Ba),onCopyArtifactUrl:ul,onCopyBubble:Yl,onPreviewArtifact:li,onLoadProcessDetails:Se=>Ne&&!M?yl(Ne.id,Se):void 0,onRespondApproval:ml,onRespondWorkspaceChangeProposal:_n,onRespondKnowledgeProposal:ta,onOpenComplexTask:Gi,onOpenSystemEvent:P}):null,(Ce=x.trailingSystemItems)==null?void 0:Ce.map(Se=>s.jsxs("div",{className:"turn-panel system-turn",children:[_o(Se,Ne,li,ul,ai,ml,_n,ta,Gi,P),s.jsx(Do,{copied:Kt===`system-${Se.id}-bottom`,content:Ro(Se),id:`system-${Se.id}-bottom`,timestamp:Se.createdAt,variant:"outside",onCopy:Yl})]},Se.id))]}),J?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},x.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:Pa,ref:si,children:[qa?s.jsxs("div",{className:`global-activity ${qa.tone??"running"}`,children:[Sr?s.jsx("button",{"aria-label":"Stop current agent run",className:"turn-stop activity-stop",onClick:()=>void Nn(),title:"Stop current agent run",type:"button",children:s.jsx($A,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:qa.title}),qa.detail?s.jsx("small",{children:qa.detail}):null]}),Sr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":w?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!w||R==="complex",className:`complex-mode-button ${w||R==="complex"?"active":""}`,disabled:!!w,onClick:()=>z(x=>x==="complex"?"simple":"complex"),title:w?"End the current complex task before switching back":R==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(Mv,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:w?"Complex task active":R==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{disabled:y!==null&&c.has(y),onChange:x=>Tn(x.target.value),onKeyDown:Yi,placeholder:"Cmd/Ctrl + Enter",ref:xr,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:!r.trim()||y!==null&&c.has(y),type:"submit",children:[s.jsx(GA,{}),s.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),s.jsxs("span",{children:[s.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),Gn?s.jsx("div",{className:"artifact-lightbox",onClick:()=>li(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:x=>x.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>li(null),type:"button",children:"×"}),s.jsx("img",{alt:Gn.name,src:Gn.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:Gn.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:Gn.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void ul(Gn),type:"button",children:ai===Gn.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function oA({conversation:e,clockNow:i,knowledgeDraft:l,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[y,k]=D.useState("overview"),[w,T]=D.useState(!1),[R,z]=D.useState(!1),[N,G]=D.useState(null),[B,P]=D.useState(null),[se,_]=D.useState(!1),[X,ae]=D.useState(null),[ee,I]=D.useState(null),[te,ce]=D.useState(!1),[Ee,ge]=D.useState(null),[ue,V]=D.useState(null),oe=fw(u),ye=Jp(e,e.status),De=N?__(N):null;D.useEffect(()=>{T(!1),G(null),P(null),ae(null),I(null),ge(null),V(null)},[e.id]),D.useEffect(()=>{y==="additionalContext"&&!X&&A()},[y,X]),D.useEffect(()=>{y==="compactions"&&!Ee&&L()},[y,Ee]);const O=()=>{T(!0),z(!0),P(null),z2(e.id).then(C=>G(C)).catch(C=>{const K=Ve(C);P(K.detail?`${K.message}
87
+ ${K.detail}`:K.message)}).finally(()=>z(!1))},A=()=>{_(!0),I(null),I2(e.id).then(C=>ae(C)).catch(C=>{const K=Ve(C);I(K.detail?`${K.message}
88
+ ${K.detail}`:K.message)}).finally(()=>_(!1))},L=()=>{ce(!0),V(null),U2(e.id).then(C=>ge(C)).catch(C=>{const K=Ve(C);V(K.detail?`${K.message}
89
+ ${K.detail}`:K.message)}).finally(()=>ce(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:C=>C.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:y==="overview"?"active":void 0,onClick:()=>k("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:y==="responsibility"?"active":void 0,onClick:()=>k("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:y==="knowledge"?"active":void 0,onClick:()=>k("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:y==="runtime"?"active":void 0,onClick:()=>k("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:y==="compactions"?"active":void 0,onClick:()=>k("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:y==="additionalContext"?"active":void 0,onClick:()=>k("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:y==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${ye}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:Oc(ye,e.nextWakeup,i)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(Je,{label:"Wake at",value:Ho(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:$c(e.nextWakeup,i)}):null,s.jsx(Je,{label:"Created by",value:e.nextWakeup.createdBy}),s.jsx(Je,{label:"Attempts",value:`${e.nextWakeup.attemptCount} / ${e.nextWakeup.maxAttempts}`,mono:!0}),s.jsxs("div",{className:"workspace-status-detail-text",children:[s.jsx("span",{children:"Wakeup instruction"}),s.jsx("pre",{children:e.nextWakeup.instruction})]}),e.nextWakeup.error?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Wakeup error"}),s.jsx("pre",{children:e.nextWakeup.error})]}):null]}):null,e.statusError?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Error"}),s.jsx("pre",{children:e.statusError})]}):e.status==="error"||e.status==="initialization_failed"?s.jsx("p",{className:"context-muted",children:"No persisted error detail is available for this status."}):null]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Workspace"}),s.jsx(Je,{label:"Name",value:e.title}),s.jsx(Je,{label:"ID",value:`workspaces/${as(e.id)}`,mono:!0}),s.jsx(Je,{label:"Path",value:e.workspacePath,mono:!0})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Context Assets"}),s.jsx(Je,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),s.jsx(Je,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),s.jsx(Je,{label:"Knowledge",value:`${r.length} item${r.length===1?"":"s"}`})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Current Responsibility"}),e.responsibility.trim()?s.jsx("div",{className:"context-markdown-preview",children:ja(e.responsibility,e)}):s.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Knowledge Index"}),s.jsx(Rv,{items:r,onDelete:d,onEdit:C=>{p(C),k("knowledge")}})]})]}):y==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:ja(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):y==="knowledge"?s.jsx(NA,{draft:l,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):y==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Je,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:R,onClick:O,type:"button",children:R?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:R,onClick:()=>T(!1),type:"button",children:"Hide"}):null]})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Token Window"}),u?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Used",value:oe===null?"unknown":`${Math.round(oe)}%`,mono:!0}),s.jsx(Je,{label:"Latest usage",value:u.modelContextWindow?`${Un(u.totalTokens)} / ${Un(u.modelContextWindow)}`:Un(u.totalTokens),mono:!0}),oe!==null?s.jsx("div",{className:`context-token-bar ${Nh(oe)}`,children:s.jsx("span",{style:{width:`${Kc(oe)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${Mc(u.inputTokens)} / ${Mc(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:Mc(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",$e(u.createdAt),"."]})]}):s.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),w?s.jsxs("section",{className:"context-card wide thread-read-panel",children:[s.jsx("h3",{children:"Runtime thread profile"}),s.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),R?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):B?s.jsx("pre",{className:"thread-read-error",children:B}):N?s.jsxs(s.Fragment,{children:[De?s.jsx(LA,{summary:De}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(N,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):y==="compactions"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Context Compactions"}),s.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),s.jsx("button",{className:"context-refresh-button",disabled:te,onClick:L,type:"button",children:te?"Refreshing...":"Refresh"})]}),ue?s.jsx("pre",{className:"thread-read-error",children:ue}):te&&!Ee?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ee!=null&&Ee.length?s.jsx("div",{className:"context-compaction-list",children:Ee.map(C=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:$e(C.completedAt??C.usageObservedAt??C.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${C.status}`,children:C.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:j_(C).map(K=>s.jsxs("div",{children:[s.jsx("dt",{children:K.label}),s.jsx("dd",{children:K.value})]},K.label))}),s.jsxs("small",{children:[Ca(C.id),C.turnId?` · turn ${Ca(C.turnId)}`:""]})]},C.id))}):s.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):s.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Additional Context"}),s.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),se?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):ee?s.jsx("pre",{className:"thread-read-error",children:ee}):X?s.jsx(OA,{preview:X,refreshing:se,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function uA({conversations:e,onClose:i,workspaceGroups:l}){var O;const[r,u]=D.useState([]),[c,d]=D.useState("active"),[p,g]=D.useState(null),[m,b]=D.useState([]),[y,k]=D.useState(!0),[w,T]=D.useState(null),[R,z]=D.useState(null),[N,G]=D.useState(!1),[B,P]=D.useState(!1),[se,_]=D.useState(new Set),[X,ae]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),ee=r.find(A=>A.id===p)??null,I=D.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),te=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),ce=l.map(A=>({...A,conversations:A.conversations.filter(L=>L.id!==X.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Ee=()=>{var A;ae({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),_(new Set),z("create")},ge=()=>{!ee||ee.status!=="active"||(ae({title:ee.title,publicDescription:ee.publicDescription,ownerWorkspaceId:ee.ownerWorkspaceId,participantWorkspaceIds:ee.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),_(new Set),z("edit"))},ue=async(A,L=c)=>{var C;k(!0),T(null);try{const K=await Fx();u(K);const me=K.filter(xe=>L==="archived"?xe.status==="archived":xe.status!=="archived"),Z=(A&&me.some(xe=>xe.id===A)?A:null)??(p&&me.some(xe=>xe.id===p)?p:((C=me[0])==null?void 0:C.id)??null);g(Z),b(Z?await Ec(Z):[])}catch(K){T(K instanceof Zi?K.detail:K instanceof Error?K.message:String(K))}finally{k(!1)}};D.useEffect(()=>{ue()},[]),D.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const L=await Fx();u(L),p&&L.some(C=>C.id===p)&&b(await Ec(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const V=async A=>{g(A),T(null);try{b(await Ec(A))}catch(L){T(L instanceof Zi?L.detail:L instanceof Error?L.message:String(L))}},oe=async A=>{var C;if(A===c)return;d(A),T(null);const L=((C=r.find(K=>A==="archived"?K.status==="archived":K.status!=="archived"))==null?void 0:C.id)??null;if(g(L),!L){b([]);return}try{b(await Ec(L))}catch(K){T(K instanceof Zi?K.detail:K instanceof Error?K.message:String(K))}},ye=async A=>{var L;if(A.preventDefault(),!(!X.title.trim()||!X.ownerWorkspaceId)){P(!0),T(null);try{const C=R==="edit"&&ee?await s2(ee.id,{expectedVersion:ee.version,title:X.title.trim(),publicDescription:X.publicDescription.trim(),participantWorkspaceIds:X.participantWorkspaceIds}):await r2({...X,title:X.title.trim(),publicDescription:X.publicDescription.trim()});d("active"),z(null),ae({title:"",publicDescription:"",ownerWorkspaceId:((L=e[0])==null?void 0:L.id)??"",participantWorkspaceIds:[]}),await ue(C.id,"active")}catch(C){T(C instanceof Zi?C.detail:C instanceof Error?C.message:String(C))}finally{P(!1)}}},De=async()=>{if(!(!ee||ee.status!=="active")){P(!0),T(null);try{const A=await o2(ee.id,ee.version);G(!1),d("active"),await ue(void 0,"active")}catch(A){T(A instanceof Zi?A.detail:A instanceof Error?A.message:String(A))}finally{P(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"协作"}),s.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),s.jsxs("div",{className:"collaboration-header-actions",children:[s.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Ee,title:"新建 Topic",type:"button",children:"+"}),s.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),w?s.jsx("div",{className:"collaboration-error",children:w}):null,s.jsxs("div",{className:"collaboration-body",children:[s.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[s.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[s.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void oe("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void oe("archived"),role:"tab",type:"button",children:"已归档"})]}),y?s.jsx("p",{children:"正在加载..."}):te.length===0?s.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):te.map(A=>s.jsxs("button",{className:`collaboration-topic-entry${A.id===p?" active":""}`,onClick:()=>void V(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:ee?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:ee.title}),s.jsx("p",{children:ee.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:ee.status}),ee.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${ee.title}`,className:"memory-icon-button",onClick:ge,title:"编辑",type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":`归档 Topic ${ee.title}`,className:"memory-icon-button",onClick:()=>G(!0),title:"归档",type:"button",children:s.jsx(JN,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:ee.members.filter(A=>A.status==="active").map(A=>s.jsxs("span",{children:[A.workspaceTitleSnapshot,s.jsx("small",{children:A.role})]},`${A.workspaceId}-${A.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(A=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:A.senderTitleSnapshot}),s.jsx("span",{children:A.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${ew(A.recipientWorkspaceIds.map(L=>I.get(L)??Ca(L)))}`}),s.jsx("time",{children:$e(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:ja(A.contentMarkdown,void 0)})]},A.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),R?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!B&&z(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:ye,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:R==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:R==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>z(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:X.title,onChange:A=>ae(L=>({...L,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:X.publicDescription,onChange:A=>ae(L=>({...L,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:R==="edit",value:X.ownerWorkspaceId,onChange:A=>ae(L=>({...L,ownerWorkspaceId:A.target.value,participantWorkspaceIds:L.participantWorkspaceIds.filter(C=>C!==A.target.value)})),children:l.map(A=>s.jsx("optgroup",{label:A.title,children:A.conversations.map(L=>s.jsx("option",{value:L.id,children:L.title},L.id))},A.id))})]}),s.jsxs("fieldset",{className:"collaboration-participant-groups",children:[s.jsx("legend",{children:"参与工作空间"}),s.jsxs("div",{className:"collaboration-participant-toolbar",children:[s.jsxs("span",{children:[X.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>_(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>_(new Set(ce.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),ce.map(A=>{const L=A.conversations,C=L.filter(me=>X.participantWorkspaceIds.includes(me.id)).length,K=se.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!K,className:"collaboration-group-toggle",onClick:()=>_(me=>{const Z=new Set(me);return Z.has(A.id)?Z.delete(A.id):Z.add(A.id),Z}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:K?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[C,"/",L.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:C===L.length,onChange:()=>ae(me=>{const Z=L.map(Le=>Le.id),xe=new Set(me.participantWorkspaceIds);return Z.every(Le=>xe.has(Le))?Z.forEach(Le=>xe.delete(Le)):Z.forEach(Le=>xe.add(Le)),{...me,participantWorkspaceIds:Array.from(xe)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),K?null:s.jsx("div",{children:L.map(me=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:X.participantWorkspaceIds.includes(me.id),onChange:Z=>ae(xe=>({...xe,participantWorkspaceIds:Z.target.checked?[...xe.participantWorkspaceIds,me.id]:xe.participantWorkspaceIds.filter(Le=>Le!==me.id)})),type:"checkbox"}),s.jsx("span",{children:me.title})]},me.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:B,onClick:()=>z(null),type:"button",children:"取消"}),s.jsx("button",{disabled:B||!X.title.trim()||!X.ownerWorkspaceId,type:"submit",children:B?"正在保存...":R==="edit"?"保存":"创建 Topic"})]})]})}):null,N&&ee?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!B&&G(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>G(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:ee.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:B,onClick:()=>G(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:B,onClick:()=>void De(),type:"button",children:B?"正在归档...":"归档"})]})]})}):null]})})}function cA({busy:e,conversation:i,conversationId:l,preview:r,previewLoading:u,result:c,status:d,warmup:p,workspaceGroups:g,onCancelResetPreview:m,onClose:b,onPreviewReset:y,onStartBlankContext:k,onResetRuntime:w,onSaveResetSelection:T,onWorkspaceChange:R,onWarmupChange:z}){const N=!i||e||d==="running";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:G=>G.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header console-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Console"}),s.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),s.jsxs("div",{className:"console-header-actions",children:[s.jsxs("label",{className:"console-workspace-picker",children:[s.jsx("span",{children:"Workspace"}),s.jsx("select",{disabled:e,onChange:G=>R(G.target.value),value:l??"",children:g.map(G=>s.jsx("optgroup",{label:G.title,children:G.conversations.map(B=>s.jsxs("option",{value:B.id,children:[B.title," · workspaces/",as(B.id)]},B.id))},G.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:b,type:"button",children:"×"})]})]}),s.jsx("div",{className:"console-body",children:s.jsxs("section",{className:"console-card",children:[s.jsxs("div",{className:"console-card-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Runtime"}),s.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),s.jsx("span",{className:`console-status ${d}`,children:d})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:i?`workspaces/${as(i.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:p,onChange:G=>z(G.target.checked),type:"checkbox"}),s.jsxs("span",{children:["Run a warmup turn after reset",s.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),s.jsxs("div",{className:"console-actions",children:[s.jsx("button",{className:"danger",disabled:N||u,onClick:y,type:"button",children:u?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:N||u,onClick:k,type:"button",children:"Clear memory & start blank"}),d==="running"?s.jsx("span",{children:"Stop the running turn before resetting."}):null]}),c?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:c.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),c.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",c.historyBatchCount," chronological batches with ",c.historyCompactionCount," native compactions"]}):null,c.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),r?s.jsx(dA,{busy:e,preview:r,warmup:p,onCancel:m,onConfirm:w,onSaveSelection:T}):null]})})}function dA({busy:e,preview:i,warmup:l,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=D.useState(()=>new Set(i.entries.filter(I=>I.includedByDefault).map(I=>I.id))),[g,m]=D.useState(!1),[b,y]=D.useState(!1),[k,w]=D.useState(null),T=D.useRef(null),R=i.entries.filter(I=>d.has(I.id)),z=R.filter(I=>I.role==="user").length,N=R.length-z,G=i.entries.filter(I=>I.topicRelation!==null).map(I=>I.id),B=G.filter(I=>d.has(I)).length,P=i.entries.length>0&&d.size===i.entries.length;D.useEffect(()=>{T.current&&(T.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const se=e||b;async function _(I){y(!0),w(null);try{await c(i.entries.filter(te=>I.has(te.id)).map(te=>te.id)),p(I)}catch(te){w(Ve(te).message)}finally{y(!1)}}function X(I,te){const ce=new Set(d);te?ce.add(I):ce.delete(I),_(ce)}function ae(){const I=new Set(d);G.forEach(te=>I.add(te)),_(I)}function ee(){const I=new Set(d);G.forEach(te=>{I.has(te)?I.delete(te):I.add(te)}),_(I)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:se?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:I=>I.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(I=>!I),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:se,onClick:r,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:P,disabled:se||i.entries.length===0,onChange:I=>void _(I.target.checked?new Set(i.entries.map(te=>te.id)):new Set),ref:T,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[z," user"]}),s.jsxs("span",{children:[N," assistant"]}),G.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[B," of ",G.length," Topic input + response"]}),s.jsx("button",{disabled:se||B===G.length,onClick:ae,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:se,onClick:ee,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:l?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,k?s.jsx("span",{className:"reset-preview-selection-error",children:k}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((I,te)=>s.jsxs("article",{className:`reset-preview-item ${I.role} ${d.has(I.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${I.role} message ${te+1}`,checked:d.has(I.id),disabled:se,onChange:ce=>X(I.id,ce.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:I.role}),I.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",I.topicRelation]}):null,s.jsx("time",{dateTime:I.createdAt,children:$e(I.createdAt)})]}),s.jsx("pre",{children:I.content})]},I.id)):s.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),s.jsxs("footer",{className:"reset-preview-actions",children:[s.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:se,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:se,onClick:()=>u(i.entries.filter(I=>d.has(I.id)).map(I=>I.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function fA({currentReleasedAt:e,currentVersion:i,job:l,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(l==null?void 0:l.currentVersion)??i,b=r!=null&&r.version&&I_(r.version,m)?L_(r.version):null;return D.useEffect(()=>{const y=k=>{k.key==="Escape"&&d()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:l?`status-${l.status}`:void 0,children:(l==null?void 0:l.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:Zp(m,(l==null?void 0:l.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?Zp(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?s.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),l?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:$e(l.startedAt)})]}):null]}),r!=null&&r.error?s.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",r.error]}):null,s.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:l!=null&&l.logs.length?l.logs.map((y,k)=>s.jsxs("div",{className:`log-${y.stream}`,children:[s.jsx("time",{children:z_(y.at)}),s.jsx("span",{children:y.text})]},`${y.at}-${k}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.jsx("button",{disabled:c||(l==null?void 0:l.status)==="running",onClick:g,type:"button",children:c?"Starting...":(l==null?void 0:l.status)==="running"?"Updating...":l?"Run again":"Start update"})]})]})})}function pA({currentUser:e,conversations:i,editingEnvironmentKey:l,environmentDraft:r,globalEnvironment:u,workspaceEnvironment:c,memorySettings:d,memorySettingsDraft:p,managedUsers:g,workspaceMemoryDraft:m,runtimeSettings:b,runtimeModels:y,runtimeCodexVersion:k,runtimeCodexReleasedAt:w,runtimeCodexUpdating:T,runtimeSettingsDraft:R,runtimeSettingsScope:z,settingsWorkspace:N,settingsWorkspaceId:G,systemDiagnostics:B,systemDiagnosticsLoading:P,workspaceGroups:se,workspaceRuntimeSettings:_,workspaceRuntimeSettingsDraft:X,onCancelEnvironmentEdit:ae,onClose:ee,onCreateUser:I,onDeleteUser:te,onDeleteEnvironment:ce,onDraftChange:Ee,onEditEnvironment:ge,onSaveBaseMemoryItems:ue,onSaveResponsibility:V,onSaveWorkspaceMemoryItems:oe,onRevealEnvironmentValue:ye,onRuntimeDraftChange:De,onGlobalSettingsImported:O,onCodexAccountSwitched:A,onUpdateCodexCli:L,onRuntimeScopeChange:C,onSettingsWorkspaceChange:K,onSubmitRuntimeSettings:me,onSubmitEnvironment:Z,onRefreshSystemDiagnostics:xe,onUpdateUser:Le,onWorkspaceRuntimeDraftChange:Xe,onWorkspaceRuntimeReset:Ot,revealedEnvironmentKeys:Wt}){const[Ye,Et]=D.useState("model"),[Jt,zt]=D.useState(!1),[rn,ze]=D.useState(null),[wt,sn]=D.useState(!1),[wn,gi]=D.useState(!1),[yi,Di]=D.useState((N==null?void 0:N.responsibility)??""),[Lt,Rl]=D.useState(!1),ne=D.useRef(null),he=z==="workspace"?Object.values((_==null?void 0:_.sources)??{}).filter(Ae=>Ae==="workspace").length:0,Re=e.role==="admin"&&z==="global"&&(Ye==="model"||Ye==="memory"||Ye==="environment");return D.useEffect(()=>{z==="global"&&sn(!1)},[z]),D.useEffect(()=>{Di((N==null?void 0:N.responsibility)??"")},[N==null?void 0:N.id,N==null?void 0:N.responsibility]),D.useEffect(()=>{if(!wt)return;const Ae=At=>{var tt;const mn=At.target;mn instanceof Node&&((tt=ne.current)!=null&&tt.contains(mn))||sn(!1)},Ie=At=>{At.key==="Escape"&&sn(!1)};return document.addEventListener("pointerdown",Ae,!0),document.addEventListener("keydown",Ie,!0),()=>{document.removeEventListener("pointerdown",Ae,!0),document.removeEventListener("keydown",Ie,!0)}},[wt]),s.jsxs("div",{className:"context-panel-overlay settings-overlay",onClick:ee,role:"presentation",children:[s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:Ae=>Ae.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Ye!=="system"&&Ye!=="users"&&Ye!=="accounts"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":z==="global",className:z==="global"?"active":void 0,onClick:()=>C("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:ne,children:[s.jsx("button",{"aria-checked":z==="workspace","aria-expanded":z==="workspace"?wt:void 0,"aria-label":z==="workspace"?"Settings workspace target":void 0,className:z==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(z!=="workspace"){C("workspace");return}sn(Ae=>!Ae)},role:"radio",type:"button",children:z==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(N==null?void 0:N.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),z==="workspace"&&wt?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:se.map(Ae=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:Ae.title}),Ae.conversations.map(Ie=>s.jsxs("button",{"aria-selected":Ie.id===G,className:Ie.id===G?"selected":void 0,onClick:()=>{K(Ie.id),sn(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ie.title}),s.jsxs("small",{children:["workspaces/",Ie.id]})]},Ie.id))]},Ae.id))}):null]})]}):null]}),s.jsxs("div",{className:"settings-header-actions",children:[Re?s.jsx("button",{className:"settings-transfer-button",onClick:()=>gi(!0),type:"button",children:"Import / Export"}):null,s.jsx("button",{"aria-label":"Close settings panel",onClick:ee,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Ye==="model"?"active":void 0,onClick:()=>Et("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Ye==="responsibility"?"active":void 0,onClick:()=>Et("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Ye==="memory"?"active":void 0,onClick:()=>Et("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Ye==="environment"?"active":void 0,onClick:()=>Et("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Ye==="accounts"?"active":void 0,onClick:()=>Et("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Login + active account"})]}),s.jsxs("button",{className:Ye==="system"?"active":void 0,onClick:()=>Et("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Ye==="users"?"active":void 0,onClick:()=>Et("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Ye!=="system"&&Ye!=="users"&&Ye!=="accounts"?s.jsxs("div",{className:`settings-scope-banner ${z==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:z==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:z==="workspace"?`${(N==null?void 0:N.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Ye==="system"?s.jsx(mA,{conversations:i,diagnostics:B,loading:P,onRefresh:xe}):Ye==="users"?s.jsx(jA,{currentUser:e,users:g,onCreate:I,onDelete:te,onUpdate:Le}):Ye==="accounts"?s.jsx(kA,{onSwitched:A}):Ye==="model"?s.jsx(SA,{draft:z==="workspace"?X:R,globalSettings:b,models:y,codexVersion:k,codexReleasedAt:w,codexUpdating:T,scope:z,workspaceOverrideCount:he,settings:z==="workspace"?(_==null?void 0:_.effective)??X:b,workspaceSettings:_,onDraftChange:z==="workspace"?Xe:De,onResetWorkspaceSetting:Ot,onSubmit:me,onUpdateCodexCli:L}):Ye==="responsibility"?s.jsx(xA,{draft:yi,saving:Lt,scope:z,workspace:N,onDraftChange:Di,onSubmit:Ae=>{Ae.preventDefault(),Ae.stopPropagation(),!(z!=="workspace"||!N)&&(Rl(!0),V(N.id,yi).then(Ie=>Di(Ie)).finally(()=>Rl(!1)))}}):Ye==="memory"?s.jsx(CA,{baseSettings:d,scope:z,workspaceSettings:m,workspaceName:N==null?void 0:N.title,onSaveBaseItems:ue,onSaveWorkspaceItems:oe}):s.jsx(AA,{deleteConfirmKey:rn,editingEnvironmentKey:l,environmentDraft:r,globalEnvironment:u,scope:z,workspaceEnvironment:c,valueVisible:Jt,onCancelEnvironmentEdit:ae,onDeleteConfirmChange:ze,onDeleteEnvironment:ce,onDraftChange:Ee,onEditEnvironment:ge,onRevealEnvironmentValue:ye,onSubmitEnvironment:Z,onValueVisibleChange:zt,revealedEnvironmentKeys:Wt})]})]})]}),wn?s.jsx(hA,{onClose:()=>gi(!1),onImported:async()=>{await O(),gi(!1)}}):null]})}const Co=[{id:"runtime",label:"Runtime",description:"Model, reasoning, fast mode, sandbox, and notifications"},{id:"environment",label:"Environment",description:"Global environment keys, descriptions, and secret values"},{id:"memory",label:"Memory",description:"Global memory items used as the base workspace context"}];function hA({onClose:e,onImported:i}){const[l,r]=D.useState("export"),[u,c]=D.useState(()=>new Set(Co.map(B=>B.id))),[d,p]=D.useState(""),[g,m]=D.useState(null),[b,y]=D.useState(!1),[k,w]=D.useState(""),T=g?new Set(Co.filter(B=>g[B.id]!==void 0).map(B=>B.id)):new Set;function R(B){r(B),w(""),c(B==="export"?new Set(Co.map(P=>P.id)):new Set(T))}function z(B){c(P=>{const se=new Set(P);return se.has(B)?se.delete(B):se.add(B),se})}async function N(B){var se;const P=(se=B.target.files)==null?void 0:se[0];if(B.target.value="",!!P){w("");try{if(P.size>5*1024*1024)throw new Error("The settings file is larger than 5 MB.");const _=JSON.parse(await P.text()),X=Qv(_),ae=new Set(Co.filter(ee=>X[ee.id]!==void 0).map(ee=>ee.id));if(ae.size===0)throw new Error("The file does not contain Runtime, Environment, or Memory.");p(P.name),m(X),c(ae)}catch(_){p(""),m(null),c(new Set),w(_ instanceof Error?_.message:"Invalid settings file.")}}}async function G(){if(u.size===0){w("Select at least one settings category.");return}y(!0),w("");try{if(l==="export"){const B=await _2(u);R2(B),e()}else{if(!g)throw new Error("Choose a Seele global settings file first.");const B={format:g.format,version:g.version,exportedAt:g.exportedAt,...u.has("runtime")?{runtime:g.runtime}:{},...u.has("environment")?{environment:g.environment}:{},...u.has("memory")?{memory:g.memory}:{}};await D2(B),await i()}}catch(B){w(B instanceof Error?B.message:"Settings transfer failed.")}finally{y(!1)}}return s.jsx("div",{className:"memory-editor-overlay",onClick:B=>{B.stopPropagation(),b||e()},role:"presentation",children:s.jsxs("section",{"aria-label":"Import or export global settings","aria-modal":"true",className:"memory-delete-dialog global-transfer-dialog",onClick:B=>B.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Global Settings Transfer"}),s.jsx("button",{"aria-label":"Close global settings transfer",className:"memory-icon-button",disabled:b,onClick:e,type:"button",children:"×"})]}),s.jsxs("div",{className:"global-transfer-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":l==="export",className:l==="export"?"active":void 0,onClick:()=>R("export"),role:"tab",type:"button",children:"Export"}),s.jsx("button",{"aria-selected":l==="import",className:l==="import"?"active":void 0,onClick:()=>R("import"),role:"tab",type:"button",children:"Import"})]}),l==="import"?s.jsxs("label",{className:"global-transfer-file",children:[s.jsx("span",{children:d||"Choose a .json settings file"}),s.jsx("input",{accept:"application/json,.json",disabled:b,onChange:B=>void N(B),type:"file"})]}):s.jsx("p",{children:"Export selected Global settings into one portable JSON file. Environment export includes secret values; store the file securely."}),s.jsx("div",{className:"global-transfer-options",children:Co.map(B=>{const P=b||l==="import"&&!T.has(B.id);return s.jsxs("label",{className:`global-transfer-option ${P?"disabled":""}`,children:[s.jsx("input",{checked:u.has(B.id),disabled:P,onChange:()=>z(B.id),type:"checkbox"}),s.jsxs("span",{children:[s.jsx("strong",{children:B.label}),s.jsx("small",{children:B.description})]})]},B.id)})}),l==="import"&&g?s.jsx("p",{className:"global-transfer-warning",children:"Import replaces the selected Global categories on this deployment. Other settings and all workspace overrides remain unchanged."}):null,k?s.jsx("p",{className:"memory-editor-error",children:k}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:b,onClick:e,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||u.size===0||l==="import"&&!g,onClick:()=>void G(),type:"button",children:b?"Working...":l==="export"?"Export file":"Import selected"})]})]})})}function mA({conversations:e,diagnostics:i,loading:l,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=D.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=D.useState(!1),g=D.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=D.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},y=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),T=document.createElement("a");T.href=w,T.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,T.click(),URL.revokeObjectURL(w)},k=()=>{if(!i||!c.length)return;const w=c[0],T=c.slice(0,5).map(B=>`- ${Ho(B.createdAt)} · ${B.level.toUpperCase()} · ${B.event} · ${B.summary}`).join(`
90
+ `),R=JSON.stringify(w,null,2),z=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${Ho(i.generatedAt)}`,"","## Latest incident","","```json",R.slice(0,2500),"```","","## Recent system log","",T,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
91
+ `),N=`[System Log] ${w.summary}`.slice(0,180),G=new URL("https://github.com/seele-labs/seele-work/issues/new");G.searchParams.set("title",N),G.searchParams.set("body",z),window.open(G.toString(),"_blank","noopener,noreferrer")};return s.jsxs("section",{className:"system-information-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"System"}),s.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),s.jsx("button",{className:"system-information-refresh",disabled:l,onClick:r,type:"button",children:l?"Refreshing...":"Refresh"})]}),u?s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"system-information-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"LRU pool target"}),s.jsxs("dd",{children:[Un(u.maxRetainedRuntimes)," runtimes"]}),s.jsx("small",{children:u.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Retention policy"}),s.jsxs("dd",{children:["LRU · ",Ap(u.maxIdleSeconds*1e3)," max idle"]}),s.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current pool"}),s.jsxs("dd",{children:[u.activeRuntimeCount," active · ",u.idleRuntimeCount," idle"]}),s.jsxs("small",{children:[u.retainedRuntimeCount," retained runtimes"]})]})]}),s.jsxs("section",{className:"system-runtime-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"Workspace runtimes"}),s.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),s.jsx("time",{dateTime:i==null?void 0:i.generatedAt,children:i?$e(i.generatedAt):""})]}),u.workspaces.length>0?s.jsxs("div",{className:"system-runtime-table",children:[s.jsxs("div",{className:"system-runtime-table-header",children:[s.jsx("span",{children:"Workspace"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Runtime"}),s.jsx("span",{children:"Age"})]}),u.workspaces.map(w=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:g.get(w.workspaceId)??w.workspaceId}),s.jsx("small",{children:w.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${w.turnId?"active":"idle"}`,children:w.lifecycle==="shutting_down"?"Shutting down":w.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:w.turnId?w.state:"Retained"}),s.jsx("small",{children:w.pid===null?"PID unavailable":`PID ${w.pid}`})]}),s.jsx("span",{children:w.idleMs===null?Ap(w.uptimeMs):`${Ap(w.idleMs)} idle`})]},w.workspaceId))]}):s.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),s.jsxs("section",{className:"system-runtime-list system-log-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"System log"}),s.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),s.jsxs("div",{className:"system-log-actions",children:[s.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!c.length,onClick:()=>void b(),title:"Copy system log report",type:"button",children:s.jsx(Th,{})}),s.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!c.length,onClick:y,title:"Download system log report",type:"button",children:s.jsx(gA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:k,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx(yA,{})}),d?s.jsx("small",{children:"Copied"}):null]})]}),c.length?s.jsx("div",{className:"system-log-entries",children:c.map(w=>s.jsxs("details",{className:`system-log-entry ${w.level}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"system-log-level",children:w.level}),s.jsxs("span",{children:[s.jsx("strong",{children:w.summary}),s.jsxs("small",{children:[w.component," · ",Ho(w.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:w.event})]}),w.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[g.get(w.workspaceId)??w.workspaceId," · ",w.workspaceId]})]}):null,w.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:w.turnId})]}):null,w.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:w.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(w.detail,null,2)})]},w.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:l?"Loading system information...":"System information is unavailable."})]})}function gA(){return s.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function yA(){return s.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"M12 7v6m0 4h.01"})]})}function xA({draft:e,saving:i,scope:l,workspace:r,onDraftChange:u,onSubmit:c}){const d=l==="workspace";return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Responsibility"}),s.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),d&&r?s.jsxs("form",{className:"settings-responsibility-form",onSubmit:c,children:[s.jsxs("label",{children:[s.jsx("span",{children:r.title}),s.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:p=>u(p.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:i,type:"submit",children:i?"Saving...":"Save responsibility"})})]}):s.jsx("section",{className:"settings-readonly-block",children:s.jsxs("div",{children:[s.jsx("strong",{children:"Workspace-only setting"}),s.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function bA({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((i,l)=>i.windowDurationMins-l.windowDurationMins).map(i=>{const l=Kc(i.usedPercent),r=zv(i.windowDurationMins);return s.jsxs("div",{className:"codex-account-usage-window",children:[s.jsxs("div",{children:[s.jsxs("span",{children:[r," used"]}),s.jsx("strong",{children:mw(l)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${l}%`}})}),s.jsxs("small",{children:["Resets ",gw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function vA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function wA(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function kA({onSwitched:e}){var A;const[i,l]=D.useState(null),[r,u]=D.useState(!0),[c,d]=D.useState(!1),[p,g]=D.useState(!1),[m,b]=D.useState(""),[y,k]=D.useState(!1),[w,T]=D.useState(""),[R,z]=D.useState(null),[N,G]=D.useState(null),[B,P]=D.useState(""),[se,_]=D.useState(null),[X,ae]=D.useState(null),[ee,I]=D.useState(!1);async function te(){var C;const L=await Kx();l(L),((C=L.login)==null?void 0:C.status)==="pending"&&(z(L.login),k(!0))}async function ce(L){d(!0),b("");try{l(await Xx(L))}catch(C){b(Ve(C).message)}finally{d(!1)}}D.useEffect(()=>{let L=!1;return Kx().then(C=>{var K;L||(l(C),((K=C.login)==null?void 0:K.status)==="pending"&&(z(C.login),k(!0)),C.accounts.length>0&&(d(!0),Xx(!1).then(me=>{L||l(me)}).catch(me=>{L||b(Ve(me).message)}).finally(()=>{L||d(!1)})))}).catch(C=>{L||b(Ve(C).message)}).finally(()=>{L||u(!1)}),()=>{L=!0}},[]),D.useEffect(()=>{if(!R||R.status!=="pending")return;let L=!1;const C=window.setInterval(()=>{v2(R.id).then(async K=>{L||(z(K),K.status!=="pending"&&(window.clearInterval(C),K.status==="succeeded"&&(await te(),await ce(!0))))}).catch(K=>{L||b(Ve(K).message)})},1e3);return()=>{L=!0,window.clearInterval(C)}},[R==null?void 0:R.id,R==null?void 0:R.status]);function Ee(){T(""),z(null),b(""),I(!1),k(!0)}async function ge(L){L.preventDefault(),g(!0),b("");try{z(await b2(w.trim()))}catch(C){b(Ve(C).message)}finally{g(!1)}}async function ue(){if(!R||R.status!=="pending"){k(!1);return}g(!0),b("");try{const L=await w2(R.id);z(L),k(!1)}catch(L){b(Ve(L).message)}finally{g(!1)}}function V(L){G(L),P(L.name),b("")}async function oe(L){if(L.preventDefault(),!N)return;const C=B.trim();if(!C||C===N.name){G(null);return}g(!0),b("");try{await k2(N.id,C),G(null),await te()}catch(K){b(Ve(K).message)}finally{g(!1)}}async function ye(){var L;if(se){g(!0),b("");try{const C=await S2(se.id);l(C),_(null),await e()}catch(C){const K=Ve(C);b((L=K.detail)!=null&&L.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":K.detail??K.message)}finally{g(!1)}}}async function De(){if(X){g(!0),b("");try{await j2(X.id),ae(null),await te()}catch(L){b(Ve(L).detail??Ve(L).message)}finally{g(!1)}}}const O=(i==null?void 0:i.accounts)??[];return s.jsxs("section",{className:"settings-section codex-accounts-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex Accounts"}),s.jsx("p",{children:"Manage isolated Codex logins. Workspaces do not bind to an account; all work uses the single active account."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||O.length===0,onClick:()=>void ce(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(R==null?void 0:R.status)==="pending",onClick:Ee,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Manual stop-and-switch"}),s.jsx("span",{children:"Switching requires the whole runtime to be idle. Seele stops retained workers, activates the selected credential, then resumes queued work. No automatic switching or parallel accounts."})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,r?s.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!r&&O.length===0?s.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,s.jsx("div",{className:"codex-account-list",children:O.map(L=>{var Z;const C=(i==null?void 0:i.activeAccountId)===L.id,K=(Z=i==null?void 0:i.accountDetails)==null?void 0:Z[L.id],me=[L.email,vA(L.accountType),wA(L.planType)].filter(xe=>!!xe);return s.jsxs("article",{className:C?"codex-account-card active":"codex-account-card",children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:L.name}),C?s.jsx("span",{className:"codex-account-active",children:"Active"}):null]}),s.jsx("small",{children:me.join(" · ")||`Added ${$e(L.createdAt)}`}),K!=null&&K.usage?s.jsx(bA,{usage:K.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),K?s.jsx("small",{className:K.error?"codex-account-detail-error":"codex-account-refreshed",children:K.error?`Refresh issue: ${K.error}`:`Updated ${$e(K.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c,onClick:()=>V(L),type:"button",children:"Rename"}),s.jsx("button",{disabled:p||c||C,onClick:()=>{b(""),_(L)},type:"button",children:C?"In use":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||C,onClick:()=>{b(""),ae(L)},type:"button",children:"Delete"})]})]},L.id)})}),N?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&G(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:L=>L.stopPropagation(),onSubmit:L=>void oe(L),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Rename Codex Account"}),s.jsx("button",{"aria-label":"Close account rename",className:"memory-icon-button",disabled:p,onClick:()=>G(null),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:L=>P(L.target.value),value:B})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>G(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!B.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,y?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!R&&k(!1),role:"presentation",children:R?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:L=>L.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:R.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void ue(),type:"button",children:"×"})]}),R.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),s.jsxs("div",{className:"codex-device-code",children:[s.jsx("strong",{children:R.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(R.userCode),I(!0),window.setTimeout(()=>I(!1),1500)},type:"button",children:ee?"Copied":"Copy code"})]}),s.jsx("a",{href:R.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),s.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):R.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=R.account)==null?void 0:A.name)??R.accountName})," is persisted and ready. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:R.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void ue(),type:"button",children:R.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:L=>L.stopPropagation(),onSubmit:L=>void ge(L),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>k(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates an isolated login profile. Completing login adds it to the list but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:L=>T(L.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>k(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,se?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&_(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:L=>L.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>_(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch global execution to ",s.jsx("strong",{children:se.name}),"? This succeeds only when every workspace and goal is idle. Retained Codex workers will be stopped; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void ye(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,X?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&ae(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:L=>L.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Codex Account"}),s.jsx("button",{"aria-label":"Close account deletion",className:"memory-icon-button",disabled:p,onClick:()=>ae(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:X.name})," and its persisted Codex credential from this Seele deployment? This cannot be undone."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>ae(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:p,onClick:()=>void De(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function jA({currentUser:e,users:i,onCreate:l,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=D.useState(null),[g,m]=D.useState(c),[b,y]=D.useState(!1),[k,w]=D.useState(null),[T,R]=D.useState("");function z(){m(c),R(""),p("new")}function N(P){m({username:P.username,password:"",role:P.role,active:P.active}),R(""),p(P)}function G(){b||(p(null),R(""))}async function B(P){if(P.preventDefault(),!!d){y(!0),R("");try{d==="new"?await l({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),p(null)}catch(se){R(Ve(se).message)}finally{y(!1)}}}return s.jsxs("section",{className:"settings-section user-management-section",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Users"}),s.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:z,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(P=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:P.username}),P.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",$e(P.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${P.role}`,children:P.role}),s.jsx("span",{className:`user-status ${P.active?"active":"disabled"}`,children:P.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${P.username}`,className:"memory-icon-button",onClick:()=>N(P),title:"Edit",type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":`Delete user ${P.username}`,className:"memory-icon-button memory-item-delete",disabled:P.id===e.id,onClick:()=>{R(""),w(P)},title:"Delete",type:"button",children:"×"})]})]},P.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:G,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:P=>P.stopPropagation(),onSubmit:P=>void B(P),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:G,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:P=>m(se=>({...se,username:P.target.value})),placeholder:"Sign-in username",value:g.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:d==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:P=>m(se=>({...se,password:P.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:P=>m(se=>({...se,role:P.target.value==="admin"?"admin":"user"})),value:g.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:P=>m(se=>({...se,active:P.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,T?s.jsx("p",{className:"memory-editor-error",children:T}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:G,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||!g.username.trim()||d==="new"&&g.password.length<8||d!=="new"&&g.password.length>0&&g.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,k?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:P=>P.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete User"}),s.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>w(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:k.username}),". Users that own workspaces must be disabled instead."]}),T?s.jsx("p",{className:"memory-editor-error",children:T}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>w(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(k.id).then(()=>w(null)).catch(P=>R(Ve(P).message))},type:"button",children:"Delete"})]})]})}):null]})}function SA({codexReleasedAt:e,codexVersion:i,codexUpdating:l,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:y,onSubmit:k,onUpdateCodexCli:w}){var R;const T=d==="workspace";return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),T?s.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:k,children:[s.jsxs("label",{className:Eo(T,Xi(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(To,{globalValue:ab(u.model,c),isWorkspaceScope:T,label:"Model",settingKey:"model",source:Xi(r.model,u.model,m==null?void 0:m.sources.model),onReset:y}),s.jsx(mp,{"aria-label":"Runtime model",onChange:z=>b({...r,model:z}),options:U_(c,r.model),value:r.model||((R=c.find(z=>z.isDefault))==null?void 0:R.model)||""})]}),s.jsxs("label",{className:Eo(T,Xi(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(To,{globalValue:lb(u.reasoningEffort),isWorkspaceScope:T,label:"Reasoning effort",settingKey:"reasoningEffort",source:Xi(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:y}),s.jsx(mp,{"aria-label":"Runtime reasoning effort",onChange:z=>b({...r,reasoningEffort:z}),options:HE,value:r.reasoningEffort})]}),s.jsxs("label",{className:Eo(T,Xi(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(To,{globalValue:sb(u.sandbox),isWorkspaceScope:T,label:"Permission mode",settingKey:"sandbox",source:Xi(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:y}),s.jsx(mp,{"aria-label":"Permission mode",onChange:z=>b({...r,sandbox:z}),options:$E,value:r.sandbox})]}),s.jsxs("label",{className:Eo(T,Xi(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(To,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:T,label:"Fast mode",settingKey:"fastMode",source:Xi(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:y}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:z=>b({...r,fastMode:z.target.checked}),type:"checkbox"})]}),s.jsxs("label",{className:Eo(T,Xi(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(To,{globalValue:u.notifyEnabled?"On":"Off",isWorkspaceScope:T,label:"Profuse notification",settingKey:"notifyEnabled",source:Xi(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),onReset:y}),s.jsx("small",{children:"Send DingTalk notification when a turn finishes or fails"})]}),s.jsx("input",{"aria-label":"Enable Profuse notification",checked:r.notifyEnabled,onChange:z=>b({...r,notifyEnabled:z.target.checked}),type:"checkbox"})]}),s.jsxs("dl",{className:"runtime-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsxs("dd",{children:["Model ",ab(p.model,c),", reasoning"," ",lb(p.reasoningEffort),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",sb(p.sandbox),", notification"," ",p.notifyEnabled?"on":"off","."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:Zp(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:l,onClick:w,type:"button",children:l?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:T?"Save workspace overrides":"Save global runtime"})})]})]})}function To({globalValue:e,isWorkspaceScope:i,label:l,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:l}),i?s.jsxs("span",{className:"runtime-field-meta",children:[s.jsx("span",{className:d?"override":"inherited",children:d?"Workspace override":`Inherited: ${e}`}),d?s.jsx("button",{type:"button",onClick:()=>c(r),children:"Reset"}):null]}):null]})}function mp({"aria-label":e,onChange:i,options:l,value:r}){const[u,c]=D.useState(!1),d=D.useRef(null),p=l.find(g=>g.value===r)??l[0]??null;return D.useEffect(()=>{if(!u)return;function g(b){var y;(y=d.current)!=null&&y.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:l.map(g=>s.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Xi(e,i,l){return e!==i?"workspace":l}function Eo(e,i,l="settings-wide-field"){return[l,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function CA({baseSettings:e,scope:i,workspaceSettings:l,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?l.items:e.items,g=d?c:u;return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),s.jsx("p",{children:d?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),d?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(EA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(TA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function TA({ariaLabel:e,emptyText:i,items:l,onSaveItems:r,title:u}){var X;const[c,d]=D.useState(qo(l)),[p,g]=D.useState(null),[m,b]=D.useState({key:"",value:""}),[y,k]=D.useState(null),[w,T]=D.useState(null),[R,z]=D.useState(null);D.useEffect(()=>{d(qo(l))},[l]),D.useEffect(()=>{if(p===null)return;const ae=ee=>{ee.key==="Escape"&&(P(),T(null))};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[p]);async function N(ae,ee){z(ee);try{const I=await r(ae);return d(qo(I)),I}finally{z(null)}}function G(){T(null),k(null),b({key:"",value:""}),g("new")}function B(ae){const ee=c[ae];ee&&(T(null),k(null),b({...ee}),g(ae))}function P(){g(null),k(null),b({key:"",value:""})}async function se(ae){const ee=c[ae],I=(ee==null?void 0:ee.key)||`${ae}`;await N(c.filter((te,ce)=>ce!==ae),`delete:${I}`),T(null)}async function _(ae){ae.preventDefault(),ae.stopPropagation();const ee=m.key.trim(),I=V2(ee);if(I){k(I);return}const te=m.value.trim();if(!te){k("Value is required.");return}const ce=p==="new"?-1:p;if(c.some((ge,ue)=>ue!==ce&&ge.key.trim()===ee)){k(`Key "${ee}" already exists. Each memory key must be unique.`);return}const Ee={...m,key:ee,value:te};p==="new"?await N([...c,Ee],"add"):typeof p=="number"&&await N(c.map((ge,ue)=>ue===p?Ee:ge),`save:${p}`),P()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:G,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((ae,ee)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${ae.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${ae.key}>`}),`
92
92
  `,s.jsx("span",{children:ae.value}),`
93
- `,s.jsx("span",{className:"memory-tag",children:`</${ae.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${ae.key||ee+1}`,className:"memory-icon-button memory-item-edit",disabled:O!==null,title:"Edit",type:"button",onClick:()=>q(ee),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${ae.key||ee+1}`,className:"memory-icon-button memory-item-delete",disabled:O!==null,title:"Delete",type:"button",onClick:()=>E(ee),children:"×"})]})]},`${ee}-${ae.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:Y,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:ae=>ae.stopPropagation(),onSubmit:ae=>void N(ae),children:[s.jsxs("header",{children:[s.jsx("strong",{children:p==="new"?"Add Memory":"Edit Memory"}),s.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:Y,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:ae=>b(ee=>({...ee,key:ae.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value · up to 1000 tokens"}),s.jsx("textarea",{onChange:ae=>b(ee=>({...ee,value:ae.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),x?s.jsx("p",{className:"memory-editor-error",children:x}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:Y,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:O!==null,type:"submit",children:O==="add"||O!=null&&O.startsWith("save:")?"Saving...":"Save"})]})]})}):null,w!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>E(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:ae=>ae.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Memory"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>E(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((X=c[w])==null?void 0:X.key)||`item ${w+1}`}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:O!==null,type:"button",onClick:()=>E(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:O!==null,type:"button",onClick:()=>void se(w),children:"Delete"})]})]})}):null]})}function jA({emptyText:e,items:i}){const l=qo(i);return l.length?s.jsx("div",{className:"memory-items-list",children:l.map(r=>s.jsx("div",{className:"memory-item-display memory-item-readonly",children:s.jsxs("pre",{"aria-label":`Memory item ${r.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${r.key}>`}),`
93
+ `,s.jsx("span",{className:"memory-tag",children:`</${ae.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${ae.key||ee+1}`,className:"memory-icon-button memory-item-edit",disabled:R!==null,title:"Edit",type:"button",onClick:()=>B(ee),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${ae.key||ee+1}`,className:"memory-icon-button memory-item-delete",disabled:R!==null,title:"Delete",type:"button",onClick:()=>T(ee),children:"×"})]})]},`${ee}-${ae.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:P,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:ae=>ae.stopPropagation(),onSubmit:ae=>void _(ae),children:[s.jsxs("header",{children:[s.jsx("strong",{children:p==="new"?"Add Memory":"Edit Memory"}),s.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:P,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:ae=>b(ee=>({...ee,key:ae.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value · up to 1000 tokens"}),s.jsx("textarea",{onChange:ae=>b(ee=>({...ee,value:ae.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),y?s.jsx("p",{className:"memory-editor-error",children:y}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:P,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:R!==null,type:"submit",children:R==="add"||R!=null&&R.startsWith("save:")?"Saving...":"Save"})]})]})}):null,w!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>T(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:ae=>ae.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Memory"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>T(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((X=c[w])==null?void 0:X.key)||`item ${w+1}`}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:R!==null,type:"button",onClick:()=>T(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:R!==null,type:"button",onClick:()=>void se(w),children:"Delete"})]})]})}):null]})}function EA({emptyText:e,items:i}){const l=qo(i);return l.length?s.jsx("div",{className:"memory-items-list",children:l.map(r=>s.jsx("div",{className:"memory-item-display memory-item-readonly",children:s.jsxs("pre",{"aria-label":`Memory item ${r.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${r.key}>`}),`
94
94
  `,s.jsx("span",{children:r.value}),`
95
- `,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function CA({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:l,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:k,onSubmitEnvironment:w,onValueVisibleChange:E,revealedEnvironmentKeys:O}){const U=i!==null&&O.has(i),_=u==="workspace",F=_?c:r,[q,Y]=D.useState(!1);function se(){p(),b({description:"",key:"",value:""}),E(!1),Y(!0)}function N(ee){x(ee),E(!1),Y(!0)}function X(){Y(!1),p(),E(!1)}function ae(ee){w(ee),Y(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:_?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:_?"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."})]})}),_?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Environment"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(Ax,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,s.jsxs("section",{className:"environment-manager",children:[s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:se,children:"+"})}),s.jsx(Ax,{emptyText:_?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:ee=>g(ee),onEdit:N,variables:F})]}),q?s.jsx("div",{className:"memory-editor-overlay",onClick:X,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:ee=>ee.stopPropagation(),onSubmit:ae,children:[s.jsxs("header",{children:[s.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:X,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:ee=>b({...l,key:ee.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:l.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:ee=>b({...l,value:ee.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:l.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!U&&!l.value){k(i),E(!0);return}E(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(ZN,{}):s.jsx(QN,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:ee=>b({...l,description:ee.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:l.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:X,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!l.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:ee=>ee.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function Ax({emptyText:e,onDelete:i,onEdit:l,readonly:r=!1,variables:u}){return u.length===0?s.jsx("p",{className:"settings-note",children:e}):s.jsx("div",{className:r?"environment-list readonly":"environment-list",children:u.map(c=>s.jsxs("div",{className:r?"environment-row readonly":"environment-row",children:[s.jsxs("div",{className:"environment-row-main",children:[s.jsxs("pre",{"aria-label":`Environment variable ${c.key}`,children:[s.jsx("span",{className:"memory-tag",children:c.key}),"=",c.hasValue?"••••••":"",c.description?s.jsx("span",{className:"environment-comment",children:` # ${c.description}`}):null]}),s.jsxs("span",{children:[c.hasValue?"configured":"empty"," · updated"," ",$e(c.updatedAt)]})]}),r?s.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):s.jsxs("div",{className:"environment-row-actions",children:[s.jsx("button",{"aria-label":`Edit ${c.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>l==null?void 0:l(c),title:"Edit",type:"button",children:"✎"}),s.jsx("button",{"aria-label":`Delete ${c.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>i==null?void 0:i(c.key),title:"Delete",type:"button",children:"×"})]})]},c.key))})}function Nv({items:e,onDelete:i,onEdit:l}){const[r,u]=D.useState(null),[c,d]=D.useState(null);return e.length===0?s.jsxs("section",{className:"knowledge-empty",children:[s.jsx("h4",{children:"No knowledge registered"}),s.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):s.jsx("div",{className:"knowledge-list",children:e.map(p=>s.jsxs("article",{className:"knowledge-row",children:[s.jsxs("div",{className:"knowledge-row-main",children:[s.jsxs("header",{children:[s.jsx("strong",{children:p.name}),s.jsx("span",{children:EA(p.kind)}),s.jsx("span",{className:_A(p.status),children:AA(p.status)})]}),s.jsx("p",{children:p.purpose||p.description||"No purpose set."}),s.jsxs("div",{className:"knowledge-paths",children:[s.jsx("code",{children:p.digestPath}),s.jsx("code",{children:p.skillPath}),s.jsx("code",{children:p.fetch.scriptPath})]}),p.fetch.requiredEnv.length>0?s.jsx("div",{className:"knowledge-envs",children:p.fetch.requiredEnv.map(g=>s.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===p.id?s.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,s.jsxs("small",{children:[p.attention," · ",NA(p.refreshPolicy)," · updated ",$e(p.updatedAt)]})]}),s.jsx("div",{className:"environment-row-actions",children:r===p.id?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"danger",onClick:()=>{i(p.id),u(null)},type:"button",children:"Delete"}),s.jsx("button",{onClick:()=>u(null),type:"button",children:"Cancel"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`Check ${p.name}`,onClick:()=>d(p.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),s.jsx("button",{"aria-label":`Edit ${p.name}`,onClick:()=>l(p),title:"Edit knowledge",type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function TA({draft:e,items:i,scope:l,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:g}){return l==="workspace"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsxs("p",{children:["Long-lived source-backed material for ",r??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),s.jsx(Nv,{items:i,onDelete:c,onEdit:p}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[s.jsxs("div",{className:"knowledge-form-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Edit metadata"}),s.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),s.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),s.jsxs("div",{className:"knowledge-form-grid",children:[s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...e,name:b.target.value}),value:e.name})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Kind"}),s.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...e,kind:b.target.value}),value:e.kind,children:[s.jsx("option",{value:"source",children:"Source"}),s.jsx("option",{value:"skill",children:"Skill"}),s.jsx("option",{value:"reference",children:"Reference"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Status"}),s.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...e,status:b.target.value}),value:e.status,children:[s.jsx("option",{value:"draft",children:"Draft"}),s.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),s.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),s.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),s.jsx("option",{value:"ready",children:"Ready"}),s.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Attention"}),s.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...e,attention:b.target.value}),value:e.attention,children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"tracked",children:"Tracked"}),s.jsx("option",{value:"watch",children:"Watch"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Refresh"}),s.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...e,refreshPolicy:b.target.value}),value:e.refreshPolicy,children:[s.jsx("option",{value:"manual",children:"Manual"}),s.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Purpose"}),s.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...e,purpose:b.target.value}),rows:2,value:e.purpose})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Content"}),s.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...e,description:b.target.value}),rows:2,value:e.description})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Source clues"}),s.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...e,sourceCluesText:b.target.value}),rows:4,value:e.sourceCluesText})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Required environment"}),s.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...e,requiredEnvText:b.target.value}),rows:3,value:e.requiredEnvText})]}),s.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):s.jsxs("section",{className:"settings-empty-section",children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function EA(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function AA(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function NA(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function _A(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function Je({label:e,value:i,mono:l=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:l?"mono":void 0,title:i,children:i})]})}function DA({onRefresh:e,preview:i,refreshing:l}){const r=["workspace_identity","workspace_environment","rendering"],u=D.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,MA(p)]).sort(([d],[p])=>{const g=r.indexOf(d),m=r.indexOf(p);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Nx(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs("div",{className:"additional-context-preview",children:[s.jsx("div",{className:"additional-context-header",children:s.jsxs("div",{className:"additional-context-meta",children:[s.jsxs("span",{children:["Generated ",$e(i.generatedAt)]}),s.jsxs("span",{children:[Un(u.length)," keys"]}),s.jsx("button",{disabled:l,onClick:e,type:"button",children:l?"Rendering...":"Refresh"})]})}),s.jsxs("div",{className:"additional-context-toc",children:[s.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),s.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>s.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),s.jsx("div",{className:"additional-context-list",children:u.map(([d,p])=>s.jsxs("section",{className:"additional-context-item",id:Nx(d),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",d,">"]}),s.jsxs("span",{children:[Un(p.length)," chars"]})]}),s.jsx("pre",{children:p})]},d))})]})}function Nx(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function MA(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 RA({summary:e}){return s.jsxs("div",{className:"thread-read-summary",children:[s.jsxs("section",{className:"thread-read-summary-grid",children:[s.jsx(Je,{label:"Thread",value:e.id,mono:!0}),s.jsx(Je,{label:"Session",value:e.sessionId,mono:!0}),s.jsx(Je,{label:"Status",value:e.status}),s.jsx(Je,{label:"Source",value:e.source}),s.jsx(Je,{label:"Created",value:No(e.createdAt)}),s.jsx(Je,{label:"Updated",value:No(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:No(e.recencyAt)}),s.jsx(Je,{label:"Turns",value:Un(e.turnCount),mono:!0}),s.jsx(Je,{label:"Items",value:Un(e.itemCount),mono:!0}),s.jsx(Je,{label:"User / agent",value:`${Un(e.userMessageCount)} / ${Un(e.agentMessageCount)}`,mono:!0}),s.jsx(Je,{label:"Compactions",value:`${Un(e.compactionCount)} / ${Un(e.contextCompactionCount)} context`,mono:!0}),s.jsx(Je,{label:"CWD",value:e.cwd,mono:!0}),s.jsx(Je,{label:"Path",value:e.path,mono:!0})]}),e.preview?s.jsxs("details",{className:"thread-read-preview",children:[s.jsx("summary",{children:"Preview"}),s.jsx("p",{children:e.preview})]}):null,s.jsxs("section",{className:"thread-read-turns",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Turns"}),s.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),s.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((i,l)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",l+1]}),s.jsx("span",{title:i.id,children:i.id}),s.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),s.jsxs("div",{className:"thread-read-turn-detail",children:[s.jsxs("div",{className:"thread-read-turn-fields",children:[s.jsx(Je,{label:"Status",value:i.status}),s.jsx(Je,{label:"Items view",value:i.itemsView}),s.jsx(Je,{label:"Started",value:No(i.startedAt)}),s.jsx(Je,{label:"Completed",value:No(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":ss(i.durationMs)}),s.jsx(Je,{label:"Item types",value:i.itemTypes||"none"})]}),i.preview?s.jsx("p",{className:"thread-read-turn-preview",children:i.preview}):null,s.jsxs("details",{className:"thread-read-turn-raw",children:[s.jsx("summary",{children:"Turn raw JSON"}),s.jsx("pre",{children:JSON.stringify(i.raw,null,2)})]})]})]},i.id))})]})]})}function _o(e,i,l,r,u,c,d,p,g,m){var b,x,k,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":$e(e.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:"Seele"}),s.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":$e(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(Ro,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":$e(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(Bx,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":$e(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:G_(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:$e(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(Bx,{content:e.message.content}):s.jsx(Ro,{content:e.message.content,conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="system"){if((b=e.topicMessages)!=null&&b.length)return s.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(O=>s.jsx("article",{className:"message topic-input","data-hover-time":$e(O.createdAt),children:s.jsxs("div",{className:"topic-message-bubble topic-input-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["From ",O.senderName]}),s.jsx("time",{dateTime:O.createdAt,children:$e(O.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Ro,{content:O.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},O.id))});const E=ur({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":$e(e.createdAt),children:s.jsx("div",{className:"message-main",children:s.jsxs("button",{className:`system-message-body system-message-link${e.visualKind?` ${e.visualKind}`:""}`,onClick:()=>m==null?void 0:m(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(Dc,{})}):null,s.jsx("span",{className:"system-message-title",children:e.title}),s.jsx("small",{children:E})]})})})}return e.type==="steerMarker"?s.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[s.jsx("span",{children:"Added while running"}),s.jsx("strong",{children:e.content})]}):e.tool.linkedTaskId&&g?s.jsx(Dv,{description:e.tool.body,icon:s.jsx(_v,{}),onClick:()=>void g(e.tool.linkedTaskId),timestamp:e.tool.createdAt,title:"View complex task details",trailing:e.tool.meta,visibleTitle:e.tool.title}):e.tool.kind==="command"?s.jsx(YA,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(GA,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(HA,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx($A,{tool:e.tool,onRespond:p}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?s.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":$e(e.tool.createdAt),title:$e(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Dc,{})}),s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsxs("div",{className:"topic-message-bubble topic-output-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["To ",e.tool.topicRecipientLabel??"Topic"]}),s.jsx("time",{dateTime:e.tool.createdAt,children:$e(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Ro,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(k=e.tool.rawEvents)!=null&&k.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":$e(e.tool.createdAt),title:$e(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Dc,{})}):null,s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsx("code",{children:e.tool.body}),e.tool.output?s.jsx("pre",{children:e.tool.output}):null,(w=e.tool.rawEvents)!=null&&w.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function _x(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&OA(e.tool)}function OA(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 zA(e){const i=[],l=[];for(const r of e)r.type==="tool"&&(r.tool.kind==="collaboration"&&r.tool.topicAction==="send"||r.tool.kind==="workspaceChange"||r.tool.kind==="responsibility")?l.push(r):i.push(r);return[...i,...l]}function LA({group:e,conversation:i,allowProcessView:l=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:k,onOpenComplexTask:w,onOpenSystemEvent:E}){const O=zA(e.agentItems.filter(_x)),U=e.agentItems.some(te=>!_x(te)),_=l&&(U||e.turnIds.length>0),F=c?"process":"result",[q,Y]=D.useState(F),[se,N]=D.useState(!1),X=q==="result"?O:e.agentItems,ae=WA(X);D.useEffect(()=>{se||Y(F)},[F,se]);const ee=c||_||e.stopped,L=s.jsxs(s.Fragment,{children:[ee?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):_?s.jsx("button",{"aria-label":q==="result"?"Show process":"Show result",className:"turn-view-toggle",title:q==="result"?"Show process":"Show result",type:"button",onClick:()=>{N(!0),Y(te=>te==="result"?(g(e.turnIds),"process"):"result")},children:q==="result"?s.jsx(IA,{}):s.jsx(UA,{})}):null}):null,X.map(te=>s.jsx(D.Fragment,{children:_o(te,i,m,d,u,b,x,k,w,E)},te.id)),q==="result"&&X.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":U?"No reliable final answer captured":"No result yet"}):null,s.jsx(Do,{copied:r,content:ae,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:KA(X),variant:"outside",onCopy:p})]});return e.stopped?s.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[s.jsxs("summary",{children:[s.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),s.jsx("span",{children:"Run stopped by user"})]}),s.jsx("div",{className:ee?"stopped-turn-body has-controls":"stopped-turn-body",children:L})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ee?"has-controls":""].filter(Boolean).join(" "),children:L})}function IA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function UA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function BA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:s.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function _v(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"15",viewBox:"0 0 24 24",width:"15",children:[s.jsx("circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"18",cy:"7",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"12",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m7.8 7 3.1 8.8M16.2 8.2l-3 7.8M8 6.2l8-.1",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function qA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:s.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function Dv({className:e="",description:i,icon:l,onClick:r,timestamp:u,title:c,trailing:d,visibleTitle:p}){return s.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":$e(u),onClick:r,title:c,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:l}),s.jsxs("span",{className:"compact-timeline-link-copy",children:[s.jsx("strong",{children:p}),s.jsx("small",{children:i})]}),d?s.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function HA({conversation:e,tool:i,onRespond:l}){var U;const r=we((U=i.workspaceChangePayload)==null?void 0:U.content)||i.body,[u,c]=D.useState(r),[d,p]=D.useState(null),[g,m]=D.useState("source"),[b,x]=D.useState(!1),k=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:k?"pending":"preparing",E=w==="pending";D.useEffect(()=>{c(r)},[r]);async function O(_){p(_);try{await l(i,_,_==="accept"?{content:u}:void 0)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Dv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(Wc,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:_=>_.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",$e(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:k?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,E?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:_=>c(_.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:Sa(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Sa(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:E?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void O("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void O("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function $A({tool:e,onRespond:i}){const[l,r]=D.useState(e.body),[u,c]=D.useState(null),[d,p]=D.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=Dx(l);return D.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":$e(e.createdAt),title:$e(e.createdAt),children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:e.title}),s.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),s.jsx("span",{children:g})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:l}):b?s.jsx(Mx,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(Mx,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:l}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{Dx(l)&&(c("accept"),Promise.resolve(i(e,"accept",l)).finally(()=>c(null)))},children:u==="accept"?"Saving...":"Save"}),s.jsx("button",{className:"reject",disabled:!!u,type:"button",onClick:()=>{c("decline"),Promise.resolve(i(e,"decline",l)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function Dx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function gp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function Mx({value:e,saved:i}){return s.jsx("div",{className:`knowledge-proposal-preview${i?" saved":""}`,children:s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:gp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:gp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:gp(e.content??e.description)})]})]})})}function GA({conversation:e,tool:i}){var d;const l=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=jE(l),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":$e(i.createdAt),title:$e(i.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),s.jsx("span",{className:"file-change-title",children:SE(l,r)})]}),s.jsx(Rx,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:l.map((p,g)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:VA(p.kind)}),s.jsx("code",{title:p.path,children:yv(p.path,r)}),s.jsx(Rx,{additions:p.additions,deletions:p.deletions})]},`${p.path}:${g}`))}),(d=i.rawEvents)!=null&&d.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(i.rawEvents,null,2)})]}):null]})}function Rx({additions:e,deletions:i,running:l=!1}){return s.jsxs("span",{className:"file-change-stats",children:[l?s.jsx("small",{children:"editing"}):null,e>0?s.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,i>0?s.jsxs("span",{className:"file-change-deletions",children:["-",i]}):null]})}function VA(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function YA({tool:e,onRespondApproval:i}){var k;const l=h_(e),[r,u]=D.useState(!1),[c,d]=D.useState("script"),p=l==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=qc(e.body)?null:e.body,m=g?b_(g):null,b=m?`${PA(l)} · ${m}`:l==="running"?"Running script":l==="approval"?"Waiting for approval":"Command",x=m_(e,l);return s.jsxs("article",{className:`tool-card command ${l}`,"data-hover-time":$e(e.createdAt),title:$e(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(w=>!w),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:b}),s.jsx("small",{className:"tool-command-badge",children:x})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(k=e.rawEvents)!=null&&k.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx(Ox,{content:g}):s.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?s.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[s.jsx("p",{className:"tool-command-result-meta",children:g_(e,l)}),e.output?s.jsx(Ox,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:l==="running"?"Waiting for output...":l==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(FA,{events:e.rawEvents??[]}):null]})}function PA(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function Ox({content:e}){const[i,l]=D.useState(!1),r=x_(e,jx);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:y_(e,jx)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>l(u=>!u),children:i?"Collapse":"Show all"}):null]})}function FA({events:e}){return s.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function Do({copied:e,content:i,id:l,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?s.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?s.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:s.jsx(Fv,{})}):null,s.jsx("time",{dateTime:u,children:$e(u)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(l,i),title:e?"Copied":"Copy",type:"button",children:e?s.jsx("span",{"aria-hidden":"true",children:"Copied"}):s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function Mo(e){return e.type==="message"?e.message.role==="user"?e.message.content:cr(e.message.content):e.type==="assistantText"?cr(e.content):e.type==="turnError"?`Task failed
95
+ `,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function AA({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:l,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:y,onRevealEnvironmentValue:k,onSubmitEnvironment:w,onValueVisibleChange:T,revealedEnvironmentKeys:R}){const z=i!==null&&R.has(i),N=u==="workspace",G=N?c:r,[B,P]=D.useState(!1);function se(){p(),b({description:"",key:"",value:""}),T(!1),P(!0)}function _(ee){y(ee),T(!1),P(!0)}function X(){P(!1),p(),T(!1)}function ae(ee){w(ee),P(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:N?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:N?"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."})]})}),N?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Environment"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(_x,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,s.jsxs("section",{className:"environment-manager",children:[s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:se,children:"+"})}),s.jsx(_x,{emptyText:N?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:ee=>g(ee),onEdit:_,variables:G})]}),B?s.jsx("div",{className:"memory-editor-overlay",onClick:X,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:ee=>ee.stopPropagation(),onSubmit:ae,children:[s.jsxs("header",{children:[s.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:X,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:ee=>b({...l,key:ee.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:l.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:ee=>b({...l,value:ee.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:l.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!z&&!l.value){k(i),T(!0);return}T(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(t2,{}):s.jsx(e2,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:ee=>b({...l,description:ee.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:l.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:X,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!l.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:ee=>ee.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function _x({emptyText:e,onDelete:i,onEdit:l,readonly:r=!1,variables:u}){return u.length===0?s.jsx("p",{className:"settings-note",children:e}):s.jsx("div",{className:r?"environment-list readonly":"environment-list",children:u.map(c=>s.jsxs("div",{className:r?"environment-row readonly":"environment-row",children:[s.jsxs("div",{className:"environment-row-main",children:[s.jsxs("pre",{"aria-label":`Environment variable ${c.key}`,children:[s.jsx("span",{className:"memory-tag",children:c.key}),"=",c.hasValue?"••••••":"",c.description?s.jsx("span",{className:"environment-comment",children:` # ${c.description}`}):null]}),s.jsxs("span",{children:[c.hasValue?"configured":"empty"," · updated"," ",$e(c.updatedAt)]})]}),r?s.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):s.jsxs("div",{className:"environment-row-actions",children:[s.jsx("button",{"aria-label":`Edit ${c.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>l==null?void 0:l(c),title:"Edit",type:"button",children:"✎"}),s.jsx("button",{"aria-label":`Delete ${c.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>i==null?void 0:i(c.key),title:"Delete",type:"button",children:"×"})]})]},c.key))})}function Rv({items:e,onDelete:i,onEdit:l}){const[r,u]=D.useState(null),[c,d]=D.useState(null);return e.length===0?s.jsxs("section",{className:"knowledge-empty",children:[s.jsx("h4",{children:"No knowledge registered"}),s.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):s.jsx("div",{className:"knowledge-list",children:e.map(p=>s.jsxs("article",{className:"knowledge-row",children:[s.jsxs("div",{className:"knowledge-row-main",children:[s.jsxs("header",{children:[s.jsx("strong",{children:p.name}),s.jsx("span",{children:_A(p.kind)}),s.jsx("span",{className:MA(p.status),children:DA(p.status)})]}),s.jsx("p",{children:p.purpose||p.description||"No purpose set."}),s.jsxs("div",{className:"knowledge-paths",children:[s.jsx("code",{children:p.digestPath}),s.jsx("code",{children:p.skillPath}),s.jsx("code",{children:p.fetch.scriptPath})]}),p.fetch.requiredEnv.length>0?s.jsx("div",{className:"knowledge-envs",children:p.fetch.requiredEnv.map(g=>s.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===p.id?s.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,s.jsxs("small",{children:[p.attention," · ",RA(p.refreshPolicy)," · updated ",$e(p.updatedAt)]})]}),s.jsx("div",{className:"environment-row-actions",children:r===p.id?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"danger",onClick:()=>{i(p.id),u(null)},type:"button",children:"Delete"}),s.jsx("button",{onClick:()=>u(null),type:"button",children:"Cancel"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`Check ${p.name}`,onClick:()=>d(p.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),s.jsx("button",{"aria-label":`Edit ${p.name}`,onClick:()=>l(p),title:"Edit knowledge",type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function NA({draft:e,items:i,scope:l,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:g}){return l==="workspace"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsxs("p",{children:["Long-lived source-backed material for ",r??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),s.jsx(Rv,{items:i,onDelete:c,onEdit:p}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[s.jsxs("div",{className:"knowledge-form-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Edit metadata"}),s.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),s.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),s.jsxs("div",{className:"knowledge-form-grid",children:[s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...e,name:b.target.value}),value:e.name})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Kind"}),s.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...e,kind:b.target.value}),value:e.kind,children:[s.jsx("option",{value:"source",children:"Source"}),s.jsx("option",{value:"skill",children:"Skill"}),s.jsx("option",{value:"reference",children:"Reference"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Status"}),s.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...e,status:b.target.value}),value:e.status,children:[s.jsx("option",{value:"draft",children:"Draft"}),s.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),s.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),s.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),s.jsx("option",{value:"ready",children:"Ready"}),s.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Attention"}),s.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...e,attention:b.target.value}),value:e.attention,children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"tracked",children:"Tracked"}),s.jsx("option",{value:"watch",children:"Watch"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Refresh"}),s.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...e,refreshPolicy:b.target.value}),value:e.refreshPolicy,children:[s.jsx("option",{value:"manual",children:"Manual"}),s.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Purpose"}),s.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...e,purpose:b.target.value}),rows:2,value:e.purpose})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Content"}),s.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...e,description:b.target.value}),rows:2,value:e.description})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Source clues"}),s.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...e,sourceCluesText:b.target.value}),rows:4,value:e.sourceCluesText})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Required environment"}),s.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...e,requiredEnvText:b.target.value}),rows:3,value:e.requiredEnvText})]}),s.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):s.jsxs("section",{className:"settings-empty-section",children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function _A(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function DA(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function RA(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function MA(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function Je({label:e,value:i,mono:l=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:l?"mono":void 0,title:i,children:i})]})}function OA({onRefresh:e,preview:i,refreshing:l}){const r=["workspace_identity","workspace_environment","rendering"],u=D.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,zA(p)]).sort(([d],[p])=>{const g=r.indexOf(d),m=r.indexOf(p);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Dx(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs("div",{className:"additional-context-preview",children:[s.jsx("div",{className:"additional-context-header",children:s.jsxs("div",{className:"additional-context-meta",children:[s.jsxs("span",{children:["Generated ",$e(i.generatedAt)]}),s.jsxs("span",{children:[Un(u.length)," keys"]}),s.jsx("button",{disabled:l,onClick:e,type:"button",children:l?"Rendering...":"Refresh"})]})}),s.jsxs("div",{className:"additional-context-toc",children:[s.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),s.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>s.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),s.jsx("div",{className:"additional-context-list",children:u.map(([d,p])=>s.jsxs("section",{className:"additional-context-item",id:Dx(d),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",d,">"]}),s.jsxs("span",{children:[Un(p.length)," chars"]})]}),s.jsx("pre",{children:p})]},d))})]})}function Dx(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function zA(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 LA({summary:e}){return s.jsxs("div",{className:"thread-read-summary",children:[s.jsxs("section",{className:"thread-read-summary-grid",children:[s.jsx(Je,{label:"Thread",value:e.id,mono:!0}),s.jsx(Je,{label:"Session",value:e.sessionId,mono:!0}),s.jsx(Je,{label:"Status",value:e.status}),s.jsx(Je,{label:"Source",value:e.source}),s.jsx(Je,{label:"Created",value:No(e.createdAt)}),s.jsx(Je,{label:"Updated",value:No(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:No(e.recencyAt)}),s.jsx(Je,{label:"Turns",value:Un(e.turnCount),mono:!0}),s.jsx(Je,{label:"Items",value:Un(e.itemCount),mono:!0}),s.jsx(Je,{label:"User / agent",value:`${Un(e.userMessageCount)} / ${Un(e.agentMessageCount)}`,mono:!0}),s.jsx(Je,{label:"Compactions",value:`${Un(e.compactionCount)} / ${Un(e.contextCompactionCount)} context`,mono:!0}),s.jsx(Je,{label:"CWD",value:e.cwd,mono:!0}),s.jsx(Je,{label:"Path",value:e.path,mono:!0})]}),e.preview?s.jsxs("details",{className:"thread-read-preview",children:[s.jsx("summary",{children:"Preview"}),s.jsx("p",{children:e.preview})]}):null,s.jsxs("section",{className:"thread-read-turns",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Turns"}),s.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),s.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((i,l)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",l+1]}),s.jsx("span",{title:i.id,children:i.id}),s.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),s.jsxs("div",{className:"thread-read-turn-detail",children:[s.jsxs("div",{className:"thread-read-turn-fields",children:[s.jsx(Je,{label:"Status",value:i.status}),s.jsx(Je,{label:"Items view",value:i.itemsView}),s.jsx(Je,{label:"Started",value:No(i.startedAt)}),s.jsx(Je,{label:"Completed",value:No(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":ss(i.durationMs)}),s.jsx(Je,{label:"Item types",value:i.itemTypes||"none"})]}),i.preview?s.jsx("p",{className:"thread-read-turn-preview",children:i.preview}):null,s.jsxs("details",{className:"thread-read-turn-raw",children:[s.jsx("summary",{children:"Turn raw JSON"}),s.jsx("pre",{children:JSON.stringify(i.raw,null,2)})]})]})]},i.id))})]})]})}function _o(e,i,l,r,u,c,d,p,g,m){var b,y,k,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":$e(e.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:"Seele"}),s.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":$e(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(Mo,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":$e(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(Hx,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":$e(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:Y_(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:$e(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(Hx,{content:e.message.content}):s.jsx(Mo,{content:e.message.content,conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="system"){if((b=e.topicMessages)!=null&&b.length)return s.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(R=>s.jsx("article",{className:"message topic-input","data-hover-time":$e(R.createdAt),children:s.jsxs("div",{className:"topic-message-bubble topic-input-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["From ",R.senderName]}),s.jsx("time",{dateTime:R.createdAt,children:$e(R.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Mo,{content:R.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},R.id))});const T=ur({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":$e(e.createdAt),children:s.jsx("div",{className:"message-main",children:s.jsxs("button",{className:`system-message-body system-message-link${e.visualKind?` ${e.visualKind}`:""}`,onClick:()=>m==null?void 0:m(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(Dc,{})}):null,s.jsx("span",{className:"system-message-title",children:e.title}),s.jsx("small",{children:T})]})})})}return e.type==="steerMarker"?s.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[s.jsx("span",{children:"Added while running"}),s.jsx("strong",{children:e.content})]}):e.tool.linkedTaskId&&g?s.jsx(Ov,{description:e.tool.body,icon:s.jsx(Mv,{}),onClick:()=>void g(e.tool.linkedTaskId),timestamp:e.tool.createdAt,title:"View complex task details",trailing:e.tool.meta,visibleTitle:e.tool.title}):e.tool.kind==="command"?s.jsx(WA,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((y=e.tool.fileChanges)!=null&&y.length)?s.jsx(YA,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(VA,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(PA,{tool:e.tool,onRespond:p}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?s.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":$e(e.tool.createdAt),title:$e(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Dc,{})}),s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsxs("div",{className:"topic-message-bubble topic-output-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["To ",e.tool.topicRecipientLabel??"Topic"]}),s.jsx("time",{dateTime:e.tool.createdAt,children:$e(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Mo,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(k=e.tool.rawEvents)!=null&&k.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":$e(e.tool.createdAt),title:$e(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Dc,{})}):null,s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsx("code",{children:e.tool.body}),e.tool.output?s.jsx("pre",{children:e.tool.output}):null,(w=e.tool.rawEvents)!=null&&w.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function Rx(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&IA(e.tool)}function IA(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 UA(e){const i=[],l=[];for(const r of e)r.type==="tool"&&(r.tool.kind==="collaboration"&&r.tool.topicAction==="send"||r.tool.kind==="workspaceChange"||r.tool.kind==="responsibility")?l.push(r):i.push(r);return[...i,...l]}function BA({group:e,conversation:i,allowProcessView:l=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:y,onRespondKnowledgeProposal:k,onOpenComplexTask:w,onOpenSystemEvent:T}){const R=UA(e.agentItems.filter(Rx)),z=e.agentItems.some(te=>!Rx(te)),N=l&&(z||e.turnIds.length>0),G=c?"process":"result",[B,P]=D.useState(G),[se,_]=D.useState(!1),X=B==="result"?R:e.agentItems,ae=QA(X);D.useEffect(()=>{se||P(G)},[G,se]);const ee=c||N||e.stopped,I=s.jsxs(s.Fragment,{children:[ee?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):N?s.jsx("button",{"aria-label":B==="result"?"Show process":"Show result",className:"turn-view-toggle",title:B==="result"?"Show process":"Show result",type:"button",onClick:()=>{_(!0),P(te=>te==="result"?(g(e.turnIds),"process"):"result")},children:B==="result"?s.jsx(qA,{}):s.jsx(HA,{})}):null}):null,X.map(te=>s.jsx(D.Fragment,{children:_o(te,i,m,d,u,b,y,k,w,T)},te.id)),B==="result"&&X.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":z?"No reliable final answer captured":"No result yet"}):null,s.jsx(Do,{copied:r,content:ae,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:ZA(X),variant:"outside",onCopy:p})]});return e.stopped?s.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[s.jsxs("summary",{children:[s.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),s.jsx("span",{children:"Run stopped by user"})]}),s.jsx("div",{className:ee?"stopped-turn-body has-controls":"stopped-turn-body",children:I})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ee?"has-controls":""].filter(Boolean).join(" "),children:I})}function qA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function HA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function $A(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:s.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function Mv(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"15",viewBox:"0 0 24 24",width:"15",children:[s.jsx("circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"18",cy:"7",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"12",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m7.8 7 3.1 8.8M16.2 8.2l-3 7.8M8 6.2l8-.1",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function GA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:s.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function Ov({className:e="",description:i,icon:l,onClick:r,timestamp:u,title:c,trailing:d,visibleTitle:p}){return s.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":$e(u),onClick:r,title:c,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:l}),s.jsxs("span",{className:"compact-timeline-link-copy",children:[s.jsx("strong",{children:p}),s.jsx("small",{children:i})]}),d?s.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function VA({conversation:e,tool:i,onRespond:l}){var z;const r=we((z=i.workspaceChangePayload)==null?void 0:z.content)||i.body,[u,c]=D.useState(r),[d,p]=D.useState(null),[g,m]=D.useState("source"),[b,y]=D.useState(!1),k=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:k?"pending":"preparing",T=w==="pending";D.useEffect(()=>{c(r)},[r]);async function R(N){p(N);try{await l(i,N,N==="accept"?{content:u}:void 0)&&y(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Ov,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(Wc,{}),onClick:()=>y(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&y(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:N=>N.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",$e(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>y(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:k?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,T?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:N=>c(N.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:ja(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:ja(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:T?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void R("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void R("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>y(!1),type:"button",children:"Close"})})]})}):null]})}function PA({tool:e,onRespond:i}){const[l,r]=D.useState(e.body),[u,c]=D.useState(null),[d,p]=D.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=Mx(l);return D.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":$e(e.createdAt),title:$e(e.createdAt),children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:e.title}),s.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),s.jsx("span",{children:g})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:y=>r(y.target.value),rows:10,value:l}):b?s.jsx(Ox,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(Ox,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:l}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{Mx(l)&&(c("accept"),Promise.resolve(i(e,"accept",l)).finally(()=>c(null)))},children:u==="accept"?"Saving...":"Save"}),s.jsx("button",{className:"reject",disabled:!!u,type:"button",onClick:()=>{c("decline"),Promise.resolve(i(e,"decline",l)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function Mx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function gp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function Ox({value:e,saved:i}){return s.jsx("div",{className:`knowledge-proposal-preview${i?" saved":""}`,children:s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:gp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:gp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:gp(e.content??e.description)})]})]})})}function YA({conversation:e,tool:i}){var d;const l=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=EE(l),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":$e(i.createdAt),title:$e(i.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),s.jsx("span",{className:"file-change-title",children:TE(l,r)})]}),s.jsx(zx,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:l.map((p,g)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:FA(p.kind)}),s.jsx("code",{title:p.path,children:bv(p.path,r)}),s.jsx(zx,{additions:p.additions,deletions:p.deletions})]},`${p.path}:${g}`))}),(d=i.rawEvents)!=null&&d.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(i.rawEvents,null,2)})]}):null]})}function zx({additions:e,deletions:i,running:l=!1}){return s.jsxs("span",{className:"file-change-stats",children:[l?s.jsx("small",{children:"editing"}):null,e>0?s.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,i>0?s.jsxs("span",{className:"file-change-deletions",children:["-",i]}):null]})}function FA(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function WA({tool:e,onRespondApproval:i}){var k;const l=y_(e),[r,u]=D.useState(!1),[c,d]=D.useState("script"),p=l==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=qc(e.body)?null:e.body,m=g?k_(g):null,b=m?`${KA(l)} · ${m}`:l==="running"?"Running script":l==="approval"?"Waiting for approval":"Command",y=x_(e,l);return s.jsxs("article",{className:`tool-card command ${l}`,"data-hover-time":$e(e.createdAt),title:$e(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(w=>!w),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:b}),s.jsx("small",{className:"tool-command-badge",children:y})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(k=e.rawEvents)!=null&&k.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx(Lx,{content:g}):s.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?s.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[s.jsx("p",{className:"tool-command-result-meta",children:b_(e,l)}),e.output?s.jsx(Lx,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:l==="running"?"Waiting for output...":l==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(XA,{events:e.rawEvents??[]}):null]})}function KA(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function Lx({content:e}){const[i,l]=D.useState(!1),r=w_(e,Tx);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:v_(e,Tx)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>l(u=>!u),children:i?"Collapse":"Show all"}):null]})}function XA({events:e}){return s.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function Do({copied:e,content:i,id:l,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?s.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?s.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:s.jsx(Xv,{})}):null,s.jsx("time",{dateTime:u,children:$e(u)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(l,i),title:e?"Copied":"Copy",type:"button",children:e?s.jsx("span",{"aria-hidden":"true",children:"Copied"}):s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function Ro(e){return e.type==="message"?e.message.role==="user"?e.message.content:cr(e.message.content):e.type==="assistantText"?cr(e.content):e.type==="turnError"?`Task failed
96
96
 
97
97
  ${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(i=>!!(i!=null&&i.trim())).join(`
98
98
 
99
- `):""}function WA(e){return e.map(Mo).filter(i=>i.trim()).join(`
99
+ `):""}function QA(e){return e.map(Ro).filter(i=>i.trim()).join(`
100
100
 
101
- `)}function KA(e){for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l.type!=="tool")return l.createdAt}return new Date().toISOString()}function XA({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(QA,{label:Mv(i.windowDurationMins),window:i},`${i.windowDurationMins}:${i.resetsAt}`))}):s.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:s.jsx("strong",{children:"--"})})}function Mv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function QA({label:e,window:i}){const l=Kc(i.usedPercent),r=Eh(l),u=`${e} usage ${fw(l)} · resets ${pw(i.resetsAt)}`;return s.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${l}%`},tabIndex:0,children:s.jsxs("strong",{children:[Math.round(l),"%"]})})}function ZA(e,i,l,r,u,c){const d=[...e].sort(Bo),p=new Map(r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>[N.turnId,N.sequence])),g=new Map(r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>[N.turnId,N.timelineAt])),m=new Map(r.filter(N=>N.nodeType==="user_message"&&N.entityId!==null).map(N=>[N.entityId,N.sequence])),b=new Map(r.filter(N=>N.nodeType==="user_message"&&N.entityId!==null).map(N=>[N.entityId,N.timelineAt])),x=r.filter(N=>N.parentId===null&&N.nodeType==="system_event"),k=x.filter(N=>N.turnId!==null&&N.subtype.startsWith("input:")),w=x.filter(N=>!k.includes(N)),E=new Set(x.flatMap(N=>N.turnId?[N.turnId]:[])),O=dE(i),U=new Map(l.map(N=>[N.id,N])),_=r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>N.turnId),q=[...new Set(r.length>0?[..._,...u?[u]:[]]:[...l.map(N=>N.id),...d.flatMap(N=>N.turnId?[N.turnId]:[]),...i.flatMap(N=>N.turnId?[N.turnId]:[])])].map(N=>{var Et,Jt,zt,rn;const X=U.get(N),ae=d.filter(ze=>ze.turnId===N),ee=ae.filter(ze=>ze.role==="user").sort((ze,wt)=>{const sn=b.get(ze.id)??ze.createdAt,wn=b.get(wt.id)??wt.createdAt;return sn.localeCompare(wn)||Bo(ze,wt)}),L=ae.filter(ze=>ze.role==="assistant"),te=i.filter(ze=>ze.turnId===N).sort(Bo),ce=`turn:${N}`,Ee=r.filter(ze=>ze.parentId===ce).sort((ze,wt)=>ze.sequence-wt.sequence),ge=(X==null?void 0:X.origin)??O.get(N),ue=k.filter(ze=>ze.turnId===N).sort((ze,wt)=>ze.timelineAt.localeCompare(wt.timelineAt)||ze.sequence-wt.sequence).map(ze=>zx(ze,void 0,c)),G=ge==="timeline_event"?[]:r.length>0?sN(Ee,te,Io([N],u),c):Ov(te,Io([N],u),c),oe=L.map(Ao),ye=Ee.find(ze=>ze.subtype==="server.complex_task.plan_updated"),De=te.find(ze=>ze.event==="server.complex_task.plan_updated"),R=(ye==null?void 0:ye.detail)??(De==null?void 0:De.data),A=fe(fe(R).task),z=fe(A.currentPlan),C=we(z.planMarkdown),K=nN(rN(G,oe),C),me=fE(X);me&&K.push({id:`turn-error-${me.turnId}`,type:"turnError",createdAt:me.createdAt,content:me.content});const Z=te.find(ze=>ze.event==="server.wakeup.started"),xe=fe(Z==null?void 0:Z.data),Le=typeof xe.instruction=="string"?xe.instruction.trim():"",Xe=ge==="timeline_event"?te[0]:void 0,Ot=E.has(N)?null:Xe?Rv(Xe,(X==null?void 0:X.startedAt)??new Date(0).toISOString()):iN(ge)?{id:`system-${N}`,type:"system",createdAt:(X==null?void 0:X.startedAt)??((Et=te[0])==null?void 0:Et.createdAt)??new Date(0).toISOString(),title:lN(ge??"system"),detail:aN(ge??"system",Le),fullDetail:Le||void 0}:null,Ft=wN(te),Ye=(ee[0]?b.get(ee[0].id):(Jt=k.find(ze=>ze.turnId===N))==null?void 0:Jt.timelineAt)??g.get(N)??(X==null?void 0:X.startedAt)??((zt=ae[0])==null?void 0:zt.createdAt)??((rn=te[0])==null?void 0:rn.createdAt)??new Date(0).toISOString();return{id:`turn-${N}`,turnIds:[N],user:Ot??(ee[0]?Ao(ee[0]):null),followupUsers:ee.slice(1).map(Ao),acceptedSystemInputs:ue,agentItems:K,activity:Ft??(Io([N],u)?{id:-1,title:K.some(ze=>ze.type==="assistantText"&&ze.streaming)?"Writing response":"Working",createdAt:Ye,tone:"running"}:null),notificationFailure:vN(te),stopped:te.some(Lv),trailingSystemItems:[],sortAt:Ye,sortSequence:p.get(N)??null}}),Y=d.filter(N=>!N.turnId);q.push(...Y.map(N=>({id:`message-${N.id}`,turnIds:[],user:N.role==="user"?Ao(N):null,followupUsers:[],agentItems:N.role==="assistant"?[Ao(N)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(N.id)??N.createdAt,sortSequence:m.get(N.id)??null})));const se=new Map(i.map(N=>[String(N.id),N]));return q.push(...w.map(N=>({id:N.id,turnIds:[],user:zx(N,N.entityType==="event"&&N.entityId?se.get(N.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:N.timelineAt,sortSequence:N.sequence}))),q.sort((N,X)=>{const ae=N.sortAt.localeCompare(X.sortAt);return ae!==0?ae:N.sortSequence!==null||X.sortSequence!==null?(N.sortSequence??Number.MAX_SAFE_INTEGER)-(X.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:N,...X})=>X)}function zx(e,i,l){var g,m;if(i||e.entityType==="event")return Rv(i??Wp(e),e.createdAt);const r=fe(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=$p(r,l),x=JA(r.messages,l),k=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(E=>typeof E=="string"&&E.trim().length>0):[],w=typeof r.unreadCount=="number"?r.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:b.title,detail:b.detail,visualKind:"topic",topicMessages:x,fullDetail:[`## ${b.title}`,"","**Unread**","",String(w),"","**From**","",k.length>0?k.map(E=>{const O=l.get(E)??E;return`${rr(O)} (\`${E}\`)`}).join(", "):"Unknown"].join(`
102
- `)}}const u=we(r.complexTaskId)||we(fe(r.task).id)||void 0,c=mv(e.title,e.subtype),d=ur(r,[e.summary,e.contentMarkdown]),p=[`## ${rr(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(`
101
+ `)}function ZA(e){for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l.type!=="tool")return l.createdAt}return new Date().toISOString()}function JA({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(eN,{label:zv(i.windowDurationMins),window:i},`${i.windowDurationMins}:${i.resetsAt}`))}):s.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:s.jsx("strong",{children:"--"})})}function zv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function eN({label:e,window:i}){const l=Kc(i.usedPercent),r=Nh(l),u=`${e} usage ${mw(l)} · resets ${gw(i.resetsAt)}`;return s.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${l}%`},tabIndex:0,children:s.jsxs("strong",{children:[Math.round(l),"%"]})})}function tN(e,i,l,r,u,c){const d=[...e].sort(Bo),p=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])),y=r.filter(_=>_.parentId===null&&_.nodeType==="system_event"),k=y.filter(_=>_.turnId!==null&&_.subtype.startsWith("input:")),w=y.filter(_=>!k.includes(_)),T=new Set(y.flatMap(_=>_.turnId?[_.turnId]:[])),R=hE(i),z=new Map(l.map(_=>[_.id,_])),N=r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>_.turnId),B=[...new Set(r.length>0?[...N,...u?[u]:[]]:[...l.map(_=>_.id),...d.flatMap(_=>_.turnId?[_.turnId]:[]),...i.flatMap(_=>_.turnId?[_.turnId]:[])])].map(_=>{var Et,Jt,zt,rn;const X=z.get(_),ae=d.filter(ze=>ze.turnId===_),ee=ae.filter(ze=>ze.role==="user").sort((ze,wt)=>{const sn=b.get(ze.id)??ze.createdAt,wn=b.get(wt.id)??wt.createdAt;return sn.localeCompare(wn)||Bo(ze,wt)}),I=ae.filter(ze=>ze.role==="assistant"),te=i.filter(ze=>ze.turnId===_).sort(Bo),ce=`turn:${_}`,Ee=r.filter(ze=>ze.parentId===ce).sort((ze,wt)=>ze.sequence-wt.sequence),ge=(X==null?void 0:X.origin)??R.get(_),ue=k.filter(ze=>ze.turnId===_).sort((ze,wt)=>ze.timelineAt.localeCompare(wt.timelineAt)||ze.sequence-wt.sequence).map(ze=>Ix(ze,void 0,c)),V=ge==="timeline_event"?[]:r.length>0?cN(Ee,te,Io([_],u),c):Iv(te,Io([_],u),c),oe=I.map(Ao),ye=Ee.find(ze=>ze.subtype==="server.complex_task.plan_updated"),De=te.find(ze=>ze.event==="server.complex_task.plan_updated"),O=(ye==null?void 0:ye.detail)??(De==null?void 0:De.data),A=pe(pe(O).task),L=pe(A.currentPlan),C=we(L.planMarkdown),K=aN(uN(V,oe),C),me=mE(X);me&&K.push({id:`turn-error-${me.turnId}`,type:"turnError",createdAt:me.createdAt,content:me.content});const Z=te.find(ze=>ze.event==="server.wakeup.started"),xe=pe(Z==null?void 0:Z.data),Le=typeof xe.instruction=="string"?xe.instruction.trim():"",Xe=ge==="timeline_event"?te[0]:void 0,Ot=T.has(_)?null:Xe?Lv(Xe,(X==null?void 0:X.startedAt)??new Date(0).toISOString()):rN(ge)?{id:`system-${_}`,type:"system",createdAt:(X==null?void 0:X.startedAt)??((Et=te[0])==null?void 0:Et.createdAt)??new Date(0).toISOString(),title:sN(ge??"system"),detail:oN(ge??"system",Le),fullDetail:Le||void 0}:null,Wt=SN(te),Ye=(ee[0]?b.get(ee[0].id):(Jt=k.find(ze=>ze.turnId===_))==null?void 0:Jt.timelineAt)??g.get(_)??(X==null?void 0:X.startedAt)??((zt=ae[0])==null?void 0:zt.createdAt)??((rn=te[0])==null?void 0:rn.createdAt)??new Date(0).toISOString();return{id:`turn-${_}`,turnIds:[_],user:Ot??(ee[0]?Ao(ee[0]):null),followupUsers:ee.slice(1).map(Ao),acceptedSystemInputs:ue,agentItems:K,activity:Wt??(Io([_],u)?{id:-1,title:K.some(ze=>ze.type==="assistantText"&&ze.streaming)?"Writing response":"Working",createdAt:Ye,tone:"running"}:null),notificationFailure:jN(te),stopped:te.some(Bv),trailingSystemItems:[],sortAt:Ye,sortSequence:p.get(_)??null}}),P=d.filter(_=>!_.turnId);B.push(...P.map(_=>({id:`message-${_.id}`,turnIds:[],user:_.role==="user"?Ao(_):null,followupUsers:[],agentItems:_.role==="assistant"?[Ao(_)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(_.id)??_.createdAt,sortSequence:m.get(_.id)??null})));const se=new Map(i.map(_=>[String(_.id),_]));return B.push(...w.map(_=>({id:_.id,turnIds:[],user:Ix(_,_.entityType==="event"&&_.entityId?se.get(_.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:_.timelineAt,sortSequence:_.sequence}))),B.sort((_,X)=>{const ae=_.sortAt.localeCompare(X.sortAt);return ae!==0?ae:_.sortSequence!==null||X.sortSequence!==null?(_.sortSequence??Number.MAX_SAFE_INTEGER)-(X.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:_,...X})=>X)}function Ix(e,i,l){var g,m;if(i||e.entityType==="event")return Lv(i??Wp(e),e.createdAt);const r=pe(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=$p(r,l),y=nN(r.messages,l),k=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(T=>typeof T=="string"&&T.trim().length>0):[],w=typeof r.unreadCount=="number"?r.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:b.title,detail:b.detail,visualKind:"topic",topicMessages:y,fullDetail:[`## ${b.title}`,"","**Unread**","",String(w),"","**From**","",k.length>0?k.map(T=>{const R=l.get(T)??T;return`${rr(R)} (\`${T}\`)`}).join(", "):"Unknown"].join(`
102
+ `)}}const u=we(r.complexTaskId)||we(pe(r.task).id)||void 0,c=yv(e.title,e.subtype),d=ur(r,[e.summary,e.contentMarkdown]),p=[`## ${rr(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(`
103
103
  `):""].filter(Boolean).join(`
104
- `);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function JA(e,i){if(!Array.isArray(e))return[];const l=new Set,r=[];for(const u of e){const c=fe(u),d=we(c.id),p=we(c.senderWorkspaceId),g=we(c.contentMarkdown).trim(),m=we(c.createdAt);!d||l.has(d)||!p||!g||!m||(l.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(we(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function Rv(e,i){return e.event==="server.collaboration.topic_created"?eN(e,i):tN(e,i)}function eN(e,i){const l=fe(fe(e.data).topic),r=we(l.title).trim()||"Untitled Topic",u=we(l.publicDescription).trim()||"未填写描述",c=Array.isArray(l.members)?l.members.map(fe):[],d=we(l.ownerWorkspaceId),p=c.find(x=>we(x.role)==="owner"||we(x.workspaceId)===d),g=we(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>we(x.role)!=="owner"&&we(x.status)==="active"),b=m.length?m.map(x=>{const k=we(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${rr(k)} (\`${we(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",rr(r),"","**描述**","",rr(u),"","**Owner Workspace**","",`${rr(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
105
- `)}}function tN(e,i){const l=fe(e.data),r=Fp(e.data),u=mv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:ur(l),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${rr(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
106
- `)}}function Fp(e,i=""){return Array.isArray(e)?e.map(l=>Fp(l)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([l,r])=>[l,Fp(r,l)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&Ho(e)||e}function nN(e,i){const l=i.trim();return l?e.filter(r=>r.type==="assistantText"?cr(r.content).trim()!==l:r.type==="message"&&r.message.role==="assistant"?cr(r.message.content).trim()!==l:!0):e}function iN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function lN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function aN(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?aw(i,20):"Auto resumed"}function rN(e,i){if(e.some(u=>u.type==="assistantText"))return Bc(e);if(i.length===0)return e;const l=[...i],r=[];for(const u of e)u.type==="tool"&&kh(u.tool)&&wh(l,u.tool)||r.push(u);return Bc([...r,...l])}function sN(e,i,l,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=oN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(_l(x),x)}if(l)for(const m of i)uN(e,m)||c.set(_l(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(_l(m),m);const p=Ov([...c.values()].sort(Bo),l,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:cN(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:l&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:dN(m,r)})}return Bc(p)}function oN(e,i,l){if(e.entityType==="event"&&e.entityId){const r=l.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[Wp(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>vh(u)===e.entityId);return r.length>0?r:[Wp(e)]}return[]}function Wp(e){const i=fe(e.detail),l=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":we(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":l,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function uN(e,i){const l=i.id===void 0?null:String(i.id),r=vh(i);return e.some(u=>l!==null&&u.entityType==="event"&&u.entityId===l||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function vh(e){if(e.event!=="codex.notification")return null;const i=fe(e.data),l=fe(i.params),r=fe(l.item);return we(r.id)||we(l.itemId)||null}function cN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function dN(e,i){var r,u;const l=fe(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?$p(l,i).title:e.title||rw(e.subtype),body:e.subtype==="input:collaboration_notice"?$p(l,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||Jv(l),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Ov(e,i,l){const r=[],u=new Map,c=new Map,d=new Map;for(const p of e){if(p.event==="server.workspace_change.decision"||p.event==="server.responsibility.decision"){hN(r,p);continue}if(p.event==="server.knowledge.decision"){mN(r,p);continue}if(Lv(p)){bN(r);continue}if(p.event==="server.steer"){const E=fe(p.data),O=typeof E.message=="string"?E.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:O||"Additional input",messageId:typeof E.messageId=="string"?E.messageId:void 0});continue}const g=U_(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=I_(p.data);if(m!=null&&m.text){const E=m.itemId?d.get(m.itemId)??m.phase:m.phase,O=m.itemId??`phase:${E}`,U=`${u.get(O)??""}${m.text}`,_=Gv(U),F=c.get(O)??"",q=_.startsWith(F)?_.slice(F.length):_;if(u.set(O,U),c.set(O,_),q){const Y=r[r.length-1];(Y==null?void 0:Y.type)==="assistantText"&&yN(Y,m.itemId,E)?(Y.content+=q,Y.itemId=Y.itemId??m.itemId,Y.streamKey=Y.streamKey??O,Y.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:q,phase:E,itemId:m.itemId,streamKey:O,streaming:i})}continue}const b=B_(p.data);if(b!=null&&b.text){const E=cr(b.text),O=b.itemId??`phase:${b.phase}`,U=xN(r,b.itemId,b.phase);if(U>=0){const _=r[U];_.type==="assistantText"&&(E?(_.content=E,_.phase=b.phase,_.itemId=_.itemId??b.itemId,_.streamKey=_.streamKey??O,_.streaming=!1,pN(r,U,b.itemId)):r.splice(U,1))}else E&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:E,phase:b.phase,itemId:b.itemId,streamKey:O,streaming:!1});continue}const x=c_(p,l);if(x){x.rawEvents=[p];const E=Ix(r,x);if(E>=0){Ux(r[E],x);continue}if(kh(x)&&wh(r,x)||x.kind==="command"&&x.meta==="running"&&qc(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const k=d_(p);if(k){k.rawEvents=[p];const E=Ix(r,k);if(E>=0){Ux(r[E],k);continue}r.push({id:`tool-${k.id}`,type:"tool",createdAt:k.createdAt,tool:k});continue}if(bE(p)){fN(r,p);continue}const w=f_(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return Bc(r)}function fN(e,i){const l=vh(i);if(l)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==l)){u.tool={...u.tool,rawEvents:Iv(u.tool.rawEvents,[i])};return}}}function pN(e,i,l){if(l)for(let r=e.length-1;r>i;r-=1){const u=e[r];u.type==="assistantText"&&u.itemId===l&&e.splice(r,1)}}function hN(e,i){const l=fe(i.data),r=typeof l.proposalId=="string"?l.proposalId:void 0,u=typeof l.decision=="string"?l.decision:void 0,c=fe(l.payload),d=we(c.content)||(typeof l.responsibility=="string"?l.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let p=e.length-1;p>=0;p-=1){const g=e[p];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){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 mN(e,i){const l=fe(i.data),r=typeof l.proposalId=="string"?l.proposalId:void 0,u=typeof l.decision=="string"?l.decision:void 0,c=fe(l.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=e.length-1;d>=0;d-=1){const p=e[d];if(p.type==="tool"&&p.tool.kind==="knowledge"&&p.tool.knowledgeProposalId===r){p.tool={...p.tool,title:u==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:u==="accept"?"saved":"declined",body:u==="accept"&&Object.keys(c).length>0?JSON.stringify(c,null,2):p.tool.body};return}}}function wh(e,i){const l=zv(i);if(typeof l!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Lx(d,i))continue;const p=cr(d.content);p!==d.content&&(e[c]={...d,content:p})}let r=0,u=-1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Lx(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,l>=g)continue;const m=Math.max(0,Math.min(d.content.length,l-p)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),k=[];return b&&k.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),k.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&k.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...k),!0}if(u>=0&&l>=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 Lx(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function Bc(e){const i=[],l=[];for(const c of e){if(c.type==="tool"&&kh(c.tool)){i.push(c.tool);continue}l.push(c)}const r=[...l],u=[];for(const c of i)wh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return gN([...u,...r])}function kh(e){return typeof zv(e)=="number"}function zv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function gN(e){const i=[];for(let l=0;l<e.length;l+=1){const r=e[l],u=e[l+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),l+=1;continue}i.push(r)}return i}function yN(e,i,l){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===l}function xN(e,i,l){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===l||u.phase==="unknown"||l==="unknown"))return r}return-1}function Lv(e){return e.event==="server.stop"||e.event==="server.stopped"}function bN(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 vN(e){for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l.event!=="server.notification.failed")continue;const r=fe(l.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function wN(e){for(let i=e.length-1;i>=0;i-=1){const l=sw(e[i]);if(l)return l}return null}function Ix(e,i){for(let l=e.length-1;l>=0;l-=1){const r=e[l];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 l}return-1}function Ux(e,i){if(e.type!=="tool")return;const l=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&qc(i.body)&&!qc(e.tool.body);e.tool={...e.tool,...i,id:e.tool.id,createdAt:e.tool.createdAt,title:l?e.tool.title:i.title,body:r?e.tool.body:i.body,meta:l?e.tool.meta:i.meta,output:T_(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:Iv(e.tool.rawEvents,i.rawEvents)}}function Iv(e,i){const l=[...e??[],...i??[]];if(l.length===0)return;const r=new Set;return l.filter(u=>{const c=_l(u);return r.has(c)?!1:(r.add(c),!0)})}function Ao(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function yp(e,i){const l=new Set,r=[...e,...i].filter(u=>l.has(u.id)?!1:(l.add(u.id),!0));return r.filter(u=>Uv(u)?!r.some(c=>kN(c,u)):!0)}function xp(e,i){const l=new Map;for(const r of[...e,...i])l.set(r.id,r);return[...l.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function bp(e,i){const l=new Map;for(const r of[...e,...i])l.set(r.id,r);return[...l.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function Uv(e){return e.id.startsWith("local-")}function kN(e,i){if(Uv(e)||e.role!==i.role||e.content.trim()!==i.content.trim())return!1;const l=Date.parse(e.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(l)||Number.isNaN(r)?!1:Math.abs(l-r)<=12e4}function Cc(e,i){const l=new Map,r=new Map;for(const c of[...e,...i]){const d=_l(c);r.has(d)||r.set(d,r.size),l.set(d,c)}return[...l.values()].sort((c,d)=>{const p=Bv(c,d);return p!==0?p:(r.get(_l(c))??0)-(r.get(_l(d))??0)})}function vp(e,i){const l=_l(i),r=e.findIndex(c=>_l(c)===l);if(r<0)return[...e,i];if(SN(e[r],i))return e;const u=[...e];return u[r]=i,u}function SN(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 _l(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Bo(e,i){const l=Bv(e,i);return l!==0?l:jN(e.id,i.id)}function Bv(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 l=Date.parse(e.createdAt??""),r=Date.parse(i.createdAt??"");return!Number.isNaN(l)&&!Number.isNaN(r)&&l!==r?l-r:Number.isNaN(l)!==Number.isNaN(r)?Number.isNaN(l)?1:-1:0}function jN(e,i){return e===i?0:e===void 0?1:i===void 0?-1:typeof e=="number"&&typeof i=="number"?e-i:String(e).localeCompare(String(i))}function wp(e,i){const l=fe(e.data);return typeof l.__seq=="number"&&typeof l.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(l,"payload")?{id:typeof l.__eventId=="string"?l.__eventId:`stream:${l.__turnId??"unknown"}:${l.__seq}`,turnId:typeof l.__turnId=="string"?l.__turnId:null,seq:l.__seq,event:e.event,data:l.payload,createdAt:l.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const Ro=D.memo(function({content:i,conversation:l,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?Gv(i):cr(i),g=l&&!r?MN(p,l):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(EN,{content:p,conversation:l}):Sa(p,l),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(DN,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},CN);function CN(e,i){var l,r,u,c;return e.content===i.content&&e.streaming===i.streaming&&e.copiedArtifactUrl===i.copiedArtifactUrl&&((l=e.conversation)==null?void 0:l.id)===((r=i.conversation)==null?void 0:r.id)&&((u=e.conversation)==null?void 0:u.workspacePath)===((c=i.conversation)==null?void 0:c.workspacePath)}function Bx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const TN=2;function EN({content:e,conversation:i}){const l=D.useRef(null),[r,u]=D.useState(null),{committedBlocks:c,activeBlock:d}=AN(e);return D.useLayoutEffect(()=>{const p=l.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=g*TN,k=Math.min(m,x);return b!==null&&k<=b?b:k})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:l,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(D.Fragment,{children:Sa(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function AN(e){const i=_N(e),l=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:NN(l),activeBlock:r}}function NN(e){const i=[];let l=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(Tc(i,e.slice(l,d)),l=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&(Tc(i,e.slice(l,m)),l=m,u=!1),g===""&&(Tc(i,e.slice(l,d)),l=d)}return l<e.length&&Tc(i,e.slice(l)),i}function Tc(e,i){i.trim()&&e.push(i)}function _N(e){const i=e.lastIndexOf(`
104
+ `);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function nN(e,i){if(!Array.isArray(e))return[];const l=new Set,r=[];for(const u of e){const c=pe(u),d=we(c.id),p=we(c.senderWorkspaceId),g=we(c.contentMarkdown).trim(),m=we(c.createdAt);!d||l.has(d)||!p||!g||!m||(l.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(we(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function Lv(e,i){return e.event==="server.collaboration.topic_created"?iN(e,i):lN(e,i)}function iN(e,i){const l=pe(pe(e.data).topic),r=we(l.title).trim()||"Untitled Topic",u=we(l.publicDescription).trim()||"未填写描述",c=Array.isArray(l.members)?l.members.map(pe):[],d=we(l.ownerWorkspaceId),p=c.find(y=>we(y.role)==="owner"||we(y.workspaceId)===d),g=we(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(y=>we(y.role)!=="owner"&&we(y.status)==="active"),b=m.length?m.map(y=>{const k=we(y.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${rr(k)} (\`${we(y.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",rr(r),"","**描述**","",rr(u),"","**Owner Workspace**","",`${rr(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
105
+ `)}}function lN(e,i){const l=pe(e.data),r=Fp(e.data),u=yv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:ur(l),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${rr(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
106
+ `)}}function Fp(e,i=""){return Array.isArray(e)?e.map(l=>Fp(l)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([l,r])=>[l,Fp(r,l)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&Ho(e)||e}function aN(e,i){const l=i.trim();return l?e.filter(r=>r.type==="assistantText"?cr(r.content).trim()!==l:r.type==="message"&&r.message.role==="assistant"?cr(r.message.content).trim()!==l:!0):e}function rN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function sN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function oN(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?ow(i,20):"Auto resumed"}function uN(e,i){if(e.some(u=>u.type==="assistantText"))return Bc(e);if(i.length===0)return e;const l=[...i],r=[];for(const u of e)u.type==="tool"&&Sh(u.tool)&&jh(l,u.tool)||r.push(u);return Bc([...r,...l])}function cN(e,i,l,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=dN(m,i,u);b.length>0&&d.add(m.id);for(const y of b)c.set(_l(y),y)}if(l)for(const m of i)fN(e,m)||c.set(_l(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(_l(m),m);const p=Iv([...c.values()].sort(Bo),l,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:pN(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:l&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:hN(m,r)})}return Bc(p)}function dN(e,i,l){if(e.entityType==="event"&&e.entityId){const r=l.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[Wp(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>kh(u)===e.entityId);return r.length>0?r:[Wp(e)]}return[]}function Wp(e){const i=pe(e.detail),l=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":we(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":l,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function fN(e,i){const l=i.id===void 0?null:String(i.id),r=kh(i);return e.some(u=>l!==null&&u.entityType==="event"&&u.entityId===l||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function kh(e){if(e.event!=="codex.notification")return null;const i=pe(e.data),l=pe(i.params),r=pe(l.item);return we(r.id)||we(l.itemId)||null}function pN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function hN(e,i){var r,u;const l=pe(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?$p(l,i).title:e.title||uw(e.subtype),body:e.subtype==="input:collaboration_notice"?$p(l,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||nw(l),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Iv(e,i,l){const r=[],u=new Map,c=new Map,d=new Map;for(const p of e){if(p.event==="server.workspace_change.decision"||p.event==="server.responsibility.decision"){yN(r,p);continue}if(p.event==="server.knowledge.decision"){xN(r,p);continue}if(Bv(p)){kN(r);continue}if(p.event==="server.steer"){const T=pe(p.data),R=typeof T.message=="string"?T.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:R||"Additional input",messageId:typeof T.messageId=="string"?T.messageId:void 0});continue}const g=H_(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=q_(p.data);if(m!=null&&m.text){const T=m.itemId?d.get(m.itemId)??m.phase:m.phase,R=m.itemId??`phase:${T}`,z=`${u.get(R)??""}${m.text}`,N=Yv(z),G=c.get(R)??"",B=N.startsWith(G)?N.slice(G.length):N;if(u.set(R,z),c.set(R,N),B){const P=r[r.length-1];(P==null?void 0:P.type)==="assistantText"&&vN(P,m.itemId,T)?(P.content+=B,P.itemId=P.itemId??m.itemId,P.streamKey=P.streamKey??R,P.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:B,phase:T,itemId:m.itemId,streamKey:R,streaming:i})}continue}const b=$_(p.data);if(b!=null&&b.text){const T=cr(b.text),R=b.itemId??`phase:${b.phase}`,z=wN(r,b.itemId,b.phase);if(z>=0){const N=r[z];N.type==="assistantText"&&(T?(N.content=T,N.phase=b.phase,N.itemId=N.itemId??b.itemId,N.streamKey=N.streamKey??R,N.streaming=!1,gN(r,z,b.itemId)):r.splice(z,1))}else T&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:T,phase:b.phase,itemId:b.itemId,streamKey:R,streaming:!1});continue}const y=p_(p,l);if(y){y.rawEvents=[p];const T=Bx(r,y);if(T>=0){qx(r[T],y);continue}if(Sh(y)&&jh(r,y)||y.kind==="command"&&y.meta==="running"&&qc(y.body))continue;r.push({id:`tool-${y.id}`,type:"tool",createdAt:y.createdAt,tool:y});continue}const k=h_(p);if(k){k.rawEvents=[p];const T=Bx(r,k);if(T>=0){qx(r[T],k);continue}r.push({id:`tool-${k.id}`,type:"tool",createdAt:k.createdAt,tool:k});continue}if(kE(p)){mN(r,p);continue}const w=m_(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return Bc(r)}function mN(e,i){const l=kh(i);if(l)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==l)){u.tool={...u.tool,rawEvents:qv(u.tool.rawEvents,[i])};return}}}function gN(e,i,l){if(l)for(let r=e.length-1;r>i;r-=1){const u=e[r];u.type==="assistantText"&&u.itemId===l&&e.splice(r,1)}}function yN(e,i){const l=pe(i.data),r=typeof l.proposalId=="string"?l.proposalId:void 0,u=typeof l.decision=="string"?l.decision:void 0,c=pe(l.payload),d=we(c.content)||(typeof l.responsibility=="string"?l.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let p=e.length-1;p>=0;p-=1){const g=e[p];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){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 xN(e,i){const l=pe(i.data),r=typeof l.proposalId=="string"?l.proposalId:void 0,u=typeof l.decision=="string"?l.decision:void 0,c=pe(l.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=e.length-1;d>=0;d-=1){const p=e[d];if(p.type==="tool"&&p.tool.kind==="knowledge"&&p.tool.knowledgeProposalId===r){p.tool={...p.tool,title:u==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:u==="accept"?"saved":"declined",body:u==="accept"&&Object.keys(c).length>0?JSON.stringify(c,null,2):p.tool.body};return}}}function jh(e,i){const l=Uv(i);if(typeof l!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Ux(d,i))continue;const p=cr(d.content);p!==d.content&&(e[c]={...d,content:p})}let r=0,u=-1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Ux(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,l>=g)continue;const m=Math.max(0,Math.min(d.content.length,l-p)),b=d.content.slice(0,m).trimEnd(),y=d.content.slice(m).trimStart(),k=[];return b&&k.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),k.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),y&&k.push({...d,id:`${d.id}:after-tool-${i.id}`,content:y,pinnedToResult:!0}),e.splice(c,1,...k),!0}if(u>=0&&l>=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 Ux(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function Bc(e){const i=[],l=[];for(const c of e){if(c.type==="tool"&&Sh(c.tool)){i.push(c.tool);continue}l.push(c)}const r=[...l],u=[];for(const c of i)jh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return bN([...u,...r])}function Sh(e){return typeof Uv(e)=="number"}function Uv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function bN(e){const i=[];for(let l=0;l<e.length;l+=1){const r=e[l],u=e[l+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),l+=1;continue}i.push(r)}return i}function vN(e,i,l){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===l}function wN(e,i,l){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===l||u.phase==="unknown"||l==="unknown"))return r}return-1}function Bv(e){return e.event==="server.stop"||e.event==="server.stopped"}function kN(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 jN(e){for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l.event!=="server.notification.failed")continue;const r=pe(l.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function SN(e){for(let i=e.length-1;i>=0;i-=1){const l=cw(e[i]);if(l)return l}return null}function Bx(e,i){for(let l=e.length-1;l>=0;l-=1){const r=e[l];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 l}return-1}function qx(e,i){if(e.type!=="tool")return;const l=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&qc(i.body)&&!qc(e.tool.body);e.tool={...e.tool,...i,id:e.tool.id,createdAt:e.tool.createdAt,title:l?e.tool.title:i.title,body:r?e.tool.body:i.body,meta:l?e.tool.meta:i.meta,output:N_(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:qv(e.tool.rawEvents,i.rawEvents)}}function qv(e,i){const l=[...e??[],...i??[]];if(l.length===0)return;const r=new Set;return l.filter(u=>{const c=_l(u);return r.has(c)?!1:(r.add(c),!0)})}function Ao(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function yp(e,i){const l=new Set,r=[...e,...i].filter(u=>l.has(u.id)?!1:(l.add(u.id),!0));return r.filter(u=>Hv(u)?!r.some(c=>CN(c,u)):!0)}function xp(e,i){const l=new Map;for(const r of[...e,...i])l.set(r.id,r);return[...l.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function bp(e,i){const l=new Map;for(const r of[...e,...i])l.set(r.id,r);return[...l.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function Hv(e){return e.id.startsWith("local-")}function CN(e,i){if(Hv(e)||e.role!==i.role||e.content.trim()!==i.content.trim())return!1;const l=Date.parse(e.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(l)||Number.isNaN(r)?!1:Math.abs(l-r)<=12e4}function Cc(e,i){const l=new Map,r=new Map;for(const c of[...e,...i]){const d=_l(c);r.has(d)||r.set(d,r.size),l.set(d,c)}return[...l.values()].sort((c,d)=>{const p=$v(c,d);return p!==0?p:(r.get(_l(c))??0)-(r.get(_l(d))??0)})}function vp(e,i){const l=_l(i),r=e.findIndex(c=>_l(c)===l);if(r<0)return[...e,i];if(TN(e[r],i))return e;const u=[...e];return u[r]=i,u}function TN(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 _l(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Bo(e,i){const l=$v(e,i);return l!==0?l:EN(e.id,i.id)}function $v(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 l=Date.parse(e.createdAt??""),r=Date.parse(i.createdAt??"");return!Number.isNaN(l)&&!Number.isNaN(r)&&l!==r?l-r:Number.isNaN(l)!==Number.isNaN(r)?Number.isNaN(l)?1:-1:0}function EN(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 wp(e,i){const l=pe(e.data);return typeof l.__seq=="number"&&typeof l.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(l,"payload")?{id:typeof l.__eventId=="string"?l.__eventId:`stream:${l.__turnId??"unknown"}:${l.__seq}`,turnId:typeof l.__turnId=="string"?l.__turnId:null,seq:l.__seq,event:e.event,data:l.payload,createdAt:l.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const Mo=D.memo(function({content:i,conversation:l,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?Yv(i):cr(i),g=l&&!r?zN(p,l):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(_N,{content:p,conversation:l}):ja(p,l),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(ON,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},AN);function AN(e,i){var l,r,u,c;return e.content===i.content&&e.streaming===i.streaming&&e.copiedArtifactUrl===i.copiedArtifactUrl&&((l=e.conversation)==null?void 0:l.id)===((r=i.conversation)==null?void 0:r.id)&&((u=e.conversation)==null?void 0:u.workspacePath)===((c=i.conversation)==null?void 0:c.workspacePath)}function Hx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const NN=2;function _N({content:e,conversation:i}){const l=D.useRef(null),[r,u]=D.useState(null),{committedBlocks:c,activeBlock:d}=DN(e);return D.useLayoutEffect(()=>{const p=l.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const y=g*NN,k=Math.min(m,y);return b!==null&&k<=b?b:k})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:l,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(D.Fragment,{children:ja(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function DN(e){const i=MN(e),l=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:RN(l),activeBlock:r}}function RN(e){const i=[];let l=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(Tc(i,e.slice(l,d)),l=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&(Tc(i,e.slice(l,m)),l=m,u=!1),g===""&&(Tc(i,e.slice(l,d)),l=d)}return l<e.length&&Tc(i,e.slice(l)),i}function Tc(e,i){i.trim()&&e.push(i)}function MN(e){const i=e.lastIndexOf(`
107
107
  `);if(i<0)return 0;const l=[0];for(let u=0;u<e.length;u+=1)e[u]===`
108
108
  `&&u+1<e.length&&l.push(u+1);let r=-1;for(const u of l){const c=e.indexOf(`
109
- `,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 DN({artifact:e,onPreview:i,onCopyUrl:l,copied:r}){return e?s.jsxs("figure",{className:"artifact-preview",children:[s.jsx("button",{className:"artifact-preview-media",onClick:()=>i(e),type:"button",children:s.jsx("img",{alt:e.name,src:e.url})}),s.jsxs("figcaption",{children:[s.jsx("span",{children:e.name}),s.jsxs("div",{className:"artifact-preview-actions",children:[s.jsx("button",{onClick:()=>i(e),type:"button",children:"Preview"}),s.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),s.jsx("button",{onClick:()=>l(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function MN(e,i){const l=new Map;for(const r of RN(e)){const u=qv(r);if(u){const c=Hv(u).toLowerCase(),d=l.get(c);(!d||LN(u,d))&&l.set(c,u)}}return Array.from(l.values()).map(r=>ON(r,i)).filter(r=>r!==null)}function RN(e){const i=[],l=/!\[[^\]]*]\(([^)]+)\)/g,r=/\[[^\]]+]\(([^)]+)\)/g,u=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const c of[l,r,u]){let d;for(;(d=c.exec(e))!==null;)i.push(d[1])}return i}function ON(e,i){const l=qv(e);if(!l||!zN(l))return null;const r=$v(l,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:Hv(r),url:pe(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function qv(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function zN(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function Hv(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function $v(e,i){const l=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/").replace(/\/+$/,"");return l===r||!l.startsWith(`${r}/`)?l:l.slice(r.length+1)}function LN(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function cr(e){return e.trim()}function Gv(e){return e.trim()}function kp(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function IN(e){return{a({children:i,href:l}){if(!l)return s.jsx(s.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(l),u=!r&&e?UN(l,e):null,c=u??l,d=r||!!u;return s.jsx("a",{className:"markdown-link",href:c,rel:d?"noreferrer":void 0,target:d?"_blank":void 0,children:i})},img(){return null},pre({children:i}){const l=HN(i);return l?Sh(l.language)==="mermaid"?s.jsx($N,{code:l.code}):s.jsx(YN,{code:l.code,language:l.language}):s.jsx("pre",{children:i})},table({children:i}){return s.jsx("div",{className:"markdown-table-wrap",children:s.jsx("table",{className:"markdown-table",children:i})})},td({align:i,children:l}){return s.jsx("td",{style:qx(i),children:l})},th({align:i,children:l}){return s.jsx("th",{style:qx(i),children:l})}}}function UN(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const[l]=e.split("#",1),[r]=l.split("?",1),u=BN(r);if(!u)return null;const c=$v(u,i.workspacePath);return pe(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function BN(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function qx(e){return e&&e!=="char"?{textAlign:e}:void 0}function Sa(e,i){const l=qN(e);return s.jsx(Q1,{components:IN(i),remarkPlugins:[cE],skipHtml:!0,children:l})}function qN(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
110
- $2`)}function HN(e){var c;const i=D.Children.toArray(e),l=i.length===1&&D.isValidElement(i[0])?i[0]:null;if(!l||l.type!=="code")return null;const u=((c=(l.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:c[1])??"";return{code:Kp(l.props.children).replace(/\n$/,""),language:u}}function Kp(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(Kp).join(""):D.isValidElement(e)?Kp(e.props.children):""}const Vv="github-light",Sp=new Map,jp=new Map;let Cp=null,Tp=null;const Yv=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Sh(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 Pv(e){const i=Sh(e);return!i||i==="text"||i==="txt"?"text":Yv.has(i)?i:"text"}function $N({code:e}){const l=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=D.useState(!1),[c,d]=D.useState(()=>jp.get(e)??null),[p,g]=D.useState(null);D.useEffect(()=>{let b=!1,x;const k=jp.get(e);return k?(d(k),g(null),()=>{b=!0}):(g(null),d(null),GN(l,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),jp.set(e,w),d(w),g(null))},w=>{if(!b){const E=w instanceof Error?w.message:String(w);x=window.setTimeout(()=>{b||g(E)},IE)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[e,l]);async function m(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${p?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:s.jsx(jh,{})})}),c?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):p?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:p}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function GN(e,i){return(await(await VN()).render(e,i)).svg}function VN(){return Tp||(Tp=kt(()=>import("./mermaid.core-Cfkt_OK7.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})),Tp}function YN({code:e,language:i,reserveHeight:l=!1}){const[r,u]=D.useState(!1),[c,d]=D.useState(()=>{if(!Gx(i))return null;const m=$x(e,i);return Sp.get(m)??null}),p=l?{"--code-block-min-height":`${KE(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!Gx(i))return d(null),()=>{m=!0};const b=$x(e,i),x=Sp.get(b);return x?(d(x),()=>{m=!0}):(d(null),JN(e,i).then(k=>{Sp.set(b,k),m||d(k)}).catch(k=>{console.warn("Failed to highlight code block",k),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:"code-block",style:p,children:[i?s.jsx("span",{className:"code-block-kind",children:i}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:s.jsx(jh,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function jh(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function PN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[s.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Fv(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),s.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),s.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function FN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function WN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function Hx(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function KN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Dc(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[s.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function Wc(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function XN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function QN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function ZN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function $x(e,i){return`${Vv}:${Pv(i)}:${e}`}function Gx(e){const i=Sh(e);return!!i&&Yv.has(i)}async function JN(e,i){return(await e2()).codeToHtml(e,{lang:Pv(i),theme:Vv})}function e2(){return Cp||(Cp=t2()),Cp}async function t2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:l},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:x},{default:k},{default:w},{default:E},{default:O},{default:U},{default:_},{default:F},{default:q},{default:Y},{default:se}]=await Promise.all([kt(()=>import("./core-DZprx5_4.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(N=>N.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(N=>N.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:[l],langs:[r,u,c,d,p,g,m,b,x,k,w,E,O,U,_,F,q,Y,se]})}async function Vx(){const e=pe("conversations"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).conversations}async function n2(){const e=pe("workspace-states"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).workspaces}async function Yx(){const e=pe("collaboration/topics"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).topics}async function Ec(e){const i=pe(`collaboration/topics/${e}/messages?limit=100`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).messages}async function i2(e){const i=pe("collaboration/topics"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await ke(l,{method:"POST",url:i}),(await l.json()).topic}async function l2(e,i){const l=pe(`collaboration/topics/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PATCH",url:l}),(await r.json()).topic}async function a2(e,i){const l=pe(`collaboration/topics/${e}/archive`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await ke(r,{method:"POST",url:l}),(await r.json()).topic}async function r2(e){const i=pe(`conversations/${e}/read`),l=await fetch(i,{method:"POST"});await ke(l,{method:"POST",url:i})}async function Px(){const e=pe("workspace-groups"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).groups}async function s2(e){const i=pe("workspace-groups"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await ke(l,{method:"POST",url:i}),(await l.json()).group}async function o2(e,i){const l=pe(`workspace-groups/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PATCH",url:l}),(await r.json()).group}async function u2(e){const i=pe(`workspace-groups/${e}`),l=await fetch(i,{method:"DELETE"});return await ke(l,{method:"DELETE",url:i}),await l.json()}async function c2(){const e=pe("settings/environment"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).variables}async function d2(e){const i=pe(`conversations/${e}/settings/environment`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).variables}async function f2(e){const i=pe(`conversations/${e}/knowledge`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).items}async function p2(){const e=pe("settings/runtime"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).settings}async function h2(){const e=pe("diagnostics"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function m2(){const e=pe("settings/runtime/codex"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function Fx(){const e=pe("settings/runtime/accounts"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function Wx(e=!1){const i=pe(`settings/runtime/accounts/refresh${e?"?force=1":""}`),l=await fetch(i,{method:"POST"});return await ke(l,{method:"POST",url:i}),await l.json()}async function g2(e){const i=pe("settings/runtime/accounts"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return await ke(l,{method:"POST",url:i}),(await l.json()).login}async function y2(e){const i=pe(`settings/runtime/accounts/login/${e}`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).login}async function x2(e){const i=pe(`settings/runtime/accounts/login/${e}/cancel`),l=await fetch(i,{method:"POST"});return await ke(l,{method:"POST",url:i}),(await l.json()).login}async function b2(e,i){const l=pe(`settings/runtime/accounts/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return await ke(r,{method:"PATCH",url:l}),(await r.json()).account}async function v2(e){const i=pe(`settings/runtime/accounts/${e}`),l=await fetch(i,{method:"DELETE"});await ke(l,{method:"DELETE",url:i})}async function w2(e){const i=pe(`settings/runtime/accounts/${e}/switch`),l=await fetch(i,{method:"POST"});return await ke(l,{method:"POST",url:i}),await l.json()}async function k2(e=!0){const i=pe(`settings/runtime/models?refresh=${e?"1":"0"}`),l=await fetch(i);return await ke(l,{url:i}),await l.json()}async function S2(e=!1){const i=pe(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),l=await fetch(i);return await ke(l,{url:i}),await l.json()}async function j2(){const e=pe("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await ke(i,{method:"POST",url:e}),(await i.json()).job}async function C2(e){const i=pe(`conversations/${e}/settings/runtime`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).settings}async function T2(){const e=pe("settings/memory"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}function Wv(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid Seele global settings file.");const i=e;if(i.format!=="seele-global-settings"||i.version!==1)throw new Error("Unsupported Seele global settings file or version.");if(typeof i.exportedAt!="string")throw new Error("The settings file is missing its export timestamp.");if(i.runtime!==void 0&&(!i.runtime||typeof i.runtime!="object"||Array.isArray(i.runtime)))throw new Error("The Runtime section is invalid.");if(i.environment!==void 0&&!Array.isArray(i.environment))throw new Error("The Environment section is invalid.");if(i.memory!==void 0&&!Array.isArray(i.memory))throw new Error("The Memory section is invalid.");return e}async function E2(e){const i=pe("settings/global-transfer/export"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime:e.has("runtime"),environment:e.has("environment"),memory:e.has("memory")})});return await ke(l,{method:"POST",url:i}),Wv(await l.json())}async function A2(e){const i=pe("settings/global-transfer/import"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});await ke(l,{method:"PUT",url:i})}function N2(e){const i=e.exportedAt.slice(0,10)||"export",l=new Blob([`${JSON.stringify(e,null,2)}
111
- `],{type:"application/json"}),r=URL.createObjectURL(l),u=document.createElement("a");u.href=r,u.download=`seele-global-settings-${i}.json`,document.body.append(u),u.click(),u.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),0)}async function _2(e){const i=pe("settings/runtime"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await ke(l,{method:"PUT",url:i}),(await l.json()).settings}async function Kx(e,i){const l=pe(`conversations/${e}/settings/runtime`),r=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PUT",url:l}),await r.json()}async function Xx(e,i){const l=pe(`conversations/${e}/runtime/reset`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await ke(r,{method:"POST",url:l});const u=(await r.json()).job;return Xv(e,u)}async function Kv(e){const i=pe(`conversations/${e}/runtime/reset`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).job}async function Xv(e,i){let l=i;const r=Date.now()+1800*1e3;for(;l.status==="running";){if(Date.now()>=r)throw new Error("Full-history reset is still running after 30 minutes. Reopen Console to check the workspace before retrying.");await new Promise(c=>window.setTimeout(c,1e3));const u=await Kv(e);if(!u||u.id!==l.id)throw new Error("The runtime reset job is no longer available.");l=u}if(l.status==="failed"||!l.result)throw new Error(l.error??"Full-history reset failed.");return l.result}async function Qx(e){const i=pe(`conversations/${e}/runtime/reset-preview`),l=await fetch(i);return await ke(l,{url:i}),await l.json()}async function D2(e,i){const l=pe(`conversations/${e}/runtime/reset-selection`),r=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await ke(r,{method:"PUT",url:l})}async function M2(e){const i=pe(`conversations/${e}/runtime/thread-read`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).result}async function R2(e){const i=pe(`conversations/${e}/runtime/token-usage`),l=await fetch(i);await ke(l,{url:i});const r=await l.json();return r.event?ow(r.event):null}async function O2(e){const i=pe(`conversations/${e}/runtime/additional-context`),l=await fetch(i);return await ke(l,{url:i}),await l.json()}async function z2(e){const i=pe(`conversations/${e}/runtime/compactions`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).compactions}function L2(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 I2(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:B2(e.sourceCluesText),requiredEnv:q2(e.requiredEnvText)}}function U2(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(`
109
+ `,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 ON({artifact:e,onPreview:i,onCopyUrl:l,copied:r}){return e?s.jsxs("figure",{className:"artifact-preview",children:[s.jsx("button",{className:"artifact-preview-media",onClick:()=>i(e),type:"button",children:s.jsx("img",{alt:e.name,src:e.url})}),s.jsxs("figcaption",{children:[s.jsx("span",{children:e.name}),s.jsxs("div",{className:"artifact-preview-actions",children:[s.jsx("button",{onClick:()=>i(e),type:"button",children:"Preview"}),s.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),s.jsx("button",{onClick:()=>l(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function zN(e,i){const l=new Map;for(const r of LN(e)){const u=Gv(r);if(u){const c=Vv(u).toLowerCase(),d=l.get(c);(!d||BN(u,d))&&l.set(c,u)}}return Array.from(l.values()).map(r=>IN(r,i)).filter(r=>r!==null)}function LN(e){const i=[],l=/!\[[^\]]*]\(([^)]+)\)/g,r=/\[[^\]]+]\(([^)]+)\)/g,u=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const c of[l,r,u]){let d;for(;(d=c.exec(e))!==null;)i.push(d[1])}return i}function IN(e,i){const l=Gv(e);if(!l||!UN(l))return null;const r=Pv(l,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:Vv(r),url:fe(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function Gv(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function UN(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function Vv(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function Pv(e,i){const l=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/").replace(/\/+$/,"");return l===r||!l.startsWith(`${r}/`)?l:l.slice(r.length+1)}function BN(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function cr(e){return e.trim()}function Yv(e){return e.trim()}function kp(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function qN(e){return{a({children:i,href:l}){if(!l)return s.jsx(s.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(l),u=!r&&e?HN(l,e):null,c=u??l,d=r||!!u;return s.jsx("a",{className:"markdown-link",href:c,rel:d?"noreferrer":void 0,target:d?"_blank":void 0,children:i})},img(){return null},pre({children:i}){const l=VN(i);return l?Ch(l.language)==="mermaid"?s.jsx(PN,{code:l.code}):s.jsx(WN,{code:l.code,language:l.language}):s.jsx("pre",{children:i})},table({children:i}){return s.jsx("div",{className:"markdown-table-wrap",children:s.jsx("table",{className:"markdown-table",children:i})})},td({align:i,children:l}){return s.jsx("td",{style:$x(i),children:l})},th({align:i,children:l}){return s.jsx("th",{style:$x(i),children:l})}}}function HN(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const[l]=e.split("#",1),[r]=l.split("?",1),u=$N(r);if(!u)return null;const c=Pv(u,i.workspacePath);return fe(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function $N(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function $x(e){return e&&e!=="char"?{textAlign:e}:void 0}function ja(e,i){const l=GN(e);return s.jsx(eC,{components:qN(i),remarkPlugins:[pE],skipHtml:!0,children:l})}function GN(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
110
+ $2`)}function VN(e){var c;const i=D.Children.toArray(e),l=i.length===1&&D.isValidElement(i[0])?i[0]:null;if(!l||l.type!=="code")return null;const u=((c=(l.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:c[1])??"";return{code:Kp(l.props.children).replace(/\n$/,""),language:u}}function Kp(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(Kp).join(""):D.isValidElement(e)?Kp(e.props.children):""}const Fv="github-light",jp=new Map,Sp=new Map;let Cp=null,Tp=null;const Wv=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Ch(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 Kv(e){const i=Ch(e);return!i||i==="text"||i==="txt"?"text":Wv.has(i)?i:"text"}function PN({code:e}){const l=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=D.useState(!1),[c,d]=D.useState(()=>Sp.get(e)??null),[p,g]=D.useState(null);D.useEffect(()=>{let b=!1,y;const k=Sp.get(e);return k?(d(k),g(null),()=>{b=!0}):(g(null),d(null),YN(l,e).then(w=>{b||(y!==void 0&&window.clearTimeout(y),Sp.set(e,w),d(w),g(null))},w=>{if(!b){const T=w instanceof Error?w.message:String(w);y=window.setTimeout(()=>{b||g(T)},qE)}}),()=>{b=!0,y!==void 0&&window.clearTimeout(y)})},[e,l]);async function m(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${p?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Th,{})})}),c?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):p?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:p}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function YN(e,i){return(await(await FN()).render(e,i)).svg}function FN(){return Tp||(Tp=kt(()=>import("./mermaid.core-D4jIbQQz.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})),Tp}function WN({code:e,language:i,reserveHeight:l=!1}){const[r,u]=D.useState(!1),[c,d]=D.useState(()=>{if(!Px(i))return null;const m=Vx(e,i);return jp.get(m)??null}),p=l?{"--code-block-min-height":`${ZE(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!Px(i))return d(null),()=>{m=!0};const b=Vx(e,i),y=jp.get(b);return y?(d(y),()=>{m=!0}):(d(null),n2(e,i).then(k=>{jp.set(b,k),m||d(k)}).catch(k=>{console.warn("Failed to highlight code block",k),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:"code-block",style:p,children:[i?s.jsx("span",{className:"code-block-kind",children:i}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Th,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Th(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function KN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[s.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Xv(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),s.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),s.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function XN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function QN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function Gx(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function ZN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Dc(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[s.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function Wc(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function JN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function e2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function t2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Vx(e,i){return`${Fv}:${Kv(i)}:${e}`}function Px(e){const i=Ch(e);return!!i&&Wv.has(i)}async function n2(e,i){return(await i2()).codeToHtml(e,{lang:Kv(i),theme:Fv})}function i2(){return Cp||(Cp=l2()),Cp}async function l2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:l},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:y},{default:k},{default:w},{default:T},{default:R},{default:z},{default:N},{default:G},{default:B},{default:P},{default:se}]=await Promise.all([kt(()=>import("./core-CFlkiNAr.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:[l],langs:[r,u,c,d,p,g,m,b,y,k,w,T,R,z,N,G,B,P,se]})}async function Yx(){const e=fe("conversations"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).conversations}async function a2(){const e=fe("workspace-states"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).workspaces}async function Fx(){const e=fe("collaboration/topics"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).topics}async function Ec(e){const i=fe(`collaboration/topics/${e}/messages?limit=100`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).messages}async function r2(e){const i=fe("collaboration/topics"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await ke(l,{method:"POST",url:i}),(await l.json()).topic}async function s2(e,i){const l=fe(`collaboration/topics/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PATCH",url:l}),(await r.json()).topic}async function o2(e,i){const l=fe(`collaboration/topics/${e}/archive`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await ke(r,{method:"POST",url:l}),(await r.json()).topic}async function u2(e){const i=fe(`conversations/${e}/read`),l=await fetch(i,{method:"POST"});await ke(l,{method:"POST",url:i})}async function Wx(){const e=fe("workspace-groups"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).groups}async function c2(e){const i=fe("workspace-groups"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await ke(l,{method:"POST",url:i}),(await l.json()).group}async function d2(e,i){const l=fe(`workspace-groups/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PATCH",url:l}),(await r.json()).group}async function f2(e){const i=fe(`workspace-groups/${e}`),l=await fetch(i,{method:"DELETE"});return await ke(l,{method:"DELETE",url:i}),await l.json()}async function p2(){const e=fe("settings/environment"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).variables}async function h2(e){const i=fe(`conversations/${e}/settings/environment`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).variables}async function m2(e){const i=fe(`conversations/${e}/knowledge`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).items}async function g2(){const e=fe("settings/runtime"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).settings}async function y2(){const e=fe("diagnostics"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function x2(){const e=fe("settings/runtime/codex"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function Kx(){const e=fe("settings/runtime/accounts"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function Xx(e=!1){const i=fe(`settings/runtime/accounts/refresh${e?"?force=1":""}`),l=await fetch(i,{method:"POST"});return await ke(l,{method:"POST",url:i}),await l.json()}async function b2(e){const i=fe("settings/runtime/accounts"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return await ke(l,{method:"POST",url:i}),(await l.json()).login}async function v2(e){const i=fe(`settings/runtime/accounts/login/${e}`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).login}async function w2(e){const i=fe(`settings/runtime/accounts/login/${e}/cancel`),l=await fetch(i,{method:"POST"});return await ke(l,{method:"POST",url:i}),(await l.json()).login}async function k2(e,i){const l=fe(`settings/runtime/accounts/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return await ke(r,{method:"PATCH",url:l}),(await r.json()).account}async function j2(e){const i=fe(`settings/runtime/accounts/${e}`),l=await fetch(i,{method:"DELETE"});await ke(l,{method:"DELETE",url:i})}async function S2(e){const i=fe(`settings/runtime/accounts/${e}/switch`),l=await fetch(i,{method:"POST"});return await ke(l,{method:"POST",url:i}),await l.json()}async function C2(e=!0){const i=fe(`settings/runtime/models?refresh=${e?"1":"0"}`),l=await fetch(i);return await ke(l,{url:i}),await l.json()}async function T2(e=!1){const i=fe(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),l=await fetch(i);return await ke(l,{url:i}),await l.json()}async function E2(){const e=fe("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await ke(i,{method:"POST",url:e}),(await i.json()).job}async function A2(e){const i=fe(`conversations/${e}/settings/runtime`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).settings}async function N2(){const e=fe("settings/memory"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}function Qv(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid Seele global settings file.");const i=e;if(i.format!=="seele-global-settings"||i.version!==1)throw new Error("Unsupported Seele global settings file or version.");if(typeof i.exportedAt!="string")throw new Error("The settings file is missing its export timestamp.");if(i.runtime!==void 0&&(!i.runtime||typeof i.runtime!="object"||Array.isArray(i.runtime)))throw new Error("The Runtime section is invalid.");if(i.environment!==void 0&&!Array.isArray(i.environment))throw new Error("The Environment section is invalid.");if(i.memory!==void 0&&!Array.isArray(i.memory))throw new Error("The Memory section is invalid.");return e}async function _2(e){const i=fe("settings/global-transfer/export"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime:e.has("runtime"),environment:e.has("environment"),memory:e.has("memory")})});return await ke(l,{method:"POST",url:i}),Qv(await l.json())}async function D2(e){const i=fe("settings/global-transfer/import"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});await ke(l,{method:"PUT",url:i})}function R2(e){const i=e.exportedAt.slice(0,10)||"export",l=new Blob([`${JSON.stringify(e,null,2)}
111
+ `],{type:"application/json"}),r=URL.createObjectURL(l),u=document.createElement("a");u.href=r,u.download=`seele-global-settings-${i}.json`,document.body.append(u),u.click(),u.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),0)}async function M2(e){const i=fe("settings/runtime"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await ke(l,{method:"PUT",url:i}),(await l.json()).settings}async function Qx(e,i){const l=fe(`conversations/${e}/settings/runtime`),r=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PUT",url:l}),await r.json()}async function Zx(e,i){const l=fe(`conversations/${e}/runtime/reset`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await ke(r,{method:"POST",url:l});const u=(await r.json()).job;return Jv(e,u)}async function Zv(e){const i=fe(`conversations/${e}/runtime/reset`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).job}async function Jv(e,i){let l=i;const r=Date.now()+1800*1e3;for(;l.status==="running";){if(Date.now()>=r)throw new Error("Full-history reset is still running after 30 minutes. Reopen Console to check the workspace before retrying.");await new Promise(c=>window.setTimeout(c,1e3));const u=await Zv(e);if(!u||u.id!==l.id)throw new Error("The runtime reset job is no longer available.");l=u}if(l.status==="failed"||!l.result)throw new Error(l.error??"Full-history reset failed.");return l.result}async function Jx(e){const i=fe(`conversations/${e}/runtime/reset-preview`),l=await fetch(i);return await ke(l,{url:i}),await l.json()}async function O2(e,i){const l=fe(`conversations/${e}/runtime/reset-selection`),r=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await ke(r,{method:"PUT",url:l})}async function z2(e){const i=fe(`conversations/${e}/runtime/thread-read`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).result}async function L2(e){const i=fe(`conversations/${e}/runtime/token-usage`),l=await fetch(i);await ke(l,{url:i});const r=await l.json();return r.event?dw(r.event):null}async function I2(e){const i=fe(`conversations/${e}/runtime/additional-context`),l=await fetch(i);return await ke(l,{url:i}),await l.json()}async function U2(e){const i=fe(`conversations/${e}/runtime/compactions`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).compactions}function B2(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 q2(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:$2(e.sourceCluesText),requiredEnv:G2(e.requiredEnvText)}}function H2(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(`
112
112
  `),requiredEnvText:e.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
113
- `)}}function B2(e){const i=new Date().toISOString();return e.split(/\r?\n/).map(l=>l.trim()).filter(Boolean).map(l=>{const r=l.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:r?r[1].toLowerCase():"text",value:r?r[2].trim():l,providedBy:"user",providedAt:i}})}function q2(e){return e.split(/\r?\n/).map(i=>i.trim()).filter(Boolean).map(i=>{const[l,...r]=i.split(/\s+-\s+/);return{key:l.trim().toUpperCase(),description:r.join(" - ").trim()}}).filter(i=>/^[A-Z_][A-Z0-9_]*$/.test(i.key))}function Zx(e,i){const l=Jx(i.attention)-Jx(e.attention);return l!==0?l:i.updatedAt.localeCompare(e.updatedAt)}function Jx(e){return e==="watch"?2:e==="tracked"?1:0}function qo(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function H2(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 $2(e){return qo(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
114
- `)}async function G2(e){const i=pe("settings/memory"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await ke(l,{method:"PUT",url:i}),await l.json()}async function V2(e,i,l){const r=pe("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:l,key:e,value:i})});return await ke(u,{method:"PUT",url:r}),(await u.json()).variable}async function Y2(e,i,l,r){const u=pe(`conversations/${e}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:l})});return await ke(c,{method:"PUT",url:u}),await c.json()}async function P2(e){const i=pe(`settings/environment/${encodeURIComponent(e)}/reveal`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).variable.value}async function F2(e,i){const l=pe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(l);return await ke(r,{url:l}),(await r.json()).variable.value}async function W2(e){const i=pe(`settings/environment/${encodeURIComponent(e)}`),l=await fetch(i,{method:"DELETE"});await ke(l,{method:"DELETE",url:i})}async function K2(e,i){const l=pe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(l,{method:"DELETE"});return await ke(r,{method:"DELETE",url:l}),(await r.json()).conversation}async function X2(e,i){const l=pe(`conversations/${e}/knowledge`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"POST",url:l}),(await r.json()).item}async function Q2(e,i,l){const r=pe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return await ke(u,{method:"PATCH",url:r}),(await u.json()).item}async function Z2(e,i){const l=pe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(l,{method:"DELETE"});await ke(r,{method:"DELETE",url:l})}async function J2(){const e=pe("meta"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function e_(e){const i=pe(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).usage??null}async function t_(e,i){const l=pe("conversations"),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await ke(r,{method:"POST",url:l}),(await r.json()).conversation}async function n_(e){const i=pe(`conversations/${e}/complex-task`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).task}async function i_(e,i){const l=pe(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(l);return await ke(r,{url:l}),(await r.json()).task}async function l_(e,i){const l=pe(`conversations/${e}/complex-task/${i}`),r=await fetch(l,{method:"POST"});return await ke(r,{method:"POST",url:l}),(await r.json()).task}async function a_(e,i,l){const r=pe(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:l})});return await ke(u,{method:"POST",url:r}),await u.json()}async function r_(e){const i=pe(`conversations/${e}/clone/retry`),l=await fetch(i,{method:"POST"});return await ke(l,{method:"POST",url:i}),await l.json()}async function Ep(e,i={}){const l=new URLSearchParams;l.set("limit",String(i.limit??xv)),i.before&&l.set("before",i.before);const r=pe(`conversations/${e}?${l}`),u=await fetch(r);return await ke(u,{url:r}),(await u.json()).conversation}async function s_(e,i){const l=pe(`conversations/${e}/turns/${i}/history-events`),r=await fetch(l);return await ke(r,{url:l}),(await r.json()).events}async function Ac(e,i){const l=pe(`conversations/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PATCH",url:l}),(await r.json()).conversation}async function o_(e){const i=pe(`conversations/${e}`),l=await fetch(i,{method:"DELETE"});await ke(l,{method:"DELETE",url:i})}function u_(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function Qv(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function c_(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:D_(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=fe(e.data),d=we(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const g=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=we(c.audience),x=we(c.recipientWorkspaceId),k=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(U=>typeof U=="string"):Array.isArray(c.recipients)?c.recipients.filter(U=>typeof U=="string"):[],w=k.filter(U=>U!=="ALL").map(U=>i.get(U)).filter(U=>!!U);let E="Topic";w.length>0?E=Qv(w):k.length===1?E=k[0]==="ALL"?"Topic participants":Ca(k[0]):k.length>1?E=`${k.length} workspaces`:b==="public"||b==="all"?E="Topic participants":b==="owner"&&(E="Topic owner");const O=we(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${E}`,body:O?`Topic ${Ca(O)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":m?"done":"failed",output:g||m?we(c.contentMarkdown)||void 0:we(c.reason)||void 0,topicAction:"send",topicRecipientLabel:E,topicMessageContent:(g||m)&&we(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=fe(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=fe(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=fe(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",k=Array.isArray(b.options)?b.options.map(w=>{const E=fe(w);return typeof E.label=="string"?`- ${E.label}${typeof E.description=="string"?`: ${E.description}`:""}`:""}).filter(Boolean).join(`
115
- `):"";return k?`${x}
113
+ `)}}function $2(e){const i=new Date().toISOString();return e.split(/\r?\n/).map(l=>l.trim()).filter(Boolean).map(l=>{const r=l.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:r?r[1].toLowerCase():"text",value:r?r[2].trim():l,providedBy:"user",providedAt:i}})}function G2(e){return e.split(/\r?\n/).map(i=>i.trim()).filter(Boolean).map(i=>{const[l,...r]=i.split(/\s+-\s+/);return{key:l.trim().toUpperCase(),description:r.join(" - ").trim()}}).filter(i=>/^[A-Z_][A-Z0-9_]*$/.test(i.key))}function eb(e,i){const l=tb(i.attention)-tb(e.attention);return l!==0?l:i.updatedAt.localeCompare(e.updatedAt)}function tb(e){return e==="watch"?2:e==="tracked"?1:0}function qo(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function V2(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 P2(e){return qo(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
114
+ `)}async function Y2(e){const i=fe("settings/memory"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await ke(l,{method:"PUT",url:i}),await l.json()}async function F2(e,i,l){const r=fe("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:l,key:e,value:i})});return await ke(u,{method:"PUT",url:r}),(await u.json()).variable}async function W2(e,i,l,r){const u=fe(`conversations/${e}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:l})});return await ke(c,{method:"PUT",url:u}),await c.json()}async function K2(e){const i=fe(`settings/environment/${encodeURIComponent(e)}/reveal`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).variable.value}async function X2(e,i){const l=fe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(l);return await ke(r,{url:l}),(await r.json()).variable.value}async function Q2(e){const i=fe(`settings/environment/${encodeURIComponent(e)}`),l=await fetch(i,{method:"DELETE"});await ke(l,{method:"DELETE",url:i})}async function Z2(e,i){const l=fe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(l,{method:"DELETE"});return await ke(r,{method:"DELETE",url:l}),(await r.json()).conversation}async function J2(e,i){const l=fe(`conversations/${e}/knowledge`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"POST",url:l}),(await r.json()).item}async function e_(e,i,l){const r=fe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return await ke(u,{method:"PATCH",url:r}),(await u.json()).item}async function t_(e,i){const l=fe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(l,{method:"DELETE"});await ke(r,{method:"DELETE",url:l})}async function n_(){const e=fe("meta"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function i_(e){const i=fe(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).usage??null}async function l_(e,i){const l=fe("conversations"),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await ke(r,{method:"POST",url:l}),(await r.json()).conversation}async function a_(e){const i=fe(`conversations/${e}/complex-task`),l=await fetch(i);return await ke(l,{url:i}),(await l.json()).task}async function r_(e,i){const l=fe(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(l);return await ke(r,{url:l}),(await r.json()).task}async function s_(e,i){const l=fe(`conversations/${e}/complex-task/${i}`),r=await fetch(l,{method:"POST"});return await ke(r,{method:"POST",url:l}),(await r.json()).task}async function o_(e,i,l){const r=fe(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:l})});return await ke(u,{method:"POST",url:r}),await u.json()}async function u_(e){const i=fe(`conversations/${e}/clone/retry`),l=await fetch(i,{method:"POST"});return await ke(l,{method:"POST",url:i}),await l.json()}async function Ep(e,i={}){const l=new URLSearchParams;l.set("limit",String(i.limit??vv)),i.before&&l.set("before",i.before);const r=fe(`conversations/${e}?${l}`),u=await fetch(r);return await ke(u,{url:r}),(await u.json()).conversation}async function c_(e,i){const l=fe(`conversations/${e}/turns/${i}/history-events`),r=await fetch(l);return await ke(r,{url:l}),(await r.json()).events}async function Ac(e,i){const l=fe(`conversations/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PATCH",url:l}),(await r.json()).conversation}async function d_(e){const i=fe(`conversations/${e}`),l=await fetch(i,{method:"DELETE"});await ke(l,{method:"DELETE",url:i})}function f_(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function ew(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function p_(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:O_(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=pe(e.data),d=we(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const g=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=we(c.audience),y=we(c.recipientWorkspaceId),k=y?[y]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(z=>typeof z=="string"):Array.isArray(c.recipients)?c.recipients.filter(z=>typeof z=="string"):[],w=k.filter(z=>z!=="ALL").map(z=>i.get(z)).filter(z=>!!z);let T="Topic";w.length>0?T=ew(w):k.length===1?T=k[0]==="ALL"?"Topic participants":Ca(k[0]):k.length>1?T=`${k.length} workspaces`:b==="public"||b==="all"?T="Topic participants":b==="owner"&&(T="Topic owner");const R=we(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${T}`,body:R?`Topic ${Ca(R)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":m?"done":"failed",output:g||m?we(c.contentMarkdown)||void 0:we(c.reason)||void 0,topicAction:"send",topicRecipientLabel:T,topicMessageContent:(g||m)&&we(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=pe(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=pe(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=pe(m),y=typeof b.question=="string"?b.question:"Please provide the missing information.",k=Array.isArray(b.options)?b.options.map(w=>{const T=pe(w);return typeof T.label=="string"?`- ${T.label}${typeof T.description=="string"?`: ${T.description}`:""}`:""}).filter(Boolean).join(`
115
+ `):"";return k?`${y}
116
116
 
117
- ${k}`:x}).join(`
117
+ ${k}`:y}).join(`
118
118
 
119
- `);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=fe(e.data);if(we(c.actionType)==="seele_workspace_change"){const p=fe(c.payload),g=fe(p.payload),m=we(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:iw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=kE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=wE(e.data);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),meta:c.meta}}if(e.event==="codex.dynamic_tool_request"){const c=fe(e.data),d=fe(c.params),p=we(d.tool)||"dynamic tool",g=fe(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:tw(p,!1,g),body:nw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:we(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?Zv(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&we(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?fe(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=fe(e.data),d=fe(c.payload),p=we(d.content)||we(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:we(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:we(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=fe(e.data),d=fe(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=fe(e.data),d=fe(c.task),p=fe(d.currentPlan),g=fe(c.update),m=we(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",x=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${x} change${x===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:we(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=fe(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:we(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=fe(e.data),d=e.event==="runtime.command.completed",p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:d?p!==null&&p!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?Mc(c.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?p!==null?`exit ${p}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const c=fe(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:Xp(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=fe(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=__(c.requestId),p=fe(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const l=fe(e.data),r=l.method,u=fe(l.params);if(r==="item/started"){const c=fe(u.item);if(c.type==="commandExecution"){const p=c.status==="inProgress"&&c.processId===null;return{id:e.id,kind:"command",title:p?"Command waiting for approval":"Seele ran command",body:Mc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Gp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File change",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=fe(u.item);if(c.type==="commandExecution"){const p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:p!==null&&p!==0?"Command failed":"Command completed",body:Mc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p!==null?`exit ${p}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=Gp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File changed",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.id)||void 0,meta:"done",fileChanges:d}}return r==="item/commandExecution/outputDelta"?{id:e.id,kind:"command",title:"Command output",body:typeof u.itemId=="string"?u.itemId:"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.itemId=="string"?u.itemId:void 0,meta:"running",output:typeof u.delta=="string"?u.delta:void 0}:null}function d_(e){if(e.event!=="codex.notification")return null;const i=fe(e.data),l=i.method;if(l!=="item/started"&&l!=="item/completed")return null;const r=fe(i.params),u=fe(r.item),c=typeof u.type=="string"?u.type:"item";if(ew(c)||cw(u))return null;const d=l==="item/completed",p=fe(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?tw(g,d,p):d?`Finished ${ja(c)}`:`Working on ${ja(c)}`,body:g?nw(g,p):lw(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:g==="seele_wakeup"&&d?"after turn":d?p_(u):"running",topicAction:g==="seele_topics"?Zv(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&we(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?fe(p.payload):void 0}}function Zv(e){return e==="read"||e==="history"||e==="send"?e:void 0}function f_(e){if(sw(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=vE(e);return i?{id:e.id,kind:"activity",title:rw(i),body:Jv(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function Jv(e){const i=fe(e);for(const l of["title","message","description","status","reason"])if(typeof i[l]=="string"&&i[l].trim())return aw(i[l].trim(),180);return"Event details are available"}function ew(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function p_(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function ja(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function tw(e,i,l){if(e==="seele_topics")switch(we(l.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(e==="seele_wakeup"){const u=we(l.action)==="cancel";return i?u?"Wakeup cancellation requested":"Wakeup requested":u?"Requesting wakeup cancellation":"Requesting wakeup"}if(e==="seele_workspace_change")return i?"Workspace change proposed":"Preparing workspace change";const r=ja(e);return i?`Finished ${r}`:`Running ${r}`}function nw(e,i){if(e==="seele_topics"){const l=we(i.topicId);return l?`Topic ${Ca(l)}`:"Topic"}if(e==="seele_wakeup")return we(i.instruction)||(we(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const l=we(i.type)||"workspace";return iw(l,fe(i.payload))}return ja(e)}function iw(e,i){return e==="responsibility"?we(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function lw(e,i){for(const l of["title","name","description","text","summary"])if(typeof e[l]=="string"&&e[l].trim())return ls(e[l].trim(),160);return typeof e.id=="string"?`${ja(i)} ${Ca(e.id)}`:ja(i)}function h_(e){var l;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const i=(l=e.meta)==null?void 0:l.match(/^exit\s+(-?\d+)$/);return i?Number(i[1])===0?"done":"failed":"done"}function m_(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function g_(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 l=(r=e.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return l?`Exit code: ${l[1]}`:i==="failed"?"Command failed.":"Command completed."}function y_(e,i){const l=e.split(/\r?\n/),u=l.slice(0,i).join(`
119
+ `);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=pe(e.data);if(we(c.actionType)==="seele_workspace_change"){const p=pe(c.payload),g=pe(p.payload),m=we(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:rw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=CE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=SE(e.data);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),meta:c.meta}}if(e.event==="codex.dynamic_tool_request"){const c=pe(e.data),d=pe(c.params),p=we(d.tool)||"dynamic tool",g=pe(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:lw(p,!1,g),body:aw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:we(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?tw(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&we(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?pe(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=pe(e.data),d=pe(c.payload),p=we(d.content)||we(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:we(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:we(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=pe(e.data),d=pe(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=pe(e.data),d=pe(c.task),p=pe(d.currentPlan),g=pe(c.update),m=we(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",y=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${y} change${y===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:we(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=pe(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:we(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=pe(e.data),d=e.event==="runtime.command.completed",p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:d?p!==null&&p!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?Rc(c.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?p!==null?`exit ${p}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const c=pe(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:Xp(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=pe(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=M_(c.requestId),p=pe(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const l=pe(e.data),r=l.method,u=pe(l.params);if(r==="item/started"){const c=pe(u.item);if(c.type==="commandExecution"){const p=c.status==="inProgress"&&c.processId===null;return{id:e.id,kind:"command",title:p?"Command waiting for approval":"Seele ran command",body:Rc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Gp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File change",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=pe(u.item);if(c.type==="commandExecution"){const p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:p!==null&&p!==0?"Command failed":"Command completed",body:Rc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p!==null?`exit ${p}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=Gp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File changed",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.id)||void 0,meta:"done",fileChanges:d}}return r==="item/commandExecution/outputDelta"?{id:e.id,kind:"command",title:"Command output",body:typeof u.itemId=="string"?u.itemId:"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.itemId=="string"?u.itemId:void 0,meta:"running",output:typeof u.delta=="string"?u.delta:void 0}:null}function h_(e){if(e.event!=="codex.notification")return null;const i=pe(e.data),l=i.method;if(l!=="item/started"&&l!=="item/completed")return null;const r=pe(i.params),u=pe(r.item),c=typeof u.type=="string"?u.type:"item";if(iw(c)||pw(u))return null;const d=l==="item/completed",p=pe(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?lw(g,d,p):d?`Finished ${Sa(c)}`:`Working on ${Sa(c)}`,body:g?aw(g,p):sw(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:g==="seele_wakeup"&&d?"after turn":d?g_(u):"running",topicAction:g==="seele_topics"?tw(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&we(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?pe(p.payload):void 0}}function tw(e){return e==="read"||e==="history"||e==="send"?e:void 0}function m_(e){if(cw(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=jE(e);return i?{id:e.id,kind:"activity",title:uw(i),body:nw(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function nw(e){const i=pe(e);for(const l of["title","message","description","status","reason"])if(typeof i[l]=="string"&&i[l].trim())return ow(i[l].trim(),180);return"Event details are available"}function iw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function g_(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function Sa(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function lw(e,i,l){if(e==="seele_topics")switch(we(l.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(e==="seele_wakeup"){const u=we(l.action)==="cancel";return i?u?"Wakeup cancellation requested":"Wakeup requested":u?"Requesting wakeup cancellation":"Requesting wakeup"}if(e==="seele_workspace_change")return i?"Workspace change proposed":"Preparing workspace change";const r=Sa(e);return i?`Finished ${r}`:`Running ${r}`}function aw(e,i){if(e==="seele_topics"){const l=we(i.topicId);return l?`Topic ${Ca(l)}`:"Topic"}if(e==="seele_wakeup")return we(i.instruction)||(we(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const l=we(i.type)||"workspace";return rw(l,pe(i.payload))}return Sa(e)}function rw(e,i){return e==="responsibility"?we(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function sw(e,i){for(const l of["title","name","description","text","summary"])if(typeof e[l]=="string"&&e[l].trim())return ls(e[l].trim(),160);return typeof e.id=="string"?`${Sa(i)} ${Ca(e.id)}`:Sa(i)}function y_(e){var l;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const i=(l=e.meta)==null?void 0:l.match(/^exit\s+(-?\d+)$/);return i?Number(i[1])===0?"done":"failed":"done"}function x_(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function b_(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 l=(r=e.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return l?`Exit code: ${l[1]}`:i==="failed"?"Command failed.":"Command completed."}function v_(e,i){const l=e.split(/\r?\n/),u=l.slice(0,i).join(`
120
120
  `);return l.length>i?`${u}
121
- ...`:u}function x_(e,i){return e?e.split(/\r?\n/).filter(l=>l.trim()).length>i:!1}function qc(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function b_(e){const i=e.trim();return!i||i.includes(`
122
- `)?null:ls(i,120)}function ls(e,i){if(e.length<=i)return e;const l=Math.max(8,Math.floor((i-3)/2));return`${e.slice(0,l)}...${e.slice(-l)}`}function aw(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function rw(e){const l=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return l?l.charAt(0).toUpperCase()+l.slice(1):"System event"}function sw(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=fe(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 ${Ca(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=fe(e.data);return{id:e.id,title:"Codex compacting context",detail:Xp(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=fe(e.data);return{id:e.id,title:"Codex context compacted",detail:Xp(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=fe(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=fe(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?ls(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=fe(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=fe(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?ls(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const l=fe(e.data),r=l.method,u=fe(l.params);if(r==="item/started"||r==="item/completed"){const c=fe(u.item),d=typeof c.type=="string"?c.type:"item",p=r==="item/completed";if(d==="commandExecution")return{id:e.id,title:p?"Command completed":"Running command",detail:ls(Mc(c.command),96),createdAt:i,tone:p?"done":"running"};if(d==="contextCompaction")return{id:e.id,title:p?"Codex context compacted":"Codex compacting context",detail:p?void 0:"Current runtime thread is being compacted",createdAt:i,tone:p?"done":"running"};const g=cw(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:ls(g,96),createdAt:i,tone:p?"done":"running"};if(!ew(d))return{id:e.id,title:p?`Finished ${ja(d)}`:`Working on ${ja(d)}`,detail:lw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=fe(u.status),d=Array.isArray(c.activeFlags)?c.activeFlags:[];if(c.type==="active"&&d.some(p=>p==="waitingOnApproval"))return{id:e.id,title:"Waiting for approval",detail:"Command needs confirmation",createdAt:i,tone:"warning"}}if(r==="turn/started")return{id:e.id,title:"Seele started working",createdAt:i,tone:"running"};if(r==="turn/completed"){const c=fe(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?ss(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=fe(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${tb(d)}`:`Finished ${tb(d)}`,detail:typeof c.durationMs=="number"?ss(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function Xp(e,i){const l=Hc(e.before),r=Hc(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${ss(c)}`)}else u.push("Codex triggered");if(l&&r){u.push(`context ${ar(l)} → ${ar(r)}`);const c=l.totalTokens-r.totalTokens;c>0&&u.push(`released ~${Ch(c)} tokens`)}else l&&u.push(`context ${ar(l)}`);return u.join(" · ")}function v_(e){const i=Hc(e.before),l=Hc(e.after),r=i&&l?i.totalTokens-l.totalTokens:null;let u="Unavailable";return i&&l?u=`${ar(i)} → ${ar(l)}`:i?u=`${ar(i)} → unavailable`:l&&(u=`unavailable → ${ar(l)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":ss(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${Ch(r)} tokens`:"No decrease observed"}]}function Hc(e){const i=fe(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function ar(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${Ch(e.totalTokens)} tokens`}function Ch(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function w_(e){let i=null;for(const l of e)for(const r of l.events){const u=j_(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function eb(...e){return e.reduce((i,l)=>l&&(!i||Date.parse(l.updatedAt)>Date.parse(i.updatedAt))?l:i,null)}function k_(e){let i=null;for(const l of e){const r=ow(l);r&&(!i||Bo(l,i)>0)&&(i=r)}return i}function ow(e){if(e.event!=="codex.notification")return null;const i=fe(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const l=fe(i.params),r=fe(l.tokenUsage),u=fe(r.last),c=fe(r.total),d=Object.keys(u).length>0?u:c,p=mi(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:mi(d.inputTokens),cachedInputTokens:mi(d.cachedInputTokens),outputTokens:mi(d.outputTokens),reasoningOutputTokens:mi(d.reasoningOutputTokens),modelContextWindow:mi(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function S_(...e){return e.reduce((i,l)=>l&&(!i||Date.parse(l.createdAt)>Date.parse(i.createdAt))?l:i,null)}function uw(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function j_(e){if(e.event!=="codex.notification")return null;const i=fe(e.data);if(i.method!=="account/rateLimits/updated")return null;const l=fe(i.params),r=fe(l.rateLimits),u=[r.primary,r.secondary].map(c=>C_(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function C_(e){const i=fe(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 T_(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Mc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function cw(e){var l;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((l=Gp(e)[0])==null?void 0:l.path)??null}function fe(e){return e&&typeof e=="object"?e:{}}function mi(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function we(e){return typeof e=="string"?e:""}function rr(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function E_(e){const i=fe(e),l=fe(i.thread);if(!Object.keys(l).length)return null;const r=Array.isArray(l.turns)?l.turns:[],u=[];let c=0,d=0,p=0,g=0,m=0;return r.forEach((b,x)=>{const k=fe(b),w=we(k.id)||`turn-${x+1}`,E=Array.isArray(k.items)?k.items:[];c+=E.length,u.push(A_(k,w)),E.forEach(O=>{const U=fe(O),_=we(U.type);_==="userMessage"?d+=1:_==="agentMessage"?p+=1:_==="compaction"?g+=1:_==="contextCompaction"&&(m+=1)})}),{id:we(l.id),sessionId:we(l.sessionId),status:dw(l.status),source:Th(l.source),cwd:we(l.cwd),path:we(l.path),preview:we(l.preview),createdAt:mi(l.createdAt),updatedAt:mi(l.updatedAt),recencyAt:mi(l.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:m,turns:u}}function A_(e,i){const l=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(l.map(c=>we(fe(c).type)).filter(c=>c.length>0))).join(", "),u=N_(l.map(c=>Qp(c)).filter(Boolean).join(" "),220);return{id:i,status:dw(e.status),itemsView:we(e.itemsView)||"unknown",itemCount:l.length,startedAt:mi(e.startedAt),completedAt:mi(e.completedAt),durationMs:mi(e.durationMs),itemTypes:r,preview:u,raw:e}}function Qp(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Qp).filter(Boolean).join(`
121
+ ...`:u}function w_(e,i){return e?e.split(/\r?\n/).filter(l=>l.trim()).length>i:!1}function qc(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function k_(e){const i=e.trim();return!i||i.includes(`
122
+ `)?null:ls(i,120)}function ls(e,i){if(e.length<=i)return e;const l=Math.max(8,Math.floor((i-3)/2));return`${e.slice(0,l)}...${e.slice(-l)}`}function ow(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function uw(e){const l=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return l?l.charAt(0).toUpperCase()+l.slice(1):"System event"}function cw(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=pe(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 ${Ca(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=pe(e.data);return{id:e.id,title:"Codex compacting context",detail:Xp(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=pe(e.data);return{id:e.id,title:"Codex context compacted",detail:Xp(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=pe(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=pe(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?ls(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=pe(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=pe(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?ls(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const l=pe(e.data),r=l.method,u=pe(l.params);if(r==="item/started"||r==="item/completed"){const c=pe(u.item),d=typeof c.type=="string"?c.type:"item",p=r==="item/completed";if(d==="commandExecution")return{id:e.id,title:p?"Command completed":"Running command",detail:ls(Rc(c.command),96),createdAt:i,tone:p?"done":"running"};if(d==="contextCompaction")return{id:e.id,title:p?"Codex context compacted":"Codex compacting context",detail:p?void 0:"Current runtime thread is being compacted",createdAt:i,tone:p?"done":"running"};const g=pw(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:ls(g,96),createdAt:i,tone:p?"done":"running"};if(!iw(d))return{id:e.id,title:p?`Finished ${Sa(d)}`:`Working on ${Sa(d)}`,detail:sw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=pe(u.status),d=Array.isArray(c.activeFlags)?c.activeFlags:[];if(c.type==="active"&&d.some(p=>p==="waitingOnApproval"))return{id:e.id,title:"Waiting for approval",detail:"Command needs confirmation",createdAt:i,tone:"warning"}}if(r==="turn/started")return{id:e.id,title:"Seele started working",createdAt:i,tone:"running"};if(r==="turn/completed"){const c=pe(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?ss(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=pe(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${ib(d)}`:`Finished ${ib(d)}`,detail:typeof c.durationMs=="number"?ss(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function Xp(e,i){const l=Hc(e.before),r=Hc(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${ss(c)}`)}else u.push("Codex triggered");if(l&&r){u.push(`context ${ar(l)} → ${ar(r)}`);const c=l.totalTokens-r.totalTokens;c>0&&u.push(`released ~${Eh(c)} tokens`)}else l&&u.push(`context ${ar(l)}`);return u.join(" · ")}function j_(e){const i=Hc(e.before),l=Hc(e.after),r=i&&l?i.totalTokens-l.totalTokens:null;let u="Unavailable";return i&&l?u=`${ar(i)} → ${ar(l)}`:i?u=`${ar(i)} → unavailable`:l&&(u=`unavailable → ${ar(l)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":ss(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${Eh(r)} tokens`:"No decrease observed"}]}function Hc(e){const i=pe(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function ar(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${Eh(e.totalTokens)} tokens`}function Eh(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function S_(e){let i=null;for(const l of e)for(const r of l.events){const u=E_(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function nb(...e){return e.reduce((i,l)=>l&&(!i||Date.parse(l.updatedAt)>Date.parse(i.updatedAt))?l:i,null)}function C_(e){let i=null;for(const l of e){const r=dw(l);r&&(!i||Bo(l,i)>0)&&(i=r)}return i}function dw(e){if(e.event!=="codex.notification")return null;const i=pe(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const l=pe(i.params),r=pe(l.tokenUsage),u=pe(r.last),c=pe(r.total),d=Object.keys(u).length>0?u:c,p=mi(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:mi(d.inputTokens),cachedInputTokens:mi(d.cachedInputTokens),outputTokens:mi(d.outputTokens),reasoningOutputTokens:mi(d.reasoningOutputTokens),modelContextWindow:mi(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function T_(...e){return e.reduce((i,l)=>l&&(!i||Date.parse(l.createdAt)>Date.parse(i.createdAt))?l:i,null)}function fw(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function E_(e){if(e.event!=="codex.notification")return null;const i=pe(e.data);if(i.method!=="account/rateLimits/updated")return null;const l=pe(i.params),r=pe(l.rateLimits),u=[r.primary,r.secondary].map(c=>A_(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function A_(e){const i=pe(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 N_(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Rc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function pw(e){var l;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((l=Gp(e)[0])==null?void 0:l.path)??null}function pe(e){return e&&typeof e=="object"?e:{}}function mi(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function we(e){return typeof e=="string"?e:""}function rr(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function __(e){const i=pe(e),l=pe(i.thread);if(!Object.keys(l).length)return null;const r=Array.isArray(l.turns)?l.turns:[],u=[];let c=0,d=0,p=0,g=0,m=0;return r.forEach((b,y)=>{const k=pe(b),w=we(k.id)||`turn-${y+1}`,T=Array.isArray(k.items)?k.items:[];c+=T.length,u.push(D_(k,w)),T.forEach(R=>{const z=pe(R),N=we(z.type);N==="userMessage"?d+=1:N==="agentMessage"?p+=1:N==="compaction"?g+=1:N==="contextCompaction"&&(m+=1)})}),{id:we(l.id),sessionId:we(l.sessionId),status:hw(l.status),source:Ah(l.source),cwd:we(l.cwd),path:we(l.path),preview:we(l.preview),createdAt:mi(l.createdAt),updatedAt:mi(l.updatedAt),recencyAt:mi(l.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:m,turns:u}}function D_(e,i){const l=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(l.map(c=>we(pe(c).type)).filter(c=>c.length>0))).join(", "),u=R_(l.map(c=>Qp(c)).filter(Boolean).join(" "),220);return{id:i,status:hw(e.status),itemsView:we(e.itemsView)||"unknown",itemCount:l.length,startedAt:mi(e.startedAt),completedAt:mi(e.completedAt),durationMs:mi(e.durationMs),itemTypes:r,preview:u,raw:e}}function Qp(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Qp).filter(Boolean).join(`
123
123
  `);if(!e||typeof e!="object")return"";const i=e,l=we(i.text),r=Qp(i.content);return[l,r].filter(Boolean).join(`
124
- `)}function dw(e){const i=fe(e);return we(i.type)||Th(e)}function N_(e,i){const l=e.replace(/\s+/g," ").trim();return l.length>i?`${l.slice(0,i)}...`:l}function No(e){return e===null?"unknown":$e(e*1e3)}function __(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Th(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function D_(e){if(typeof e=="string")return e;const i=fe(e),l=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return l&&r?`${l}
124
+ `)}function hw(e){const i=pe(e);return we(i.type)||Ah(e)}function R_(e,i){const l=e.replace(/\s+/g," ").trim();return l.length>i?`${l.slice(0,i)}...`:l}function No(e){return e===null?"unknown":$e(e*1e3)}function M_(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Ah(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function O_(e){if(typeof e=="string")return e;const i=pe(e),l=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return l&&r?`${l}
125
125
 
126
- ${r}`:l||r||Th(e)}function tb(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function ss(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Ap(e){if(e<6e4)return ss(e);const i=Math.floor(e/6e4);if(i<60)return`${i}m`;const l=Math.floor(i/60),r=i%60;return r===0?`${l}h`:`${l}h ${r}m`}function fw(e){return`${Math.round(e)}%`}function Un(e){return new Intl.NumberFormat("en-US").format(e)}function Rc(e){return e===null?"unknown":Un(e)}function Kc(e){return Math.max(0,Math.min(100,Math.round(e)))}function Eh(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function pw(e){return $e(e*1e3)}function $e(e){const i=typeof e=="number"?new Date(e):new Date(e);if(Number.isNaN(i.getTime()))return"";const l={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",l).formatToParts(i),u=c=>{var d;return((d=r.find(p=>p.type===c))==null?void 0:d.value)??""};return`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`}function Ho(e){const i=$e(e);return i?`${i} UTC+08:00`:""}function M_(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 nb(e){return e==="minimal"?"Minimal":e==="low"?"Low":e==="medium"?"Medium":e==="high"?"High":e==="xhigh"?"Extra high":"Medium"}function ib(e,i){const l=e?i.find(r=>r.model===e):i.find(r=>r.isDefault);return l?`${l.displayName}${l.isDefault?" (default)":""}`:e||"Unavailable"}function Xc(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function Zp(e,i){const l=Xc(e);return i?`${l} (${$e(i)})`:l}function R_(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(Xc(e))}`}function O_(e,i){const l=lb(e),r=lb(i);if(!l||!r)return!1;for(let u=0;u<l.core.length;u+=1)if(l.core[u]!==r.core[u])return l.core[u]>r.core[u];return l.prerelease===r.prerelease?!1:l.prerelease?r.prerelease?l.prerelease.localeCompare(r.prerelease,void 0,{numeric:!0})>0:!1:!0}function lb(e){if(!e)return null;const i=Xc(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 z_(e,i){const l=e.map(r=>({value:r.model,label:`${r.displayName}${r.isDefault?" (default)":""}`}));return i&&!e.some(r=>r.model===i)&&l.push({value:i,label:`${i} (unavailable)`}),l.length===0&&l.push({value:"",label:"Models unavailable"}),l}async function Np(e,i){const l=e.getReader(),r=new TextDecoder;let u="";for(;;){const{done:c,value:d}=await l.read();if(c)break;u+=r.decode(d,{stream:!0});const p=u.split(`
126
+ ${r}`:l||r||Ah(e)}function ib(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function ss(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Ap(e){if(e<6e4)return ss(e);const i=Math.floor(e/6e4);if(i<60)return`${i}m`;const l=Math.floor(i/60),r=i%60;return r===0?`${l}h`:`${l}h ${r}m`}function mw(e){return`${Math.round(e)}%`}function Un(e){return new Intl.NumberFormat("en-US").format(e)}function Mc(e){return e===null?"unknown":Un(e)}function Kc(e){return Math.max(0,Math.min(100,Math.round(e)))}function Nh(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function gw(e){return $e(e*1e3)}function $e(e){const i=typeof e=="number"?new Date(e):new Date(e);if(Number.isNaN(i.getTime()))return"";const l={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",l).formatToParts(i),u=c=>{var d;return((d=r.find(p=>p.type===c))==null?void 0:d.value)??""};return`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`}function Ho(e){const i=$e(e);return i?`${i} UTC+08:00`:""}function z_(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 lb(e){return e==="minimal"?"Minimal":e==="low"?"Low":e==="medium"?"Medium":e==="high"?"High":e==="xhigh"?"Extra high":"Medium"}function ab(e,i){const l=e?i.find(r=>r.model===e):i.find(r=>r.isDefault);return l?`${l.displayName}${l.isDefault?" (default)":""}`:e||"Unavailable"}function Xc(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function Zp(e,i){const l=Xc(e);return i?`${l} (${$e(i)})`:l}function L_(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(Xc(e))}`}function I_(e,i){const l=rb(e),r=rb(i);if(!l||!r)return!1;for(let u=0;u<l.core.length;u+=1)if(l.core[u]!==r.core[u])return l.core[u]>r.core[u];return l.prerelease===r.prerelease?!1:l.prerelease?r.prerelease?l.prerelease.localeCompare(r.prerelease,void 0,{numeric:!0})>0:!1:!0}function rb(e){if(!e)return null;const i=Xc(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 U_(e,i){const l=e.map(r=>({value:r.model,label:`${r.displayName}${r.isDefault?" (default)":""}`}));return i&&!e.some(r=>r.model===i)&&l.push({value:i,label:`${i} (unavailable)`}),l.length===0&&l.push({value:"",label:"Models unavailable"}),l}async function Np(e,i){const l=e.getReader(),r=new TextDecoder;let u="";for(;;){const{done:c,value:d}=await l.read();if(c)break;u+=r.decode(d,{stream:!0});const p=u.split(`
127
127
 
128
- `);u=p.pop()??"";for(const g of p){const m=L_(g);m&&i(m)}}}function L_(e){const i=e.split(`
128
+ `);u=p.pop()??"";for(const g of p){const m=B_(g);m&&i(m)}}}function B_(e){const i=e.split(`
129
129
  `),l=i.find(d=>d.startsWith("event: ")),r=i.filter(d=>d.startsWith("data: ")).map(d=>d.slice(6));if(!l||r.length===0)return null;const u=l.slice(7),c=r.join(`
130
- `);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function I_(e){var r,u,c,d,p;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/agentMessage/delta"&&i.method!=="item/plan/delta")return null;const l=((r=i.params)==null?void 0:r.delta)??((u=i.params)==null?void 0:u.text)??"";return l?{text:l,phase:i.method==="item/plan/delta"?"final_answer":((c=i.params)==null?void 0:c.phase)==="commentary"||((d=i.params)==null?void 0:d.phase)==="final_answer"?i.params.phase:"unknown",itemId:(p=i.params)==null?void 0:p.itemId}:null}function U_(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/started")return null;const l=(r=i.params)==null?void 0:r.item;return(l==null?void 0:l.type)!=="agentMessage"&&(l==null?void 0:l.type)!=="plan"?null:{itemId:l.id,phase:l.type==="plan"?"final_answer":l.phase==="commentary"||l.phase==="final_answer"?l.phase:"unknown"}}function B_(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/completed")return null;const l=(r=i.params)==null?void 0:r.item;return(l==null?void 0:l.type)!=="agentMessage"&&(l==null?void 0:l.type)!=="plan"||!l.text?null:{itemId:l.id,text:l.text,phase:l.type==="plan"?"final_answer":l.phase==="commentary"||l.phase==="final_answer"?l.phase:"unknown"}}function ns(e){var l,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=(l=i.params)==null?void 0:l.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 as(e){return e.length<=6?e:e.slice(0,6)}function Ca(e){return e.slice(0,8)}function ab(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function rb(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function _p(e,...i){return i.includes(e)}function q_(e,i){const l=Date.parse(e.startedAt??e.createdAt),r=e.finishedAt?Date.parse(e.finishedAt):i;if(!Number.isFinite(l)||!Number.isFinite(r))return"";const u=Math.max(0,Math.floor((r-l)/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 H_(e,i){const l=Date.parse(e),r=Date.parse(i);if(!Number.isFinite(l)||!Number.isFinite(r))return"Goal completed";const u=Math.max(0,Math.floor((r-l)/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 Jp(e,i){var l;return i==="running"||i==="error"?i:((l=e==null?void 0:e.nextWakeup)==null?void 0:l.status)==="scheduled"?"waiting":i}function $_(e,i){return`waiting ${$c(e,i)}`}function $c(e,i){const l=Date.parse(e.wakeAt);if(Number.isNaN(l))return"waiting";const r=Math.max(0,Math.ceil((l-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 Oc(e,i=null,l=Date.now()){if(e==="waiting")return i?$_(i,l):"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 sb(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function G_(e){return e==="assistant"?"Seele":"You"}const V_=document.getElementById("root"),hw=window.__seeleCodexRoot??Bk.createRoot(V_);window.__seeleCodexRoot=hw;X_();hw.render(s.jsx(D.StrictMode,{children:s.jsx(Y_,{})}));function Y_(){const[e,i]=D.useState(null),[l,r]=D.useState("admin"),[u,c]=D.useState(""),[d,p]=D.useState(!1),[g,m]=D.useState("");D.useEffect(()=>{ob().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),m("Unable to reach Seele.")})},[]),D.useEffect(()=>{const k=()=>{i({enabled:!0,authenticated:!1,user:null}),c(""),m("Your session has expired. Sign in again.")};return window.addEventListener(Yp,k),()=>window.removeEventListener(Yp,k)},[]);async function b(k){k.preventDefault(),p(!0),m("");try{const w=await fetch(pe("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:l,password:u})});if(!w.ok){m(w.status===401?"Incorrect username or password.":w.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}c(""),i(await ob())}catch{m("Unable to reach Seele.")}finally{p(!1)}}async function x(){await fetch(pe("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}if(!e)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:"Loading Seele..."})});if(!e.enabled||e.authenticated){const k=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(lA,{authEnabled:e.enabled,currentUser:k,onLogout:x})}return s.jsx("main",{className:"auth-shell",children:s.jsxs("section",{className:"auth-panel",children:[s.jsxs("header",{children:[s.jsx("p",{children:"Seele"}),s.jsx("h1",{children:"Sign in"})]}),s.jsxs("form",{onSubmit:b,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:k=>r(k.target.value),value:l})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:k=>c(k.target.value),type:"password",value:u})]}),g?s.jsx("p",{className:"auth-error",role:"alert",children:g}):null,s.jsx("button",{disabled:d||!l||!u,type:"submit",children:d?"Signing in...":"Sign in"})]})]})})}async function ob(){const e=await fetch(pe("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function P_(){const e=pe("admin/users"),i=await fetch(e);if(!i.ok)throw await Zt(i,{url:e});return(await i.json()).users}async function F_(e){const i=pe("admin/users"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!l.ok)throw await Zt(l,{method:"POST",url:i});return(await l.json()).user}async function W_(e,i){const l=pe(`admin/users/${encodeURIComponent(e)}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Zt(r,{method:"PATCH",url:l});return(await r.json()).user}async function K_(e){const i=pe(`admin/users/${encodeURIComponent(e)}`),l=await fetch(i,{method:"DELETE"});if(!l.ok)throw await Zt(l,{method:"DELETE",url:i})}function X_(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const l=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;return l.status===401&&!r.includes("/api/auth/")&&window.dispatchEvent(new Event(Yp)),l},window.__seeleAuthFetchInstalled=!0}export{kt as _,qk as a,nS as b,dx as c,Zk as f,ub as g,tS as h,nh as s,Yk as w};
130
+ `);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function q_(e){var r,u,c,d,p;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/agentMessage/delta"&&i.method!=="item/plan/delta")return null;const l=((r=i.params)==null?void 0:r.delta)??((u=i.params)==null?void 0:u.text)??"";return l?{text:l,phase:i.method==="item/plan/delta"?"final_answer":((c=i.params)==null?void 0:c.phase)==="commentary"||((d=i.params)==null?void 0:d.phase)==="final_answer"?i.params.phase:"unknown",itemId:(p=i.params)==null?void 0:p.itemId}:null}function H_(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/started")return null;const l=(r=i.params)==null?void 0:r.item;return(l==null?void 0:l.type)!=="agentMessage"&&(l==null?void 0:l.type)!=="plan"?null:{itemId:l.id,phase:l.type==="plan"?"final_answer":l.phase==="commentary"||l.phase==="final_answer"?l.phase:"unknown"}}function $_(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/completed")return null;const l=(r=i.params)==null?void 0:r.item;return(l==null?void 0:l.type)!=="agentMessage"&&(l==null?void 0:l.type)!=="plan"||!l.text?null:{itemId:l.id,text:l.text,phase:l.type==="plan"?"final_answer":l.phase==="commentary"||l.phase==="final_answer"?l.phase:"unknown"}}function ns(e){var l,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=(l=i.params)==null?void 0:l.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 as(e){return e.length<=6?e:e.slice(0,6)}function Ca(e){return e.slice(0,8)}function sb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function ob(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function _p(e,...i){return i.includes(e)}function G_(e,i){const l=Date.parse(e.startedAt??e.createdAt),r=e.finishedAt?Date.parse(e.finishedAt):i;if(!Number.isFinite(l)||!Number.isFinite(r))return"";const u=Math.max(0,Math.floor((r-l)/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 V_(e,i){const l=Date.parse(e),r=Date.parse(i);if(!Number.isFinite(l)||!Number.isFinite(r))return"Goal completed";const u=Math.max(0,Math.floor((r-l)/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 Jp(e,i){var l;return i==="running"||i==="error"?i:((l=e==null?void 0:e.nextWakeup)==null?void 0:l.status)==="scheduled"?"waiting":i}function P_(e,i){return`waiting ${$c(e,i)}`}function $c(e,i){const l=Date.parse(e.wakeAt);if(Number.isNaN(l))return"waiting";const r=Math.max(0,Math.ceil((l-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 Oc(e,i=null,l=Date.now()){if(e==="waiting")return i?P_(i,l):"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 ub(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function Y_(e){return e==="assistant"?"Seele":"You"}const F_=document.getElementById("root"),yw=window.__seeleCodexRoot??$k.createRoot(F_);window.__seeleCodexRoot=yw;rD();yw.render(s.jsx(D.StrictMode,{children:s.jsx(W_,{})}));function W_(){const[e,i]=D.useState(null),[l,r]=D.useState(null),[u,c]=D.useState(""),[d,p]=D.useState("admin"),[g,m]=D.useState(""),[b,y]=D.useState(!1),[k,w]=D.useState("");D.useEffect(()=>{cb().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),w("Unable to reach Seele.")})},[]),D.useEffect(()=>{let N=!1,G=0;const B=async()=>{try{const P=await J_();if(N)return;r(P),c(""),G=window.setTimeout(B,P.status==="authorized"?3e4:3e3)}catch{if(N)return;c("Unable to reach Seele."),G=window.setTimeout(B,3e3)}};return B(),()=>{N=!0,window.clearTimeout(G)}},[]),D.useEffect(()=>{const N=()=>{i({enabled:!0,authenticated:!1,user:null}),m(""),w("Your session has expired. Sign in again.")};return window.addEventListener(Pp,N),()=>window.removeEventListener(Pp,N)},[]);async function T(N){N.preventDefault(),y(!0),w("");try{const G=await fetch(fe("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d,password:g})});if(!G.ok){w(G.status===401?"Incorrect username or password.":G.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}m(""),i(await cb())}catch{w("Unable to reach Seele.")}finally{y(!1)}}async function R(){await fetch(fe("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}const z=Q_();if(z&&e&&(!e.enabled||e.authenticated)){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return N.role!=="admin"?s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-access-denied",children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Administrator access required"}),s.jsx("p",{children:"This page changes deployment authorization."}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("a",{href:vh(),children:"Back to Seele"}),s.jsx("button",{onClick:()=>void R(),type:"button",children:"Sign out"})]})]})}):s.jsx(X_,{authorization:l,currentUser:N,onLogout:R})}if(!z&&l&&l.status!=="authorized")return s.jsx(K_,{authorization:l});if(!e||!l&&!z)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:u||"Loading Seele..."})});if(!e.enabled||e.authenticated){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(sA,{authEnabled:e.enabled,currentUser:N,onLogout:R})}return s.jsx("main",{className:"auth-shell",children:s.jsxs("section",{className:"auth-panel",children:[s.jsxs("header",{children:[s.jsx("p",{children:"Seele"}),s.jsx("h1",{children:"Sign in"})]}),s.jsxs("form",{onSubmit:T,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:N=>p(N.target.value),value:d})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:N=>m(N.target.value),type:"password",value:g})]}),k?s.jsx("p",{className:"auth-error",role:"alert",children:k}):null,s.jsx("button",{disabled:b||!d||!g,type:"submit",children:b?"Signing in...":"Sign in"})]})]})})}function K_({authorization:e}){const l={starting:{title:"Checking deployment authorization",body:"Seele is contacting its configured cloud service."},pending:{title:"Waiting for cloud approval",body:"A cloud administrator must authorize this deployment before it can be used."},revoked:{title:"Deployment access revoked",body:"This deployment is disabled until a cloud administrator authorizes it again."},unavailable:{title:"Cloud authorization unavailable",body:"Seele will keep retrying. Business APIs and the runtime remain paused."},authorized:{title:"Deployment authorized",body:"Seele is ready."}}[e.status];return s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-waiting-panel",children:[s.jsx("div",{className:`deployment-status-mark is-${e.status}`,"aria-hidden":"true"}),s.jsx("p",{className:"deployment-kicker",children:"Seele deployment"}),s.jsx("h1",{children:l.title}),s.jsx("p",{className:"deployment-lead",children:l.body}),s.jsxs("dl",{className:"deployment-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Deployment ID"}),s.jsx("dd",{children:s.jsx("code",{children:e.deploymentId})})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:e.name})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Cloud"}),s.jsx("dd",{children:e.cloudUrl})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last checked"}),s.jsx("dd",{children:e.lastCheckedAt?eh(e.lastCheckedAt):"Starting"})]})]}),e.lastError?s.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError}):null,s.jsx("a",{className:"deployment-primary-link",href:Z_(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function X_({authorization:e,currentUser:i,onLogout:l}){const[r,u]=D.useState([]),[c,d]=D.useState({}),[p,g]=D.useState(null),[m,b]=D.useState(!0),[y,k]=D.useState("");D.useEffect(()=>{let T=!1,R=0;const z=async()=>{try{const N=await eD();if(T)return;u(N),d(G=>Object.fromEntries(N.map(B=>[B.deploymentId,G[B.deploymentId]??B.name]))),k("")}catch(N){T||k(Ve(N).message)}finally{T||(b(!1),R=window.setTimeout(z,5e3))}};return z(),()=>{T=!0,window.clearTimeout(R)}},[]);async function w(T,R){g(T),k("");try{const z=await tD(T,R);u(N=>N.map(G=>G.deploymentId===z.deploymentId?z:G)),d(N=>({...N,[z.deploymentId]:z.name}))}catch(z){k(Ve(z).message)}finally{g(null)}}return s.jsxs("main",{className:"deployment-admin-shell",children:[s.jsxs("header",{className:"deployment-admin-header",children:[s.jsxs("div",{children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Deployments"}),s.jsx("p",{children:"Authorize or revoke Seele instances connected to this cloud deployment."})]}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("span",{children:i.username}),s.jsx("a",{href:vh(),children:"Open Seele"}),s.jsx("button",{onClick:()=>void l(),type:"button",children:"Sign out"})]})]}),s.jsxs("section",{className:"deployment-admin-summary",children:[s.jsxs("div",{children:[s.jsx("strong",{children:r.length}),s.jsx("span",{children:"Total"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="pending").length}),s.jsx("span",{children:"Pending"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="authorized").length}),s.jsx("span",{children:"Authorized"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="revoked").length}),s.jsx("span",{children:"Revoked"})]})]}),e?s.jsxs("p",{className:"deployment-cloud-identity",children:["This cloud: ",s.jsx("code",{children:e.deploymentId})]}):null,y?s.jsx("p",{className:"deployment-error",role:"alert",children:y}):null,m?s.jsx("p",{className:"deployment-admin-empty",children:"Loading deployments..."}):null,!m&&r.length===0?s.jsx("p",{className:"deployment-admin-empty",children:"No deployment has contacted this cloud yet."}):null,s.jsx("div",{className:"deployment-list",children:r.map(T=>{const R=p===T.deploymentId,z=c[T.deploymentId]??T.name;return s.jsxs("article",{className:"deployment-card",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("span",{className:`deployment-status is-${T.status}`,children:T.status}),s.jsx("h2",{children:T.name}),s.jsx("code",{children:T.deploymentId})]}),s.jsx("button",{className:T.status==="authorized"?"is-danger":"is-primary",disabled:R,onClick:()=>void w(T.deploymentId,{status:T.status==="authorized"?"revoked":"authorized"}),type:"button",children:R?"Saving...":T.status==="authorized"?"Revoke":"Authorize"})]}),s.jsxs("dl",{className:"deployment-card-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Version"}),s.jsx("dd",{children:T.version})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last seen"}),s.jsx("dd",{children:eh(T.lastSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"First seen"}),s.jsx("dd",{children:eh(T.firstSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsx("dd",{children:T.appliedGlobalRevision})]})]}),s.jsxs("form",{className:"deployment-name-form",onSubmit:N=>{N.preventDefault(),w(T.deploymentId,{name:z})},children:[s.jsxs("label",{children:[s.jsx("span",{children:"Display name"}),s.jsx("input",{disabled:R,maxLength:80,onChange:N=>d(G=>({...G,[T.deploymentId]:N.target.value})),value:z})]}),s.jsx("button",{disabled:R||!z.trim()||z.trim()===T.name,type:"submit",children:"Save name"})]})]},T.deploymentId)})})]})}function Q_(){const e=vh("admin/deployments").replace(/\/+$/,"");return window.location.pathname.replace(/\/+$/,"")===e}function Z_(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function eh(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function J_(){const e=await fetch(fe("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function eD(){const e=fe("admin/deployments"),i=await fetch(e);if(!i.ok)throw await Vt(i,{url:e});return(await i.json()).deployments}async function tD(e,i){const l=fe(`admin/deployments/${encodeURIComponent(e)}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Vt(r,{method:"PATCH",url:l});return(await r.json()).deployment}async function cb(){const e=await fetch(fe("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function nD(){const e=fe("admin/users"),i=await fetch(e);if(!i.ok)throw await Vt(i,{url:e});return(await i.json()).users}async function iD(e){const i=fe("admin/users"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!l.ok)throw await Vt(l,{method:"POST",url:i});return(await l.json()).user}async function lD(e,i){const l=fe(`admin/users/${encodeURIComponent(e)}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Vt(r,{method:"PATCH",url:l});return(await r.json()).user}async function aD(e){const i=fe(`admin/users/${encodeURIComponent(e)}`),l=await fetch(i,{method:"DELETE"});if(!l.ok)throw await Vt(l,{method:"DELETE",url:i})}function rD(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const l=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;return l.status===401&&!r.includes("/api/auth/")&&window.dispatchEvent(new Event(Pp)),l},window.__seeleAuthFetchInstalled=!0}export{kt as _,Gk as a,aj as b,px as c,tj as f,db as g,lj as h,ih as s,Wk as w};