remote-codex 0.1.5 → 0.1.6

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.
@@ -0,0 +1,377 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-B12qg9BL.js","assets/ruby-Dw2BHqvy.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/just-Cw27pwNe.js","assets/perl-C0TMdlhV.js","assets/latex-CWtU0Tv5.js","assets/tex-idrVyKtj.js","assets/liquid-DYVedYrR.js","assets/marko-CnJfTvn9.js","assets/less-B1dDrJ26.js","assets/mdc-BMNejdWA.js","assets/nextflow-Zz6hmt5N.js","assets/nextflow-groovy-BeH2EWoN.js","assets/nginx-BpAMiNFr.js","assets/nim-CVrawwO9.js","assets/php-Dhbhpdrm.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-Uh8Bk_45.js","assets/csharp-COcwbKMJ.js","assets/rst-BrH8l1NY.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-C_ipcX3V.js","assets/templ-P3uqSqPl.js","assets/go-CxLEBnE3.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-DNn4PbVi.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
2
+ var KN=Object.defineProperty;var ZN=Object.getPrototypeOf;var JN=Reflect.get;var jE=e=>{throw TypeError(e)};var eA=(e,t,n)=>t in e?KN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>eA(e,typeof t!="symbol"?t+"":t,n),zp=(e,t,n)=>t.has(e)||jE("Cannot "+n);var Ar=(e,t,n)=>(zp(e,t,"read from private field"),n?n.call(e):t.get(e)),El=(e,t,n)=>t.has(e)?jE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ga=(e,t,n,r)=>(zp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Fp=(e,t,n)=>(zp(e,t,"access private method"),n);var ME=(e,t,n)=>JN(ZN(e),n,t);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function Eh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $p={exports:{}},qu={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var PE;function tA(){if(PE)return qu;PE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,l){var o=null;if(l!==void 0&&(o=""+l),i.key!==void 0&&(o=""+i.key),"key"in i){l={};for(var c in i)c!=="key"&&(l[c]=i[c])}else l=i;return i=l.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:l}}return qu.Fragment=t,qu.jsx=n,qu.jsxs=n,qu}var BE;function nA(){return BE||(BE=1,$p.exports=tA()),$p.exports}var f=nA(),Vp={exports:{}},yt={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var UE;function rA(){if(UE)return yt;UE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function E(F){return F===null||typeof F!="object"?null:(F=y&&F[y]||F["@@iterator"],typeof F=="function"?F:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function S(F,se,O){this.props=F,this.context=se,this.refs=C,this.updater=O||v}S.prototype.isReactComponent={},S.prototype.setState=function(F,se){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,se,"setState")},S.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function N(){}N.prototype=S.prototype;function A(F,se,O){this.props=F,this.context=se,this.refs=C,this.updater=O||v}var H=A.prototype=new N;H.constructor=A,w(H,S.prototype),H.isPureReactComponent=!0;var $=Array.isArray;function U(){}var P={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function fe(F,se,O){var ke=O.ref;return{$$typeof:e,type:F,key:se,ref:ke!==void 0?ke:null,props:O}}function M(F,se){return fe(F.type,se,F.props)}function K(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function V(F){var se={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(O){return se[O]})}var he=/\/+/g;function de(F,se){return typeof F=="object"&&F!==null&&F.key!=null?V(""+F.key):se.toString(36)}function ne(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(U,U):(F.status="pending",F.then(function(se){F.status==="pending"&&(F.status="fulfilled",F.value=se)},function(se){F.status==="pending"&&(F.status="rejected",F.reason=se)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function z(F,se,O,ke,Ae){var _e=typeof F;(_e==="undefined"||_e==="boolean")&&(F=null);var et=!1;if(F===null)et=!0;else switch(_e){case"bigint":case"string":case"number":et=!0;break;case"object":switch(F.$$typeof){case e:case t:et=!0;break;case p:return et=F._init,z(et(F._payload),se,O,ke,Ae)}}if(et)return Ae=Ae(F),et=ke===""?"."+de(F,0):ke,$(Ae)?(O="",et!=null&&(O=et.replace(he,"$&/")+"/"),z(Ae,se,O,"",function(dt){return dt})):Ae!=null&&(K(Ae)&&(Ae=M(Ae,O+(Ae.key==null||F&&F.key===Ae.key?"":(""+Ae.key).replace(he,"$&/")+"/")+et)),se.push(Ae)),1;et=0;var st=ke===""?".":ke+":";if($(F))for(var Me=0;Me<F.length;Me++)ke=F[Me],_e=st+de(ke,Me),et+=z(ke,se,O,_e,Ae);else if(Me=E(F),typeof Me=="function")for(F=Me.call(F),Me=0;!(ke=F.next()).done;)ke=ke.value,_e=st+de(ke,Me++),et+=z(ke,se,O,_e,Ae);else if(_e==="object"){if(typeof F.then=="function")return z(ne(F),se,O,ke,Ae);throw se=String(F),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.")}return et}function ee(F,se,O){if(F==null)return F;var ke=[],Ae=0;return z(F,ke,"","",function(_e){return se.call(O,_e,Ae++)}),ke}function Te(F){if(F._status===-1){var se=F._result;se=se(),se.then(function(O){(F._status===0||F._status===-1)&&(F._status=1,F._result=O)},function(O){(F._status===0||F._status===-1)&&(F._status=2,F._result=O)}),F._status===-1&&(F._status=0,F._result=se)}if(F._status===1)return F._result.default;throw F._result}var De=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var se=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(se))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},L={map:ee,forEach:function(F,se,O){ee(F,function(){se.apply(this,arguments)},O)},count:function(F){var se=0;return ee(F,function(){se++}),se},toArray:function(F){return ee(F,function(se){return se})||[]},only:function(F){if(!K(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return yt.Activity=g,yt.Children=L,yt.Component=S,yt.Fragment=n,yt.Profiler=i,yt.PureComponent=A,yt.StrictMode=r,yt.Suspense=d,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,yt.__COMPILER_RUNTIME={__proto__:null,c:function(F){return P.H.useMemoCache(F)}},yt.cache=function(F){return function(){return F.apply(null,arguments)}},yt.cacheSignal=function(){return null},yt.cloneElement=function(F,se,O){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var ke=w({},F.props),Ae=F.key;if(se!=null)for(_e in se.key!==void 0&&(Ae=""+se.key),se)!Y.call(se,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&se.ref===void 0||(ke[_e]=se[_e]);var _e=arguments.length-2;if(_e===1)ke.children=O;else if(1<_e){for(var et=Array(_e),st=0;st<_e;st++)et[st]=arguments[st+2];ke.children=et}return fe(F.type,Ae,ke)},yt.createContext=function(F){return F={$$typeof:o,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:l,_context:F},F},yt.createElement=function(F,se,O){var ke,Ae={},_e=null;if(se!=null)for(ke in se.key!==void 0&&(_e=""+se.key),se)Y.call(se,ke)&&ke!=="key"&&ke!=="__self"&&ke!=="__source"&&(Ae[ke]=se[ke]);var et=arguments.length-2;if(et===1)Ae.children=O;else if(1<et){for(var st=Array(et),Me=0;Me<et;Me++)st[Me]=arguments[Me+2];Ae.children=st}if(F&&F.defaultProps)for(ke in et=F.defaultProps,et)Ae[ke]===void 0&&(Ae[ke]=et[ke]);return fe(F,_e,Ae)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(F){return{$$typeof:c,render:F}},yt.isValidElement=K,yt.lazy=function(F){return{$$typeof:p,_payload:{_status:-1,_result:F},_init:Te}},yt.memo=function(F,se){return{$$typeof:m,type:F,compare:se===void 0?null:se}},yt.startTransition=function(F){var se=P.T,O={};P.T=O;try{var ke=F(),Ae=P.S;Ae!==null&&Ae(O,ke),typeof ke=="object"&&ke!==null&&typeof ke.then=="function"&&ke.then(U,De)}catch(_e){De(_e)}finally{se!==null&&O.types!==null&&(se.types=O.types),P.T=se}},yt.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},yt.use=function(F){return P.H.use(F)},yt.useActionState=function(F,se,O){return P.H.useActionState(F,se,O)},yt.useCallback=function(F,se){return P.H.useCallback(F,se)},yt.useContext=function(F){return P.H.useContext(F)},yt.useDebugValue=function(){},yt.useDeferredValue=function(F,se){return P.H.useDeferredValue(F,se)},yt.useEffect=function(F,se){return P.H.useEffect(F,se)},yt.useEffectEvent=function(F){return P.H.useEffectEvent(F)},yt.useId=function(){return P.H.useId()},yt.useImperativeHandle=function(F,se,O){return P.H.useImperativeHandle(F,se,O)},yt.useInsertionEffect=function(F,se){return P.H.useInsertionEffect(F,se)},yt.useLayoutEffect=function(F,se){return P.H.useLayoutEffect(F,se)},yt.useMemo=function(F,se){return P.H.useMemo(F,se)},yt.useOptimistic=function(F,se){return P.H.useOptimistic(F,se)},yt.useReducer=function(F,se,O){return P.H.useReducer(F,se,O)},yt.useRef=function(F){return P.H.useRef(F)},yt.useState=function(F){return P.H.useState(F)},yt.useSyncExternalStore=function(F,se,O){return P.H.useSyncExternalStore(F,se,O)},yt.useTransition=function(){return P.H.useTransition()},yt.version="19.2.5",yt}var HE;function Kg(){return HE||(HE=1,Vp.exports=rA()),Vp.exports}var T=Kg();const aA=Eh(T);var Gp={exports:{}},Yu={},qp={exports:{}},Yp={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var zE;function sA(){return zE||(zE=1,(function(e){function t(z,ee){var Te=z.length;z.push(ee);e:for(;0<Te;){var De=Te-1>>>1,L=z[De];if(0<i(L,ee))z[De]=ee,z[Te]=L,Te=De;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var ee=z[0],Te=z.pop();if(Te!==ee){z[0]=Te;e:for(var De=0,L=z.length,F=L>>>1;De<F;){var se=2*(De+1)-1,O=z[se],ke=se+1,Ae=z[ke];if(0>i(O,Te))ke<L&&0>i(Ae,O)?(z[De]=Ae,z[ke]=Te,De=ke):(z[De]=O,z[se]=Te,De=se);else if(ke<L&&0>i(Ae,Te))z[De]=Ae,z[ke]=Te,De=ke;else break e}}return ee}function i(z,ee){var Te=z.sortIndex-ee.sortIndex;return Te!==0?Te:z.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],m=[],p=1,g=null,y=3,E=!1,v=!1,w=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function H(z){for(var ee=n(m);ee!==null;){if(ee.callback===null)r(m);else if(ee.startTime<=z)r(m),ee.sortIndex=ee.expirationTime,t(d,ee);else break;ee=n(m)}}function $(z){if(w=!1,H(z),!v)if(n(d)!==null)v=!0,U||(U=!0,V());else{var ee=n(m);ee!==null&&ne($,ee.startTime-z)}}var U=!1,P=-1,Y=5,fe=-1;function M(){return C?!0:!(e.unstable_now()-fe<Y)}function K(){if(C=!1,U){var z=e.unstable_now();fe=z;var ee=!0;try{e:{v=!1,w&&(w=!1,N(P),P=-1),E=!0;var Te=y;try{t:{for(H(z),g=n(d);g!==null&&!(g.expirationTime>z&&M());){var De=g.callback;if(typeof De=="function"){g.callback=null,y=g.priorityLevel;var L=De(g.expirationTime<=z);if(z=e.unstable_now(),typeof L=="function"){g.callback=L,H(z),ee=!0;break t}g===n(d)&&r(d),H(z)}else r(d);g=n(d)}if(g!==null)ee=!0;else{var F=n(m);F!==null&&ne($,F.startTime-z),ee=!1}}break e}finally{g=null,y=Te,E=!1}ee=void 0}}finally{ee?V():U=!1}}}var V;if(typeof A=="function")V=function(){A(K)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,de=he.port2;he.port1.onmessage=K,V=function(){de.postMessage(null)}}else V=function(){S(K,0)};function ne(z,ee){P=S(function(){z(e.unstable_now())},ee)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(z){switch(y){case 1:case 2:case 3:var ee=3;break;default:ee=y}var Te=y;y=ee;try{return z()}finally{y=Te}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,ee){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var Te=y;y=z;try{return ee()}finally{y=Te}},e.unstable_scheduleCallback=function(z,ee,Te){var De=e.unstable_now();switch(typeof Te=="object"&&Te!==null?(Te=Te.delay,Te=typeof Te=="number"&&0<Te?De+Te:De):Te=De,z){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=Te+L,z={id:p++,callback:ee,priorityLevel:z,startTime:Te,expirationTime:L,sortIndex:-1},Te>De?(z.sortIndex=Te,t(m,z),n(d)===null&&z===n(m)&&(w?(N(P),P=-1):w=!0,ne($,Te-De))):(z.sortIndex=L,t(d,z),v||E||(v=!0,U||(U=!0,V()))),z},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(z){var ee=y;return function(){var Te=y;y=ee;try{return z.apply(this,arguments)}finally{y=Te}}}})(Yp)),Yp}var FE;function iA(){return FE||(FE=1,qp.exports=sA()),qp.exports}var Wp={exports:{}},br={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var $E;function lA(){if($E)return br;$E=1;var e=Kg();function t(d){var m="https://react.dev/errors/"+d;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(d,m,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:d,containerInfo:m,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,m){if(d==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return br.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,br.createPortal=function(d,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return l(d,m,null,p)},br.flushSync=function(d){var m=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=m,r.p=p,r.d.f()}},br.preconnect=function(d,m){typeof d=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(d,m))},br.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},br.preinit=function(d,m){if(typeof d=="string"&&m&&typeof m.as=="string"){var p=m.as,g=c(p,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,E=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?r.d.S(d,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:E}):p==="script"&&r.d.X(d,{crossOrigin:g,integrity:y,fetchPriority:E,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},br.preinitModule=function(d,m){if(typeof d=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=c(m.as,m.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(d)},br.preload=function(d,m){if(typeof d=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,g=c(p,m.crossOrigin);r.d.L(d,p,{crossOrigin:g,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})}},br.preloadModule=function(d,m){if(typeof d=="string")if(m){var p=c(m.as,m.crossOrigin);r.d.m(d,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(d)},br.requestFormReset=function(d){r.d.r(d)},br.unstable_batchedUpdates=function(d,m){return d(m)},br.useFormState=function(d,m,p){return o.H.useFormState(d,m,p)},br.useFormStatus=function(){return o.H.useHostTransitionStatus()},br.version="19.2.5",br}var VE;function mv(){if(VE)return Wp.exports;VE=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(t){console.error(t)}}return e(),Wp.exports=lA(),Wp.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var GE;function oA(){if(GE)return Yu;GE=1;var e=iA(),t=Kg(),n=mv();function r(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var s=a,u=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(u=s.return),a=s.return;while(a)}return s.tag===3?u:null}function o(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function c(a){if(a.tag===31){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function d(a){if(l(a)!==a)throw Error(r(188))}function m(a){var s=a.alternate;if(!s){if(s=l(a),s===null)throw Error(r(188));return s!==a?null:a}for(var u=a,h=s;;){var b=u.return;if(b===null)break;var x=b.alternate;if(x===null){if(h=b.return,h!==null){u=h;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===u)return d(b),a;if(x===h)return d(b),s;x=x.sibling}throw Error(r(188))}if(u.return!==h.return)u=b,h=x;else{for(var k=!1,R=b.child;R;){if(R===u){k=!0,u=b,h=x;break}if(R===h){k=!0,h=b,u=x;break}R=R.sibling}if(!k){for(R=x.child;R;){if(R===u){k=!0,u=x,h=b;break}if(R===h){k=!0,h=x,u=b;break}R=R.sibling}if(!k)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:s}function p(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=p(a),s!==null)return s;a=a.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function V(a){return a===null||typeof a!="object"?null:(a=K&&a[K]||a["@@iterator"],typeof a=="function"?a:null)}var he=Symbol.for("react.client.reference");function de(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===he?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case w:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case $:return"Suspense";case U:return"SuspenseList";case fe:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case A:return a.displayName||"Context";case N:return(a._context.displayName||"Context")+".Consumer";case H:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case P:return s=a.displayName||null,s!==null?s:de(a.type)||"Memo";case Y:s=a._payload,a=a._init;try{return de(a(s))}catch{}}return null}var ne=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Te={pending:!1,data:null,method:null,action:null},De=[],L=-1;function F(a){return{current:a}}function se(a){0>L||(a.current=De[L],De[L]=null,L--)}function O(a,s){L++,De[L]=a.current,a.current=s}var ke=F(null),Ae=F(null),_e=F(null),et=F(null);function st(a,s){switch(O(_e,s),O(Ae,a),O(ke,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?aE(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=aE(s),a=sE(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}se(ke),O(ke,a)}function Me(){se(ke),se(Ae),se(_e)}function dt(a){a.memoizedState!==null&&O(et,a);var s=ke.current,u=sE(s,a.type);s!==u&&(O(Ae,a),O(ke,u))}function pt(a){Ae.current===a&&(se(ke),se(Ae)),et.current===a&&(se(et),Fu._currentValue=Te)}var Dt,kn;function bt(a){if(Dt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);Dt=s&&s[1]||"",kn=-1<u.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+Dt+a+kn}var He=!1;function Ve(a,s){if(!a||He)return"";He=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(ce){var ie=ce}Reflect.construct(a,[],Ee)}else{try{Ee.call()}catch(ce){ie=ce}a.call(Ee.prototype)}}else{try{throw Error()}catch(ce){ie=ce}(Ee=a())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(ce){if(ce&&ie&&typeof ce.stack=="string")return[ce.stack,ie.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=h.DetermineComponentFrameRoot(),k=x[0],R=x[1];if(k&&R){var W=k.split(`
45
+ `),ae=R.split(`
46
+ `);for(b=h=0;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;for(;b<ae.length&&!ae[b].includes("DetermineComponentFrameRoot");)b++;if(h===W.length||b===ae.length)for(h=W.length-1,b=ae.length-1;1<=h&&0<=b&&W[h]!==ae[b];)b--;for(;1<=h&&0<=b;h--,b--)if(W[h]!==ae[b]){if(h!==1||b!==1)do if(h--,b--,0>b||W[h]!==ae[b]){var ge=`
47
+ `+W[h].replace(" at new "," at ");return a.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",a.displayName)),ge}while(1<=h&&0<=b);break}}}finally{He=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?bt(u):""}function Qt(a,s){switch(a.tag){case 26:case 27:case 5:return bt(a.type);case 16:return bt("Lazy");case 13:return a.child!==s&&s!==null?bt("Suspense Fallback"):bt("Suspense");case 19:return bt("SuspenseList");case 0:case 15:return Ve(a.type,!1);case 11:return Ve(a.type.render,!1);case 1:return Ve(a.type,!0);case 31:return bt("Activity");default:return""}}function at(a){try{var s="",u=null;do s+=Qt(a,u),u=a,a=a.return;while(a);return s}catch(h){return`
48
+ Error generating stack: `+h.message+`
49
+ `+h.stack}}var Ke=Object.prototype.hasOwnProperty,Ge=e.unstable_scheduleCallback,an=e.unstable_cancelCallback,xn=e.unstable_shouldYield,or=e.unstable_requestPaint,Bt=e.unstable_now,Zn=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Qe=e.unstable_NormalPriority,lt=e.unstable_LowPriority,xt=e.unstable_IdlePriority,sn=e.log,mn=e.unstable_setDisableYieldValue,xe=null,Se=null;function ze(a){if(typeof sn=="function"&&mn(a),Se&&typeof Se.setStrictMode=="function")try{Se.setStrictMode(xe,a)}catch{}}var Pe=Math.clz32?Math.clz32:be,Ze=Math.log,Q=Math.LN2;function be(a){return a>>>=0,a===0?32:31-(Ze(a)/Q|0)|0}var ot=256,je=262144,Fe=4194304;function nt(a){var s=a&42;if(s!==0)return s;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function zt(a,s,u){var h=a.pendingLanes;if(h===0)return 0;var b=0,x=a.suspendedLanes,k=a.pingedLanes;a=a.warmLanes;var R=h&134217727;return R!==0?(h=R&~x,h!==0?b=nt(h):(k&=R,k!==0?b=nt(k):u||(u=R&~a,u!==0&&(b=nt(u))))):(R=h&~x,R!==0?b=nt(R):k!==0?b=nt(k):u||(u=h&~a,u!==0&&(b=nt(u)))),b===0?0:s!==0&&s!==b&&(s&x)===0&&(x=b&-b,u=s&-s,x>=u||x===32&&(u&4194048)!==0)?s:b}function ut(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function wt(a,s){switch(a){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 pn(){var a=Fe;return Fe<<=1,(Fe&62914560)===0&&(Fe=4194304),a}function ua(a){for(var s=[],u=0;31>u;u++)s.push(a);return s}function An(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function qr(a,s,u,h,b,x){var k=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var R=a.entanglements,W=a.expirationTimes,ae=a.hiddenUpdates;for(u=k&~u;0<u;){var ge=31-Pe(u),Ee=1<<ge;R[ge]=0,W[ge]=-1;var ie=ae[ge];if(ie!==null)for(ae[ge]=null,ge=0;ge<ie.length;ge++){var ce=ie[ge];ce!==null&&(ce.lane&=-536870913)}u&=~Ee}h!==0&&Dr(a,h,0),x!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=x&~(k&~s))}function Dr(a,s,u){a.pendingLanes|=s,a.suspendedLanes&=~s;var h=31-Pe(s);a.entangledLanes|=s,a.entanglements[h]=a.entanglements[h]|1073741824|u&261930}function Xi(a,s){var u=a.entangledLanes|=s;for(a=a.entanglements;u;){var h=31-Pe(u),b=1<<h;b&s|a[h]&s&&(a[h]|=s),u&=~b}}function Jn(a,s){var u=s&-s;return u=(u&42)!==0?1:ni(u),(u&(a.suspendedLanes|s))!==0?0:u}function ni(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function er(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Ja(){var a=ee.p;return a!==0?a:(a=window.event,a===void 0?32:NE(a.type))}function vs(a,s){var u=ee.p;try{return ee.p=a,s()}finally{ee.p=u}}var ur=Math.random().toString(36).slice(2),ln="__reactFiber$"+ur,on="__reactProps$"+ur,Nt="__reactContainer$"+ur,ks="__reactEvents$"+ur,ri="__reactListeners$"+ur,jr="__reactHandles$"+ur,Ki="__reactResources$"+ur,es="__reactMarker$"+ur;function vr(a){delete a[ln],delete a[on],delete a[ks],delete a[ri],delete a[jr]}function ca(a){var s=a[ln];if(s)return s;for(var u=a.parentNode;u;){if(s=u[Nt]||u[ln]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(a=fE(a);a!==null;){if(u=a[ln])return u;a=fE(a)}return s}a=u,u=a.parentNode}return null}function cr(a){if(a=a[ln]||a[Nt]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function Da(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function ja(a){var s=a[Ki];return s||(s=a[Ki]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function un(a){a[es]=!0}var ts=new Set,tr={};function dr(a,s){da(a,s),da(a+"Capture",s)}function da(a,s){for(tr[a]=s,a=0;a<s.length;a++)ts.add(s[a])}var Zi=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]*$"),Jt={},ai={};function si(a){return Ke.call(ai,a)?!0:Ke.call(Jt,a)?!1:Zi.test(a)?ai[a]=!0:(Jt[a]=!0,!1)}function fa(a,s,u){if(si(s))if(u===null)a.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+u)}}function ns(a,s,u){if(u===null)a.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+u)}}function kr(a,s,u,h){if(h===null)a.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(s,u,""+h)}}function En(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Rn(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function lu(a,s,u){var h=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,x=h.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return b.call(this)},set:function(k){u=""+k,x.call(this,k)}}),Object.defineProperty(a,s,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(k){u=""+k},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Ma(a){if(!a._valueTracker){var s=Rn(a)?"checked":"value";a._valueTracker=lu(a,s,""+a[s])}}function en(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return a&&(h=Rn(a)?a.checked?"true":"false":a.value),a=h,a!==u?(s.setValue(a),!0):!1}function gr(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Yr=/[\n"\\]/g;function nr(a){return a.replace(Yr,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ji(a,s,u,h,b,x,k,R){a.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?a.type=k:a.removeAttribute("type"),s!=null?k==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+En(s)):a.value!==""+En(s)&&(a.value=""+En(s)):k!=="submit"&&k!=="reset"||a.removeAttribute("value"),s!=null?tl(a,k,En(s)):u!=null?tl(a,k,En(u)):h!=null&&a.removeAttribute("value"),b==null&&x!=null&&(a.defaultChecked=!!x),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?a.name=""+En(R):a.removeAttribute("name")}function el(a,s,u,h,b,x,k,R){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(a.type=x),s!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){Ma(a);return}u=u!=null?""+En(u):"",s=s!=null?""+En(s):u,R||s===a.value||(a.value=s),a.defaultValue=s}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=R?a.checked:!!h,a.defaultChecked=!!h,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(a.name=k),Ma(a)}function tl(a,s,u){s==="number"&&gr(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function ha(a,s,u,h){if(a=a.options,s){s={};for(var b=0;b<u.length;b++)s["$"+u[b]]=!0;for(u=0;u<a.length;u++)b=s.hasOwnProperty("$"+a[u].value),a[u].selected!==b&&(a[u].selected=b),b&&h&&(a[u].defaultSelected=!0)}else{for(u=""+En(u),s=null,b=0;b<a.length;b++){if(a[b].value===u){a[b].selected=!0,h&&(a[b].defaultSelected=!0);return}s!==null||a[b].disabled||(s=a[b])}s!==null&&(s.selected=!0)}}function ii(a,s,u){if(s!=null&&(s=""+En(s),s!==a.value&&(a.value=s),u==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=u!=null?""+En(u):""}function ws(a,s,u,h){if(s==null){if(h!=null){if(u!=null)throw Error(r(92));if(ne(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),s=u}u=En(s),a.defaultValue=u,h=a.textContent,h===u&&h!==""&&h!==null&&(a.value=h),Ma(a)}function wr(a,s){if(s){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=s;return}}a.textContent=s}var li=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 oi(a,s,u){var h=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":h?a.setProperty(s,u):typeof u!="number"||u===0||li.has(s)?s==="float"?a.cssFloat=u:a[s]=(""+u).trim():a[s]=u+"px"}function nl(a,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var b in s)h=s[b],s.hasOwnProperty(b)&&u[b]!==h&&oi(a,b,h)}else for(var x in s)s.hasOwnProperty(x)&&oi(a,x,s[x])}function Cs(a){if(a.indexOf("-")===-1)return!1;switch(a){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 rl=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"]]),ql=/^[\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 ui(a){return ql.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Wr(){}var Pa=null;function rs(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ba=null,Qr=null;function Yl(a){var s=cr(a);if(s&&(a=s.stateNode)){var u=a[on]||null;e:switch(a=s.stateNode,s.type){case"input":if(Ji(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+nr(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==a&&h.form===a.form){var b=h[on]||null;if(!b)throw Error(r(90));Ji(h,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<u.length;s++)h=u[s],h.form===a.form&&en(h)}break e;case"textarea":ii(a,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&ha(a,!!u.multiple,s,!1)}}}var al=!1;function Xr(a,s,u){if(al)return a(s,u);al=!0;try{var h=a(s);return h}finally{if(al=!1,(Ba!==null||Qr!==null)&&(zd(),Ba&&(s=Ba,a=Qr,Qr=Ba=null,Yl(s),a)))for(s=0;s<a.length;s++)Yl(a[s])}}function Ua(a,s){var u=a.stateNode;if(u===null)return null;var h=u[on]||null;if(h===null)return null;u=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var Cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ci=!1;if(Cr)try{var as={};Object.defineProperty(as,"passive",{get:function(){ci=!0}}),window.addEventListener("test",as,as),window.removeEventListener("test",as,as)}catch{ci=!1}var Sr=null,Ss=null,Ns=null;function q(){if(Ns)return Ns;var a,s=Ss,u=s.length,h,b="value"in Sr?Sr.value:Sr.textContent,x=b.length;for(a=0;a<u&&s[a]===b[a];a++);var k=u-a;for(h=1;h<=k&&s[u-h]===b[x-h];h++);return Ns=b.slice(a,1<h?1-h:void 0)}function Z(a){var s=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&s===13&&(a=13)):a=s,a===10&&(a=13),32<=a||a===13?a:0}function ue(){return!0}function Oe(){return!1}function Le(a){function s(u,h,b,x,k){this._reactName=u,this._targetInst=b,this.type=h,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var R in a)a.hasOwnProperty(R)&&(u=a[R],this[R]=u?u(x):x[R]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?ue:Oe,this.isPropagationStopped=Oe,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=ue)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=ue)},persist:function(){},isPersistent:ue}),s}var gt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ye=Le(gt),wn=g({},gt,{view:0,detail:0}),_n=Le(wn),Mr,Ha,Gt,Ut=g({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wl,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Gt&&(Gt&&a.type==="mousemove"?(Mr=a.screenX-Gt.screenX,Ha=a.screenY-Gt.screenY):Ha=Mr=0,Gt=a),Mr)},movementY:function(a){return"movementY"in a?a.movementY:Ha}}),Re=Le(Ut),Je=g({},Ut,{dataTransfer:0}),tt=Le(Je),Xt=g({},wn,{relatedTarget:0}),Ct=Le(Xt),Kt=g({},gt,{animationName:0,elapsedTime:0,pseudoElement:0}),Ln=Le(Kt),In=g({},gt,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),za=Le(In),ss=g({},gt,{data:0}),ou=Le(ss),Wc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qc={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"},Xc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kc(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=Xc[a])?!!s[a]:!1}function Wl(){return Kc}var Zc=g({},wn,{key:function(a){if(a.key){var s=Wc[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=Z(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Qc[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wl,charCode:function(a){return a.type==="keypress"?Z(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Z(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Jc=Le(Zc),ed=g({},Ut,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uu=Le(ed),td=g({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wl}),nd=Le(td),rd=g({},gt,{propertyName:0,elapsedTime:0,pseudoElement:0}),ad=Le(rd),I=g({},Ut,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),le=Le(I),we=g({},gt,{newState:0,oldState:0}),We=Le(we),Xe=[9,13,27,32],ht=Cr&&"CompositionEvent"in window,it=null;Cr&&"documentMode"in document&&(it=document.documentMode);var jt=Cr&&"TextEvent"in window&&!it,kt=Cr&&(!ht||it&&8<it&&11>=it),tn=" ",Hn=!1;function Ft(a,s){switch(a){case"keyup":return Xe.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ma(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var pa=!1;function sd(a,s){switch(a){case"compositionend":return ma(s);case"keypress":return s.which!==32?null:(Hn=!0,tn);case"textInput":return a=s.data,a===tn&&Hn?null:a;default:return null}}function TS(a,s){if(pa)return a==="compositionend"||!ht&&Ft(a,s)?(a=q(),Ns=Ss=Sr=null,pa=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return kt&&s.locale!=="ko"?null:s.data;default:return null}}var vS={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 pb(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!vS[a.type]:s==="textarea"}function gb(a,s,u,h){Ba?Qr?Qr.push(h):Qr=[h]:Ba=h,s=Wd(s,"onChange"),0<s.length&&(u=new Ye("onChange","change",null,u,h),a.push({event:u,listeners:s}))}var cu=null,du=null;function kS(a){Zy(a,0)}function id(a){var s=Da(a);if(en(s))return a}function bb(a,s){if(a==="change")return s}var xb=!1;if(Cr){var Wh;if(Cr){var Qh="oninput"in document;if(!Qh){var yb=document.createElement("div");yb.setAttribute("oninput","return;"),Qh=typeof yb.oninput=="function"}Wh=Qh}else Wh=!1;xb=Wh&&(!document.documentMode||9<document.documentMode)}function Eb(){cu&&(cu.detachEvent("onpropertychange",_b),du=cu=null)}function _b(a){if(a.propertyName==="value"&&id(du)){var s=[];gb(s,du,a,rs(a)),Xr(kS,s)}}function wS(a,s,u){a==="focusin"?(Eb(),cu=s,du=u,cu.attachEvent("onpropertychange",_b)):a==="focusout"&&Eb()}function CS(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return id(du)}function SS(a,s){if(a==="click")return id(s)}function NS(a,s){if(a==="input"||a==="change")return id(s)}function AS(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var Kr=typeof Object.is=="function"?Object.is:AS;function fu(a,s){if(Kr(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var u=Object.keys(a),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var b=u[h];if(!Ke.call(s,b)||!Kr(a[b],s[b]))return!1}return!0}function Tb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function vb(a,s){var u=Tb(a);a=0;for(var h;u;){if(u.nodeType===3){if(h=a+u.textContent.length,a<=s&&h>=s)return{node:u,offset:s-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Tb(u)}}function kb(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?kb(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function wb(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=gr(a.document);s instanceof a.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)a=s.contentWindow;else break;s=gr(a.document)}return s}function Xh(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}var RS=Cr&&"documentMode"in document&&11>=document.documentMode,Ql=null,Kh=null,hu=null,Zh=!1;function Cb(a,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Zh||Ql==null||Ql!==gr(h)||(h=Ql,"selectionStart"in h&&Xh(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),hu&&fu(hu,h)||(hu=h,h=Wd(Kh,"onSelect"),0<h.length&&(s=new Ye("onSelect","select",null,s,u),a.push({event:s,listeners:h}),s.target=Ql)))}function sl(a,s){var u={};return u[a.toLowerCase()]=s.toLowerCase(),u["Webkit"+a]="webkit"+s,u["Moz"+a]="moz"+s,u}var Xl={animationend:sl("Animation","AnimationEnd"),animationiteration:sl("Animation","AnimationIteration"),animationstart:sl("Animation","AnimationStart"),transitionrun:sl("Transition","TransitionRun"),transitionstart:sl("Transition","TransitionStart"),transitioncancel:sl("Transition","TransitionCancel"),transitionend:sl("Transition","TransitionEnd")},Jh={},Sb={};Cr&&(Sb=document.createElement("div").style,"AnimationEvent"in window||(delete Xl.animationend.animation,delete Xl.animationiteration.animation,delete Xl.animationstart.animation),"TransitionEvent"in window||delete Xl.transitionend.transition);function il(a){if(Jh[a])return Jh[a];if(!Xl[a])return a;var s=Xl[a],u;for(u in s)if(s.hasOwnProperty(u)&&u in Sb)return Jh[a]=s[u];return a}var Nb=il("animationend"),Ab=il("animationiteration"),Rb=il("animationstart"),LS=il("transitionrun"),IS=il("transitionstart"),OS=il("transitioncancel"),Lb=il("transitionend"),Ib=new Map,em="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(" ");em.push("scrollEnd");function Fa(a,s){Ib.set(a,s),dr(s,[a])}var ld=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=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(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},ga=[],Kl=0,tm=0;function od(){for(var a=Kl,s=tm=Kl=0;s<a;){var u=ga[s];ga[s++]=null;var h=ga[s];ga[s++]=null;var b=ga[s];ga[s++]=null;var x=ga[s];if(ga[s++]=null,h!==null&&b!==null){var k=h.pending;k===null?b.next=b:(b.next=k.next,k.next=b),h.pending=b}x!==0&&Ob(u,b,x)}}function ud(a,s,u,h){ga[Kl++]=a,ga[Kl++]=s,ga[Kl++]=u,ga[Kl++]=h,tm|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function nm(a,s,u,h){return ud(a,s,u,h),cd(a)}function ll(a,s){return ud(a,null,null,s),cd(a)}function Ob(a,s,u){a.lanes|=u;var h=a.alternate;h!==null&&(h.lanes|=u);for(var b=!1,x=a.return;x!==null;)x.childLanes|=u,h=x.alternate,h!==null&&(h.childLanes|=u),x.tag===22&&(a=x.stateNode,a===null||a._visibility&1||(b=!0)),a=x,x=x.return;return a.tag===3?(x=a.stateNode,b&&s!==null&&(b=31-Pe(u),a=x.hiddenUpdates,h=a[b],h===null?a[b]=[s]:h.push(s),s.lane=u|536870912),x):null}function cd(a){if(50<ju)throw ju=0,dp=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var Zl={};function DS(a,s,u,h){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(a,s,u,h){return new DS(a,s,u,h)}function rm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function As(a,s){var u=a.alternate;return u===null?(u=Zr(a.tag,s,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=s,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,s=a.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function Db(a,s){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=s,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,s=u.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function dd(a,s,u,h,b,x){var k=0;if(h=a,typeof a=="function")rm(a)&&(k=1);else if(typeof a=="string")k=UN(a,u,ke.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case fe:return a=Zr(31,u,s,b),a.elementType=fe,a.lanes=x,a;case w:return ol(u.children,b,x,s);case C:k=8,b|=24;break;case S:return a=Zr(12,u,s,b|2),a.elementType=S,a.lanes=x,a;case $:return a=Zr(13,u,s,b),a.elementType=$,a.lanes=x,a;case U:return a=Zr(19,u,s,b),a.elementType=U,a.lanes=x,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case A:k=10;break e;case N:k=9;break e;case H:k=11;break e;case P:k=14;break e;case Y:k=16,h=null;break e}k=29,u=Error(r(130,a===null?"null":typeof a,"")),h=null}return s=Zr(k,u,s,b),s.elementType=a,s.type=h,s.lanes=x,s}function ol(a,s,u,h){return a=Zr(7,a,h,s),a.lanes=u,a}function am(a,s,u){return a=Zr(6,a,null,s),a.lanes=u,a}function jb(a){var s=Zr(18,null,null,0);return s.stateNode=a,s}function sm(a,s,u){return s=Zr(4,a.children!==null?a.children:[],a.key,s),s.lanes=u,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var Mb=new WeakMap;function ba(a,s){if(typeof a=="object"&&a!==null){var u=Mb.get(a);return u!==void 0?u:(s={value:a,source:s,stack:at(s)},Mb.set(a,s),s)}return{value:a,source:s,stack:at(s)}}var Jl=[],eo=0,fd=null,mu=0,xa=[],ya=0,di=null,is=1,ls="";function Rs(a,s){Jl[eo++]=mu,Jl[eo++]=fd,fd=a,mu=s}function Pb(a,s,u){xa[ya++]=is,xa[ya++]=ls,xa[ya++]=di,di=a;var h=is;a=ls;var b=32-Pe(h)-1;h&=~(1<<b),u+=1;var x=32-Pe(s)+b;if(30<x){var k=b-b%5;x=(h&(1<<k)-1).toString(32),h>>=k,b-=k,is=1<<32-Pe(s)+b|u<<b|h,ls=x+a}else is=1<<x|u<<b|h,ls=a}function im(a){a.return!==null&&(Rs(a,1),Pb(a,1,0))}function lm(a){for(;a===fd;)fd=Jl[--eo],Jl[eo]=null,mu=Jl[--eo],Jl[eo]=null;for(;a===di;)di=xa[--ya],xa[ya]=null,ls=xa[--ya],xa[ya]=null,is=xa[--ya],xa[ya]=null}function Bb(a,s){xa[ya++]=is,xa[ya++]=ls,xa[ya++]=di,is=s.id,ls=s.overflow,di=a}var fr=null,Tn=null,Ht=!1,fi=null,Ea=!1,om=Error(r(519));function hi(a){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pu(ba(s,a)),om}function Ub(a){var s=a.stateNode,u=a.type,h=a.memoizedProps;switch(s[ln]=a,s[on]=h,u){case"dialog":It("cancel",s),It("close",s);break;case"iframe":case"object":case"embed":It("load",s);break;case"video":case"audio":for(u=0;u<Pu.length;u++)It(Pu[u],s);break;case"source":It("error",s);break;case"img":case"image":case"link":It("error",s),It("load",s);break;case"details":It("toggle",s);break;case"input":It("invalid",s),el(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":It("invalid",s);break;case"textarea":It("invalid",s),ws(s,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||h.suppressHydrationWarning===!0||nE(s.textContent,u)?(h.popover!=null&&(It("beforetoggle",s),It("toggle",s)),h.onScroll!=null&&It("scroll",s),h.onScrollEnd!=null&&It("scrollend",s),h.onClick!=null&&(s.onclick=Wr),s=!0):s=!1,s||hi(a,!0)}function Hb(a){for(fr=a.return;fr;)switch(fr.tag){case 5:case 31:case 13:Ea=!1;return;case 27:case 3:Ea=!0;return;default:fr=fr.return}}function to(a){if(a!==fr)return!1;if(!Ht)return Hb(a),Ht=!0,!1;var s=a.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Cp(a.type,a.memoizedProps)),u=!u),u&&Tn&&hi(a),Hb(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tn=dE(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tn=dE(a)}else s===27?(s=Tn,Si(a.type)?(a=Lp,Lp=null,Tn=a):Tn=s):Tn=fr?Ta(a.stateNode.nextSibling):null;return!0}function ul(){Tn=fr=null,Ht=!1}function um(){var a=fi;return a!==null&&(Hr===null?Hr=a:Hr.push.apply(Hr,a),fi=null),a}function pu(a){fi===null?fi=[a]:fi.push(a)}var cm=F(null),cl=null,Ls=null;function mi(a,s,u){O(cm,s._currentValue),s._currentValue=u}function Is(a){a._currentValue=cm.current,se(cm)}function dm(a,s,u){for(;a!==null;){var h=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),a===u)break;a=a.return}}function fm(a,s,u,h){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var x=b.dependencies;if(x!==null){var k=b.child;x=x.firstContext;e:for(;x!==null;){var R=x;x=b;for(var W=0;W<s.length;W++)if(R.context===s[W]){x.lanes|=u,R=x.alternate,R!==null&&(R.lanes|=u),dm(x.return,u,a),h||(k=null);break e}x=R.next}}else if(b.tag===18){if(k=b.return,k===null)throw Error(r(341));k.lanes|=u,x=k.alternate,x!==null&&(x.lanes|=u),dm(k,u,a),k=null}else k=b.child;if(k!==null)k.return=b;else for(k=b;k!==null;){if(k===a){k=null;break}if(b=k.sibling,b!==null){b.return=k.return,k=b;break}k=k.return}b=k}}function no(a,s,u,h){a=null;for(var b=s,x=!1;b!==null;){if(!x){if((b.flags&524288)!==0)x=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var k=b.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var R=b.type;Kr(b.pendingProps.value,k.value)||(a!==null?a.push(R):a=[R])}}else if(b===et.current){if(k=b.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Fu):a=[Fu])}b=b.return}a!==null&&fm(s,a,u,h),s.flags|=262144}function hd(a){for(a=a.firstContext;a!==null;){if(!Kr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function dl(a){cl=a,Ls=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function hr(a){return zb(cl,a)}function md(a,s){return cl===null&&dl(a),zb(a,s)}function zb(a,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Ls===null){if(a===null)throw Error(r(308));Ls=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else Ls=Ls.next=s;return u}var jS=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(u,h){a.push(h)}};this.abort=function(){s.aborted=!0,a.forEach(function(u){return u()})}},MS=e.unstable_scheduleCallback,PS=e.unstable_NormalPriority,zn={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hm(){return{controller:new jS,data:new Map,refCount:0}}function gu(a){a.refCount--,a.refCount===0&&MS(PS,function(){a.controller.abort()})}var bu=null,mm=0,ro=0,ao=null;function BS(a,s){if(bu===null){var u=bu=[];mm=0,ro=bp(),ao={status:"pending",value:void 0,then:function(h){u.push(h)}}}return mm++,s.then(Fb,Fb),s}function Fb(){if(--mm===0&&bu!==null){ao!==null&&(ao.status="fulfilled");var a=bu;bu=null,ro=0,ao=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function US(a,s){var u=[],h={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return a.then(function(){h.status="fulfilled",h.value=s;for(var b=0;b<u.length;b++)(0,u[b])(s)},function(b){for(h.status="rejected",h.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),h}var $b=z.S;z.S=function(a,s){Cy=Bt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&BS(a,s),$b!==null&&$b(a,s)};var fl=F(null);function pm(){var a=fl.current;return a!==null?a:gn.pooledCache}function pd(a,s){s===null?O(fl,fl.current):O(fl,s.pool)}function Vb(){var a=pm();return a===null?null:{parent:zn._currentValue,pool:a}}var so=Error(r(460)),gm=Error(r(474)),gd=Error(r(542)),bd={then:function(){}};function Gb(a){return a=a.status,a==="fulfilled"||a==="rejected"}function qb(a,s,u){switch(u=a[u],u===void 0?a.push(s):u!==s&&(s.then(Wr,Wr),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,Wb(a),a;default:if(typeof s.status=="string")s.then(Wr,Wr);else{if(a=gn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(h){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=h}},function(h){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,Wb(a),a}throw ml=s,so}}function hl(a){try{var s=a._init;return s(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(ml=u,so):u}}var ml=null;function Yb(){if(ml===null)throw Error(r(459));var a=ml;return ml=null,a}function Wb(a){if(a===so||a===gd)throw Error(r(483))}var io=null,xu=0;function xd(a){var s=xu;return xu+=1,io===null&&(io=[]),qb(io,a,s)}function yu(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function yd(a,s){throw s.$$typeof===y?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function Qb(a){function s(J,X){if(a){var re=J.deletions;re===null?(J.deletions=[X],J.flags|=16):re.push(X)}}function u(J,X){if(!a)return null;for(;X!==null;)s(J,X),X=X.sibling;return null}function h(J){for(var X=new Map;J!==null;)J.key!==null?X.set(J.key,J):X.set(J.index,J),J=J.sibling;return X}function b(J,X){return J=As(J,X),J.index=0,J.sibling=null,J}function x(J,X,re){return J.index=re,a?(re=J.alternate,re!==null?(re=re.index,re<X?(J.flags|=67108866,X):re):(J.flags|=67108866,X)):(J.flags|=1048576,X)}function k(J){return a&&J.alternate===null&&(J.flags|=67108866),J}function R(J,X,re,ye){return X===null||X.tag!==6?(X=am(re,J.mode,ye),X.return=J,X):(X=b(X,re),X.return=J,X)}function W(J,X,re,ye){var rt=re.type;return rt===w?ge(J,X,re.props.children,ye,re.key):X!==null&&(X.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===Y&&hl(rt)===X.type)?(X=b(X,re.props),yu(X,re),X.return=J,X):(X=dd(re.type,re.key,re.props,null,J.mode,ye),yu(X,re),X.return=J,X)}function ae(J,X,re,ye){return X===null||X.tag!==4||X.stateNode.containerInfo!==re.containerInfo||X.stateNode.implementation!==re.implementation?(X=sm(re,J.mode,ye),X.return=J,X):(X=b(X,re.children||[]),X.return=J,X)}function ge(J,X,re,ye,rt){return X===null||X.tag!==7?(X=ol(re,J.mode,ye,rt),X.return=J,X):(X=b(X,re),X.return=J,X)}function Ee(J,X,re){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=am(""+X,J.mode,re),X.return=J,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case E:return re=dd(X.type,X.key,X.props,null,J.mode,re),yu(re,X),re.return=J,re;case v:return X=sm(X,J.mode,re),X.return=J,X;case Y:return X=hl(X),Ee(J,X,re)}if(ne(X)||V(X))return X=ol(X,J.mode,re,null),X.return=J,X;if(typeof X.then=="function")return Ee(J,xd(X),re);if(X.$$typeof===A)return Ee(J,md(J,X),re);yd(J,X)}return null}function ie(J,X,re,ye){var rt=X!==null?X.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return rt!==null?null:R(J,X,""+re,ye);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case E:return re.key===rt?W(J,X,re,ye):null;case v:return re.key===rt?ae(J,X,re,ye):null;case Y:return re=hl(re),ie(J,X,re,ye)}if(ne(re)||V(re))return rt!==null?null:ge(J,X,re,ye,null);if(typeof re.then=="function")return ie(J,X,xd(re),ye);if(re.$$typeof===A)return ie(J,X,md(J,re),ye);yd(J,re)}return null}function ce(J,X,re,ye,rt){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return J=J.get(re)||null,R(X,J,""+ye,rt);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case E:return J=J.get(ye.key===null?re:ye.key)||null,W(X,J,ye,rt);case v:return J=J.get(ye.key===null?re:ye.key)||null,ae(X,J,ye,rt);case Y:return ye=hl(ye),ce(J,X,re,ye,rt)}if(ne(ye)||V(ye))return J=J.get(re)||null,ge(X,J,ye,rt,null);if(typeof ye.then=="function")return ce(J,X,re,xd(ye),rt);if(ye.$$typeof===A)return ce(J,X,re,md(X,ye),rt);yd(X,ye)}return null}function Be(J,X,re,ye){for(var rt=null,qt=null,qe=X,Tt=X=0,Pt=null;qe!==null&&Tt<re.length;Tt++){qe.index>Tt?(Pt=qe,qe=null):Pt=qe.sibling;var Yt=ie(J,qe,re[Tt],ye);if(Yt===null){qe===null&&(qe=Pt);break}a&&qe&&Yt.alternate===null&&s(J,qe),X=x(Yt,X,Tt),qt===null?rt=Yt:qt.sibling=Yt,qt=Yt,qe=Pt}if(Tt===re.length)return u(J,qe),Ht&&Rs(J,Tt),rt;if(qe===null){for(;Tt<re.length;Tt++)qe=Ee(J,re[Tt],ye),qe!==null&&(X=x(qe,X,Tt),qt===null?rt=qe:qt.sibling=qe,qt=qe);return Ht&&Rs(J,Tt),rt}for(qe=h(qe);Tt<re.length;Tt++)Pt=ce(qe,J,Tt,re[Tt],ye),Pt!==null&&(a&&Pt.alternate!==null&&qe.delete(Pt.key===null?Tt:Pt.key),X=x(Pt,X,Tt),qt===null?rt=Pt:qt.sibling=Pt,qt=Pt);return a&&qe.forEach(function(Ii){return s(J,Ii)}),Ht&&Rs(J,Tt),rt}function ft(J,X,re,ye){if(re==null)throw Error(r(151));for(var rt=null,qt=null,qe=X,Tt=X=0,Pt=null,Yt=re.next();qe!==null&&!Yt.done;Tt++,Yt=re.next()){qe.index>Tt?(Pt=qe,qe=null):Pt=qe.sibling;var Ii=ie(J,qe,Yt.value,ye);if(Ii===null){qe===null&&(qe=Pt);break}a&&qe&&Ii.alternate===null&&s(J,qe),X=x(Ii,X,Tt),qt===null?rt=Ii:qt.sibling=Ii,qt=Ii,qe=Pt}if(Yt.done)return u(J,qe),Ht&&Rs(J,Tt),rt;if(qe===null){for(;!Yt.done;Tt++,Yt=re.next())Yt=Ee(J,Yt.value,ye),Yt!==null&&(X=x(Yt,X,Tt),qt===null?rt=Yt:qt.sibling=Yt,qt=Yt);return Ht&&Rs(J,Tt),rt}for(qe=h(qe);!Yt.done;Tt++,Yt=re.next())Yt=ce(qe,J,Tt,Yt.value,ye),Yt!==null&&(a&&Yt.alternate!==null&&qe.delete(Yt.key===null?Tt:Yt.key),X=x(Yt,X,Tt),qt===null?rt=Yt:qt.sibling=Yt,qt=Yt);return a&&qe.forEach(function(XN){return s(J,XN)}),Ht&&Rs(J,Tt),rt}function fn(J,X,re,ye){if(typeof re=="object"&&re!==null&&re.type===w&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case E:e:{for(var rt=re.key;X!==null;){if(X.key===rt){if(rt=re.type,rt===w){if(X.tag===7){u(J,X.sibling),ye=b(X,re.props.children),ye.return=J,J=ye;break e}}else if(X.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===Y&&hl(rt)===X.type){u(J,X.sibling),ye=b(X,re.props),yu(ye,re),ye.return=J,J=ye;break e}u(J,X);break}else s(J,X);X=X.sibling}re.type===w?(ye=ol(re.props.children,J.mode,ye,re.key),ye.return=J,J=ye):(ye=dd(re.type,re.key,re.props,null,J.mode,ye),yu(ye,re),ye.return=J,J=ye)}return k(J);case v:e:{for(rt=re.key;X!==null;){if(X.key===rt)if(X.tag===4&&X.stateNode.containerInfo===re.containerInfo&&X.stateNode.implementation===re.implementation){u(J,X.sibling),ye=b(X,re.children||[]),ye.return=J,J=ye;break e}else{u(J,X);break}else s(J,X);X=X.sibling}ye=sm(re,J.mode,ye),ye.return=J,J=ye}return k(J);case Y:return re=hl(re),fn(J,X,re,ye)}if(ne(re))return Be(J,X,re,ye);if(V(re)){if(rt=V(re),typeof rt!="function")throw Error(r(150));return re=rt.call(re),ft(J,X,re,ye)}if(typeof re.then=="function")return fn(J,X,xd(re),ye);if(re.$$typeof===A)return fn(J,X,md(J,re),ye);yd(J,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,X!==null&&X.tag===6?(u(J,X.sibling),ye=b(X,re),ye.return=J,J=ye):(u(J,X),ye=am(re,J.mode,ye),ye.return=J,J=ye),k(J)):u(J,X)}return function(J,X,re,ye){try{xu=0;var rt=fn(J,X,re,ye);return io=null,rt}catch(qe){if(qe===so||qe===gd)throw qe;var qt=Zr(29,qe,null,J.mode);return qt.lanes=ye,qt.return=J,qt}finally{}}}var pl=Qb(!0),Xb=Qb(!1),pi=!1;function bm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xm(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function gi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function bi(a,s,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(Zt&2)!==0){var b=h.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),h.pending=s,s=cd(a),Ob(a,null,u),s}return ud(a,h,s,u),cd(a)}function Eu(a,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var h=s.lanes;h&=a.pendingLanes,u|=h,s.lanes=u,Xi(a,u)}}function ym(a,s){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var b=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var k={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?b=x=k:x=x.next=k,u=u.next}while(u!==null);x===null?b=x=s:x=x.next=s}else b=x=s;u={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=s:a.next=s,u.lastBaseUpdate=s}var Em=!1;function _u(){if(Em){var a=ao;if(a!==null)throw a}}function Tu(a,s,u,h){Em=!1;var b=a.updateQueue;pi=!1;var x=b.firstBaseUpdate,k=b.lastBaseUpdate,R=b.shared.pending;if(R!==null){b.shared.pending=null;var W=R,ae=W.next;W.next=null,k===null?x=ae:k.next=ae,k=W;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,R=ge.lastBaseUpdate,R!==k&&(R===null?ge.firstBaseUpdate=ae:R.next=ae,ge.lastBaseUpdate=W))}if(x!==null){var Ee=b.baseState;k=0,ge=ae=W=null,R=x;do{var ie=R.lane&-536870913,ce=ie!==R.lane;if(ce?(Mt&ie)===ie:(h&ie)===ie){ie!==0&&ie===ro&&(Em=!0),ge!==null&&(ge=ge.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Be=a,ft=R;ie=s;var fn=u;switch(ft.tag){case 1:if(Be=ft.payload,typeof Be=="function"){Ee=Be.call(fn,Ee,ie);break e}Ee=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=ft.payload,ie=typeof Be=="function"?Be.call(fn,Ee,ie):Be,ie==null)break e;Ee=g({},Ee,ie);break e;case 2:pi=!0}}ie=R.callback,ie!==null&&(a.flags|=64,ce&&(a.flags|=8192),ce=b.callbacks,ce===null?b.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ge===null?(ae=ge=ce,W=Ee):ge=ge.next=ce,k|=ie;if(R=R.next,R===null){if(R=b.shared.pending,R===null)break;ce=R,R=ce.next,ce.next=null,b.lastBaseUpdate=ce,b.shared.pending=null}}while(!0);ge===null&&(W=Ee),b.baseState=W,b.firstBaseUpdate=ae,b.lastBaseUpdate=ge,x===null&&(b.shared.lanes=0),Ti|=k,a.lanes=k,a.memoizedState=Ee}}function Kb(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function Zb(a,s){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)Kb(u[a],s)}var lo=F(null),Ed=F(0);function Jb(a,s){a=zs,O(Ed,a),O(lo,s),zs=a|s.baseLanes}function _m(){O(Ed,zs),O(lo,lo.current)}function Tm(){zs=Ed.current,se(lo),se(Ed)}var Jr=F(null),_a=null;function xi(a){var s=a.alternate;O(Mn,Mn.current&1),O(Jr,a),_a===null&&(s===null||lo.current!==null||s.memoizedState!==null)&&(_a=a)}function vm(a){O(Mn,Mn.current),O(Jr,a),_a===null&&(_a=a)}function ex(a){a.tag===22?(O(Mn,Mn.current),O(Jr,a),_a===null&&(_a=a)):yi()}function yi(){O(Mn,Mn.current),O(Jr,Jr.current)}function ea(a){se(Jr),_a===a&&(_a=null),se(Mn)}var Mn=F(0);function _d(a){for(var s=a;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Ap(u)||Rp(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Os=0,_t=null,cn=null,Fn=null,Td=!1,oo=!1,gl=!1,vd=0,vu=0,uo=null,HS=0;function On(){throw Error(r(321))}function km(a,s){if(s===null)return!1;for(var u=0;u<s.length&&u<a.length;u++)if(!Kr(a[u],s[u]))return!1;return!0}function wm(a,s,u,h,b,x){return Os=x,_t=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,z.H=a===null||a.memoizedState===null?Px:Hm,gl=!1,x=u(h,b),gl=!1,oo&&(x=nx(s,u,h,b)),tx(a),x}function tx(a){z.H=Cu;var s=cn!==null&&cn.next!==null;if(Os=0,Fn=cn=_t=null,Td=!1,vu=0,uo=null,s)throw Error(r(300));a===null||$n||(a=a.dependencies,a!==null&&hd(a)&&($n=!0))}function nx(a,s,u,h){_t=a;var b=0;do{if(oo&&(uo=null),vu=0,oo=!1,25<=b)throw Error(r(301));if(b+=1,Fn=cn=null,a.updateQueue!=null){var x=a.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}z.H=Bx,x=s(u,h)}while(oo);return x}function zS(){var a=z.H,s=a.useState()[0];return s=typeof s.then=="function"?ku(s):s,a=a.useState()[0],(cn!==null?cn.memoizedState:null)!==a&&(_t.flags|=1024),s}function Cm(){var a=vd!==0;return vd=0,a}function Sm(a,s,u){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~u}function Nm(a){if(Td){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}Td=!1}Os=0,Fn=cn=_t=null,oo=!1,vu=vd=0,uo=null}function Nr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fn===null?_t.memoizedState=Fn=a:Fn=Fn.next=a,Fn}function Pn(){if(cn===null){var a=_t.alternate;a=a!==null?a.memoizedState:null}else a=cn.next;var s=Fn===null?_t.memoizedState:Fn.next;if(s!==null)Fn=s,cn=a;else{if(a===null)throw _t.alternate===null?Error(r(467)):Error(r(310));cn=a,a={memoizedState:cn.memoizedState,baseState:cn.baseState,baseQueue:cn.baseQueue,queue:cn.queue,next:null},Fn===null?_t.memoizedState=Fn=a:Fn=Fn.next=a}return Fn}function kd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ku(a){var s=vu;return vu+=1,uo===null&&(uo=[]),a=qb(uo,a,s),s=_t,(Fn===null?s.memoizedState:Fn.next)===null&&(s=s.alternate,z.H=s===null||s.memoizedState===null?Px:Hm),a}function wd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return ku(a);if(a.$$typeof===A)return hr(a)}throw Error(r(438,String(a)))}function Am(a){var s=null,u=_t.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var h=_t.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=kd(),_t.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(a),h=0;h<a;h++)u[h]=M;return s.index++,u}function Ds(a,s){return typeof s=="function"?s(a):s}function Cd(a){var s=Pn();return Rm(s,cn,a)}function Rm(a,s,u){var h=a.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var b=a.baseQueue,x=h.pending;if(x!==null){if(b!==null){var k=b.next;b.next=x.next,x.next=k}s.baseQueue=b=x,h.pending=null}if(x=a.baseState,b===null)a.memoizedState=x;else{s=b.next;var R=k=null,W=null,ae=s,ge=!1;do{var Ee=ae.lane&-536870913;if(Ee!==ae.lane?(Mt&Ee)===Ee:(Os&Ee)===Ee){var ie=ae.revertLane;if(ie===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),Ee===ro&&(ge=!0);else if((Os&ie)===ie){ae=ae.next,ie===ro&&(ge=!0);continue}else Ee={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},W===null?(R=W=Ee,k=x):W=W.next=Ee,_t.lanes|=ie,Ti|=ie;Ee=ae.action,gl&&u(x,Ee),x=ae.hasEagerState?ae.eagerState:u(x,Ee)}else ie={lane:Ee,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},W===null?(R=W=ie,k=x):W=W.next=ie,_t.lanes|=Ee,Ti|=Ee;ae=ae.next}while(ae!==null&&ae!==s);if(W===null?k=x:W.next=R,!Kr(x,a.memoizedState)&&($n=!0,ge&&(u=ao,u!==null)))throw u;a.memoizedState=x,a.baseState=k,a.baseQueue=W,h.lastRenderedState=x}return b===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function Lm(a){var s=Pn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var h=u.dispatch,b=u.pending,x=s.memoizedState;if(b!==null){u.pending=null;var k=b=b.next;do x=a(x,k.action),k=k.next;while(k!==b);Kr(x,s.memoizedState)||($n=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,h]}function rx(a,s,u){var h=_t,b=Pn(),x=Ht;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var k=!Kr((cn||b).memoizedState,u);if(k&&(b.memoizedState=u,$n=!0),b=b.queue,Dm(ix.bind(null,h,b,a),[a]),b.getSnapshot!==s||k||Fn!==null&&Fn.memoizedState.tag&1){if(h.flags|=2048,co(9,{destroy:void 0},sx.bind(null,h,b,u,s),null),gn===null)throw Error(r(349));x||(Os&127)!==0||ax(h,s,u)}return u}function ax(a,s,u){a.flags|=16384,a={getSnapshot:s,value:u},s=_t.updateQueue,s===null?(s=kd(),_t.updateQueue=s,s.stores=[a]):(u=s.stores,u===null?s.stores=[a]:u.push(a))}function sx(a,s,u,h){s.value=u,s.getSnapshot=h,lx(s)&&ox(a)}function ix(a,s,u){return u(function(){lx(s)&&ox(a)})}function lx(a){var s=a.getSnapshot;a=a.value;try{var u=s();return!Kr(a,u)}catch{return!0}}function ox(a){var s=ll(a,2);s!==null&&zr(s,a,2)}function Im(a){var s=Nr();if(typeof a=="function"){var u=a;if(a=u(),gl){ze(!0);try{u()}finally{ze(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:a},s}function ux(a,s,u,h){return a.baseState=u,Rm(a,cn,typeof h=="function"?h:Ds)}function FS(a,s,u,h,b){if(Ad(a))throw Error(r(485));if(a=s.action,a!==null){var x={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){x.listeners.push(k)}};z.T!==null?u(!0):x.isTransition=!1,h(x),u=s.pending,u===null?(x.next=s.pending=x,cx(s,x)):(x.next=u.next,s.pending=u.next=x)}}function cx(a,s){var u=s.action,h=s.payload,b=a.state;if(s.isTransition){var x=z.T,k={};z.T=k;try{var R=u(b,h),W=z.S;W!==null&&W(k,R),dx(a,s,R)}catch(ae){Om(a,s,ae)}finally{x!==null&&k.types!==null&&(x.types=k.types),z.T=x}}else try{x=u(b,h),dx(a,s,x)}catch(ae){Om(a,s,ae)}}function dx(a,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){fx(a,s,h)},function(h){return Om(a,s,h)}):fx(a,s,u)}function fx(a,s,u){s.status="fulfilled",s.value=u,hx(s),a.state=u,s=a.pending,s!==null&&(u=s.next,u===s?a.pending=null:(u=u.next,s.next=u,cx(a,u)))}function Om(a,s,u){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=u,hx(s),s=s.next;while(s!==h)}a.action=null}function hx(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function mx(a,s){return s}function px(a,s){if(Ht){var u=gn.formState;if(u!==null){e:{var h=_t;if(Ht){if(Tn){t:{for(var b=Tn,x=Ea;b.nodeType!==8;){if(!x){b=null;break t}if(b=Ta(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){Tn=Ta(b.nextSibling),h=b.data==="F!";break e}}hi(h)}h=!1}h&&(s=u[0])}}return u=Nr(),u.memoizedState=u.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mx,lastRenderedState:s},u.queue=h,u=Dx.bind(null,_t,h),h.dispatch=u,h=Im(!1),x=Um.bind(null,_t,!1,h.queue),h=Nr(),b={state:s,dispatch:null,action:a,pending:null},h.queue=b,u=FS.bind(null,_t,b,x,u),b.dispatch=u,h.memoizedState=a,[s,u,!1]}function gx(a){var s=Pn();return bx(s,cn,a)}function bx(a,s,u){if(s=Rm(a,s,mx)[0],a=Cd(Ds)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=ku(s)}catch(k){throw k===so?gd:k}else h=s;s=Pn();var b=s.queue,x=b.dispatch;return u!==s.memoizedState&&(_t.flags|=2048,co(9,{destroy:void 0},$S.bind(null,b,u),null)),[h,x,a]}function $S(a,s){a.action=s}function xx(a){var s=Pn(),u=cn;if(u!==null)return bx(s,u,a);Pn(),s=s.memoizedState,u=Pn();var h=u.queue.dispatch;return u.memoizedState=a,[s,h,!1]}function co(a,s,u,h){return a={tag:a,create:u,deps:h,inst:s,next:null},s=_t.updateQueue,s===null&&(s=kd(),_t.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=a.next=a:(h=u.next,u.next=a,a.next=h,s.lastEffect=a),a}function yx(){return Pn().memoizedState}function Sd(a,s,u,h){var b=Nr();_t.flags|=a,b.memoizedState=co(1|s,{destroy:void 0},u,h===void 0?null:h)}function Nd(a,s,u,h){var b=Pn();h=h===void 0?null:h;var x=b.memoizedState.inst;cn!==null&&h!==null&&km(h,cn.memoizedState.deps)?b.memoizedState=co(s,x,u,h):(_t.flags|=a,b.memoizedState=co(1|s,x,u,h))}function Ex(a,s){Sd(8390656,8,a,s)}function Dm(a,s){Nd(2048,8,a,s)}function VS(a){_t.flags|=4;var s=_t.updateQueue;if(s===null)s=kd(),_t.updateQueue=s,s.events=[a];else{var u=s.events;u===null?s.events=[a]:u.push(a)}}function _x(a){var s=Pn().memoizedState;return VS({ref:s,nextImpl:a}),function(){if((Zt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Tx(a,s){return Nd(4,2,a,s)}function vx(a,s){return Nd(4,4,a,s)}function kx(a,s){if(typeof s=="function"){a=a();var u=s(a);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function wx(a,s,u){u=u!=null?u.concat([a]):null,Nd(4,4,kx.bind(null,s,a),u)}function jm(){}function Cx(a,s){var u=Pn();s=s===void 0?null:s;var h=u.memoizedState;return s!==null&&km(s,h[1])?h[0]:(u.memoizedState=[a,s],a)}function Sx(a,s){var u=Pn();s=s===void 0?null:s;var h=u.memoizedState;if(s!==null&&km(s,h[1]))return h[0];if(h=a(),gl){ze(!0);try{a()}finally{ze(!1)}}return u.memoizedState=[h,s],h}function Mm(a,s,u){return u===void 0||(Os&1073741824)!==0&&(Mt&261930)===0?a.memoizedState=s:(a.memoizedState=u,a=Ny(),_t.lanes|=a,Ti|=a,u)}function Nx(a,s,u,h){return Kr(u,s)?u:lo.current!==null?(a=Mm(a,u,h),Kr(a,s)||($n=!0),a):(Os&42)===0||(Os&1073741824)!==0&&(Mt&261930)===0?($n=!0,a.memoizedState=u):(a=Ny(),_t.lanes|=a,Ti|=a,s)}function Ax(a,s,u,h,b){var x=ee.p;ee.p=x!==0&&8>x?x:8;var k=z.T,R={};z.T=R,Um(a,!1,s,u);try{var W=b(),ae=z.S;if(ae!==null&&ae(R,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var ge=US(W,h);wu(a,s,ge,ra(a))}else wu(a,s,h,ra(a))}catch(Ee){wu(a,s,{then:function(){},status:"rejected",reason:Ee},ra())}finally{ee.p=x,k!==null&&R.types!==null&&(k.types=R.types),z.T=k}}function GS(){}function Pm(a,s,u,h){if(a.tag!==5)throw Error(r(476));var b=Rx(a).queue;Ax(a,b,s,Te,u===null?GS:function(){return Lx(a),u(h)})}function Rx(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:Te,baseState:Te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:Te},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:u},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function Lx(a){var s=Rx(a);s.next===null&&(s=a.alternate.memoizedState),wu(a,s.next.queue,{},ra())}function Bm(){return hr(Fu)}function Ix(){return Pn().memoizedState}function Ox(){return Pn().memoizedState}function qS(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var u=ra();a=gi(u);var h=bi(s,a,u);h!==null&&(zr(h,s,u),Eu(h,s,u)),s={cache:hm()},a.payload=s;return}s=s.return}}function YS(a,s,u){var h=ra();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ad(a)?jx(s,u):(u=nm(a,s,u,h),u!==null&&(zr(u,a,h),Mx(u,s,h)))}function Dx(a,s,u){var h=ra();wu(a,s,u,h)}function wu(a,s,u,h){var b={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Ad(a))jx(s,b);else{var x=a.alternate;if(a.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var k=s.lastRenderedState,R=x(k,u);if(b.hasEagerState=!0,b.eagerState=R,Kr(R,k))return ud(a,s,b,0),gn===null&&od(),!1}catch{}finally{}if(u=nm(a,s,b,h),u!==null)return zr(u,a,h),Mx(u,s,h),!0}return!1}function Um(a,s,u,h){if(h={lane:2,revertLane:bp(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Ad(a)){if(s)throw Error(r(479))}else s=nm(a,u,h,2),s!==null&&zr(s,a,2)}function Ad(a){var s=a.alternate;return a===_t||s!==null&&s===_t}function jx(a,s){oo=Td=!0;var u=a.pending;u===null?s.next=s:(s.next=u.next,u.next=s),a.pending=s}function Mx(a,s,u){if((u&4194048)!==0){var h=s.lanes;h&=a.pendingLanes,u|=h,s.lanes=u,Xi(a,u)}}var Cu={readContext:hr,use:wd,useCallback:On,useContext:On,useEffect:On,useImperativeHandle:On,useLayoutEffect:On,useInsertionEffect:On,useMemo:On,useReducer:On,useRef:On,useState:On,useDebugValue:On,useDeferredValue:On,useTransition:On,useSyncExternalStore:On,useId:On,useHostTransitionStatus:On,useFormState:On,useActionState:On,useOptimistic:On,useMemoCache:On,useCacheRefresh:On};Cu.useEffectEvent=On;var Px={readContext:hr,use:wd,useCallback:function(a,s){return Nr().memoizedState=[a,s===void 0?null:s],a},useContext:hr,useEffect:Ex,useImperativeHandle:function(a,s,u){u=u!=null?u.concat([a]):null,Sd(4194308,4,kx.bind(null,s,a),u)},useLayoutEffect:function(a,s){return Sd(4194308,4,a,s)},useInsertionEffect:function(a,s){Sd(4,2,a,s)},useMemo:function(a,s){var u=Nr();s=s===void 0?null:s;var h=a();if(gl){ze(!0);try{a()}finally{ze(!1)}}return u.memoizedState=[h,s],h},useReducer:function(a,s,u){var h=Nr();if(u!==void 0){var b=u(s);if(gl){ze(!0);try{u(s)}finally{ze(!1)}}}else b=s;return h.memoizedState=h.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},h.queue=a,a=a.dispatch=YS.bind(null,_t,a),[h.memoizedState,a]},useRef:function(a){var s=Nr();return a={current:a},s.memoizedState=a},useState:function(a){a=Im(a);var s=a.queue,u=Dx.bind(null,_t,s);return s.dispatch=u,[a.memoizedState,u]},useDebugValue:jm,useDeferredValue:function(a,s){var u=Nr();return Mm(u,a,s)},useTransition:function(){var a=Im(!1);return a=Ax.bind(null,_t,a.queue,!0,!1),Nr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,u){var h=_t,b=Nr();if(Ht){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),gn===null)throw Error(r(349));(Mt&127)!==0||ax(h,s,u)}b.memoizedState=u;var x={value:u,getSnapshot:s};return b.queue=x,Ex(ix.bind(null,h,x,a),[a]),h.flags|=2048,co(9,{destroy:void 0},sx.bind(null,h,x,u,s),null),u},useId:function(){var a=Nr(),s=gn.identifierPrefix;if(Ht){var u=ls,h=is;u=(h&~(1<<32-Pe(h)-1)).toString(32)+u,s="_"+s+"R_"+u,u=vd++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=HS++,s="_"+s+"r_"+u.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:Bm,useFormState:px,useActionState:px,useOptimistic:function(a){var s=Nr();s.memoizedState=s.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Um.bind(null,_t,!0,u),u.dispatch=s,[a,s]},useMemoCache:Am,useCacheRefresh:function(){return Nr().memoizedState=qS.bind(null,_t)},useEffectEvent:function(a){var s=Nr(),u={impl:a};return s.memoizedState=u,function(){if((Zt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Hm={readContext:hr,use:wd,useCallback:Cx,useContext:hr,useEffect:Dm,useImperativeHandle:wx,useInsertionEffect:Tx,useLayoutEffect:vx,useMemo:Sx,useReducer:Cd,useRef:yx,useState:function(){return Cd(Ds)},useDebugValue:jm,useDeferredValue:function(a,s){var u=Pn();return Nx(u,cn.memoizedState,a,s)},useTransition:function(){var a=Cd(Ds)[0],s=Pn().memoizedState;return[typeof a=="boolean"?a:ku(a),s]},useSyncExternalStore:rx,useId:Ix,useHostTransitionStatus:Bm,useFormState:gx,useActionState:gx,useOptimistic:function(a,s){var u=Pn();return ux(u,cn,a,s)},useMemoCache:Am,useCacheRefresh:Ox};Hm.useEffectEvent=_x;var Bx={readContext:hr,use:wd,useCallback:Cx,useContext:hr,useEffect:Dm,useImperativeHandle:wx,useInsertionEffect:Tx,useLayoutEffect:vx,useMemo:Sx,useReducer:Lm,useRef:yx,useState:function(){return Lm(Ds)},useDebugValue:jm,useDeferredValue:function(a,s){var u=Pn();return cn===null?Mm(u,a,s):Nx(u,cn.memoizedState,a,s)},useTransition:function(){var a=Lm(Ds)[0],s=Pn().memoizedState;return[typeof a=="boolean"?a:ku(a),s]},useSyncExternalStore:rx,useId:Ix,useHostTransitionStatus:Bm,useFormState:xx,useActionState:xx,useOptimistic:function(a,s){var u=Pn();return cn!==null?ux(u,cn,a,s):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Am,useCacheRefresh:Ox};Bx.useEffectEvent=_x;function zm(a,s,u,h){s=a.memoizedState,u=u(h,s),u=u==null?s:g({},s,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var Fm={enqueueSetState:function(a,s,u){a=a._reactInternals;var h=ra(),b=gi(h);b.payload=s,u!=null&&(b.callback=u),s=bi(a,b,h),s!==null&&(zr(s,a,h),Eu(s,a,h))},enqueueReplaceState:function(a,s,u){a=a._reactInternals;var h=ra(),b=gi(h);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=bi(a,b,h),s!==null&&(zr(s,a,h),Eu(s,a,h))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var u=ra(),h=gi(u);h.tag=2,s!=null&&(h.callback=s),s=bi(a,h,u),s!==null&&(zr(s,a,u),Eu(s,a,u))}};function Ux(a,s,u,h,b,x,k){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,x,k):s.prototype&&s.prototype.isPureReactComponent?!fu(u,h)||!fu(b,x):!0}function Hx(a,s,u,h){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==a&&Fm.enqueueReplaceState(s,s.state,null)}function bl(a,s){var u=s;if("ref"in s){u={};for(var h in s)h!=="ref"&&(u[h]=s[h])}if(a=a.defaultProps){u===s&&(u=g({},u));for(var b in a)u[b]===void 0&&(u[b]=a[b])}return u}function zx(a){ld(a)}function Fx(a){console.error(a)}function $x(a){ld(a)}function Rd(a,s){try{var u=a.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function Vx(a,s,u){try{var h=a.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function $m(a,s,u){return u=gi(u),u.tag=3,u.payload={element:null},u.callback=function(){Rd(a,s)},u}function Gx(a){return a=gi(a),a.tag=3,a}function qx(a,s,u,h){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var x=h.value;a.payload=function(){return b(x)},a.callback=function(){Vx(s,u,h)}}var k=u.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(a.callback=function(){Vx(s,u,h),typeof b!="function"&&(vi===null?vi=new Set([this]):vi.add(this));var R=h.stack;this.componentDidCatch(h.value,{componentStack:R!==null?R:""})})}function WS(a,s,u,h,b){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=u.alternate,s!==null&&no(s,u,b,!0),u=Jr.current,u!==null){switch(u.tag){case 31:case 13:return _a===null?Fd():u.alternate===null&&Dn===0&&(Dn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,h===bd?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([h]):s.add(h),mp(a,h,b)),!1;case 22:return u.flags|=65536,h===bd?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([h]):u.add(h)),mp(a,h,b)),!1}throw Error(r(435,u.tag))}return mp(a,h,b),Fd(),!1}if(Ht)return s=Jr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,h!==om&&(a=Error(r(422),{cause:h}),pu(ba(a,u)))):(h!==om&&(s=Error(r(423),{cause:h}),pu(ba(s,u))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,h=ba(h,u),b=$m(a.stateNode,h,b),ym(a,b),Dn!==4&&(Dn=2)),!1;var x=Error(r(520),{cause:h});if(x=ba(x,u),Du===null?Du=[x]:Du.push(x),Dn!==4&&(Dn=2),s===null)return!0;h=ba(h,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,a=b&-b,u.lanes|=a,a=$m(u.stateNode,h,a),ym(u,a),!1;case 1:if(s=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(vi===null||!vi.has(x))))return u.flags|=65536,b&=-b,u.lanes|=b,b=Gx(b),qx(b,a,u,h),ym(u,b),!1}u=u.return}while(u!==null);return!1}var Vm=Error(r(461)),$n=!1;function mr(a,s,u,h){s.child=a===null?Xb(s,null,u,h):pl(s,a.child,u,h)}function Yx(a,s,u,h,b){u=u.render;var x=s.ref;if("ref"in h){var k={};for(var R in h)R!=="ref"&&(k[R]=h[R])}else k=h;return dl(s),h=wm(a,s,u,k,x,b),R=Cm(),a!==null&&!$n?(Sm(a,s,b),js(a,s,b)):(Ht&&R&&im(s),s.flags|=1,mr(a,s,h,b),s.child)}function Wx(a,s,u,h,b){if(a===null){var x=u.type;return typeof x=="function"&&!rm(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,Qx(a,s,x,h,b)):(a=dd(u.type,null,h,s,s.mode,b),a.ref=s.ref,a.return=s,s.child=a)}if(x=a.child,!Zm(a,b)){var k=x.memoizedProps;if(u=u.compare,u=u!==null?u:fu,u(k,h)&&a.ref===s.ref)return js(a,s,b)}return s.flags|=1,a=As(x,h),a.ref=s.ref,a.return=s,s.child=a}function Qx(a,s,u,h,b){if(a!==null){var x=a.memoizedProps;if(fu(x,h)&&a.ref===s.ref)if($n=!1,s.pendingProps=h=x,Zm(a,b))(a.flags&131072)!==0&&($n=!0);else return s.lanes=a.lanes,js(a,s,b)}return Gm(a,s,u,h,b)}function Xx(a,s,u,h){var b=h.children,x=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,a!==null){for(h=s.child=a.child,b=0;h!==null;)b=b|h.lanes|h.childLanes,h=h.sibling;h=b&~x}else h=0,s.child=null;return Kx(a,s,x,u,h)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&pd(s,x!==null?x.cachePool:null),x!==null?Jb(s,x):_m(),ex(s);else return h=s.lanes=536870912,Kx(a,s,x!==null?x.baseLanes|u:u,u,h)}else x!==null?(pd(s,x.cachePool),Jb(s,x),yi(),s.memoizedState=null):(a!==null&&pd(s,null),_m(),yi());return mr(a,s,b,u),s.child}function Su(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Kx(a,s,u,h,b){var x=pm();return x=x===null?null:{parent:zn._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},a!==null&&pd(s,null),_m(),ex(s),a!==null&&no(a,s,h,!0),s.childLanes=b,null}function Ld(a,s){return s=Od({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function Zx(a,s,u){return pl(s,a.child,null,u),a=Ld(s,s.pendingProps),a.flags|=2,ea(s),s.memoizedState=null,a}function QS(a,s,u){var h=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,a===null){if(Ht){if(h.mode==="hidden")return a=Ld(s,h),s.lanes=536870912,Su(null,a);if(vm(s),(a=Tn)?(a=cE(a,Ea),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:di!==null?{id:is,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},u=jb(a),u.return=s,s.child=u,fr=s,Tn=null)):a=null,a===null)throw hi(s);return s.lanes=536870912,null}return Ld(s,h)}var x=a.memoizedState;if(x!==null){var k=x.dehydrated;if(vm(s),b)if(s.flags&256)s.flags&=-257,s=Zx(a,s,u);else if(s.memoizedState!==null)s.child=a.child,s.flags|=128,s=null;else throw Error(r(558));else if($n||no(a,s,u,!1),b=(u&a.childLanes)!==0,$n||b){if(h=gn,h!==null&&(k=Jn(h,u),k!==0&&k!==x.retryLane))throw x.retryLane=k,ll(a,k),zr(h,a,k),Vm;Fd(),s=Zx(a,s,u)}else a=x.treeContext,Tn=Ta(k.nextSibling),fr=s,Ht=!0,fi=null,Ea=!1,a!==null&&Bb(s,a),s=Ld(s,h),s.flags|=4096;return s}return a=As(a.child,{mode:h.mode,children:h.children}),a.ref=s.ref,s.child=a,a.return=s,a}function Id(a,s){var u=s.ref;if(u===null)a!==null&&a.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(s.flags|=4194816)}}function Gm(a,s,u,h,b){return dl(s),u=wm(a,s,u,h,void 0,b),h=Cm(),a!==null&&!$n?(Sm(a,s,b),js(a,s,b)):(Ht&&h&&im(s),s.flags|=1,mr(a,s,u,b),s.child)}function Jx(a,s,u,h,b,x){return dl(s),s.updateQueue=null,u=nx(s,h,u,b),tx(a),h=Cm(),a!==null&&!$n?(Sm(a,s,x),js(a,s,x)):(Ht&&h&&im(s),s.flags|=1,mr(a,s,u,x),s.child)}function ey(a,s,u,h,b){if(dl(s),s.stateNode===null){var x=Zl,k=u.contextType;typeof k=="object"&&k!==null&&(x=hr(k)),x=new u(h,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Fm,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=h,x.state=s.memoizedState,x.refs={},bm(s),k=u.contextType,x.context=typeof k=="object"&&k!==null?hr(k):Zl,x.state=s.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(zm(s,u,k,h),x.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(k=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),k!==x.state&&Fm.enqueueReplaceState(x,x.state,null),Tu(s,h,x,b),_u(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(a===null){x=s.stateNode;var R=s.memoizedProps,W=bl(u,R);x.props=W;var ae=x.context,ge=u.contextType;k=Zl,typeof ge=="object"&&ge!==null&&(k=hr(ge));var Ee=u.getDerivedStateFromProps;ge=typeof Ee=="function"||typeof x.getSnapshotBeforeUpdate=="function",R=s.pendingProps!==R,ge||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(R||ae!==k)&&Hx(s,x,h,k),pi=!1;var ie=s.memoizedState;x.state=ie,Tu(s,h,x,b),_u(),ae=s.memoizedState,R||ie!==ae||pi?(typeof Ee=="function"&&(zm(s,u,Ee,h),ae=s.memoizedState),(W=pi||Ux(s,u,W,h,ie,ae,k))?(ge||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=ae),x.props=h,x.state=ae,x.context=k,h=W):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{x=s.stateNode,xm(a,s),k=s.memoizedProps,ge=bl(u,k),x.props=ge,Ee=s.pendingProps,ie=x.context,ae=u.contextType,W=Zl,typeof ae=="object"&&ae!==null&&(W=hr(ae)),R=u.getDerivedStateFromProps,(ae=typeof R=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==Ee||ie!==W)&&Hx(s,x,h,W),pi=!1,ie=s.memoizedState,x.state=ie,Tu(s,h,x,b),_u();var ce=s.memoizedState;k!==Ee||ie!==ce||pi||a!==null&&a.dependencies!==null&&hd(a.dependencies)?(typeof R=="function"&&(zm(s,u,R,h),ce=s.memoizedState),(ge=pi||Ux(s,u,ge,h,ie,ce,W)||a!==null&&a.dependencies!==null&&hd(a.dependencies))?(ae||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,ce,W),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,ce,W)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===a.memoizedProps&&ie===a.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ie===a.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=ce),x.props=h,x.state=ce,x.context=W,h=ge):(typeof x.componentDidUpdate!="function"||k===a.memoizedProps&&ie===a.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ie===a.memoizedState||(s.flags|=1024),h=!1)}return x=h,Id(a,s),h=(s.flags&128)!==0,x||h?(x=s.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,a!==null&&h?(s.child=pl(s,a.child,null,b),s.child=pl(s,null,u,b)):mr(a,s,u,b),s.memoizedState=x.state,a=s.child):a=js(a,s,b),a}function ty(a,s,u,h){return ul(),s.flags|=256,mr(a,s,u,h),s.child}var qm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ym(a){return{baseLanes:a,cachePool:Vb()}}function Wm(a,s,u){return a=a!==null?a.childLanes&~u:0,s&&(a|=na),a}function ny(a,s,u){var h=s.pendingProps,b=!1,x=(s.flags&128)!==0,k;if((k=x)||(k=a!==null&&a.memoizedState===null?!1:(Mn.current&2)!==0),k&&(b=!0,s.flags&=-129),k=(s.flags&32)!==0,s.flags&=-33,a===null){if(Ht){if(b?xi(s):yi(),(a=Tn)?(a=cE(a,Ea),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:di!==null?{id:is,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},u=jb(a),u.return=s,s.child=u,fr=s,Tn=null)):a=null,a===null)throw hi(s);return Rp(a)?s.lanes=32:s.lanes=536870912,null}var R=h.children;return h=h.fallback,b?(yi(),b=s.mode,R=Od({mode:"hidden",children:R},b),h=ol(h,b,u,null),R.return=s,h.return=s,R.sibling=h,s.child=R,h=s.child,h.memoizedState=Ym(u),h.childLanes=Wm(a,k,u),s.memoizedState=qm,Su(null,h)):(xi(s),Qm(s,R))}var W=a.memoizedState;if(W!==null&&(R=W.dehydrated,R!==null)){if(x)s.flags&256?(xi(s),s.flags&=-257,s=Xm(a,s,u)):s.memoizedState!==null?(yi(),s.child=a.child,s.flags|=128,s=null):(yi(),R=h.fallback,b=s.mode,h=Od({mode:"visible",children:h.children},b),R=ol(R,b,u,null),R.flags|=2,h.return=s,R.return=s,h.sibling=R,s.child=h,pl(s,a.child,null,u),h=s.child,h.memoizedState=Ym(u),h.childLanes=Wm(a,k,u),s.memoizedState=qm,s=Su(null,h));else if(xi(s),Rp(R)){if(k=R.nextSibling&&R.nextSibling.dataset,k)var ae=k.dgst;k=ae,h=Error(r(419)),h.stack="",h.digest=k,pu({value:h,source:null,stack:null}),s=Xm(a,s,u)}else if($n||no(a,s,u,!1),k=(u&a.childLanes)!==0,$n||k){if(k=gn,k!==null&&(h=Jn(k,u),h!==0&&h!==W.retryLane))throw W.retryLane=h,ll(a,h),zr(k,a,h),Vm;Ap(R)||Fd(),s=Xm(a,s,u)}else Ap(R)?(s.flags|=192,s.child=a.child,s=null):(a=W.treeContext,Tn=Ta(R.nextSibling),fr=s,Ht=!0,fi=null,Ea=!1,a!==null&&Bb(s,a),s=Qm(s,h.children),s.flags|=4096);return s}return b?(yi(),R=h.fallback,b=s.mode,W=a.child,ae=W.sibling,h=As(W,{mode:"hidden",children:h.children}),h.subtreeFlags=W.subtreeFlags&65011712,ae!==null?R=As(ae,R):(R=ol(R,b,u,null),R.flags|=2),R.return=s,h.return=s,h.sibling=R,s.child=h,Su(null,h),h=s.child,R=a.child.memoizedState,R===null?R=Ym(u):(b=R.cachePool,b!==null?(W=zn._currentValue,b=b.parent!==W?{parent:W,pool:W}:b):b=Vb(),R={baseLanes:R.baseLanes|u,cachePool:b}),h.memoizedState=R,h.childLanes=Wm(a,k,u),s.memoizedState=qm,Su(a.child,h)):(xi(s),u=a.child,a=u.sibling,u=As(u,{mode:"visible",children:h.children}),u.return=s,u.sibling=null,a!==null&&(k=s.deletions,k===null?(s.deletions=[a],s.flags|=16):k.push(a)),s.child=u,s.memoizedState=null,u)}function Qm(a,s){return s=Od({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function Od(a,s){return a=Zr(22,a,null,s),a.lanes=0,a}function Xm(a,s,u){return pl(s,a.child,null,u),a=Qm(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function ry(a,s,u){a.lanes|=s;var h=a.alternate;h!==null&&(h.lanes|=s),dm(a.return,s,u)}function Km(a,s,u,h,b,x){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:b,treeForkCount:x}:(k.isBackwards=s,k.rendering=null,k.renderingStartTime=0,k.last=h,k.tail=u,k.tailMode=b,k.treeForkCount=x)}function ay(a,s,u){var h=s.pendingProps,b=h.revealOrder,x=h.tail;h=h.children;var k=Mn.current,R=(k&2)!==0;if(R?(k=k&1|2,s.flags|=128):k&=1,O(Mn,k),mr(a,s,h,u),h=Ht?mu:0,!R&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&ry(a,u,s);else if(a.tag===19)ry(a,u,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(u=s.child,b=null;u!==null;)a=u.alternate,a!==null&&_d(a)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),Km(s,!1,b,u,x,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=s.child,s.child=null;b!==null;){if(a=b.alternate,a!==null&&_d(a)===null){s.child=b;break}a=b.sibling,b.sibling=u,u=b,b=a}Km(s,!0,u,null,x,h);break;case"together":Km(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function js(a,s,u){if(a!==null&&(s.dependencies=a.dependencies),Ti|=s.lanes,(u&s.childLanes)===0)if(a!==null){if(no(a,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,u=As(a,a.pendingProps),s.child=u,u.return=s;a.sibling!==null;)a=a.sibling,u=u.sibling=As(a,a.pendingProps),u.return=s;u.sibling=null}return s.child}function Zm(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&hd(a)))}function XS(a,s,u){switch(s.tag){case 3:st(s,s.stateNode.containerInfo),mi(s,zn,a.memoizedState.cache),ul();break;case 27:case 5:dt(s);break;case 4:st(s,s.stateNode.containerInfo);break;case 10:mi(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,vm(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(xi(s),s.flags|=128,null):(u&s.child.childLanes)!==0?ny(a,s,u):(xi(s),a=js(a,s,u),a!==null?a.sibling:null);xi(s);break;case 19:var b=(a.flags&128)!==0;if(h=(u&s.childLanes)!==0,h||(no(a,s,u,!1),h=(u&s.childLanes)!==0),b){if(h)return ay(a,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),O(Mn,Mn.current),h)break;return null;case 22:return s.lanes=0,Xx(a,s,u,s.pendingProps);case 24:mi(s,zn,a.memoizedState.cache)}return js(a,s,u)}function sy(a,s,u){if(a!==null)if(a.memoizedProps!==s.pendingProps)$n=!0;else{if(!Zm(a,u)&&(s.flags&128)===0)return $n=!1,XS(a,s,u);$n=(a.flags&131072)!==0}else $n=!1,Ht&&(s.flags&1048576)!==0&&Pb(s,mu,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(a=hl(s.elementType),s.type=a,typeof a=="function")rm(a)?(h=bl(a,h),s.tag=1,s=ey(null,s,a,h,u)):(s.tag=0,s=Gm(null,s,a,h,u));else{if(a!=null){var b=a.$$typeof;if(b===H){s.tag=11,s=Yx(null,s,a,h,u);break e}else if(b===P){s.tag=14,s=Wx(null,s,a,h,u);break e}}throw s=de(a)||a,Error(r(306,s,""))}}return s;case 0:return Gm(a,s,s.type,s.pendingProps,u);case 1:return h=s.type,b=bl(h,s.pendingProps),ey(a,s,h,b,u);case 3:e:{if(st(s,s.stateNode.containerInfo),a===null)throw Error(r(387));h=s.pendingProps;var x=s.memoizedState;b=x.element,xm(a,s),Tu(s,h,null,u);var k=s.memoizedState;if(h=k.cache,mi(s,zn,h),h!==x.cache&&fm(s,[zn],u,!0),_u(),h=k.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:k.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=ty(a,s,h,u);break e}else if(h!==b){b=ba(Error(r(424)),s),pu(b),s=ty(a,s,h,u);break e}else{switch(a=s.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Tn=Ta(a.firstChild),fr=s,Ht=!0,fi=null,Ea=!0,u=Xb(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ul(),h===b){s=js(a,s,u);break e}mr(a,s,h,u)}s=s.child}return s;case 26:return Id(a,s),a===null?(u=gE(s.type,null,s.pendingProps,null))?s.memoizedState=u:Ht||(u=s.type,a=s.pendingProps,h=Qd(_e.current).createElement(u),h[ln]=s,h[on]=a,pr(h,u,a),un(h),s.stateNode=h):s.memoizedState=gE(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return dt(s),a===null&&Ht&&(h=s.stateNode=hE(s.type,s.pendingProps,_e.current),fr=s,Ea=!0,b=Tn,Si(s.type)?(Lp=b,Tn=Ta(h.firstChild)):Tn=b),mr(a,s,s.pendingProps.children,u),Id(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&Ht&&((b=h=Tn)&&(h=CN(h,s.type,s.pendingProps,Ea),h!==null?(s.stateNode=h,fr=s,Tn=Ta(h.firstChild),Ea=!1,b=!0):b=!1),b||hi(s)),dt(s),b=s.type,x=s.pendingProps,k=a!==null?a.memoizedProps:null,h=x.children,Cp(b,x)?h=null:k!==null&&Cp(b,k)&&(s.flags|=32),s.memoizedState!==null&&(b=wm(a,s,zS,null,null,u),Fu._currentValue=b),Id(a,s),mr(a,s,h,u),s.child;case 6:return a===null&&Ht&&((a=u=Tn)&&(u=SN(u,s.pendingProps,Ea),u!==null?(s.stateNode=u,fr=s,Tn=null,a=!0):a=!1),a||hi(s)),null;case 13:return ny(a,s,u);case 4:return st(s,s.stateNode.containerInfo),h=s.pendingProps,a===null?s.child=pl(s,null,h,u):mr(a,s,h,u),s.child;case 11:return Yx(a,s,s.type,s.pendingProps,u);case 7:return mr(a,s,s.pendingProps,u),s.child;case 8:return mr(a,s,s.pendingProps.children,u),s.child;case 12:return mr(a,s,s.pendingProps.children,u),s.child;case 10:return h=s.pendingProps,mi(s,s.type,h.value),mr(a,s,h.children,u),s.child;case 9:return b=s.type._context,h=s.pendingProps.children,dl(s),b=hr(b),h=h(b),s.flags|=1,mr(a,s,h,u),s.child;case 14:return Wx(a,s,s.type,s.pendingProps,u);case 15:return Qx(a,s,s.type,s.pendingProps,u);case 19:return ay(a,s,u);case 31:return QS(a,s,u);case 22:return Xx(a,s,u,s.pendingProps);case 24:return dl(s),h=hr(zn),a===null?(b=pm(),b===null&&(b=gn,x=hm(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=u),b=x),s.memoizedState={parent:h,cache:b},bm(s),mi(s,zn,b)):((a.lanes&u)!==0&&(xm(a,s),Tu(s,null,null,u),_u()),b=a.memoizedState,x=s.memoizedState,b.parent!==h?(b={parent:h,cache:h},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),mi(s,zn,h)):(h=x.cache,mi(s,zn,h),h!==b.cache&&fm(s,[zn],u,!0))),mr(a,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ms(a){a.flags|=4}function Jm(a,s,u,h,b){if((s=(a.mode&32)!==0)&&(s=!1),s){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(Iy())a.flags|=8192;else throw ml=bd,gm}else a.flags&=-16777217}function iy(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!_E(s))if(Iy())a.flags|=8192;else throw ml=bd,gm}function Dd(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?pn():536870912,a.lanes|=s,po|=s)}function Nu(a,s){if(!Ht)switch(a.tailMode){case"hidden":s=a.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function vn(a){var s=a.alternate!==null&&a.alternate.child===a.child,u=0,h=0;if(s)for(var b=a.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags&65011712,h|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)u|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=h,a.childLanes=u,s}function KS(a,s,u){var h=s.pendingProps;switch(lm(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(s),null;case 1:return vn(s),null;case 3:return u=s.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Is(zn),Me(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(to(s)?Ms(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,um())),vn(s),null;case 26:var b=s.type,x=s.memoizedState;return a===null?(Ms(s),x!==null?(vn(s),iy(s,x)):(vn(s),Jm(s,b,null,h,u))):x?x!==a.memoizedState?(Ms(s),vn(s),iy(s,x)):(vn(s),s.flags&=-16777217):(a=a.memoizedProps,a!==h&&Ms(s),vn(s),Jm(s,b,a,h,u)),null;case 27:if(pt(s),u=_e.current,b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&Ms(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return vn(s),null}a=ke.current,to(s)?Ub(s):(a=hE(b,h,u),s.stateNode=a,Ms(s))}return vn(s),null;case 5:if(pt(s),b=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==h&&Ms(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return vn(s),null}if(x=ke.current,to(s))Ub(s);else{var k=Qd(_e.current);switch(x){case 1:x=k.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=k.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=k.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof h.is=="string"?k.createElement("select",{is:h.is}):k.createElement("select"),h.multiple?x.multiple=!0:h.size&&(x.size=h.size);break;default:x=typeof h.is=="string"?k.createElement(b,{is:h.is}):k.createElement(b)}}x[ln]=s,x[on]=h;e:for(k=s.child;k!==null;){if(k.tag===5||k.tag===6)x.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===s)break e;for(;k.sibling===null;){if(k.return===null||k.return===s)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}s.stateNode=x;e:switch(pr(x,b,h),b){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Ms(s)}}return vn(s),Jm(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,u),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==h&&Ms(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(a=_e.current,to(s)){if(a=s.stateNode,u=s.memoizedProps,h=null,b=fr,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}a[ln]=s,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||nE(a.nodeValue,u)),a||hi(s,!0)}else a=Qd(a).createTextNode(h),a[ln]=s,s.stateNode=a}return vn(s),null;case 31:if(u=s.memoizedState,a===null||a.memoizedState!==null){if(h=to(s),u!==null){if(a===null){if(!h)throw Error(r(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[ln]=s}else ul(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;vn(s),a=!1}else u=um(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return s.flags&256?(ea(s),s):(ea(s),null);if((s.flags&128)!==0)throw Error(r(558))}return vn(s),null;case 13:if(h=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=to(s),h!==null&&h.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[ln]=s}else ul(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;vn(s),b=!1}else b=um(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(ea(s),s):(ea(s),null)}return ea(s),(s.flags&128)!==0?(s.lanes=u,s):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=s.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==b&&(h.flags|=2048)),u!==a&&u&&(s.child.flags|=8192),Dd(s,s.updateQueue),vn(s),null);case 4:return Me(),a===null&&_p(s.stateNode.containerInfo),vn(s),null;case 10:return Is(s.type),vn(s),null;case 19:if(se(Mn),h=s.memoizedState,h===null)return vn(s),null;if(b=(s.flags&128)!==0,x=h.rendering,x===null)if(b)Nu(h,!1);else{if(Dn!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(x=_d(a),x!==null){for(s.flags|=128,Nu(h,!1),a=x.updateQueue,s.updateQueue=a,Dd(s,a),s.subtreeFlags=0,a=u,u=s.child;u!==null;)Db(u,a),u=u.sibling;return O(Mn,Mn.current&1|2),Ht&&Rs(s,h.treeForkCount),s.child}a=a.sibling}h.tail!==null&&Bt()>Ud&&(s.flags|=128,b=!0,Nu(h,!1),s.lanes=4194304)}else{if(!b)if(a=_d(x),a!==null){if(s.flags|=128,b=!0,a=a.updateQueue,s.updateQueue=a,Dd(s,a),Nu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!x.alternate&&!Ht)return vn(s),null}else 2*Bt()-h.renderingStartTime>Ud&&u!==536870912&&(s.flags|=128,b=!0,Nu(h,!1),s.lanes=4194304);h.isBackwards?(x.sibling=s.child,s.child=x):(a=h.last,a!==null?a.sibling=x:s.child=x,h.last=x)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=Bt(),a.sibling=null,u=Mn.current,O(Mn,b?u&1|2:u&1),Ht&&Rs(s,h.treeForkCount),a):(vn(s),null);case 22:case 23:return ea(s),Tm(),h=s.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(u&536870912)!==0&&(s.flags&128)===0&&(vn(s),s.subtreeFlags&6&&(s.flags|=8192)):vn(s),u=s.updateQueue,u!==null&&Dd(s,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==u&&(s.flags|=2048),a!==null&&se(fl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Is(zn),vn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function ZS(a,s){switch(lm(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return Is(zn),Me(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return pt(s),null;case 31:if(s.memoizedState!==null){if(ea(s),s.alternate===null)throw Error(r(340));ul()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(ea(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ul()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return se(Mn),null;case 4:return Me(),null;case 10:return Is(s.type),null;case 22:case 23:return ea(s),Tm(),a!==null&&se(fl),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return Is(zn),null;case 25:return null;default:return null}}function ly(a,s){switch(lm(s),s.tag){case 3:Is(zn),Me();break;case 26:case 27:case 5:pt(s);break;case 4:Me();break;case 31:s.memoizedState!==null&&ea(s);break;case 13:ea(s);break;case 19:se(Mn);break;case 10:Is(s.type);break;case 22:case 23:ea(s),Tm(),a!==null&&se(fl);break;case 24:Is(zn)}}function Au(a,s){try{var u=s.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var b=h.next;u=b;do{if((u.tag&a)===a){h=void 0;var x=u.create,k=u.inst;h=x(),k.destroy=h}u=u.next}while(u!==b)}}catch(R){rn(s,s.return,R)}}function Ei(a,s,u){try{var h=s.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var x=b.next;h=x;do{if((h.tag&a)===a){var k=h.inst,R=k.destroy;if(R!==void 0){k.destroy=void 0,b=s;var W=u,ae=R;try{ae()}catch(ge){rn(b,W,ge)}}}h=h.next}while(h!==x)}}catch(ge){rn(s,s.return,ge)}}function oy(a){var s=a.updateQueue;if(s!==null){var u=a.stateNode;try{Zb(s,u)}catch(h){rn(a,a.return,h)}}}function uy(a,s,u){u.props=bl(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){rn(a,s,h)}}function Ru(a,s){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(b){rn(a,s,b)}}function os(a,s){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(b){rn(a,s,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){rn(a,s,b)}else u.current=null}function cy(a){var s=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(b){rn(a,a.return,b)}}function ep(a,s,u){try{var h=a.stateNode;EN(h,a.type,u,s),h[on]=s}catch(b){rn(a,a.return,b)}}function dy(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Si(a.type)||a.tag===4}function tp(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||dy(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Si(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function np(a,s,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(a),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Wr));else if(h!==4&&(h===27&&Si(a.type)&&(u=a.stateNode,s=null),a=a.child,a!==null))for(np(a,s,u),a=a.sibling;a!==null;)np(a,s,u),a=a.sibling}function jd(a,s,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,s?u.insertBefore(a,s):u.appendChild(a);else if(h!==4&&(h===27&&Si(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(jd(a,s,u),a=a.sibling;a!==null;)jd(a,s,u),a=a.sibling}function fy(a){var s=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);pr(s,h,u),s[ln]=a,s[on]=u}catch(x){rn(a,a.return,x)}}var Ps=!1,Vn=!1,rp=!1,hy=typeof WeakSet=="function"?WeakSet:Set,rr=null;function JS(a,s){if(a=a.containerInfo,kp=nf,a=wb(a),Xh(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var b=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var k=0,R=-1,W=-1,ae=0,ge=0,Ee=a,ie=null;t:for(;;){for(var ce;Ee!==u||b!==0&&Ee.nodeType!==3||(R=k+b),Ee!==x||h!==0&&Ee.nodeType!==3||(W=k+h),Ee.nodeType===3&&(k+=Ee.nodeValue.length),(ce=Ee.firstChild)!==null;)ie=Ee,Ee=ce;for(;;){if(Ee===a)break t;if(ie===u&&++ae===b&&(R=k),ie===x&&++ge===h&&(W=k),(ce=Ee.nextSibling)!==null)break;Ee=ie,ie=Ee.parentNode}Ee=ce}u=R===-1||W===-1?null:{start:R,end:W}}else u=null}u=u||{start:0,end:0}}else u=null;for(wp={focusedElem:a,selectionRange:u},nf=!1,rr=s;rr!==null;)if(s=rr,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,rr=a;else for(;rr!==null;){switch(s=rr,x=s.alternate,a=s.flags,s.tag){case 0:if((a&4)!==0&&(a=s.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)b=a[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&x!==null){a=void 0,u=s,b=x.memoizedProps,x=x.memoizedState,h=u.stateNode;try{var Be=bl(u.type,b);a=h.getSnapshotBeforeUpdate(Be,x),h.__reactInternalSnapshotBeforeUpdate=a}catch(ft){rn(u,u.return,ft)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,u=a.nodeType,u===9)Np(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Np(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=s.sibling,a!==null){a.return=s.return,rr=a;break}rr=s.return}}function my(a,s,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Us(a,u),h&4&&Au(5,u);break;case 1:if(Us(a,u),h&4)if(a=u.stateNode,s===null)try{a.componentDidMount()}catch(k){rn(u,u.return,k)}else{var b=bl(u.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(b,s,a.__reactInternalSnapshotBeforeUpdate)}catch(k){rn(u,u.return,k)}}h&64&&oy(u),h&512&&Ru(u,u.return);break;case 3:if(Us(a,u),h&64&&(a=u.updateQueue,a!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{Zb(a,s)}catch(k){rn(u,u.return,k)}}break;case 27:s===null&&h&4&&fy(u);case 26:case 5:Us(a,u),s===null&&h&4&&cy(u),h&512&&Ru(u,u.return);break;case 12:Us(a,u);break;case 31:Us(a,u),h&4&&by(a,u);break;case 13:Us(a,u),h&4&&xy(a,u),h&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=oN.bind(null,u),NN(a,u))));break;case 22:if(h=u.memoizedState!==null||Ps,!h){s=s!==null&&s.memoizedState!==null||Vn,b=Ps;var x=Vn;Ps=h,(Vn=s)&&!x?Hs(a,u,(u.subtreeFlags&8772)!==0):Us(a,u),Ps=b,Vn=x}break;case 30:break;default:Us(a,u)}}function py(a){var s=a.alternate;s!==null&&(a.alternate=null,py(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&vr(s)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Cn=null,Pr=!1;function Bs(a,s,u){for(u=u.child;u!==null;)gy(a,s,u),u=u.sibling}function gy(a,s,u){if(Se&&typeof Se.onCommitFiberUnmount=="function")try{Se.onCommitFiberUnmount(xe,u)}catch{}switch(u.tag){case 26:Vn||os(u,s),Bs(a,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Vn||os(u,s);var h=Cn,b=Pr;Si(u.type)&&(Cn=u.stateNode,Pr=!1),Bs(a,s,u),Uu(u.stateNode),Cn=h,Pr=b;break;case 5:Vn||os(u,s);case 6:if(h=Cn,b=Pr,Cn=null,Bs(a,s,u),Cn=h,Pr=b,Cn!==null)if(Pr)try{(Cn.nodeType===9?Cn.body:Cn.nodeName==="HTML"?Cn.ownerDocument.body:Cn).removeChild(u.stateNode)}catch(x){rn(u,s,x)}else try{Cn.removeChild(u.stateNode)}catch(x){rn(u,s,x)}break;case 18:Cn!==null&&(Pr?(a=Cn,oE(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),vo(a)):oE(Cn,u.stateNode));break;case 4:h=Cn,b=Pr,Cn=u.stateNode.containerInfo,Pr=!0,Bs(a,s,u),Cn=h,Pr=b;break;case 0:case 11:case 14:case 15:Ei(2,u,s),Vn||Ei(4,u,s),Bs(a,s,u);break;case 1:Vn||(os(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"&&uy(u,s,h)),Bs(a,s,u);break;case 21:Bs(a,s,u);break;case 22:Vn=(h=Vn)||u.memoizedState!==null,Bs(a,s,u),Vn=h;break;default:Bs(a,s,u)}}function by(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{vo(a)}catch(u){rn(s,s.return,u)}}}function xy(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{vo(a)}catch(u){rn(s,s.return,u)}}function eN(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new hy),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new hy),s;default:throw Error(r(435,a.tag))}}function Md(a,s){var u=eN(a);s.forEach(function(h){if(!u.has(h)){u.add(h);var b=uN.bind(null,a,h);h.then(b,b)}})}function Br(a,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var b=u[h],x=a,k=s,R=k;e:for(;R!==null;){switch(R.tag){case 27:if(Si(R.type)){Cn=R.stateNode,Pr=!1;break e}break;case 5:Cn=R.stateNode,Pr=!1;break e;case 3:case 4:Cn=R.stateNode.containerInfo,Pr=!0;break e}R=R.return}if(Cn===null)throw Error(r(160));gy(x,k,b),Cn=null,Pr=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)yy(s,a),s=s.sibling}var $a=null;function yy(a,s){var u=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Br(s,a),Ur(a),h&4&&(Ei(3,a,a.return),Au(3,a),Ei(5,a,a.return));break;case 1:Br(s,a),Ur(a),h&512&&(Vn||u===null||os(u,u.return)),h&64&&Ps&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var b=$a;if(Br(s,a),Ur(a),h&512&&(Vn||u===null||os(u,u.return)),h&4){var x=u!==null?u.memoizedState:null;if(h=a.memoizedState,u===null)if(h===null)if(a.stateNode===null){e:{h=a.type,u=a.memoizedProps,b=b.ownerDocument||b;t:switch(h){case"title":x=b.getElementsByTagName("title")[0],(!x||x[es]||x[ln]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=b.createElement(h),b.head.insertBefore(x,b.querySelector("head > title"))),pr(x,h,u),x[ln]=a,un(x),h=x;break e;case"link":var k=yE("link","href",b).get(h+(u.href||""));if(k){for(var R=0;R<k.length;R++)if(x=k[R],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){k.splice(R,1);break t}}x=b.createElement(h),pr(x,h,u),b.head.appendChild(x);break;case"meta":if(k=yE("meta","content",b).get(h+(u.content||""))){for(R=0;R<k.length;R++)if(x=k[R],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){k.splice(R,1);break t}}x=b.createElement(h),pr(x,h,u),b.head.appendChild(x);break;default:throw Error(r(468,h))}x[ln]=a,un(x),h=x}a.stateNode=h}else EE(b,a.type,a.stateNode);else a.stateNode=xE(b,h,a.memoizedProps);else x!==h?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,h===null?EE(b,a.type,a.stateNode):xE(b,h,a.memoizedProps)):h===null&&a.stateNode!==null&&ep(a,a.memoizedProps,u.memoizedProps)}break;case 27:Br(s,a),Ur(a),h&512&&(Vn||u===null||os(u,u.return)),u!==null&&h&4&&ep(a,a.memoizedProps,u.memoizedProps);break;case 5:if(Br(s,a),Ur(a),h&512&&(Vn||u===null||os(u,u.return)),a.flags&32){b=a.stateNode;try{wr(b,"")}catch(Be){rn(a,a.return,Be)}}h&4&&a.stateNode!=null&&(b=a.memoizedProps,ep(a,b,u!==null?u.memoizedProps:b)),h&1024&&(rp=!0);break;case 6:if(Br(s,a),Ur(a),h&4){if(a.stateNode===null)throw Error(r(162));h=a.memoizedProps,u=a.stateNode;try{u.nodeValue=h}catch(Be){rn(a,a.return,Be)}}break;case 3:if(Zd=null,b=$a,$a=Xd(s.containerInfo),Br(s,a),$a=b,Ur(a),h&4&&u!==null&&u.memoizedState.isDehydrated)try{vo(s.containerInfo)}catch(Be){rn(a,a.return,Be)}rp&&(rp=!1,Ey(a));break;case 4:h=$a,$a=Xd(a.stateNode.containerInfo),Br(s,a),Ur(a),$a=h;break;case 12:Br(s,a),Ur(a);break;case 31:Br(s,a),Ur(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Md(a,h)));break;case 13:Br(s,a),Ur(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Bd=Bt()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Md(a,h)));break;case 22:b=a.memoizedState!==null;var W=u!==null&&u.memoizedState!==null,ae=Ps,ge=Vn;if(Ps=ae||b,Vn=ge||W,Br(s,a),Vn=ge,Ps=ae,Ur(a),h&8192)e:for(s=a.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||W||Ps||Vn||xl(a)),u=null,s=a;;){if(s.tag===5||s.tag===26){if(u===null){W=u=s;try{if(x=W.stateNode,b)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{R=W.stateNode;var Ee=W.memoizedProps.style,ie=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;R.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(Be){rn(W,W.return,Be)}}}else if(s.tag===6){if(u===null){W=s;try{W.stateNode.nodeValue=b?"":W.memoizedProps}catch(Be){rn(W,W.return,Be)}}}else if(s.tag===18){if(u===null){W=s;try{var ce=W.stateNode;b?uE(ce,!0):uE(W.stateNode,!1)}catch(Be){rn(W,W.return,Be)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=a.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Md(a,u))));break;case 19:Br(s,a),Ur(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Md(a,h)));break;case 30:break;case 21:break;default:Br(s,a),Ur(a)}}function Ur(a){var s=a.flags;if(s&2){try{for(var u,h=a.return;h!==null;){if(dy(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,x=tp(a);jd(a,x,b);break;case 5:var k=u.stateNode;u.flags&32&&(wr(k,""),u.flags&=-33);var R=tp(a);jd(a,R,k);break;case 3:case 4:var W=u.stateNode.containerInfo,ae=tp(a);np(a,ae,W);break;default:throw Error(r(161))}}catch(ge){rn(a,a.return,ge)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function Ey(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;Ey(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function Us(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)my(a,s.alternate,s),s=s.sibling}function xl(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:Ei(4,s,s.return),xl(s);break;case 1:os(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&uy(s,s.return,u),xl(s);break;case 27:Uu(s.stateNode);case 26:case 5:os(s,s.return),xl(s);break;case 22:s.memoizedState===null&&xl(s);break;case 30:xl(s);break;default:xl(s)}a=a.sibling}}function Hs(a,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,b=a,x=s,k=x.flags;switch(x.tag){case 0:case 11:case 15:Hs(b,x,u),Au(4,x);break;case 1:if(Hs(b,x,u),h=x,b=h.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ae){rn(h,h.return,ae)}if(h=x,b=h.updateQueue,b!==null){var R=h.stateNode;try{var W=b.shared.hiddenCallbacks;if(W!==null)for(b.shared.hiddenCallbacks=null,b=0;b<W.length;b++)Kb(W[b],R)}catch(ae){rn(h,h.return,ae)}}u&&k&64&&oy(x),Ru(x,x.return);break;case 27:fy(x);case 26:case 5:Hs(b,x,u),u&&h===null&&k&4&&cy(x),Ru(x,x.return);break;case 12:Hs(b,x,u);break;case 31:Hs(b,x,u),u&&k&4&&by(b,x);break;case 13:Hs(b,x,u),u&&k&4&&xy(b,x);break;case 22:x.memoizedState===null&&Hs(b,x,u),Ru(x,x.return);break;case 30:break;default:Hs(b,x,u)}s=s.sibling}}function ap(a,s){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&gu(u))}function sp(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&gu(a))}function Va(a,s,u,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)_y(a,s,u,h),s=s.sibling}function _y(a,s,u,h){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Va(a,s,u,h),b&2048&&Au(9,s);break;case 1:Va(a,s,u,h);break;case 3:Va(a,s,u,h),b&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&gu(a)));break;case 12:if(b&2048){Va(a,s,u,h),a=s.stateNode;try{var x=s.memoizedProps,k=x.id,R=x.onPostCommit;typeof R=="function"&&R(k,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(W){rn(s,s.return,W)}}else Va(a,s,u,h);break;case 31:Va(a,s,u,h);break;case 13:Va(a,s,u,h);break;case 23:break;case 22:x=s.stateNode,k=s.alternate,s.memoizedState!==null?x._visibility&2?Va(a,s,u,h):Lu(a,s):x._visibility&2?Va(a,s,u,h):(x._visibility|=2,fo(a,s,u,h,(s.subtreeFlags&10256)!==0||!1)),b&2048&&ap(k,s);break;case 24:Va(a,s,u,h),b&2048&&sp(s.alternate,s);break;default:Va(a,s,u,h)}}function fo(a,s,u,h,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=a,k=s,R=u,W=h,ae=k.flags;switch(k.tag){case 0:case 11:case 15:fo(x,k,R,W,b),Au(8,k);break;case 23:break;case 22:var ge=k.stateNode;k.memoizedState!==null?ge._visibility&2?fo(x,k,R,W,b):Lu(x,k):(ge._visibility|=2,fo(x,k,R,W,b)),b&&ae&2048&&ap(k.alternate,k);break;case 24:fo(x,k,R,W,b),b&&ae&2048&&sp(k.alternate,k);break;default:fo(x,k,R,W,b)}s=s.sibling}}function Lu(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=a,h=s,b=h.flags;switch(h.tag){case 22:Lu(u,h),b&2048&&ap(h.alternate,h);break;case 24:Lu(u,h),b&2048&&sp(h.alternate,h);break;default:Lu(u,h)}s=s.sibling}}var Iu=8192;function ho(a,s,u){if(a.subtreeFlags&Iu)for(a=a.child;a!==null;)Ty(a,s,u),a=a.sibling}function Ty(a,s,u){switch(a.tag){case 26:ho(a,s,u),a.flags&Iu&&a.memoizedState!==null&&HN(u,$a,a.memoizedState,a.memoizedProps);break;case 5:ho(a,s,u);break;case 3:case 4:var h=$a;$a=Xd(a.stateNode.containerInfo),ho(a,s,u),$a=h;break;case 22:a.memoizedState===null&&(h=a.alternate,h!==null&&h.memoizedState!==null?(h=Iu,Iu=16777216,ho(a,s,u),Iu=h):ho(a,s,u));break;default:ho(a,s,u)}}function vy(a){var s=a.alternate;if(s!==null&&(a=s.child,a!==null)){s.child=null;do s=a.sibling,a.sibling=null,a=s;while(a!==null)}}function Ou(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];rr=h,wy(h,a)}vy(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)ky(a),a=a.sibling}function ky(a){switch(a.tag){case 0:case 11:case 15:Ou(a),a.flags&2048&&Ei(9,a,a.return);break;case 3:Ou(a);break;case 12:Ou(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,Pd(a)):Ou(a);break;default:Ou(a)}}function Pd(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];rr=h,wy(h,a)}vy(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:Ei(8,s,s.return),Pd(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Pd(s));break;default:Pd(s)}a=a.sibling}}function wy(a,s){for(;rr!==null;){var u=rr;switch(u.tag){case 0:case 11:case 15:Ei(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:gu(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,rr=h;else e:for(u=a;rr!==null;){h=rr;var b=h.sibling,x=h.return;if(py(h),h===u){rr=null;break e}if(b!==null){b.return=x,rr=b;break e}rr=x}}}var tN={getCacheForType:function(a){var s=hr(zn),u=s.data.get(a);return u===void 0&&(u=a(),s.data.set(a,u)),u},cacheSignal:function(){return hr(zn).controller.signal}},nN=typeof WeakMap=="function"?WeakMap:Map,Zt=0,gn=null,Lt=null,Mt=0,nn=0,ta=null,_i=!1,mo=!1,ip=!1,zs=0,Dn=0,Ti=0,yl=0,lp=0,na=0,po=0,Du=null,Hr=null,op=!1,Bd=0,Cy=0,Ud=1/0,Hd=null,vi=null,Yn=0,ki=null,go=null,Fs=0,up=0,cp=null,Sy=null,ju=0,dp=null;function ra(){return(Zt&2)!==0&&Mt!==0?Mt&-Mt:z.T!==null?bp():Ja()}function Ny(){if(na===0)if((Mt&536870912)===0||Ht){var a=je;je<<=1,(je&3932160)===0&&(je=262144),na=a}else na=536870912;return a=Jr.current,a!==null&&(a.flags|=32),na}function zr(a,s,u){(a===gn&&(nn===2||nn===9)||a.cancelPendingCommit!==null)&&(bo(a,0),wi(a,Mt,na,!1)),An(a,u),((Zt&2)===0||a!==gn)&&(a===gn&&((Zt&2)===0&&(yl|=u),Dn===4&&wi(a,Mt,na,!1)),us(a))}function Ay(a,s,u){if((Zt&6)!==0)throw Error(r(327));var h=!u&&(s&127)===0&&(s&a.expiredLanes)===0||ut(a,s),b=h?sN(a,s):hp(a,s,!0),x=h;do{if(b===0){mo&&!h&&wi(a,s,0,!1);break}else{if(u=a.current.alternate,x&&!rN(u)){b=hp(a,s,!1),x=!1;continue}if(b===2){if(x=s,a.errorRecoveryDisabledLanes&x)var k=0;else k=a.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){s=k;e:{var R=a;b=Du;var W=R.current.memoizedState.isDehydrated;if(W&&(bo(R,k).flags|=256),k=hp(R,k,!1),k!==2){if(ip&&!W){R.errorRecoveryDisabledLanes|=x,yl|=x,b=4;break e}x=Hr,Hr=b,x!==null&&(Hr===null?Hr=x:Hr.push.apply(Hr,x))}b=k}if(x=!1,b!==2)continue}}if(b===1){bo(a,0),wi(a,s,0,!0);break}e:{switch(h=a,x=b,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:wi(h,s,na,!_i);break e;case 2:Hr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=Bd+300-Bt(),10<b)){if(wi(h,s,na,!_i),zt(h,0,!0)!==0)break e;Fs=s,h.timeoutHandle=iE(Ry.bind(null,h,u,Hr,Hd,op,s,na,yl,po,_i,x,"Throttled",-0,0),b);break e}Ry(h,u,Hr,Hd,op,s,na,yl,po,_i,x,null,-0,0)}}break}while(!0);us(a)}function Ry(a,s,u,h,b,x,k,R,W,ae,ge,Ee,ie,ce){if(a.timeoutHandle=-1,Ee=s.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wr},Ty(s,x,Ee);var Be=(x&62914560)===x?Bd-Bt():(x&4194048)===x?Cy-Bt():0;if(Be=zN(Ee,Be),Be!==null){Fs=x,a.cancelPendingCommit=Be(By.bind(null,a,s,x,u,h,b,k,R,W,ge,Ee,null,ie,ce)),wi(a,x,k,!ae);return}}By(a,s,x,u,h,b,k,R,W)}function rN(a){for(var s=a;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var b=u[h],x=b.getSnapshot;b=b.value;try{if(!Kr(x(),b))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function wi(a,s,u,h){s&=~lp,s&=~yl,a.suspendedLanes|=s,a.pingedLanes&=~s,h&&(a.warmLanes|=s),h=a.expirationTimes;for(var b=s;0<b;){var x=31-Pe(b),k=1<<x;h[x]=-1,b&=~k}u!==0&&Dr(a,u,s)}function zd(){return(Zt&6)===0?(Mu(0),!1):!0}function fp(){if(Lt!==null){if(nn===0)var a=Lt.return;else a=Lt,Ls=cl=null,Nm(a),io=null,xu=0,a=Lt;for(;a!==null;)ly(a.alternate,a),a=a.return;Lt=null}}function bo(a,s){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,vN(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),Fs=0,fp(),gn=a,Lt=u=As(a.current,null),Mt=s,nn=0,ta=null,_i=!1,mo=ut(a,s),ip=!1,po=na=lp=yl=Ti=Dn=0,Hr=Du=null,op=!1,(s&8)!==0&&(s|=s&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=s;0<h;){var b=31-Pe(h),x=1<<b;s|=a[b],h&=~x}return zs=s,od(),u}function Ly(a,s){_t=null,z.H=Cu,s===so||s===gd?(s=Yb(),nn=3):s===gm?(s=Yb(),nn=4):nn=s===Vm?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ta=s,Lt===null&&(Dn=1,Rd(a,ba(s,a.current)))}function Iy(){var a=Jr.current;return a===null?!0:(Mt&4194048)===Mt?_a===null:(Mt&62914560)===Mt||(Mt&536870912)!==0?a===_a:!1}function Oy(){var a=z.H;return z.H=Cu,a===null?Cu:a}function Dy(){var a=z.A;return z.A=tN,a}function Fd(){Dn=4,_i||(Mt&4194048)!==Mt&&Jr.current!==null||(mo=!0),(Ti&134217727)===0&&(yl&134217727)===0||gn===null||wi(gn,Mt,na,!1)}function hp(a,s,u){var h=Zt;Zt|=2;var b=Oy(),x=Dy();(gn!==a||Mt!==s)&&(Hd=null,bo(a,s)),s=!1;var k=Dn;e:do try{if(nn!==0&&Lt!==null){var R=Lt,W=ta;switch(nn){case 8:fp(),k=6;break e;case 3:case 2:case 9:case 6:Jr.current===null&&(s=!0);var ae=nn;if(nn=0,ta=null,xo(a,R,W,ae),u&&mo){k=0;break e}break;default:ae=nn,nn=0,ta=null,xo(a,R,W,ae)}}aN(),k=Dn;break}catch(ge){Ly(a,ge)}while(!0);return s&&a.shellSuspendCounter++,Ls=cl=null,Zt=h,z.H=b,z.A=x,Lt===null&&(gn=null,Mt=0,od()),k}function aN(){for(;Lt!==null;)jy(Lt)}function sN(a,s){var u=Zt;Zt|=2;var h=Oy(),b=Dy();gn!==a||Mt!==s?(Hd=null,Ud=Bt()+500,bo(a,s)):mo=ut(a,s);e:do try{if(nn!==0&&Lt!==null){s=Lt;var x=ta;t:switch(nn){case 1:nn=0,ta=null,xo(a,s,x,1);break;case 2:case 9:if(Gb(x)){nn=0,ta=null,My(s);break}s=function(){nn!==2&&nn!==9||gn!==a||(nn=7),us(a)},x.then(s,s);break e;case 3:nn=7;break e;case 4:nn=5;break e;case 7:Gb(x)?(nn=0,ta=null,My(s)):(nn=0,ta=null,xo(a,s,x,7));break;case 5:var k=null;switch(Lt.tag){case 26:k=Lt.memoizedState;case 5:case 27:var R=Lt;if(k?_E(k):R.stateNode.complete){nn=0,ta=null;var W=R.sibling;if(W!==null)Lt=W;else{var ae=R.return;ae!==null?(Lt=ae,$d(ae)):Lt=null}break t}}nn=0,ta=null,xo(a,s,x,5);break;case 6:nn=0,ta=null,xo(a,s,x,6);break;case 8:fp(),Dn=6;break e;default:throw Error(r(462))}}iN();break}catch(ge){Ly(a,ge)}while(!0);return Ls=cl=null,z.H=h,z.A=b,Zt=u,Lt!==null?0:(gn=null,Mt=0,od(),Dn)}function iN(){for(;Lt!==null&&!xn();)jy(Lt)}function jy(a){var s=sy(a.alternate,a,zs);a.memoizedProps=a.pendingProps,s===null?$d(a):Lt=s}function My(a){var s=a,u=s.alternate;switch(s.tag){case 15:case 0:s=Jx(u,s,s.pendingProps,s.type,void 0,Mt);break;case 11:s=Jx(u,s,s.pendingProps,s.type.render,s.ref,Mt);break;case 5:Nm(s);default:ly(u,s),s=Lt=Db(s,zs),s=sy(u,s,zs)}a.memoizedProps=a.pendingProps,s===null?$d(a):Lt=s}function xo(a,s,u,h){Ls=cl=null,Nm(s),io=null,xu=0;var b=s.return;try{if(WS(a,b,s,u,Mt)){Dn=1,Rd(a,ba(u,a.current)),Lt=null;return}}catch(x){if(b!==null)throw Lt=b,x;Dn=1,Rd(a,ba(u,a.current)),Lt=null;return}s.flags&32768?(Ht||h===1?a=!0:mo||(Mt&536870912)!==0?a=!1:(_i=a=!0,(h===2||h===9||h===3||h===6)&&(h=Jr.current,h!==null&&h.tag===13&&(h.flags|=16384))),Py(s,a)):$d(s)}function $d(a){var s=a;do{if((s.flags&32768)!==0){Py(s,_i);return}a=s.return;var u=KS(s.alternate,s,zs);if(u!==null){Lt=u;return}if(s=s.sibling,s!==null){Lt=s;return}Lt=s=a}while(s!==null);Dn===0&&(Dn=5)}function Py(a,s){do{var u=ZS(a.alternate,a);if(u!==null){u.flags&=32767,Lt=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(a=a.sibling,a!==null)){Lt=a;return}Lt=a=u}while(a!==null);Dn=6,Lt=null}function By(a,s,u,h,b,x,k,R,W){a.cancelPendingCommit=null;do Vd();while(Yn!==0);if((Zt&6)!==0)throw Error(r(327));if(s!==null){if(s===a.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=tm,qr(a,u,x,k,R,W),a===gn&&(Lt=gn=null,Mt=0),go=s,ki=a,Fs=u,up=x,cp=b,Sy=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,cN(Qe,function(){return $y(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=z.T,z.T=null,b=ee.p,ee.p=2,k=Zt,Zt|=4;try{JS(a,s,u)}finally{Zt=k,ee.p=b,z.T=h}}Yn=1,Uy(),Hy(),zy()}}function Uy(){if(Yn===1){Yn=0;var a=ki,s=go,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=z.T,z.T=null;var h=ee.p;ee.p=2;var b=Zt;Zt|=4;try{yy(s,a);var x=wp,k=wb(a.containerInfo),R=x.focusedElem,W=x.selectionRange;if(k!==R&&R&&R.ownerDocument&&kb(R.ownerDocument.documentElement,R)){if(W!==null&&Xh(R)){var ae=W.start,ge=W.end;if(ge===void 0&&(ge=ae),"selectionStart"in R)R.selectionStart=ae,R.selectionEnd=Math.min(ge,R.value.length);else{var Ee=R.ownerDocument||document,ie=Ee&&Ee.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),Be=R.textContent.length,ft=Math.min(W.start,Be),fn=W.end===void 0?ft:Math.min(W.end,Be);!ce.extend&&ft>fn&&(k=fn,fn=ft,ft=k);var J=vb(R,ft),X=vb(R,fn);if(J&&X&&(ce.rangeCount!==1||ce.anchorNode!==J.node||ce.anchorOffset!==J.offset||ce.focusNode!==X.node||ce.focusOffset!==X.offset)){var re=Ee.createRange();re.setStart(J.node,J.offset),ce.removeAllRanges(),ft>fn?(ce.addRange(re),ce.extend(X.node,X.offset)):(re.setEnd(X.node,X.offset),ce.addRange(re))}}}}for(Ee=[],ce=R;ce=ce.parentNode;)ce.nodeType===1&&Ee.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<Ee.length;R++){var ye=Ee[R];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}nf=!!kp,wp=kp=null}finally{Zt=b,ee.p=h,z.T=u}}a.current=s,Yn=2}}function Hy(){if(Yn===2){Yn=0;var a=ki,s=go,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=z.T,z.T=null;var h=ee.p;ee.p=2;var b=Zt;Zt|=4;try{my(a,s.alternate,s)}finally{Zt=b,ee.p=h,z.T=u}}Yn=3}}function zy(){if(Yn===4||Yn===3){Yn=0,or();var a=ki,s=go,u=Fs,h=Sy;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Yn=5:(Yn=0,go=ki=null,Fy(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(vi=null),er(u),s=s.stateNode,Se&&typeof Se.onCommitFiberRoot=="function")try{Se.onCommitFiberRoot(xe,s,void 0,(s.current.flags&128)===128)}catch{}if(h!==null){s=z.T,b=ee.p,ee.p=2,z.T=null;try{for(var x=a.onRecoverableError,k=0;k<h.length;k++){var R=h[k];x(R.value,{componentStack:R.stack})}}finally{z.T=s,ee.p=b}}(Fs&3)!==0&&Vd(),us(a),b=a.pendingLanes,(u&261930)!==0&&(b&42)!==0?a===dp?ju++:(ju=0,dp=a):ju=0,Mu(0)}}function Fy(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,gu(s)))}function Vd(){return Uy(),Hy(),zy(),$y()}function $y(){if(Yn!==5)return!1;var a=ki,s=up;up=0;var u=er(Fs),h=z.T,b=ee.p;try{ee.p=32>u?32:u,z.T=null,u=cp,cp=null;var x=ki,k=Fs;if(Yn=0,go=ki=null,Fs=0,(Zt&6)!==0)throw Error(r(331));var R=Zt;if(Zt|=4,ky(x.current),_y(x,x.current,k,u),Zt=R,Mu(0,!1),Se&&typeof Se.onPostCommitFiberRoot=="function")try{Se.onPostCommitFiberRoot(xe,x)}catch{}return!0}finally{ee.p=b,z.T=h,Fy(a,s)}}function Vy(a,s,u){s=ba(u,s),s=$m(a.stateNode,s,2),a=bi(a,s,2),a!==null&&(An(a,2),us(a))}function rn(a,s,u){if(a.tag===3)Vy(a,a,u);else for(;s!==null;){if(s.tag===3){Vy(s,a,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(vi===null||!vi.has(h))){a=ba(u,a),u=Gx(2),h=bi(s,u,2),h!==null&&(qx(u,h,s,a),An(h,2),us(h));break}}s=s.return}}function mp(a,s,u){var h=a.pingCache;if(h===null){h=a.pingCache=new nN;var b=new Set;h.set(s,b)}else b=h.get(s),b===void 0&&(b=new Set,h.set(s,b));b.has(u)||(ip=!0,b.add(u),a=lN.bind(null,a,s,u),s.then(a,a))}function lN(a,s,u){var h=a.pingCache;h!==null&&h.delete(s),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,gn===a&&(Mt&u)===u&&(Dn===4||Dn===3&&(Mt&62914560)===Mt&&300>Bt()-Bd?(Zt&2)===0&&bo(a,0):lp|=u,po===Mt&&(po=0)),us(a)}function Gy(a,s){s===0&&(s=pn()),a=ll(a,s),a!==null&&(An(a,s),us(a))}function oN(a){var s=a.memoizedState,u=0;s!==null&&(u=s.retryLane),Gy(a,u)}function uN(a,s){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,b=a.memoizedState;b!==null&&(u=b.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),Gy(a,u)}function cN(a,s){return Ge(a,s)}var Gd=null,yo=null,pp=!1,qd=!1,gp=!1,Ci=0;function us(a){a!==yo&&a.next===null&&(yo===null?Gd=yo=a:yo=yo.next=a),qd=!0,pp||(pp=!0,fN())}function Mu(a,s){if(!gp&&qd){gp=!0;do for(var u=!1,h=Gd;h!==null;){if(a!==0){var b=h.pendingLanes;if(b===0)var x=0;else{var k=h.suspendedLanes,R=h.pingedLanes;x=(1<<31-Pe(42|a)+1)-1,x&=b&~(k&~R),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,Qy(h,x))}else x=Mt,x=zt(h,h===gn?x:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(x&3)===0||ut(h,x)||(u=!0,Qy(h,x));h=h.next}while(u);gp=!1}}function dN(){qy()}function qy(){qd=pp=!1;var a=0;Ci!==0&&TN()&&(a=Ci);for(var s=Bt(),u=null,h=Gd;h!==null;){var b=h.next,x=Yy(h,s);x===0?(h.next=null,u===null?Gd=b:u.next=b,b===null&&(yo=u)):(u=h,(a!==0||(x&3)!==0)&&(qd=!0)),h=b}Yn!==0&&Yn!==5||Mu(a),Ci!==0&&(Ci=0)}function Yy(a,s){for(var u=a.suspendedLanes,h=a.pingedLanes,b=a.expirationTimes,x=a.pendingLanes&-62914561;0<x;){var k=31-Pe(x),R=1<<k,W=b[k];W===-1?((R&u)===0||(R&h)!==0)&&(b[k]=wt(R,s)):W<=s&&(a.expiredLanes|=R),x&=~R}if(s=gn,u=Mt,u=zt(a,a===s?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,u===0||a===s&&(nn===2||nn===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&an(h),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||ut(a,u)){if(s=u&-u,s===a.callbackPriority)return s;switch(h!==null&&an(h),er(u)){case 2:case 8:u=Ce;break;case 32:u=Qe;break;case 268435456:u=xt;break;default:u=Qe}return h=Wy.bind(null,a),u=Ge(u,h),a.callbackPriority=s,a.callbackNode=u,s}return h!==null&&h!==null&&an(h),a.callbackPriority=2,a.callbackNode=null,2}function Wy(a,s){if(Yn!==0&&Yn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Vd()&&a.callbackNode!==u)return null;var h=Mt;return h=zt(a,a===gn?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(Ay(a,h,s),Yy(a,Bt()),a.callbackNode!=null&&a.callbackNode===u?Wy.bind(null,a):null)}function Qy(a,s){if(Vd())return null;Ay(a,s,!0)}function fN(){kN(function(){(Zt&6)!==0?Ge(pe,dN):qy()})}function bp(){if(Ci===0){var a=ro;a===0&&(a=ot,ot<<=1,(ot&261888)===0&&(ot=256)),Ci=a}return Ci}function Xy(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:ui(""+a)}function Ky(a,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,a.id&&u.setAttribute("form",a.id),s.parentNode.insertBefore(u,s),a=new FormData(a),u.parentNode.removeChild(u),a}function hN(a,s,u,h,b){if(s==="submit"&&u&&u.stateNode===b){var x=Xy((b[on]||null).action),k=h.submitter;k&&(s=(s=k[on]||null)?Xy(s.formAction):k.getAttribute("formAction"),s!==null&&(x=s,k=null));var R=new Ye("action","action",null,h,b);a.push({event:R,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Ci!==0){var W=k?Ky(b,k):new FormData(b);Pm(u,{pending:!0,data:W,method:b.method,action:x},null,W)}}else typeof x=="function"&&(R.preventDefault(),W=k?Ky(b,k):new FormData(b),Pm(u,{pending:!0,data:W,method:b.method,action:x},x,W))},currentTarget:b}]})}}for(var xp=0;xp<em.length;xp++){var yp=em[xp],mN=yp.toLowerCase(),pN=yp[0].toUpperCase()+yp.slice(1);Fa(mN,"on"+pN)}Fa(Nb,"onAnimationEnd"),Fa(Ab,"onAnimationIteration"),Fa(Rb,"onAnimationStart"),Fa("dblclick","onDoubleClick"),Fa("focusin","onFocus"),Fa("focusout","onBlur"),Fa(LS,"onTransitionRun"),Fa(IS,"onTransitionStart"),Fa(OS,"onTransitionCancel"),Fa(Lb,"onTransitionEnd"),da("onMouseEnter",["mouseout","mouseover"]),da("onMouseLeave",["mouseout","mouseover"]),da("onPointerEnter",["pointerout","pointerover"]),da("onPointerLeave",["pointerout","pointerover"]),dr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dr("onBeforeInput",["compositionend","keypress","textInput","paste"]),dr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pu="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(" "),gN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pu));function Zy(a,s){s=(s&4)!==0;for(var u=0;u<a.length;u++){var h=a[u],b=h.event;h=h.listeners;e:{var x=void 0;if(s)for(var k=h.length-1;0<=k;k--){var R=h[k],W=R.instance,ae=R.currentTarget;if(R=R.listener,W!==x&&b.isPropagationStopped())break e;x=R,b.currentTarget=ae;try{x(b)}catch(ge){ld(ge)}b.currentTarget=null,x=W}else for(k=0;k<h.length;k++){if(R=h[k],W=R.instance,ae=R.currentTarget,R=R.listener,W!==x&&b.isPropagationStopped())break e;x=R,b.currentTarget=ae;try{x(b)}catch(ge){ld(ge)}b.currentTarget=null,x=W}}}}function It(a,s){var u=s[ks];u===void 0&&(u=s[ks]=new Set);var h=a+"__bubble";u.has(h)||(Jy(s,a,2,!1),u.add(h))}function Ep(a,s,u){var h=0;s&&(h|=4),Jy(u,a,h,s)}var Yd="_reactListening"+Math.random().toString(36).slice(2);function _p(a){if(!a[Yd]){a[Yd]=!0,ts.forEach(function(u){u!=="selectionchange"&&(gN.has(u)||Ep(u,!1,a),Ep(u,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[Yd]||(s[Yd]=!0,Ep("selectionchange",!1,s))}}function Jy(a,s,u,h){switch(NE(s)){case 2:var b=VN;break;case 8:b=GN;break;default:b=Mp}u=b.bind(null,s,u,a),b=void 0,!ci||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),h?b!==void 0?a.addEventListener(s,u,{capture:!0,passive:b}):a.addEventListener(s,u,!0):b!==void 0?a.addEventListener(s,u,{passive:b}):a.addEventListener(s,u,!1)}function Tp(a,s,u,h,b){var x=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var k=h.tag;if(k===3||k===4){var R=h.stateNode.containerInfo;if(R===b)break;if(k===4)for(k=h.return;k!==null;){var W=k.tag;if((W===3||W===4)&&k.stateNode.containerInfo===b)return;k=k.return}for(;R!==null;){if(k=ca(R),k===null)return;if(W=k.tag,W===5||W===6||W===26||W===27){h=x=k;continue e}R=R.parentNode}}h=h.return}Xr(function(){var ae=x,ge=rs(u),Ee=[];e:{var ie=Ib.get(a);if(ie!==void 0){var ce=Ye,Be=a;switch(a){case"keypress":if(Z(u)===0)break e;case"keydown":case"keyup":ce=Jc;break;case"focusin":Be="focus",ce=Ct;break;case"focusout":Be="blur",ce=Ct;break;case"beforeblur":case"afterblur":ce=Ct;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=Re;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=tt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=nd;break;case Nb:case Ab:case Rb:ce=Ln;break;case Lb:ce=ad;break;case"scroll":case"scrollend":ce=_n;break;case"wheel":ce=le;break;case"copy":case"cut":case"paste":ce=za;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=uu;break;case"toggle":case"beforetoggle":ce=We}var ft=(s&4)!==0,fn=!ft&&(a==="scroll"||a==="scrollend"),J=ft?ie!==null?ie+"Capture":null:ie;ft=[];for(var X=ae,re;X!==null;){var ye=X;if(re=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||re===null||J===null||(ye=Ua(X,J),ye!=null&&ft.push(Bu(X,ye,re))),fn)break;X=X.return}0<ft.length&&(ie=new ce(ie,Be,null,u,ge),Ee.push({event:ie,listeners:ft}))}}if((s&7)===0){e:{if(ie=a==="mouseover"||a==="pointerover",ce=a==="mouseout"||a==="pointerout",ie&&u!==Pa&&(Be=u.relatedTarget||u.fromElement)&&(ca(Be)||Be[Nt]))break e;if((ce||ie)&&(ie=ge.window===ge?ge:(ie=ge.ownerDocument)?ie.defaultView||ie.parentWindow:window,ce?(Be=u.relatedTarget||u.toElement,ce=ae,Be=Be?ca(Be):null,Be!==null&&(fn=l(Be),ft=Be.tag,Be!==fn||ft!==5&&ft!==27&&ft!==6)&&(Be=null)):(ce=null,Be=ae),ce!==Be)){if(ft=Re,ye="onMouseLeave",J="onMouseEnter",X="mouse",(a==="pointerout"||a==="pointerover")&&(ft=uu,ye="onPointerLeave",J="onPointerEnter",X="pointer"),fn=ce==null?ie:Da(ce),re=Be==null?ie:Da(Be),ie=new ft(ye,X+"leave",ce,u,ge),ie.target=fn,ie.relatedTarget=re,ye=null,ca(ge)===ae&&(ft=new ft(J,X+"enter",Be,u,ge),ft.target=re,ft.relatedTarget=fn,ye=ft),fn=ye,ce&&Be)t:{for(ft=bN,J=ce,X=Be,re=0,ye=J;ye;ye=ft(ye))re++;ye=0;for(var rt=X;rt;rt=ft(rt))ye++;for(;0<re-ye;)J=ft(J),re--;for(;0<ye-re;)X=ft(X),ye--;for(;re--;){if(J===X||X!==null&&J===X.alternate){ft=J;break t}J=ft(J),X=ft(X)}ft=null}else ft=null;ce!==null&&eE(Ee,ie,ce,ft,!1),Be!==null&&fn!==null&&eE(Ee,fn,Be,ft,!0)}}e:{if(ie=ae?Da(ae):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var qt=bb;else if(pb(ie))if(xb)qt=NS;else{qt=CS;var qe=wS}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ae&&Cs(ae.elementType)&&(qt=bb):qt=SS;if(qt&&(qt=qt(a,ae))){gb(Ee,qt,u,ge);break e}qe&&qe(a,ie,ae),a==="focusout"&&ae&&ie.type==="number"&&ae.memoizedProps.value!=null&&tl(ie,"number",ie.value)}switch(qe=ae?Da(ae):window,a){case"focusin":(pb(qe)||qe.contentEditable==="true")&&(Ql=qe,Kh=ae,hu=null);break;case"focusout":hu=Kh=Ql=null;break;case"mousedown":Zh=!0;break;case"contextmenu":case"mouseup":case"dragend":Zh=!1,Cb(Ee,u,ge);break;case"selectionchange":if(RS)break;case"keydown":case"keyup":Cb(Ee,u,ge)}var Tt;if(ht)e:{switch(a){case"compositionstart":var Pt="onCompositionStart";break e;case"compositionend":Pt="onCompositionEnd";break e;case"compositionupdate":Pt="onCompositionUpdate";break e}Pt=void 0}else pa?Ft(a,u)&&(Pt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(Pt="onCompositionStart");Pt&&(kt&&u.locale!=="ko"&&(pa||Pt!=="onCompositionStart"?Pt==="onCompositionEnd"&&pa&&(Tt=q()):(Sr=ge,Ss="value"in Sr?Sr.value:Sr.textContent,pa=!0)),qe=Wd(ae,Pt),0<qe.length&&(Pt=new ou(Pt,a,null,u,ge),Ee.push({event:Pt,listeners:qe}),Tt?Pt.data=Tt:(Tt=ma(u),Tt!==null&&(Pt.data=Tt)))),(Tt=jt?sd(a,u):TS(a,u))&&(Pt=Wd(ae,"onBeforeInput"),0<Pt.length&&(qe=new ou("onBeforeInput","beforeinput",null,u,ge),Ee.push({event:qe,listeners:Pt}),qe.data=Tt)),hN(Ee,a,ae,u,ge)}Zy(Ee,s)})}function Bu(a,s,u){return{instance:a,listener:s,currentTarget:u}}function Wd(a,s){for(var u=s+"Capture",h=[];a!==null;){var b=a,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=Ua(a,u),b!=null&&h.unshift(Bu(a,b,x)),b=Ua(a,s),b!=null&&h.push(Bu(a,b,x))),a.tag===3)return h;a=a.return}return[]}function bN(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function eE(a,s,u,h,b){for(var x=s._reactName,k=[];u!==null&&u!==h;){var R=u,W=R.alternate,ae=R.stateNode;if(R=R.tag,W!==null&&W===h)break;R!==5&&R!==26&&R!==27||ae===null||(W=ae,b?(ae=Ua(u,x),ae!=null&&k.unshift(Bu(u,ae,W))):b||(ae=Ua(u,x),ae!=null&&k.push(Bu(u,ae,W)))),u=u.return}k.length!==0&&a.push({event:s,listeners:k})}var xN=/\r\n?/g,yN=/\u0000|\uFFFD/g;function tE(a){return(typeof a=="string"?a:""+a).replace(xN,`
50
+ `).replace(yN,"")}function nE(a,s){return s=tE(s),tE(a)===s}function dn(a,s,u,h,b,x){switch(u){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||wr(a,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&wr(a,""+h);break;case"className":ns(a,"class",h);break;case"tabIndex":ns(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ns(a,u,h);break;case"style":nl(a,h,x);break;case"data":if(s!=="object"){ns(a,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||u!=="href")){a.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=ui(""+h),a.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(u,"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 x=="function"&&(u==="formAction"?(s!=="input"&&dn(a,s,"name",b.name,b,null),dn(a,s,"formEncType",b.formEncType,b,null),dn(a,s,"formMethod",b.formMethod,b,null),dn(a,s,"formTarget",b.formTarget,b,null)):(dn(a,s,"encType",b.encType,b,null),dn(a,s,"method",b.method,b,null),dn(a,s,"target",b.target,b,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=ui(""+h),a.setAttribute(u,h);break;case"onClick":h!=null&&(a.onclick=Wr);break;case"onScroll":h!=null&&It("scroll",a);break;case"onScrollEnd":h!=null&&It("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}u=ui(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""+h):a.removeAttribute(u);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":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":h===!0?a.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,h):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(u,h):a.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(u):a.setAttribute(u,h);break;case"popover":It("beforetoggle",a),It("toggle",a),fa(a,"popover",h);break;case"xlinkActuate":kr(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":kr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":kr(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":kr(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":kr(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":kr(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":kr(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":kr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":kr(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":fa(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=rl.get(u)||u,fa(a,u,h))}}function vp(a,s,u,h,b,x){switch(u){case"style":nl(a,h,x);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof h=="string"?wr(a,h):(typeof h=="number"||typeof h=="bigint")&&wr(a,""+h);break;case"onScroll":h!=null&&It("scroll",a);break;case"onScrollEnd":h!=null&&It("scrollend",a);break;case"onClick":h!=null&&(a.onclick=Wr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tr.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),s=u.slice(2,b?u.length-7:void 0),x=a[on]||null,x=x!=null?x[u]:null,typeof x=="function"&&a.removeEventListener(s,x,b),typeof h=="function")){typeof x!="function"&&x!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(s,h,b);break e}u in a?a[u]=h:h===!0?a.setAttribute(u,""):fa(a,u,h)}}}function pr(a,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":It("error",a),It("load",a);var h=!1,b=!1,x;for(x in u)if(u.hasOwnProperty(x)){var k=u[x];if(k!=null)switch(x){case"src":h=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:dn(a,s,x,k,u,null)}}b&&dn(a,s,"srcSet",u.srcSet,u,null),h&&dn(a,s,"src",u.src,u,null);return;case"input":It("invalid",a);var R=x=k=b=null,W=null,ae=null;for(h in u)if(u.hasOwnProperty(h)){var ge=u[h];if(ge!=null)switch(h){case"name":b=ge;break;case"type":k=ge;break;case"checked":W=ge;break;case"defaultChecked":ae=ge;break;case"value":x=ge;break;case"defaultValue":R=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,s));break;default:dn(a,s,h,ge,u,null)}}el(a,x,R,W,ae,k,b,!1);return;case"select":It("invalid",a),h=k=x=null;for(b in u)if(u.hasOwnProperty(b)&&(R=u[b],R!=null))switch(b){case"value":x=R;break;case"defaultValue":k=R;break;case"multiple":h=R;default:dn(a,s,b,R,u,null)}s=x,u=k,a.multiple=!!h,s!=null?ha(a,!!h,s,!1):u!=null&&ha(a,!!h,u,!0);return;case"textarea":It("invalid",a),x=b=h=null;for(k in u)if(u.hasOwnProperty(k)&&(R=u[k],R!=null))switch(k){case"value":h=R;break;case"defaultValue":b=R;break;case"children":x=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(91));break;default:dn(a,s,k,R,u,null)}ws(a,h,b,x);return;case"option":for(W in u)if(u.hasOwnProperty(W)&&(h=u[W],h!=null))switch(W){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:dn(a,s,W,h,u,null)}return;case"dialog":It("beforetoggle",a),It("toggle",a),It("cancel",a),It("close",a);break;case"iframe":case"object":It("load",a);break;case"video":case"audio":for(h=0;h<Pu.length;h++)It(Pu[h],a);break;case"image":It("error",a),It("load",a);break;case"details":It("toggle",a);break;case"embed":case"source":case"link":It("error",a),It("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in u)if(u.hasOwnProperty(ae)&&(h=u[ae],h!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:dn(a,s,ae,h,u,null)}return;default:if(Cs(s)){for(ge in u)u.hasOwnProperty(ge)&&(h=u[ge],h!==void 0&&vp(a,s,ge,h,u,void 0));return}}for(R in u)u.hasOwnProperty(R)&&(h=u[R],h!=null&&dn(a,s,R,h,u,null))}function EN(a,s,u,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,k=null,R=null,W=null,ae=null,ge=null;for(ce in u){var Ee=u[ce];if(u.hasOwnProperty(ce)&&Ee!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":W=Ee;default:h.hasOwnProperty(ce)||dn(a,s,ce,null,h,Ee)}}for(var ie in h){var ce=h[ie];if(Ee=u[ie],h.hasOwnProperty(ie)&&(ce!=null||Ee!=null))switch(ie){case"type":x=ce;break;case"name":b=ce;break;case"checked":ae=ce;break;case"defaultChecked":ge=ce;break;case"value":k=ce;break;case"defaultValue":R=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,s));break;default:ce!==Ee&&dn(a,s,ie,ce,h,Ee)}}Ji(a,k,R,W,ae,ge,x,b);return;case"select":ce=k=R=ie=null;for(x in u)if(W=u[x],u.hasOwnProperty(x)&&W!=null)switch(x){case"value":break;case"multiple":ce=W;default:h.hasOwnProperty(x)||dn(a,s,x,null,h,W)}for(b in h)if(x=h[b],W=u[b],h.hasOwnProperty(b)&&(x!=null||W!=null))switch(b){case"value":ie=x;break;case"defaultValue":R=x;break;case"multiple":k=x;default:x!==W&&dn(a,s,b,x,h,W)}s=R,u=k,h=ce,ie!=null?ha(a,!!u,ie,!1):!!h!=!!u&&(s!=null?ha(a,!!u,s,!0):ha(a,!!u,u?[]:"",!1));return;case"textarea":ce=ie=null;for(R in u)if(b=u[R],u.hasOwnProperty(R)&&b!=null&&!h.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:dn(a,s,R,null,h,b)}for(k in h)if(b=h[k],x=u[k],h.hasOwnProperty(k)&&(b!=null||x!=null))switch(k){case"value":ie=b;break;case"defaultValue":ce=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==x&&dn(a,s,k,b,h,x)}ii(a,ie,ce);return;case"option":for(var Be in u)if(ie=u[Be],u.hasOwnProperty(Be)&&ie!=null&&!h.hasOwnProperty(Be))switch(Be){case"selected":a.selected=!1;break;default:dn(a,s,Be,null,h,ie)}for(W in h)if(ie=h[W],ce=u[W],h.hasOwnProperty(W)&&ie!==ce&&(ie!=null||ce!=null))switch(W){case"selected":a.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:dn(a,s,W,ie,h,ce)}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 ft in u)ie=u[ft],u.hasOwnProperty(ft)&&ie!=null&&!h.hasOwnProperty(ft)&&dn(a,s,ft,null,h,ie);for(ae in h)if(ie=h[ae],ce=u[ae],h.hasOwnProperty(ae)&&ie!==ce&&(ie!=null||ce!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,s));break;default:dn(a,s,ae,ie,h,ce)}return;default:if(Cs(s)){for(var fn in u)ie=u[fn],u.hasOwnProperty(fn)&&ie!==void 0&&!h.hasOwnProperty(fn)&&vp(a,s,fn,void 0,h,ie);for(ge in h)ie=h[ge],ce=u[ge],!h.hasOwnProperty(ge)||ie===ce||ie===void 0&&ce===void 0||vp(a,s,ge,ie,h,ce);return}}for(var J in u)ie=u[J],u.hasOwnProperty(J)&&ie!=null&&!h.hasOwnProperty(J)&&dn(a,s,J,null,h,ie);for(Ee in h)ie=h[Ee],ce=u[Ee],!h.hasOwnProperty(Ee)||ie===ce||ie==null&&ce==null||dn(a,s,Ee,ie,h,ce)}function rE(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _N(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var b=u[h],x=b.transferSize,k=b.initiatorType,R=b.duration;if(x&&R&&rE(k)){for(k=0,R=b.responseEnd,h+=1;h<u.length;h++){var W=u[h],ae=W.startTime;if(ae>R)break;var ge=W.transferSize,Ee=W.initiatorType;ge&&rE(Ee)&&(W=W.responseEnd,k+=ge*(W<R?1:(R-ae)/(W-ae)))}if(--h,s+=8*(x+k)/(b.duration/1e3),a++,10<a)break}}if(0<a)return s/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var kp=null,wp=null;function Qd(a){return a.nodeType===9?a:a.ownerDocument}function aE(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function sE(a,s){if(a===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&s==="foreignObject"?0:a}function Cp(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Sp=null;function TN(){var a=window.event;return a&&a.type==="popstate"?a===Sp?!1:(Sp=a,!0):(Sp=null,!1)}var iE=typeof setTimeout=="function"?setTimeout:void 0,vN=typeof clearTimeout=="function"?clearTimeout:void 0,lE=typeof Promise=="function"?Promise:void 0,kN=typeof queueMicrotask=="function"?queueMicrotask:typeof lE<"u"?function(a){return lE.resolve(null).then(a).catch(wN)}:iE;function wN(a){setTimeout(function(){throw a})}function Si(a){return a==="head"}function oE(a,s){var u=s,h=0;do{var b=u.nextSibling;if(a.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(h===0){a.removeChild(b),vo(s);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Uu(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Uu(u);for(var x=u.firstChild;x;){var k=x.nextSibling,R=x.nodeName;x[es]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=k}}else u==="body"&&Uu(a.ownerDocument.body);u=b}while(u);vo(s)}function uE(a,s){var u=a;a=0;do{var h=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=h}while(u)}function Np(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Np(u),vr(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function CN(a,s,u,h){for(;a.nodeType===1;){var b=u;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[es])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(x=a.getAttribute("rel"),x==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(x!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(x=a.getAttribute("src"),(x!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&x&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var x=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===x)return a}else return a;if(a=Ta(a.nextSibling),a===null)break}return null}function SN(a,s,u){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Ta(a.nextSibling),a===null))return null;return a}function cE(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=Ta(a.nextSibling),a===null))return null;return a}function Ap(a){return a.data==="$?"||a.data==="$~"}function Rp(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function NN(a,s){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||u.readyState!=="loading")s();else{var h=function(){s(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}function Ta(a){for(;a!=null;a=a.nextSibling){var s=a.nodeType;if(s===1||s===3)break;if(s===8){if(s=a.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return a}var Lp=null;function dE(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(s===0)return Ta(a.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}a=a.nextSibling}return null}function fE(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return a;s--}else u!=="/$"&&u!=="/&"||s++}a=a.previousSibling}return null}function hE(a,s,u){switch(s=Qd(u),a){case"html":if(a=s.documentElement,!a)throw Error(r(452));return a;case"head":if(a=s.head,!a)throw Error(r(453));return a;case"body":if(a=s.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Uu(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);vr(a)}var va=new Map,mE=new Set;function Xd(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var $s=ee.d;ee.d={f:AN,r:RN,D:LN,C:IN,L:ON,m:DN,X:MN,S:jN,M:PN};function AN(){var a=$s.f(),s=zd();return a||s}function RN(a){var s=cr(a);s!==null&&s.tag===5&&s.type==="form"?Lx(s):$s.r(a)}var Eo=typeof document>"u"?null:document;function pE(a,s,u){var h=Eo;if(h&&typeof s=="string"&&s){var b=nr(s);b='link[rel="'+a+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),mE.has(b)||(mE.add(b),a={rel:a,crossOrigin:u,href:s},h.querySelector(b)===null&&(s=h.createElement("link"),pr(s,"link",a),un(s),h.head.appendChild(s)))}}function LN(a){$s.D(a),pE("dns-prefetch",a,null)}function IN(a,s){$s.C(a,s),pE("preconnect",a,s)}function ON(a,s,u){$s.L(a,s,u);var h=Eo;if(h&&a&&s){var b='link[rel="preload"][as="'+nr(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+nr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+nr(u.imageSizes)+'"]')):b+='[href="'+nr(a)+'"]';var x=b;switch(s){case"style":x=_o(a);break;case"script":x=To(a)}va.has(x)||(a=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:a,as:s},u),va.set(x,a),h.querySelector(b)!==null||s==="style"&&h.querySelector(Hu(x))||s==="script"&&h.querySelector(zu(x))||(s=h.createElement("link"),pr(s,"link",a),un(s),h.head.appendChild(s)))}}function DN(a,s){$s.m(a,s);var u=Eo;if(u&&a){var h=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+nr(h)+'"][href="'+nr(a)+'"]',x=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=To(a)}if(!va.has(x)&&(a=g({rel:"modulepreload",href:a},s),va.set(x,a),u.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(zu(x)))return}h=u.createElement("link"),pr(h,"link",a),un(h),u.head.appendChild(h)}}}function jN(a,s,u){$s.S(a,s,u);var h=Eo;if(h&&a){var b=ja(h).hoistableStyles,x=_o(a);s=s||"default";var k=b.get(x);if(!k){var R={loading:0,preload:null};if(k=h.querySelector(Hu(x)))R.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":s},u),(u=va.get(x))&&Ip(a,u);var W=k=h.createElement("link");un(W),pr(W,"link",a),W._p=new Promise(function(ae,ge){W.onload=ae,W.onerror=ge}),W.addEventListener("load",function(){R.loading|=1}),W.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Kd(k,s,h)}k={type:"stylesheet",instance:k,count:1,state:R},b.set(x,k)}}}function MN(a,s){$s.X(a,s);var u=Eo;if(u&&a){var h=ja(u).hoistableScripts,b=To(a),x=h.get(b);x||(x=u.querySelector(zu(b)),x||(a=g({src:a,async:!0},s),(s=va.get(b))&&Op(a,s),x=u.createElement("script"),un(x),pr(x,"link",a),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(b,x))}}function PN(a,s){$s.M(a,s);var u=Eo;if(u&&a){var h=ja(u).hoistableScripts,b=To(a),x=h.get(b);x||(x=u.querySelector(zu(b)),x||(a=g({src:a,async:!0,type:"module"},s),(s=va.get(b))&&Op(a,s),x=u.createElement("script"),un(x),pr(x,"link",a),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(b,x))}}function gE(a,s,u,h){var b=(b=_e.current)?Xd(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=_o(u.href),u=ja(b).hoistableStyles,h=u.get(s),h||(h={type:"style",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=_o(u.href);var x=ja(b).hoistableStyles,k=x.get(a);if(k||(b=b.ownerDocument||b,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(a,k),(x=b.querySelector(Hu(a)))&&!x._p&&(k.instance=x,k.state.loading=5),va.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},va.set(a,u),x||BN(b,a,u,k.state))),s&&h===null)throw Error(r(528,""));return k}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=To(u),u=ja(b).hoistableScripts,h=u.get(s),h||(h={type:"script",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function _o(a){return'href="'+nr(a)+'"'}function Hu(a){return'link[rel="stylesheet"]['+a+"]"}function bE(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function BN(a,s,u,h){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=a.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),pr(s,"link",u),un(s),a.head.appendChild(s))}function To(a){return'[src="'+nr(a)+'"]'}function zu(a){return"script[async]"+a}function xE(a,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var h=a.querySelector('style[data-href~="'+nr(u.href)+'"]');if(h)return s.instance=h,un(h),h;var b=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),un(h),pr(h,"style",b),Kd(h,u.precedence,a),s.instance=h;case"stylesheet":b=_o(u.href);var x=a.querySelector(Hu(b));if(x)return s.state.loading|=4,s.instance=x,un(x),x;h=bE(u),(b=va.get(b))&&Ip(h,b),x=(a.ownerDocument||a).createElement("link"),un(x);var k=x;return k._p=new Promise(function(R,W){k.onload=R,k.onerror=W}),pr(x,"link",h),s.state.loading|=4,Kd(x,u.precedence,a),s.instance=x;case"script":return x=To(u.src),(b=a.querySelector(zu(x)))?(s.instance=b,un(b),b):(h=u,(b=va.get(x))&&(h=g({},u),Op(h,b)),a=a.ownerDocument||a,b=a.createElement("script"),un(b),pr(b,"link",h),a.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(h=s.instance,s.state.loading|=4,Kd(h,u.precedence,a));return s.instance}function Kd(a,s,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,x=b,k=0;k<h.length;k++){var R=h[k];if(R.dataset.precedence===s)x=R;else if(x!==b)break}x?x.parentNode.insertBefore(a,x.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(a,s.firstChild))}function Ip(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function Op(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var Zd=null;function yE(a,s,u){if(Zd===null){var h=new Map,b=Zd=new Map;b.set(u,h)}else b=Zd,h=b.get(u),h||(h=new Map,b.set(u,h));if(h.has(a))return h;for(h.set(a,null),u=u.getElementsByTagName(a),b=0;b<u.length;b++){var x=u[b];if(!(x[es]||x[ln]||a==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var k=x.getAttribute(s)||"";k=a+k;var R=h.get(k);R?R.push(x):h.set(k,[x])}}return h}function EE(a,s,u){a=a.ownerDocument||a,a.head.insertBefore(u,s==="title"?a.querySelector("head > title"):null)}function UN(a,s,u){if(u===1||s.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return a=s.disabled,typeof s.precedence=="string"&&a==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function _E(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function HN(a,s,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=_o(h.href),x=s.querySelector(Hu(b));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=Jd.bind(a),s.then(a,a)),u.state.loading|=4,u.instance=x,un(x);return}x=s.ownerDocument||s,h=bE(h),(b=va.get(b))&&Ip(h,b),x=x.createElement("link"),un(x);var k=x;k._p=new Promise(function(R,W){k.onload=R,k.onerror=W}),pr(x,"link",h),u.instance=x}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=Jd.bind(a),s.addEventListener("load",u),s.addEventListener("error",u))}}var Dp=0;function zN(a,s){return a.stylesheets&&a.count===0&&tf(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var h=setTimeout(function(){if(a.stylesheets&&tf(a,a.stylesheets),a.unsuspend){var x=a.unsuspend;a.unsuspend=null,x()}},6e4+s);0<a.imgBytes&&Dp===0&&(Dp=62500*_N());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&tf(a,a.stylesheets),a.unsuspend)){var x=a.unsuspend;a.unsuspend=null,x()}},(a.imgBytes>Dp?50:800)+s);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(b)}}:null}function Jd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tf(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var ef=null;function tf(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,ef=new Map,s.forEach(FN,a),ef=null,Jd.call(a))}function FN(a,s){if(!(s.state.loading&4)){var u=ef.get(a);if(u)var h=u.get(null);else{u=new Map,ef.set(a,u);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var k=b[x];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(u.set(k.dataset.precedence,k),h=k)}h&&u.set(null,h)}b=s.instance,k=b.getAttribute("data-precedence"),x=u.get(k)||h,x===h&&u.set(null,b),u.set(k,b),this.count++,h=Jd.bind(this),b.addEventListener("load",h),b.addEventListener("error",h),x?x.parentNode.insertBefore(b,x.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),s.state.loading|=4}}var Fu={$$typeof:A,Provider:null,Consumer:null,_currentValue:Te,_currentValue2:Te,_threadCount:0};function $N(a,s,u,h,b,x,k,R,W){this.tag=1,this.containerInfo=a,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=ua(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ua(0),this.hiddenUpdates=ua(null),this.identifierPrefix=h,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function TE(a,s,u,h,b,x,k,R,W,ae,ge,Ee){return a=new $N(a,s,u,k,W,ae,ge,Ee,R),s=1,x===!0&&(s|=24),x=Zr(3,null,null,s),a.current=x,x.stateNode=a,s=hm(),s.refCount++,a.pooledCache=s,s.refCount++,x.memoizedState={element:h,isDehydrated:u,cache:s},bm(x),a}function vE(a){return a?(a=Zl,a):Zl}function kE(a,s,u,h,b,x){b=vE(b),h.context===null?h.context=b:h.pendingContext=b,h=gi(s),h.payload={element:u},x=x===void 0?null:x,x!==null&&(h.callback=x),u=bi(a,h,s),u!==null&&(zr(u,a,s),Eu(u,a,s))}function wE(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<s?u:s}}function jp(a,s){wE(a,s),(a=a.alternate)&&wE(a,s)}function CE(a){if(a.tag===13||a.tag===31){var s=ll(a,67108864);s!==null&&zr(s,a,67108864),jp(a,67108864)}}function SE(a){if(a.tag===13||a.tag===31){var s=ra();s=ni(s);var u=ll(a,s);u!==null&&zr(u,a,s),jp(a,s)}}var nf=!0;function VN(a,s,u,h){var b=z.T;z.T=null;var x=ee.p;try{ee.p=2,Mp(a,s,u,h)}finally{ee.p=x,z.T=b}}function GN(a,s,u,h){var b=z.T;z.T=null;var x=ee.p;try{ee.p=8,Mp(a,s,u,h)}finally{ee.p=x,z.T=b}}function Mp(a,s,u,h){if(nf){var b=Pp(h);if(b===null)Tp(a,s,h,rf,u),AE(a,h);else if(YN(b,a,s,u,h))h.stopPropagation();else if(AE(a,h),s&4&&-1<qN.indexOf(a)){for(;b!==null;){var x=cr(b);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=nt(x.pendingLanes);if(k!==0){var R=x;for(R.pendingLanes|=2,R.entangledLanes|=2;k;){var W=1<<31-Pe(k);R.entanglements[1]|=W,k&=~W}us(x),(Zt&6)===0&&(Ud=Bt()+500,Mu(0))}}break;case 31:case 13:R=ll(x,2),R!==null&&zr(R,x,2),zd(),jp(x,2)}if(x=Pp(h),x===null&&Tp(a,s,h,rf,u),x===b)break;b=x}b!==null&&h.stopPropagation()}else Tp(a,s,h,null,u)}}function Pp(a){return a=rs(a),Bp(a)}var rf=null;function Bp(a){if(rf=null,a=ca(a),a!==null){var s=l(a);if(s===null)a=null;else{var u=s.tag;if(u===13){if(a=o(s),a!==null)return a;a=null}else if(u===31){if(a=c(s),a!==null)return a;a=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return rf=a,null}function NE(a){switch(a){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(Zn()){case pe:return 2;case Ce:return 8;case Qe:case lt:return 32;case xt:return 268435456;default:return 32}default:return 32}}var Up=!1,Ni=null,Ai=null,Ri=null,$u=new Map,Vu=new Map,Li=[],qN="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 AE(a,s){switch(a){case"focusin":case"focusout":Ni=null;break;case"dragenter":case"dragleave":Ai=null;break;case"mouseover":case"mouseout":Ri=null;break;case"pointerover":case"pointerout":$u.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vu.delete(s.pointerId)}}function Gu(a,s,u,h,b,x){return a===null||a.nativeEvent!==x?(a={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:x,targetContainers:[b]},s!==null&&(s=cr(s),s!==null&&CE(s)),a):(a.eventSystemFlags|=h,s=a.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),a)}function YN(a,s,u,h,b){switch(s){case"focusin":return Ni=Gu(Ni,a,s,u,h,b),!0;case"dragenter":return Ai=Gu(Ai,a,s,u,h,b),!0;case"mouseover":return Ri=Gu(Ri,a,s,u,h,b),!0;case"pointerover":var x=b.pointerId;return $u.set(x,Gu($u.get(x)||null,a,s,u,h,b)),!0;case"gotpointercapture":return x=b.pointerId,Vu.set(x,Gu(Vu.get(x)||null,a,s,u,h,b)),!0}return!1}function RE(a){var s=ca(a.target);if(s!==null){var u=l(s);if(u!==null){if(s=u.tag,s===13){if(s=o(u),s!==null){a.blockedOn=s,vs(a.priority,function(){SE(u)});return}}else if(s===31){if(s=c(u),s!==null){a.blockedOn=s,vs(a.priority,function(){SE(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function af(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var u=Pp(a.nativeEvent);if(u===null){u=a.nativeEvent;var h=new u.constructor(u.type,u);Pa=h,u.target.dispatchEvent(h),Pa=null}else return s=cr(u),s!==null&&CE(s),a.blockedOn=u,!1;s.shift()}return!0}function LE(a,s,u){af(a)&&u.delete(s)}function WN(){Up=!1,Ni!==null&&af(Ni)&&(Ni=null),Ai!==null&&af(Ai)&&(Ai=null),Ri!==null&&af(Ri)&&(Ri=null),$u.forEach(LE),Vu.forEach(LE)}function sf(a,s){a.blockedOn===s&&(a.blockedOn=null,Up||(Up=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,WN)))}var lf=null;function IE(a){lf!==a&&(lf=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lf===a&&(lf=null);for(var s=0;s<a.length;s+=3){var u=a[s],h=a[s+1],b=a[s+2];if(typeof h!="function"){if(Bp(h||u)===null)continue;break}var x=cr(u);x!==null&&(a.splice(s,3),s-=3,Pm(x,{pending:!0,data:b,method:u.method,action:h},h,b))}}))}function vo(a){function s(W){return sf(W,a)}Ni!==null&&sf(Ni,a),Ai!==null&&sf(Ai,a),Ri!==null&&sf(Ri,a),$u.forEach(s),Vu.forEach(s);for(var u=0;u<Li.length;u++){var h=Li[u];h.blockedOn===a&&(h.blockedOn=null)}for(;0<Li.length&&(u=Li[0],u.blockedOn===null);)RE(u),u.blockedOn===null&&Li.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var b=u[h],x=u[h+1],k=b[on]||null;if(typeof x=="function")k||IE(u);else if(k){var R=null;if(x&&x.hasAttribute("formAction")){if(b=x,k=x[on]||null)R=k.formAction;else if(Bp(b)!==null)continue}else R=k.action;typeof R=="function"?u[h+1]=R:(u.splice(h,3),h-=3),IE(u)}}}function OE(){function a(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(k){return b=k})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function Hp(a){this._internalRoot=a}of.prototype.render=Hp.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,h=ra();kE(u,h,a,s,null,null)},of.prototype.unmount=Hp.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;kE(a.current,2,null,a,null,null),zd(),s[Nt]=null}};function of(a){this._internalRoot=a}of.prototype.unstable_scheduleHydration=function(a){if(a){var s=Ja();a={blockedOn:null,target:a,priority:s};for(var u=0;u<Li.length&&s!==0&&s<Li[u].priority;u++);Li.splice(u,0,a),u===0&&RE(a)}};var DE=t.version;if(DE!=="19.2.5")throw Error(r(527,DE,"19.2.5"));ee.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=m(s),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var QN={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uf.isDisabled&&uf.supportsFiber)try{xe=uf.inject(QN),Se=uf}catch{}}return Yu.createRoot=function(a,s){if(!i(a))throw Error(r(299));var u=!1,h="",b=zx,x=Fx,k=$x;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError)),s=TE(a,1,!1,null,null,u,h,null,b,x,k,OE),a[Nt]=s.current,_p(a),new Hp(s)},Yu.hydrateRoot=function(a,s,u){if(!i(a))throw Error(r(299));var h=!1,b="",x=zx,k=Fx,R=$x,W=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(R=u.onRecoverableError),u.formState!==void 0&&(W=u.formState)),s=TE(a,1,!0,s,u??null,h,b,W,x,k,R,OE),s.context=vE(null),u=s.current,h=ra(),h=ni(h),b=gi(h),b.callback=null,bi(u,b,h),u=h,s.current.lanes=u,An(s,u),us(s),a[Nt]=s.current,_p(a),new of(s)},Yu.version="19.2.5",Yu}var qE;function uA(){if(qE)return Gp.exports;qE=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(t){console.error(t)}}return e(),Gp.exports=oA(),Gp.exports}var cA=uA();const dA=Eh(cA);/**
51
+ * react-router v7.14.0
52
+ *
53
+ * Copyright (c) Remix Software Inc.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE.md file in the root directory of this source tree.
57
+ *
58
+ * @license MIT
59
+ */var YE="popstate";function WE(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function fA(e={}){function t(r,i){var m;let l=(m=i.state)==null?void 0:m.masked,{pathname:o,search:c,hash:d}=l||r.location;return K0("",{pathname:o,search:c,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:kc(i)}return mA(t,n,null,e)}function Nn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function La(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hA(){return Math.random().toString(36).substring(2,10)}function QE(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function K0(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?qo(t):t,state:n,key:t&&t.key||r||hA(),unstable_mask:i}}function kc({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function qo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function mA(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:l=!1}=r,o=i.history,c="POP",d=null,m=p();m==null&&(m=0,o.replaceState({...o.state,idx:m},""));function p(){return(o.state||{idx:null}).idx}function g(){c="POP";let C=p(),S=C==null?null:C-m;m=C,d&&d({action:c,location:w.location,delta:S})}function y(C,S){c="PUSH";let N=WE(C)?C:K0(w.location,C,S);m=p()+1;let A=QE(N,m),H=w.createHref(N.unstable_mask||N);try{o.pushState(A,"",H)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;i.location.assign(H)}l&&d&&d({action:c,location:w.location,delta:1})}function E(C,S){c="REPLACE";let N=WE(C)?C:K0(w.location,C,S);m=p();let A=QE(N,m),H=w.createHref(N.unstable_mask||N);o.replaceState(A,"",H),l&&d&&d({action:c,location:w.location,delta:0})}function v(C){return pA(C)}let w={get action(){return c},get location(){return e(i,o)},listen(C){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(YE,g),d=C,()=>{i.removeEventListener(YE,g),d=null}},createHref(C){return t(i,C)},createURL:v,encodeLocation(C){let S=v(C);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:E,go(C){return o.go(C)}};return w}function pA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Nn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:kc(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function pv(e,t,n="/"){return gA(e,t,n,!1)}function gA(e,t,n,r){let i=typeof t=="string"?qo(t):t,l=Zs(i.pathname||"/",n);if(l==null)return null;let o=gv(e);bA(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let m=NA(l);c=CA(o[d],m,r)}return c}function gv(e,t=[],n=[],r="",i=!1){let l=(o,c,d=i,m)=>{let p={relativePath:m===void 0?o.path||"":m,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&d)return;Nn(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let g=ps([r,p.relativePath]),y=n.concat(p);o.children&&o.children.length>0&&(Nn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),gv(o.children,t,y,g,d)),!(o.path==null&&!o.index)&&t.push({path:g,score:kA(g,o.index),routesMeta:y})};return e.forEach((o,c)=>{var d;if(o.path===""||!((d=o.path)!=null&&d.includes("?")))l(o,c);else for(let m of bv(o.path))l(o,c,!0,m)}),t}function bv(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let o=bv(r.join("/")),c=[];return c.push(...o.map(d=>d===""?l:[l,d].join("/"))),i&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function bA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:wA(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var xA=/^:[\w-]+$/,yA=3,EA=2,_A=1,TA=10,vA=-2,XE=e=>e==="*";function kA(e,t){let n=e.split("/"),r=n.length;return n.some(XE)&&(r+=vA),t&&(r+=EA),n.filter(i=>!XE(i)).reduce((i,l)=>i+(xA.test(l)?yA:l===""?_A:TA),r)}function wA(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function CA(e,t,n=!1){let{routesMeta:r}=e,i={},l="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],m=c===r.length-1,p=l==="/"?t:t.slice(l.length)||"/",g=Yf({path:d.relativePath,caseSensitive:d.caseSensitive,end:m},p),y=d.route;if(!g&&m&&n&&!r[r.length-1].route.index&&(g=Yf({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!g)return null;Object.assign(i,g.params),o.push({params:i,pathname:ps([l,g.pathname]),pathnameBase:IA(ps([l,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(l=ps([l,g.pathnameBase]))}return o}function Yf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=SA(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],o=l.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:r.reduce((m,{paramName:p,isOptional:g},y)=>{if(p==="*"){let v=c[y]||"";o=l.slice(0,l.length-v.length).replace(/(.)\/+$/,"$1")}const E=c[y];return g&&!E?m[p]=void 0:m[p]=(E||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:o,pattern:e}}function SA(e,t=!1,n=!0){La(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,d,m,p)=>{if(r.push({paramName:c,isOptional:d!=null}),d){let g=p.charAt(m+o.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function NA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return La(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Zs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var AA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function RA(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?qo(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=KE(n.substring(1),"/"):l=KE(n,t)):l=t,{pathname:l,search:OA(r),hash:DA(i)}}function KE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Qp(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function LA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Zg(e){let t=LA(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function _h(e,t,n,r=!1){let i;typeof e=="string"?i=qo(e):(i={...e},Nn(!i.pathname||!i.pathname.includes("?"),Qp("?","pathname","search",i)),Nn(!i.pathname||!i.pathname.includes("#"),Qp("#","pathname","hash",i)),Nn(!i.search||!i.search.includes("#"),Qp("#","search","hash",i)));let l=e===""||i.pathname==="",o=l?"/":i.pathname,c;if(o==null)c=n;else{let g=t.length-1;if(!r&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),g-=1;i.pathname=y.join("/")}c=g>=0?t[g]:"/"}let d=RA(i,c),m=o&&o!=="/"&&o.endsWith("/"),p=(l||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(m||p)&&(d.pathname+="/"),d}var ps=e=>e.join("/").replace(/\/\/+/g,"/"),IA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),OA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,jA=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function MA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function PA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var xv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yv(e,t){let n=e;if(typeof n!="string"||!AA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(xv)try{let l=new URL(window.location.href),o=n.startsWith("//")?new URL(l.protocol+n):new URL(n),c=Zs(o.pathname,t);o.origin===l.origin&&c!=null?n=c+o.search+o.hash:i=!0}catch{La(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ev=["POST","PUT","PATCH","DELETE"];new Set(Ev);var BA=["GET",...Ev];new Set(BA);var Yo=T.createContext(null);Yo.displayName="DataRouter";var Th=T.createContext(null);Th.displayName="DataRouterState";var _v=T.createContext(!1);function UA(){return T.useContext(_v)}var Tv=T.createContext({isTransitioning:!1});Tv.displayName="ViewTransition";var HA=T.createContext(new Map);HA.displayName="Fetchers";var zA=T.createContext(null);zA.displayName="Await";var la=T.createContext(null);la.displayName="Navigation";var jc=T.createContext(null);jc.displayName="Location";var Oa=T.createContext({outlet:null,matches:[],isDataRoute:!1});Oa.displayName="Route";var Jg=T.createContext(null);Jg.displayName="RouteError";var vv="REACT_ROUTER_ERROR",FA="REDIRECT",$A="ROUTE_ERROR_RESPONSE";function VA(e){if(e.startsWith(`${vv}:${FA}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function GA(e){if(e.startsWith(`${vv}:${$A}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new jA(t.status,t.statusText,t.data)}catch{}}function qA(e,{relative:t}={}){Nn(Wo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(la),{hash:i,pathname:l,search:o}=Mc(e,{relative:t}),c=l;return n!=="/"&&(c=l==="/"?n:ps([n,l])),r.createHref({pathname:c,search:o,hash:i})}function Wo(){return T.useContext(jc)!=null}function oa(){return Nn(Wo(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(jc).location}var kv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wv(e){T.useContext(la).static||T.useLayoutEffect(e)}function Xa(){let{isDataRoute:e}=T.useContext(Oa);return e?o5():YA()}function YA(){Nn(Wo(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(Yo),{basename:t,navigator:n}=T.useContext(la),{matches:r}=T.useContext(Oa),{pathname:i}=oa(),l=JSON.stringify(Zg(r)),o=T.useRef(!1);return wv(()=>{o.current=!0}),T.useCallback((d,m={})=>{if(La(o.current,kv),!o.current)return;if(typeof d=="number"){n.go(d);return}let p=_h(d,JSON.parse(l),i,m.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:ps([t,p.pathname])),(m.replace?n.replace:n.push)(p,m.state,m)},[t,n,l,i,e])}var WA=T.createContext(null);function QA(e){let t=T.useContext(Oa).outlet;return T.useMemo(()=>t&&T.createElement(WA.Provider,{value:e},t),[t,e])}function XA(){let{matches:e}=T.useContext(Oa),t=e[e.length-1];return t?t.params:{}}function Mc(e,{relative:t}={}){let{matches:n}=T.useContext(Oa),{pathname:r}=oa(),i=JSON.stringify(Zg(n));return T.useMemo(()=>_h(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function KA(e,t){return Cv(e,t)}function Cv(e,t,n){var C;Nn(Wo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(la),{matches:i}=T.useContext(Oa),l=i[i.length-1],o=l?l.params:{},c=l?l.pathname:"/",d=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";Nv(c,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=oa(),g;if(t){let S=typeof t=="string"?qo(t):t;Nn(d==="/"||((C=S.pathname)==null?void 0:C.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${S.pathname}" was given in the \`location\` prop.`),g=S}else g=p;let y=g.pathname||"/",E=y;if(d!=="/"){let S=d.replace(/^\//,"").split("/");E="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=pv(e,{pathname:E});La(m||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),La(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=n5(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:ps([d,r.encodeLocation?r.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?d:ps([d,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,n);return t&&w?T.createElement(jc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},w):w}function ZA(){let e=l5(),t=MA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:l},"ErrorBoundary")," or"," ",T.createElement("code",{style:l},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:i},n):null,o)}var JA=T.createElement(ZA,null),Sv=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=GA(e.digest);n&&(e=n)}let t=e!==void 0?T.createElement(Oa.Provider,{value:this.props.routeContext},T.createElement(Jg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(e5,{error:e},t):t}};Sv.contextType=_v;var Xp=new WeakMap;function e5({children:e,error:t}){let{basename:n}=T.useContext(la);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=VA(t.digest);if(r){let i=Xp.get(t);if(i)throw i;let l=yv(r.location,n);if(xv&&!Xp.get(t))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw Xp.set(t,o),o}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function t5({routeContext:e,match:t,children:n}){let r=T.useContext(Yo);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(Oa.Provider,{value:e},n)}function n5(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,l=r==null?void 0:r.errors;if(l!=null){let p=i.findIndex(g=>g.route.id&&(l==null?void 0:l[g.route.id])!==void 0);Nn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,p+1))}let o=!1,c=-1;if(n&&r){o=r.renderFallback;for(let p=0;p<i.length;p++){let g=i[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=p),g.route.id){let{loaderData:y,errors:E}=r,v=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!E||E[g.route.id]===void 0);if(g.route.lazy||v){n.isStatic&&(o=!0),c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let d=n==null?void 0:n.onError,m=r&&d?(p,g)=>{var y,E;d(p,{location:r.location,params:((E=(y=r.matches)==null?void 0:y[0])==null?void 0:E.params)??{},unstable_pattern:PA(r.matches),errorInfo:g})}:void 0;return i.reduceRight((p,g,y)=>{let E,v=!1,w=null,C=null;r&&(E=l&&g.route.id?l[g.route.id]:void 0,w=g.route.errorElement||JA,o&&(c<0&&y===0?(Nv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,C=null):c===y&&(v=!0,C=g.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,y+1)),N=()=>{let A;return E?A=w:v?A=C:g.route.Component?A=T.createElement(g.route.Component,null):g.route.element?A=g.route.element:A=p,T.createElement(t5,{match:g,routeContext:{outlet:p,matches:S,isDataRoute:r!=null},children:A})};return r&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?T.createElement(Sv,{location:r.location,revalidation:r.revalidation,component:w,error:E,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):N()},null)}function e1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function r5(e){let t=T.useContext(Yo);return Nn(t,e1(e)),t}function a5(e){let t=T.useContext(Th);return Nn(t,e1(e)),t}function s5(e){let t=T.useContext(Oa);return Nn(t,e1(e)),t}function t1(e){let t=s5(e),n=t.matches[t.matches.length-1];return Nn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function i5(){return t1("useRouteId")}function l5(){var r;let e=T.useContext(Jg),t=a5("useRouteError"),n=t1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function o5(){let{router:e}=r5("useNavigate"),t=t1("useNavigate"),n=T.useRef(!1);return wv(()=>{n.current=!0}),T.useCallback(async(i,l={})=>{La(n.current,kv),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var ZE={};function Nv(e,t,n){!t&&!ZE[e]&&(ZE[e]=!0,La(!1,n))}T.memo(u5);function u5({routes:e,future:t,state:n,isStatic:r,onError:i}){return Cv(e,void 0,{state:n,isStatic:r,onError:i})}function c5({to:e,replace:t,state:n,relative:r}){Nn(Wo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=T.useContext(la);La(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=T.useContext(Oa),{pathname:o}=oa(),c=Xa(),d=_h(e,Zg(l),o,r==="path"),m=JSON.stringify(d);return T.useEffect(()=>{c(JSON.parse(m),{replace:t,state:n,relative:r})},[c,m,r,t,n]),null}function d5(e){return QA(e.context)}function Ys(e){Nn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function f5({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:l=!1,unstable_useTransitions:o}){Nn(!Wo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=T.useMemo(()=>({basename:c,navigator:i,static:l,unstable_useTransitions:o,future:{}}),[c,i,l,o]);typeof n=="string"&&(n=qo(n));let{pathname:m="/",search:p="",hash:g="",state:y=null,key:E="default",unstable_mask:v}=n,w=T.useMemo(()=>{let C=Zs(m,c);return C==null?null:{location:{pathname:C,search:p,hash:g,state:y,key:E,unstable_mask:v},navigationType:r}},[c,m,p,g,y,E,r,v]);return La(w!=null,`<Router basename="${c}"> is not able to match the URL "${m}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:T.createElement(la.Provider,{value:d},T.createElement(jc.Provider,{children:t,value:w}))}function h5({children:e,location:t}){return KA(Z0(e),t)}function Z0(e,t=[]){let n=[];return T.Children.forEach(e,(r,i)=>{if(!T.isValidElement(r))return;let l=[...t,i];if(r.type===T.Fragment){n.push.apply(n,Z0(r.props.children,l));return}Nn(r.type===Ys,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Nn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Z0(r.props.children,l)),n.push(o)}),n}var Mf="get",Pf="application/x-www-form-urlencoded";function vh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function m5(e){return vh(e)&&e.tagName.toLowerCase()==="button"}function p5(e){return vh(e)&&e.tagName.toLowerCase()==="form"}function g5(e){return vh(e)&&e.tagName.toLowerCase()==="input"}function b5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function x5(e,t){return e.button===0&&(!t||t==="_self")&&!b5(e)}function J0(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function y5(e,t){let n=J0(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}var cf=null;function E5(){if(cf===null)try{new FormData(document.createElement("form"),0),cf=!1}catch{cf=!0}return cf}var _5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kp(e){return e!=null&&!_5.has(e)?(La(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pf}"`),null):e}function T5(e,t){let n,r,i,l,o;if(p5(e)){let c=e.getAttribute("action");r=c?Zs(c,t):null,n=e.getAttribute("method")||Mf,i=Kp(e.getAttribute("enctype"))||Pf,l=new FormData(e)}else if(m5(e)||g5(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||c.getAttribute("action");if(r=d?Zs(d,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Mf,i=Kp(e.getAttribute("formenctype"))||Kp(c.getAttribute("enctype"))||Pf,l=new FormData(c,e),!E5()){let{name:m,type:p,value:g}=e;if(p==="image"){let y=m?`${m}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else m&&l.append(m,g)}}else{if(vh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Mf,r=null,i=Pf,o=e}return l&&i==="text/plain"&&(o=l,l=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:l,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function n1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Av(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&Zs(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function v5(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function k5(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function w5(e,t,n){let r=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let o=await v5(l,n);return o.links?o.links():[]}return[]}));return A5(r.flat(1).filter(k5).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function JE(e,t,n,r,i,l){let o=(d,m)=>n[m]?d.route.id!==n[m].route.id:!0,c=(d,m)=>{var p;return n[m].pathname!==d.pathname||((p=n[m].route.path)==null?void 0:p.endsWith("*"))&&n[m].params["*"]!==d.params["*"]};return l==="assets"?t.filter((d,m)=>o(d,m)||c(d,m)):l==="data"?t.filter((d,m)=>{var g;let p=r.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(o(d,m)||c(d,m))return!0;if(d.route.shouldRevalidate){let y=d.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function C5(e,t,{includeHydrateFallback:n}={}){return S5(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let l=[i.module];return i.clientActionModule&&(l=l.concat(i.clientActionModule)),i.clientLoaderModule&&(l=l.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(l=l.concat(i.hydrateFallbackModule)),i.imports&&(l=l.concat(i.imports)),l}).flat(1))}function S5(e){return[...new Set(e)]}function N5(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function A5(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let l=JSON.stringify(N5(i));return n.has(l)||(n.add(l),r.push({key:l,link:i})),r},[])}function r1(){let e=T.useContext(Yo);return n1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function R5(){let e=T.useContext(Th);return n1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var a1=T.createContext(void 0);a1.displayName="FrameworkContext";function s1(){let e=T.useContext(a1);return n1(e,"You must render this element inside a <HydratedRouter> element"),e}function L5(e,t){let n=T.useContext(a1),[r,i]=T.useState(!1),[l,o]=T.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:m,onMouseLeave:p,onTouchStart:g}=t,y=T.useRef(null);T.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=S=>{S.forEach(N=>{o(N.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),T.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let E=()=>{i(!0)},v=()=>{i(!1),o(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:Wu(c,E),onBlur:Wu(d,v),onMouseEnter:Wu(m,E),onMouseLeave:Wu(p,v),onTouchStart:Wu(g,E)}]:[!1,y,{}]}function Wu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function I5({page:e,...t}){let n=UA(),{router:r}=r1(),i=T.useMemo(()=>pv(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?T.createElement(D5,{page:e,matches:i,...t}):T.createElement(j5,{page:e,matches:i,...t}):null}function O5(e){let{manifest:t,routeModules:n}=s1(),[r,i]=T.useState([]);return T.useEffect(()=>{let l=!1;return w5(e,t,n).then(o=>{l||i(o)}),()=>{l=!0}},[e,t,n]),r}function D5({page:e,matches:t,...n}){let r=oa(),{future:i}=s1(),{basename:l}=r1(),o=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let c=Av(e,l,i.unstable_trailingSlashAwareDataRequests,"rsc"),d=!1,m=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?d=!0:m.push(p.route.id);return d&&m.length>0&&c.searchParams.set("_routes",m.join(",")),[c.pathname+c.search]},[l,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return T.createElement(T.Fragment,null,o.map(c=>T.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...n})))}function j5({page:e,matches:t,...n}){let r=oa(),{future:i,manifest:l,routeModules:o}=s1(),{basename:c}=r1(),{loaderData:d,matches:m}=R5(),p=T.useMemo(()=>JE(e,t,m,l,r,"data"),[e,t,m,l,r]),g=T.useMemo(()=>JE(e,t,m,l,r,"assets"),[e,t,m,l,r]),y=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(N=>{var H;let A=l.routes[N.route.id];!A||!A.hasLoader||(!p.some($=>$.route.id===N.route.id)&&N.route.id in d&&((H=o[N.route.id])!=null&&H.shouldRevalidate)||A.hasClientLoader?C=!0:w.add(N.route.id))}),w.size===0)return[];let S=Av(e,c,i.unstable_trailingSlashAwareDataRequests,"data");return C&&w.size>0&&S.searchParams.set("_routes",t.filter(N=>w.has(N.route.id)).map(N=>N.route.id).join(",")),[S.pathname+S.search]},[c,i.unstable_trailingSlashAwareDataRequests,d,r,l,p,t,e,o]),E=T.useMemo(()=>C5(g,l),[g,l]),v=O5(g);return T.createElement(T.Fragment,null,y.map(w=>T.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),E.map(w=>T.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),v.map(({key:w,link:C})=>T.createElement("link",{key:w,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function M5(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var P5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{P5&&(window.__reactRouterVersion="7.14.0")}catch{}function B5({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=T.useRef();i.current==null&&(i.current=fA({window:r,v5Compat:!0}));let l=i.current,[o,c]=T.useState({action:l.action,location:l.location}),d=T.useCallback(m=>{n===!1?c(m):T.startTransition(()=>c(m))},[n]);return T.useLayoutEffect(()=>l.listen(d),[l,d]),T.createElement(f5,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var Rv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Js=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:l,replace:o,unstable_mask:c,state:d,target:m,to:p,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:E,...v},w){let{basename:C,navigator:S,unstable_useTransitions:N}=T.useContext(la),A=typeof p=="string"&&Rv.test(p),H=yv(p,C);p=H.to;let $=qA(p,{relative:i}),U=oa(),P=null;if(c){let ne=_h(c,[],U.unstable_mask?U.unstable_mask.pathname:"/",!0);C!=="/"&&(ne.pathname=ne.pathname==="/"?C:ps([C,ne.pathname])),P=S.createHref(ne)}let[Y,fe,M]=L5(r,v),K=F5(p,{replace:o,unstable_mask:c,state:d,target:m,preventScrollReset:g,relative:i,viewTransition:y,unstable_defaultShouldRevalidate:E,unstable_useTransitions:N});function V(ne){t&&t(ne),ne.defaultPrevented||K(ne)}let he=!(H.isExternal||l),de=T.createElement("a",{...v,...M,href:(he?P:void 0)||H.absoluteURL||$,onClick:he?V:t,ref:M5(w,fe),target:m,"data-discover":!A&&n==="render"?"true":void 0});return Y&&!A?T.createElement(T.Fragment,null,de,T.createElement(I5,{page:$})):de});Js.displayName="Link";var U5=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:l,to:o,viewTransition:c,children:d,...m},p){let g=Mc(o,{relative:m.relative}),y=oa(),E=T.useContext(Th),{navigator:v,basename:w}=T.useContext(la),C=E!=null&&Y5(g)&&c===!0,S=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,N=y.pathname,A=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(N=N.toLowerCase(),A=A?A.toLowerCase():null,S=S.toLowerCase()),A&&w&&(A=Zs(A,w)||A);const H=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let $=N===S||!i&&N.startsWith(S)&&N.charAt(H)==="/",U=A!=null&&(A===S||!i&&A.startsWith(S)&&A.charAt(S.length)==="/"),P={isActive:$,isPending:U,isTransitioning:C},Y=$?t:void 0,fe;typeof r=="function"?fe=r(P):fe=[r,$?"active":null,U?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let M=typeof l=="function"?l(P):l;return T.createElement(Js,{...m,"aria-current":Y,className:fe,ref:p,style:M,to:o,viewTransition:c},typeof d=="function"?d(P):d)});U5.displayName="NavLink";var H5=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:l,method:o=Mf,action:c,onSubmit:d,relative:m,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:y,...E},v)=>{let{unstable_useTransitions:w}=T.useContext(la),C=G5(),S=q5(c,{relative:m}),N=o.toLowerCase()==="get"?"get":"post",A=typeof c=="string"&&Rv.test(c),H=$=>{if(d&&d($),$.defaultPrevented)return;$.preventDefault();let U=$.nativeEvent.submitter,P=(U==null?void 0:U.getAttribute("formmethod"))||o,Y=()=>C(U||$.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:i,state:l,relative:m,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:y});w&&n!==!1?T.startTransition(()=>Y()):Y()};return T.createElement("form",{ref:v,method:N,action:S,onSubmit:r?d:H,...E,"data-discover":!A&&e==="render"?"true":void 0})});H5.displayName="Form";function z5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lv(e){let t=T.useContext(Yo);return Nn(t,z5(e)),t}function F5(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:m}={}){let p=Xa(),g=oa(),y=Mc(e,{relative:o});return T.useCallback(E=>{if(x5(E,t)){E.preventDefault();let v=n!==void 0?n:kc(g)===kc(y),w=()=>p(e,{replace:v,unstable_mask:r,state:i,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d});m?T.startTransition(()=>w()):w()}},[g,p,y,n,r,i,t,e,l,o,c,d,m])}function Iv(e){La(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=T.useRef(J0(e)),n=T.useRef(!1),r=oa(),i=T.useMemo(()=>y5(r.search,n.current?null:t.current),[r.search]),l=Xa(),o=T.useCallback((c,d)=>{const m=J0(typeof c=="function"?c(new URLSearchParams(i)):c);n.current=!0,l("?"+m,d)},[l,i]);return[i,o]}var $5=0,V5=()=>`__${String(++$5)}__`;function G5(){let{router:e}=Lv("useSubmit"),{basename:t}=T.useContext(la),n=i5(),r=e.fetch,i=e.navigate;return T.useCallback(async(l,o={})=>{let{action:c,method:d,encType:m,formData:p,body:g}=T5(l,t);if(o.navigate===!1){let y=o.fetcherKey||V5();await r(y,n,o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||d,formEncType:o.encType||m,flushSync:o.flushSync})}else await i(o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||d,formEncType:o.encType||m,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function q5(e,{relative:t}={}){let{basename:n}=T.useContext(la),r=T.useContext(Oa);Nn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),l={...Mc(e||".",{relative:t})},o=oa();if(e==null){l.search=o.search;let c=new URLSearchParams(l.search),d=c.getAll("index");if(d.some(p=>p==="")){c.delete("index"),d.filter(g=>g).forEach(g=>c.append("index",g));let p=c.toString();l.search=p?`?${p}`:""}}return(!e||e===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:ps([n,l.pathname])),kc(l)}function Y5(e,{relative:t}={}){let n=T.useContext(Tv);Nn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Lv("useViewTransitionState"),i=Mc(e,{relative:t});if(!n.isTransitioning)return!1;let l=Zs(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Zs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Yf(i.pathname,o)!=null||Yf(i.pathname,l)!=null}var Qo=mv();const Ov=T.createContext(null);function Pc(){return T.useContext(Ov)}class Wt extends Error{constructor(t,n){super(n.message),this.statusCode=t,this.payload=n}}async function mt(e,t){const n=new Headers(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!(t.body instanceof FormData)&&!n.has("Content-Type")&&n.set("Content-Type","application/json");const r=await fetch(e,{headers:n,...t});if(!r.ok){const i=await r.json();throw new Wt(r.status,i)}return await r.json()}function W5(e){const t=String(e);return t.includes("/exports/pdf")?t.includes("format=html")?"remote-codex-transcript.html":"remote-codex-transcript.pdf":"download"}function Q5(e){var i;if(!e)return null;const t=e.match(/filename\*=UTF-8''([^;]+)/i);if(t!=null&&t[1])try{return decodeURIComponent(t[1].trim())}catch{return t[1].trim()}const n=e.match(/filename="([^"]+)"/i);if(n!=null&&n[1])return n[1].trim();const r=e.match(/filename=([^;]+)/i);return((i=r==null?void 0:r[1])==null?void 0:i.trim())??null}async function X5(e,t){const n=await fetch(e,t);if(!n.ok){let i=null;try{i=await n.json()}catch{i=null}throw new Wt(n.status,i??{code:"internal_error",message:"Unable to download file."})}const r=Q5(n.headers.get("content-disposition"))??W5(e);return{blob:await n.blob(),filename:r}}function e2(e,t){const n=e.originalName.trim();if(n)return n;const r=e.file.name.trim();return r||(e.kind==="photo"?`photo-${t+1}.jpg`:`file-${t+1}`)}function K5(){return mt("/api/config/runtime")}function Z5(){return mt("/api/config/workspace-settings",{cache:"no-store"})}function J5(e){return mt("/api/config/workspace-settings",{method:"PATCH",body:JSON.stringify(e)})}function eg(e){return mt(`/api/config/codex-files/${encodeURIComponent(e)}`,{cache:"no-store"})}function tg(e,t){return mt(`/api/config/codex-files/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}function e6(){return mt("/api/config/codex-archives",{cache:"no-store"})}function t6(e={}){return mt("/api/config/codex-archives",{method:"POST",body:JSON.stringify(e)})}function n6(e,t){return mt(`/api/config/codex-archives/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}function r6(e){return mt(`/api/config/codex-archives/${encodeURIComponent(e)}/apply`,{method:"POST"})}function Dv(){return mt("/api/codex/status")}function a6(){return mt("/api/codex/restart",{method:"POST"})}function s6(){return mt("/api/codex/build-restart",{method:"POST"})}function jv(){return mt("/api/codex/models")}function i6(){return mt("/healthz",{cache:"no-store"})}function i1(){return mt("/api/workspaces")}function Mv(){return mt("/api/threads")}function t2(e,t={}){const n=new URLSearchParams;return t.limit!==void 0&&n.set("limit",String(t.limit)),t.beforeTurnId&&n.set("beforeTurnId",t.beforeTurnId),mt(`/api/threads/${e}${n.size>0?`?${n.toString()}`:""}`)}function l6(e,t){return mt(`/api/threads/${e}/items/${encodeURIComponent(t)}/detail`)}function o6(e){return mt(`/api/threads/${e}/export-turns`,{cache:"no-store"})}function u6(e,t){var r,i,l;const n=new URLSearchParams;return t.format!==void 0&&n.set("format",t.format),n.set("mode",t.mode),t.limit!==void 0&&n.set("limit",String(t.limit)),t.turnIds!==void 0&&n.set("turnIds",t.turnIds.join(",")),t.profile!==void 0&&n.set("profile",t.profile),((r=t.options)==null?void 0:r.includeTokenAndPrice)!==void 0&&n.set("includeTokenAndPrice",String(t.options.includeTokenAndPrice)),((i=t.options)==null?void 0:i.includeCommandOutput)!==void 0&&n.set("includeCommandOutput",String(t.options.includeCommandOutput)),((l=t.options)==null?void 0:l.includeAbsolutePaths)!==void 0&&n.set("includeAbsolutePaths",String(t.options.includeAbsolutePaths)),`/api/threads/${encodeURIComponent(e)}/exports/pdf?${n.toString()}`}function c6(e,t){return X5(u6(e,t),{cache:"no-store"})}function d6(e){return mt(`/api/threads/${e}/shell`)}function f6(e){return mt("/api/threads/start",{method:"POST",body:JSON.stringify(e)})}function h6(e){return mt("/api/threads/import",{method:"POST",body:JSON.stringify({sessionId:e})})}function m6(e,t={}){return mt(`/api/threads/${e}/shell`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function p6(e){return mt(`/api/shells/${e}/terminate`,{method:"POST"})}function n2(e,t={}){return mt(`/api/threads/${e}/resume`,{method:"POST",...Object.keys(t).length>0?{body:JSON.stringify(t)}:{}})}function g6(e){return mt(`/api/threads/${e}/disconnect`,{method:"POST"})}function b6(e,t){const n=t.attachments??[];if(n.length===0)return mt(`/api/threads/${e}/prompt`,{method:"POST",body:JSON.stringify(t)});const r=new FormData;r.append("prompt",t.prompt),t.clientRequestId!==void 0&&r.append("clientRequestId",t.clientRequestId),t.model!==void 0&&r.append("model",t.model),t.reasoningEffort!==void 0&&t.reasoningEffort!==null&&r.append("reasoningEffort",t.reasoningEffort),t.collaborationMode!==void 0&&r.append("collaborationMode",t.collaborationMode),t.sandboxMode!==void 0&&t.sandboxMode!==null&&r.append("sandboxMode",t.sandboxMode);const i=n.map((l,o)=>({clientId:l.clientId,kind:l.kind,originalName:e2(l,o),placeholder:l.placeholder}));r.append("attachmentManifest",JSON.stringify(i));for(const[l,o]of n.entries())r.append("attachments",o.file,e2(o,l));return mt(`/api/threads/${e}/prompt`,{method:"POST",body:r})}function r2(e,t={}){return mt(`/api/threads/${e}/interrupt`,{method:"POST",body:JSON.stringify(t)})}function Pv(e,t){return mt(`/api/threads/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function x6(e){return mt(`/api/threads/${e}`,{method:"DELETE"})}function y6(e,t){return mt(`/api/threads/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}function E6(e){return mt(`/api/threads/${e}/compact`,{method:"POST"})}function _6(e){return mt(`/api/threads/${e}/goal`,{cache:"no-store"})}function T6(e,t){return mt(`/api/threads/${e}/goal`,{method:"PATCH",body:JSON.stringify(t)})}function v6(e){return mt(`/api/threads/${e}/goal`,{method:"DELETE"})}function k6(e){return mt(`/api/threads/${e}/fork-turns`,{cache:"no-store"})}function a2(e,t){return mt(`/api/threads/${e}/fork`,{method:"POST",body:JSON.stringify(t)})}function w6(e){return mt(`/api/threads/${e}/skills`,{cache:"no-store"})}function C6(e){return mt(`/api/threads/${e}/mcp-servers`,{cache:"no-store"})}function S6(e){return mt(`/api/threads/${e}/hooks`,{cache:"no-store"})}function N6(e,t){return mt(`/api/threads/${e}/hooks`,{method:"POST",body:JSON.stringify(t)})}function A6(e,t){return mt(`/api/threads/${e}/hooks`,{method:"PUT",body:JSON.stringify(t)})}function R6(e,t){return mt(`/api/threads/${e}/hooks/trust`,{method:"POST",body:JSON.stringify(t)})}function L6(e,t){return mt(`/api/threads/${e}/hooks/untrust`,{method:"POST",body:JSON.stringify(t)})}function I6(e,t,n){return mt(`/api/threads/${e}/requests/${encodeURIComponent(t)}/respond`,{method:"POST",body:JSON.stringify(n)})}function O6(e){return mt("/api/workspaces",{method:"POST",body:JSON.stringify(e)})}function D6(e,t){return mt(`/api/workspaces/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function j6(e){return mt(`/api/workspaces/${e}`,{method:"DELETE"})}function M6(e,t){return mt(`/api/workspaces/${e}/favorite`,{method:"POST",body:JSON.stringify(t)})}function Bv(e){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host,r=new WebSocket(`${t}//${n}/ws`);return r.addEventListener("message",i=>{try{const l=JSON.parse(i.data);"threadId"in l&&l.type.startsWith("thread.")&&e(l)}catch{}}),r}function P6(e={}){const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host,r=new WebSocket(`${t}//${n}/ws`);return r.addEventListener("message",i=>{var l,o;try{const c=JSON.parse(i.data);if(c.type==="supervisor.connected"){(l=e.onConnected)==null||l.call(e,c);return}"shellId"in c&&c.type.startsWith("shell.")&&((o=e.onShellEvent)==null||o.call(e,c))}catch{}}),{socket:r,send(i){r.send(JSON.stringify(i))}}}function B6(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M2 3.25h12v1.5H2Zm0 4h12v1.5H2Zm0 4h12v1.5H2Z"})})}function ng(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})}function s2(e=!1){return`flex w-full items-center rounded-[0.95rem] px-3 py-2 text-left text-sm transition ${e?"cursor-not-allowed bg-[var(--theme-muted)] text-[var(--theme-fg-muted)]":"text-[var(--theme-fg)] hover:bg-[var(--theme-hover)]"}`}const U6=[{value:"light",label:"Light",description:"Always use the bright theme."},{value:"dark",label:"Dark",description:"Always use the dark theme."},{value:"system",label:"System",description:"Follow the operating system appearance."}],H6=["config.toml","auth.json"];function z6(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function l1({className:e=""}){const t=Pc();return t?f.jsx("button",{type:"button","aria-label":t.navOpen?"Close Navigation":"Open Navigation","aria-expanded":t.navOpen,"aria-controls":"app-shell-navigation-menu",onClick:t.toggleNav,className:`inline-flex h-10 w-10 shrink-0 items-center justify-center text-[var(--theme-fg)] transition hover:text-[var(--theme-fg-soft)] ${e}`.trim(),children:t.navOpen?f.jsx(ng,{}):f.jsx(B6,{})}):null}function o1({className:e=""}){const t=Pc(),n=oa(),r=Xa(),i=T.useRef(null),l=n.pathname==="/workspaces";return T.useEffect(()=>{if(!(t!=null&&t.navOpen))return;const o=t;function c(d){const m=d.target;if(!m)return;const p=i.current;p!=null&&p.contains(m)||m instanceof Element&&m.closest('[aria-controls="app-shell-navigation-menu"]')||o.closeNav()}return document.addEventListener("pointerdown",c),()=>{document.removeEventListener("pointerdown",c)}},[t]),t!=null&&t.navOpen?f.jsxs("div",{ref:i,id:"app-shell-navigation-menu",onPointerDown:o=>{o.stopPropagation()},onMouseDown:o=>{o.stopPropagation()},onTouchStart:o=>{o.stopPropagation()},className:`rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] p-4 shadow-2xl shadow-black/15 backdrop-blur ${e}`.trim(),children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-base font-semibold tracking-wide text-[var(--theme-accent-strong)]",children:"Remote Codex"}),f.jsx("p",{className:"mt-1 text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Navigation"})]}),f.jsxs("nav",{className:"mt-4 flex flex-col gap-1.5 text-sm",children:[f.jsx("button",{type:"button",disabled:l,onClick:()=>{l||(t.closeNav(),r("/workspaces"))},className:s2(l),children:"Workspaces"}),f.jsx("button",{type:"button",onClick:()=>{t.openSettings()},className:s2(),children:"Settings"})]})]}):null}function F6(){const e=Pc(),t=T.useMemo(()=>[{name:"config.toml",label:"config.toml",description:"Codex runtime configuration"},{name:"auth.json",label:"auth.json",description:"Codex authentication state"}],[]),[n,r]=T.useState(null),[i,l]=T.useState({"config.toml":{path:"~/.codex/config.toml",exists:!1,originalContent:"",draftContent:"",loading:!1,saving:!1,error:null,saveMessage:null},"auth.json":{path:"~/.codex/auth.json",exists:!1,originalContent:"",draftContent:"",loading:!1,saving:!1,error:null,saveMessage:null}}),o=n?i[n]:null,[c,d]=T.useState({busy:!1,message:null,error:null}),[m,p]=T.useState([]),[g,y]=T.useState(null),[E,v]=T.useState({devHomeDraft:"",loading:!1,saving:!1,message:null,error:null}),[w,C]=T.useState({loading:!1,creating:!1,applyingId:null,renamingId:null,renameDraft:"",message:null,error:null}),S=(e==null?void 0:e.themeMode)??"system",N=(e==null?void 0:e.effectiveTheme)??"dark";T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;const M=e;function K(V){V.key==="Escape"&&M.closeSettings()}return window.addEventListener("keydown",K),()=>{window.removeEventListener("keydown",K)}},[e]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let M=!1;return v(K=>({...K,loading:!0,message:null,error:null})),Z5().then(K=>{M||(y(K),v(V=>({...V,devHomeDraft:K.devHome,loading:!1})))}).catch(K=>{M||v(V=>({...V,loading:!1,error:K instanceof Wt?K.message:"Unable to load workspace settings."}))}),()=>{M=!0}},[e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let M=!1;async function K(){l(he=>({"config.toml":{...he["config.toml"],loading:!0,error:null,saveMessage:null},"auth.json":{...he["auth.json"],loading:!0,error:null,saveMessage:null}}));const V=await Promise.allSettled(t.map(async he=>({name:he.name,result:await eg(he.name)})));M||l(he=>{var ne;const de={...he};for(const z of V){if(z.status==="fulfilled"){const{name:De,result:L}=z.value;de[De]={path:L.path,exists:L.exists,originalContent:L.content,draftContent:L.content,loading:!1,saving:!1,error:null,saveMessage:null};continue}const ee=z.reason instanceof Wt?z.reason.message:"Unable to load the file.",Te=((ne=t[V.indexOf(z)])==null?void 0:ne.name)??"config.toml";de[Te]={...de[Te],loading:!1,saving:!1,error:ee,saveMessage:null}}return de})}return K(),()=>{M=!0}},[t,e==null?void 0:e.settingsOpen]),T.useEffect(()=>{if(!(e!=null&&e.settingsOpen))return;let M=!1;async function K(){C(V=>({...V,loading:!0,error:null,message:null}));try{const V=await e6();if(M)return;p(V),C(he=>({...he,loading:!1}))}catch(V){if(M)return;C(he=>({...he,loading:!1,error:V instanceof Wt?V.message:"Unable to load config archives."}))}}return K(),()=>{M=!0}},[e==null?void 0:e.settingsOpen]);async function A(){if(!c.busy){d({busy:!0,message:null,error:null});try{const M=await a6();d({busy:!1,message:M.state==="ready"?"App server restarted.":`App server state: ${M.state}`,error:null})}catch(M){d({busy:!1,message:null,error:M instanceof Wt?M.message:"Unable to restart the app server."})}}}async function H(){if(!c.busy){d({busy:!0,message:null,error:null});try{await s6(),d({busy:!1,message:"Build and restart launched. The page may disconnect briefly.",error:null})}catch(M){d({busy:!1,message:null,error:M instanceof Wt?M.message:"Unable to launch build and restart."})}}}async function $(){const M=E.devHomeDraft.trim();if(!(!M||E.saving)){v(K=>({...K,saving:!0,message:null,error:null}));try{const K=await J5({devHome:M});y(K),v(V=>({...V,devHomeDraft:K.devHome,saving:!1,message:"Workspace defaults saved."}))}catch(K){v(V=>({...V,saving:!1,error:K instanceof Wt?K.message:"Unable to save workspace settings."}))}}}async function U(M){const K=i[M];if(!(!K||K.saving)){l(V=>({...V,[M]:{...V[M],saving:!0,error:null,saveMessage:null}}));try{const V=await tg(M,{content:K.draftContent});l(he=>({...he,[M]:{path:V.path,exists:V.exists,originalContent:V.content,draftContent:V.content,loading:!1,saving:!1,error:null,saveMessage:"Saved"}}))}catch(V){l(he=>({...he,[M]:{...he[M],saving:!1,error:V instanceof Wt?V.message:"Unable to save the file.",saveMessage:null}}))}}}async function P(){if(!w.creating){C(M=>({...M,creating:!0,message:null,error:null}));try{const M=await t6();p(K=>[M,...K]),C(K=>({...K,creating:!1,message:"Backup created."}))}catch(M){C(K=>({...K,creating:!1,error:M instanceof Wt?M.message:"Unable to create a config backup."}))}}}async function Y(M){if(!w.applyingId){C(K=>({...K,applyingId:M.id,message:null,error:null}));try{const K=await r6(M.id);C(V=>({...V,applyingId:null,message:K.status.state==="ready"?`Applied "${K.archive.label}" and restarted app-server.`:`Applied "${K.archive.label}". App-server state: ${K.status.state}.`}))}catch(K){C(V=>({...V,applyingId:null,error:K instanceof Wt?K.message:"Unable to apply the config archive."}))}}}async function fe(M){const K=w.renameDraft.trim();if(!(!K||w.renamingId!==M.id)){C(V=>({...V,message:null,error:null}));try{const V=await n6(M.id,{label:K});p(he=>he.map(de=>de.id===M.id?V:de)),C(he=>({...he,renamingId:null,renameDraft:"",message:"Backup renamed."}))}catch(V){C(he=>({...he,error:V instanceof Wt?V.message:"Unable to rename the config backup."}))}}}return e!=null&&e.settingsOpen?f.jsxs("div",{className:"fixed inset-0 z-[70] flex items-start justify-center p-4 pt-[max(env(safe-area-inset-top),1rem)] sm:items-center",children:[f.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"ui-overlay-scrim absolute inset-0 backdrop-blur-sm"}),f.jsxs("section",{role:"dialog","aria-modal":"true","aria-label":"Settings",className:"relative z-10 flex max-h-[calc(100vh-2rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/20",children:[f.jsx("div",{className:"shrink-0 p-5 pb-0",children:f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Settings"}),f.jsx("h2",{className:"mt-2 text-xl font-semibold text-[var(--theme-fg)]",children:"Settings"}),f.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Edit host-side Codex configuration files through supervisor."})]}),f.jsx("button",{type:"button","aria-label":"Close Settings",onClick:e.closeSettings,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:f.jsx(ng,{})})]})}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-5 pt-5",children:f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsx("div",{className:"flex items-start justify-between gap-3",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Appearance"}),f.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:["Choose light, dark, or follow the system setting. Active: ",N,"."]})]})}),f.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-3",children:U6.map(M=>{const K=S===M.value;return f.jsxs("button",{type:"button",onClick:()=>e.setThemeMode(M.value),className:`block rounded-[1rem] border px-3 py-2.5 text-left transition ${K?"border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)]":"border-[var(--theme-border)] bg-[var(--theme-surface-strong)] hover:bg-[var(--theme-hover)]"}`,children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm font-medium text-[var(--theme-fg)]",children:M.label}),K?f.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Active"}):null]}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:M.description})]},M.value)})})]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsx("div",{className:"flex items-start justify-between gap-3",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Workspace defaults"}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Git projects clone into dev home. New workspace directories can create one missing child under this path."})]})}),f.jsxs("div",{className:"mt-3 grid gap-3",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Workspace root"}),f.jsx("p",{title:(g==null?void 0:g.workspaceRoot)??"Loading workspace root",className:"mt-1 truncate rounded-[0.9rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-2 font-mono text-xs text-[var(--theme-fg-soft)]",children:E.loading&&!g?"Loading...":(g==null?void 0:g.workspaceRoot)??"Unavailable"})]}),f.jsxs("div",{children:[f.jsx("label",{htmlFor:"settings-dev-home",className:"text-[11px] uppercase tracking-[0.18em] text-[var(--theme-fg-muted)]",children:"Dev home"}),f.jsxs("div",{className:"mt-1 flex flex-col gap-2 sm:flex-row",children:[f.jsx("input",{id:"settings-dev-home",value:E.devHomeDraft,onChange:M=>v(K=>({...K,devHomeDraft:M.target.value,message:null,error:null})),placeholder:"/Users/name/dev",className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-2 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),f.jsx("button",{type:"button","aria-label":"Save workspace defaults",onClick:()=>void $(),disabled:E.loading||E.saving||!E.devHomeDraft.trim(),className:"rounded-full bg-[var(--theme-accent-solid)] px-4 py-2 text-xs font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)] disabled:cursor-not-allowed disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:E.saving?"Saving...":"Save"})]})]})]}),E.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:E.error}):E.message?f.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:E.message}):null]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Codex app-server"}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Restart after editing host configuration to force a fresh reload."})]}),f.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:()=>void A(),disabled:c.busy,className:"rounded-full border border-sky-400/35 bg-sky-400/10 px-3 py-1.5 text-xs font-medium text-sky-500 transition hover:bg-sky-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:c.busy?"Restarting...":"Restart"}),f.jsx("button",{type:"button",onClick:()=>void H(),disabled:c.busy,className:"rounded-full border border-amber-400/35 bg-amber-400/10 px-3 py-1.5 text-xs font-medium text-amber-500 transition hover:bg-amber-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:c.busy?"Working...":"Build and restart"})]})]}),c.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:c.error}):c.message?f.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:c.message}):null]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsx("div",{className:"flex items-start justify-between gap-3",children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Host files"}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Open `config.toml` or `auth.json` in a secondary editor dialog when needed."})]})}),f.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:t.map(M=>{const K=i[M.name],V=K.draftContent!==K.originalContent;return f.jsx("button",{type:"button",onClick:()=>r(M.name),className:"block rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-left transition hover:bg-[var(--theme-hover)]",children:f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:M.label}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:M.description})]}),f.jsx("div",{className:"shrink-0",children:K.loading?f.jsx("span",{className:"text-[11px] uppercase tracking-[0.2em] text-[var(--theme-fg-muted)]",children:"Loading"}):V?f.jsx("span",{className:"rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-[var(--theme-accent-strong)]",children:"Unsaved"}):K.exists?f.jsx("span",{className:"rounded-full border border-emerald-400/25 bg-emerald-400/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-emerald-600 dark:text-emerald-100",children:"Ready"}):f.jsx("span",{className:"rounded-full border border-sky-300/25 bg-sky-300/10 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-600 dark:text-sky-100",children:"New"})})]})},M.name)})})]}),f.jsxs("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-3",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:"Config archives"}),f.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:"Backup `config.toml` and `auth.json`, then apply a saved archive with an app-server restart so Codex reloads the selected files."})]}),f.jsx("button",{type:"button",onClick:()=>void P(),disabled:w.creating,className:"shrink-0 rounded-full border border-[var(--theme-accent-border)] bg-[var(--theme-accent-soft)] px-3 py-1.5 text-xs font-medium text-[var(--theme-accent-strong)] transition hover:bg-[var(--theme-hover)] disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:w.creating?"Creating...":"Create backup"})]}),w.error?f.jsx("p",{className:"mt-2 text-xs text-rose-300",children:w.error}):w.message?f.jsx("p",{className:"mt-2 text-xs text-emerald-300",children:w.message}):null,f.jsx("div",{className:"mt-3 space-y-2",children:w.loading?f.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"Loading backups..."}):m.length===0?f.jsx("p",{className:"rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs text-[var(--theme-fg-muted)]",children:"No config backups yet."}):m.map(M=>{const K=w.renamingId===M.id;return f.jsx("div",{className:"rounded-[1.1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3",children:f.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[f.jsxs("div",{className:"min-w-0",children:[K?f.jsxs("div",{className:"flex max-w-xl gap-2",children:[f.jsx("input",{"aria-label":`Rename ${M.label}`,value:w.renameDraft,onChange:V=>C(he=>({...he,renameDraft:V.target.value,error:null,message:null})),className:"min-w-0 flex-1 rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-sm text-[var(--theme-fg)] outline-none focus:border-[var(--theme-accent-border)]"}),f.jsx("button",{type:"button","aria-label":`Save archive name ${M.label}`,onClick:()=>void fe(M),className:"rounded-full bg-[var(--theme-accent-solid)] px-3 py-1.5 text-xs font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"Save"}),f.jsx("button",{type:"button",onClick:()=>C(V=>({...V,renamingId:null,renameDraft:""})),className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)]",children:"Cancel"})]}):f.jsx("p",{className:"truncate text-sm font-medium text-[var(--theme-fg)]",children:M.label}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] text-[var(--theme-fg-muted)]",children:[f.jsxs("span",{children:["Created ",z6(M.createdAt)]}),H6.map(V=>{var he;return f.jsxs("span",{className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-2 py-0.5 font-mono",children:[V,": ",(he=M.files[V])!=null&&he.exists?"saved":"missing"]},V)})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[f.jsx("button",{type:"button",onClick:()=>C(V=>({...V,renamingId:M.id,renameDraft:M.label,message:null,error:null})),disabled:K,className:"rounded-full border border-[var(--theme-border)] bg-[var(--theme-panel)] px-3 py-1.5 text-xs font-medium text-[var(--theme-fg)] transition hover:bg-[var(--theme-hover)] disabled:cursor-not-allowed disabled:text-[var(--theme-fg-muted)]",children:"Rename"}),f.jsx("button",{type:"button",onClick:()=>void Y(M),disabled:w.applyingId!==null,className:"rounded-full border border-emerald-400/35 bg-emerald-400/10 px-3 py-1.5 text-xs font-medium text-emerald-600 transition hover:bg-emerald-400/16 disabled:cursor-not-allowed disabled:border-[var(--theme-border)] disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)] dark:text-emerald-100",children:w.applyingId===M.id?"Applying...":"Apply"})]})]})},M.id)})})]})]})})]}),n&&o?f.jsx("div",{className:"pointer-events-none fixed inset-0 z-[71] flex items-center justify-center p-4",children:f.jsxs("div",{className:"pointer-events-auto relative z-10 flex max-h-[min(88vh,56rem)] w-full max-w-3xl flex-col overflow-hidden rounded-[1.6rem] border border-[var(--theme-border)] bg-[var(--theme-panel)] shadow-2xl shadow-black/25",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--theme-border)] px-4 py-3 sm:px-5",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:n}),f.jsx("p",{className:"mt-1 break-all font-mono text-xs text-[var(--theme-fg-muted)]",children:o.path})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[o.error?f.jsx("span",{className:"text-xs text-rose-300",children:o.error}):o.saveMessage?f.jsx("span",{className:"text-xs text-emerald-300",children:o.saveMessage}):null,f.jsx("button",{type:"button","aria-label":`Save ${n}`,onClick:()=>void U(n),disabled:o.loading||o.saving||o.draftContent===o.originalContent,className:"rounded-full bg-[var(--theme-accent-solid)] px-4 py-2 text-sm font-medium text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)] disabled:cursor-not-allowed disabled:bg-[var(--theme-muted)] disabled:text-[var(--theme-fg-muted)]",children:o.saving?"Saving...":"Save"}),f.jsx("button",{type:"button","aria-label":"Close File Editor",onClick:()=>r(null),className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg)] transition hover:border-[var(--theme-border-contrast)] hover:bg-[var(--theme-hover)]",children:f.jsx(ng,{})})]})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 sm:p-5",children:f.jsx("textarea",{"aria-label":`Edit ${n}`,value:o.draftContent,onChange:M=>l(K=>({...K,[n]:{...K[n],draftContent:M.target.value,error:null,saveMessage:null}})),spellCheck:!1,className:"min-h-[28rem] w-full rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 font-mono text-[13px] leading-6 text-[var(--theme-fg)] outline-none transition focus:border-[var(--theme-accent-border)]",placeholder:o.loading?"Loading...":`Edit ${n} here`})})]})}):null]}):null}function Zp({eyebrow:e,title:t,description:n}){return f.jsxs("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 p-5 shadow-2xl shadow-stone-950/20",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:e}),f.jsx("h2",{className:"mt-3 text-xl font-semibold text-stone-100",children:t}),f.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]})}function $6(){const[e,t]=T.useState(null),[n,r]=T.useState(null);return T.useEffect(()=>{K5().then(t).catch(i=>{r(i instanceof Error?i.message:"Unable to load runtime config.")})},[]),f.jsx("div",{className:"min-h-screen bg-stone-950 px-4 py-8 text-stone-100 sm:px-6",children:f.jsx("div",{className:"mx-auto max-w-7xl",children:f.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.2fr_0.8fr]",children:[f.jsxs("section",{className:"rounded-[2rem] border border-stone-800 bg-stone-900 p-8 shadow-2xl shadow-stone-950/20 sm:p-10",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.35em] text-amber-300",children:"Local Supervisor"}),f.jsx("h1",{className:"mt-4 max-w-3xl text-4xl font-semibold tracking-tight text-stone-100 sm:text-6xl",children:"Bring your local workspaces into a mobile-ready control surface."}),f.jsx("p",{className:"mt-6 max-w-2xl text-base leading-7 text-stone-400 sm:text-lg",children:"Phase 1 focuses on a stable supervisor shell: runtime config, workspace onboarding, database bootstrap, and a read-only file tree that already respects workspace root boundaries."}),f.jsxs("div",{className:"mt-8 flex flex-wrap gap-4",children:[f.jsx(Js,{to:"/workspaces",className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200",children:"Enter Workspace Console"}),f.jsx(Js,{to:"/workspaces/new",className:"rounded-full border border-stone-700 px-5 py-3 font-medium text-stone-200 transition hover:border-stone-500 hover:bg-stone-800",children:"Add First Workspace"})]})]}),f.jsxs("section",{className:"grid gap-4",children:[f.jsx(Zp,{eyebrow:"Health",title:n?"API unavailable":"Supervisor reachable",description:n??`Connected to ${(e==null?void 0:e.appName)??"Remote Codex Supervisor"} ${(e==null?void 0:e.appVersion)??""}`.trim()}),f.jsx(Zp,{eyebrow:"Workspace Root",title:(e==null?void 0:e.workspaceRoot)??"Loading root path",description:"The file tree and workspace creation flow stay inside this boundary in Phase 1."}),f.jsx(Zp,{eyebrow:"Environment",title:(e==null?void 0:e.environment)??"Loading environment",description:e?`${e.host}:${e.port}`:"Runtime metadata appears here after bootstrap."})]})]})})})}function V6(e){if(!e)return"No time";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function G6(e){switch(e){case"inProgress":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"failed":return"failed"}}function q6({open:e,busy:t=!1,turnsState:n,onCancel:r,onLoadTurns:i,onExport:l}){var H,$,U;const o=((H=n.data)==null?void 0:H.turns)??[],c=T.useMemo(()=>o.slice(0,10).map(P=>P.turnId),[o]),[d,m]=T.useState("latest"),[p,g]=T.useState(()=>new Set),[y,E]=T.useState(!0),[v,w]=T.useState("pdf");if(T.useEffect(()=>{e&&(m("latest"),w("pdf"),E(!0),i())},[i,e]),T.useEffect(()=>{e&&o.length>0&&g(new Set(c))},[c,e,o.length]),T.useEffect(()=>{if(!e)return;function P(Y){Y.key==="Escape"&&!t&&r()}return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[t,r,e]),!e)return null;const C=d==="latest"?Math.min(10,(($=n.data)==null?void 0:$.totalTurnCount)??10):p.size,S=!t&&(d==="latest"||p.size>0);function N(P){g(Y=>{const fe=new Set(Y);return fe.has(P)?fe.delete(P):fe.add(P),fe})}function A(){const P={format:v,mode:d,...d==="latest"?{limit:10}:{turnIds:[...p]},profile:"review",options:{includeTokenAndPrice:y}};l(P)}return Qo.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[96] flex items-center justify-center p-3 sm:p-6",children:[f.jsx("button",{type:"button","aria-label":"Close export dialog",onClick:r,disabled:t,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),f.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Export transcript",className:"relative z-[1] flex max-h-[min(46rem,calc(100vh-2rem))] w-full max-w-2xl flex-col rounded-[1.6rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-stone-800 px-5 py-4",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-sm font-semibold text-stone-100",children:"Export transcript"}),f.jsx("p",{className:"mt-1 text-xs text-stone-500",children:"Default review copy summarizes command batches and file changes."})]}),f.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,disabled:t,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),f.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:[f.jsx("div",{className:"inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["latest","Latest 10"],["selected","Custom selection"]].map(([P,Y])=>f.jsx("button",{type:"button",onClick:()=>m(P),className:`rounded-full px-3 py-1.5 text-sm transition ${d===P?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:Y},P))}),f.jsx("div",{className:"mt-4 inline-flex rounded-full border border-stone-700 bg-stone-950/60 p-1",children:[["pdf","PDF"],["html","HTML"]].map(([P,Y])=>f.jsx("button",{type:"button",onClick:()=>w(P),className:`rounded-full px-3 py-1.5 text-sm transition ${v===P?"ui-status-warning":"text-stone-400 hover:text-stone-100"}`,children:Y},P))}),d==="selected"?f.jsxs("div",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-stone-800 px-3 py-2.5",children:[f.jsxs("p",{className:"text-xs text-stone-400",children:["Selected ",p.size," of ",((U=n.data)==null?void 0:U.totalTurnCount)??o.length]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",onClick:()=>g(new Set(o.map(P=>P.turnId))),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Select all"}),f.jsx("button",{type:"button",onClick:()=>g(new Set),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Clear"})]})]}),n.status==="loading"?f.jsx("p",{className:"px-3 py-6 text-sm text-stone-400",children:"Loading turns..."}):n.status==="failed"?f.jsx("p",{className:"px-3 py-6 text-sm text-rose-100",children:n.error}):f.jsx("div",{className:"max-h-80 overflow-auto p-2",children:o.map(P=>f.jsxs("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl px-2.5 py-2 text-sm transition hover:bg-stone-800/70",children:[f.jsx("input",{type:"checkbox",checked:p.has(P.turnId),onChange:()=>N(P.turnId),className:"h-4 w-4 accent-amber-300"}),f.jsxs("span",{className:"shrink-0 text-xs font-medium text-stone-300",children:["Turn ",P.turnNumber]}),f.jsx("span",{className:"shrink-0 text-xs text-stone-500",children:V6(P.startedAt)}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-stone-200",children:P.userPromptPreview}),f.jsx("span",{className:"hidden shrink-0 rounded-full border border-stone-700 px-2 py-0.5 text-[10px] text-stone-400 sm:inline",children:G6(P.status)})]},P.turnId))})]}):f.jsx("p",{className:"mt-4 rounded-2xl border border-stone-800 bg-stone-950/40 px-3 py-3 text-sm text-stone-300",children:"Exports the latest 10 turns in chronological order."}),f.jsxs("div",{className:"mt-4 grid gap-2 text-sm text-stone-300 sm:grid-cols-2",children:[f.jsxs("label",{className:"flex items-center gap-2 rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2",children:[f.jsx("input",{type:"checkbox",checked:y,onChange:P=>E(P.target.checked),className:"h-4 w-4 accent-amber-300"}),"Token and price"]}),f.jsx("p",{className:"flex items-center rounded-xl border border-stone-800 bg-stone-950/35 px-3 py-2 text-xs text-stone-500",children:v==="html"?"HTML keeps the chat timeline styling and omits raw command output.":"Review exports keep message text readable and omit tool activity."})]})]}),f.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-stone-800 px-5 py-4",children:[f.jsxs("p",{className:"min-w-0 text-xs text-stone-500",children:[C," ",C===1?"turn":"turns"," will be exported."]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",onClick:r,disabled:t,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),f.jsx("button",{type:"button",onClick:A,disabled:!S,className:"ui-status-warning rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:t?"Exporting...":`Export ${v.toUpperCase()}`})]})]})]})]}),document.body)}const Bf=[{value:"preToolUse",label:"PreToolUse",matcherHint:"Bash"},{value:"permissionRequest",label:"PermissionRequest",matcherHint:"Bash"},{value:"postToolUse",label:"PostToolUse",matcherHint:"Bash"},{value:"sessionStart",label:"SessionStart",matcherHint:"startup|resume"},{value:"userPromptSubmit",label:"UserPromptSubmit",matcherHint:""},{value:"stop",label:"Stop",matcherHint:""},{value:"preCompact",label:"PreCompact",matcherHint:""},{value:"postCompact",label:"PostCompact",matcherHint:""}],Uv=`node -e "process.stdin.resume(); process.stdin.on('end', () => console.error('remote-codex hook ran'))"`,Hv=`node -e 'process.stdin.resume(); process.stdin.on("end", () => console.log(JSON.stringify({ systemMessage: "remote-codex hook ran" })))'`,Y6=new Set([Uv,Hv]);function Jp(e){return e==="stop"?Hv:Uv}function i2(e){return e.replace(/\u00a0/g," ")}function W6(e){if(!e)return"";const t=document.createElement("div");return t.innerHTML=e,t.textContent??""}function Q6(e){return!!e.querySelector("[style], font")}function X6(e,t){if(!e)return[];const n=[],r=[...t].sort((o,c)=>c.placeholder.length-o.placeholder.length);let i=0,l=0;for(;i<e.length;){const o=r.find(m=>e.startsWith(m.placeholder,i));if(o){n.push({type:"attachment",key:`${o.clientId}-${i}`,attachment:o}),i+=o.placeholder.length;continue}let c=e.length;for(const m of r){const p=e.indexOf(m.placeholder,i);p!==-1&&p<c&&(c=p)}const d=e.slice(i,c);d&&(n.push({type:"text",key:`text-${l}`,text:d}),l+=1),i=c}return n}function l2(e){if(!e)return"Auto";switch(e){case"xhigh":return"xhigh";default:return e}}function K6(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"m4 5 2 2-2 2"}),f.jsx("path",{d:"M7.75 9.5h4.25"})]})}function Z6(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",children:f.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function J6(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M10.75 2.5 5.25 13.5"}),f.jsx("path",{d:"M4.25 5.25h2.25"}),f.jsx("path",{d:"M9.5 10.75h2.25"})]})}function e4(e){switch(e){case"bearerToken":return"Token";case"oAuth":return"OAuth";case"notLoggedIn":return"Login";case"unsupported":return"Public";default:return"Unknown"}}function t4(e){switch(e){case"repo":return"Repo";case"system":return"System";case"admin":return"Admin";case"user":default:return"User"}}function n4(e){var t;return((t=Bf.find(n=>n.value===e))==null?void 0:t.label)??e}function r4(e){var t;switch(e){case"cloudRequirements":return"Cloud";case"legacyManagedConfigFile":case"legacyManagedConfigMdm":return"Managed";case"sessionFlags":return"Session";default:return((t=e[0])==null?void 0:t.toUpperCase())+e.slice(1)}}function a4(e){switch(e){case"managed":return"Managed";case"modified":return"Modified";case"trusted":return"Trusted";case"untrusted":return"Review"}}function s4(e){switch(e){case"preToolUse":return"PreToolUse";case"permissionRequest":return"PermissionRequest";case"postToolUse":return"PostToolUse";case"preCompact":return"PreCompact";case"postCompact":return"PostCompact";case"sessionStart":return"SessionStart";case"userPromptSubmit":return"UserPromptSubmit";case"stop":return"Stop"}}function i4(e){return e.source==="user"?"global":e.source==="project"?"project":null}function o2(e){const t=i4(e);return!t||e.handlerType!=="command"||!e.command||e.isManaged?null:{scope:t,eventName:e.eventName,matcher:e.matcher,command:e.command,timeoutSec:e.timeoutSec,statusMessage:e.statusMessage}}function l4(e){switch(e){case"active":return"Active";case"paused":return"Paused";case"budgetLimited":return"Budget";case"complete":return"Complete";default:return e}}function o4(e){const t=e.trim();if(!t)return null;const n=Number(t);return!Number.isFinite(n)||n<=0?Number.NaN:Math.round(n*1e3)}function u4(e){if(!e)return"";const t=e/1e3;return Number.isInteger(t)?String(t):String(Number(t.toFixed(1)))}function rg(e){return e.replace(/\r\n/g,`
62
+ `)}function c4(e){const t=e.trim();return/^[A-Za-z0-9_-]+$/.test(t)?t:null}function d4(e){const n=rg(e).split(`
63
+ `).map(i=>i.trim()).filter(Boolean).find(i=>/^\[mcp_servers\.[^\]]+\]$/.test(i));if(!n)return null;const r=n.match(/^\[mcp_servers\.([A-Za-z0-9_-]+)\]$/);return(r==null?void 0:r[1])??null}function f4(e,t){return`[mcp_servers.${e}]
64
+ url = ${JSON.stringify(t.trim())}
65
+ `}function u2(e,t,n){var g,y;const r=rg(e),i=`${rg(n).trim()}
66
+ `,l=r.split(`
67
+ `),o=`[mcp_servers.${t}]`,c=`[mcp_servers.${t}.`;let d=-1,m=l.length;for(let E=0;E<l.length;E+=1)if((((g=l[E])==null?void 0:g.trim())??"")===o){d=E;break}if(d>=0){for(let w=d+1;w<l.length;w+=1){const C=((y=l[w])==null?void 0:y.trim())??"";if(C.startsWith("[")&&!(C===o||C.startsWith(c))){m=w;break}}const E=l.slice(0,d).join(`
68
+ `).trimEnd(),v=l.slice(m).join(`
69
+ `).trim();return[E,i.trimEnd(),v].filter(Boolean).join(`
70
+
71
+ `).replace(/\n{3,}/g,`
72
+
73
+ `).concat(`
74
+ `)}const p=r.trimEnd();return p?`${p}
75
+
76
+ ${i}`:i}function zv(e){return typeof e!="number"||Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))}function e0(e){const t=e/1e3;return Number.isInteger(t)?`${t}k`:`${Number(t.toFixed(1))}k`}function h4(e,t){if(!e)return"Select model";if((t==null?void 0:t.availability)!=="available"||typeof t.tokensInContextWindow!="number"||typeof t.modelContextWindow!="number")return`${e} · context unavailable`;const n=Math.max(t.tokensInContextWindow,0),r=Math.max(t.modelContextWindow,0),i=Math.max(r-n,0);return[e,`${e0(n)} used / ${e0(r)}`,`${e0(i)} left`,`${zv(t.remainingPercent)}% context left`].join(" · ")}function m4({contextUsage:e}){const t=(e==null?void 0:e.availability)??"unavailable",n=zv(e==null?void 0:e.remainingPercent),r=t==="available"?n:100,i=t!=="available"?"rgba(120,113,108,0.55)":n<=20?"rgba(251,113,133,0.95)":n<=40?"rgba(252,211,77,0.94)":"rgba(125,211,252,0.95)";return f.jsx("span",{"aria-hidden":"true",className:"thread-context-progress-frame pointer-events-none absolute inset-0",style:{"--context-ring-progress":`${r}%`,"--context-ring-color":i}})}function c2(e,t){const n=e.name.trim();if(n)return n;const r=t==="photo"?e.type.includes("png")?".png":e.type.includes("heic")?".heic":e.type.includes("heif")?".heif":e.type.includes("webp")?".webp":".jpg":"";return`${t==="photo"?"photo":"file"}-${Date.now()}${r}`}function d2(e){return e.replace(/[\r\n[\]]+/g," ").replace(/\s+/g," ").trim()||"attachment"}function t0(e){return e.type.startsWith("image/")?"photo":"file"}function ag(e,t){const n=[];if(e)for(const r of Array.from(e)){if(r.kind!=="file")continue;const i=r.getAsFile();i&&n.push(i)}return n.length>0?n:t?Array.from(t):[]}function f2(e,t){return ag(e,t).length>0}function _l(e){return e instanceof HTMLElement&&e.dataset.segmentType==="attachment"&&e.dataset.placeholder?e.dataset.placeholder:e.textContent??""}function p4(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function h2(e){const t=e.placeholder.match(/^\[(?:PHOTO|FILE)\s+(.+)\]$/);return t!=null&&t[1]?t[1]:p4(e.originalName)}function g4(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M3 4.5A1.75 1.75 0 0 1 4.75 2.75h6.5A1.75 1.75 0 0 1 13 4.5v4A1.75 1.75 0 0 1 11.25 10.25H8l-2.75 2v-2H4.75A1.75 1.75 0 0 1 3 8.5v-4Z"})})}function b4(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:[f.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),f.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),f.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function n0(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M5.5 3.25h5"}),f.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function Tl({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-50":"border-stone-700/90 bg-stone-900/80 text-stone-100";return f.jsx("span",{className:`inline-flex min-w-[3rem] items-center justify-center rounded-full border px-2 py-1.5 text-[10px] font-medium tracking-[0.12em] ${n}`,children:e})}function r0({activeView:e,edgeToEdgeMobile:t=!1,busy:n=!1,settingsBusy:r=!1,compactBusy:i=!1,error:l,model:o=null,reasoningEffort:c=null,fastMode:d=!1,collaborationMode:m="default",modelOptions:p=[],contextUsage:g=null,followTail:y=!1,threadConnected:E=!0,disabled:v=!1,disabledPlaceholder:w,shellControlState:C=null,draftPrompt:S,draftAttachments:N,skillsState:A={status:"idle",data:null,error:null},mcpState:H={status:"idle",data:null,error:null},hooksState:$={status:"idle",data:null,error:null},goalState:U={status:"idle",data:null,error:null},forkTurnOptionsState:P={status:"idle",data:null,error:null},onDraftChange:Y,onSubmit:fe,onInterrupt:M,onCompact:K,onOpenSkills:V,onOpenMcp:he,onOpenHooks:de,onCreateHook:ne,onUpdateHook:z,onTrustHook:ee,onUntrustHook:Te,onOpenGoal:De,onUpdateGoal:L,onOpenForkTurns:F,onForkLatest:se,onForkTurn:O,onReadCodexConfig:ke,onWriteCodexConfig:Ae,onToggleFollow:_e,onUpdateSettings:et,onToggleView:st,onShellCopy:Me,onShellControl:dt,canInterrupt:pt=!1}){var ou,Wc,Qc,Xc,Kc,Wl,Zc,Jc,ed,uu,td,nd,rd,ad;const[Dt,kn]=T.useState({prompt:"",attachments:[]}),[bt,He]=T.useState(null),[Ve,Qt]=T.useState("root"),[at,Ke]=T.useState("list"),[Ge,an]=T.useState("list"),[xn,or]=T.useState("project"),[Bt,Zn]=T.useState("preToolUse"),[pe,Ce]=T.useState("Bash"),[Qe,lt]=T.useState(Jp("preToolUse")),[xt,sn]=T.useState("30"),[mn,xe]=T.useState("Running hook"),[Se,ze]=T.useState(null),[Pe,Ze]=T.useState(!1),[Q,be]=T.useState(null),[ot,je]=T.useState(null),[Fe,nt]=T.useState(""),[zt,ut]=T.useState(""),[wt,pn]=T.useState(""),[ua,An]=T.useState(null),[qr,Dr]=T.useState(!1),[Xi,Jn]=T.useState(null),[ni,er]=T.useState(null),[Ja,vs]=T.useState(null),[ur,ln]=T.useState(!1),[on,Nt]=T.useState(!1),[ks,ri]=T.useState(""),[jr,Ki]=T.useState(!1),[es,vr]=T.useState(null),ca=T.useRef(null),cr=T.useRef(null),Da=T.useRef(null),ja=T.useRef(null),un=T.useRef(null),ts=T.useRef([]),tr=T.useRef(null),dr=T.useRef(new Map),da=T.useRef(""),Zi=T.useRef(0),Jt=e==="shell",ai=!!(Jt&&(C!=null&&C.isMobileShell)),si=(C==null?void 0:C.promptLabel)??null,[fa,ns]=T.useState({}),[kr,En]=T.useState(!1),[Rn,lu]=T.useState(0),Ma=!Jt&&S!==void 0&&N!==void 0&&typeof Y=="function",en=Ma?S:Dt.prompt,gr=Ma?N:Dt.attachments;T.useEffect(()=>{bt!=="slash"&&(Qt("root"),Ke("list"),Jn(null),er(null),an("list"),be(null),je(null))},[bt]),T.useEffect(()=>{Ve!=="mcp"&&(Ke("list"),Jn(null),er(null))},[Ve]),T.useEffect(()=>{Ve!=="forkTurns"&&ln(!1)},[Ve]),T.useEffect(()=>{Ve!=="hooks"&&(an("list"),be(null),je(null))},[Ve]),T.useEffect(()=>{const I=Bf.find(le=>le.value===Bt);Ce(le=>{const we=le.trim(),We=new Set(Bf.map(Xe=>Xe.matcherHint).filter(Boolean));return we&&!We.has(we)?le:(I==null?void 0:I.matcherHint)??""}),lt(le=>Y6.has(le.trim())?Jp(Bt):le)},[Bt]),T.useEffect(()=>{if(!Ja)return;const I=window.setTimeout(()=>{vs(le=>le===Ja?null:le)},1400);return()=>{window.clearTimeout(I)}},[Ja]);function Yr(I){if(Ma){Y==null||Y(le=>I({prompt:le.prompt,attachments:le.attachments}));return}kn(le=>I(le))}function nr(I){Yr(le=>{if(typeof I=="function"){const we=I(le.prompt,le.attachments);return{prompt:we.prompt,attachments:we.attachments??le.attachments}}return{prompt:I,attachments:le.attachments}})}async function Ji(I){try{await navigator.clipboard.writeText(`$${I}`),vs(I)}catch{vs(null)}}async function el(){if(se){ln(!0);try{await se(),He(null)}finally{ln(!1)}}}async function tl(I){if(O){ln(!0);try{await O(I),He(null)}finally{ln(!1)}}}async function ha(){const I=en.trim();if(!I){vr("Goal objective cannot be empty.");return}const le=ks.trim(),we=o4(le);if(le.length>0&&(we===null||!Number.isInteger(we)||we<=0)){vr("Token budget must be a positive number in thousands.");return}if(!L){vr("/goal is unavailable in this view.");return}Ki(!0),vr(null);try{await L({objective:I,status:"active",tokenBudget:we}),ri(""),Nt(!1),Yr(()=>({prompt:"",attachments:[]}))}catch(We){vr(We instanceof Error?We.message:"Unable to set goal.")}finally{Ki(!1)}}function ii(){var I;He(null),Qt("root"),Nt(!0),ri(u4((I=U.data)==null?void 0:I.tokenBudget)),vr(null),De==null||De(),requestAnimationFrame(()=>{var le;(le=cr.current)==null||le.focus()})}function ws(){Nt(!1),vr(null)}const wr=T.useMemo(()=>p.find(I=>I.model===o)??null,[o,p]),li=h4(o,g),oi=(wr==null?void 0:wr.supportedReasoningEfforts)??[],nl=T.useMemo(()=>X6(en,gr),[gr,en]),Cs=T.useMemo(()=>Object.entries(fa).sort(([I],[le])=>I.localeCompare(le)).map(([I,le])=>`${I}:${le}`).join("|"),[fa]);async function rl(){if(!ke)throw new Error("config.toml editing is unavailable in this view.");const I=await ke();return An(I.path),I}async function ql(I){if(!Ae)throw new Error("config.toml editing is unavailable in this view.");const le=await Ae(I);return An(le.path),le}function ui(){ze(null),or("project"),Zn("preToolUse"),Ce("Bash"),lt(Jp("preToolUse")),sn("30"),xe("Running hook")}function Wr(I){const le=o2(I);if(!le){be("Only command hooks in global or project hooks.json can be edited here.");return}ze(le),or(le.scope),Zn(le.eventName),Ce(le.matcher??""),lt(le.command),sn(le.timeoutSec?String(le.timeoutSec):""),xe(le.statusMessage??""),be(null),je(null),an("edit")}async function Pa(){const I=c4(Fe),le=zt.trim();if(!I){Jn("MCP name must use only letters, numbers, underscore, or hyphen.");return}if(!/^https?:\/\//i.test(le)){Jn("HTTP MCP URL must start with http:// or https://");return}Dr(!0),Jn(null),er(null);try{const we=await rl(),We=u2(we.content,I,f4(I,le));await ql(We),er("MCP entry written to config.toml. Restart Codex service if it does not appear immediately."),Ke("list"),nt(""),ut(""),he==null||he()}catch(we){Jn(we instanceof Error?we.message:"Unable to update config.toml.")}finally{Dr(!1)}}async function rs(){Dr(!0),Jn(null),er(null);try{await rl(),wt.trim()||pn(`[mcp_servers.example_stdio]
77
+ command = "npx"
78
+ args = ["-y", "your-mcp-server"]
79
+ `),Ke("stdio")}catch(I){Jn(I instanceof Error?I.message:"Unable to load config.toml.")}finally{Dr(!1)}}async function Ba(){const I=d4(wt);if(!I){Jn("The raw MCP block must start with a header like [mcp_servers.name].");return}Dr(!0),Jn(null),er(null);try{const le=await rl(),we=u2(le.content,I,wt);await ql(we),er("MCP entry written to config.toml. Restart Codex service if it does not appear immediately."),Ke("list"),he==null||he()}catch(le){Jn(le instanceof Error?le.message:"Unable to update config.toml.")}finally{Dr(!1)}}async function Qr(){if(Ge==="edit"&&!z){be("Hook editing is unavailable in this view.");return}if(Ge!=="edit"&&!ne){be("Hook editing is unavailable in this view.");return}if(Ge==="edit"&&!Se){be("Select a hook to edit first.");return}const I=Qe.trim();if(!I){be("Hook command cannot be empty.");return}const le=xt.trim(),we=le?Number(le):null;if(le&&(we===null||!Number.isInteger(we)||we<=0)){be("Timeout must be a positive number of seconds.");return}Ze(!0),be(null),je(null);try{const We={scope:xn,eventName:Bt,matcher:pe.trim()||null,command:I,timeoutSec:we,statusMessage:mn.trim()||null};Ge==="edit"?await(z==null?void 0:z({...We,target:Se})):await(ne==null?void 0:ne(We)),je(`${xn==="project"?"Project":"Global"} hook ${Ge==="edit"?"updated":"written"} in hooks.json and trusted.`),an("list"),ze(null)}catch(We){be(We instanceof Error?We.message:"Unable to write hooks.json.")}finally{Ze(!1)}}async function Yl(I){if(!ee||!I.currentHash){be("Hook trust is unavailable in this view.");return}Ze(!0),be(null),je(null);try{await ee({key:I.key,currentHash:I.currentHash}),je("Hook trusted.")}catch(le){be(le instanceof Error?le.message:"Unable to trust hook.")}finally{Ze(!1)}}async function al(I){if(!Te){be("Hook trust is unavailable in this view.");return}Ze(!0),be(null),je(null);try{await Te({key:I.key}),je("Hook untrusted.")}catch(le){be(le instanceof Error?le.message:"Unable to untrust hook.")}finally{Ze(!1)}}T.useEffect(()=>{if(Jt){ns({});return}const I={},le=new Set;for(const we of gr){if(we.kind!=="photo")continue;le.add(we.clientId);let We=dr.current.get(we.clientId);We||(We=URL.createObjectURL(we.file),dr.current.set(we.clientId,We)),I[we.clientId]=We}for(const[we,We]of dr.current.entries())le.has(we)||(URL.revokeObjectURL(We),dr.current.delete(we));ns(I)},[gr,Jt]),T.useEffect(()=>()=>{for(const I of dr.current.values())URL.revokeObjectURL(I);dr.current.clear()},[]);function Xr(){const I=cr.current,le=window.getSelection();if(!I||!le||le.rangeCount===0)return null;const we=le.getRangeAt(0);return!I.contains(we.startContainer)||!I.contains(we.endContainer)?null:{start:Ua(I,we.startContainer,we.startOffset),end:Ua(I,we.endContainer,we.endOffset)}}function Ua(I,le,we){var jt;let We=null,Xe=we;if(le===I){const kt=Array.from(I.childNodes);let tn=0;for(let Hn=0;Hn<Math.min(we,kt.length);Hn+=1){const Ft=kt[Hn];Ft&&(tn+=_l(Ft).length)}return tn}if(le.nodeType===Node.TEXT_NODE)We=le;else{const kt=Array.from(I.childNodes).find(tn=>tn.contains(le));if(!kt)return Sr().length;if(We=kt,kt instanceof HTMLElement&&kt.dataset.segmentType==="attachment"){const tn=document.createRange();tn.selectNodeContents(kt);const Hn=_l(kt).length;try{tn.setEnd(le,we);const Ft=tn.toString().length,ma=((jt=kt.textContent)==null?void 0:jt.length)??0;ma===0?Xe=Hn:Xe=Math.round(Math.min(1,Ft/ma)*Hn)}catch{Xe=Hn}}else{const tn=document.createRange();tn.selectNodeContents(kt);try{tn.setEnd(le,we),Xe=tn.toString().length}catch{Xe=_l(kt).length}}}const ht=Array.from(I.childNodes);let it=0;for(const kt of ht){if(kt===We)return kt.nodeType===Node.TEXT_NODE?it+Xe:it+Math.min(Xe,_l(kt).length);it+=_l(kt).length}return it}function Cr(I,le){let we=Math.max(0,le);const We=Array.from(I.childNodes);for(const[Xe,ht]of We.entries()){const jt=_l(ht).length;if(ht.nodeType===Node.TEXT_NODE){if(we<=jt)return{node:ht,offset:we};we-=jt;continue}if(ht instanceof HTMLElement&&ht.dataset.segmentType==="attachment"){if(we===0)return{node:I,offset:Xe};if(we<=jt){const kt=We[Xe+1];return we===jt&&(kt==null?void 0:kt.nodeType)===Node.TEXT_NODE?{node:kt,offset:0}:{node:I,offset:Xe+1}}we-=jt;continue}if(we<=jt)return{node:I,offset:Xe+1};we-=jt}return{node:I,offset:I.childNodes.length}}function ci(I){const le=cr.current;if(!le||!I)return;const we=Cr(le,I.start),We=Cr(le,I.end),Xe=document.createRange();Xe.setStart(we.node,we.offset),Xe.setEnd(We.node,We.offset);const ht=window.getSelection();ht==null||ht.removeAllRanges(),ht==null||ht.addRange(Xe)}function as(I){const le=ts.current;if(le.length===0)return!1;const we=le.at(-1);if(!we)return!1;const We=Array.from(I.childNodes).find(jt=>jt instanceof HTMLElement&&jt.dataset.segmentType==="attachment"&&jt.dataset.clientId===we);if(!(We instanceof HTMLElement))return!1;const Xe=document.createRange(),ht=We.nextSibling;(ht==null?void 0:ht.nodeType)===Node.TEXT_NODE?Xe.setStart(ht,0):Xe.setStartAfter(We),Xe.collapse(!0);const it=window.getSelection();return it==null||it.removeAllRanges(),it==null||it.addRange(Xe),!0}function Sr(){const I=cr.current;if(!I)return en;let le="";for(const we of Array.from(I.childNodes))le+=_l(we);return i2(le)}function Ss(I,le,we){const We=I==="photo"?"PHOTO":"FILE";let Xe=0;for(;;){const ht=Xe===0?le:`${le} (${Xe+1})`,it=`[${We} ${ht}]`;if(!we.has(it))return it;Xe+=1}}function Ns(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`attachment-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function q(I,le,we){const We=le.start>0?I[le.start-1]:"",Xe=le.end<I.length?I[le.end]:"",ht=!!(We&&!/\s/.test(We)),it=!Xe||!/\s/.test(Xe);return`${ht?" ":""}${we.join(" ")}${it?" ":""}`}function Z(I,le){if(!I||I.length===0)return;const we=Array.from(I),We=new Set(gr.map(Ft=>Ft.placeholder)),Xe=we.map(Ft=>{const ma=c2(Ft,le),pa=Ss(le,d2(ma),We);return We.add(pa),{clientId:Ns(),kind:le,originalName:ma,placeholder:pa,file:Ft}}),ht=Xr()??tr.current,it=ht?{start:ht.start,end:ht.end}:{start:en.length,end:en.length},jt=q(en,it,Xe.map(Ft=>Ft.placeholder)),kt=`${en.slice(0,it.start)}${jt}${en.slice(it.end)}`;Yr(Ft=>({prompt:kt,attachments:[...Ft.attachments,...Xe]}));const tn=jt.endsWith(" ")?1:0,Hn=it.start+jt.length-tn;un.current={start:Hn,end:Hn},tr.current={start:Hn,end:Hn},ts.current=Xe.map(Ft=>Ft.clientId),He(null)}function ue(I){if(I.length===0)return;const le={photo:I.filter(Ft=>t0(Ft)==="photo"),file:I.filter(Ft=>t0(Ft)==="file")},we=[...le.photo,...le.file],We=new Set(gr.map(Ft=>Ft.placeholder)),Xe=we.map(Ft=>{const ma=t0(Ft),pa=c2(Ft,ma),sd=Ss(ma,d2(pa),We);return We.add(sd),{clientId:Ns(),kind:ma,originalName:pa,placeholder:sd,file:Ft}}),ht=Xr()??tr.current,it=ht?{start:ht.start,end:ht.end}:{start:en.length,end:en.length},jt=q(en,it,Xe.map(Ft=>Ft.placeholder)),kt=`${en.slice(0,it.start)}${jt}${en.slice(it.end)}`;Yr(Ft=>({prompt:kt,attachments:[...Ft.attachments,...Xe]}));const tn=jt.endsWith(" ")?1:0,Hn=it.start+jt.length-tn;un.current={start:Hn,end:Hn},tr.current={start:Hn,end:Hn},ts.current=Xe.map(Ft=>Ft.clientId),He(null)}function Oe(I){if(!I)return;const le=Xr()??tr.current,we=(le==null?void 0:le.start)??en.length,We=(le==null?void 0:le.end)??we,Xe=i2(I),ht=`${en.slice(0,we)}${Xe}${en.slice(We)}`;Yr(jt=>({prompt:ht,attachments:jt.attachments}));const it=we+Xe.length;un.current={start:it,end:it},tr.current={start:it,end:it}}T.useEffect(()=>{function I(le){(typeof le.composedPath=="function"?le.composedPath():[]).some(Xe=>Xe instanceof HTMLElement&&(Xe.dataset.composerMenuSurface==="true"||Xe.dataset.composerMenuTrigger==="true"))||bt&&He(null)}if(bt)return window.addEventListener("pointerdown",I),()=>{window.removeEventListener("pointerdown",I)}},[bt]),T.useLayoutEffect(()=>{const I=cr.current;if(!I||Jt)return;const le=un.current,we=Sr()!==en||da.current!==Cs||Zi.current!==Rn;if(we){const We=document.createDocumentFragment();for(const Xe of nl){if(Xe.type==="text"){We.append(document.createTextNode(Xe.text===" "?" ":Xe.text));continue}const ht=Xe.attachment,it=document.createElement("span");if(it.dataset.segmentType="attachment",it.dataset.clientId=ht.clientId,it.dataset.placeholder=ht.placeholder,it.contentEditable="false",it.className="mx-[0.12rem] inline-flex max-w-full align-baseline",ht.kind==="photo"){it.classList.add("rounded-[0.95rem]","border","border-sky-300/35","bg-sky-300/10","p-1","shadow-sm","shadow-stone-950/20");const jt=fa[ht.clientId];if(jt){const tn=document.createElement("img");tn.src=jt,tn.alt=ht.originalName||"Pasted image",tn.className="h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-950 object-contain",tn.draggable=!1,it.append(tn)}else{const tn=document.createElement("span");tn.className="inline-block h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-900/80",tn.setAttribute("aria-hidden","true"),it.append(tn)}const kt=document.createElement("span");kt.className="ml-2 inline-flex max-w-[8rem] items-center text-[10px] font-medium tracking-[0.08em] text-sky-50",kt.textContent=h2(ht),it.append(kt)}else{it.classList.add("items-center","gap-2","rounded-[0.95rem]","border","border-emerald-300/35","bg-emerald-300/10","px-2.5","py-2","text-[10px]","font-medium","tracking-[0.08em]","text-emerald-50","shadow-sm","shadow-stone-950/20");const jt=document.createElement("span");jt.className="inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/25 bg-emerald-300/12 text-[9px]",jt.textContent="FILE";const kt=document.createElement("span");kt.className="inline-flex max-w-[10rem] truncate",kt.textContent=h2(ht),it.append(jt,kt)}We.append(it)}I.replaceChildren(We),da.current=Cs,Zi.current=Rn}le!==null?(I.focus(),as(I)||ci(le),tr.current=le):document.activeElement===I&&we&&ci(tr.current),un.current=null,ts.current=[]},[fa,Rn,Jt,Cs,en,nl]);function Le(){var I;(I=cr.current)==null||I.blur(),document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur()}async function gt(){var I;if(Le(),He(null),!!((I=navigator.clipboard)!=null&&I.readText))try{const le=await navigator.clipboard.readText();Oe(le)}catch{return}}async function Ye(){if(on&&!Jt){await ha();return}if(!Jt&&!en.trim())return;const I=Jt?en:en.trim(),le=Jt?[]:gr.filter(we=>I.includes(we.placeholder));await fe(le.length>0?{prompt:I,attachments:le}:{prompt:I}),Yr(()=>({prompt:"",attachments:[]}))}async function wn(I){I.preventDefault(),await Ye()}function _n(){const I=Sr(),le=Xr();tr.current=le;const we=cr.current;(we?Q6(we):!1)&&(un.current=le,lu(Xe=>Xe+1)),Yr(Xe=>({prompt:I,attachments:Xe.attachments.filter(ht=>I.includes(ht.placeholder))}))}function Mr(I){var we,We,Xe,ht;const le=ag((we=I.clipboardData)==null?void 0:we.items,(We=I.clipboardData)==null?void 0:We.files);if(le.length===0){const it=((Xe=I.clipboardData)==null?void 0:Xe.getData("text/plain"))??"",jt=((ht=I.clipboardData)==null?void 0:ht.getData("text/html"))??"",kt=it||W6(jt);if(!kt&&!jt)return;I.preventDefault(),Oe(kt);return}I.preventDefault(),ue(le)}function Ha(I){var le,we;f2((le=I.dataTransfer)==null?void 0:le.items,(we=I.dataTransfer)==null?void 0:we.files)&&(I.preventDefault(),En(!0))}function Gt(I){var le,we;f2((le=I.dataTransfer)==null?void 0:le.items,(we=I.dataTransfer)==null?void 0:we.files)&&(I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="copy"),En(!0))}function Ut(I){I.currentTarget.contains(I.relatedTarget)||En(!1)}function Re(I){var we,We;const le=ag((we=I.dataTransfer)==null?void 0:we.items,(We=I.dataTransfer)==null?void 0:We.files);le.length!==0&&(I.preventDefault(),En(!1),ue(le))}function Je(I){I.key==="Enter"&&(!I.metaKey&&!I.ctrlKey||(I.preventDefault(),!(n||v)&&Ye()))}async function tt(I){await(et==null?void 0:et(I)),He(null)}const Xt=on?"Describe the goal Codex should continue working toward...":w??(Jt?"Send shell input to the attached terminal...":"Ask Codex to inspect, modify, or explain code..."),Ct=Jt?"Send Ctrl-C":"Stop Current Turn",Kt=on?jr?"Setting...":"Set goal":!E&&n?"Connecting...":E&&n&&!Jt?"Sending...":"Send",Ln=E?on?"ui-action-info":"ui-action-primary":"ui-action-danger",In=r,za=t||ai?"relative z-20 shrink-0 bg-transparent px-3 pb-0 pt-3 sm:p-4":"relative z-20 shrink-0 bg-transparent px-3 pb-3 pt-0 sm:px-4 sm:pb-4 sm:pt-0",ss=`thread-composer-input min-h-[7.25rem] w-full rounded-[1.25rem] border px-4 pr-14 pt-2.5 outline-none transition sm:min-h-[6.25rem] ${kr?"is-drag-target border-sky-300/80 bg-sky-300/[0.08] shadow-[0_0_0_1px_rgba(125,211,252,0.2)]":"border-stone-700 focus-within:border-[var(--theme-accent-border)]"}`;return f.jsxs("div",{className:"relative z-20 shrink-0",children:[f.jsx("input",{ref:Da,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{Z(I.target.files,"photo"),I.target.value=""}}),f.jsx("input",{ref:ja,type:"file",multiple:!0,tabIndex:-1,className:"sr-only",onChange:I=>{Z(I.target.files,"file"),I.target.value=""}}),e==="chat"&&f.jsx("button",{type:"button","aria-label":"Jump to latest",title:y?"Latest turn is in view":"Jump to the latest messages",onClick:()=>_e==null?void 0:_e(),className:"absolute left-1/2 top-3 z-40 inline-flex h-9 min-w-[5.75rem] -translate-x-1/2 -translate-y-[62%] items-start justify-center bg-transparent pt-1 touch-manipulation sm:top-4",children:f.jsx("span",{className:`thread-jump-latest-badge pointer-events-none inline-flex h-4 min-w-[3.75rem] items-center justify-center rounded-[0.7rem] border shadow-sm transition ${y?"is-active border-sky-300/36 bg-sky-300/[0.03] text-sky-100/86":"border-stone-500/70 bg-stone-950/[0.08] text-stone-200/86"}`,children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m4 6 4 4 4-4"})})})}),f.jsxs("form",{ref:ca,onSubmit:wn,className:za,children:[f.jsxs("div",{className:"thread-composer-toolbar relative z-30 mb-0 flex items-center gap-2 rounded-full border px-2.5 py-1.5 text-xs shadow-lg shadow-stone-950/8",children:[f.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!Jt&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Open slash toolbox",title:"Open slash toolbox",onClick:()=>He(I=>I==="slash"?null:"slash"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:f.jsx(J6,{})}),bt==="slash"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute bottom-full left-0 z-40 mb-2 w-72 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20 backdrop-blur-xl",onClick:I=>{I.stopPropagation()},onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:Ve==="root"?f.jsxs("div",{className:"p-2",children:[f.jsx("button",{type:"button",disabled:r,onClick:()=>{tt({fastMode:!d})},className:`block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60 ${d?"ui-status-warning":"thread-composer-menu-item"}`,children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"/fast"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:d?"On":"Off"})]})}),f.jsx("button",{type:"button",disabled:i||n,onClick:()=>{He(null),K==null||K()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"/compact"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:i?"Busy":"Run"})]})}),f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),on?(ws(),He(null)):ii()},className:`mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition ${on||((ou=U.data)==null?void 0:ou.status)==="active"?"ui-status-warning":"thread-composer-menu-item"}`,children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"/goal"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:on?"Composing":U.data?l4(U.data.status):"Open"})]})}),f.jsx("button",{type:"button",disabled:n||ur,onClick:I=>{I.stopPropagation(),Qt("fork")},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"/fork"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:n?"Idle only":"Open"})]})}),f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Qt("skills"),V==null||V()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"/skills"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"View"})]})}),f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Qt("mcp"),he==null||he()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"/mcp"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"View"})]})}),f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Qt("hooks"),de==null||de()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"/hooks"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"View"})]})})]}):f.jsx("div",{className:"max-h-80 overflow-auto",children:Ve==="fork"?f.jsxs("div",{className:"p-2",children:[f.jsx("button",{type:"button",disabled:n||ur,onClick:()=>void el(),className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"Fork from latest"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:ur?"Forking":"Run"})]})}),f.jsx("button",{type:"button",disabled:n||ur,onClick:I=>{I.stopPropagation(),Qt("forkTurns"),F==null||F()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{children:"Fork from selected turn"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"Pick"})]})}),n?f.jsx("p",{className:"mt-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Fork is only available while the thread is idle."}):null]}):Ve==="forkTurns"?f.jsxs("div",{className:"p-2",children:[P.status==="loading"&&!P.data?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading turns…"}):null,P.error?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:P.error}):null,(Wc=P.data)!=null&&Wc.length?f.jsx("div",{className:"space-y-2",children:P.data.map(I=>f.jsx("button",{type:"button",disabled:ur,onClick:()=>void tl(I.turnId),className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition disabled:cursor-not-allowed disabled:opacity-60",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"text-sm text-stone-100",children:["Turn ",I.turnIndex]}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:ur?"Forking":I.status})]})},I.turnId))}):null,P.status!=="loading"&&!P.error&&(((Qc=P.data)==null?void 0:Qc.length)??0)===0?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No turns available to fork yet."}):null]}):Ve==="skills"?f.jsxs("div",{className:"p-2",children:[A.status==="loading"&&!A.data?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading skills…"}):null,A.error?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:A.error}):null,(Xc=A.data)!=null&&Xc.skills.length?f.jsx("div",{className:"space-y-2",children:A.data.skills.map(I=>{var le,we;return f.jsx("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:((le=I.interface)==null?void 0:le.displayName)??I.name}),f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em]",children:[f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1 text-stone-400",children:t4(I.scope)}),f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 rounded-full border px-2 py-1 normal-case tracking-normal transition ${Ja===I.name?"border-emerald-400/45 bg-emerald-400/12 text-emerald-100":"thread-composer-chip-button border-stone-700 text-stone-300 hover:border-stone-500"}`,onClick:()=>void Ji(I.name),title:`Copy $${I.name}`,"aria-label":`Copy $${I.name}`,children:[f.jsx(n0,{}),"$",I.name]})]}),f.jsx("p",{className:"text-xs leading-5 text-stone-400",children:((we=I.interface)==null?void 0:we.shortDescription)??I.shortDescription??I.description})]})},I.path)})}):null,(Kc=A.data)!=null&&Kc.errors.length?f.jsx("div",{className:"mt-2 space-y-2",children:A.data.errors.map(I=>f.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:[f.jsx("p",{className:"font-medium",children:I.message}),f.jsx("p",{className:"mt-1 break-all text-amber-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,A.status!=="loading"&&!A.error&&(((Wl=A.data)==null?void 0:Wl.skills.length)??0)===0&&(((Zc=A.data)==null?void 0:Zc.errors.length)??0)===0?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No skills available right now."}):null]}):Ve==="hooks"?f.jsxs("div",{className:"p-2",children:[f.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-xs text-stone-400",children:"Hook config sources"}),f.jsx("p",{className:"truncate text-[11px] text-stone-500",children:((Jc=$.data)==null?void 0:Jc.projectHooksPath)??"<workspace>/.codex/hooks.json"})]}),Ge==="list"?f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),ui(),an("add"),be(null),je(null)},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add Hook"}):null]}),$.status==="loading"&&!$.data?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading hooks…"}):null,$.error?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:$.error}):null,Q?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:Q}):null,ot?f.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:ot}):null,Ge==="add"||Ge==="edit"?f.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[Ge==="edit"?f.jsxs("p",{className:"rounded-lg border border-stone-800 bg-stone-950 px-3 py-2 text-[11px] text-stone-400",children:["Editing ",s4((Se==null?void 0:Se.eventName)??Bt)," in"," ",(Se==null?void 0:Se.scope)==="global"?"global":"project"," hooks.json"]}):null,f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsxs("label",{className:"block text-xs text-stone-400",children:["Scope",f.jsxs("select",{"aria-label":"Hook scope",value:xn,onChange:I=>or(I.target.value),disabled:Ge==="edit",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:[f.jsx("option",{value:"project",children:"Project"}),f.jsx("option",{value:"global",children:"Global"})]})]}),f.jsxs("label",{className:"block text-xs text-stone-400",children:["Event",f.jsx("select",{"aria-label":"Hook event",value:Bt,onChange:I=>Zn(I.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:Bf.map(I=>f.jsx("option",{value:I.value,children:I.label},I.value))})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Matcher"}),f.jsx("input",{"aria-label":"Hook matcher",value:pe,onChange:I=>Ce(I.target.value),placeholder:"Bash",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Command"}),f.jsx("textarea",{"aria-label":"Hook command",value:Qe,onChange:I=>lt(I.target.value),rows:3,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 font-mono text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsxs("label",{className:"block text-xs text-stone-400",children:["Timeout",f.jsx("input",{"aria-label":"Hook timeout seconds",value:xt,onChange:I=>sn(I.target.value),inputMode:"numeric",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]}),f.jsxs("label",{className:"block text-xs text-stone-400",children:["Status message",f.jsx("input",{"aria-label":"Hook status message",value:mn,onChange:I=>xe(I.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:()=>{an("list"),ze(null)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),f.jsx("button",{type:"button",onClick:()=>void Qr(),disabled:Pe,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:Pe?"Saving…":Ge==="edit"?"Update Hook":"Write Hook"})]})]}):null,Ge==="list"&&((ed=$.data)!=null&&ed.warnings.length)?f.jsx("div",{className:"mb-2 space-y-2",children:$.data.warnings.map(I=>f.jsx("p",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:I},I))}):null,Ge==="list"&&((uu=$.data)!=null&&uu.errors.length)?f.jsx("div",{className:"mb-2 space-y-2",children:$.data.errors.map(I=>f.jsxs("div",{className:"rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-2 text-xs text-rose-100/90",children:[f.jsx("p",{className:"font-medium",children:I.message}),f.jsx("p",{className:"mt-1 break-all text-rose-100/60",children:I.path})]},`${I.path}:${I.message}`))}):null,Ge==="list"&&((td=$.data)!=null&&td.hooks.length)?f.jsx("div",{className:"space-y-2",children:$.data.hooks.map(I=>f.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsxs("p",{className:"truncate text-sm font-medium text-stone-100",children:[n4(I.eventName),I.matcher?` · ${I.matcher}`:""]}),f.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-stone-400",children:I.command??I.handlerType}),I.statusMessage?f.jsx("p",{className:"mt-1 truncate text-[11px] text-stone-500",children:I.statusMessage}):null]}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.08em] text-stone-500",children:[o2(I)?f.jsx("button",{type:"button",onClick:le=>{le.stopPropagation(),Wr(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-sky-100 transition hover:border-sky-300/35 hover:bg-sky-300/10",children:"Edit"}):null,I.trustStatus==="trusted"&&!I.isManaged?f.jsx("button",{type:"button",disabled:Pe,onClick:le=>{le.stopPropagation(),al(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-amber-100 transition hover:border-amber-300/35 hover:bg-amber-300/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Untrust"}):null,(I.trustStatus==="untrusted"||I.trustStatus==="modified")&&!I.isManaged?f.jsx("button",{type:"button",disabled:Pe||!I.currentHash,onClick:le=>{le.stopPropagation(),Yl(I)},className:"thread-composer-chip-button rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-emerald-100 transition hover:border-emerald-300/35 hover:bg-emerald-300/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Trust"}):null,f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-0.5 text-stone-300",children:a4(I.trustStatus)})]}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em] text-stone-500",children:[f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:r4(I.source)}),f.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:I.enabled?"Enabled":"Disabled"}),f.jsxs("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:[I.timeoutSec,"s"]})]})]},I.key))}):null,Ge==="list"&&$.status!=="loading"&&!$.error&&(((nd=$.data)==null?void 0:nd.hooks.length)??0)===0?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No hooks configured for this workspace."}):null]}):f.jsxs("div",{className:"p-2",children:[f.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-xs text-stone-400",children:"MCP config source"}),f.jsx("p",{className:"truncate text-[11px] text-stone-500",children:ua??"~/.codex/config.toml"})]}),at==="list"?f.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),Ke("add"),Jn(null),er(null)},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add MCP"}):null]}),H.status==="loading"&&!H.data?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading MCP servers…"}):null,H.error?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:H.error}):null,Xi?f.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:Xi}):null,ni?f.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:ni}):null,at==="add"?f.jsxs("div",{className:"space-y-2",children:[f.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),Ke("http"),Jn(null),er(null)},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm text-stone-100",children:"HTTP / Streamable HTTP"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"Form"})]}),f.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Add an MCP server with a name and URL, then write the matching block into config.toml."})]}),f.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),rs()},className:"thread-composer-panel-button block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-sm text-stone-100",children:"stdio / raw block"}),f.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"TOML"})]}),f.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Write a single `[mcp_servers.name]` block, then save it back into config.toml."})]})]}):null,at==="http"?f.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"MCP name"}),f.jsx("input",{"aria-label":"MCP name",value:Fe,onChange:I=>nt(I.target.value),placeholder:"openaiDeveloperDocs",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"URL"}),f.jsx("input",{"aria-label":"URL",value:zt,onChange:I=>ut(I.target.value),placeholder:"https://developers.openai.com/mcp",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:()=>Ke("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),f.jsx("button",{type:"button",onClick:()=>void Pa(),disabled:qr,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:qr?"Saving…":"Write HTTP MCP"})]})]}):null,at==="stdio"?f.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[f.jsx("label",{className:"block text-xs text-stone-400",children:"MCP block for config.toml"}),f.jsx("textarea",{"aria-label":"MCP block for config.toml",value:wt,onChange:I=>pn(I.target.value),rows:8,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"}),f.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[f.jsx("button",{type:"button",onClick:()=>Ke("add"),className:"thread-composer-chip-button rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition",children:"Back"}),f.jsx("button",{type:"button",onClick:()=>void Ba(),disabled:qr,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:qr?"Saving…":"Write raw block"})]})]}):null,at==="list"&&((rd=H.data)!=null&&rd.servers.length)?f.jsx("div",{className:"space-y-2",children:H.data.servers.map(I=>f.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:I.name}),f.jsxs("p",{className:"mt-0.5 text-xs text-stone-400",children:[I.tools.length," tools · ",I.resourceCount," ","resources · ",I.resourceTemplateCount," templates"]})]}),f.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:e4(I.authStatus)})]}),I.tools.length>0?f.jsx("p",{className:"mt-2 line-clamp-2 text-xs text-stone-500",children:I.tools.slice(0,4).map(le=>le.title??le.name).join(" · ")}):null]},I.name))}):null,at==="list"&&H.status!=="loading"&&!H.error&&(((ad=H.data)==null?void 0:ad.servers.length)??0)===0?f.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No MCP servers available right now."}):null]})})})]}),!Jt&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":"Add attachment",title:"Add attachment",onClick:()=>He(I=>I==="attachments"?null:"attachments"),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:f.jsx(Z6,{})}),bt==="attachments"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"thread-composer-menu absolute left-0 top-full mt-2 w-32 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20",children:f.jsxs("div",{className:"p-2",children:[f.jsx("button",{type:"button",onClick:()=>{var I;Le(),(I=Da.current)==null||I.click()},className:"thread-composer-menu-item block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"Photo"}),f.jsx("button",{type:"button",onClick:()=>{var I;Le(),(I=ja.current)==null||I.click()},className:"thread-composer-menu-item mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition",children:"File"})]})})]}),f.jsx("button",{type:"button","aria-label":Jt?"Switch to chat":"Switch to shell",title:Jt?"Switch to chat":"Switch to shell",onClick:()=>st==null?void 0:st(),className:"thread-composer-icon-button inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:Jt?f.jsx(g4,{}):f.jsx(K6,{})})]}),f.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-1.5",children:[Jt&&si&&f.jsx("span",{className:"min-w-0 max-w-[12rem] truncate rounded-full px-1.5 py-1 text-stone-400",title:si,children:si}),ai&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":bt==="shellTools"?"Close shell tools":"Open shell tools","aria-haspopup":"menu","aria-expanded":bt==="shellTools",title:bt==="shellTools"?"Close shell tools":"Open shell tools",onClick:()=>{Le(),He(I=>I==="shellTools"?null:"shellTools")},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:f.jsx(b4,{})}),bt==="shellTools"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"absolute right-0 top-full z-40 mt-2 w-[11.5rem] max-w-[calc(100vw-1.5rem)] rounded-[1rem] border border-stone-700/90 bg-stone-950/96 p-2 shadow-2xl shadow-stone-950/40 sm:w-48",onMouseDown:I=>{I.stopPropagation()},onPointerDown:I=>{I.stopPropagation()},onTouchStart:I=>{I.stopPropagation()},children:f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsx("button",{type:"button",onClick:()=>void gt(),className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2 py-2 text-sky-50",children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(n0,{}),f.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Paste"})]})}),f.jsx("button",{type:"button",onClick:()=>{Le(),He(null),Me==null||Me()},className:"inline-flex items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-2 text-stone-100",children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(n0,{}),f.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Copy"})]})}),f.jsx("button",{type:"button",disabled:n,onClick:()=>{Le(),He(null),fe({prompt:"clear"})},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Tl,{label:"CLEAR",tone:"sky"})}),f.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled)||!(C!=null&&C.isCommandRunning),onClick:()=>{Le(),He(null),dt==null||dt("ctrl_c")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Tl,{label:"CTRL-C",tone:"rose"})}),f.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Le(),He(null),dt==null||dt("ctrl_d")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Tl,{label:"CTRL-D"})}),f.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Le(),He(null),dt==null||dt("esc")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Tl,{label:"ESC"})}),f.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Le(),He(null),dt==null||dt("tab")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Tl,{label:"TAB"})}),f.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Le(),He(null),dt==null||dt("up")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Tl,{label:"UP"})}),f.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{Le(),He(null),dt==null||dt("down")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:f.jsx(Tl,{label:"DOWN"})})]})})]})]})]}),on&&!Jt&&f.jsxs("div",{className:"relative z-20 mb-1.5 flex flex-wrap items-center gap-2 rounded-2xl border border-sky-300/25 bg-sky-300/[0.07] px-3 py-2 text-xs text-sky-50 shadow-sm shadow-stone-950/10",children:[f.jsx("span",{className:"font-medium uppercase tracking-[0.16em] text-sky-100/90",children:"Goal"}),f.jsxs("label",{className:"flex items-center gap-2 text-stone-300",children:[f.jsx("span",{children:"Max tokens (k)"}),f.jsx("input",{"aria-label":"Goal token budget",value:ks,onChange:I=>ri(I.target.value),inputMode:"numeric",placeholder:"Optional",className:"h-7 w-24 rounded-full border border-sky-300/25 bg-stone-950/60 px-3 text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/70"})]}),es?f.jsx("span",{className:"min-w-0 flex-1 text-rose-200",children:es}):null,f.jsx("button",{type:"button",onClick:ws,className:"rounded-full border border-stone-700/80 px-2.5 py-1 text-[11px] text-stone-300 transition hover:bg-stone-800",children:"Cancel"})]}),f.jsxs("div",{className:"relative",children:[Jt?f.jsx("textarea",{"aria-label":"Prompt",disabled:!1,value:en,onChange:I=>nr(I.target.value),onKeyDown:Je,rows:2,placeholder:Xt,className:`${ss} resize-y pb-10`}):f.jsxs("div",{className:ss,children:[en.length===0&&f.jsx("span",{className:"pointer-events-none absolute left-4 top-2.5 text-stone-500",children:Xt}),f.jsx("div",{ref:cr,role:"textbox","aria-label":"Prompt","aria-multiline":"true",contentEditable:!v,suppressContentEditableWarning:!0,onInput:()=>_n(),onPaste:Mr,onKeyDown:Je,onKeyUp:()=>{tr.current=Xr()},onMouseUp:()=>{tr.current=Xr()},onBlur:()=>{tr.current=Xr(),En(!1)},onDragEnter:Ha,onDragOver:Gt,onDragLeave:Ut,onDrop:Re,className:`relative z-[1] min-h-[5.75rem] whitespace-pre-wrap break-words pb-10 outline-none sm:min-h-[4.875rem] ${v?"cursor-not-allowed text-stone-500":""}`})]}),f.jsx("button",{type:"button","aria-label":Ct,title:Ct,onClick:()=>void(M==null?void 0:M()),disabled:!pt,className:`absolute right-2.5 top-2.5 inline-flex h-8 w-8 items-center justify-center rounded-full border transition ${pt?"border-rose-300/55 bg-rose-300/[0.14] text-rose-50 shadow-lg shadow-rose-950/20 hover:bg-rose-300/[0.22]":"cursor-not-allowed border-stone-700/30 bg-stone-400/[0.02] text-stone-500/55 opacity-55"}`,children:f.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}),f.jsx("button",{type:"submit","aria-label":on&&!Jt?"Set goal":Jt?"Send Shell Input":"Send Prompt",onMouseDown:I=>{I.preventDefault()},onPointerDown:I=>{I.preventDefault()},onTouchStart:I=>{I.preventDefault()},disabled:jr||n||(e==="chat"?v:!1),className:`absolute bottom-2.5 right-2.5 rounded-full px-3.5 py-1.5 text-sm font-medium shadow-lg shadow-stone-950/30 transition disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300 ${Ln}`,children:Kt}),!Jt&&f.jsxs("div",{className:"absolute bottom-2.5 left-3 z-30 flex max-w-[calc(100%-7rem)] items-center gap-1.5 text-xs",children:[f.jsxs("div",{className:"relative min-w-0",children:[f.jsxs("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":bt==="model","aria-label":o??"Select model",disabled:In||p.length===0,onClick:()=>He(I=>I==="model"?null:"model"),title:d?`Fast mode is on. Turn it off from the slash toolbox to edit model. ${li}`:li,className:"thread-composer-inline-toggle relative inline-flex min-w-0 max-w-[8.75rem] items-center overflow-hidden rounded-full px-2.5 py-1 text-left text-stone-300 transition disabled:cursor-not-allowed disabled:text-stone-600 sm:max-w-[11rem]",children:[o?f.jsx(m4,{contextUsage:g}):null,f.jsx("span",{className:"relative z-[1] block min-w-0 truncate whitespace-nowrap [direction:rtl]",children:o??"Select model"})]}),bt==="model"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[9rem] max-w-[14rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:f.jsx("div",{className:"max-h-72 overflow-auto p-2",children:p.map(I=>f.jsx("button",{type:"button",onClick:()=>void tt({model:I.model,reasoningEffort:I.defaultReasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.model===o?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:f.jsx("p",{className:"text-sm font-medium",children:I.model})},I.id))})})]}),f.jsxs("div",{className:"relative",children:[f.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":bt==="effort",disabled:In||oi.length===0,onClick:()=>He(I=>I==="effort"?null:"effort"),title:d?"Fast mode is on. Turn it off from the slash toolbox to edit reasoning.":void 0,className:"thread-composer-inline-toggle rounded-full px-2 py-1 text-stone-500 transition disabled:cursor-not-allowed disabled:text-stone-700",children:l2(c)}),bt==="effort"&&f.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[8rem] max-w-[12rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:f.jsx("div",{className:"max-h-72 overflow-auto p-2",children:oi.map(I=>f.jsx("button",{type:"button",onClick:()=>void tt({reasoningEffort:I.reasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${I.reasoningEffort===c?"ui-status-warning":"thread-composer-menu-item text-stone-300"}`,children:f.jsx("p",{className:"text-sm font-medium",children:l2(I.reasoningEffort)})},I.reasoningEffort))})})]}),f.jsx("button",{type:"button","aria-pressed":m==="plan",disabled:r,onClick:()=>void tt({collaborationMode:m==="plan"?"default":"plan"}),className:`thread-composer-inline-toggle rounded-full px-2.5 py-1 transition ${m==="plan"?"bg-sky-300/18 text-sky-100":"text-stone-500"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Plan"})]})]}),l&&f.jsx("div",{className:"mt-2 rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l})]})]})}const x4="modulepreload",y4=function(e){return"/"+e},m2={},D=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=o(n.map(m=>{if(m=y4(m),m in m2)return;m2[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const y=document.createElement("link");if(y.rel=p?"stylesheet":x4,p||(y.as="script"),y.crossOrigin="",y.href=m,d&&y.setAttribute("nonce",d),document.head.appendChild(y),p)return new Promise((E,v)=>{y.addEventListener("load",E),y.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&l(c.reason);return t().catch(l)})};function p2(e){return{background:e==="light"?"#f2ede5":"#0c1117",foreground:e==="light"?"#3f3a36":"#d6dde6",cursor:e==="light"?"#3f3a36":"#d6dde6",black:e==="light"?"#d8cfc2":"#0f1720",brightBlack:e==="light"?"#8a7f73":"#475569",red:"#f87171",brightRed:"#fb7185",green:e==="light"?"#16a34a":"#86efac",brightGreen:e==="light"?"#22c55e":"#4ade80",yellow:"#fbbf24",brightYellow:"#fcd34d",blue:e==="light"?"#2563eb":"#93c5fd",brightBlue:e==="light"?"#3b82f6":"#60a5fa",magenta:e==="light"?"#7c3aed":"#c4b5fd",brightMagenta:e==="light"?"#8b5cf6":"#a78bfa",cyan:e==="light"?"#0891b2":"#67e8f9",brightCyan:e==="light"?"#06b6d4":"#22d3ee",white:e==="light"?"#5b5148":"#e2e8f0",brightWhite:e==="light"?"#2c2723":"#f8fafc"}}function E4(e){switch(e){case"not_created":return"Not created";case"creating":return"Creating";case"running":return"Running";case"attached":return"Attached";case"detached":return"Detached";case"exited":return"Exited";case"not_found":return"Missing";case"workspace_missing":return"Workspace missing"}}function g2(e,t,n,r,i){const l=t.replace(/\r\n/g,`
80
+ `).replace(/\r/g,`
81
+ `),o=l.split(`
82
+ `);l.endsWith(`
83
+ `)&&o.at(-1)===""&&o.pop();let d=o.join(`\r
84
+ `);if(n!==void 0&&r!==void 0){const p=(i!==void 0?Math.max(0,o.length-i):0)+r,g=Math.max(0,o.length-p-1);g>0&&(d+=`\x1B[${g}A`),d+=`\r\x1B[${n+1}G`}e.reset(),e.write(d,()=>{e.scrollToBottom()})}function _4(e){return/^[a-z]$/i.test(e)?String.fromCharCode(e.toUpperCase().charCodeAt(0)-64):null}function a0(e){return e?Array.from(e.querySelectorAll(".xterm-rows > div")).map(n=>n.textContent??"").filter((n,r,i)=>n.length>0||r<i.length-1).join(`
85
+ `).trimEnd():""}function Fv(e){return e.replace(/\r\n/g,`
86
+ `).replace(/\r/g,`
87
+ `)}function b2(e){const t=Fv(e),n=t.split(`
88
+ `);return t.endsWith(`
89
+ `)&&n.at(-1)===""&&n.pop(),n}function T4(e){const t=e.trim();return t?/(?:[$%#>])\s*$/.test(t):!1}function v4(e,t){const n=t.trim();if(!n||e.length===0)return e;const[r,...i]=e;if(r===void 0)return e;const l=r.trim();return l===n||l.endsWith(` ${n}`)||l.endsWith(`$ ${n}`)||l.endsWith(`% ${n}`)||l.endsWith(`# ${n}`)||l.endsWith(`> ${n}`)?i:e}function k4(e,t,n){var d,m;const r=b2(e),i=b2(t);let l=0;for(;l<r.length&&l<i.length&&r[l]===i[l];)l+=1;let o=0;for(;o<r.length-l&&o<i.length-l&&r[r.length-1-o]===i[i.length-1-o];)o+=1;let c=i.slice(l,i.length-o);for(c=v4(c,n);c.length>0&&((d=c[0])==null?void 0:d.trim())==="";)c.shift();for(;c.length>0&&(((m=c.at(-1))==null?void 0:m.trim())===""||T4(c.at(-1)??""));)c.pop();return c.join(`
90
+ `).trimEnd()}function s0(e){if(!e)return"";const t=e.replace(/[\\/]+$/,"");return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function i0(e,t){const n=[t==null?void 0:t.trim(),e==null?void 0:e.trim()].filter(Boolean);return n.length>0?n.join(" "):null}function w4(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4 fill-current",children:[f.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),f.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),f.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function C4({connected:e}){return e?f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})}):f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9"})})}function x2(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M5.5 3.25h5"}),f.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function vl({label:e,tone:t="stone"}){const n=t==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-600 dark:text-rose-50":t==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-600 dark:text-sky-50":"shell-control-chip border";return f.jsx("span",{className:`inline-flex min-w-[3.45rem] items-center justify-center rounded-full border px-2.5 py-1.5 text-[11px] font-medium tracking-[0.12em] ${n}`,children:e})}function S4(e){switch(e){case"ctrl_c":return"";case"ctrl_d":return"";case"esc":return"\x1B";case"tab":return" ";case"up":return"\x1B[A";case"down":return"\x1B[B"}}const N4=T.forwardRef(function({threadId:t,isVisible:n=!0,showHeader:r=!0,showFloatingToolbox:i=!0,onStateChange:l},o){var sn,mn;const c=Pc(),d=T.useRef(null),m=T.useRef(null),p=T.useRef(null),g=T.useRef(null),y=T.useRef(null),E=T.useRef(null),v=T.useRef(0),w=T.useRef(""),C=T.useRef(null),S=T.useRef(""),N=T.useRef(null),A=T.useRef({cursorX:void 0,cursorY:void 0,paneHeight:void 0}),H=T.useRef(!1),$=T.useRef(null),[U,P]=T.useState(null),[Y,fe]=T.useState(null),[M,K]=T.useState(!0),[V,he]=T.useState(!1),[de,ne]=T.useState(null),[z,ee]=T.useState(0),[Te,De]=T.useState(!1),[L,F]=T.useState(!1),[se,O]=T.useState(!1),[ke,Ae]=T.useState(null),[_e,et]=T.useState(!1),[st,Me]=T.useState(null),dt=(c==null?void 0:c.effectiveTheme)??"dark",pt=T.useCallback((xe,Se)=>{Me({tone:xe,text:Se}),$.current!==null&&window.clearTimeout($.current),$.current=window.setTimeout(()=>{Me(null),$.current=null},1800)},[]),Dt=T.useCallback(xe=>{var Ze;const Se=p.current,ze=y.current,Pe=g.current;return!Se||!ze||!Pe?!1:(Se.send({type:"shell.input",shellId:ze,viewerId:Pe,data:xe}),L||(Ze=d.current)==null||Ze.focus(),!0)},[L]),kn=T.useCallback(()=>{var Pe;const xe=p.current,Se=y.current,ze=g.current;return!xe||!Se||!ze?!1:(xe.send({type:"shell.clear",shellId:Se,viewerId:ze}),L||(Pe=d.current)==null||Pe.focus(),!0)},[L]),bt=T.useCallback(xe=>{const Se=d.current,ze=m.current;!Se||!ze||(ze.fit(),w.current&&!a0(U)?g2(Se,w.current,A.current.cursorX,A.current.cursorY,A.current.paneHeight):Se.scrollToBottom(),xe!=null&&xe.focus&&!L&&Se.focus())},[L,U]),He=(Y==null?void 0:Y.state)??"not_created",Ve=T.useMemo(()=>(Y==null?void 0:Y.shell)??null,[Y==null?void 0:Y.shell]),Qt=!!(g.current&&Ve),at=T.useMemo(()=>i0(s0(Ve==null?void 0:Ve.cwd),null),[Ve==null?void 0:Ve.cwd]),Ke=ke??at,Ge=V||M||He==="creating"||He==="workspace_missing",an=He==="attached"?"border-emerald-300/45 bg-emerald-300/18 text-emerald-50 ring-1 ring-emerald-300/20 hover:bg-emerald-300/24":He==="exited"||He==="not_found"?"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800":He==="workspace_missing"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800",xn=He==="attached"?"Disconnect shell":He==="exited"||He==="not_found"?"Restart shell":Ve?"Connect shell":"Create shell",or=(st==null?void 0:st.tone)==="done"?"shell-floating-feedback shell-floating-feedback-done":(st==null?void 0:st.tone)==="failed"?"shell-floating-feedback shell-floating-feedback-failed":"shell-floating-feedback",Bt=T.useCallback(async()=>{K(!0);try{const xe=await d6(t);fe(xe),ne(null)}catch(xe){ne(xe instanceof Error?xe.message:"Unable to load shell state.")}finally{K(!1)}},[t]);T.useEffect(()=>{Bt()},[Bt]),T.useEffect(()=>{var xe;y.current=((xe=Y==null?void 0:Y.shell)==null?void 0:xe.id)??null},[(sn=Y==null?void 0:Y.shell)==null?void 0:sn.id]),T.useEffect(()=>{E.current=Y},[Y]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const xe=window.matchMedia("(max-width: 767px), (hover: none) and (pointer: coarse)"),Se=()=>{F(xe.matches),xe.matches||O(!1)};return Se(),xe.addEventListener("change",Se),()=>{xe.removeEventListener("change",Se)}},[]),T.useEffect(()=>()=>{$.current!==null&&window.clearTimeout($.current)},[]),T.useEffect(()=>{if(!U||d.current)return;let xe=!1,Se=null;return(async()=>{const[{Terminal:ze},{FitAddon:Pe}]=await Promise.all([D(()=>import("./xterm-CWQ1ih_R.js").then(be=>be.x),[]),D(()=>import("./addon-fit-YJmn1quW.js"),[])]);if(xe||!U)return;const Ze=new ze({cursorBlink:!0,disableStdin:L,fontFamily:"IBM Plex Mono, SFMono-Regular, Menlo, monospace",fontSize:13,lineHeight:1.25,scrollback:3e3,theme:p2(dt)}),Q=new Pe;Ze.loadAddon(Q),Ze.open(U),Q.fit(),Ze.attachCustomKeyEventHandler(be=>{if(L||be.type!=="keydown")return!0;if(be.ctrlKey&&!be.altKey&&!be.metaKey&&!be.shiftKey){const ot=_4(be.key);return ot&&Dt(ot)?(be.preventDefault(),!1):!0}return!0}),d.current=Ze,m.current=Q,De(!0),N.current=new ResizeObserver(()=>{bt(),p.current&&y.current&&g.current&&p.current.send({type:"shell.resize",shellId:y.current,viewerId:g.current,cols:Ze.cols,rows:Ze.rows})}),N.current.observe(U),Se=Ze.onData(be=>{L||Dt(be)})})(),()=>{var ze,Pe;xe=!0,Se==null||Se.dispose(),(ze=N.current)==null||ze.disconnect(),N.current=null,De(!1),(Pe=d.current)==null||Pe.dispose(),d.current=null,m.current=null}},[L,bt,Dt,U]),T.useEffect(()=>{if(!n||!Te)return;let xe=window.requestAnimationFrame(()=>{bt({focus:!0})});return()=>{window.cancelAnimationFrame(xe)}},[n,bt,Te]),T.useEffect(()=>{const xe=d.current;xe&&(xe.options.disableStdin=L)},[L]),T.useEffect(()=>{var Q;const xe=E.current,Se=(Q=xe==null?void 0:xe.shell)==null?void 0:Q.id;if(!Se)return;const ze=xe==null?void 0:xe.state;if(ze==="not_created"||ze==="workspace_missing"||ze==="creating"||ze==="not_found"||ze==="exited")return;const Pe=d.current;if(!Pe||!Te||z===v.current)return;v.current=z,Pe.reset(),ne(null),g.current=null,Pe.focus();const Ze=P6({onConnected:()=>{Ze.send({type:"shell.attach",shellId:Se,cols:Pe.cols,rows:Pe.rows})},onShellEvent:be=>{if(be.shellId!==Se)return;if(be.type==="shell.connected"){const je=String(be.payload.viewerId??"");g.current=je||null,fe(Fe=>Fe&&{...Fe,state:"attached",shell:Fe.shell?{...Fe.shell,status:"attached",attachedViewerId:je}:Fe.shell});return}if(be.type==="shell.output"){const je=typeof be.payload.data=="string"?be.payload.data:"",Fe=be.payload.replace===!0,nt=typeof be.payload.cursorX=="number"?be.payload.cursorX:void 0,zt=typeof be.payload.cursorY=="number"?be.payload.cursorY:void 0,ut=typeof be.payload.paneHeight=="number"?be.payload.paneHeight:void 0,wt=typeof be.payload.cwdBaseName=="string"?be.payload.cwdBaseName:null,pn=typeof be.payload.envPrefix=="string"?be.payload.envPrefix:null,ua=i0(wt??s0(Ve==null?void 0:Ve.cwd),pn),An=be.payload.isCommandRunning===!0;if(A.current={cursorX:nt,cursorY:zt,paneHeight:ut},Ae(ua),et(An),H.current=An,je)if(Fe){const qr=Fv(je);w.current=qr,g2(Pe,je,nt,zt,ut),!An&&C.current&&(S.current=k4(C.current.beforeSnapshot,qr,C.current.command),C.current=null)}else Pe.write(je);return}if(be.type==="shell.error"){ne(String(be.payload.message??"Shell connection failed.")),be.payload.code==="viewer_conflict"&&fe(je=>je&&{...je,state:"detached",shell:je.shell?{...je.shell,status:"detached",attachedViewerId:null}:je.shell});return}if(be.type==="shell.detached"){const je=String(be.payload.viewerId??""),Fe=String(be.payload.reason??"");je&&je===g.current&&(g.current=null,fe(nt=>nt&&{...nt,state:"detached",shell:nt.shell?{...nt.shell,status:"detached",attachedViewerId:null}:nt.shell}),ne(Fe==="replaced"?"This shell connection was taken over by another device.":null),et(!1),H.current=!1,Ze.socket.close());return}if(be.type==="shell.exited"){g.current=null,et(!1),H.current=!1;const je=be.payload.state==="exited"?"exited":"not_found";fe(Fe=>Fe&&{...Fe,state:je,shell:Fe.shell?{...Fe.shell,status:je,attachedViewerId:null}:Fe.shell});return}const ot=be.payload.state;ot&&(ot!=="attached"&&(g.current=null,et(!1),H.current=!1),fe(je=>je&&{...je,state:ot,shell:je.shell?{...je.shell,status:ot==="attached"||ot==="detached"?ot:je.shell.status,attachedViewerId:ot==="attached"?je.shell.attachedViewerId:null}:je.shell}))}});return p.current=Ze,Ze.socket.addEventListener("close",()=>{var be;((be=p.current)==null?void 0:be.socket)===Ze.socket&&(p.current=null)}),()=>{var ot;const be=g.current;be&&Ze.send({type:"shell.detach",shellId:Se,viewerId:be}),g.current=null,Ze.socket.close(),((ot=p.current)==null?void 0:ot.socket)===Ze.socket&&(p.current=null)}},[z,Ve==null?void 0:Ve.cwd,(mn=Y==null?void 0:Y.shell)==null?void 0:mn.id,Te]);const Zn=T.useCallback(async()=>{he(!0);try{const xe=d.current,Se=await m6(t,{...(xe==null?void 0:xe.cols)!==void 0?{cols:xe.cols}:{},...(xe==null?void 0:xe.rows)!==void 0?{rows:xe.rows}:{}});fe(Se),ee(ze=>ze+1),ne(null)}catch(xe){ne(xe instanceof Wt?xe.payload.message:"Unable to create shell.")}finally{he(!1)}},[t]),pe=T.useCallback(async()=>{if(He==="exited"||He==="not_found"){await Zn();return}ne(null),ee(xe=>xe+1)},[Zn,He]),Ce=T.useCallback(async()=>{if(Y!=null&&Y.shell){he(!0);try{await p6(Y.shell.id),await Bt(),ne(null)}catch(xe){ne(xe instanceof Wt?xe.payload.message:"Unable to terminate shell.")}finally{he(!1)}}},[Bt,Y==null?void 0:Y.shell]),Qe=T.useCallback(()=>{var Pe;const xe=p.current,Se=y.current,ze=g.current;!xe||!Se||(ze&&xe.send({type:"shell.detach",shellId:Se,viewerId:ze}),g.current=null,xe.socket.close(),((Pe=p.current)==null?void 0:Pe.socket)===xe.socket&&(p.current=null),ne(null),fe(Ze=>Ze&&{...Ze,state:"detached",shell:Ze.shell?{...Ze.shell,status:"detached",attachedViewerId:null}:Ze.shell}))},[dt]);T.useEffect(()=>{d.current&&(d.current.options.theme=p2(dt))},[dt]);const lt=T.useCallback(async()=>{if(!(V||M||He==="creating"||He==="workspace_missing")){if(He==="attached"){Qe();return}if(He==="exited"||He==="not_found"||!Ve){await Zn();return}await pe()}},[V,Zn,Qe,pe,M,Ve,He]),xt=T.useCallback(async()=>{var xe,Se,ze,Pe;try{const Ze=((Se=(xe=d.current)==null?void 0:xe.getSelection())==null?void 0:Se.trim())||((Pe=(ze=window.getSelection)==null?void 0:ze.call(window))==null?void 0:Pe.toString().trim())||a0(U);return Ze?(await navigator.clipboard.writeText(Ze),pt("done","Copied"),!0):(pt("failed","Nothing to copy"),!1)}catch{return pt("failed","Copy failed"),!1}},[U,pt]);return T.useEffect(()=>{if(!(Ve!=null&&Ve.cwd)){Ae(null);return}Ae(xe=>xe??i0(s0(Ve.cwd),null))},[Ve==null?void 0:Ve.cwd]),T.useEffect(()=>{l==null||l({status:He,connectionButtonDisabled:Ge,connectionButtonLabel:xn,shellInputEnabled:Qt,isCommandRunning:_e,promptLabel:Ke,isMobileShell:L,hasShell:!!Ve,busy:V,loading:M,error:de})},[V,Ge,xn,de,L,_e,M,l,Ke,Ve,Qt,He]),T.useImperativeHandle(o,()=>({async toggleConnection(){await lt()},sendInput(xe){return Dt(xe)},sendCommand(xe){const Se={command:xe,beforeSnapshot:w.current};if(C.current=Se,xe.trim()==="clear"){const Ze=kn();return!Ze&&C.current===Se&&(C.current=null),Ze}const ze=xe.endsWith(`
91
+ `)?xe:`${xe}
92
+ `,Pe=Dt(ze);return!Pe&&C.current===Se&&(C.current=null),Pe},sendControl(xe){return xe==="clear"?kn():Dt(S4(xe))},async copyLastCommandOutput(){const xe=S.current.trim()||a0(U);if(!xe)return pt("failed","Nothing to copy"),!1;try{return await navigator.clipboard.writeText(xe),pt("done","Copied"),!0}catch{return pt("failed","Copy failed"),!1}},async terminate(){await Ce()},focus(){var xe;(xe=d.current)==null||xe.focus()},refreshLayout(xe){bt(xe)}}),[lt,Ce,bt,kn,Dt,pt,U]),f.jsxs("div",{className:"shell-panel flex min-h-0 flex-1 flex-col",children:[r&&f.jsxs("div",{className:"shell-header shrink-0 border-b px-3 py-3 sm:px-5",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Shell"}),f.jsx("p",{className:"mt-1 truncate text-sm text-[var(--theme-fg-soft)]",children:Ke??(Ve==null?void 0:Ve.cwd)??"Create a durable shell for this thread."})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("button",{type:"button","aria-label":xn,title:`${xn} (${E4(He)})`,disabled:Ge,onClick:()=>void lt(),className:`inline-flex h-10 w-10 items-center justify-center rounded-full border shadow-lg shadow-stone-950/25 transition disabled:cursor-not-allowed disabled:opacity-60 ${an}`,children:f.jsx(C4,{connected:He==="attached"})}),Ve&&f.jsx("button",{type:"button",disabled:V,onClick:()=>void Ce(),className:"rounded-full border border-rose-300/35 bg-rose-300/12 px-3 py-2 text-sm text-rose-600 transition hover:bg-rose-300/18 dark:text-rose-100 disabled:cursor-not-allowed disabled:opacity-60",children:"Terminate"})]})]}),(de||M||(Y==null?void 0:Y.workspacePathStatus)==="missing")&&f.jsxs("div",{className:"shell-banner mt-3 rounded-2xl border px-3 py-3 text-sm",children:[M&&f.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!M&&(Y==null?void 0:Y.workspacePathStatus)==="missing"&&f.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!M&&de&&f.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:de})]})]}),f.jsx("div",{className:"min-h-0 flex-1",children:He==="not_created"||He==="workspace_missing"?f.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:f.jsxs("div",{className:"shell-empty-state max-w-md rounded-[1.6rem] border px-6 py-8",children:[f.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Durable thread shell"}),f.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-muted)]",children:"The shell runs under supervisor-managed tmux and survives browser disconnects. Create it explicitly when you want to inspect or take over the workspace."})]})}):f.jsx("div",{className:"h-full min-h-0 p-2 sm:p-3",children:f.jsxs("div",{className:"shell-terminal-frame relative h-full rounded-[1.4rem] border shadow-inner",children:[!r&&(de||M||(Y==null?void 0:Y.workspacePathStatus)==="missing")&&f.jsxs("div",{className:"shell-banner absolute left-2 right-2 top-2 z-10 rounded-2xl border px-3 py-3 text-sm backdrop-blur sm:left-3 sm:right-3 sm:top-3",children:[M&&f.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!M&&(Y==null?void 0:Y.workspacePathStatus)==="missing"&&f.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!M&&de&&f.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:de})]}),f.jsx("div",{ref:P,className:`h-full w-full px-2 py-2 sm:px-3 sm:py-3 ${L?"mobile-shell-selectable":""}`,onMouseDown:()=>{var xe;(xe=d.current)==null||xe.focus()}}),i&&L&&f.jsxs("div",{className:"pointer-events-none absolute bottom-3 right-3 z-20 flex flex-col items-end gap-2",children:[st&&f.jsx("div",{className:`pointer-events-auto rounded-full border px-3 py-1.5 text-[11px] shadow-lg shadow-stone-950/30 backdrop-blur ${or}`,children:st.text}),se&&f.jsx("div",{className:"shell-toolbox pointer-events-auto rounded-[1.2rem] border p-2 shadow-2xl backdrop-blur",children:f.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[f.jsx("button",{type:"button",onClick:()=>{pt("idle","Use the prompt box tools to paste")},className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2.5 py-2 text-sky-600 dark:text-sky-50",children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(x2,{}),f.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Paste"})]})}),f.jsx("button",{type:"button",onClick:()=>void xt(),className:"shell-toolbox-copy inline-flex items-center justify-center rounded-full border px-2.5 py-2",children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(x2,{}),f.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Copy"})]})}),f.jsx("button",{type:"button",disabled:!Qt,onClick:()=>{kn()?pt("done","Cleared"):pt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(vl,{label:"CLEAR",tone:"sky"})}),f.jsx("button",{type:"button",disabled:!Qt||!_e,onClick:()=>{Dt("")?pt("done","Sent Ctrl-C"):pt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(vl,{label:"CTRL-C",tone:"rose"})}),f.jsx("button",{type:"button",disabled:!Qt,onClick:()=>{Dt("")?pt("done","Sent Ctrl-D"):pt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(vl,{label:"CTRL-D",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!Qt,onClick:()=>{Dt("\x1B")?pt("done","Sent Esc"):pt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(vl,{label:"ESC",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!Qt,onClick:()=>{Dt(" ")?pt("done","Sent Tab"):pt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(vl,{label:"TAB",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!Qt,onClick:()=>{Dt("\x1B[A")?pt("done","Sent Up"):pt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(vl,{label:"UP",tone:"stone"})}),f.jsx("button",{type:"button",disabled:!Qt,onClick:()=>{Dt("\x1B[B")?pt("done","Sent Down"):pt("failed","Connect the shell first")},className:"disabled:opacity-45",children:f.jsx(vl,{label:"DOWN",tone:"stone"})})]})}),f.jsx("button",{type:"button","aria-expanded":se,"aria-label":se?"Close shell tools":"Open shell tools",onClick:()=>O(xe=>!xe),className:"shell-toolbox-trigger pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-2xl backdrop-blur transition",children:f.jsx(w4,{})})]})]})})})]})});let qn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function A4(e){return u1(e)}function u1(e){return Array.isArray(e)?R4(e):e instanceof RegExp?e:typeof e=="object"?L4(e):e}function R4(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=u1(e[n]);return t}function L4(e){let t={};for(let n in e)t[n]=u1(e[n]);return t}function $v(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Vv(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Vv(e.substring(0,e.length-1)):e.substr(~t+1)}var l0=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,df=class{static hasCaptures(e){return e===null?!1:(l0.lastIndex=0,l0.test(e))}static replaceCaptures(e,t,n){return e.replace(l0,(r,i,l,o)=>{let c=n[parseInt(i||l,10)];if(c){let d=t.substring(c.start,c.end);for(;d[0]===".";)d=d.substring(1);switch(o){case"downcase":return d.toLowerCase();case"upcase":return d.toUpperCase();default:return d}}else return r})}};function Gv(e,t){return e<t?-1:e>t?1:0}function qv(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let l=Gv(e[i],t[i]);if(l!==0)return l}return 0}return n-r}function y2(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Yv(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Wv=class{constructor(e){oe(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Wf=class{constructor(e,t,n){oe(this,"_cachedMatchRoot",new Wv(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(D4(e),t)}static createFromParsedTheme(e,t){return M4(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>I4(e.parent,i.parentScopes));return r?new Qv(r.fontStyle,r.foreground,r.background):null}},o0=class Uf{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Uf(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Uf(n,t[r]);return n}push(t){return new Uf(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function I4(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!O4(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function O4(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Qv=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function D4(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,l=t.length;i<l;i++){let o=t[i];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let g=o.scope;g=g.replace(/^[,]+/,""),g=g.replace(/[,]+$/,""),c=g.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let d=-1;if(typeof o.settings.fontStyle=="string"){d=0;let g=o.settings.fontStyle.split(" ");for(let y=0,E=g.length;y<E;y++)switch(g[y]){case"italic":d=d|1;break;case"bold":d=d|2;break;case"underline":d=d|4;break;case"strikethrough":d=d|8;break}}let m=null;typeof o.settings.foreground=="string"&&y2(o.settings.foreground)&&(m=o.settings.foreground);let p=null;typeof o.settings.background=="string"&&y2(o.settings.background)&&(p=o.settings.background);for(let g=0,y=c.length;g<y;g++){let v=c[g].trim().split(" "),w=v[v.length-1],C=null;v.length>1&&(C=v.slice(0,v.length-1),C.reverse()),n[r++]=new j4(w,C,i,d,m,p)}}return n}var j4=class{constructor(e,t,n,r,i,l){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=l}},yr=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(yr||{});function M4(e,t){e.sort((d,m)=>{let p=Gv(d.scope,m.scope);return p!==0||(p=qv(d.parentScopes,m.parentScopes),p!==0)?p:d.index-m.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let d=e.shift();d.fontStyle!==-1&&(n=d.fontStyle),d.foreground!==null&&(r=d.foreground),d.background!==null&&(i=d.background)}let l=new P4(t),o=new Qv(n,l.getId(r),l.getId(i)),c=new U4(new sg(0,null,-1,0,0),[]);for(let d=0,m=e.length;d<m;d++){let p=e[d];c.insert(0,p.scope,p.parentScopes,p.fontStyle,l.getId(p.foreground),l.getId(p.background))}return new Wf(l,o,c)}var P4=class{constructor(e){oe(this,"_isFrozen");oe(this,"_lastColorId");oe(this,"_id2color");oe(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},B4=Object.freeze([]),sg=class Xv{constructor(t,n,r,i,l){oe(this,"scopeDepth");oe(this,"parentScopes");oe(this,"fontStyle");oe(this,"foreground");oe(this,"background");this.scopeDepth=t,this.parentScopes=n||B4,this.fontStyle=r,this.foreground=i,this.background=l}clone(){return new Xv(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},U4=class ig{constructor(t,n=[],r={}){oe(this,"_rulesWithParentScopes");this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const l=n.parentScopes[i].length-t.parentScopes[r].length;if(l!==0)return l;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,l;if(r===-1?(i=t,l=""):(i=t.substring(0,r),l=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(l)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ig._cmpBySpecificity),n}insert(t,n,r,i,l,o){if(n===""){this._doInsertHere(t,r,i,l,o);return}let c=n.indexOf("."),d,m;c===-1?(d=n,m=""):(d=n.substring(0,c),m=n.substring(c+1));let p;this._children.hasOwnProperty(d)?p=this._children[d]:(p=new ig(this._mainRule.clone(),sg.cloneArr(this._rulesWithParentScopes)),this._children[d]=p),p.insert(t+1,m,r,i,l,o)}_doInsertHere(t,n,r,i,l){if(n===null){this._mainRule.acceptOverwrite(t,r,i,l);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let d=this._rulesWithParentScopes[o];if(qv(d.parentScopes,n)===0){d.acceptOverwrite(t,r,i,l);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),l===0&&(l=this._mainRule.background),this._rulesWithParentScopes.push(new sg(t,n,r,i,l))}},Fo=class ka{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=ka.getLanguageId(t),r=ka.getTokenType(t),i=ka.getFontStyle(t),l=ka.getForeground(t),o=ka.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:l,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,l,o,c){let d=ka.getLanguageId(t),m=ka.getTokenType(t),p=ka.containsBalancedBrackets(t)?1:0,g=ka.getFontStyle(t),y=ka.getForeground(t),E=ka.getBackground(t);return n!==0&&(d=n),r!==8&&(m=r),i!==null&&(p=i?1:0),l!==-1&&(g=l),o!==0&&(y=o),c!==0&&(E=c),(d<<0|m<<8|p<<10|g<<11|y<<15|E<<24)>>>0}};function Qf(e,t){const n=[],r=H4(e);let i=r.next();for(;i!==null;){let d=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":d=1;break;case"L":d=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let m=o();if(n.push({matcher:m,priority:d}),i!==",")break;i=r.next()}return n;function l(){if(i==="-"){i=r.next();const d=l();return m=>!!d&&!d(m)}if(i==="("){i=r.next();const d=c();return i===")"&&(i=r.next()),d}if(E2(i)){const d=[];do d.push(i),i=r.next();while(E2(i));return m=>t(d,m)}return null}function o(){const d=[];let m=l();for(;m;)d.push(m),m=l();return p=>d.every(g=>g(p))}function c(){const d=[];let m=o();for(;m&&(d.push(m),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");m=o()}return p=>d.some(g=>g(p))}}function E2(e){return!!e&&!!e.match(/[\w\.:]+/)}function H4(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Kv(e){typeof e.dispose=="function"&&e.dispose()}var wc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},z4=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},F4=class{constructor(){oe(this,"_references",[]);oe(this,"_seenReferenceKeys",new Set);oe(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},$4=class{constructor(e,t){oe(this,"seenFullScopeRequests",new Set);oe(this,"seenPartialScopeRequests",new Set);oe(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new wc(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new F4;for(const n of e)V4(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof wc){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function V4(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const l=n.lookup(t);e instanceof wc?Hf({baseGrammar:l,selfGrammar:i},r):lg(e.ruleName,{baseGrammar:l,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const c of o)r.add(new wc(c))}function lg(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Xf([r],t,n)}}function Hf(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Xf(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Xf(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Xf(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?$v({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Xf(r.patterns,{...t,repository:i},n);const l=r.include;if(!l)continue;const o=Zv(l);switch(o.kind){case 0:Hf({...t,selfGrammar:t.baseGrammar},n);break;case 1:Hf(t,n);break;case 2:lg(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const c=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(c){const d={baseGrammar:t.baseGrammar,selfGrammar:c,repository:i};o.kind===4?lg(o.ruleName,d,n):Hf(d,n)}else o.kind===4?n.add(new z4(o.scopeName,o.ruleName)):n.add(new wc(o.scopeName));break}}}var G4=class{constructor(){oe(this,"kind",0)}},q4=class{constructor(){oe(this,"kind",1)}},Y4=class{constructor(e){oe(this,"kind",2);this.ruleName=e}},W4=class{constructor(e){oe(this,"kind",3);this.scopeName=e}},Q4=class{constructor(e,t){oe(this,"kind",4);this.scopeName=e,this.ruleName=t}};function Zv(e){if(e==="$base")return new G4;if(e==="$self")return new q4;const t=e.indexOf("#");if(t===-1)return new W4(e);if(t===0)return new Y4(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new Q4(n,r)}}var X4=/\\(\d+)/,_2=/\\(\d+)/g,K4=-1,Jv=-2;var Bc=class{constructor(e,t,n,r){oe(this,"$location");oe(this,"id");oe(this,"_nameIsCapturing");oe(this,"_name");oe(this,"_contentNameIsCapturing");oe(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=df.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=df.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Vv(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:df.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:df.replaceCaptures(this._contentName,e,t)}},Z4=class extends Bc{constructor(t,n,r,i,l){super(t,n,r,i);oe(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=l}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,r,i){throw new Error("Not supported!")}},J4=class extends Bc{constructor(t,n,r,i,l){super(t,n,r,null);oe(this,"_match");oe(this,"captures");oe(this,"_cachedCompiledPatterns");this._match=new Cc(i,this.id),this.captures=l,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,n){n.push(this._match)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Sc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},T2=class extends Bc{constructor(t,n,r,i,l){super(t,n,r,i);oe(this,"hasMissingPatterns");oe(this,"patterns");oe(this,"_cachedCompiledPatterns");this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,n){for(const r of this.patterns)t.getRule(r).collectPatterns(t,n)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Sc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},og=class extends Bc{constructor(t,n,r,i,l,o,c,d,m,p){super(t,n,r,i);oe(this,"_begin");oe(this,"beginCaptures");oe(this,"_end");oe(this,"endHasBackReferences");oe(this,"endCaptures");oe(this,"applyEndPatternLast");oe(this,"hasMissingPatterns");oe(this,"patterns");oe(this,"_cachedCompiledPatterns");this._begin=new Cc(l,this.id),this.beginCaptures=o,this._end=new Cc(c||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=m||!1,this.patterns=p.patterns,this.hasMissingPatterns=p.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,n){return this._end.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t,n).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t,n).compileAG(t,r,i)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Sc;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},Kf=class extends Bc{constructor(t,n,r,i,l,o,c,d,m){super(t,n,r,i);oe(this,"_begin");oe(this,"beginCaptures");oe(this,"whileCaptures");oe(this,"_while");oe(this,"whileHasBackReferences");oe(this,"hasMissingPatterns");oe(this,"patterns");oe(this,"_cachedCompiledPatterns");oe(this,"_cachedCompiledWhilePatterns");this._begin=new Cc(l,this.id),this.beginCaptures=o,this.whileCaptures=d,this._while=new Cc(c,Jv),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=m.patterns,this.hasMissingPatterns=m.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Sc;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,n){return this._getCachedCompiledWhilePatterns(t,n).compile(t)}compileWhileAG(t,n,r,i){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,r,i)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Sc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},ek=class xr{static createCaptureRule(t,n,r,i,l){return t.registerRule(o=>new Z4(n,o,r,i,l))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new J4(t.$vscodeTextmateLocation,t.id,t.name,t.match,xr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=$v({},r,t.repository));let l=t.patterns;return typeof l>"u"&&t.include&&(l=[{include:t.include}]),new T2(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,xr._compilePatterns(l,n,r))}return t.while?new Kf(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,xr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,xr._compileCaptures(t.whileCaptures||t.captures,n,r),xr._compilePatterns(t.patterns,n,r)):new og(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,xr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,xr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,xr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let l=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>l&&(l=c)}for(let o=0;o<=l;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let d=0;t[o].patterns&&(d=xr.getCompiledRuleId(t[o],n,r)),i[c]=xr.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,d)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let l=0,o=t.length;l<o;l++){const c=t[l];let d=-1;if(c.include){const m=Zv(c.include);switch(m.kind){case 0:case 1:d=xr.getCompiledRuleId(r[c.include],n,r);break;case 2:let p=r[m.ruleName];p&&(d=xr.getCompiledRuleId(p,n,r));break;case 3:case 4:const g=m.scopeName,y=m.kind===4?m.ruleName:null,E=n.getExternalGrammar(g,r);if(E)if(y){let v=E.repository[y];v&&(d=xr.getCompiledRuleId(v,n,E.repository))}else d=xr.getCompiledRuleId(E.repository.$self,n,E.repository);break}}else d=xr.getCompiledRuleId(c,n,r);if(d!==-1){const m=n.getRule(d);let p=!1;if((m instanceof T2||m instanceof og||m instanceof Kf)&&m.hasMissingPatterns&&m.patterns.length===0&&(p=!0),p)continue;i.push(d)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Cc=class tk{constructor(t,n){oe(this,"source");oe(this,"ruleId");oe(this,"hasAnchor");oe(this,"hasBackReferences");oe(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let i=0,l=[],o=!1;for(let c=0;c<r;c++)if(t.charAt(c)==="\\"&&c+1<r){const m=t.charAt(c+1);m==="z"?(l.push(t.substring(i,c)),l.push("$(?!\\n)(?<!\\n)"),i=c+2):(m==="A"||m==="G")&&(o=!0),c++}this.hasAnchor=o,i===0?this.source=t:(l.push(t.substring(i,r)),this.source=l.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=X4.test(this.source):this.hasBackReferences=!1}clone(){return new tk(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return _2.lastIndex=0,this.source.replace(_2,(i,l)=>Yv(r[parseInt(l,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],l,o,c,d;for(l=0,o=this.source.length;l<o;l++)c=this.source.charAt(l),t[l]=c,n[l]=c,r[l]=c,i[l]=c,c==="\\"&&l+1<o&&(d=this.source.charAt(l+1),d==="A"?(t[l+1]="￿",n[l+1]="￿",r[l+1]="A",i[l+1]="A"):d==="G"?(t[l+1]="￿",n[l+1]="G",r[l+1]="￿",i[l+1]="G"):(t[l+1]=d,n[l+1]=d,r[l+1]=d,i[l+1]=d),l++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Sc=class{constructor(){oe(this,"_items");oe(this,"_hasAnchors");oe(this,"_cached");oe(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new v2(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new v2(e,r,this._items.map(i=>i.ruleId))}},v2=class{constructor(e,t,n){oe(this,"scanner");this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
93
+ `)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},u0=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Xs,eR=(Xs=class{constructor(t,n){oe(this,"_defaultAttributes");oe(this,"_embeddedLanguagesMatcher");oe(this,"_getBasicScopeAttributes",new Wv(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new u0(n,r)}));this._defaultAttributes=new u0(t,8),this._embeddedLanguagesMatcher=new tR(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Xs._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Xs.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},oe(Xs,"_NULL_SCOPE_METADATA",new u0(0,0)),oe(Xs,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),Xs),tR=class{constructor(e){oe(this,"values");oe(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Yv(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},k2=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function nk(e,t,n,r,i,l,o,c){const d=t.content.length;let m=!1,p=-1;if(o){const E=nR(e,t,n,r,i,l);i=E.stack,r=E.linePos,n=E.isFirstLine,p=E.anchorPosition}const g=Date.now();for(;!m;){if(c!==0&&Date.now()-g>c)return new k2(i,!0);y()}return new k2(i,!1);function y(){const E=rR(e,t,n,r,i,p);if(!E){l.produce(i,d),m=!0;return}const v=E.captureIndices,w=E.matchedRuleId,C=v&&v.length>0?v[0].end>r:!1;if(w===K4){const S=i.getRule(e);l.produce(i,v[0].start),i=i.withContentNameScopesList(i.nameScopesList),ic(e,t,n,i,l,S.endCaptures,v),l.produce(i,v[0].end);const N=i;if(i=i.parent,p=N.getAnchorPos(),!C&&N.getEnterPos()===r){i=N,l.produce(i,d),m=!0;return}}else{const S=e.getRule(w);l.produce(i,v[0].start);const N=i,A=S.getName(t.content,v),H=i.contentNameScopesList.pushAttributed(A,e);if(i=i.push(w,r,p,v[0].end===d,null,H,H),S instanceof og){const $=S;ic(e,t,n,i,l,$.beginCaptures,v),l.produce(i,v[0].end),p=v[0].end;const U=$.getContentName(t.content,v),P=H.pushAttributed(U,e);if(i=i.withContentNameScopesList(P),$.endHasBackReferences&&(i=i.withEndRule($.getEndWithResolvedBackReferences(t.content,v))),!C&&N.hasSameRuleAs(i)){i=i.pop(),l.produce(i,d),m=!0;return}}else if(S instanceof Kf){const $=S;ic(e,t,n,i,l,$.beginCaptures,v),l.produce(i,v[0].end),p=v[0].end;const U=$.getContentName(t.content,v),P=H.pushAttributed(U,e);if(i=i.withContentNameScopesList(P),$.whileHasBackReferences&&(i=i.withEndRule($.getWhileWithResolvedBackReferences(t.content,v))),!C&&N.hasSameRuleAs(i)){i=i.pop(),l.produce(i,d),m=!0;return}}else if(ic(e,t,n,i,l,S.captures,v),l.produce(i,v[0].end),i=i.pop(),!C){i=i.safePop(),l.produce(i,d),m=!0;return}}v[0].end>r&&(r=v[0].end,n=!1)}}function nR(e,t,n,r,i,l){let o=i.beginRuleCapturedEOL?0:-1;const c=[];for(let d=i;d;d=d.pop()){const m=d.getRule(e);m instanceof Kf&&c.push({rule:m,stack:d})}for(let d=c.pop();d;d=c.pop()){const{ruleScanner:m,findOptions:p}=iR(d.rule,e,d.stack.endRule,n,r===o),g=m.findNextMatchSync(t,r,p);if(g){if(g.ruleId!==Jv){i=d.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(l.produce(d.stack,g.captureIndices[0].start),ic(e,t,n,d.stack,l,d.rule.whileCaptures,g.captureIndices),l.produce(d.stack,g.captureIndices[0].end),o=g.captureIndices[0].end,g.captureIndices[0].end>r&&(r=g.captureIndices[0].end,n=!1))}else{i=d.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function rR(e,t,n,r,i,l){const o=aR(e,t,n,r,i,l),c=e.getInjections();if(c.length===0)return o;const d=sR(c,e,t,n,r,i,l);if(!d)return o;if(!o)return d;const m=o.captureIndices[0].start,p=d.captureIndices[0].start;return p<m||d.priorityMatch&&p===m?d:o}function aR(e,t,n,r,i,l){const o=i.getRule(e),{ruleScanner:c,findOptions:d}=rk(o,e,i.endRule,n,r===l),m=c.findNextMatchSync(t,r,d);return m?{captureIndices:m.captureIndices,matchedRuleId:m.ruleId}:null}function sR(e,t,n,r,i,l,o){let c=Number.MAX_VALUE,d=null,m,p=0;const g=l.contentNameScopesList.getScopeNames();for(let y=0,E=e.length;y<E;y++){const v=e[y];if(!v.matcher(g))continue;const w=t.getRule(v.ruleId),{ruleScanner:C,findOptions:S}=rk(w,t,null,r,i===o),N=C.findNextMatchSync(n,i,S);if(!N)continue;const A=N.captureIndices[0].start;if(!(A>=c)&&(c=A,d=N.captureIndices,m=N.ruleId,p=v.priority,c===i))break}return d?{priorityMatch:p===-1,captureIndices:d,matchedRuleId:m}:null}function rk(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function iR(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function ic(e,t,n,r,i,l,o){if(l.length===0)return;const c=t.content,d=Math.min(l.length,o.length),m=[],p=o[0].end;for(let g=0;g<d;g++){const y=l[g];if(y===null)continue;const E=o[g];if(E.length===0)continue;if(E.start>p)break;for(;m.length>0&&m[m.length-1].endPos<=E.start;)i.produceFromScopes(m[m.length-1].scopes,m[m.length-1].endPos),m.pop();if(m.length>0?i.produceFromScopes(m[m.length-1].scopes,E.start):i.produce(r,E.start),y.retokenizeCapturedWithRuleId){const w=y.getName(c,o),C=r.contentNameScopesList.pushAttributed(w,e),S=y.getContentName(c,o),N=C.pushAttributed(S,e),A=r.push(y.retokenizeCapturedWithRuleId,E.start,-1,!1,null,C,N),H=e.createOnigString(c.substring(0,E.end));nk(e,H,n&&E.start===0,E.start,A,i,!1,0),Kv(H);continue}const v=y.getName(c,o);if(v!==null){const C=(m.length>0?m[m.length-1].scopes:r.contentNameScopesList).pushAttributed(v,e);m.push(new lR(C,E.end))}}for(;m.length>0;)i.produceFromScopes(m[m.length-1].scopes,m[m.length-1].endPos),m.pop()}var lR=class{constructor(e,t){oe(this,"scopes");oe(this,"endPos");this.scopes=e,this.endPos=t}};function oR(e,t,n,r,i,l,o,c){return new cR(e,t,n,r,i,l,o,c)}function w2(e,t,n,r,i){const l=Qf(t,Zf),o=ek.getCompiledRuleId(n,r,i.repository);for(const c of l)e.push({debugSelector:t,matcher:c.matcher,ruleId:o,grammar:i,priority:c.priority})}function Zf(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(uR(t[i],r))return n=i+1,!0;return!1})}function uR(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var cR=class{constructor(e,t,n,r,i,l,o,c){oe(this,"_rootId");oe(this,"_lastRuleId");oe(this,"_ruleId2desc");oe(this,"_includedGrammars");oe(this,"_grammarRepository");oe(this,"_grammar");oe(this,"_injections");oe(this,"_basicScopeAttributesProvider");oe(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=l,this._onigLib=c,this._basicScopeAttributesProvider=new eR(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=C2(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const d of Object.keys(i)){const m=Qf(d,Zf);for(const p of m)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[d]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)w2(t,o,i[o],this,r);const l=this._grammarRepository.injections(n);l&&l.forEach(o=>{const c=this.getExternalGrammar(o);if(c){const d=c.injectionSelector;d&&w2(t,d,c,this,c)}})}return t.sort((i,l)=>i.priority-l.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=C2(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=ek.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===ug.NULL){i=!0;const m=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),g=Fo.set(0,m.languageId,m.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),y=this.getRule(this._rootId).getName(null,null);let E;y?E=fc.createRootAndLookUpScopeName(y,g,this):E=fc.createRoot("unknown",g),t=new ug(null,this._rootId,-1,-1,!1,null,E,E)}else i=!1,t.reset();e=e+`
94
+ `;const l=this.createOnigString(e),o=l.content.length,c=new fR(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),d=nk(this,l,i,0,t,c,!0,r);return Kv(l),{lineLength:o,lineTokens:c,ruleStack:d.stack,stoppedEarly:d.stoppedEarly}}};function C2(e,t){return e=A4(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var fc=class cs{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=(t==null?void 0:t.scopePath)??null;for(const l of n)i=o0.push(i,l.scopeNames),r=new cs(r,i,l.encodedTokenAttributes);return r}static createRoot(t,n){return new cs(null,new o0(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),l=new o0(null,t),o=r.themeProvider.themeMatch(l),c=cs.mergeAttributes(n,i,o);return new cs(null,l,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return cs.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,l=0,o=0;return r!==null&&(i=r.fontStyle,l=r.foregroundId,o=r.backgroundId),Fo.set(t,n.languageId,n.tokenType,null,i,l,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return cs._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const l of r)i=cs._pushAttributed(i,l,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),l=t.scopePath.push(n),o=r.themeProvider.themeMatch(l),c=cs.mergeAttributes(t.tokenAttributes,i,o);return new cs(t,l,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var i;const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((i=r.parent)==null?void 0:i.scopePath)??null)}),r=r.parent;return r===t?n.reverse():void 0}},Na,ug=(Na=class{constructor(t,n,r,i,l,o,c,d){oe(this,"_stackElementBrand");oe(this,"_enterPos");oe(this,"_anchorPos");oe(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=l,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=d,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(t){return t===null?!1:Na._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?fc.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Na._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,l,o,c){return new Na(this,t,n,r,i,l,o,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){var r,i;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(i=this.contentNameScopesList)==null?void 0:i.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Na(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var t,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,n){const r=fc.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new Na(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,fc.fromExtension(r,n.contentNameScopesList))}},oe(Na,"NULL",new Na(null,0,0,0,!1,null,null,null)),Na),dR=class{constructor(e,t){oe(this,"balancedBracketScopes");oe(this,"unbalancedBracketScopes");oe(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Qf(n,Zf).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Qf(n,Zf).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},fR=class{constructor(e,t,n,r){oe(this,"_emitBinaryTokens");oe(this,"_lineText");oe(this,"_tokens");oe(this,"_binaryTokens");oe(this,"_lastTokenEndIndex");oe(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var r;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=(e==null?void 0:e.tokenAttributes)??0,l=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(l=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=(e==null?void 0:e.getScopeNames())??[];for(const c of this._tokenTypeOverrides)c.matcher(o)&&(i=Fo.set(i,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(l=this.balancedBracketSelectors.match(o))}if(l&&(i=Fo.set(i,0,8,l,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},hR=class{constructor(e,t){oe(this,"_grammars",new Map);oe(this,"_rawGrammars",new Map);oe(this,"_injectionGrammars",new Map);oe(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let l=this._rawGrammars.get(e);if(!l)return null;this._grammars.set(e,oR(e,l,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},mR=class{constructor(t){oe(this,"_options");oe(this,"_syncRegistry");oe(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new hR(Wf.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Wf.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new dR(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,l){const o=new $4(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(c=>this._loadSingleGrammar(c.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,i,l)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,l=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,l)}},cg=ug.NULL;const ak=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Uc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Uc.prototype.normal={};Uc.prototype.property={};Uc.prototype.space=void 0;function sk(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Uc(n,r,t)}function Nc(e){return e.toLowerCase()}class Gr{constructor(t,n){this.attribute=n,this.property=t}}Gr.prototype.attribute="";Gr.prototype.booleanish=!1;Gr.prototype.boolean=!1;Gr.prototype.commaOrSpaceSeparated=!1;Gr.prototype.commaSeparated=!1;Gr.prototype.defined=!1;Gr.prototype.mustUseProperty=!1;Gr.prototype.number=!1;Gr.prototype.overloadedBoolean=!1;Gr.prototype.property="";Gr.prototype.spaceSeparated=!1;Gr.prototype.space=void 0;let pR=0;const vt=zl(),Gn=zl(),dg=zl(),Ie=zl(),yn=zl(),Bo=zl(),aa=zl();function zl(){return 2**++pR}const fg=Object.freeze(Object.defineProperty({__proto__:null,boolean:vt,booleanish:Gn,commaOrSpaceSeparated:aa,commaSeparated:Bo,number:Ie,overloadedBoolean:dg,spaceSeparated:yn},Symbol.toStringTag,{value:"Module"})),c0=Object.keys(fg);class c1 extends Gr{constructor(t,n,r,i){let l=-1;if(super(t,n),S2(this,"space",i),typeof r=="number")for(;++l<c0.length;){const o=c0[l];S2(this,c0[l],(r&fg[o])===fg[o])}}}c1.prototype.defined=!0;function S2(e,t,n){n&&(e[t]=n)}function Xo(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new c1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Nc(r)]=r,n[Nc(l.attribute)]=r}return new Uc(t,n,e.space)}const ik=Xo({properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Ie,ariaColIndex:Ie,ariaColSpan:Ie,ariaControls:yn,ariaCurrent:null,ariaDescribedBy:yn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:yn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:yn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yn,ariaLevel:Ie,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:yn,ariaPlaceholder:null,ariaPosInSet:Ie,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:yn,ariaRowCount:Ie,ariaRowIndex:Ie,ariaRowSpan:Ie,ariaSelected:Gn,ariaSetSize:Ie,ariaSort:null,ariaValueMax:Ie,ariaValueMin:Ie,ariaValueNow:Ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function lk(e,t){return t in e?e[t]:t}function ok(e,t){return lk(e,t.toLowerCase())}const gR=Xo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bo,acceptCharset:yn,accessKey:yn,action:null,allow:null,allowFullScreen:vt,allowPaymentRequest:vt,allowUserMedia:vt,alt:null,as:null,async:vt,autoCapitalize:null,autoComplete:yn,autoFocus:vt,autoPlay:vt,blocking:yn,capture:null,charSet:null,checked:vt,cite:null,className:yn,cols:Ie,colSpan:null,content:null,contentEditable:Gn,controls:vt,controlsList:yn,coords:Ie|Bo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:vt,defer:vt,dir:null,dirName:null,disabled:vt,download:dg,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:vt,formTarget:null,headers:yn,height:Ie,hidden:dg,high:Ie,href:null,hrefLang:null,htmlFor:yn,httpEquiv:yn,id:null,imageSizes:null,imageSrcSet:null,inert:vt,inputMode:null,integrity:null,is:null,isMap:vt,itemId:null,itemProp:yn,itemRef:yn,itemScope:vt,itemType:yn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:vt,low:Ie,manifest:null,max:null,maxLength:Ie,media:null,method:null,min:null,minLength:Ie,multiple:vt,muted:vt,name:null,nonce:null,noModule:vt,noValidate:vt,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:vt,optimum:Ie,pattern:null,ping:yn,placeholder:null,playsInline:vt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:vt,referrerPolicy:null,rel:yn,required:vt,reversed:vt,rows:Ie,rowSpan:Ie,sandbox:yn,scope:null,scoped:vt,seamless:vt,selected:vt,shadowRootClonable:vt,shadowRootDelegatesFocus:vt,shadowRootMode:null,shape:null,size:Ie,sizes:null,slot:null,span:Ie,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ie,step:null,style:null,tabIndex:Ie,target:null,title:null,translate:null,type:null,typeMustMatch:vt,useMap:null,value:Gn,width:Ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yn,axis:null,background:null,bgColor:null,border:Ie,borderColor:null,bottomMargin:Ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:vt,declare:vt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ie,leftMargin:Ie,link:null,longDesc:null,lowSrc:null,marginHeight:Ie,marginWidth:Ie,noResize:vt,noHref:vt,noShade:vt,noWrap:vt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ie,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:Ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:vt,disableRemotePlayback:vt,prefix:null,property:null,results:Ie,security:null,unselectable:null},space:"html",transform:ok}),bR=Xo({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",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:aa,accentHeight:Ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ie,amplitude:Ie,arabicForm:null,ascent:Ie,attributeName:null,attributeType:null,azimuth:Ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ie,by:null,calcMode:null,capHeight:Ie,className:yn,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:Ie,diffuseConstant:Ie,direction:null,display:null,dur:null,divisor:Ie,dominantBaseline:null,download:vt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ie,enableBackground:null,end:null,event:null,exponent:Ie,externalResourcesRequired:null,fill:null,fillOpacity:Ie,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:Bo,g2:Bo,glyphName:Bo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ie,horizOriginX:Ie,horizOriginY:Ie,id:null,ideographic:Ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ie,k:Ie,k1:Ie,k2:Ie,k3:Ie,k4:Ie,kernelMatrix:aa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ie,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ie,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:Ie,overlineThickness:Ie,paintOrder:null,panose1:null,path:null,pathLength:Ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ie,pointsAtY:Ie,pointsAtZ:Ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:aa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:aa,rev:aa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:aa,requiredFeatures:aa,requiredFonts:aa,requiredFormats:aa,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:Ie,specularExponent:Ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ie,strikethroughThickness:Ie,string:null,stroke:null,strokeDashArray:aa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ie,strokeOpacity:Ie,strokeWidth:null,style:null,surfaceScale:Ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:aa,tabIndex:Ie,tableValues:null,target:null,targetX:Ie,targetY:Ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:aa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ie,underlineThickness:Ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ie,values:null,vAlphabetic:Ie,vMathematical:Ie,vectorEffect:null,vHanging:Ie,vIdeographic:Ie,version:null,vertAdvY:Ie,vertOriginX:Ie,vertOriginY:Ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lk}),uk=Xo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ck=Xo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ok}),dk=Xo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),xR={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"},yR=/[A-Z]/g,N2=/-[a-z]/g,ER=/^data[-\w.:]+$/i;function Hc(e,t){const n=Nc(t);let r=t,i=Gr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ER.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(N2,TR);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!N2.test(l)){let o=l.replace(yR,_R);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=c1}return new i(r,t)}function _R(e){return"-"+e.toLowerCase()}function TR(e){return e.charAt(1).toUpperCase()}const Ko=sk([ik,gR,uk,ck,dk],"html"),xs=sk([ik,bR,uk,ck,dk],"svg"),A2={}.hasOwnProperty;function d1(e,t){const n=t||{};function r(i,...l){let o=r.invalid;const c=r.handlers;if(i&&A2.call(i,e)){const d=String(i[e]);o=A2.call(c,d)?c[d]:r.unknown}if(o)return o.call(this,i,...l)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const vR=/["&'<>`]/g,kR=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wR=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,CR=/[|\\{}()[\]^$+*?.]/g,R2=new WeakMap;function SR(e,t){if(e=e.replace(t.subset?NR(t.subset):vR,r),t.subset||t.escapeOnly)return e;return e.replace(kR,n).replace(wR,r);function n(i,l,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(l+2),t)}function r(i,l,o){return t.format(i.charCodeAt(0),o.charCodeAt(l+1),t)}}function NR(e){let t=R2.get(e);return t||(t=AR(e),R2.set(e,t)),t}function AR(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(CR,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const RR=/[\dA-Fa-f]/;function LR(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!RR.test(String.fromCharCode(t))?r:r+";"}const IR=/\d/;function OR(e,t,n){const r="&#"+String(e);return n&&t&&!IR.test(String.fromCharCode(t))?r:r+";"}const DR=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],d0={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},jR=["cent","copy","divide","gt","lt","not","para","times"],fk={}.hasOwnProperty,hg={};let ff;for(ff in d0)fk.call(d0,ff)&&(hg[d0[ff]]=ff);const MR=/[^\dA-Za-z]/;function PR(e,t,n,r){const i=String.fromCharCode(e);if(fk.call(hg,i)){const l=hg[i],o="&"+l;return n&&DR.includes(l)&&!jR.includes(l)&&(!r||t&&t!==61&&MR.test(String.fromCharCode(t)))?o:o+";"}return""}function BR(e,t,n){let r=LR(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=PR(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const l=OR(e,t,n.omitOptionalSemicolons);l.length<r.length&&(r=l)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Uo(e,t){return SR(e,Object.assign({format:BR},t))}const UR=/^>|^->|<!--|-->|--!>|<!-$/g,HR=[">"],zR=["<",">"];function FR(e,t,n,r){return r.settings.bogusComments?"<?"+Uo(e.value,Object.assign({},r.settings.characterReferences,{subset:HR}))+">":"<!--"+e.value.replace(UR,i)+"-->";function i(l){return Uo(l,Object.assign({},r.settings.characterReferences,{subset:zR}))}}function $R(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Jf(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function L2(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const o=n.slice(i,r).trim();(o||!l)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function f1(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function I2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function h1(e){return e.join(" ").trim()}const VR=/[ \t\n\f\r]/g;function kh(e){return typeof e=="object"?e.type==="text"?O2(e.value):!1:O2(e)}function O2(e){return e.replace(VR,"")===""}const Kn=mk(1),hk=mk(-1),GR=[];function mk(e){return t;function t(n,r,i){const l=n?n.children:GR;let o=(r||0)+e,c=l[o];if(!i)for(;c&&kh(c);)o+=e,c=l[o];return c}}const qR={}.hasOwnProperty;function pk(e){return t;function t(n,r,i){return qR.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const m1=pk({body:WR,caption:f0,colgroup:f0,dd:ZR,dt:KR,head:f0,html:YR,li:XR,optgroup:JR,option:eL,p:QR,rp:D2,rt:D2,tbody:nL,td:j2,tfoot:rL,th:j2,thead:tL,tr:aL});function f0(e,t,n){const r=Kn(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&kh(r.value.charAt(0)))}function YR(e,t,n){const r=Kn(n,t);return!r||r.type!=="comment"}function WR(e,t,n){const r=Kn(n,t);return!r||r.type!=="comment"}function QR(e,t,n){const r=Kn(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function XR(e,t,n){const r=Kn(n,t);return!r||r.type==="element"&&r.tagName==="li"}function KR(e,t,n){const r=Kn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function ZR(e,t,n){const r=Kn(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function D2(e,t,n){const r=Kn(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function JR(e,t,n){const r=Kn(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function eL(e,t,n){const r=Kn(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function tL(e,t,n){const r=Kn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function nL(e,t,n){const r=Kn(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function rL(e,t,n){return!Kn(n,t)}function aL(e,t,n){const r=Kn(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function j2(e,t,n){const r=Kn(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const sL=pk({body:oL,colgroup:uL,head:lL,html:iL,tbody:cL});function iL(e){const t=Kn(e,-1);return!t||t.type!=="comment"}function lL(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function oL(e){const t=Kn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&kh(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function uL(e,t,n){const r=hk(n,t),i=Kn(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&m1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function cL(e,t,n){const r=hk(n,t),i=Kn(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&m1(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const hf={name:[[`
95
+ \f\r &/=>`.split(""),`
96
+ \f\r "&'/=>\``.split("")],[`\0
97
+ \f\r "&'/<=>`.split(""),`\0
98
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
99
+ \f\r &>`.split(""),`\0
100
+ \f\r "&'<=>\``.split("")],[`\0
101
+ \f\r "&'<=>\``.split(""),`\0
102
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function dL(e,t,n,r){const i=r.schema,l=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const c=[];let d;i.space==="html"&&e.tagName==="svg"&&(r.schema=xs);const m=fL(r,e.properties),p=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,p&&(o=!1),(m||!l||!sL(e,t,n))&&(c.push("<",e.tagName,m?" "+m:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(d=m.charAt(m.length-1),(!r.settings.tightSelfClosing||d==="/"||d&&d!=='"'&&d!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(p),!o&&(!l||!m1(e,t,n))&&c.push("</"+e.tagName+">"),c.join("")}function fL(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const l=hL(e,i,t[i]);l&&n.push(l)}}for(;++r<n.length;){const l=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&l!=='"'&&l!=="'"&&(n[r]+=" ")}return n.join("")}function hL(e,t,n){const r=Hc(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,l=e.settings.allowDangerousCharacters?0:1;let o=e.quote,c;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const d=Uo(r.attribute,Object.assign({},e.settings.characterReferences,{subset:hf.name[i][l]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?f1:h1)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?d:(e.settings.preferUnquoted&&(c=Uo(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:hf.unquoted[i][l]}))),c!==n&&(e.settings.quoteSmart&&Jf(n,o)>Jf(n,e.alternative)&&(o=e.alternative),c=o+Uo(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?hf.single:hf.double)[i][l],attribute:!0}))+o),d+(c&&"="+c))}const mL=["<","&"];function gk(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Uo(e.value,Object.assign({},r.settings.characterReferences,{subset:mL}))}function pL(e,t,n,r){return r.settings.allowDangerousHtml?e.value:gk(e,t,n,r)}function gL(e,t,n,r){return r.all(e)}const bL=d1("type",{invalid:xL,unknown:yL,handlers:{comment:FR,doctype:$R,element:dL,raw:pL,root:gL,text:gk}});function xL(e){throw new Error("Expected node, not `"+e+"`")}function yL(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const EL={},_L={},TL=[];function vL(e,t){const n=t||EL,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:kL,all:wL,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ak,characterReferences:n.characterReferences||_L,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?xs:Ko,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function kL(e,t,n){return bL(e,t,n,this)}function wL(e){const t=[],n=e&&e.children||TL;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function eh(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,l]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof l=="string"?n[i]=l:i===r&&Object.assign(n,l);return n}function Vi(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function CL(e){return Array.isArray(e)?e:[e]}async function bk(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function p1(e){return!e||["plaintext","txt","text","plain"].includes(e)}function xk(e){return e==="ansi"||p1(e)}function g1(e){return e==="none"}function yk(e){return g1(e)}function Ek(e,t){var r;if(!t)return e;e.properties||(e.properties={}),(r=e.properties).class||(r.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function wh(e,t=!1){var l;if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let o=0;o<n.length;o+=2){const c=t?n[o]+(n[o+1]||""):n[o];i.push([c,r]),r+=n[o].length,r+=((l=n[o+1])==null?void 0:l.length)||0}return i}function SL(e){const t=wh(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t[t.length-1].length};let l=i,o=0;for(const c of t){if(l<c.length)break;l-=c.length,o++}return{line:o,character:l}}function r(i,l){let o=0;for(let c=0;c<i;c++)o+=t[c].length;return o+=l,o}return{lines:t,indexToPos:n,posToIndex:r}}const b1="light-dark()",NL=["color","background-color"];function AL(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function RL(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const l=n.filter(o=>i.offset<o&&o<i.offset+i.content.length).map(o=>o-i.offset).sort((o,c)=>o-c);return l.length?AL(i,l):i})):e}function LL(e,t,n,r,i="css-vars"){const l={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(p=>th(e.variants[p])),c=new Set(o.flatMap(p=>Object.keys(p))),d={},m=(p,g)=>{const y=g==="color"?"":g==="background-color"?"-bg":`-${g}`;return n+t[p]+(g==="color"?"":y)};return o.forEach((p,g)=>{for(const y of c){const E=p[y]||"inherit";if(g===0&&r&&NL.includes(y))if(r===b1&&o.length>1){const v=t.findIndex(N=>N==="light"),w=t.findIndex(N=>N==="dark");if(v===-1||w===-1)throw new qn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const C=o[v][y]||"inherit",S=o[w][y]||"inherit";d[y]=`light-dark(${C}, ${S})`,i==="css-vars"&&(d[m(g,y)]=E)}else d[y]=E;else i==="css-vars"&&(d[m(g,y)]=E)}}),l.htmlStyle=d,l}function th(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&yr.Italic&&(t["font-style"]="italic"),e.fontStyle&yr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&yr.Underline&&n.push("underline"),e.fontStyle&yr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function mg(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const _k=new WeakMap;function Ch(e,t){_k.set(e,t)}function Ac(e){return _k.get(e)}class Zo{constructor(...t){oe(this,"_stacks",{});oe(this,"lang");if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Zo(Object.fromEntries(CL(n).map(r=>[r,cg])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return IL(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function IL(e){const t=[],n=new Set;function r(i){var o;if(n.has(i))return;n.add(i);const l=(o=i==null?void 0:i.nameScopesList)==null?void 0:o.scopeName;l&&t.push(l),i.parent&&r(i.parent)}return r(e),t}function OL(e,t){if(!(e instanceof Zo))throw new qn("Invalid grammar state");return e.getInternalStack(t)}function DL(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new qn(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const c=i.lines[o.line];if(c===void 0)throw new qn(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let d=o.character;if(d<0&&(d=c.length+d),d<0||d>c.length)throw new qn(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${c.length}`);return{...o,character:d,offset:i.posToIndex(o.line,d)}}};const i=SL(n.source),l=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));jL(l),e.set(n.meta,{decorations:l,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var o;if(!((o=this.options.decorations)!=null&&o.length))return;const i=t(this).decorations.flatMap(c=>[c.start.offset,c.end.offset]);return RL(n,i)},code(n){var p;if(!((p=this.options.decorations)!=null&&p.length))return;const r=t(this),i=Array.from(n.children).filter(g=>g.type==="element"&&g.tagName==="span");if(i.length!==r.converter.lines.length)throw new qn(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function l(g,y,E,v){const w=i[g];let C="",S=-1,N=-1;if(y===0&&(S=0),E===0&&(N=0),E===Number.POSITIVE_INFINITY&&(N=w.children.length),S===-1||N===-1)for(let H=0;H<w.children.length;H++)C+=Tk(w.children[H]),S===-1&&C.length===y&&(S=H+1),N===-1&&C.length===E&&(N=H+1);if(S===-1)throw new qn(`Failed to find start index for decoration ${JSON.stringify(v.start)}`);if(N===-1)throw new qn(`Failed to find end index for decoration ${JSON.stringify(v.end)}`);const A=w.children.slice(S,N);if(!v.alwaysWrap&&A.length===w.children.length)c(w,v,"line");else if(!v.alwaysWrap&&A.length===1&&A[0].type==="element")c(A[0],v,"token");else{const H={type:"element",tagName:"span",properties:{},children:A};c(H,v,"wrapper"),w.children.splice(S,A.length,H)}}function o(g,y){i[g]=c(i[g],y,"line")}function c(g,y,E){var C;const v=y.properties||{},w=y.transform||(S=>S);return g.tagName=y.tagName||"span",g.properties={...g.properties,...v,class:g.properties.class},(C=y.properties)!=null&&C.class&&Ek(g,y.properties.class),g=w(g,E)||g,g}const d=[],m=r.decorations.sort((g,y)=>y.start.offset-g.start.offset||g.end.offset-y.end.offset);for(const g of m){const{start:y,end:E}=g;if(y.line===E.line)l(y.line,y.character,E.character,g);else if(y.line<E.line){l(y.line,y.character,Number.POSITIVE_INFINITY,g);for(let v=y.line+1;v<E.line;v++)d.unshift(()=>o(v,g));l(E.line,0,E.character,g)}}d.forEach(g=>g())}}}function jL(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new qn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],l=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,o=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,c=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,d=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(l||o||c||d){if(l&&o||c&&d||c&&n.start.offset===n.end.offset||o&&i.start.offset===i.end.offset)continue;throw new qn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function Tk(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Tk).join(""):""}const ML=[DL()];function nh(e){const t=PL(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ML]}function PL(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Ll=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],h0={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function BL(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function M2(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function UL(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)h0[r]&&t.push({type:"setDecoration",value:h0[r]});else if(r<=29){const i=h0[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Ll[r-30]}});else if(r===38){const i=M2(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Ll[r-40]}});else if(r===48){const i=M2(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Ll[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Ll[r-100+8]}})}return t}function HL(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let l=0;do{const o=BL(r,l),c=o.sequence?r.substring(l,o.startPosition):r.substring(l);if(c.length>0&&i.push({value:c,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const d=UL(o.sequence);for(const m of d)m.type==="resetAll"?(e=null,t=null,n.clear()):m.type==="resetForegroundColor"?e=null:m.type==="resetBackgroundColor"?t=null:m.type==="resetDecoration"&&n.delete(m.value);for(const m of d)m.type==="setForegroundColor"?e=m.value:m.type==="setBackgroundColor"?t=m.value:m.type==="setDecoration"&&n.add(m.value)}l=o.position}while(l<r.length);return i}}}var zL={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function FL(e=zL){function t(c){return e[c]}function n(c){return`#${c.map(d=>Math.max(0,Math.min(d,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let m=0;m<Ll.length;m++)r.push(t(Ll[m]));let c=[0,95,135,175,215,255];for(let m=0;m<6;m++)for(let p=0;p<6;p++)for(let g=0;g<6;g++)r.push(n([c[m],c[p],c[g]]));let d=8;for(let m=0;m<24;m++,d+=10)r.push(n([d,d,d]));return r}function l(c){return i()[c]}function o(c){switch(c.type){case"named":return t(c.name);case"rgb":return n(c.rgb);case"table":return l(c.index)}}return{value:o}}const $L={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function VL(e,t,n){const r=eh(e,n),i=wh(t),l=Object.fromEntries(Ll.map(d=>{var g;const m=`terminal.ansi${d[0].toUpperCase()}${d.substring(1)}`,p=(g=e.colors)==null?void 0:g[m];return[d,p||$L[d]]})),o=FL(l),c=HL();return i.map(d=>c.parse(d[0]).map(m=>{let p,g;m.decorations.has("reverse")?(p=m.background?o.value(m.background):e.bg,g=m.foreground?o.value(m.foreground):e.fg):(p=m.foreground?o.value(m.foreground):e.fg,g=m.background?o.value(m.background):void 0),p=Vi(p,r),g=Vi(g,r),m.decorations.has("dim")&&(p=GL(p));let y=yr.None;return m.decorations.has("bold")&&(y|=yr.Bold),m.decorations.has("italic")&&(y|=yr.Italic),m.decorations.has("underline")&&(y|=yr.Underline),m.decorations.has("strikethrough")&&(y|=yr.Strikethrough),{content:m.value,offset:d[1],color:p,bgColor:g,fontStyle:y}}))}function GL(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],l=r[1],o=r[2],c=r[3],d=Math.round(Number.parseInt(`${c}${c}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${l}${l}${o}${o}${d}`}else if(r.length===3){const i=r[0],l=r[1],o=r[2];return`#${i}${i}${l}${l}${o}${o}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function x1(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||"text");if(p1(i)||g1(r))return wh(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:l,colorMap:o}=e.setTheme(r);if(i==="ansi")return VL(l,t,n);const c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new qn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(l.name))throw new qn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${l.name}"`)}return YL(t,c,l,o,n)}function qL(...e){if(e.length===2)return Ac(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:l=t.getLoadedThemes()[0]}=r;if(p1(i)||g1(l))throw new qn("Plain language does not have grammar state");if(i==="ansi")throw new qn("ANSI language does not have grammar state");const{theme:o,colorMap:c}=t.setTheme(l),d=t.getLanguage(i);return new Zo(y1(n,d,o,c,r).stateStack,d.name,o.name)}function YL(e,t,n,r,i){const l=y1(e,t,n,r,i),o=new Zo(l.stateStack,t.name,n.name);return Ch(l.tokens,o),l.tokens}function y1(e,t,n,r,i){const l=eh(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:c=500}=i,d=wh(e);let m=i.grammarState?OL(i.grammarState,n.name)??cg:i.grammarContextCode!=null?y1(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:cg,p=[];const g=[];for(let y=0,E=d.length;y<E;y++){const[v,w]=d[y];if(v===""){p=[],g.push([]);continue}if(o>0&&v.length>=o){p=[],g.push([{content:v,offset:w,color:"",fontStyle:0}]);continue}let C,S,N;i.includeExplanation&&(C=t.tokenizeLine(v,m,c),S=C.tokens,N=0);const A=t.tokenizeLine2(v,m,c),H=A.tokens.length/2;for(let $=0;$<H;$++){const U=A.tokens[2*$],P=$+1<H?A.tokens[2*$+2]:v.length;if(U===P)continue;const Y=A.tokens[2*$+1],fe=Vi(r[Fo.getForeground(Y)],l),M=Fo.getFontStyle(Y),K={content:v.substring(U,P),offset:w+U,color:fe,fontStyle:M};if(i.includeExplanation){const V=[];if(i.includeExplanation!=="scopeName")for(const de of n.settings){let ne;switch(typeof de.scope){case"string":ne=de.scope.split(/,/).map(z=>z.trim());break;case"object":ne=de.scope;break;default:continue}V.push({settings:de,selectors:ne.map(z=>z.split(/ /))})}K.explanation=[];let he=0;for(;U+he<P;){const de=S[N],ne=v.substring(de.startIndex,de.endIndex);he+=ne.length,K.explanation.push({content:ne,scopes:i.includeExplanation==="scopeName"?WL(de.scopes):QL(V,de.scopes)}),N+=1}}p.push(K)}g.push(p),p=[],m=A.ruleStack}return{tokens:g,stateStack:m}}function WL(e){return e.map(t=>({scopeName:t}))}function QL(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const l=t[r];n[r]={scopeName:l,themeMatches:KL(e,l,t.slice(0,r))}}return n}function P2(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function XL(e,t,n){if(!P2(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)P2(e[r],n[i])&&(r-=1),i-=1;return r===-1}function KL(e,t,n){const r=[];for(const{selectors:i,settings:l}of e)for(const o of i)if(XL(o,t,n)){r.push(l);break}return r}function vk(e,t,n){const r=Object.entries(n.themes).filter(d=>d[1]).map(d=>({color:d[0],theme:d[1]})),i=r.map(d=>{const m=x1(e,t,{...n,theme:d.theme}),p=Ac(m),g=typeof d.theme=="string"?d.theme:d.theme.name;return{tokens:m,state:p,theme:g}}),l=ZL(...i.map(d=>d.tokens)),o=l[0].map((d,m)=>d.map((p,g)=>{const y={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(y.explanation=p.explanation),l.forEach((E,v)=>{const{content:w,explanation:C,offset:S,...N}=E[m][g];y.variants[r[v].color]=N}),y})),c=i[0].state?new Zo(Object.fromEntries(i.map(d=>{var m;return[d.theme,(m=d.state)==null?void 0:m.getInternalStack(d.theme)]})),i[0].state.lang):void 0;return c&&Ch(o,c),o}function ZL(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(d=>d[r]),l=t.map(()=>[]);t.forEach((d,m)=>d.push(l[m]));const o=i.map(()=>0),c=i.map(d=>d[0]);for(;c.every(d=>d);){const d=Math.min(...c.map(m=>m.content.length));for(let m=0;m<n;m++){const p=c[m];p.content.length===d?(l[m].push(p),o[m]+=1,c[m]=i[m][o[m]]):(l[m].push({...p,content:p.content.slice(0,d)}),c[m]={...p,content:p.content.slice(d),offset:p.offset+d})}}}return t}function rh(e,t,n){let r,i,l,o,c,d;if("themes"in n){const{defaultColor:m="light",cssVariablePrefix:p="--shiki-",colorsRendering:g="css-vars"}=n,y=Object.entries(n.themes).filter(S=>S[1]).map(S=>({color:S[0],theme:S[1]})).sort((S,N)=>S.color===m?-1:N.color===m?1:0);if(y.length===0)throw new qn("`themes` option must not be empty");const E=vk(e,t,n);if(d=Ac(E),m&&b1!==m&&!y.find(S=>S.color===m))throw new qn(`\`themes\` option must contain the defaultColor key \`${m}\``);const v=y.map(S=>e.getTheme(S.theme)),w=y.map(S=>S.color);l=E.map(S=>S.map(N=>LL(N,w,p,m,g))),d&&Ch(l,d);const C=y.map(S=>eh(S.theme,n));i=B2(y,v,C,p,m,"fg",g),r=B2(y,v,C,p,m,"bg",g),o=`shiki-themes ${v.map(S=>S.name).join(" ")}`,c=m?void 0:[i,r].join(";")}else if("theme"in n){const m=eh(n.theme,n);l=x1(e,t,n);const p=e.getTheme(n.theme);r=Vi(p.bg,m),i=Vi(p.fg,m),o=p.name,d=Ac(l)}else throw new qn("Invalid options, either `theme` or `themes` must be provided");return{tokens:l,fg:i,bg:r,themeName:o,rootStyle:c,grammarState:d}}function B2(e,t,n,r,i,l,o){return e.map((c,d)=>{const m=Vi(t[d][l],n[d])||"inherit",p=`${r+c.color}${l==="bg"?"-bg":""}:${m}`;if(d===0&&i){if(i===b1&&e.length>1){const g=e.findIndex(w=>w.color==="light"),y=e.findIndex(w=>w.color==="dark");if(g===-1||y===-1)throw new qn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const E=Vi(t[g][l],n[g])||"inherit",v=Vi(t[y][l],n[y])||"inherit";return`light-dark(${E}, ${v});${p}`}return m}return o==="css-vars"?p:null}).filter(c=>!!c).join(";")}function ah(e,t,n,r={meta:{},options:n,codeToHast:(i,l)=>ah(e,i,l),codeToTokens:(i,l)=>rh(e,i,l)}){var v,w;let i=t;for(const C of nh(n))i=((v=C.preprocess)==null?void 0:v.call(r,i,n))||i;let{tokens:l,fg:o,bg:c,themeName:d,rootStyle:m,grammarState:p}=rh(e,i,n);const{mergeWhitespaces:g=!0,mergeSameStyleTokens:y=!1}=n;g===!0?l=eI(l):g==="never"&&(l=tI(l)),y&&(l=nI(l));const E={...r,get source(){return i}};for(const C of nh(n))l=((w=C.tokens)==null?void 0:w.call(E,l))||l;return JL(l,{...n,fg:o,bg:c,themeName:d,rootStyle:n.rootStyle===!1?!1:n.rootStyle??m},E,p)}function JL(e,t,n,r=Ac(e)){var w,C,S,N;const i=nh(t),l=[],o={type:"root",children:[]},{structure:c="classic",tabindex:d="0"}=t,m={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?m.style=t.rootStyle:m.style=`background-color:${t.bg};color:${t.fg}`),d!==!1&&d!=null&&(m.tabindex=d.toString());for(const[A,H]of Object.entries(t.meta||{}))A.startsWith("_")||(m[A]=H);let p={type:"element",tagName:"pre",properties:m,children:[],data:t.data},g={type:"element",tagName:"code",properties:{},children:l};const y=[],E={...n,structure:c,addClassToHast:Ek,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return p},get code(){return g},get lines(){return y}};if(e.forEach((A,H)=>{var P,Y;H&&(c==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):c==="classic"&&l.push({type:"text",value:`
103
+ `}));let $={type:"element",tagName:"span",properties:{class:"line"},children:[]},U=0;for(const fe of A){let M={type:"element",tagName:"span",properties:{...fe.htmlAttrs},children:[{type:"text",value:fe.content}]};const K=mg(fe.htmlStyle||th(fe));K&&(M.properties.style=K);for(const V of i)M=((P=V==null?void 0:V.span)==null?void 0:P.call(E,M,H+1,U,$,fe))||M;c==="inline"?o.children.push(M):c==="classic"&&$.children.push(M),U+=fe.content.length}if(c==="classic"){for(const fe of i)$=((Y=fe==null?void 0:fe.line)==null?void 0:Y.call(E,$,H+1))||$;y.push($),l.push($)}else c==="inline"&&y.push($)}),c==="classic"){for(const A of i)g=((w=A==null?void 0:A.code)==null?void 0:w.call(E,g))||g;p.children.push(g);for(const A of i)p=((C=A==null?void 0:A.pre)==null?void 0:C.call(E,p))||p;o.children.push(p)}else if(c==="inline"){const A=[];let H={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const P of o.children)P.type==="element"&&P.tagName==="br"?(A.push(H),H={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(P.type==="element"||P.type==="text")&&H.children.push(P);A.push(H);let U={type:"element",tagName:"code",properties:{},children:A};for(const P of i)U=((S=P==null?void 0:P.code)==null?void 0:S.call(E,U))||U;o.children=[];for(let P=0;P<U.children.length;P++){P>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const Y=U.children[P];Y.type==="element"&&o.children.push(...Y.children)}}let v=o;for(const A of i)v=((N=A==null?void 0:A.root)==null?void 0:N.call(E,v))||v;return r&&Ch(v,r),v}function eI(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((l,o)=>{const d=!(l.fontStyle&&(l.fontStyle&yr.Underline||l.fontStyle&yr.Strikethrough));d&&l.content.match(/^\s+$/)&&t[o+1]?(i===void 0&&(i=l.offset),r+=l.content):r?(d?n.push({...l,offset:i,content:r+l.content}):n.push({content:r,offset:i},l),i=void 0,r=""):n.push(l)}),n})}function tI(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,l,o]=r;if(!i&&!o)return n;const c=[{...n,offset:n.offset+i.length,content:l}];return i&&c.unshift({content:i,offset:n.offset}),o&&c.push({content:o,offset:n.offset+i.length+l.length}),c}))}function nI(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],l=mg(i.htmlStyle||th(i)),o=mg(r.htmlStyle||th(r)),c=i.fontStyle&&(i.fontStyle&yr.Underline||i.fontStyle&yr.Strikethrough),d=r.fontStyle&&(r.fontStyle&yr.Underline||r.fontStyle&yr.Strikethrough);!c&&!d&&l===o?i.content+=r.content:n.push({...r})}return n})}const rI=vL;function aI(e,t,n){var l;const r={meta:{},options:n,codeToHast:(o,c)=>ah(e,o,c),codeToTokens:(o,c)=>rh(e,o,c)};let i=rI(ah(e,t,n,r));for(const o of nh(n))i=((l=o.postprocess)==null?void 0:l.call(r,i,n))||i;return i}const U2={light:"#333333",dark:"#bbbbbb"},H2={light:"#fffffe",dark:"#1e1e1e"},z2="__shiki_resolved";function E1(e){var c,d,m,p,g;if(e!=null&&e[z2])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:n,fg:r}=t;if(!n||!r){const y=t.settings?t.settings.find(E=>!E.name&&!E.scope):void 0;(c=y==null?void 0:y.settings)!=null&&c.foreground&&(r=y.settings.foreground),(d=y==null?void 0:y.settings)!=null&&d.background&&(n=y.settings.background),!r&&((m=t==null?void 0:t.colors)!=null&&m["editor.foreground"])&&(r=t.colors["editor.foreground"]),!n&&((p=t==null?void 0:t.colors)!=null&&p["editor.background"])&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?U2.light:U2.dark),n||(n=t.type==="light"?H2.light:H2.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const l=new Map;function o(y){var v;if(l.has(y))return l.get(y);i+=1;const E=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(v=t.colorReplacements)!=null&&v[`#${E}`]?o(y):(l.set(y,E),E)}t.settings=t.settings.map(y=>{var C,S;const E=((C=y.settings)==null?void 0:C.foreground)&&!y.settings.foreground.startsWith("#"),v=((S=y.settings)==null?void 0:S.background)&&!y.settings.background.startsWith("#");if(!E&&!v)return y;const w={...y,settings:{...y.settings}};if(E){const N=o(y.settings.foreground);t.colorReplacements[N]=y.settings.foreground,w.settings.foreground=N}if(v){const N=o(y.settings.background);t.colorReplacements[N]=y.settings.background,w.settings.background=N}return w});for(const y of Object.keys(t.colors||{}))if((y==="editor.foreground"||y==="editor.background"||y.startsWith("terminal.ansi"))&&!((g=t.colors[y])!=null&&g.startsWith("#"))){const E=o(t.colors[y]);t.colorReplacements[E]=t.colors[y],t.colors[y]=E}return Object.defineProperty(t,z2,{enumerable:!1,writable:!1,value:!0}),t}async function kk(e){return Array.from(new Set((await Promise.all(e.filter(t=>!xk(t)).map(async t=>await bk(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function wk(e){return(await Promise.all(e.map(async n=>yk(n)?null:E1(await bk(n))))).filter(n=>!!n)}let sI=3;function iI(e,t=3){t>sI||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let jo=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Ck(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new jo(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class lI extends mR{constructor(n,r,i,l={}){super(n);oe(this,"_resolvedThemes",new Map);oe(this,"_resolvedGrammars",new Map);oe(this,"_langMap",new Map);oe(this,"_langGraph",new Map);oe(this,"_textmateThemeCache",new WeakMap);oe(this,"_loadedThemesCache",null);oe(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=i,this._alias=l,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=E1(n);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let r=this._textmateThemeCache.get(n);r||(r=Wf.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){return n=Ck(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var o,c,d,m;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(p=>{var g;return(g=p.embeddedLangsLazy)==null?void 0:g.includes(n.name)}));this._resolver.addLanguage(n);const i={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const l=this.loadGrammarWithConfiguration(n.scopeName,1,i);if(l.name=n.name,this._resolvedGrammars.set(n.name,l),n.aliases&&n.aliases.forEach(p=>{this._alias[p]=n.name}),this._loadedLanguagesCache=null,r.size)for(const p of r)this._resolvedGrammars.delete(p.name),this._loadedLanguagesCache=null,(c=(o=this._syncRegistry)==null?void 0:o._injectionGrammars)==null||c.delete(p.scopeName),(m=(d=this._syncRegistry)==null?void 0:d._grammars)==null||m.delete(p.scopeName),this.loadLanguage(this._langMap.get(p.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const l of n)this.resolveEmbeddedLanguages(l);const r=Array.from(this._langGraph.entries()),i=r.filter(([l,o])=>!o);if(i.length){const l=r.filter(([o,c])=>{if(!c)return!1;const d=c.embeddedLanguages||c.embeddedLangs;return d==null?void 0:d.some(m=>i.map(([p])=>p).includes(m))}).filter(o=>!i.includes(o));throw new jo(`Missing languages ${i.map(([o])=>`\`${o}\``).join(", ")}, required by ${l.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[l,o]of r)this._resolver.addLanguage(o);for(const[l,o]of r)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){this._langMap.set(n.name,n),this._langGraph.set(n.name,n);const r=n.embeddedLanguages??n.embeddedLangs;if(r)for(const i of r)this._langGraph.set(i,this._langMap.get(i))}}class oI{constructor(t,n){oe(this,"_langs",new Map);oe(this,"_scopeToLang",new Map);oe(this,"_injections",new Map);oe(this,"_onigLib");this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let i=1;i<=n.length;i++){const l=n.slice(0,i).join(".");r=[...r,...this._injections.get(l)||[]]}return r}}let Qu=0;function uI(e){Qu+=1,e.warnings!==!1&&Qu>=10&&Qu%10===0&&console.warn(`[Shiki] ${Qu} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new jo("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(E1),i=new oI(e.engine,n),l=new lI(i,r,n,e.langAlias);let o;function c(A){return Ck(A,e.langAlias)}function d(A){S();const H=l.getGrammar(typeof A=="string"?A:A.name);if(!H)throw new jo(`Language \`${A}\` not found, you may need to load it first`);return H}function m(A){if(A==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};S();const H=l.getTheme(A);if(!H)throw new jo(`Theme \`${A}\` not found, you may need to load it first`);return H}function p(A){S();const H=m(A);o!==A&&(l.setTheme(H),o=A);const $=l.getColorMap();return{theme:H,colorMap:$}}function g(){return S(),l.getLoadedThemes()}function y(){return S(),l.getLoadedLanguages()}function E(...A){S(),l.loadLanguages(A.flat(1))}async function v(...A){return E(await kk(A))}function w(...A){S();for(const H of A.flat(1))l.loadTheme(H)}async function C(...A){return S(),w(await wk(A))}function S(){if(t)throw new jo("Shiki instance has been disposed")}function N(){t||(t=!0,l.dispose(),Qu-=1)}return{setTheme:p,getTheme:m,getLanguage:d,getLoadedThemes:g,getLoadedLanguages:y,resolveLangAlias:c,loadLanguage:v,loadLanguageSync:E,loadTheme:C,loadThemeSync:w,dispose:N,[Symbol.dispose]:N}}async function cI(e){e.engine||iI("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([wk(e.themes||[]),kk(e.langs||[]),e.engine]);return uI({...e,themes:t,langs:n,engine:r})}async function dI(e){const t=await cI(e);return{getLastGrammarState:(...n)=>qL(t,...n),codeToTokensBase:(n,r)=>x1(t,n,r),codeToTokensWithThemes:(n,r)=>vk(t,n,r),codeToTokens:(n,r)=>rh(t,n,r),codeToHast:(n,r)=>ah(t,n,r),codeToHtml:(n,r)=>aI(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function fI(e){const t=e.langs,n=e.themes,r=e.engine;async function i(l){function o(g){var y;if(typeof g=="string"){if(g=((y=l.langAlias)==null?void 0:y[g])||g,xk(g))return[];const E=t[g];if(!E)throw new qn(`Language \`${g}\` is not included in this bundle. You may want to load it from external source.`);return E}return g}function c(g){if(yk(g))return"none";if(typeof g=="string"){const y=n[g];if(!y)throw new qn(`Theme \`${g}\` is not included in this bundle. You may want to load it from external source.`);return y}return g}const d=(l.themes??[]).map(g=>c(g)),m=(l.langs??[]).map(g=>o(g)),p=await dI({engine:l.engine??r(),...l,themes:d,langs:m});return{...p,loadLanguage(...g){return p.loadLanguage(...g.map(o))},loadTheme(...g){return p.loadTheme(...g.map(c))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}const _1=[{id:"abap",name:"ABAP",import:(()=>D(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>D(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>D(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>D(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>D(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>D(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>D(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>D(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>D(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>D(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>D(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>D(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>D(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>D(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>D(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>D(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>D(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>D(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>D(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>D(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>D(()=>import("./bird2-DPOp833l.js"),[]))},{id:"blade",name:"Blade",import:(()=>D(()=>import("./blade-D4QpJJKB.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>D(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>D(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>D(()=>import("./c3-eo99z4R2.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>D(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>D(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>D(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>D(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>D(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>D(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>D(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>D(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>D(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>D(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>D(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>D(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>D(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>D(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>D(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>D(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>D(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>D(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>D(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>D(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>D(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>D(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>D(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>D(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>D(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>D(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>D(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>D(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>D(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>D(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>D(()=>import("./erb-B12qg9BL.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>D(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>D(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>D(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>D(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>D(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>D(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>D(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>D(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>D(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>D(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>D(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>D(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>D(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>D(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>D(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>D(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>D(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>D(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>D(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>D(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>D(()=>import("./go-CxLEBnE3.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>D(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>D(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>D(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>D(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>D(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>D(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>D(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>D(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>D(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>D(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>D(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>D(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>D(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>D(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>D(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>D(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>D(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>D(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>D(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>D(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>D(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>D(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>D(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>D(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>D(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>D(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>D(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>D(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>D(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>D(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>D(()=>import("./just-Cw27pwNe.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>D(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>D(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>D(()=>import("./kusto-DZf3V79B.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>D(()=>import("./latex-CWtU0Tv5.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>D(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>D(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>D(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>D(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>D(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>D(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>D(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>D(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>D(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>D(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>D(()=>import("./marko-CnJfTvn9.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>D(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>D(()=>import("./mdc-BMNejdWA.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>D(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>D(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>D(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>D(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>D(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>D(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>D(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>D(()=>import("./nextflow-Zz6hmt5N.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>D(()=>import("./nextflow-groovy-BeH2EWoN.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>D(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>D(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>D(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>D(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>D(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>D(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>D(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>D(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>D(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>D(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>D(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>D(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>D(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>D(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>D(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>D(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>D(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>D(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>D(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>D(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>D(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>D(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>D(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>D(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>D(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>D(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>D(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>D(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>D(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>D(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>D(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>D(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>D(()=>import("./razor-Uh8Bk_45.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>D(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>D(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>D(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>D(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>D(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>D(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>D(()=>import("./rst-BrH8l1NY.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>D(()=>import("./ruby-Dw2BHqvy.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>D(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>D(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>D(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>D(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>D(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>D(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>D(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>D(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>D(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>D(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>D(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>D(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>D(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>D(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>D(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>D(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>D(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>D(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>D(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>D(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>D(()=>import("./svelte-C_ipcX3V.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>D(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>D(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>D(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>D(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>D(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>D(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>D(()=>import("./templ-P3uqSqPl.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>D(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>D(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>D(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>D(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>D(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>D(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>D(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>D(()=>import("./twig-DNn4PbVi.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>D(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>D(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>D(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>D(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>D(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>D(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>D(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>D(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>D(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>D(()=>import("./vue-DN_0RTcg.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>D(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>D(()=>import("./vue-vine-CQOfvN7w.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>D(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>D(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>D(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>D(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>D(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>D(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>D(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>D(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>D(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>D(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>D(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>D(()=>import("./zig-VOosw3JB.js"),[]))}],hI=Object.fromEntries(_1.map(e=>[e.id,e.import])),mI=Object.fromEntries(_1.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))||[]})),Sk={...hI,...mI},pI=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>D(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>D(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>D(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>D(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>D(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>D(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>D(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>D(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>D(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>D(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>D(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>D(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>D(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>D(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>D(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>D(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>D(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>D(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>D(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>D(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>D(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>D(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>D(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>D(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>D(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>D(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>D(()=>import("./horizon-bright-Cn-bp-IR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>D(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>D(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>D(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>D(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>D(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>D(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>D(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>D(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>D(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>D(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>D(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>D(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>D(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>D(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>D(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>D(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>D(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>D(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>D(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>D(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>D(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>D(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>D(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>D(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>D(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>D(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>D(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>D(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>D(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>D(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>D(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>D(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>D(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>D(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>D(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>D(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],gI=Object.fromEntries(pI.map(e=>[e.id,e.import]));class T1 extends Error{constructor(t){super(t),this.name="ShikiError"}}function bI(){return 2147483648}function xI(){return typeof performance<"u"?performance.now():Date.now()}const yI=(e,t)=>e+(t-e%t)%t;async function EI(e){let t,n;const r={};function i(E){n=E,r.HEAPU8=new Uint8Array(E),r.HEAPU32=new Uint32Array(E)}function l(E,v,w){r.HEAPU8.copyWithin(E,v,v+w)}function o(E){try{return t.grow(E-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function c(E){const v=r.HEAPU8.length;E=E>>>0;const w=bI();if(E>w)return!1;for(let C=1;C<=4;C*=2){let S=v*(1+.2/C);S=Math.min(S,E+100663296);const N=Math.min(w,yI(Math.max(E,S),65536));if(o(N))return!0}return!1}const d=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function m(E,v,w=1024){const C=v+w;let S=v;for(;E[S]&&!(S>=C);)++S;if(S-v>16&&E.buffer&&d)return d.decode(E.subarray(v,S));let N="";for(;v<S;){let A=E[v++];if(!(A&128)){N+=String.fromCharCode(A);continue}const H=E[v++]&63;if((A&224)===192){N+=String.fromCharCode((A&31)<<6|H);continue}const $=E[v++]&63;if((A&240)===224?A=(A&15)<<12|H<<6|$:A=(A&7)<<18|H<<12|$<<6|E[v++]&63,A<65536)N+=String.fromCharCode(A);else{const U=A-65536;N+=String.fromCharCode(55296|U>>10,56320|U&1023)}}return N}function p(E,v){return E?m(r.HEAPU8,E,v):""}const g={emscripten_get_now:xI,emscripten_memcpy_big:l,emscripten_resize_heap:c,fd_write:()=>0};async function y(){const v=await e({env:g,wasi_snapshot_preview1:g});t=v.memory,i(t.buffer),Object.assign(r,v),r.UTF8ToString=p}return await y(),r}var _I=Object.defineProperty,TI=(e,t,n)=>t in e?_I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qn=(e,t,n)=>TI(e,typeof t!="symbol"?t+"":t,n);let sr=null;function vI(e){throw new T1(e.UTF8ToString(e.getLastOnigError()))}class Sh{constructor(t){Qn(this,"utf16Length"),Qn(this,"utf8Length"),Qn(this,"utf16Value"),Qn(this,"utf8Value"),Qn(this,"utf16OffsetToUtf8"),Qn(this,"utf8OffsetToUtf16");const n=t.length,r=Sh._utf8ByteLength(t),i=r!==n,l=i?new Uint32Array(n+1):null;i&&(l[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const c=new Uint8Array(r);let d=0;for(let m=0;m<n;m++){const p=t.charCodeAt(m);let g=p,y=!1;if(p>=55296&&p<=56319&&m+1<n){const E=t.charCodeAt(m+1);E>=56320&&E<=57343&&(g=(p-55296<<10)+65536|E-56320,y=!0)}i&&(l[m]=d,y&&(l[m+1]=d),g<=127?o[d+0]=m:g<=2047?(o[d+0]=m,o[d+1]=m):g<=65535?(o[d+0]=m,o[d+1]=m,o[d+2]=m):(o[d+0]=m,o[d+1]=m,o[d+2]=m,o[d+3]=m)),g<=127?c[d++]=g:g<=2047?(c[d++]=192|(g&1984)>>>6,c[d++]=128|(g&63)>>>0):g<=65535?(c[d++]=224|(g&61440)>>>12,c[d++]=128|(g&4032)>>>6,c[d++]=128|(g&63)>>>0):(c[d++]=240|(g&1835008)>>>18,c[d++]=128|(g&258048)>>>12,c[d++]=128|(g&4032)>>>6,c[d++]=128|(g&63)>>>0),y&&m++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=c,this.utf16OffsetToUtf8=l,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r<i;r++){const l=t.charCodeAt(r);let o=l,c=!1;if(l>=55296&&l<=56319&&r+1<i){const d=t.charCodeAt(r+1);d>=56320&&d<=57343&&(o=(l-55296<<10)+65536|d-56320,c=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,c&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Nh=class ds{constructor(t){if(Qn(this,"id",++ds.LAST_ID),Qn(this,"_onigBinding"),Qn(this,"content"),Qn(this,"utf16Length"),Qn(this,"utf8Length"),Qn(this,"utf16OffsetToUtf8"),Qn(this,"utf8OffsetToUtf16"),Qn(this,"ptr"),!sr)throw new T1("Must invoke loadWasm first.");this._onigBinding=sr,this.content=t;const n=new Sh(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!ds._sharedPtrInUse?(ds._sharedPtr||(ds._sharedPtr=sr.omalloc(1e4)),ds._sharedPtrInUse=!0,sr.HEAPU8.set(n.utf8Value,ds._sharedPtr),this.ptr=ds._sharedPtr):this.ptr=n.createString(sr)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===ds._sharedPtr?ds._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Qn(Nh,"LAST_ID",0);Qn(Nh,"_sharedPtr",0);Qn(Nh,"_sharedPtrInUse",!1);let Nk=Nh;class kI{constructor(t){if(Qn(this,"_onigBinding"),Qn(this,"_ptr"),!sr)throw new T1("Must invoke loadWasm first.");const n=[],r=[];for(let c=0,d=t.length;c<d;c++){const m=new Sh(t[c]);n[c]=m.createString(sr),r[c]=m.utf8Length}const i=sr.omalloc(4*t.length);sr.HEAPU32.set(n,i/4);const l=sr.omalloc(4*t.length);sr.HEAPU32.set(r,l/4);const o=sr.createOnigScanner(i,l,t.length);for(let c=0,d=t.length;c<d;c++)sr.ofree(n[c]);sr.ofree(l),sr.ofree(i),o===0&&vI(sr),this._onigBinding=sr,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof t=="string"){t=new Nk(t);const l=this._findNextMatchSync(t,n,!1,i);return t.dispose(),l}return this._findNextMatchSync(t,n,!1,i)}_findNextMatchSync(t,n,r,i){const l=this._onigBinding,o=l.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),i);if(o===0)return null;const c=l.HEAPU32;let d=o/4;const m=c[d++],p=c[d++],g=[];for(let y=0;y<p;y++){const E=t.convertUtf8OffsetToUtf16(c[d++]),v=t.convertUtf8OffsetToUtf16(c[d++]);g[y]={start:E,end:v,length:v-E}}return{index:m,captureIndices:g}}}function wI(e){return typeof e.instantiator=="function"}function CI(e){return typeof e.default=="function"}function SI(e){return typeof e.data<"u"}function NI(e){return typeof Response<"u"&&e instanceof Response}function AI(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let mf;function RI(e){if(mf)return mf;async function t(){sr=await EI(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),wI(r)?r=await r.instantiator(n):CI(r)?r=await r.default(n):(SI(r)&&(r=r.data),NI(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await LI(r)(n):r=await II(r)(n):AI(r)?r=await m0(r)(n):r instanceof WebAssembly.Module?r=await m0(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await m0(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return mf=t(),mf}function m0(e){return t=>WebAssembly.instantiate(e,t)}function LI(e){return t=>WebAssembly.instantiateStreaming(e,t)}function II(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function OI(e){return e&&await RI(e),{createScanner(t){return new kI(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Nk(t)}}}const DI=fI({langs:Sk,themes:gI,engine:()=>OI(D(()=>import("./wasm-CG6Dc4jp.js"),[]))});function Jo(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function jI(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const v1=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),ir=String.raw;function eu(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Ak=ir`\[\^?`,Rk=`c.? | C(?:-.?)?|${ir`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${ir`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${ir`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${ir`o\{[^\}]*\}?`}|${ir`\d{1,3}`}`,k1=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,pf=new RegExp(ir`
104
+ \\ (?:
105
+ ${Rk}
106
+ | [gk]<[^>]*>?
107
+ | [gk]'[^']*'?
108
+ | .
109
+ )
110
+ | \( (?:
111
+ \? (?:
112
+ [:=!>({]
113
+ | <[=!]
114
+ | <[^>]*>
115
+ | '[^']*'
116
+ | ~\|?
117
+ | #(?:[^)\\]|\\.?)*
118
+ | [^:)]*[:)]
119
+ )?
120
+ | \*[^\)]*\)?
121
+ )?
122
+ | (?:${k1.source})+
123
+ | ${Ak}
124
+ | .
125
+ `.replace(/\s+/g,""),"gsu"),p0=new RegExp(ir`
126
+ \\ (?:
127
+ ${Rk}
128
+ | .
129
+ )
130
+ | \[:(?:\^?\p{Alpha}+|\^):\]
131
+ | ${Ak}
132
+ | &&
133
+ | .
134
+ `.replace(/\s+/g,""),"gsu");function MI(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=tO(n.flags),i=[r.extended],l={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(g){i.push(g)},replaceCurrentModX(g){i[i.length-1]=g},singleline:n.rules.singleline};let o=[],c;for(pf.lastIndex=0;c=pf.exec(e);){const g=PI(l,e,c[0],pf.lastIndex);g.tokens?o.push(...g.tokens):g.token&&o.push(g.token),g.lastIndex!==void 0&&(pf.lastIndex=g.lastIndex)}const d=[];let m=0;o.filter(g=>g.type==="GroupOpen").forEach(g=>{g.kind==="capturing"?g.number=++m:g.raw==="("&&d.push(g)}),m||d.forEach((g,y)=>{g.kind="capturing",g.number=y+1});const p=m||d.length;return{tokens:o.map(g=>g.type==="EscapedNumber"?rO(g,p):g).flat(),flags:r}}function PI(e,t,n,r){const[i,l]=n;if(n==="["||n==="[^"){const o=BI(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(l))return{token:F2(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:WI(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Ik(n)}}if(l==="K")return{token:Ok("keep",n)};if(l==="N"||l==="R")return{token:Il("newline",n,{negate:l==="N"})};if(l==="O")return{token:Il("any",n)};if(l==="X")return{token:Il("text_segment",n)};const o=Lk(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(l==="*")return{token:ZI(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:KI(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Io("group",n)};if(n==="(?>")return{token:Io("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Io(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Io("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Io("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:GI(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
135
+ `,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:Il("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":ir`\A`,$:ir`\Z`}[n]:n;return{token:F2(o,n)}}return n==="|"?{token:HI(n)}:k1.test(n)?{tokens:aO(n)}:{token:Ks(Jo(n),n)}}function BI(e,t,n){const r=[$2(t[1]==="^",t)];let i=1,l;for(p0.lastIndex=n;l=p0.exec(e);){const o=l[0];if(o[0]==="["&&o[1]!==":")i++,r.push($2(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Ks(93,o));else if(i--,r.push(zI(o)),!i)break}else{const c=UI(o);Array.isArray(c)?r.push(...c):r.push(c)}}return{tokens:r,lastIndex:p0.lastIndex||e.length}}function UI(e){if(e[0]==="\\")return Lk(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!v1.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Il("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?FI(e):e==="&&"?$I(e):Ks(Jo(e),e)}function Lk(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return XI(e);if("dDhHsSwW".includes(n))return JI(e);if(e.startsWith(ir`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return eO(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),l=new TextEncoder;return[...i].map(o=>{const c=[...l.encode(o)].map(d=>`\\x${d.toString(16)}`).join("");return Ks(Jo(o),c)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ks(nO(e),e);if(V2.has(n))return Ks(V2.get(n),e);if(/\d/.test(n))return VI(t,e);if(e==="\\")throw new Error(ir`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ks(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function HI(e){return{type:"Alternator",raw:e}}function F2(e,t){return{type:"Assertion",kind:e,raw:t}}function Ik(e){return{type:"Backreference",raw:e}}function Ks(e,t){return{type:"Character",value:e,raw:t}}function zI(e){return{type:"CharacterClassClose",raw:e}}function FI(e){return{type:"CharacterClassHyphen",raw:e}}function $I(e){return{type:"CharacterClassIntersector",raw:e}}function $2(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Il(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Ok(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:eu(n.flags),raw:t}}function VI(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function GI(e){return{type:"GroupClose",raw:e}}function Io(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function qI(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function YI(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function WI(e){return{type:"Subroutine",raw:e}}const QI=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),V2=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function XI(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Ks(Jo(t.toUpperCase())-64,e)}function KI(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??(r="");const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),l=q2(n),o=q2(r),c={};if(l&&(c.enable=l),o&&(c.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),Ok("flags",e,{flags:c});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,Io("group",e,{...(l||o)&&{flags:c}});throw new Error(`Unexpected flag modifier "${e}"`)}function ZI(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const l=i?i.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[o,c,d]=l,m=QI.has(n)?n.toLowerCase():"custom";switch(m){case"fail":case"mismatch":case"skip":if(l.length>0)throw new Error(`Named callout arguments not allowed "${l}"`);break;case"error":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!l.length||l.length>2)throw new Error(`Named callout must have one or two arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(l.length===2&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${c}"`);break;case"count":case"total_count":if(l.length>1)throw new Error(`Named callout allows only one argument "${l}"`);if(l.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(l.length!==3)throw new Error(`Named callout must have three arguments "${l}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof c=="number"||!/^(?:[<>!=]=|[<>])$/.test(c))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${c}"`);if(typeof d=="string"&&!/^[A-Za-z_]\w*$/.test(d))throw new Error(`Named callout argument three must be a tag or number "${d}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${m}"`)}return qI(m,r??null,(i==null?void 0:i.split(","))??null,e)}function G2(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:l}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||l&&+l>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=l===void 0?+i:l===""?1/0:+l,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return YI(t,n,r,e)}function JI(e){const t=e[1].toLowerCase();return Il({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function eO(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Il("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function q2(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function tO(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function nO(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function rO(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[Ik(n)];const l=[],o=i.match(/^[0-7]+|\d/g);for(let c=0;c<o.length;c++){const d=o[c];let m;if(c===0&&d!=="8"&&d!=="9"){if(m=parseInt(d,8),m>127)throw new Error(ir`Octal encoded byte above 177 unsupported "${n}"`)}else m=Jo(d);l.push(Ks(m,(c===0?"\\":"")+d))}return l}function aO(e){const t=[],n=new RegExp(k1,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const l=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(l){const{min:o,max:c}=l.groups;if(+o>+c&&i.endsWith("?")){n.lastIndex--,t.push(G2(i.slice(0,-1)));continue}}}t.push(G2(i))}return t}function Dk(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function sO(e){return iO.has(e.type)}const iO=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function jk(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=MI(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(y,E)=>{const v=r.tokens[l.nextIndex];switch(l.parent=y,l.nextIndex++,v.type){case"Alternator":return Pl();case"Assertion":return lO(v);case"Backreference":return oO(v,l);case"Character":return Ah(v.value,{useLastValid:!!E.isCheckingRangeEnd});case"CharacterClassHyphen":return uO(v,l,E);case"CharacterClassOpen":return cO(v,l,E);case"CharacterSet":return dO(v,l);case"Directive":return bO(v.kind,{flags:v.flags});case"GroupOpen":return fO(v,l,E);case"NamedCallout":return yO(v.kind,v.tag,v.arguments);case"Quantifier":return hO(v,l);case"Subroutine":return mO(v,l);default:throw new Error(`Unexpected token type "${v.type}"`)}},l={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=_O(xO(r.flags));let c=o.body[0];for(;l.nextIndex<r.tokens.length;){const y=i(c,{});y.type==="Alternative"?(o.body.push(y),c=y):c.body.push(y)}const{capturingGroups:d,hasNumberedRef:m,namedGroupsByName:p,subroutines:g}=l;if(m&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of g)if(typeof y=="number"){if(y>d.length)throw new Error("Subroutine uses a group number that's not defined");y&&(d[y-1].isSubroutined=!0)}else if(p.has(y)){if(p.get(y).length>1)throw new Error(ir`Subroutine uses a duplicate group name "\g<${y}>"`);p.get(y)[0].isSubroutined=!0}else throw new Error(ir`Subroutine uses a group name that's not defined "\g<${y}>"`);return o}function lO({kind:e}){return pg(eu({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===ir`\B`||e===ir`\Y`})}function oO({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(l,o=!1)=>{const c=t.capturingGroups.length;let d=!1;if(l>c)if(t.skipBackrefValidation)d=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,gg(o?c+1-l:l,{orphan:d})};if(n){const l=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(l)return i(+l.groups.num,!!l.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return gg(r)}return i(+r)}function uO(e,t,n){const{tokens:r,walk:i}=t,l=t.parent,o=l.body.at(-1),c=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&c&&c.type!=="CharacterClassOpen"&&c.type!=="CharacterClassClose"&&c.type!=="CharacterClassIntersector"){const d=i(l,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&d.type==="Character")return l.body.pop(),gO(o,d);throw new Error("Invalid character class range")}return Ah(Jo("-"))}function cO({negate:e},t,n){const{tokens:r,walk:i}=t,l=r[t.nextIndex],o=[zf()];let c=Q2(l);for(;c.type!=="CharacterClassClose";){if(c.type==="CharacterClassIntersector")o.push(zf()),t.nextIndex++;else{const m=o.at(-1);m.body.push(i(m,n))}c=Q2(r[t.nextIndex],l)}const d=zf({negate:e});return o.length===1?d.body=o[0].body:(d.kind="intersection",d.body=o.map(m=>m.body.length===1?m.body[0]:m)),t.nextIndex++,d}function dO({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o}=r;if(e==="property"){const c=Rh(n);if(v1.has(c)&&!(o!=null&&o.has(c)))e="posix",n=c;else return Oo(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:l,unicodePropertyMap:o})}return e==="posix"?EO(n,{negate:t}):bg(e,{negate:t})}function fO(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:l,skipLookbehindValidation:o,walk:c}=t,d=TO(e),m=d.type==="AbsenceFunction",p=W2(d),g=p&&d.negate;if(d.type==="CapturingGroup"&&(i.push(d),d.name&&jI(l,d.name,[]).push(d)),m&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=X2(r[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")d.body.push(Pl()),t.nextIndex++;else{const E=d.body.at(-1),v=c(E,{...n,isInAbsenceFunction:n.isInAbsenceFunction||m,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||g});if(E.body.push(v),(p||n.isInLookbehind)&&!o){const w="Lookbehind includes a pattern not allowed by Oniguruma";if(g||n.isInNegLookbehind){if(Y2(v)||v.type==="CapturingGroup")throw new Error(w)}else if(Y2(v)||W2(v)&&v.negate)throw new Error(w)}}y=X2(r[t.nextIndex])}return t.nextIndex++,d}function hO({kind:e,min:t,max:n},r){const i=r.parent,l=i.body.at(-1);if(!l||!sO(l))throw new Error("Quantifier requires a repeatable token");const o=Pk(e,t,n,l);return i.body.pop(),o}function mO({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const l=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(l){const c=+l.groups.num,d=n.length;if(t.hasNumberedRef=!0,i={"":c,"+":d+c,"-":d+1-c}[l.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=Bk(i);return r.push(o),o}function pO(e,t){return{type:"AbsenceFunction",kind:e,body:zc(t==null?void 0:t.body)}}function Pl(e){return{type:"Alternative",body:Uk(e==null?void 0:e.body)}}function pg(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!(t!=null&&t.negate)),n}function gg(e,t){const n=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Mk(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!vO(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:zc(t==null?void 0:t.body)}}function Ah(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function zf(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Uk(e==null?void 0:e.body)}}function gO(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function bg(e,t){const n=!!(t!=null&&t.negate),r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function bO(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:eu(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function xO(e){return{type:"Flags",...e}}function Ya(e){const t=e==null?void 0:e.atomic,n=e==null?void 0:e.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:zc(e==null?void 0:e.body)}}function Nl(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:zc(e==null?void 0:e.body)}}function yO(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function EO(e,t){const n=!!(t!=null&&t.negate);if(!v1.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Pk(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function _O(e,t){return{type:"Regex",body:zc(t==null?void 0:t.body),flags:e}}function Bk(e){return{type:"Subroutine",ref:e}}function Oo(e,t){var i;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=(i=n.unicodePropertyMap)==null?void 0:i.get(Rh(e));if(!r){if(n.normalizeUnknownPropertyNames)r=kO(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(ir`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function TO({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return pO("repeater");case"atomic":return Ya({atomic:!0});case"capturing":return Mk(i,{name:n});case"group":return Ya({flags:e});case"lookahead":case"lookbehind":return Nl({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function zc(e){if(e===void 0)e=[Pl()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function Uk(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Y2(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function W2(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function vO(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function kO(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Rh(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Q2(e,t){return eu(e,`${(t==null?void 0:t.type)==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function X2(e){return eu(e,"Unclosed group")}function hc(e,t,n=null){function r(l,o){for(let c=0;c<l.length;c++){const d=i(l[c],o,c,l);c=Math.max(-1,c+d)}}function i(l,o=null,c=null,d=null){var S,N;let m=0,p=!1;const g={node:l,parent:o,key:c,container:d,root:e,remove(){gf(d).splice(Math.max(0,ko(c)+m),1),m--,p=!0},removeAllNextSiblings(){return gf(d).splice(ko(c)+1)},removeAllPrevSiblings(){const A=ko(c)+m;return m-=A,gf(d).splice(0,Math.max(0,A))},replaceWith(A,H={}){const $=!!H.traverse;d?d[Math.max(0,ko(c)+m)]=A:eu(o,"Can't replace root node")[c]=A,$&&i(A,o,c,d),p=!0},replaceWithMultiple(A,H={}){const $=!!H.traverse;if(gf(d).splice(Math.max(0,ko(c)+m),1,...A),m+=A.length-1,$){let U=0;for(let P=0;P<A.length;P++)U+=i(A[P],o,ko(c)+P+U,d)}p=!0},skip(){p=!0}},{type:y}=l,E=t["*"],v=t[y],w=typeof E=="function"?E:E==null?void 0:E.enter,C=typeof v=="function"?v:v==null?void 0:v.enter;if(w==null||w(g,n),C==null||C(g,n),!p)switch(y){case"AbsenceFunction":case"CapturingGroup":case"Group":r(l.body,l);break;case"Alternative":case"CharacterClass":r(l.body,l);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(l.min,l,"min"),i(l.max,l,"max");break;case"LookaroundAssertion":r(l.body,l);break;case"Quantifier":i(l.body,l,"body");break;case"Regex":r(l.body,l),i(l.flags,l,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return(S=v==null?void 0:v.exit)==null||S.call(v,g,n),(N=E==null?void 0:E.exit)==null||N.call(E,g,n),m}return i(e),e}function gf(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function ko(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const wO=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function CO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function SO(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Ra=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function w1(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),l=[!1];let o=0,c="";for(const d of e.matchAll(i)){const{0:m,groups:{$skip:p}}=d;if(!p&&(!r||r===Ra.DEFAULT==!o)){n instanceof Function?c+=n(d,{context:o?Ra.CHAR_CLASS:Ra.DEFAULT,negated:l[l.length-1]}):c+=n;continue}m[0]==="["?(o++,l.push(m[1]==="^")):m==="]"&&o&&(o--,l.pop()),c+=m}return c}function Hk(e,t,n,r){w1(e,t,n,r)}function NO(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let l=0,o;for(;o=i.exec(e);){const{0:c,groups:{$skip:d}}=o;if(!d&&(!r||r===Ra.DEFAULT==!l))return o;c==="["?l++:c==="]"&&l&&l--,i.lastIndex==o.index&&i.lastIndex++}return null}function bf(e,t,n){return!!NO(e,t,0,n)}function AO(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,l=1,o;for(;o=n.exec(e);){const[c]=o;if(c==="[")i++;else if(i)c==="]"&&i--;else if(c==="(")l++;else if(c===")"&&(l--,!l)){r=o.index;break}}return e.slice(t,r)}const K2=new RegExp(String.raw`(?<noncapturingStart>${wO})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function RO(e,t){const n=(t==null?void 0:t.hiddenCaptures)??[];let r=(t==null?void 0:t.captureTransfers)??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",l="(?:(?=(",o=[0],c=[];let d=0,m=0,p=NaN,g;do{g=!1;let y=0,E=0,v=!1,w;for(K2.lastIndex=Number.isNaN(p)?0:p+l.length;w=K2.exec(e);){const{0:C,index:S,groups:{capturingStart:N,noncapturingStart:A}}=w;if(C==="[")y++;else if(y)C==="]"&&y--;else if(C===i&&!v)p=S,v=!0;else if(v&&A)E++;else if(N)v?E++:(d++,o.push(d+m));else if(C===")"&&v){if(!E){m++;const H=d+m;if(e=`${e.slice(0,p)}${l}${e.slice(p+i.length,S)}))<$$${H}>)${e.slice(S+1)}`,g=!0,c.push(H),CO(n,H),r.size){const $=new Map;r.forEach((U,P)=>{$.set(P>=H?P+1:P,U.map(Y=>Y>=H?Y+1:Y))}),r=$}break}E--}}}while(g);return n.push(...c),e=w1(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:E,wrappedBackrefNum:v}})=>{if(E){const w=+E;if(w>o.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${o[w]}`}return`\\${v}`},Ra.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const zk=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,g0=new RegExp(String.raw`
136
+ \\(?: \d+
137
+ | c[A-Za-z]
138
+ | [gk]<[^>]+>
139
+ | [pPu]\{[^\}]+\}
140
+ | u[A-Fa-f\d]{4}
141
+ | x[A-Fa-f\d]{2}
142
+ )
143
+ | \((?: \? (?: [:=!>]
144
+ | <(?:[=!]|[^>]+>)
145
+ | [A-Za-z\-]+:
146
+ | \(DEFINE\)
147
+ ))?
148
+ | (?<qBase>${zk})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
149
+ | \\?.
150
+ `.replace(/\s+/g,""),"gsu");function LO(e){if(!new RegExp(`${zk}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",l=0,o;for(g0.lastIndex=0;o=g0.exec(e);){const{0:c,index:d,groups:{qBase:m,qMod:p,invalidQ:g}}=o;if(c==="[")l||(r=d),l++;else if(c==="]")l?l--:r=null;else if(!l)if(p==="+"&&i&&!i.startsWith("(")){if(g)throw new Error(`Invalid quantifier "${c}"`);let y=-1;if(/^\{\d+\}$/.test(m))e=SO(e,d+m.length,p,"");else{if(i===")"||i==="]"){const E=i===")"?n:r;if(E===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,E)}(?>${e.slice(E,d)}${m})${e.slice(d+c.length)}`}else e=`${e.slice(0,d-i.length)}(?>${i}${m})${e.slice(d+c.length)}`;y+=4}g0.lastIndex+=y}else c[0]==="("?t.push(d):c===")"&&(n=t.length?t.pop():null);i=c}return{pattern:e}}const Aa=String.raw,IO=Aa`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,xg=Aa`\(\?R=(?<rDepth>[^\)]+)\)|${IO}`,Lh=Aa`\(\?<(?![=!])(?<captureName>[^>]+)>`,Fk=Aa`${Lh}|(?<unnamed>\()(?!\?)`,kl=new RegExp(Aa`${Lh}|${xg}|\(\?|\\?.`,"gsu"),b0="Cannot use multiple overlapping recursions";function OO(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(xg,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&bf(e,Aa`\(\?\(DEFINE\)`,Ra.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const l=[],o=bf(e,Aa`\\[1-9]`,Ra.DEFAULT),c=new Map,d=[];let m=!1,p=0,g=0,y;for(kl.lastIndex=0;y=kl.exec(e);){const{0:E,groups:{captureName:v,rDepth:w,gRNameOrNum:C,gRDepth:S}}=y;if(E==="[")p++;else if(p)E==="]"&&p--;else if(w){if(Z2(w),m)throw new Error(b0);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const N=e.slice(0,y.index),A=e.slice(kl.lastIndex);if(bf(A,xg,Ra.DEFAULT))throw new Error(b0);const H=+w-1;e=J2(N,A,H,!1,n,l,g),i=t_(i,N,H,l.length,0,g);break}else if(C){Z2(S);let N=!1;for(const V of d)if(V.name===C||V.num===+C){if(N=!0,V.hasRecursedWithin)throw new Error(b0);break}if(!N)throw new Error(Aa`Recursive \g cannot be used outside the referenced group "${r==="external"?C:Aa`\g<${C}&R=${S}>`}"`);const A=c.get(C),H=AO(e,A);if(o&&bf(H,Aa`${Lh}|\((?!\?)`,Ra.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const $=e.slice(A,y.index),U=H.slice($.length+E.length),P=l.length,Y=+S-1,fe=J2($,U,Y,!0,n,l,g);i=t_(i,$,Y,l.length-P,P,g);const M=e.slice(0,A),K=e.slice(A+H.length);e=`${M}${fe}${K}`,kl.lastIndex+=fe.length-E.length-$.length-U.length,d.forEach(V=>V.hasRecursedWithin=!0),m=!0}else if(v)g++,c.set(String(g),kl.lastIndex),c.set(v,kl.lastIndex),d.push({num:g,name:v});else if(E[0]==="("){const N=E==="(";N&&(g++,c.set(String(g),kl.lastIndex)),d.push(N?{num:g}:{})}else E===")"&&d.pop()}return n.push(...l),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Z2(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function J2(e,t,n,r,i,l,o){const c=new Set;r&&Hk(e+t,Lh,({groups:{captureName:m}})=>{c.add(m)},Ra.DEFAULT);const d=[n,r?c:null,i,l,o];return`${e}${e_(`(?:${e}`,"forward",...d)}(?:)${e_(`${t})`,"backward",...d)}${t}`}function e_(e,t,n,r,i,l,o){const d=p=>t==="forward"?p+2:n-p+2-1;let m="";for(let p=0;p<n;p++){const g=d(p);m+=w1(e,Aa`${Fk}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:E,unnamed:v,backref:w}})=>{if(w&&r&&!r.has(w))return y;const C=`_$${g}`;if(v||E){const S=o+l.length+1;return l.push(S),DO(i,S),v?y:`(?<${E}${C}>`}return Aa`\k<${w}${C}>`},Ra.DEFAULT)}return m}function DO(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function t_(e,t,n,r,i,l){if(e.size&&r){let o=0;Hk(t,Fk,()=>o++,Ra.DEFAULT);const c=l-o+i,d=new Map;return e.forEach((m,p)=>{const g=(r-o*n)/n,y=o*n,E=p>c+o?p+r:p,v=[];for(const w of m)if(w<=c)v.push(w);else if(w>c+o+g)v.push(w+r);else if(w<=c+o)for(let C=0;C<=n;C++)v.push(w+o*C);else for(let C=0;C<=n;C++)v.push(w+y+g*C);d.set(E,v)}),d}return e}var Xn=String.fromCodePoint,Et=String.raw,Wa={},Ih=globalThis.RegExp;Wa.flagGroups=(()=>{try{new Ih("(?i:)")}catch{return!1}return!0})();Wa.unicodeSets=(()=>{try{new Ih("[[]]","v")}catch{return!1}return!0})();Wa.bugFlagVLiteralHyphenIsRange=Wa.unicodeSets?(()=>{try{new Ih(Et`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Wa.bugNestedClassIgnoresNegation=Wa.unicodeSets&&new Ih("[[^a]]","v").test("a");function sh(e,{enable:t,disable:n}){return{dotAll:!(n!=null&&n.dotAll)&&!!(t!=null&&t.dotAll||e.dotAll),ignoreCase:!(n!=null&&n.ignoreCase)&&!!(t!=null&&t.ignoreCase||e.ignoreCase)}}function Rc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function yg(e,t){return n_[e]>=n_[t]}function jO(e,t){if(e==null)throw new Error(t??"Value expected");return e}var n_={ES2025:2025,ES2024:2024,ES2018:2018},MO={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function $k(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!MO[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=Wa.flagGroups?"ES2025":Wa.unicodeSets?"ES2024":"ES2018"),t}var PO="[ -\r ]",BO=new Set([Xn(304),Xn(305)]),Vs=Et`[\p{L}\p{M}\p{N}\p{Pc}]`;function Vk(e){if(BO.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=zO.get(n),l=UO.get(n),o=HO.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),l&&t.add(l),[...t]}var C1=new Map(`C Other
151
+ Cc Control cntrl
152
+ Cf Format
153
+ Cn Unassigned
154
+ Co Private_Use
155
+ Cs Surrogate
156
+ L Letter
157
+ LC Cased_Letter
158
+ Ll Lowercase_Letter
159
+ Lm Modifier_Letter
160
+ Lo Other_Letter
161
+ Lt Titlecase_Letter
162
+ Lu Uppercase_Letter
163
+ M Mark Combining_Mark
164
+ Mc Spacing_Mark
165
+ Me Enclosing_Mark
166
+ Mn Nonspacing_Mark
167
+ N Number
168
+ Nd Decimal_Number digit
169
+ Nl Letter_Number
170
+ No Other_Number
171
+ P Punctuation punct
172
+ Pc Connector_Punctuation
173
+ Pd Dash_Punctuation
174
+ Pe Close_Punctuation
175
+ Pf Final_Punctuation
176
+ Pi Initial_Punctuation
177
+ Po Other_Punctuation
178
+ Ps Open_Punctuation
179
+ S Symbol
180
+ Sc Currency_Symbol
181
+ Sk Modifier_Symbol
182
+ Sm Math_Symbol
183
+ So Other_Symbol
184
+ Z Separator
185
+ Zl Line_Separator
186
+ Zp Paragraph_Separator
187
+ Zs Space_Separator
188
+ ASCII
189
+ ASCII_Hex_Digit AHex
190
+ Alphabetic Alpha
191
+ Any
192
+ Assigned
193
+ Bidi_Control Bidi_C
194
+ Bidi_Mirrored Bidi_M
195
+ Case_Ignorable CI
196
+ Cased
197
+ Changes_When_Casefolded CWCF
198
+ Changes_When_Casemapped CWCM
199
+ Changes_When_Lowercased CWL
200
+ Changes_When_NFKC_Casefolded CWKCF
201
+ Changes_When_Titlecased CWT
202
+ Changes_When_Uppercased CWU
203
+ Dash
204
+ Default_Ignorable_Code_Point DI
205
+ Deprecated Dep
206
+ Diacritic Dia
207
+ Emoji
208
+ Emoji_Component EComp
209
+ Emoji_Modifier EMod
210
+ Emoji_Modifier_Base EBase
211
+ Emoji_Presentation EPres
212
+ Extended_Pictographic ExtPict
213
+ Extender Ext
214
+ Grapheme_Base Gr_Base
215
+ Grapheme_Extend Gr_Ext
216
+ Hex_Digit Hex
217
+ IDS_Binary_Operator IDSB
218
+ IDS_Trinary_Operator IDST
219
+ ID_Continue IDC
220
+ ID_Start IDS
221
+ Ideographic Ideo
222
+ Join_Control Join_C
223
+ Logical_Order_Exception LOE
224
+ Lowercase Lower
225
+ Math
226
+ Noncharacter_Code_Point NChar
227
+ Pattern_Syntax Pat_Syn
228
+ Pattern_White_Space Pat_WS
229
+ Quotation_Mark QMark
230
+ Radical
231
+ Regional_Indicator RI
232
+ Sentence_Terminal STerm
233
+ Soft_Dotted SD
234
+ Terminal_Punctuation Term
235
+ Unified_Ideograph UIdeo
236
+ Uppercase Upper
237
+ Variation_Selector VS
238
+ White_Space space
239
+ XID_Continue XIDC
240
+ XID_Start XIDS`.split(/\s/).map(e=>[Rh(e),e])),UO=new Map([["s",Xn(383)],[Xn(383),"s"]]),HO=new Map([[Xn(223),Xn(7838)],[Xn(107),Xn(8490)],[Xn(229),Xn(8491)],[Xn(969),Xn(8486)]]),zO=new Map([Mi(453),Mi(456),Mi(459),Mi(498),...x0(8072,8079),...x0(8088,8095),...x0(8104,8111),Mi(8124),Mi(8140),Mi(8188)]),FO=new Map([["alnum",Et`[\p{Alpha}\p{Nd}]`],["alpha",Et`\p{Alpha}`],["ascii",Et`\p{ASCII}`],["blank",Et`[\p{Zs}\t]`],["cntrl",Et`\p{Cc}`],["digit",Et`\p{Nd}`],["graph",Et`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Et`\p{Lower}`],["print",Et`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Et`[\p{P}\p{S}]`],["space",Et`\p{space}`],["upper",Et`\p{Upper}`],["word",Et`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Et`\p{AHex}`]]);function $O(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Mi(e){const t=Xn(e);return[t.toLowerCase(),t]}function x0(e,t){return $O(e,t).map(n=>Mi(n))}var Gk=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function VO(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};qk(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:yg(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};hc(e,GO,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},l={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};hc(e,qO,l);const o={groupsByName:l.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:l.reffedNodesByReferencer};return hc(e,YO,o),e._originMap=l.groupOriginByCopy,e._strategy=r.strategy,e}var GO={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const l=Ya();l.body[0].body.push(Nl({negate:!0,body:r}),Oo("Any"));const o=Ya();o.body[0].body.push(Pk("greedy",0,1/0,l)),n(Bn(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(l=>l.kind==="flags");for(let l=n+1;l<t.body.length;l++){const o=t.body[l];Rc(r,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=Wk(t.get(e));if(r){const i=Ya({flags:r});i.body[0].body=e.body,e.body=[Bn(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:l,replaceWith:o},c){const{kind:d,negate:m}=e,{asciiWordBoundaries:p,avoidSubclass:g,supportedGNodes:y,wordIsAscii:E}=c;if(d==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${m?"Y":"y"}"`);if(d==="line_end")o(Bn(Nl({body:[Pl({body:[pg("string_end")]}),Pl({body:[Ah(10)]})]}),t));else if(d==="line_start")o(Bn(Gs(Et`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(d==="search_start")if(y.has(e))i.flags.sticky=!0,l();else{const v=r[n-1];if(v&&JO(v))o(Bn(Nl({negate:!0}),t));else{if(g)throw new Error(Et`Uses "\G" in a way that requires a subclass`);o(Pi(pg("string_start"),t)),c.strategy="clip_search"}}else if(!(d==="string_end"||d==="string_start"))if(d==="string_end_newline")o(Bn(Gs(Et`(?=\n?\z)`),t));else if(d==="word_boundary"){if(!E&&!p){const v=`(?:(?<=${Vs})(?!${Vs})|(?<!${Vs})(?=${Vs}))`,w=`(?:(?<=${Vs})(?=${Vs})|(?<!${Vs})(?!${Vs}))`;o(Bn(Gs(m?w:v),t))}}else throw new Error(`Unexpected assertion kind "${d}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!E0(n)&&(n=y0(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!E0(r)&&(r=y0(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=zf({body:[e]});n(Bn(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:l,spaceIsAscii:o,wordIsAscii:c}){const{kind:d,negate:m,value:p}=e;if(l&&(d==="digit"||p==="digit")){n(Pi(bg("digit",{negate:m}),t));return}if(o&&(d==="space"||p==="space")){n(Bn(_0(Gs(PO),m),t));return}if(c&&(d==="word"||p==="word")){n(Pi(bg("word",{negate:m}),t));return}if(d==="any")n(Pi(Oo("Any"),t));else if(d==="digit")n(Pi(Oo("Nd",{negate:m}),t));else if(d!=="dot")if(d==="text_segment"){if(r==="strict")throw new Error(Et`Use of "\X" requires non-strict accuracy`);const g="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",y=Et`\p{RI}{2}|${g}(?:\u200D${g})*`;n(Bn(Gs(Et`(?>\r\n|${i?Et`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(d==="hex")n(Pi(Oo("AHex",{negate:m}),t));else if(d==="newline")n(Bn(Gs(m?`[^
241
+ ]`:`(?>\r
242
+ ?|[
243
+ \v\f…\u2028\u2029])`),t));else if(d==="posix")if(!i&&(p==="graph"||p==="print")){if(r==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let g={graph:"!-~",print:" -~"}[p];m&&(g=`\0-${Xn(g.codePointAt(0)-1)}${Xn(g.codePointAt(2)+1)}-􏿿`),n(Bn(Gs(`[${g}]`),t))}else n(Bn(_0(Gs(FO.get(p)),m),t));else if(d==="property")C1.has(Rh(p))||(e.key="sc");else if(d==="space")n(Pi(Oo("space",{negate:m}),t));else if(d==="word")n(Bn(_0(Gs(Vs),m),t));else throw new Error(`Unexpected character set kind "${d}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:l,removeAllNextSiblings:o}){const{kind:c,flags:d}=e;if(c==="flags")if(!d.enable&&!d.disable)r();else{const m=Ya({flags:d});m.body[0].body=o(),i(Bn(m,t),{traverse:!0})}else if(c==="keep"){const m=n.body[0],g=n.body.length===1&&Dk(m,{type:"Group"})&&m.body[0].body.length===1?m.body[0]:n;if(t.parent!==g||g.body.length>1)throw new Error(Et`Uses "\K" in a way that's unsupported`);const y=Nl({behind:!0});y.body[0].body=l(),i(Bn(y,t))}else throw new Error(`Unexpected directive kind "${c}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t!=null&&t.extended&&delete t.extended,n!=null&&n.extended&&delete n.extended,t!=null&&t.dotAll&&(n!=null&&n.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(n!=null&&n.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(Bn(Nl({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Ya();t.body[0].body.push(e.body),e.body=Bn(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const l of e.body)if(l.body.length===1&&l.body[0].kind==="search_start")l.body.pop();else{const o=Xk(l.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(l=>t.add(l))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Et`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!E0(n)&&(n=y0(n,t),e.ref=n)}},qO={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:l})=>l)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:l,multiplexCapturesToLeftByRef:o,openRefs:c,reffedNodesByReferencer:d}){const m=i.get(e);if(m&&c.has(e.number)){const g=Pi(r_(e.number),t);d.set(g,c.get(e.number)),n(g);return}c.set(e.number,e),o.set(e.number,[]),e.name&&Rc(o,e.name,[]);const p=o.get(e.name??e.number);for(let g=0;g<p.length;g++){const y=p[g];if(m===y.node||m&&m===y.origin||e===y.origin){p.splice(g,1);break}}if(o.get(e.number).push({node:e,origin:m}),e.name&&o.get(e.name).push({node:e,origin:m}),e.name){const g=Rc(l,e.name,new Map);let y=!1;if(m)y=!0;else for(const E of g.values())if(!E.hasDuplicateNameToRemove){y=!0;break}l.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=sh(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:i,ref:l}=e;if(i){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===l||p.number===l)););r.reffedNodesByReferencer.set(e,p);return}const o=r.subroutineRefMap.get(l),c=l===0,d=c?r_(0):Yk(o,r.groupOriginByCopy,null);let m=d;if(!c){const p=Wk(XO(o,y=>y.type==="Group"&&!!y.flags)),g=p?sh(r.globalFlags,p):r.globalFlags;WO(g,r.currentFlags)||(m=Ya({flags:KO(g)}),m.body[0].body.push(d))}n(Bn(m,t),{traverse:!c})}},YO={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const l=r.reffedNodesByReferencer.get(e).filter(o=>QO(o,e));if(!l.length)n(Bn(Nl({negate:!0}),t));else if(l.length>1){const o=Ya({atomic:!0,body:l.reverse().map(c=>Pl({body:[gg(c.number)]}))});n(Bn(o,t))}else e.ref=l[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const i=Mk();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function qk(e){hc(e,{"*"({node:t,parent:n}){t.parent=n}})}function WO(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function QO(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=Qk(n.parent);for(const i of r){if(i===n)break;if(i===e||Kk(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Yk(e,t,n,r){const i=Array.isArray(e)?[]:{};for(const[l,o]of Object.entries(e))l==="parent"?i.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?i[l]=Yk(o,t,i,n):(l==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[l]=o);return i}function r_(e){const t=Bk(e);return t.isRecursive=!0,t}function XO(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function y0(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Wk(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(i=>{var l,o;(l=r.enable)!=null&&l[i]&&(delete n.disable[i],n.enable[i]=!0),(o=r.disable)!=null&&o[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function KO({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Qk(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Xk(e){const t=e.find(n=>n.kind==="search_start"||e8(n,{negate:!1})||!ZO(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=Xk(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function Kk(e,t){const n=Qk(e)??[];for(const r of n)if(r===t||Kk(r,t))return!0;return!1}function ZO({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function JO(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function e8(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Dk(e.body[0],{type:"Assertion",kind:"search_start"})}function E0(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Gs(e,t){const r=jk(e,{...t,unicodePropertyMap:C1}).body;return r.length>1||r[0].body.length>1?Ya({body:r}):r[0].body[0]}function _0(e,t){return e.negate=t,e}function Pi(e,t){return e.parent=t,e}function Bn(e,t){return qk(e),e.parent=t,e}function t8(e,t){const n=$k(t),r=yg(n.target,"ES2024"),i=yg(n.target,"ES2025"),l=n.rules.recursionLimit;if(!Number.isInteger(l)||l<2||l>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,c=null;if(!i){const E=[e.flags.ignoreCase];hc(e,n8,{getCurrentModI:()=>E.at(-1),popModI(){E.pop()},pushModI(v){E.push(v)},setHasCasedChar(){E.at(-1)?o=!0:c=!0}})}const d={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!c)};let m=e;const p={accuracy:n.accuracy,appliedGlobalFlags:d,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:m,originMap:e._originMap,recursionLimit:l,useAppliedIgnoreCase:!!(!i&&o&&c),useFlagMods:i,useFlagV:r,verbose:n.verbose};function g(E){return p.lastNode=m,m=E,jO(r8[E.type],`Unexpected node type "${E.type}"`)(E,p,g)}const y={pattern:e.body.map(g).join("|"),flags:g(e.flags),options:{...e.options}};return r||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],p.captureMap.forEach((E,v)=>{E.hidden&&y._hiddenCaptures.push(v),E.transferTo&&Rc(y._captureTransfers,E.transferTo,[]).push(v)}),y}var n8={"*":{enter({node:e},t){if(s_(e)){const n=t.getCurrentModI();t.pushModI(e.flags?sh({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){s_(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){S1(Xn(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Zk(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Gk.has(e.value)&&t.setHasCasedChar()}},r8={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Et`\B`:Et`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:l}=e,o={ignoreCase:t.currentFlags.ignoreCase},c=t.originMap.get(e);return c&&(o.hidden=!0,l>c.number&&(o.transferTo=c.number)),t.captureMap.set(l,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=Xn(e),r=wo(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&S1(n)){const i=Vk(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:l}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Wa.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(i_)&&(o=[Ah(45),...o.filter(m=>!i_(m))]);const c=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Wa.bugNestedClassIgnoresNegation)&&!i){const p=o.filter(g=>g.type==="CharacterClass"&&g.kind==="union"&&g.negate);if(p.length){const g=Ya(),y=g.body[0];return g.parent=l,y.parent=g,o=o.filter(E=>!p.includes(E)),e.body=o,o.length?(e.parent=y,y.body.push(e)):g.body.pop(),p.forEach(E=>{const v=Pl({body:[E]});E.parent=v,v.parent=g,g.body.push(v)}),n(g)}}t.inCharClass=!0;const m=c();return t.inCharClass=!1,m}const d=o[0];if(r==="union"&&!i&&d&&((!t.useFlagV||!t.verbose)&&l.kind==="union"&&!(Wa.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&l.kind==="intersection"&&o.length===1&&d.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&l.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return c()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},l=wo(n,i),o=wo(r,i),c=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const d=Zk(e);o8(d).forEach(p=>{c.add(Array.isArray(p)?`${wo(p[0],i)}-${wo(p[1],i)}`:wo(p,i))})}return`${l}-${o}${[...c].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":Et`[^\n]`;if(e==="digit")return t?Et`\D`:Et`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Gk.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Et`\P`:Et`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Et`\W`:Et`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,l){const o=i.currentFlags;n&&(i.currentFlags=sh(o,n));const c=t.map(l).join("|"),d=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?c:`(?${u8(e,n,i.useFlagMods)}${c})`;return i.currentFlags=o,d},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+c8(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:Et`\g<${t}&R=${r}>`}},a8=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),s8=new Set(["-","\\","]","^","["]),i8=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),a_=new Map([[9,Et`\t`],[10,Et`\n`],[11,Et`\v`],[12,Et`\f`],[13,Et`\r`],[8232,Et`\u2028`],[8233,Et`\u2029`],[65279,Et`\uFEFF`]]),l8=new RegExp("^\\p{Cased}$","u");function S1(e){return l8.test(e)}function Zk(e,t){const n=!!(t!=null&&t.firstOnly),r=e.min.value,i=e.max.value,l=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return l;for(let o=r;o<=i;o++){const c=Xn(o);if(!S1(c))continue;const d=Vk(c).filter(m=>{const p=m.codePointAt(0);return p<r||p>i});if(d.length&&(l.push(...d),n))break}return l}function wo(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(a_.has(e))return a_.get(e);if(e<32||e>126&&e<160||e>262143||t&&d8(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?i8:s8:a8,l=Xn(e);return(i.has(l)?"\\":"")+l}function o8(e){const t=e.map(i=>i.codePointAt(0)).sort((i,l)=>i-l),n=[];let r=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?r??(r=t[i]):r===null?n.push(t[i]):(n.push([r,t[i]]),r=null);return n}function u8(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:i,disable:l}=t;r=(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")+(l?"-":"")+(l!=null&&l.ignoreCase?"i":"")+(l!=null&&l.dotAll?"s":"")}return`${r}:`}function c8({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function s_({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function d8(e){return e>47&&e<58}function i_({type:e,value:t}){return e==="Character"&&t===45}var zi,Ws,Dl,Fi,jl,Dc,Eg,Gi,f8=(Gi=class extends RegExp{constructor(n,r,i){var t=(...QY)=>(super(...QY),El(this,Dc),El(this,zi,new Map),El(this,Ws,null),El(this,Dl),El(this,Fi,null),El(this,jl,null),oe(this,"rawOptions",{}),this);const l=!!(i!=null&&i.lazyCompile);if(n instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const o=n;t(o,r),Ga(this,Dl,o.source),o instanceof Gi&&(Ga(this,zi,Ar(o,zi)),Ga(this,Fi,Ar(o,Fi)),Ga(this,jl,Ar(o,jl)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};t(l?"":n,r),Ga(this,Dl,n),Ga(this,zi,m8(o.hiddenCaptures,o.transfers)),Ga(this,jl,o.strategy),this.rawOptions=i??{}}l||Ga(this,Ws,this)}get source(){return Ar(this,Dl)||"(?:)"}exec(n){if(!Ar(this,Ws)){const{lazyCompile:l,...o}=this.rawOptions;Ga(this,Ws,new Gi(Ar(this,Dl),this.flags,o))}const r=this.global||this.sticky,i=this.lastIndex;if(Ar(this,jl)==="clip_search"&&r&&i){this.lastIndex=0;const l=Fp(this,Dc,Eg).call(this,n.slice(i));return l&&(h8(l,i,n,this.hasIndices),this.lastIndex+=i),l}return Fp(this,Dc,Eg).call(this,n)}},zi=new WeakMap,Ws=new WeakMap,Dl=new WeakMap,Fi=new WeakMap,jl=new WeakMap,Dc=new WeakSet,Eg=function(n){Ar(this,Ws).lastIndex=this.lastIndex;const r=ME(Gi.prototype,this,"exec").call(Ar(this,Ws),n);if(this.lastIndex=Ar(this,Ws).lastIndex,!r||!Ar(this,zi).size)return r;const i=[...r];r.length=1;let l;this.hasIndices&&(l=[...r.indices],r.indices.length=1);const o=[0];for(let c=1;c<i.length;c++){const{hidden:d,transferTo:m}=Ar(this,zi).get(c)??{};if(d?o.push(null):(o.push(r.length),r.push(i[c]),this.hasIndices&&r.indices.push(l[c])),m&&i[c]!==void 0){const p=o[m];if(!p)throw new Error(`Invalid capture transfer to "${p}"`);if(r[p]=i[c],this.hasIndices&&(r.indices[p]=l[c]),r.groups){Ar(this,Fi)||Ga(this,Fi,p8(this.source));const g=Ar(this,Fi).get(m);g&&(r.groups[g]=i[c],this.hasIndices&&(r.indices.groups[g]=l[c]))}}}return r},Gi);function h8(e,t,n,r){if(e.index+=t,e.input=n,r){const i=e.indices;for(let o=0;o<i.length;o++){const c=i[o];c&&(i[o]=[c[0]+t,c[1]+t])}const l=i.groups;l&&Object.keys(l).forEach(o=>{const c=l[o];c&&(l[o]=[c[0]+t,c[1]+t])})}}function m8(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const l of i)Rc(n,l,{}).transferTo=r;return n}function p8(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,l;for(;l=t.exec(e);){const{0:o,groups:{capture:c,name:d}}=l;o==="["?r++:r?o==="]"&&r--:c&&(i++,d&&n.set(i,d))}return n}function g8(e,t){const n=b8(e,t);return n.options?new f8(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function b8(e,t){const n=$k(t),r=jk(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:C1}),i=VO(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),l=t8(i,n),o=OO(l.pattern,{captureTransfers:l._captureTransfers,hiddenCaptures:l._hiddenCaptures,mode:"external"}),c=LO(o.pattern),d=RO(c.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),m={pattern:d.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${l.flags}${l.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=d.hiddenCaptures.sort((v,w)=>v-w),g=Array.from(d.captureTransfers),y=i._strategy,E=m.pattern.length>=n.lazyCompileLength;(p.length||g.length||y||E)&&(m.options={...p.length&&{hiddenCaptures:p},...g.length&&{transfers:g},...y&&{strategy:y},...E&&{lazyCompile:E}})}return m}const l_=4294967295;class x8{constructor(t,n={}){oe(this,"regexps");this.patterns=t,this.options=n;const{forgiving:r=!1,cache:i,regexConstructor:l}=n;if(!l)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(o=>{if(typeof o!="string")return o;const c=i==null?void 0:i.get(o);if(c){if(c instanceof RegExp)return c;if(r)return null;throw c}try{const d=l(o);return i==null||i.set(o,d),d}catch(d){if(i==null||i.set(o,d),r)return null;throw d}})}findNextMatchSync(t,n,r){const i=typeof t=="string"?t:t.content,l=[];function o(c,d,m=0){return{index:c,captureIndices:d.indices.map(p=>p==null?{start:l_,end:l_,length:0}:{start:p[0]+m,end:p[1]+m,length:p[1]-p[0]})}}for(let c=0;c<this.regexps.length;c++){const d=this.regexps[c];if(d)try{d.lastIndex=n;const m=d.exec(i);if(!m)continue;if(m.index===n)return o(c,m,0);l.push([c,m,0])}catch(m){if(this.options.forgiving)continue;throw m}}if(l.length){const c=Math.min(...l.map(d=>d[1].index));for(const[d,m,p]of l)if(m.index===c)return o(d,m,p)}return null}}function y8(e,t){return g8(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function E8(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||(t.regexConstructor=n=>y8(n,{target:t.target})),{createScanner(n){return new x8(n,t)},createString(n){return{content:n}}}}var _8=E8({forgiving:!0}),T8=Object.fromEntries(_1.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(n=>[n,e.id])})),Ff=new Set(Object.keys(Sk)),o_=e=>{let t=e.trim().toLowerCase();return T8[t]||(Ff.has(t),t)},T0=new Map,v0=new Map,Co=new Map,ih=e=>{var t;return typeof e=="string"?e:(t=e.name)!=null?t:"custom"},v8=(e,t)=>`${e}-${ih(t[0])}-${ih(t[1])}`,k8=(e,t,n)=>{let r=e.slice(0,100),i=e.length>100?e.slice(-100):"";return`${t}:${n[0]}:${n[1]}:${e.length}:${r}:${i}`},w8=(e,t)=>{let n=v8(e,t);if(T0.has(n))return T0.get(n);let r=DI({themes:t,langs:[e],engine:_8});return T0.set(n,r),r};function C8(e={}){var t;let n=(t=e.themes)!=null?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(r){let i=o_(r);return Ff.has(i)},getSupportedLanguages(){return Array.from(Ff)},getThemes(){return n},highlight({code:r,language:i,themes:l},o){let c=o_(i),d=[ih(l[0]),ih(l[1])],m=k8(r,c,d);if(v0.has(m))return v0.get(m);o&&(Co.has(m)||Co.set(m,new Set),Co.get(m).add(o));let p=Ff.has(c)?c:"text";return w8(p,l).then(g=>{let y=g.getLoadedLanguages().includes(c)?c:"text",E=g.codeToTokens(r,{lang:y,themes:{light:d[0],dark:d[1]}});v0.set(m,E);let v=Co.get(m);if(v){for(let w of v)w(E);Co.delete(m)}}).catch(g=>{console.error("[Streamdown Code] Failed to highlight code:",g),Co.delete(m)}),null}}}var S8=C8();const Oh=(function(e){if(e==null)return L8;if(typeof e=="function")return Dh(e);if(typeof e=="object")return Array.isArray(e)?N8(e):A8(e);if(typeof e=="string")return R8(e);throw new Error("Expected function, string, or object as test")});function N8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Oh(e[n]);return Dh(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function A8(e){const t=e;return Dh(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function R8(e){return Dh(t);function t(n){return n&&n.type===e}}function Dh(e){return t;function t(n,r,i){return!!(I8(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function L8(){return!0}function I8(e){return e!==null&&typeof e=="object"&&"type"in e}const Jk=[],lc=!0,_g=!1,Mo="skip";function N1(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=Oh(i),o=r?-1:1;c(e,void 0,[])();function c(d,m,p){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const E=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(E?"<"+E+">":""))+")"})}return y;function y(){let E=Jk,v,w,C;if((!t||l(d,m,p[p.length-1]||void 0))&&(E=O8(n(d,p)),E[0]===_g))return E;if("children"in d&&d.children){const S=d;if(S.children&&E[0]!==Mo)for(w=(r?S.children.length:-1)+o,C=p.concat(S);w>-1&&w<S.children.length;){const N=S.children[w];if(v=c(N,w,C)(),v[0]===_g)return v;w=typeof v[1]=="number"?v[1]:w+o}}return E}}}function O8(e){return Array.isArray(e)?e:typeof e=="number"?[lc,e]:e==null?Jk:[e]}function gs(e,t,n,r){let i,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,i=n):(l=t,o=n,i=r),N1(e,l,c,i);function c(d,m){const p=m[m.length-1],g=p?p.children.indexOf(d):void 0;return o(d,g,p)}}const $o={indicator:"indicator",textOnly:"text-only",remove:"remove"};function D8({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:l="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:o="text-gray-500",linkBlockPolicy:c=$o.indicator,imageBlockPolicy:d=$o.indicator}){const m=t.length&&!t.every(g=>g==="*"),p=n.length&&!n.every(g=>g==="*");if(!e&&(m||p))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return g=>{const y=H8(e,t,n,r,i,l,o,c,d);e3(g),gs(g,y)}}function u_(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function j8(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const M8=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),P8=new Set(["javascript:","data:","file:","vbscript:"]);function c_(e,t,n,r=!1,i=!1,l=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const p=e.substring(5);if(p&&p.length>0&&p!=="invalid")return e}}catch{return null}return null}const o=u_(e,n);if(!o||P8.has(o.protocol)||!(M8.has(o.protocol)||l.includes(o.protocol)||l.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const d=j8(e);return o&&t.some(m=>{const p=u_(m,n);return!p||p.origin!==o.origin?!1:o.href.startsWith(p.href)})?d?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:d?o.pathname+o.search+o.hash:o.href:null}function e3(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)e3(t)}}const k0=Symbol("node-seen");function B8(e,t,n){return t===$o.remove?{type:"remove"}:t===$o.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function U8(e,t,n){if(t===$o.remove)return{type:"remove"};if(t===$o.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const H8=(e,t,n,r,i,l,o,c,d)=>{const m=(p,g,y)=>{if(p.type!=="element"||p[k0])return lc;if(p.tagName==="a"){const E=c_(p.properties.href,t,e,!1,!1,i);if(E===null){if(p[k0]=!0,gs(p,m),y&&typeof g=="number"){const v=B8(p,c,o);if(v.type==="remove")return y.children.splice(g,1),[Mo,g];y.children[g]=v.element}return Mo}else return p.properties.href=E,p.properties.target="_blank",p.properties.rel="noopener noreferrer",lc}if(p.tagName==="img"){const E=c_(p.properties.src,n,e,r,!0,i);if(E===null){if(p[k0]=!0,gs(p,m),y&&typeof g=="number"){const v=U8(p,d,l);if(v.type==="remove")return y.children.splice(g,1),[Mo,g];y.children[g]=v.element}return Mo}else return p.properties.src=E,lc}return lc};return m},t3=-1,jh=0,mc=1,lh=2,A1=3,R1=4,L1=5,I1=6,n3=7,r3=8,d_=typeof self=="object"?self:globalThis,z8=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=t[i];switch(l){case jh:case t3:return n(o,i);case mc:{const c=n([],i);for(const d of o)c.push(r(d));return c}case lh:{const c=n({},i);for(const[d,m]of o)c[r(d)]=r(m);return c}case A1:return n(new Date(o),i);case R1:{const{source:c,flags:d}=o;return n(new RegExp(c,d),i)}case L1:{const c=n(new Map,i);for(const[d,m]of o)c.set(r(d),r(m));return c}case I1:{const c=n(new Set,i);for(const d of o)c.add(r(d));return c}case n3:{const{name:c,message:d}=o;return n(new d_[c](d),i)}case r3:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new d_[l](o),i)};return r},f_=e=>z8(new Map,e)(0),So="",{toString:F8}={},{keys:$8}=Object,Xu=e=>{const t=typeof e;if(t!=="object"||!e)return[jh,t];const n=F8.call(e).slice(8,-1);switch(n){case"Array":return[mc,So];case"Object":return[lh,So];case"Date":return[A1,So];case"RegExp":return[R1,So];case"Map":return[L1,So];case"Set":return[I1,So];case"DataView":return[mc,n]}return n.includes("Array")?[mc,n]:n.includes("Error")?[n3,n]:[lh,n]},xf=([e,t])=>e===jh&&(t==="function"||t==="symbol"),V8=(e,t,n,r)=>{const i=(o,c)=>{const d=r.push(o)-1;return n.set(c,d),d},l=o=>{if(n.has(o))return n.get(o);let[c,d]=Xu(o);switch(c){case jh:{let p=o;switch(d){case"bigint":c=r3,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([t3],o)}return i([c,p],o)}case mc:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],g=i([c,p],o);for(const y of o)p.push(l(y));return g}case lh:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const p=[],g=i([c,p],o);for(const y of $8(o))(e||!xf(Xu(o[y])))&&p.push([l(y),l(o[y])]);return g}case A1:return i([c,o.toISOString()],o);case R1:{const{source:p,flags:g}=o;return i([c,{source:p,flags:g}],o)}case L1:{const p=[],g=i([c,p],o);for(const[y,E]of o)(e||!(xf(Xu(y))||xf(Xu(E))))&&p.push([l(y),l(E)]);return g}case I1:{const p=[],g=i([c,p],o);for(const y of o)(e||!xf(Xu(y)))&&p.push(l(y));return g}}const{message:m}=o;return i([c,{name:d,message:m}],o)};return l},h_=(e,{json:t,lossy:n}={})=>{const r=[];return V8(!(t||n),!!t,new Map,r)(e),r},Bl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?f_(h_(e,t)):structuredClone(e):(e,t)=>f_(h_(e,t));const m_=/[#.]/g;function G8(e,t){const n=e||"",r={};let i=0,l,o;for(;i<n.length;){m_.lastIndex=i;const c=m_.exec(n),d=n.slice(i,c?c.index:n.length);d&&(l?l==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:o=d,i+=d.length),c&&(l=c[0],i++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function a3(e,t,n){const r=n?Q8(n):void 0;function i(l,o,...c){let d;if(l==null){d={type:"root",children:[]};const m=o;c.unshift(m)}else{d=G8(l,t);const m=d.tagName.toLowerCase(),p=r?r.get(m):void 0;if(d.tagName=p||m,q8(o))c.unshift(o);else for(const[g,y]of Object.entries(o))Y8(e,d.properties,g,y)}for(const m of c)Tg(d.children,m);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return i}function q8(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const l=i;for(const o of l)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Y8(e,t,n,r){const i=Hc(e,n);let l;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;l=r}else typeof r=="boolean"?l=r:typeof r=="string"?i.spaceSeparated?l=I2(r):i.commaSeparated?l=L2(r):i.commaOrSpaceSeparated?l=I2(L2(r).join(" ")):l=p_(i,i.property,r):Array.isArray(r)?l=[...r]:l=i.property==="style"?W8(r):String(r);if(Array.isArray(l)){const o=[];for(const c of l)o.push(p_(i,i.property,c));l=o}i.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[i.property]=l}}function Tg(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Tg(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Tg(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function p_(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Nc(n)===Nc(t)))return!0}return n}function W8(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Q8(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const X8=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],K8=a3(Ko,"div"),Z8=a3(xs,"g",X8);function J8(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(l){if(typeof l=="number"&&l>-1&&l<=t.length){let o=0;for(;;){let c=n[o];if(c===void 0){const d=g_(t,n[o-1]);c=d===-1?t.length+1:d+1,n[o]=c}if(c>l)return{line:o+1,column:l-(o>0?n[o-1]:0)+1,offset:l};o++}}}function i(l){if(l&&typeof l.line=="number"&&typeof l.column=="number"&&!Number.isNaN(l.line)&&!Number.isNaN(l.column)){for(;n.length<l.line;){const c=n[n.length-1],d=g_(t,c),m=d===-1?t.length+1:d+1;if(c===m)break;n.push(m)}const o=(l.line>1?n[l.line-2]:0)+l.column-1;if(o<n[l.line-1])return o}}}function g_(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
244
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Ol={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},s3={}.hasOwnProperty,eD=Object.prototype;function tD(e,t){const n=t||{};return O1({file:n.file||void 0,location:!1,schema:n.space==="svg"?xs:Ko,verbose:n.verbose||!1},e)}function O1(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},$f(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:i3(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const l=String(e.file),o=J8(l),c=o.toPoint(0),d=o.toPoint(l.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},$f(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},$f(e,r,n),n}default:return n=nD(e,t),n}}function i3(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=O1(e,t[n]);r.push(i)}return r}function nD(e,t){const n=e.schema;e.schema=t.namespaceURI===Ol.svg?xs:Ko;let r=-1;const i={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;s3.call(eD,d)||(i[d]=c.value)}const o=(e.schema.space==="svg"?Z8:K8)(t.tagName,i,i3(e,t.childNodes));if($f(e,t,o),o.tagName==="template"){const c=t,d=c.sourceCodeLocation,m=d&&d.startTag&&Po(d.startTag),p=d&&d.endTag&&Po(d.endTag),g=O1(e,c.content);m&&p&&e.file&&(g.position={start:m.end,end:p.start}),o.content=g}return e.schema=n,o}function $f(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=rD(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function rD(e,t,n){const r=Po(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const l={};let o;if(n.attrs)for(o in n.attrs)s3.call(n.attrs,o)&&(l[Hc(e.schema,o).property]=Po(n.attrs[o]));n.startTag;const c=Po(n.startTag),d=n.endTag?Po(n.endTag):void 0,m={opening:c};d&&(m.closing=d),m.properties=l,t.data={position:m}}}return r}function Po(e){const t=b_({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=b_({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function b_(e){return e.line&&e.column?e:void 0}const aD={},sD={}.hasOwnProperty,l3=d1("type",{handlers:{root:lD,element:fD,text:cD,comment:dD,doctype:uD}});function iD(e,t){const r=(t||aD).space;return l3(e,r==="svg"?xs:Ko)}function lD(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=D1(e.children,n,t),tu(e,n),n}function oD(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=D1(e.children,n,t),tu(e,n),n}function uD(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return tu(e,t),t}function cD(e){const t={nodeName:"#text",value:e.value,parentNode:null};return tu(e,t),t}function dD(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return tu(e,t),t}function fD(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=xs);const i=[];let l;if(e.properties){for(l in e.properties)if(l!=="children"&&sD.call(e.properties,l)){const d=hD(r,l,e.properties[l]);d&&i.push(d)}}const o=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Ol[o],childNodes:[],parentNode:null};return c.childNodes=D1(e.children,c,r),tu(e,c),e.tagName==="template"&&e.content&&(c.content=oD(e.content,r)),c}function hD(e,t,n){const r=Hc(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?f1(n):h1(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const l=i.name.indexOf(":");l<0?i.prefix="":(i.name=i.name.slice(l+1),i.prefix=r.attribute.slice(0,l)),i.namespace=Ol[r.space]}return i}function D1(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const l=l3(e[r],n);l.parentNode=t,i.push(l)}return i}function tu(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const mD=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Sn="�";var j;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(j||(j={}));const Fr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function o3(e){return e>=55296&&e<=57343}function pD(e){return e>=56320&&e<=57343}function gD(e,t){return(e-55296)*1024+9216+t}function u3(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function c3(e){return e>=64976&&e<=65007||mD.has(e)}var me;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(me||(me={}));const bD=65536;class xD{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=bD,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:l}=this,o=i+n,c=l+n;return{code:t,startLine:r,endLine:r,startCol:o,endCol:o,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(pD(n))return this.pos++,this._addGap(),gD(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,j.EOF;return this._err(me.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,j.EOF;const r=this.html.charCodeAt(n);return r===j.CARRIAGE_RETURN?j.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,j.EOF;let t=this.html.charCodeAt(this.pos);return t===j.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,j.LINE_FEED):t===j.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,o3(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===j.LINE_FEED||t===j.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){u3(t)?this._err(me.controlCharacterInInputStream):c3(t)&&this._err(me.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var At;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(At||(At={}));function d3(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const yD=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ED=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function _D(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ED.get(e))!==null&&t!==void 0?t:e}var lr;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(lr||(lr={}));const TD=32;var $i;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})($i||($i={}));function vg(e){return e>=lr.ZERO&&e<=lr.NINE}function vD(e){return e>=lr.UPPER_A&&e<=lr.UPPER_F||e>=lr.LOWER_A&&e<=lr.LOWER_F}function kD(e){return e>=lr.UPPER_A&&e<=lr.UPPER_Z||e>=lr.LOWER_A&&e<=lr.LOWER_Z||vg(e)}function wD(e){return e===lr.EQUALS||kD(e)}var ar;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ar||(ar={}));var Qs;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Qs||(Qs={}));class CD{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=ar.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Qs.Strict}startEntity(t){this.decodeMode=t,this.state=ar.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case ar.EntityStart:return t.charCodeAt(n)===lr.NUM?(this.state=ar.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ar.NamedEntity,this.stateNamedEntity(t,n));case ar.NumericStart:return this.stateNumericStart(t,n);case ar.NumericDecimal:return this.stateNumericDecimal(t,n);case ar.NumericHex:return this.stateNumericHex(t,n);case ar.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|TD)===lr.LOWER_X?(this.state=ar.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ar.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const l=r-n;this.result=this.result*Math.pow(i,l)+Number.parseInt(t.substr(n,l),i),this.consumed+=l}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(vg(i)||vD(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(vg(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===lr.SEMI)this.consumed+=1;else if(this.decodeMode===Qs.Strict)return 0;return this.emitCodePoint(_D(this.result),this.consumed),this.errors&&(t!==lr.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],l=(i&$i.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=SD(r,i,this.treeIndex+Math.max(1,l),o),this.treeIndex<0)return this.result===0||this.decodeMode===Qs.Attribute&&(l===0||wD(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],l=(i&$i.VALUE_LENGTH)>>14,l!==0){if(o===lr.SEMI)return this.emitNamedEntityData(this.treeIndex,l,this.consumed+this.excess);this.decodeMode!==Qs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&$i.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~$i.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case ar.NamedEntity:return this.result!==0&&(this.decodeMode!==Qs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ar.NumericDecimal:return this.emitNumericEntity(0,2);case ar.NumericHex:return this.emitNumericEntity(0,3);case ar.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ar.EntityStart:return 0}}}function SD(e,t,n,r){const i=(t&$i.BRANCH_LENGTH)>>7,l=t&$i.JUMP_TABLE;if(i===0)return l!==0&&r===l?n:-1;if(l){const d=r-l;return d<0||d>=i?-1:e[n+d]-1}let o=n,c=o+i-1;for(;o<=c;){const d=o+c>>>1,m=e[d];if(m<r)o=d+1;else if(m>r)c=d-1;else return e[d+i]}return-1}var ve;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(ve||(ve={}));var Ml;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ml||(Ml={}));var wa;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(wa||(wa={}));var te;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(te||(te={}));var _;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(_||(_={}));const ND=new Map([[te.A,_.A],[te.ADDRESS,_.ADDRESS],[te.ANNOTATION_XML,_.ANNOTATION_XML],[te.APPLET,_.APPLET],[te.AREA,_.AREA],[te.ARTICLE,_.ARTICLE],[te.ASIDE,_.ASIDE],[te.B,_.B],[te.BASE,_.BASE],[te.BASEFONT,_.BASEFONT],[te.BGSOUND,_.BGSOUND],[te.BIG,_.BIG],[te.BLOCKQUOTE,_.BLOCKQUOTE],[te.BODY,_.BODY],[te.BR,_.BR],[te.BUTTON,_.BUTTON],[te.CAPTION,_.CAPTION],[te.CENTER,_.CENTER],[te.CODE,_.CODE],[te.COL,_.COL],[te.COLGROUP,_.COLGROUP],[te.DD,_.DD],[te.DESC,_.DESC],[te.DETAILS,_.DETAILS],[te.DIALOG,_.DIALOG],[te.DIR,_.DIR],[te.DIV,_.DIV],[te.DL,_.DL],[te.DT,_.DT],[te.EM,_.EM],[te.EMBED,_.EMBED],[te.FIELDSET,_.FIELDSET],[te.FIGCAPTION,_.FIGCAPTION],[te.FIGURE,_.FIGURE],[te.FONT,_.FONT],[te.FOOTER,_.FOOTER],[te.FOREIGN_OBJECT,_.FOREIGN_OBJECT],[te.FORM,_.FORM],[te.FRAME,_.FRAME],[te.FRAMESET,_.FRAMESET],[te.H1,_.H1],[te.H2,_.H2],[te.H3,_.H3],[te.H4,_.H4],[te.H5,_.H5],[te.H6,_.H6],[te.HEAD,_.HEAD],[te.HEADER,_.HEADER],[te.HGROUP,_.HGROUP],[te.HR,_.HR],[te.HTML,_.HTML],[te.I,_.I],[te.IMG,_.IMG],[te.IMAGE,_.IMAGE],[te.INPUT,_.INPUT],[te.IFRAME,_.IFRAME],[te.KEYGEN,_.KEYGEN],[te.LABEL,_.LABEL],[te.LI,_.LI],[te.LINK,_.LINK],[te.LISTING,_.LISTING],[te.MAIN,_.MAIN],[te.MALIGNMARK,_.MALIGNMARK],[te.MARQUEE,_.MARQUEE],[te.MATH,_.MATH],[te.MENU,_.MENU],[te.META,_.META],[te.MGLYPH,_.MGLYPH],[te.MI,_.MI],[te.MO,_.MO],[te.MN,_.MN],[te.MS,_.MS],[te.MTEXT,_.MTEXT],[te.NAV,_.NAV],[te.NOBR,_.NOBR],[te.NOFRAMES,_.NOFRAMES],[te.NOEMBED,_.NOEMBED],[te.NOSCRIPT,_.NOSCRIPT],[te.OBJECT,_.OBJECT],[te.OL,_.OL],[te.OPTGROUP,_.OPTGROUP],[te.OPTION,_.OPTION],[te.P,_.P],[te.PARAM,_.PARAM],[te.PLAINTEXT,_.PLAINTEXT],[te.PRE,_.PRE],[te.RB,_.RB],[te.RP,_.RP],[te.RT,_.RT],[te.RTC,_.RTC],[te.RUBY,_.RUBY],[te.S,_.S],[te.SCRIPT,_.SCRIPT],[te.SEARCH,_.SEARCH],[te.SECTION,_.SECTION],[te.SELECT,_.SELECT],[te.SOURCE,_.SOURCE],[te.SMALL,_.SMALL],[te.SPAN,_.SPAN],[te.STRIKE,_.STRIKE],[te.STRONG,_.STRONG],[te.STYLE,_.STYLE],[te.SUB,_.SUB],[te.SUMMARY,_.SUMMARY],[te.SUP,_.SUP],[te.TABLE,_.TABLE],[te.TBODY,_.TBODY],[te.TEMPLATE,_.TEMPLATE],[te.TEXTAREA,_.TEXTAREA],[te.TFOOT,_.TFOOT],[te.TD,_.TD],[te.TH,_.TH],[te.THEAD,_.THEAD],[te.TITLE,_.TITLE],[te.TR,_.TR],[te.TRACK,_.TRACK],[te.TT,_.TT],[te.U,_.U],[te.UL,_.UL],[te.SVG,_.SVG],[te.VAR,_.VAR],[te.WBR,_.WBR],[te.XMP,_.XMP]]);function nu(e){var t;return(t=ND.get(e))!==null&&t!==void 0?t:_.UNKNOWN}const Ne=_,AD={[ve.HTML]:new Set([Ne.ADDRESS,Ne.APPLET,Ne.AREA,Ne.ARTICLE,Ne.ASIDE,Ne.BASE,Ne.BASEFONT,Ne.BGSOUND,Ne.BLOCKQUOTE,Ne.BODY,Ne.BR,Ne.BUTTON,Ne.CAPTION,Ne.CENTER,Ne.COL,Ne.COLGROUP,Ne.DD,Ne.DETAILS,Ne.DIR,Ne.DIV,Ne.DL,Ne.DT,Ne.EMBED,Ne.FIELDSET,Ne.FIGCAPTION,Ne.FIGURE,Ne.FOOTER,Ne.FORM,Ne.FRAME,Ne.FRAMESET,Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6,Ne.HEAD,Ne.HEADER,Ne.HGROUP,Ne.HR,Ne.HTML,Ne.IFRAME,Ne.IMG,Ne.INPUT,Ne.LI,Ne.LINK,Ne.LISTING,Ne.MAIN,Ne.MARQUEE,Ne.MENU,Ne.META,Ne.NAV,Ne.NOEMBED,Ne.NOFRAMES,Ne.NOSCRIPT,Ne.OBJECT,Ne.OL,Ne.P,Ne.PARAM,Ne.PLAINTEXT,Ne.PRE,Ne.SCRIPT,Ne.SECTION,Ne.SELECT,Ne.SOURCE,Ne.STYLE,Ne.SUMMARY,Ne.TABLE,Ne.TBODY,Ne.TD,Ne.TEMPLATE,Ne.TEXTAREA,Ne.TFOOT,Ne.TH,Ne.THEAD,Ne.TITLE,Ne.TR,Ne.TRACK,Ne.UL,Ne.WBR,Ne.XMP]),[ve.MATHML]:new Set([Ne.MI,Ne.MO,Ne.MN,Ne.MS,Ne.MTEXT,Ne.ANNOTATION_XML]),[ve.SVG]:new Set([Ne.TITLE,Ne.FOREIGN_OBJECT,Ne.DESC]),[ve.XLINK]:new Set,[ve.XML]:new Set,[ve.XMLNS]:new Set},kg=new Set([Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6]);te.STYLE,te.SCRIPT,te.XMP,te.IFRAME,te.NOEMBED,te.NOFRAMES,te.PLAINTEXT;var B;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(B||(B={}));const Un={DATA:B.DATA,RCDATA:B.RCDATA,RAWTEXT:B.RAWTEXT,SCRIPT_DATA:B.SCRIPT_DATA,PLAINTEXT:B.PLAINTEXT,CDATA_SECTION:B.CDATA_SECTION};function RD(e){return e>=j.DIGIT_0&&e<=j.DIGIT_9}function oc(e){return e>=j.LATIN_CAPITAL_A&&e<=j.LATIN_CAPITAL_Z}function LD(e){return e>=j.LATIN_SMALL_A&&e<=j.LATIN_SMALL_Z}function Bi(e){return LD(e)||oc(e)}function x_(e){return Bi(e)||RD(e)}function yf(e){return e+32}function f3(e){return e===j.SPACE||e===j.LINE_FEED||e===j.TABULATION||e===j.FORM_FEED}function y_(e){return f3(e)||e===j.SOLIDUS||e===j.GREATER_THAN_SIGN}function ID(e){return e===j.NULL?me.nullCharacterReference:e>1114111?me.characterReferenceOutsideUnicodeRange:o3(e)?me.surrogateCharacterReference:c3(e)?me.noncharacterCharacterReference:u3(e)||e===j.CARRIAGE_RETURN?me.controlCharacterReference:null}class OD{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=B.DATA,this.returnState=B.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new xD(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new CD(yD,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(me.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(me.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=ID(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:At.START_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:At.END_TAG,tagName:"",tagID:_.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:At.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:At.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(d3(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(me.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=nu(t.tagName),t.type===At.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(me.endTagWithAttributes),t.selfClosing&&this._err(me.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case At.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case At.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case At.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:At.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=f3(t)?At.WHITESPACE_CHARACTER:t===j.NULL?At.NULL_CHARACTER:At.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(At.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=B.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Qs.Attribute:Qs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===B.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case B.DATA:{this._stateData(t);break}case B.RCDATA:{this._stateRcdata(t);break}case B.RAWTEXT:{this._stateRawtext(t);break}case B.SCRIPT_DATA:{this._stateScriptData(t);break}case B.PLAINTEXT:{this._statePlaintext(t);break}case B.TAG_OPEN:{this._stateTagOpen(t);break}case B.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case B.TAG_NAME:{this._stateTagName(t);break}case B.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case B.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case B.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case B.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case B.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case B.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case B.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case B.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case B.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case B.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case B.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case B.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case B.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case B.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case B.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case B.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case B.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case B.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case B.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case B.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case B.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case B.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case B.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case B.BOGUS_COMMENT:{this._stateBogusComment(t);break}case B.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case B.COMMENT_START:{this._stateCommentStart(t);break}case B.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case B.COMMENT:{this._stateComment(t);break}case B.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case B.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case B.COMMENT_END:{this._stateCommentEnd(t);break}case B.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case B.DOCTYPE:{this._stateDoctype(t);break}case B.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case B.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case B.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case B.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case B.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case B.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case B.CDATA_SECTION:{this._stateCdataSection(t);break}case B.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case B.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case B.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case B.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case j.LESS_THAN_SIGN:{this.state=B.TAG_OPEN;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(me.unexpectedNullCharacter),this._emitCodePoint(t);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case j.AMPERSAND:{this._startCharacterReference();break}case j.LESS_THAN_SIGN:{this.state=B.RCDATA_LESS_THAN_SIGN;break}case j.NULL:{this._err(me.unexpectedNullCharacter),this._emitChars(Sn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case j.LESS_THAN_SIGN:{this.state=B.RAWTEXT_LESS_THAN_SIGN;break}case j.NULL:{this._err(me.unexpectedNullCharacter),this._emitChars(Sn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_LESS_THAN_SIGN;break}case j.NULL:{this._err(me.unexpectedNullCharacter),this._emitChars(Sn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case j.NULL:{this._err(me.unexpectedNullCharacter),this._emitChars(Sn);break}case j.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Bi(t))this._createStartTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case j.EXCLAMATION_MARK:{this.state=B.MARKUP_DECLARATION_OPEN;break}case j.SOLIDUS:{this.state=B.END_TAG_OPEN;break}case j.QUESTION_MARK:{this._err(me.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t);break}case j.EOF:{this._err(me.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(me.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=B.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Bi(t))this._createEndTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case j.GREATER_THAN_SIGN:{this._err(me.missingEndTagName),this.state=B.DATA;break}case j.EOF:{this._err(me.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(me.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_ATTRIBUTE_NAME;break}case j.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case j.NULL:{this._err(me.unexpectedNullCharacter),n.tagName+=Sn;break}case j.EOF:{this._err(me.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(oc(t)?yf(t):t)}}_stateRcdataLessThanSign(t){t===j.SOLIDUS?this.state=B.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=B.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Bi(t)?(this.state=B.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=B.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=B.BEFORE_ATTRIBUTE_NAME,!1;case j.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=B.SELF_CLOSING_START_TAG,!1;case j.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=B.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===j.SOLIDUS?this.state=B.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Bi(t)?(this.state=B.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case j.SOLIDUS:{this.state=B.SCRIPT_DATA_END_TAG_OPEN;break}case j.EXCLAMATION_MARK:{this.state=B.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=B.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Bi(t)?(this.state=B.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===j.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===j.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.NULL:{this._err(me.unexpectedNullCharacter),this._emitChars(Sn);break}case j.EOF:{this._err(me.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.NULL:{this._err(me.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(Sn);break}case j.EOF:{this._err(me.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case j.HYPHEN_MINUS:{this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case j.GREATER_THAN_SIGN:{this.state=B.SCRIPT_DATA,this._emitChars(">");break}case j.NULL:{this._err(me.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(Sn);break}case j.EOF:{this._err(me.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===j.SOLIDUS?this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Bi(t)?(this._emitChars("<"),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Bi(t)?(this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Fr.SCRIPT,!1)&&y_(this.preprocessor.peek(Fr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Fr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.NULL:{this._err(me.unexpectedNullCharacter),this._emitChars(Sn);break}case j.EOF:{this._err(me.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.NULL:{this._err(me.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Sn);break}case j.EOF:{this._err(me.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case j.HYPHEN_MINUS:{this._emitChars("-");break}case j.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case j.GREATER_THAN_SIGN:{this.state=B.SCRIPT_DATA,this._emitChars(">");break}case j.NULL:{this._err(me.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Sn);break}case j.EOF:{this._err(me.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===j.SOLIDUS?(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Fr.SCRIPT,!1)&&y_(this.preprocessor.peek(Fr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Fr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.SOLIDUS:case j.GREATER_THAN_SIGN:case j.EOF:{this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case j.EQUALS_SIGN:{this._err(me.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=B.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:case j.SOLIDUS:case j.GREATER_THAN_SIGN:case j.EOF:{this._leaveAttrName(),this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case j.EQUALS_SIGN:{this._leaveAttrName(),this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case j.QUOTATION_MARK:case j.APOSTROPHE:case j.LESS_THAN_SIGN:{this._err(me.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case j.NULL:{this._err(me.unexpectedNullCharacter),this.currentAttr.name+=Sn;break}default:this.currentAttr.name+=String.fromCodePoint(oc(t)?yf(t):t)}}_stateAfterAttributeName(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case j.EQUALS_SIGN:{this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(me.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{this.state=B.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this.state=B.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(me.missingAttributeValue),this.state=B.DATA,this.emitCurrentTagToken();break}default:this.state=B.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case j.QUOTATION_MARK:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(me.unexpectedNullCharacter),this.currentAttr.value+=Sn;break}case j.EOF:{this._err(me.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case j.APOSTROPHE:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.NULL:{this._err(me.unexpectedNullCharacter),this.currentAttr.value+=Sn;break}case j.EOF:{this._err(me.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case j.AMPERSAND:{this._startCharacterReference();break}case j.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case j.NULL:{this._err(me.unexpectedNullCharacter),this.currentAttr.value+=Sn;break}case j.QUOTATION_MARK:case j.APOSTROPHE:case j.LESS_THAN_SIGN:case j.EQUALS_SIGN:case j.GRAVE_ACCENT:{this._err(me.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case j.EOF:{this._err(me.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case j.SOLIDUS:{this._leaveAttrValue(),this.state=B.SELF_CLOSING_START_TAG;break}case j.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(me.eofInTag),this._emitEOFToken();break}default:this._err(me.missingWhitespaceBetweenAttributes),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case j.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=B.DATA,this.emitCurrentTagToken();break}case j.EOF:{this._err(me.eofInTag),this._emitEOFToken();break}default:this._err(me.unexpectedSolidusInTag),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case j.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case j.NULL:{this._err(me.unexpectedNullCharacter),n.data+=Sn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Fr.DASH_DASH,!0)?(this._createCommentToken(Fr.DASH_DASH.length+1),this.state=B.COMMENT_START):this._consumeSequenceIfMatch(Fr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Fr.DOCTYPE.length+1),this.state=B.DOCTYPE):this._consumeSequenceIfMatch(Fr.CDATA_START,!0)?this.inForeignNode?this.state=B.CDATA_SECTION:(this._err(me.cdataInHtmlContent),this._createCommentToken(Fr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=B.BOGUS_COMMENT):this._ensureHibernation()||(this._err(me.incorrectlyOpenedComment),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_START_DASH;break}case j.GREATER_THAN_SIGN:{this._err(me.abruptClosingOfEmptyComment),this.state=B.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case j.GREATER_THAN_SIGN:{this._err(me.abruptClosingOfEmptyComment),this.state=B.DATA,this.emitCurrentComment(n);break}case j.EOF:{this._err(me.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_END_DASH;break}case j.LESS_THAN_SIGN:{n.data+="<",this.state=B.COMMENT_LESS_THAN_SIGN;break}case j.NULL:{this._err(me.unexpectedNullCharacter),n.data+=Sn;break}case j.EOF:{this._err(me.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case j.EXCLAMATION_MARK:{n.data+="!",this.state=B.COMMENT_LESS_THAN_SIGN_BANG;break}case j.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===j.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=B.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===j.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=B.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==j.GREATER_THAN_SIGN&&t!==j.EOF&&this._err(me.nestedComment),this.state=B.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case j.EOF:{this._err(me.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case j.EXCLAMATION_MARK:{this.state=B.COMMENT_END_BANG;break}case j.HYPHEN_MINUS:{n.data+="-";break}case j.EOF:{this._err(me.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case j.HYPHEN_MINUS:{n.data+="--!",this.state=B.COMMENT_END_DASH;break}case j.GREATER_THAN_SIGN:{this._err(me.incorrectlyClosedComment),this.state=B.DATA,this.emitCurrentComment(n);break}case j.EOF:{this._err(me.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=B.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case j.EOF:{this._err(me.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(me.missingWhitespaceBeforeDoctypeName),this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(oc(t))this._createDoctypeToken(String.fromCharCode(yf(t))),this.state=B.DOCTYPE_NAME;else switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.NULL:{this._err(me.unexpectedNullCharacter),this._createDoctypeToken(Sn),this.state=B.DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this._err(me.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(me.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=B.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.AFTER_DOCTYPE_NAME;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.NULL:{this._err(me.unexpectedNullCharacter),n.name+=Sn;break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(oc(t)?yf(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Fr.PUBLIC,!1)?this.state=B.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Fr.SYSTEM,!1)?this.state=B.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(me.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.QUOTATION_MARK:{this._err(me.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(me.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(me.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(me.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(me.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(me.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case j.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.NULL:{this._err(me.unexpectedNullCharacter),n.publicId+=Sn;break}case j.GREATER_THAN_SIGN:{this._err(me.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case j.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case j.NULL:{this._err(me.unexpectedNullCharacter),n.publicId+=Sn;break}case j.GREATER_THAN_SIGN:{this._err(me.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case j.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.QUOTATION_MARK:{this._err(me.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(me.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(me.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(me.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.QUOTATION_MARK:{this._err(me.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{this._err(me.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(me.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(me.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case j.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case j.GREATER_THAN_SIGN:{this._err(me.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(me.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case j.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.NULL:{this._err(me.unexpectedNullCharacter),n.systemId+=Sn;break}case j.GREATER_THAN_SIGN:{this._err(me.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case j.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case j.NULL:{this._err(me.unexpectedNullCharacter),n.systemId+=Sn;break}case j.GREATER_THAN_SIGN:{this._err(me.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case j.SPACE:case j.LINE_FEED:case j.TABULATION:case j.FORM_FEED:break;case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.EOF:{this._err(me.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(me.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case j.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case j.NULL:{this._err(me.unexpectedNullCharacter);break}case j.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case j.RIGHT_SQUARE_BRACKET:{this.state=B.CDATA_SECTION_BRACKET;break}case j.EOF:{this._err(me.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===j.RIGHT_SQUARE_BRACKET?this.state=B.CDATA_SECTION_END:(this._emitChars("]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case j.GREATER_THAN_SIGN:{this.state=B.DATA;break}case j.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(j.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&x_(this.preprocessor.peek(1))?B.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){x_(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===j.SEMICOLON&&this._err(me.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const h3=new Set([_.DD,_.DT,_.LI,_.OPTGROUP,_.OPTION,_.P,_.RB,_.RP,_.RT,_.RTC]),E_=new Set([...h3,_.CAPTION,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]),oh=new Set([_.APPLET,_.CAPTION,_.HTML,_.MARQUEE,_.OBJECT,_.TABLE,_.TD,_.TEMPLATE,_.TH]),DD=new Set([...oh,_.OL,_.UL]),jD=new Set([...oh,_.BUTTON]),__=new Set([_.ANNOTATION_XML,_.MI,_.MN,_.MO,_.MS,_.MTEXT]),T_=new Set([_.DESC,_.FOREIGN_OBJECT,_.TITLE]),MD=new Set([_.TR,_.TEMPLATE,_.HTML]),PD=new Set([_.TBODY,_.TFOOT,_.THEAD,_.TEMPLATE,_.HTML]),BD=new Set([_.TABLE,_.TEMPLATE,_.HTML]),UD=new Set([_.TD,_.TH]);class HD{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=_.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===_.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ve.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==ve.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(kg,ve.HTML)}popUntilTableCellPopped(){this.popUntilPopped(UD,ve.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(BD,ve.HTML)}clearBackToTableBodyContext(){this.clearBackTo(PD,ve.HTML)}clearBackToTableRowContext(){this.clearBackTo(MD,ve.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===_.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===_.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ve.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case ve.SVG:{if(T_.has(i))return!1;break}case ve.MATHML:{if(__.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,oh)}hasInListItemScope(t){return this.hasInDynamicScope(t,DD)}hasInButtonScope(t){return this.hasInDynamicScope(t,jD)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ve.HTML:{if(kg.has(n))return!0;if(oh.has(n))return!1;break}case ve.SVG:{if(T_.has(n))return!1;break}case ve.MATHML:{if(__.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ve.HTML)switch(this.tagIDs[n]){case t:return!0;case _.TABLE:case _.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ve.HTML)switch(this.tagIDs[t]){case _.TBODY:case _.THEAD:case _.TFOOT:return!0;case _.TABLE:case _.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ve.HTML)switch(this.tagIDs[n]){case t:return!0;case _.OPTION:case _.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&h3.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&E_.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&E_.has(this.currentTagId);)this.pop()}}const w0=3;var ms;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ms||(ms={}));const v_={type:ms.Marker};class zD{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,l=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===ms.Marker)break;const{element:m}=d;if(this.treeAdapter.getTagName(m)===l&&this.treeAdapter.getNamespaceURI(m)===o){const p=this.treeAdapter.getAttrList(m);p.length===i&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<w0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<w0)return;const i=new Map(n.map(o=>[o.name,o.value]));let l=0;for(let o=0;o<r.length;o++){const c=r[o];c.attrs.every(d=>i.get(d.name)===d.value)&&(l+=1,l>=w0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(v_)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ms.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ms.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(v_);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===ms.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ms.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ms.Element&&n.element===t)}}const Ui={createDocument(){return{nodeName:"#document",mode:wa.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(l=>l.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const l={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ui.appendChild(e,l)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Ui.isTextNode(n)){n.value+=t;return}}Ui.appendChild(e,Ui.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ui.isTextNode(r)?r.value+=t:Ui.insertBefore(e,Ui.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},m3="html",FD="about:legacy-compat",$D="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",p3=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],VD=[...p3,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],GD=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),g3=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],qD=[...g3,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function k_(e,t){return t.some(n=>e.startsWith(n))}function YD(e){return e.name===m3&&e.publicId===null&&(e.systemId===null||e.systemId===FD)}function WD(e){if(e.name!==m3)return wa.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===$D)return wa.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),GD.has(n))return wa.QUIRKS;let r=t===null?VD:p3;if(k_(n,r))return wa.QUIRKS;if(r=t===null?g3:qD,k_(n,r))return wa.LIMITED_QUIRKS}return wa.NO_QUIRKS}const w_={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},QD="definitionurl",XD="definitionURL",KD=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),ZD=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ve.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ve.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ve.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ve.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ve.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ve.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ve.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ve.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ve.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ve.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ve.XMLNS}]]),JD=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),ej=new Set([_.B,_.BIG,_.BLOCKQUOTE,_.BODY,_.BR,_.CENTER,_.CODE,_.DD,_.DIV,_.DL,_.DT,_.EM,_.EMBED,_.H1,_.H2,_.H3,_.H4,_.H5,_.H6,_.HEAD,_.HR,_.I,_.IMG,_.LI,_.LISTING,_.MENU,_.META,_.NOBR,_.OL,_.P,_.PRE,_.RUBY,_.S,_.SMALL,_.SPAN,_.STRONG,_.STRIKE,_.SUB,_.SUP,_.TABLE,_.TT,_.U,_.UL,_.VAR]);function tj(e){const t=e.tagID;return t===_.FONT&&e.attrs.some(({name:r})=>r===Ml.COLOR||r===Ml.SIZE||r===Ml.FACE)||ej.has(t)}function b3(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===QD){e.attrs[t].name=XD;break}}function x3(e){for(let t=0;t<e.attrs.length;t++){const n=KD.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function j1(e){for(let t=0;t<e.attrs.length;t++){const n=ZD.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function nj(e){const t=JD.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=nu(e.tagName))}function rj(e,t){return t===ve.MATHML&&(e===_.MI||e===_.MO||e===_.MN||e===_.MS||e===_.MTEXT)}function aj(e,t,n){if(t===ve.MATHML&&e===_.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ml.ENCODING){const i=n[r].value.toLowerCase();return i===w_.TEXT_HTML||i===w_.APPLICATION_XML}}return t===ve.SVG&&(e===_.FOREIGN_OBJECT||e===_.DESC||e===_.TITLE)}function sj(e,t,n,r){return(!r||r===ve.HTML)&&aj(e,t,n)||(!r||r===ve.MATHML)&&rj(e,t)}const ij="hidden",lj=8,oj=3;var G;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(G||(G={}));const uj={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},y3=new Set([_.TABLE,_.TBODY,_.TFOOT,_.THEAD,_.TR]),C_={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ui,onParseError:null};class S_{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=G.INITIAL,this.originalInsertionMode=G.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...C_,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new OD(this.options,this),this.activeFormattingElements=new zD(this.treeAdapter),this.fragmentContextID=r?nu(this.treeAdapter.getTagName(r)):_.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new HD(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...C_,...n};t??(t=r.treeAdapter.createElement(te.TEMPLATE,ve.HTML,[]));const i=r.treeAdapter.createElement("documentmock",ve.HTML,[]),l=new this(r,i,t);return l.fragmentContextID===_.TEMPLATE&&l.tmplInsertionModeStack.unshift(G.IN_TEMPLATE),l._initTokenizerForFragmentParsing(),l._insertFakeRootElement(),l._resetInsertionMode(),l._findFormInFragmentContext(),l}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const l=(i=t.location)!==null&&i!==void 0?i:uj,o={code:n,startLine:l.startLine,startCol:l.startCol,startOffset:l.startOffset,endLine:r?l.startLine:l.endLine,endCol:r?l.startCol:l.endCol,endOffset:r?l.startOffset:l.endOffset};this.onParseError(o)}onItemPush(t,n,r){var i,l;(l=(i=this.treeAdapter).onItemPush)===null||l===void 0||l.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let l,o;this.openElements.stackTop===0&&this.fragmentContext?(l=this.fragmentContext,o=this.fragmentContextID):{current:l,currentTagId:o}=this.openElements,this._setContextModes(l,o)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ve.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ve.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=G.TEXT}switchToPlaintextParsing(){this.insertionMode=G.TEXT,this.originalInsertionMode=G.IN_BODY,this.tokenizer.state=Un.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===te.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ve.HTML))switch(this.fragmentContextID){case _.TITLE:case _.TEXTAREA:{this.tokenizer.state=Un.RCDATA;break}case _.STYLE:case _.XMP:case _.IFRAME:case _.NOEMBED:case _.NOFRAMES:case _.NOSCRIPT:{this.tokenizer.state=Un.RAWTEXT;break}case _.SCRIPT:{this.tokenizer.state=Un.SCRIPT_DATA;break}case _.PLAINTEXT:{this.tokenizer.state=Un.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ve.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ve.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(te.HTML,ve.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,_.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),l=r?i.lastIndexOf(r):i.length,o=i[l-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:d,endCol:m,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:d,endCol:m,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),l=n.type===At.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,l)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===_.SVG&&this.treeAdapter.getTagName(n)===te.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ve.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===_.MGLYPH||t.tagID===_.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ve.HTML)}_processToken(t){switch(t.type){case At.CHARACTER:{this.onCharacter(t);break}case At.NULL_CHARACTER:{this.onNullCharacter(t);break}case At.COMMENT:{this.onComment(t);break}case At.DOCTYPE:{this.onDoctype(t);break}case At.START_TAG:{this._processStartTag(t);break}case At.END_TAG:{this.onEndTag(t);break}case At.EOF:{this.onEof(t);break}case At.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),l=this.treeAdapter.getAttrList(n);return sj(t,i,l,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ms.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const l=this.activeFormattingElements.entries[i];this._insertElement(l.token,this.treeAdapter.getNamespaceURI(l.element)),l.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=G.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(_.P),this.openElements.popUntilTagNamePopped(_.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case _.TR:{this.insertionMode=G.IN_ROW;return}case _.TBODY:case _.THEAD:case _.TFOOT:{this.insertionMode=G.IN_TABLE_BODY;return}case _.CAPTION:{this.insertionMode=G.IN_CAPTION;return}case _.COLGROUP:{this.insertionMode=G.IN_COLUMN_GROUP;return}case _.TABLE:{this.insertionMode=G.IN_TABLE;return}case _.BODY:{this.insertionMode=G.IN_BODY;return}case _.FRAMESET:{this.insertionMode=G.IN_FRAMESET;return}case _.SELECT:{this._resetInsertionModeForSelect(t);return}case _.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case _.HTML:{this.insertionMode=this.headElement?G.AFTER_HEAD:G.BEFORE_HEAD;return}case _.TD:case _.TH:{if(t>0){this.insertionMode=G.IN_CELL;return}break}case _.HEAD:{if(t>0){this.insertionMode=G.IN_HEAD;return}break}}this.insertionMode=G.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===_.TEMPLATE)break;if(r===_.TABLE){this.insertionMode=G.IN_SELECT_IN_TABLE;return}}this.insertionMode=G.IN_SELECT}_isElementCausesFosterParenting(t){return y3.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case _.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ve.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case _.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return AD[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){U9(this,t);return}switch(this.insertionMode){case G.INITIAL:{Ku(this,t);break}case G.BEFORE_HTML:{pc(this,t);break}case G.BEFORE_HEAD:{gc(this,t);break}case G.IN_HEAD:{bc(this,t);break}case G.IN_HEAD_NO_SCRIPT:{xc(this,t);break}case G.AFTER_HEAD:{yc(this,t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:{_3(this,t);break}case G.TEXT:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{C0(this,t);break}case G.IN_TABLE_TEXT:{S3(this,t);break}case G.IN_COLUMN_GROUP:{uh(this,t);break}case G.AFTER_BODY:{ch(this,t);break}case G.AFTER_AFTER_BODY:{Vf(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){B9(this,t);return}switch(this.insertionMode){case G.INITIAL:{Ku(this,t);break}case G.BEFORE_HTML:{pc(this,t);break}case G.BEFORE_HEAD:{gc(this,t);break}case G.IN_HEAD:{bc(this,t);break}case G.IN_HEAD_NO_SCRIPT:{xc(this,t);break}case G.AFTER_HEAD:{yc(this,t);break}case G.TEXT:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{C0(this,t);break}case G.IN_COLUMN_GROUP:{uh(this,t);break}case G.AFTER_BODY:{ch(this,t);break}case G.AFTER_AFTER_BODY:{Vf(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){wg(this,t);return}switch(this.insertionMode){case G.INITIAL:case G.BEFORE_HTML:case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_TEMPLATE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{wg(this,t);break}case G.IN_TABLE_TEXT:{Zu(this,t);break}case G.AFTER_BODY:{gj(this,t);break}case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{bj(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case G.INITIAL:{xj(this,t);break}case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:{this._err(t,me.misplacedDoctype);break}case G.IN_TABLE_TEXT:{Zu(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,me.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?H9(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{Ku(this,t);break}case G.BEFORE_HTML:{yj(this,t);break}case G.BEFORE_HEAD:{_j(this,t);break}case G.IN_HEAD:{Ka(this,t);break}case G.IN_HEAD_NO_SCRIPT:{kj(this,t);break}case G.AFTER_HEAD:{Cj(this,t);break}case G.IN_BODY:{_r(this,t);break}case G.IN_TABLE:{Vo(this,t);break}case G.IN_TABLE_TEXT:{Zu(this,t);break}case G.IN_CAPTION:{T9(this,t);break}case G.IN_COLUMN_GROUP:{B1(this,t);break}case G.IN_TABLE_BODY:{Bh(this,t);break}case G.IN_ROW:{Uh(this,t);break}case G.IN_CELL:{w9(this,t);break}case G.IN_SELECT:{R3(this,t);break}case G.IN_SELECT_IN_TABLE:{S9(this,t);break}case G.IN_TEMPLATE:{A9(this,t);break}case G.AFTER_BODY:{L9(this,t);break}case G.IN_FRAMESET:{I9(this,t);break}case G.AFTER_FRAMESET:{D9(this,t);break}case G.AFTER_AFTER_BODY:{M9(this,t);break}case G.AFTER_AFTER_FRAMESET:{P9(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?z9(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{Ku(this,t);break}case G.BEFORE_HTML:{Ej(this,t);break}case G.BEFORE_HEAD:{Tj(this,t);break}case G.IN_HEAD:{vj(this,t);break}case G.IN_HEAD_NO_SCRIPT:{wj(this,t);break}case G.AFTER_HEAD:{Sj(this,t);break}case G.IN_BODY:{Ph(this,t);break}case G.TEXT:{f9(this,t);break}case G.IN_TABLE:{Lc(this,t);break}case G.IN_TABLE_TEXT:{Zu(this,t);break}case G.IN_CAPTION:{v9(this,t);break}case G.IN_COLUMN_GROUP:{k9(this,t);break}case G.IN_TABLE_BODY:{Cg(this,t);break}case G.IN_ROW:{A3(this,t);break}case G.IN_CELL:{C9(this,t);break}case G.IN_SELECT:{L3(this,t);break}case G.IN_SELECT_IN_TABLE:{N9(this,t);break}case G.IN_TEMPLATE:{R9(this,t);break}case G.AFTER_BODY:{O3(this,t);break}case G.IN_FRAMESET:{O9(this,t);break}case G.AFTER_FRAMESET:{j9(this,t);break}case G.AFTER_AFTER_BODY:{Vf(this,t);break}}}onEof(t){switch(this.insertionMode){case G.INITIAL:{Ku(this,t);break}case G.BEFORE_HTML:{pc(this,t);break}case G.BEFORE_HEAD:{gc(this,t);break}case G.IN_HEAD:{bc(this,t);break}case G.IN_HEAD_NO_SCRIPT:{xc(this,t);break}case G.AFTER_HEAD:{yc(this,t);break}case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{w3(this,t);break}case G.TEXT:{h9(this,t);break}case G.IN_TABLE_TEXT:{Zu(this,t);break}case G.IN_TEMPLATE:{I3(this,t);break}case G.AFTER_BODY:case G.IN_FRAMESET:case G.AFTER_FRAMESET:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{P1(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===j.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.TEXT:case G.IN_COLUMN_GROUP:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{this._insertCharacters(t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:case G.AFTER_BODY:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{E3(this,t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{C0(this,t);break}case G.IN_TABLE_TEXT:{C3(this,t);break}}}}function cj(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):k3(e,t),n}function dj(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function fj(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let l=0,o=i;o!==n;l++,o=i){i=e.openElements.getCommonAncestor(o);const c=e.activeFormattingElements.getElementEntry(o),d=c&&l>=oj;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(o)):(o=hj(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function hj(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function mj(e,t,n){const r=e.treeAdapter.getTagName(t),i=nu(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const l=e.treeAdapter.getNamespaceURI(t);i===_.TEMPLATE&&l===ve.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function pj(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,l=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,l),e.treeAdapter.appendChild(t,l),e.activeFormattingElements.insertElementAfterBookmark(l,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,l,i.tagID)}function M1(e,t){for(let n=0;n<lj;n++){const r=cj(e,t);if(!r)break;const i=dj(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const l=fj(e,i,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(l),o&&mj(e,o,l),pj(e,i,r)}}function wg(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function gj(e,t){e._appendCommentNode(t,e.openElements.items[0])}function bj(e,t){e._appendCommentNode(t,e.document)}function P1(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const l=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(l);o&&!o.endTag&&e._setEndLocation(l,t)}}}}function xj(e,t){e._setDocumentType(t);const n=t.forceQuirks?wa.QUIRKS:WD(t);YD(t)||e._err(t,me.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=G.BEFORE_HTML}function Ku(e,t){e._err(t,me.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,wa.QUIRKS),e.insertionMode=G.BEFORE_HTML,e._processToken(t)}function yj(e,t){t.tagID===_.HTML?(e._insertElement(t,ve.HTML),e.insertionMode=G.BEFORE_HEAD):pc(e,t)}function Ej(e,t){const n=t.tagID;(n===_.HTML||n===_.HEAD||n===_.BODY||n===_.BR)&&pc(e,t)}function pc(e,t){e._insertFakeRootElement(),e.insertionMode=G.BEFORE_HEAD,e._processToken(t)}function _j(e,t){switch(t.tagID){case _.HTML:{_r(e,t);break}case _.HEAD:{e._insertElement(t,ve.HTML),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD;break}default:gc(e,t)}}function Tj(e,t){const n=t.tagID;n===_.HEAD||n===_.BODY||n===_.HTML||n===_.BR?gc(e,t):e._err(t,me.endTagWithoutMatchingOpenElement)}function gc(e,t){e._insertFakeElement(te.HEAD,_.HEAD),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD,e._processToken(t)}function Ka(e,t){switch(t.tagID){case _.HTML:{_r(e,t);break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:{e._appendElement(t,ve.HTML),t.ackSelfClosing=!0;break}case _.TITLE:{e._switchToTextParsing(t,Un.RCDATA);break}case _.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Un.RAWTEXT):(e._insertElement(t,ve.HTML),e.insertionMode=G.IN_HEAD_NO_SCRIPT);break}case _.NOFRAMES:case _.STYLE:{e._switchToTextParsing(t,Un.RAWTEXT);break}case _.SCRIPT:{e._switchToTextParsing(t,Un.SCRIPT_DATA);break}case _.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=G.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(G.IN_TEMPLATE);break}case _.HEAD:{e._err(t,me.misplacedStartTagForHeadElement);break}default:bc(e,t)}}function vj(e,t){switch(t.tagID){case _.HEAD:{e.openElements.pop(),e.insertionMode=G.AFTER_HEAD;break}case _.BODY:case _.BR:case _.HTML:{bc(e,t);break}case _.TEMPLATE:{Fl(e,t);break}default:e._err(t,me.endTagWithoutMatchingOpenElement)}}function Fl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==_.TEMPLATE&&e._err(t,me.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,me.endTagWithoutMatchingOpenElement)}function bc(e,t){e.openElements.pop(),e.insertionMode=G.AFTER_HEAD,e._processToken(t)}function kj(e,t){switch(t.tagID){case _.HTML:{_r(e,t);break}case _.BASEFONT:case _.BGSOUND:case _.HEAD:case _.LINK:case _.META:case _.NOFRAMES:case _.STYLE:{Ka(e,t);break}case _.NOSCRIPT:{e._err(t,me.nestedNoscriptInHead);break}default:xc(e,t)}}function wj(e,t){switch(t.tagID){case _.NOSCRIPT:{e.openElements.pop(),e.insertionMode=G.IN_HEAD;break}case _.BR:{xc(e,t);break}default:e._err(t,me.endTagWithoutMatchingOpenElement)}}function xc(e,t){const n=t.type===At.EOF?me.openElementsLeftAfterEof:me.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=G.IN_HEAD,e._processToken(t)}function Cj(e,t){switch(t.tagID){case _.HTML:{_r(e,t);break}case _.BODY:{e._insertElement(t,ve.HTML),e.framesetOk=!1,e.insertionMode=G.IN_BODY;break}case _.FRAMESET:{e._insertElement(t,ve.HTML),e.insertionMode=G.IN_FRAMESET;break}case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:case _.NOFRAMES:case _.SCRIPT:case _.STYLE:case _.TEMPLATE:case _.TITLE:{e._err(t,me.abandonedHeadElementChild),e.openElements.push(e.headElement,_.HEAD),Ka(e,t),e.openElements.remove(e.headElement);break}case _.HEAD:{e._err(t,me.misplacedStartTagForHeadElement);break}default:yc(e,t)}}function Sj(e,t){switch(t.tagID){case _.BODY:case _.HTML:case _.BR:{yc(e,t);break}case _.TEMPLATE:{Fl(e,t);break}default:e._err(t,me.endTagWithoutMatchingOpenElement)}}function yc(e,t){e._insertFakeElement(te.BODY,_.BODY),e.insertionMode=G.IN_BODY,Mh(e,t)}function Mh(e,t){switch(t.type){case At.CHARACTER:{_3(e,t);break}case At.WHITESPACE_CHARACTER:{E3(e,t);break}case At.COMMENT:{wg(e,t);break}case At.START_TAG:{_r(e,t);break}case At.END_TAG:{Ph(e,t);break}case At.EOF:{w3(e,t);break}}}function E3(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function _3(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Nj(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Aj(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Rj(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ve.HTML),e.insertionMode=G.IN_FRAMESET)}function Lj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ve.HTML)}function Ij(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&kg.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ve.HTML)}function Oj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ve.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Dj(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ve.HTML),n||(e.formElement=e.openElements.current))}function jj(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===_.LI&&i===_.LI||(n===_.DD||n===_.DT)&&(i===_.DD||i===_.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==_.ADDRESS&&i!==_.DIV&&i!==_.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ve.HTML)}function Mj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ve.HTML),e.tokenizer.state=Un.PLAINTEXT}function Pj(e,t){e.openElements.hasInScope(_.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ve.HTML),e.framesetOk=!1}function Bj(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(te.A);n&&(M1(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ve.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Uj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ve.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Hj(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(_.NOBR)&&(M1(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ve.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function zj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ve.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Fj(e,t){e.treeAdapter.getDocumentMode(e.document)!==wa.QUIRKS&&e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._insertElement(t,ve.HTML),e.framesetOk=!1,e.insertionMode=G.IN_TABLE}function T3(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ve.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function v3(e){const t=d3(e,Ml.TYPE);return t!=null&&t.toLowerCase()===ij}function $j(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ve.HTML),v3(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Vj(e,t){e._appendElement(t,ve.HTML),t.ackSelfClosing=!0}function Gj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._appendElement(t,ve.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function qj(e,t){t.tagName=te.IMG,t.tagID=_.IMG,T3(e,t)}function Yj(e,t){e._insertElement(t,ve.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Un.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=G.TEXT}function Wj(e,t){e.openElements.hasInButtonScope(_.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Un.RAWTEXT)}function Qj(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Un.RAWTEXT)}function N_(e,t){e._switchToTextParsing(t,Un.RAWTEXT)}function Xj(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ve.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===G.IN_TABLE||e.insertionMode===G.IN_CAPTION||e.insertionMode===G.IN_TABLE_BODY||e.insertionMode===G.IN_ROW||e.insertionMode===G.IN_CELL?G.IN_SELECT_IN_TABLE:G.IN_SELECT}function Kj(e,t){e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ve.HTML)}function Zj(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ve.HTML)}function Jj(e,t){e.openElements.hasInScope(_.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(_.RTC),e._insertElement(t,ve.HTML)}function e9(e,t){e._reconstructActiveFormattingElements(),b3(t),j1(t),t.selfClosing?e._appendElement(t,ve.MATHML):e._insertElement(t,ve.MATHML),t.ackSelfClosing=!0}function t9(e,t){e._reconstructActiveFormattingElements(),x3(t),j1(t),t.selfClosing?e._appendElement(t,ve.SVG):e._insertElement(t,ve.SVG),t.ackSelfClosing=!0}function A_(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ve.HTML)}function _r(e,t){switch(t.tagID){case _.I:case _.S:case _.B:case _.U:case _.EM:case _.TT:case _.BIG:case _.CODE:case _.FONT:case _.SMALL:case _.STRIKE:case _.STRONG:{Uj(e,t);break}case _.A:{Bj(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{Ij(e,t);break}case _.P:case _.DL:case _.OL:case _.UL:case _.DIV:case _.DIR:case _.NAV:case _.MAIN:case _.MENU:case _.ASIDE:case _.CENTER:case _.FIGURE:case _.FOOTER:case _.HEADER:case _.HGROUP:case _.DIALOG:case _.DETAILS:case _.ADDRESS:case _.ARTICLE:case _.SEARCH:case _.SECTION:case _.SUMMARY:case _.FIELDSET:case _.BLOCKQUOTE:case _.FIGCAPTION:{Lj(e,t);break}case _.LI:case _.DD:case _.DT:{jj(e,t);break}case _.BR:case _.IMG:case _.WBR:case _.AREA:case _.EMBED:case _.KEYGEN:{T3(e,t);break}case _.HR:{Gj(e,t);break}case _.RB:case _.RTC:{Zj(e,t);break}case _.RT:case _.RP:{Jj(e,t);break}case _.PRE:case _.LISTING:{Oj(e,t);break}case _.XMP:{Wj(e,t);break}case _.SVG:{t9(e,t);break}case _.HTML:{Nj(e,t);break}case _.BASE:case _.LINK:case _.META:case _.STYLE:case _.TITLE:case _.SCRIPT:case _.BGSOUND:case _.BASEFONT:case _.TEMPLATE:{Ka(e,t);break}case _.BODY:{Aj(e,t);break}case _.FORM:{Dj(e,t);break}case _.NOBR:{Hj(e,t);break}case _.MATH:{e9(e,t);break}case _.TABLE:{Fj(e,t);break}case _.INPUT:{$j(e,t);break}case _.PARAM:case _.TRACK:case _.SOURCE:{Vj(e,t);break}case _.IMAGE:{qj(e,t);break}case _.BUTTON:{Pj(e,t);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{zj(e,t);break}case _.IFRAME:{Qj(e,t);break}case _.SELECT:{Xj(e,t);break}case _.OPTION:case _.OPTGROUP:{Kj(e,t);break}case _.NOEMBED:case _.NOFRAMES:{N_(e,t);break}case _.FRAMESET:{Rj(e,t);break}case _.TEXTAREA:{Yj(e,t);break}case _.NOSCRIPT:{e.options.scriptingEnabled?N_(e,t):A_(e,t);break}case _.PLAINTEXT:{Mj(e,t);break}case _.COL:case _.TH:case _.TD:case _.TR:case _.HEAD:case _.FRAME:case _.TBODY:case _.TFOOT:case _.THEAD:case _.CAPTION:case _.COLGROUP:break;default:A_(e,t)}}function n9(e,t){if(e.openElements.hasInScope(_.BODY)&&(e.insertionMode=G.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function r9(e,t){e.openElements.hasInScope(_.BODY)&&(e.insertionMode=G.AFTER_BODY,O3(e,t))}function a9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function s9(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(_.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(_.FORM):n&&e.openElements.remove(n))}function i9(e){e.openElements.hasInButtonScope(_.P)||e._insertFakeElement(te.P,_.P),e._closePElement()}function l9(e){e.openElements.hasInListItemScope(_.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(_.LI),e.openElements.popUntilTagNamePopped(_.LI))}function o9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function u9(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function c9(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function d9(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(te.BR,_.BR),e.openElements.pop(),e.framesetOk=!1}function k3(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const l=e.openElements.items[i],o=e.openElements.tagIDs[i];if(r===o&&(r!==_.UNKNOWN||e.treeAdapter.getTagName(l)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(l,o))break}}function Ph(e,t){switch(t.tagID){case _.A:case _.B:case _.I:case _.S:case _.U:case _.EM:case _.TT:case _.BIG:case _.CODE:case _.FONT:case _.NOBR:case _.SMALL:case _.STRIKE:case _.STRONG:{M1(e,t);break}case _.P:{i9(e);break}case _.DL:case _.UL:case _.OL:case _.DIR:case _.DIV:case _.NAV:case _.PRE:case _.MAIN:case _.MENU:case _.ASIDE:case _.BUTTON:case _.CENTER:case _.FIGURE:case _.FOOTER:case _.HEADER:case _.HGROUP:case _.DIALOG:case _.ADDRESS:case _.ARTICLE:case _.DETAILS:case _.SEARCH:case _.SECTION:case _.SUMMARY:case _.LISTING:case _.FIELDSET:case _.BLOCKQUOTE:case _.FIGCAPTION:{a9(e,t);break}case _.LI:{l9(e);break}case _.DD:case _.DT:{o9(e,t);break}case _.H1:case _.H2:case _.H3:case _.H4:case _.H5:case _.H6:{u9(e);break}case _.BR:{d9(e);break}case _.BODY:{n9(e,t);break}case _.HTML:{r9(e,t);break}case _.FORM:{s9(e);break}case _.APPLET:case _.OBJECT:case _.MARQUEE:{c9(e,t);break}case _.TEMPLATE:{Fl(e,t);break}default:k3(e,t)}}function w3(e,t){e.tmplInsertionModeStack.length>0?I3(e,t):P1(e,t)}function f9(e,t){var n;t.tagID===_.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function h9(e,t){e._err(t,me.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function C0(e,t){if(e.openElements.currentTagId!==void 0&&y3.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=G.IN_TABLE_TEXT,t.type){case At.CHARACTER:{S3(e,t);break}case At.WHITESPACE_CHARACTER:{C3(e,t);break}}else Fc(e,t)}function m9(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ve.HTML),e.insertionMode=G.IN_CAPTION}function p9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ve.HTML),e.insertionMode=G.IN_COLUMN_GROUP}function g9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(te.COLGROUP,_.COLGROUP),e.insertionMode=G.IN_COLUMN_GROUP,B1(e,t)}function b9(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ve.HTML),e.insertionMode=G.IN_TABLE_BODY}function x9(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(te.TBODY,_.TBODY),e.insertionMode=G.IN_TABLE_BODY,Bh(e,t)}function y9(e,t){e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function E9(e,t){v3(t)?e._appendElement(t,ve.HTML):Fc(e,t),t.ackSelfClosing=!0}function _9(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ve.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Vo(e,t){switch(t.tagID){case _.TD:case _.TH:case _.TR:{x9(e,t);break}case _.STYLE:case _.SCRIPT:case _.TEMPLATE:{Ka(e,t);break}case _.COL:{g9(e,t);break}case _.FORM:{_9(e,t);break}case _.TABLE:{y9(e,t);break}case _.TBODY:case _.TFOOT:case _.THEAD:{b9(e,t);break}case _.INPUT:{E9(e,t);break}case _.CAPTION:{m9(e,t);break}case _.COLGROUP:{p9(e,t);break}default:Fc(e,t)}}function Lc(e,t){switch(t.tagID){case _.TABLE:{e.openElements.hasInTableScope(_.TABLE)&&(e.openElements.popUntilTagNamePopped(_.TABLE),e._resetInsertionMode());break}case _.TEMPLATE:{Fl(e,t);break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TBODY:case _.TD:case _.TFOOT:case _.TH:case _.THEAD:case _.TR:break;default:Fc(e,t)}}function Fc(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Mh(e,t),e.fosterParentingEnabled=n}function C3(e,t){e.pendingCharacterTokens.push(t)}function S3(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Zu(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Fc(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const N3=new Set([_.CAPTION,_.COL,_.COLGROUP,_.TBODY,_.TD,_.TFOOT,_.TH,_.THEAD,_.TR]);function T9(e,t){const n=t.tagID;N3.has(n)?e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,Vo(e,t)):_r(e,t)}function v9(e,t){const n=t.tagID;switch(n){case _.CAPTION:case _.TABLE:{e.openElements.hasInTableScope(_.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(_.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,n===_.TABLE&&Lc(e,t));break}case _.BODY:case _.COL:case _.COLGROUP:case _.HTML:case _.TBODY:case _.TD:case _.TFOOT:case _.TH:case _.THEAD:case _.TR:break;default:Ph(e,t)}}function B1(e,t){switch(t.tagID){case _.HTML:{_r(e,t);break}case _.COL:{e._appendElement(t,ve.HTML),t.ackSelfClosing=!0;break}case _.TEMPLATE:{Ka(e,t);break}default:uh(e,t)}}function k9(e,t){switch(t.tagID){case _.COLGROUP:{e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case _.TEMPLATE:{Fl(e,t);break}case _.COL:break;default:uh(e,t)}}function uh(e,t){e.openElements.currentTagId===_.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE,e._processToken(t))}function Bh(e,t){switch(t.tagID){case _.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ve.HTML),e.insertionMode=G.IN_ROW;break}case _.TH:case _.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(te.TR,_.TR),e.insertionMode=G.IN_ROW,Uh(e,t);break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,Vo(e,t));break}default:Vo(e,t)}}function Cg(e,t){const n=t.tagID;switch(t.tagID){case _.TBODY:case _.TFOOT:case _.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case _.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,Lc(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:case _.TR:break;default:Lc(e,t)}}function Uh(e,t){switch(t.tagID){case _.TH:case _.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ve.HTML),e.insertionMode=G.IN_CELL,e.activeFormattingElements.insertMarker();break}case _.CAPTION:case _.COL:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Bh(e,t));break}default:Vo(e,t)}}function A3(e,t){switch(t.tagID){case _.TR:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY);break}case _.TABLE:{e.openElements.hasInTableScope(_.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Cg(e,t));break}case _.TBODY:case _.TFOOT:case _.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(_.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Cg(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:case _.TD:case _.TH:break;default:Lc(e,t)}}function w9(e,t){const n=t.tagID;N3.has(n)?(e.openElements.hasInTableScope(_.TD)||e.openElements.hasInTableScope(_.TH))&&(e._closeTableCell(),Uh(e,t)):_r(e,t)}function C9(e,t){const n=t.tagID;switch(n){case _.TD:case _.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_ROW);break}case _.TABLE:case _.TBODY:case _.TFOOT:case _.THEAD:case _.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),A3(e,t));break}case _.BODY:case _.CAPTION:case _.COL:case _.COLGROUP:case _.HTML:break;default:Ph(e,t)}}function R3(e,t){switch(t.tagID){case _.HTML:{_r(e,t);break}case _.OPTION:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e._insertElement(t,ve.HTML);break}case _.OPTGROUP:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ve.HTML);break}case _.HR:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ve.HTML),t.ackSelfClosing=!0;break}case _.INPUT:case _.KEYGEN:case _.TEXTAREA:case _.SELECT:{e.openElements.hasInSelectScope(_.SELECT)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),t.tagID!==_.SELECT&&e._processStartTag(t));break}case _.SCRIPT:case _.TEMPLATE:{Ka(e,t);break}}}function L3(e,t){switch(t.tagID){case _.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===_.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===_.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===_.OPTGROUP&&e.openElements.pop();break}case _.OPTION:{e.openElements.currentTagId===_.OPTION&&e.openElements.pop();break}case _.SELECT:{e.openElements.hasInSelectScope(_.SELECT)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode());break}case _.TEMPLATE:{Fl(e,t);break}}}function S9(e,t){const n=t.tagID;n===_.CAPTION||n===_.TABLE||n===_.TBODY||n===_.TFOOT||n===_.THEAD||n===_.TR||n===_.TD||n===_.TH?(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),e._processStartTag(t)):R3(e,t)}function N9(e,t){const n=t.tagID;n===_.CAPTION||n===_.TABLE||n===_.TBODY||n===_.TFOOT||n===_.THEAD||n===_.TR||n===_.TD||n===_.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(_.SELECT),e._resetInsertionMode(),e.onEndTag(t)):L3(e,t)}function A9(e,t){switch(t.tagID){case _.BASE:case _.BASEFONT:case _.BGSOUND:case _.LINK:case _.META:case _.NOFRAMES:case _.SCRIPT:case _.STYLE:case _.TEMPLATE:case _.TITLE:{Ka(e,t);break}case _.CAPTION:case _.COLGROUP:case _.TBODY:case _.TFOOT:case _.THEAD:{e.tmplInsertionModeStack[0]=G.IN_TABLE,e.insertionMode=G.IN_TABLE,Vo(e,t);break}case _.COL:{e.tmplInsertionModeStack[0]=G.IN_COLUMN_GROUP,e.insertionMode=G.IN_COLUMN_GROUP,B1(e,t);break}case _.TR:{e.tmplInsertionModeStack[0]=G.IN_TABLE_BODY,e.insertionMode=G.IN_TABLE_BODY,Bh(e,t);break}case _.TD:case _.TH:{e.tmplInsertionModeStack[0]=G.IN_ROW,e.insertionMode=G.IN_ROW,Uh(e,t);break}default:e.tmplInsertionModeStack[0]=G.IN_BODY,e.insertionMode=G.IN_BODY,_r(e,t)}}function R9(e,t){t.tagID===_.TEMPLATE&&Fl(e,t)}function I3(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(_.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):P1(e,t)}function L9(e,t){t.tagID===_.HTML?_r(e,t):ch(e,t)}function O3(e,t){var n;if(t.tagID===_.HTML){if(e.fragmentContext||(e.insertionMode=G.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===_.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else ch(e,t)}function ch(e,t){e.insertionMode=G.IN_BODY,Mh(e,t)}function I9(e,t){switch(t.tagID){case _.HTML:{_r(e,t);break}case _.FRAMESET:{e._insertElement(t,ve.HTML);break}case _.FRAME:{e._appendElement(t,ve.HTML),t.ackSelfClosing=!0;break}case _.NOFRAMES:{Ka(e,t);break}}}function O9(e,t){t.tagID===_.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==_.FRAMESET&&(e.insertionMode=G.AFTER_FRAMESET))}function D9(e,t){switch(t.tagID){case _.HTML:{_r(e,t);break}case _.NOFRAMES:{Ka(e,t);break}}}function j9(e,t){t.tagID===_.HTML&&(e.insertionMode=G.AFTER_AFTER_FRAMESET)}function M9(e,t){t.tagID===_.HTML?_r(e,t):Vf(e,t)}function Vf(e,t){e.insertionMode=G.IN_BODY,Mh(e,t)}function P9(e,t){switch(t.tagID){case _.HTML:{_r(e,t);break}case _.NOFRAMES:{Ka(e,t);break}}}function B9(e,t){t.chars=Sn,e._insertCharacters(t)}function U9(e,t){e._insertCharacters(t),e.framesetOk=!1}function D3(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ve.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function H9(e,t){if(tj(t))D3(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ve.MATHML?b3(t):r===ve.SVG&&(nj(t),x3(t)),j1(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function z9(e,t){if(t.tagID===_.P||t.tagID===_.BR){D3(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ve.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}te.AREA,te.BASE,te.BASEFONT,te.BGSOUND,te.BR,te.COL,te.EMBED,te.FRAME,te.HR,te.IMG,te.INPUT,te.KEYGEN,te.LINK,te.META,te.PARAM,te.SOURCE,te.TRACK,te.WBR;const Hh=j3("end"),ys=j3("start");function j3(e){return t;function t(n){const r=n&&n.position&&n.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 M3(e){const t=ys(e),n=Hh(e);if(t&&n)return{start:t,end:n}}const F9=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,$9=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),R_={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function P3(e,t){const n=J9(e),r=d1("type",{handlers:{root:V9,element:G9,text:q9,comment:U3,doctype:Y9,raw:Q9},unknown:X9}),i={parser:n?new S_(R_):S_.getFragmentParser(void 0,R_),handle(c){r(c,i)},stitches:!1,options:t||{}};r(e,i),ru(i,ys());const l=n?i.parser.document:i.parser.getFragment(),o=tD(l,{file:i.options.file});return i.stitches&&gs(o,"comment",function(c,d,m){const p=c;if(p.value.stitch&&m&&d!==void 0){const g=m.children;return g[d]=p.value.stitch,d}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function B3(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function V9(e,t){B3(e.children,t)}function G9(e,t){K9(e,t),B3(e.children,t),Z9(e,t)}function q9(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:At.CHARACTER,chars:e.value,location:$c(e)};ru(t,ys(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Y9(e,t){const n={type:At.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:$c(e)};ru(t,ys(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function W9(e,t){t.stitches=!0;const n=eM(e);if("children"in e&&"children"in n){const r=P3({type:"root",children:e.children},t.options);n.children=r.children}U3({type:"comment",value:{stitch:n}},t)}function U3(e,t){const n=e.value,r={type:At.COMMENT,data:n,location:$c(e)};ru(t,ys(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Q9(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,H3(t,ys(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(F9,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function X9(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))W9(n,t);else{let r="";throw $9.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function ru(e,t){H3(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Un.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function H3(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function K9(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Un.PLAINTEXT)return;ru(t,ys(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Ol.html;i===Ol.html&&n==="svg"&&(i=Ol.svg);const l=iD({...e,children:[]},{space:i===Ol.svg?"svg":"html"}),o={type:At.START_TAG,tagName:n,tagID:nu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in l?l.attrs:[],location:$c(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Z9(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&ak.includes(n)||t.parser.tokenizer.state===Un.PLAINTEXT)return;ru(t,Hh(e));const r={type:At.END_TAG,tagName:n,tagID:nu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:$c(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Un.RCDATA||t.parser.tokenizer.state===Un.RAWTEXT||t.parser.tokenizer.state===Un.SCRIPT_DATA)&&(t.parser.tokenizer.state=Un.DATA)}function J9(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function $c(e){const t=ys(e)||{line:void 0,column:void 0,offset:void 0},n=Hh(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function eM(e){return"children"in e?Bl({...e,children:[]}):Bl(e)}function Sg(e){return function(t,n){return P3(t,{...e,file:n})}}const wl=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Al={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...wl,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...wl],h2:[["className","sr-only"]],img:[...wl,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...wl,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...wl],table:[...wl],ul:[...wl,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Hi={}.hasOwnProperty;function tM(e,t){let n={type:"root",children:[]};const r={schema:t?{...Al,...t}:Al,stack:[]},i=z3(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function z3(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return nM(e,n);case"doctype":return rM(e,n);case"element":return aM(e,n);case"root":return sM(e,n);case"text":return iM(e,n)}}}function nM(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),l={type:"comment",value:r<0?n:n.slice(0,r)};return Vc(l,t),l}}function rM(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Vc(n,t),n}}function aM(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=F3(e,t.children),i=lM(e,t.properties);e.stack.pop();let l=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(l=!0,e.schema.ancestors&&Hi.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(l=!1;++d<c.length;)e.stack.includes(c[d])&&(l=!0)}if(!l)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:i,children:r};return Vc(o,t),o}function sM(e,t){const r={type:"root",children:F3(e,t.children)};return Vc(r,t),r}function iM(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Vc(r,t),r}function F3(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const l=z3(e,r[i]);l&&(Array.isArray(l)?n.push(...l):n.push(l))}}return n}function lM(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,l=r&&Hi.call(r,n)?r[n]:void 0,o=r&&Hi.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let m;for(m in c)if(Hi.call(c,m)){const p=c[m];let g=L_(e,I_(l,m),m,p);g==null&&(g=L_(e,I_(o,m),m,p)),g!=null&&(d[m]=g)}if(i&&Hi.call(i,n)){const p=i[n];for(m in p)Hi.call(p,m)&&!Hi.call(d,m)&&(d[m]=p[m])}return d}function L_(e,t,n,r){return t?Array.isArray(r)?oM(e,t,n,r):$3(e,t,n,r):void 0}function oM(e,t,n,r){let i=-1;const l=[];for(;++i<r.length;){const o=$3(e,t,n,r[i]);(typeof o=="number"||typeof o=="string")&&l.push(o)}return l}function $3(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&uM(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,l=0;for(;++l<t.length;){const o=t[l];if(o&&typeof o=="object"&&"flags"in o){if(o.test(String(r))){i=!0;break}}else if(o===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function uM(e,t,n){const r=e.schema.protocols&&Hi.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),l=i.indexOf(":"),o=i.indexOf("?"),c=i.indexOf("#"),d=i.indexOf("/");if(l<0||d>-1&&l>d||o>-1&&l>o||c>-1&&l>c)return!0;let m=-1;for(;++m<r.length;){const p=r[m];if(l===p.length&&i.slice(0,p.length)===p)return!0}return!1}function Vc(e,t){const n=M3(t);t.data&&(e.data=Bl(t.data)),n&&(e.position=n)}function I_(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],l=typeof i=="string"?i:i[0];if(l===t)return i;l==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function V3(e){return function(t){return tM(t,e)}}const Lr=Wi(/[A-Za-z]/),Er=Wi(/[\dA-Za-z]/),cM=Wi(/[#-'*+\--9=?A-Z^-~]/);function dh(e){return e!==null&&(e<32||e===127)}const Ng=Wi(/\d/),dM=Wi(/[\dA-Fa-f]/),fM=Wi(/[!-/:-@[-`{-~]/);function ct(e){return e!==null&&e<-2}function bn(e){return e!==null&&(e<0||e===32)}function Ot(e){return e===-2||e===-1||e===32}const zh=Wi(new RegExp("\\p{P}|\\p{S}","u")),Ul=Wi(/\s/);function Wi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function hM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function mM(e,t,n){const i=Oh((n||{}).ignore||[]),l=pM(t);let o=-1;for(;++o<l.length;)N1(e,"text",c);function c(m,p){let g=-1,y;for(;++g<p.length;){const E=p[g],v=y?y.children:void 0;if(i(E,v?v.indexOf(E):void 0,y))return;y=E}if(y)return d(m,p)}function d(m,p){const g=p[p.length-1],y=l[o][0],E=l[o][1];let v=0;const C=g.children.indexOf(m);let S=!1,N=[];y.lastIndex=0;let A=y.exec(m.value);for(;A;){const H=A.index,$={index:A.index,input:A.input,stack:[...p,m]};let U=E(...A,$);if(typeof U=="string"&&(U=U.length>0?{type:"text",value:U}:void 0),U===!1?y.lastIndex=H+1:(v!==H&&N.push({type:"text",value:m.value.slice(v,H)}),Array.isArray(U)?N.push(...U):U&&N.push(U),v=H+A[0].length,S=!0),!y.global)break;A=y.exec(m.value)}return S?(v<m.value.length&&N.push({type:"text",value:m.value.slice(v)}),g.children.splice(C,1,...N)):N=[m],C+N.length}}function pM(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([gM(i[0]),bM(i[1])])}return t}function gM(e){return typeof e=="string"?new RegExp(hM(e),"g"):e}function bM(e){return typeof e=="function"?e:function(){return e}}const S0="phrasing",N0=["autolink","link","image","label"];function xM(){return{transforms:[wM],enter:{literalAutolink:EM,literalAutolinkEmail:A0,literalAutolinkHttp:A0,literalAutolinkWww:A0},exit:{literalAutolink:kM,literalAutolinkEmail:vM,literalAutolinkHttp:_M,literalAutolinkWww:TM}}}function yM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:S0,notInConstruct:N0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:S0,notInConstruct:N0},{character:":",before:"[ps]",after:"\\/",inConstruct:S0,notInConstruct:N0}]}}function EM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function A0(e){this.config.enter.autolinkProtocol.call(this,e)}function _M(e){this.config.exit.autolinkProtocol.call(this,e)}function TM(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function vM(e){this.config.exit.autolinkEmail.call(this,e)}function kM(e){this.exit(e)}function wM(e){mM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,CM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),SM]],{ignore:["link","linkReference"]})}function CM(e,t,n,r,i){let l="";if(!G3(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!NM(n)))return!1;const o=AM(n+r);if(!o[0])return!1;const c={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[c,{type:"text",value:o[1]}]:c}function SM(e,t,n,r){return!G3(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function NM(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function AM(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Jf(e,"(");let l=Jf(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function G3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ul(n)||zh(n))&&(!t||n!==47)}function Qa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}q3.peek=BM;function RM(){this.buffer()}function LM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function IM(){this.buffer()}function OM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function DM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jM(e){this.exit(e)}function MM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function PM(e){this.exit(e)}function BM(){return"["}function q3(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const o=n.enter("footnoteReference"),c=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),c(),o(),l+=i.move("]"),l}function UM(){return{enter:{gfmFootnoteCallString:RM,gfmFootnoteCall:LM,gfmFootnoteDefinitionLabelString:IM,gfmFootnoteDefinition:OM},exit:{gfmFootnoteCallString:DM,gfmFootnoteCall:jM,gfmFootnoteDefinitionLabelString:MM,gfmFootnoteDefinition:PM}}}function HM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:q3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,o){const c=l.createTracker(o);let d=c.move("[^");const m=l.enter("footnoteDefinition"),p=l.enter("label");return d+=c.move(l.safe(l.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
245
+ `:" ")+l.indentLines(l.containerFlow(r,c.current()),t?Y3:zM))),m(),d}}function zM(e,t,n){return t===0?e:Y3(e,t,n)}function Y3(e,t,n){return(n?"":" ")+e}const FM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];W3.peek=YM;function $M(){return{canContainEols:["delete"],enter:{strikethrough:GM},exit:{strikethrough:qM}}}function VM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:FM}],handlers:{delete:W3}}}function GM(e){this.enter({type:"delete",children:[]},e)}function qM(e){this.exit(e)}function W3(e,t,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),l(),o}function YM(){return"~"}function WM(e){return e.length}function QM(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||WM,l=[],o=[],c=[],d=[];let m=0,p=-1;for(;++p<e.length;){const w=[],C=[];let S=-1;for(e[p].length>m&&(m=e[p].length);++S<e[p].length;){const N=XM(e[p][S]);if(n.alignDelimiters!==!1){const A=i(N);C[S]=A,(d[S]===void 0||A>d[S])&&(d[S]=A)}w.push(N)}o[p]=w,c[p]=C}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<m;)l[g]=O_(r[g]);else{const w=O_(r);for(;++g<m;)l[g]=w}g=-1;const y=[],E=[];for(;++g<m;){const w=l[g];let C="",S="";w===99?(C=":",S=":"):w===108?C=":":w===114&&(S=":");let N=n.alignDelimiters===!1?1:Math.max(1,d[g]-C.length-S.length);const A=C+"-".repeat(N)+S;n.alignDelimiters!==!1&&(N=C.length+N+S.length,N>d[g]&&(d[g]=N),E[g]=N),y[g]=A}o.splice(1,0,y),c.splice(1,0,E),p=-1;const v=[];for(;++p<o.length;){const w=o[p],C=c[p];g=-1;const S=[];for(;++g<m;){const N=w[g]||"";let A="",H="";if(n.alignDelimiters!==!1){const $=d[g]-(C[g]||0),U=l[g];U===114?A=" ".repeat($):U===99?$%2?(A=" ".repeat($/2+.5),H=" ".repeat($/2-.5)):(A=" ".repeat($/2),H=A):H=" ".repeat($)}n.delimiterStart!==!1&&!g&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||g)&&S.push(" "),n.alignDelimiters!==!1&&S.push(A),S.push(N),n.alignDelimiters!==!1&&S.push(H),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||g!==m-1)&&S.push("|")}v.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
246
+ `)}function XM(e){return e==null?"":String(e)}function O_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function KM(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),ZM);return i(),o}function ZM(e,t,n){return">"+(n?"":" ")+e}function JM(e,t){return D_(e,t.inConstruct,!0)&&!D_(e,t.notInConstruct,!1)}function D_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function j_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
247
+ `&&JM(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
248
+ `}function e7(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>o&&(o=l):l=1,i=r+t.length,r=n.indexOf(t,i);return o}function t7(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function n7(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function r7(e,t,n,r){const i=n7(n),l=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(t7(e,n)){const g=n.enter("codeIndented"),y=n.indentLines(l,a7);return g(),y}const c=n.createTracker(r),d=i.repeat(Math.max(e7(l,i)+1,3)),m=n.enter("codeFenced");let p=c.move(d);if(e.lang){const g=n.enter(`codeFencedLang${o}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${o}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
249
+ `,encode:["`"],...c.current()})),g()}return p+=c.move(`
250
+ `),l&&(p+=c.move(l+`
251
+ `)),p+=c.move(d),m(),p}function a7(e,t,n){return(n?"":" ")+e}function U1(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function s7(e,t,n,r){const i=U1(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("[");return m+=d.move(n.safe(n.associationId(e),{before:m,after:"]",...d.current()})),m+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":`
252
+ `,...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),c()),o(),m}function i7(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ic(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Go(e){if(e===null||bn(e)||Ul(e))return 1;if(zh(e))return 2}function fh(e,t,n){const r=Go(e),i=Go(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Q3.peek=l7;function Q3(e,t,n,r){const i=i7(n),l=n.enter("emphasis"),o=n.createTracker(r),c=o.move(i);let d=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const m=d.charCodeAt(0),p=fh(r.before.charCodeAt(r.before.length-1),m,i);p.inside&&(d=Ic(m)+d.slice(1));const g=d.charCodeAt(d.length-1),y=fh(r.after.charCodeAt(0),g,i);y.inside&&(d=d.slice(0,-1)+Ic(g));const E=o.move(i);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+E}function l7(e,t,n){return n.options.emphasis||"*"}const o7={};function H1(e,t){const n=o7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return X3(e,r,i)}function X3(e,t,n){if(u7(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return M_(e.children,t,n)}return Array.isArray(e)?M_(e,t,n):""}function M_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=X3(e[i],t,n);return r.join("")}function u7(e){return!!(e&&typeof e=="object")}function c7(e,t){let n=!1;return gs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,_g}),!!((!e.depth||e.depth<3)&&H1(e)&&(t.options.setext||n))}function d7(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(c7(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),y=n.containerPhrasing(e,{...l.current(),before:`
253
+ `,after:`
254
+ `});return g(),p(),y+`
255
+ `+(i===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
256
+ `))+1))}const o="#".repeat(i),c=n.enter("headingAtx"),d=n.enter("phrasing");l.move(o+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
257
+ `,...l.current()});return/^[\t ]/.test(m)&&(m=Ic(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,n.options.closeAtx&&(m+=" "+o),d(),c(),m}K3.peek=f7;function K3(e){return e.value||""}function f7(){return"<"}Z3.peek=h7;function Z3(e,t,n,r){const i=U1(n),l=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let m=d.move("![");return m+=d.move(n.safe(e.alt,{before:m,after:"]",...d.current()})),m+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(n.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(c=n.enter("destinationRaw"),m+=d.move(n.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${l}`),m+=d.move(" "+i),m+=d.move(n.safe(e.title,{before:m,after:i,...d.current()})),m+=d.move(i),c()),m+=d.move(")"),o(),m}function h7(){return"!"}J3.peek=m7;function J3(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const m=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=p,l(),i==="full"||!m||m!==g?d+=c.move(g+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function m7(){return"!"}ew.peek=p7;function ew(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const o=n.unsafe[l],c=n.compilePattern(o);let d;if(o.atBreak)for(;d=c.exec(r);){let m=d.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(d.index+1)}}return i+r+i}function p7(){return"`"}function tw(e,t){const n=H1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}nw.peek=g7;function nw(e,t,n,r){const i=U1(n),l=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let c,d;if(tw(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let g=o.move("<");return g+=o.move(n.containerPhrasing(e,{before:g,after:">",...o.current()})),g+=o.move(">"),c(),n.stack=p,g}c=n.enter("link"),d=n.enter("label");let m=o.move("[");return m+=o.move(n.containerPhrasing(e,{before:m,after:"](",...o.current()})),m+=o.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(n.safe(e.url,{before:m,after:">",...o.current()})),m+=o.move(">")):(d=n.enter("destinationRaw"),m+=o.move(n.safe(e.url,{before:m,after:e.title?" ":")",...o.current()}))),d(),e.title&&(d=n.enter(`title${l}`),m+=o.move(" "+i),m+=o.move(n.safe(e.title,{before:m,after:i,...o.current()})),m+=o.move(i),d()),m+=o.move(")"),c(),m}function g7(e,t,n){return tw(e,n)?"<":"["}rw.peek=b7;function rw(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const m=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(m+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return o(),n.stack=p,l(),i==="full"||!m||m!==g?d+=c.move(g+"]"):i==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function b7(){return"["}function z1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function x7(e){const t=z1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function y7(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function aw(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function E7(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?y7(n):z1(n);const c=e.ordered?o==="."?")":".":x7(n);let d=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),aw(n)===o&&p){let g=-1;for(;++g<e.children.length;){const y=e.children[g];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(o=c),n.bulletCurrent=o;const m=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=l,i(),m}function _7(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function T7(e,t,n,r){const i=_7(n);let l=n.bulletCurrent||z1(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const c=n.createTracker(r);c.move(l+" ".repeat(o-l.length)),c.shift(o);const d=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,c.current()),p);return d(),m;function p(g,y,E){return y?(E?"":" ".repeat(o))+g:(E?l:l+" ".repeat(o-l.length))+g}}function v7(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,r);return l(),i(),o}const k7=Oh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function w7(e,t,n,r){return(e.children.some(function(o){return k7(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function C7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}sw.peek=S7;function sw(e,t,n,r){const i=C7(n),l=n.enter("strong"),o=n.createTracker(r),c=o.move(i+i);let d=o.move(n.containerPhrasing(e,{after:i,before:c,...o.current()}));const m=d.charCodeAt(0),p=fh(r.before.charCodeAt(r.before.length-1),m,i);p.inside&&(d=Ic(m)+d.slice(1));const g=d.charCodeAt(d.length-1),y=fh(r.after.charCodeAt(0),g,i);y.inside&&(d=d.slice(0,-1)+Ic(g));const E=o.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+E}function S7(e,t,n){return n.options.strong||"*"}function N7(e,t,n,r){return n.safe(e.value,r)}function A7(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function R7(e,t,n){const r=(aw(n)+(n.options.ruleSpaces?" ":"")).repeat(A7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const iw={blockquote:KM,break:j_,code:r7,definition:s7,emphasis:Q3,hardBreak:j_,heading:d7,html:K3,image:Z3,imageReference:J3,inlineCode:ew,link:nw,linkReference:rw,list:E7,listItem:T7,paragraph:v7,root:w7,strong:sw,text:N7,thematicBreak:R7},P_=document.createElement("i");function F1(e){const t="&"+e+";";P_.innerHTML=t;const n=P_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function lw(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const L7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function I7(e){return e.replace(L7,O7)}function O7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return lw(n.slice(l?2:1),l?16:10)}return F1(n)||e}function D7(){return{enter:{table:j7,tableData:B_,tableHeader:B_,tableRow:P7},exit:{codeText:B7,table:M7,tableData:R0,tableHeader:R0,tableRow:R0}}}function j7(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function M7(e){this.exit(e),this.data.inTable=void 0}function P7(e){this.enter({type:"tableRow",children:[]},e)}function R0(e){this.exit(e)}function B_(e){this.enter({type:"tableCell",children:[]},e)}function B7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,U7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function U7(e,t){return t==="|"?t:e}function H7(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
258
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:o,tableCell:d,tableRow:c}};function o(E,v,w,C){return m(p(E,w,C),E.align)}function c(E,v,w,C){const S=g(E,w,C),N=m([S]);return N.slice(0,N.indexOf(`
259
+ `))}function d(E,v,w,C){const S=w.enter("tableCell"),N=w.enter("phrasing"),A=w.containerPhrasing(E,{...C,before:l,after:l});return N(),S(),A}function m(E,v){return QM(E,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function p(E,v,w){const C=E.children;let S=-1;const N=[],A=v.enter("table");for(;++S<C.length;)N[S]=g(C[S],v,w);return A(),N}function g(E,v,w){const C=E.children;let S=-1;const N=[],A=v.enter("tableRow");for(;++S<C.length;)N[S]=d(C[S],E,v,w);return A(),N}function y(E,v,w){let C=iw.inlineCode(E,v,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function z7(){return{exit:{taskListCheckValueChecked:U_,taskListCheckValueUnchecked:U_,paragraph:$7}}}function F7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:V7}}}function U_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function $7(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,o;for(;++l<i.length;){const c=i[l];if(c.type==="paragraph"){o=c;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function V7(e,t,n,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);l&&c.move(o);let d=iw.listItem(e,t,n,{...r,...c.current()});return l&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),d;function m(p){return p+o}}function G7(){return[xM(),UM(),$M(),D7(),z7()]}function q7(e){return{extensions:[yM(),HM(e),VM(),H7(e),F7()]}}function sa(e,t,n,r){const i=e.length;let l=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<r.length;)o=r.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function Ca(e,t){return e.length>0?(sa(e,e.length,0,t),e):t}const H_={}.hasOwnProperty;function ow(e){const t={};let n=-1;for(;++n<e.length;)Y7(t,e[n]);return t}function Y7(e,t){let n;for(n in t){const i=(H_.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){H_.call(i,o)||(i[o]=[]);const c=l[o];W7(i[o],Array.isArray(c)?c:c?[c]:[])}}}function W7(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);sa(e,0,0,r)}const Q7={tokenize:tP,partial:!0},uw={tokenize:nP,partial:!0},cw={tokenize:rP,partial:!0},dw={tokenize:aP,partial:!0},X7={tokenize:sP,partial:!0},fw={name:"wwwAutolink",tokenize:J7,previous:mw},hw={name:"protocolAutolink",tokenize:eP,previous:pw},ei={name:"emailAutolink",tokenize:Z7,previous:gw},Es={};function K7(){return{text:Es}}let Cl=48;for(;Cl<123;)Es[Cl]=ei,Cl++,Cl===58?Cl=65:Cl===91&&(Cl=97);Es[43]=ei;Es[45]=ei;Es[46]=ei;Es[95]=ei;Es[72]=[ei,hw];Es[104]=[ei,hw];Es[87]=[ei,fw];Es[119]=[ei,fw];function Z7(e,t,n){const r=this;let i,l;return o;function o(g){return!Ag(g)||!gw.call(r,r.previous)||$1(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return Ag(g)?(e.consume(g),c):g===64?(e.consume(g),d):n(g)}function d(g){return g===46?e.check(X7,p,m)(g):g===45||g===95||Er(g)?(l=!0,e.consume(g),d):p(g)}function m(g){return e.consume(g),i=!0,d}function p(g){return l&&i&&Lr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function J7(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!mw.call(r,r.previous)||$1(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Q7,e.attempt(uw,e.attempt(cw,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function eP(e,t,n){const r=this;let i="",l=!1;return o;function o(g){return(g===72||g===104)&&pw.call(r,r.previous)&&!$1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(Lr(g)&&i.length<5)return i+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const y=i.toLowerCase();if(y==="http"||y==="https")return e.consume(g),d}return n(g)}function d(g){return g===47?(e.consume(g),l?m:(l=!0,d)):n(g)}function m(g){return g===null||dh(g)||bn(g)||Ul(g)||zh(g)?n(g):e.attempt(uw,e.attempt(cw,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function tP(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function nP(e,t,n){let r,i,l;return o;function o(m){return m===46||m===95?e.check(dw,d,c)(m):m===null||bn(m)||Ul(m)||m!==45&&zh(m)?d(m):(l=!0,e.consume(m),o)}function c(m){return m===95?r=!0:(i=r,r=void 0),e.consume(m),o}function d(m){return i||r||!l?n(m):t(m)}}function rP(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(dw,t,l)(o):o===null||bn(o)||Ul(o)?t(o):(e.consume(o),i)}function l(o){return o===41&&r++,e.consume(o),i}}function aP(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),l):c===93?(e.consume(c),i):c===60||c===null||bn(c)||Ul(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||bn(c)||Ul(c)?t(c):r(c)}function l(c){return Lr(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),r):Lr(c)?(e.consume(c),o):n(c)}}function sP(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return Er(l)?n(l):t(l)}}function mw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||bn(e)}function pw(e){return!Lr(e)}function gw(e){return!(e===47||Ag(e))}function Ag(e){return e===43||e===45||e===46||e===95||Er(e)}function $1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function au(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Er(e.charCodeAt(n+1))&&Er(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(o=String.fromCharCode(l,c),i=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Fh(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Rg={name:"attention",resolveAll:iP,tokenize:lP};function iP(e,t){let n=-1,r,i,l,o,c,d,m,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},y={...e[n][1].start};z_(g,-d),z_(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=Ca(m,[["enter",e[r][1],t],["exit",e[r][1],t]])),m=Ca(m,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",l,t]]),m=Ca(m,Fh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),m=Ca(m,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,m=Ca(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,sa(e,r-1,n-r+3,m),n=r+m.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function lP(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Go(r);let l;return o;function o(d){return l=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===l)return e.consume(d),c;const m=e.exit("attentionSequence"),p=Go(d),g=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return m._open=!!(l===42?g:g&&(i||!y)),m._close=!!(l===42?y:y&&(p||!g)),t(d)}}function z_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const oP={name:"autolink",tokenize:uP};function uP(e,t,n){let r=0;return i;function i(E){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(E){return Lr(E)?(e.consume(E),o):E===64?n(E):m(E)}function o(E){return E===43||E===45||E===46||Er(E)?(r=1,c(E)):m(E)}function c(E){return E===58?(e.consume(E),r=0,d):(E===43||E===45||E===46||Er(E))&&r++<32?(e.consume(E),c):(r=0,m(E))}function d(E){return E===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):E===null||E===32||E===60||dh(E)?n(E):(e.consume(E),d)}function m(E){return E===64?(e.consume(E),p):cM(E)?(e.consume(E),m):n(E)}function p(E){return Er(E)?g(E):n(E)}function g(E){return E===46?(e.consume(E),r=0,p):E===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):y(E)}function y(E){if((E===45||Er(E))&&r++<63){const v=E===45?y:g;return e.consume(E),v}return n(E)}}function $t(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(d){return Ot(d)?(e.enter(n),c(d)):t(d)}function c(d){return Ot(d)&&l++<i?(e.consume(d),c):(e.exit(n),t(d))}}const Gc={partial:!0,tokenize:cP};function cP(e,t,n){return r;function r(l){return Ot(l)?$t(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||ct(l)?t(l):n(l)}}const bw={continuation:{tokenize:fP},exit:hP,name:"blockQuote",tokenize:dP};function dP(e,t,n){const r=this;return i;function i(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return Ot(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function fP(e,t,n){const r=this;return i;function i(o){return Ot(o)?$t(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(bw,t,n)(o)}}function hP(e){e.exit("blockQuote")}const xw={name:"characterEscape",tokenize:mP};function mP(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return fM(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const yw={name:"characterReference",tokenize:pP};function pP(e,t,n){const r=this;let i=0,l,o;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,o=Er,p(g))}function m(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=dM,p):(e.enter("characterReferenceValue"),l=7,o=Ng,p(g))}function p(g){if(g===59&&i){const y=e.exit("characterReferenceValue");return o===Er&&!F1(r.sliceSerialize(y))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(g)&&i++<l?(e.consume(g),p):n(g)}}const F_={partial:!0,tokenize:bP},$_={concrete:!0,name:"codeFenced",tokenize:gP};function gP(e,t,n){const r=this,i={partial:!0,tokenize:$};let l=0,o=0,c;return d;function d(U){return m(U)}function m(U){const P=r.events[r.events.length-1];return l=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,c=U,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(U)}function p(U){return U===c?(o++,e.consume(U),p):o<3?n(U):(e.exit("codeFencedFenceSequence"),Ot(U)?$t(e,g,"whitespace")(U):g(U))}function g(U){return U===null||ct(U)?(e.exit("codeFencedFence"),r.interrupt?t(U):e.check(F_,w,H)(U)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(U))}function y(U){return U===null||ct(U)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(U)):Ot(U)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),$t(e,E,"whitespace")(U)):U===96&&U===c?n(U):(e.consume(U),y)}function E(U){return U===null||ct(U)?g(U):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(U))}function v(U){return U===null||ct(U)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(U)):U===96&&U===c?n(U):(e.consume(U),v)}function w(U){return e.attempt(i,H,C)(U)}function C(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),S}function S(U){return l>0&&Ot(U)?$t(e,N,"linePrefix",l+1)(U):N(U)}function N(U){return U===null||ct(U)?e.check(F_,w,H)(U):(e.enter("codeFlowValue"),A(U))}function A(U){return U===null||ct(U)?(e.exit("codeFlowValue"),N(U)):(e.consume(U),A)}function H(U){return e.exit("codeFenced"),t(U)}function $(U,P,Y){let fe=0;return M;function M(ne){return U.enter("lineEnding"),U.consume(ne),U.exit("lineEnding"),K}function K(ne){return U.enter("codeFencedFence"),Ot(ne)?$t(U,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):V(ne)}function V(ne){return ne===c?(U.enter("codeFencedFenceSequence"),he(ne)):Y(ne)}function he(ne){return ne===c?(fe++,U.consume(ne),he):fe>=o?(U.exit("codeFencedFenceSequence"),Ot(ne)?$t(U,de,"whitespace")(ne):de(ne)):Y(ne)}function de(ne){return ne===null||ct(ne)?(U.exit("codeFencedFence"),P(ne)):Y(ne)}}}function bP(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const L0={name:"codeIndented",tokenize:yP},xP={partial:!0,tokenize:EP};function yP(e,t,n){const r=this;return i;function i(m){return e.enter("codeIndented"),$t(e,l,"linePrefix",5)(m)}function l(m){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(m):n(m)}function o(m){return m===null?d(m):ct(m)?e.attempt(xP,o,d)(m):(e.enter("codeFlowValue"),c(m))}function c(m){return m===null||ct(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),c)}function d(m){return e.exit("codeIndented"),t(m)}}function EP(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):ct(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):$t(e,l,"linePrefix",5)(o)}function l(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):ct(o)?i(o):n(o)}}const _P={name:"codeText",previous:vP,resolve:TP,tokenize:kP};function TP(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function vP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kP(e,t,n){let r=0,i,l;return o;function o(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(l=e.enter("codeTextSequence"),i=0,p(g)):ct(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||ct(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),m)}function p(g){return g===96?(e.consume(g),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",m(g))}}class wP{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ju(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ju(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ju(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ju(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ju(this.left,n.reverse())}}}function Ju(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ew(e){const t={};let n=-1,r,i,l,o,c,d,m;const p=new wP(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,CP(p,n)),n=t[n],m=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(o=p.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return sa(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!m}function CP(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,d=[],m={};let p,g,y=-1,E=n,v=0,w=0;const C=[w];for(;E;){for(;e.get(++i)[1]!==E;);l.push(i),E._tokenizer||(p=r.sliceStream(E),E.next||p.push(null),g&&o.defineSkip(E.start),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),g=E,E=E.next}for(E=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(w=y+1,C.push(w),E._tokenizer=void 0,E.previous=void 0,E=E.next);for(o.events=[],E?(E._tokenizer=void 0,E.previous=void 0):C.pop(),y=C.length;y--;){const S=c.slice(C[y],C[y+1]),N=l.pop();d.push([N,N+S.length-1]),e.splice(N,2,S)}for(d.reverse(),y=-1;++y<d.length;)m[v+d[y][0]]=v+d[y][1],v+=d[y][1]-d[y][0]-1;return m}const SP={resolve:AP,tokenize:RP},NP={partial:!0,tokenize:LP};function AP(e){return Ew(e),e}function RP(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?l(c):ct(c)?e.check(NP,o,l)(c):(e.consume(c),i)}function l(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function LP(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),$t(e,l,"linePrefix")}function l(o){if(o===null||ct(o))return n(o);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function _w(e,t,n,r,i,l,o,c,d){const m=d||Number.POSITIVE_INFINITY;let p=0;return g;function g(S){return S===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(S),e.exit(l),y):S===null||S===32||S===41||dh(S)?n(S):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(S))}function y(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),E(S))}function E(S){return S===62?(e.exit("chunkString"),e.exit(c),y(S)):S===null||S===60||ct(S)?n(S):(e.consume(S),S===92?v:E)}function v(S){return S===60||S===62||S===92?(e.consume(S),E):E(S)}function w(S){return!p&&(S===null||S===41||bn(S))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(S)):p<m&&S===40?(e.consume(S),p++,w):S===41?(e.consume(S),p--,w):S===null||S===32||S===40||dh(S)?n(S):(e.consume(S),S===92?C:w)}function C(S){return S===40||S===41||S===92?(e.consume(S),w):w(S)}}function Tw(e,t,n,r,i,l){const o=this;let c=0,d;return m;function m(E){return e.enter(r),e.enter(i),e.consume(E),e.exit(i),e.enter(l),p}function p(E){return c>999||E===null||E===91||E===93&&!d||E===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(E):E===93?(e.exit(l),e.enter(i),e.consume(E),e.exit(i),e.exit(r),t):ct(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||E===91||E===93||ct(E)||c++>999?(e.exit("chunkString"),p(E)):(e.consume(E),d||(d=!Ot(E)),E===92?y:g)}function y(E){return E===91||E===92||E===93?(e.consume(E),c++,g):g(E)}}function vw(e,t,n,r,i,l){let o;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(l),m(y))}function m(y){return y===o?(e.exit(l),d(o)):y===null?n(y):ct(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),$t(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||ct(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?g:p)}function g(y){return y===o||y===92?(e.consume(y),p):p(y)}}function Ec(e,t){let n;return r;function r(i){return ct(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ot(i)?$t(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const IP={name:"definition",tokenize:DP},OP={partial:!0,tokenize:jP};function DP(e,t,n){const r=this;let i;return l;function l(E){return e.enter("definition"),o(E)}function o(E){return Tw.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(E)}function c(E){return i=Qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),d):n(E)}function d(E){return bn(E)?Ec(e,m)(E):m(E)}function m(E){return _w(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(E)}function p(E){return e.attempt(OP,g,g)(E)}function g(E){return Ot(E)?$t(e,y,"whitespace")(E):y(E)}function y(E){return E===null||ct(E)?(e.exit("definition"),r.parser.defined.push(i),t(E)):n(E)}}function jP(e,t,n){return r;function r(c){return bn(c)?Ec(e,i)(c):n(c)}function i(c){return vw(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return Ot(c)?$t(e,o,"whitespace")(c):o(c)}function o(c){return c===null||ct(c)?t(c):n(c)}}const MP={name:"hardBreakEscape",tokenize:PP};function PP(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return ct(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const BP={name:"headingAtx",resolve:UP,tokenize:HP};function UP(e,t){let n=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},sa(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function HP(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||bn(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||ct(p)?(e.exit("atxHeading"),t(p)):Ot(p)?$t(e,c,"whitespace")(p):(e.enter("atxHeadingText"),m(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function m(p){return p===null||p===35||bn(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),m)}}const zP=["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"],V_=["pre","script","style","textarea"],FP={concrete:!0,name:"htmlFlow",resolveTo:GP,tokenize:qP},$P={partial:!0,tokenize:WP},VP={partial:!0,tokenize:YP};function GP(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function qP(e,t,n){const r=this;let i,l,o,c,d;return m;function m(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),l=!0,w):O===63?(e.consume(O),i=3,r.interrupt?t:L):Lr(O)?(e.consume(O),o=String.fromCharCode(O),C):n(O)}function y(O){return O===45?(e.consume(O),i=2,E):O===91?(e.consume(O),i=5,c=0,v):Lr(O)?(e.consume(O),i=4,r.interrupt?t:L):n(O)}function E(O){return O===45?(e.consume(O),r.interrupt?t:L):n(O)}function v(O){const ke="CDATA[";return O===ke.charCodeAt(c++)?(e.consume(O),c===ke.length?r.interrupt?t:V:v):n(O)}function w(O){return Lr(O)?(e.consume(O),o=String.fromCharCode(O),C):n(O)}function C(O){if(O===null||O===47||O===62||bn(O)){const ke=O===47,Ae=o.toLowerCase();return!ke&&!l&&V_.includes(Ae)?(i=1,r.interrupt?t(O):V(O)):zP.includes(o.toLowerCase())?(i=6,ke?(e.consume(O),S):r.interrupt?t(O):V(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):l?N(O):A(O))}return O===45||Er(O)?(e.consume(O),o+=String.fromCharCode(O),C):n(O)}function S(O){return O===62?(e.consume(O),r.interrupt?t:V):n(O)}function N(O){return Ot(O)?(e.consume(O),N):M(O)}function A(O){return O===47?(e.consume(O),M):O===58||O===95||Lr(O)?(e.consume(O),H):Ot(O)?(e.consume(O),A):M(O)}function H(O){return O===45||O===46||O===58||O===95||Er(O)?(e.consume(O),H):$(O)}function $(O){return O===61?(e.consume(O),U):Ot(O)?(e.consume(O),$):A(O)}function U(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,P):Ot(O)?(e.consume(O),U):Y(O)}function P(O){return O===d?(e.consume(O),d=null,fe):O===null||ct(O)?n(O):(e.consume(O),P)}function Y(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||bn(O)?$(O):(e.consume(O),Y)}function fe(O){return O===47||O===62||Ot(O)?A(O):n(O)}function M(O){return O===62?(e.consume(O),K):n(O)}function K(O){return O===null||ct(O)?V(O):Ot(O)?(e.consume(O),K):n(O)}function V(O){return O===45&&i===2?(e.consume(O),z):O===60&&i===1?(e.consume(O),ee):O===62&&i===4?(e.consume(O),F):O===63&&i===3?(e.consume(O),L):O===93&&i===5?(e.consume(O),De):ct(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check($P,se,he)(O)):O===null||ct(O)?(e.exit("htmlFlowData"),he(O)):(e.consume(O),V)}function he(O){return e.check(VP,de,se)(O)}function de(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ne}function ne(O){return O===null||ct(O)?he(O):(e.enter("htmlFlowData"),V(O))}function z(O){return O===45?(e.consume(O),L):V(O)}function ee(O){return O===47?(e.consume(O),o="",Te):V(O)}function Te(O){if(O===62){const ke=o.toLowerCase();return V_.includes(ke)?(e.consume(O),F):V(O)}return Lr(O)&&o.length<8?(e.consume(O),o+=String.fromCharCode(O),Te):V(O)}function De(O){return O===93?(e.consume(O),L):V(O)}function L(O){return O===62?(e.consume(O),F):O===45&&i===2?(e.consume(O),L):V(O)}function F(O){return O===null||ct(O)?(e.exit("htmlFlowData"),se(O)):(e.consume(O),F)}function se(O){return e.exit("htmlFlow"),t(O)}}function YP(e,t,n){const r=this;return i;function i(o){return ct(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function WP(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Gc,t,n)}}const QP={name:"htmlText",tokenize:XP};function XP(e,t,n){const r=this;let i,l,o;return c;function c(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),m):L===47?(e.consume(L),$):L===63?(e.consume(L),A):Lr(L)?(e.consume(L),Y):n(L)}function m(L){return L===45?(e.consume(L),p):L===91?(e.consume(L),l=0,v):Lr(L)?(e.consume(L),N):n(L)}function p(L){return L===45?(e.consume(L),E):n(L)}function g(L){return L===null?n(L):L===45?(e.consume(L),y):ct(L)?(o=g,ee(L)):(e.consume(L),g)}function y(L){return L===45?(e.consume(L),E):g(L)}function E(L){return L===62?z(L):L===45?y(L):g(L)}function v(L){const F="CDATA[";return L===F.charCodeAt(l++)?(e.consume(L),l===F.length?w:v):n(L)}function w(L){return L===null?n(L):L===93?(e.consume(L),C):ct(L)?(o=w,ee(L)):(e.consume(L),w)}function C(L){return L===93?(e.consume(L),S):w(L)}function S(L){return L===62?z(L):L===93?(e.consume(L),S):w(L)}function N(L){return L===null||L===62?z(L):ct(L)?(o=N,ee(L)):(e.consume(L),N)}function A(L){return L===null?n(L):L===63?(e.consume(L),H):ct(L)?(o=A,ee(L)):(e.consume(L),A)}function H(L){return L===62?z(L):A(L)}function $(L){return Lr(L)?(e.consume(L),U):n(L)}function U(L){return L===45||Er(L)?(e.consume(L),U):P(L)}function P(L){return ct(L)?(o=P,ee(L)):Ot(L)?(e.consume(L),P):z(L)}function Y(L){return L===45||Er(L)?(e.consume(L),Y):L===47||L===62||bn(L)?fe(L):n(L)}function fe(L){return L===47?(e.consume(L),z):L===58||L===95||Lr(L)?(e.consume(L),M):ct(L)?(o=fe,ee(L)):Ot(L)?(e.consume(L),fe):z(L)}function M(L){return L===45||L===46||L===58||L===95||Er(L)?(e.consume(L),M):K(L)}function K(L){return L===61?(e.consume(L),V):ct(L)?(o=K,ee(L)):Ot(L)?(e.consume(L),K):fe(L)}function V(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),i=L,he):ct(L)?(o=V,ee(L)):Ot(L)?(e.consume(L),V):(e.consume(L),de)}function he(L){return L===i?(e.consume(L),i=void 0,ne):L===null?n(L):ct(L)?(o=he,ee(L)):(e.consume(L),he)}function de(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||bn(L)?fe(L):(e.consume(L),de)}function ne(L){return L===47||L===62||bn(L)?fe(L):n(L)}function z(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function ee(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),Te}function Te(L){return Ot(L)?$t(e,De,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):De(L)}function De(L){return e.enter("htmlTextData"),o(L)}}const V1={name:"labelEnd",resolveAll:eB,resolveTo:tB,tokenize:nB},KP={tokenize:rB},ZP={tokenize:aB},JP={tokenize:sB};function eB(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&sa(e,0,e.length,n),e}function tB(e,t){let n=e.length,r=0,i,l,o,c;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const d={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",d,t],["enter",m,t]],c=Ca(c,e.slice(l+1,l+r+3)),c=Ca(c,[["enter",p,t]]),c=Ca(c,Fh(t.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),t)),c=Ca(c,[["exit",p,t],e[o-2],e[o-1],["exit",m,t]]),c=Ca(c,e.slice(o+1)),c=Ca(c,[["exit",d,t]]),sa(e,l,e.length,c),e}function nB(e,t,n){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return c;function c(y){return l?l._inactive?g(y):(o=r.parser.defined.includes(Qa(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(KP,p,o?p:g)(y):y===91?e.attempt(ZP,p,o?m:g)(y):o?p(y):g(y)}function m(y){return e.attempt(JP,p,g)(y)}function p(y){return t(y)}function g(y){return l._balanced=!0,n(y)}}function rB(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),i}function i(g){return bn(g)?Ec(e,l)(g):l(g)}function l(g){return g===41?p(g):_w(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function o(g){return bn(g)?Ec(e,d)(g):p(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?vw(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function m(g){return bn(g)?Ec(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function aB(e,t,n){const r=this;return i;function i(c){return Tw.call(r,e,l,o,"reference","referenceMarker","referenceString")(c)}function l(c){return r.parser.defined.includes(Qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function sB(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const iB={name:"labelStartImage",resolveAll:V1.resolveAll,tokenize:lB};function lB(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),l}function l(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const oB={name:"labelStartLink",resolveAll:V1.resolveAll,tokenize:uB};function uB(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const I0={name:"lineEnding",tokenize:cB};function cB(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),$t(e,t,"linePrefix")}}const Gf={name:"thematicBreak",tokenize:dB};function dB(e,t,n){let r=0,i;return l;function l(m){return e.enter("thematicBreak"),o(m)}function o(m){return i=m,c(m)}function c(m){return m===i?(e.enter("thematicBreakSequence"),d(m)):r>=3&&(m===null||ct(m))?(e.exit("thematicBreak"),t(m)):n(m)}function d(m){return m===i?(e.consume(m),r++,d):(e.exit("thematicBreakSequence"),Ot(m)?$t(e,c,"whitespace")(m):c(m))}}const $r={continuation:{tokenize:pB},exit:bB,name:"list",tokenize:mB},fB={partial:!0,tokenize:xB},hB={partial:!0,tokenize:gB};function mB(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return c;function c(E){const v=r.containerState.type||(E===42||E===43||E===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||E===r.containerState.marker:Ng(E)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),E===42||E===45?e.check(Gf,n,m)(E):m(E);if(!r.interrupt||E===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(E)}return n(E)}function d(E){return Ng(E)&&++o<10?(e.consume(E),d):(!r.interrupt||o<2)&&(r.containerState.marker?E===r.containerState.marker:E===41||E===46)?(e.exit("listItemValue"),m(E)):n(E)}function m(E){return e.enter("listItemMarker"),e.consume(E),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||E,e.check(Gc,r.interrupt?n:p,e.attempt(fB,y,g))}function p(E){return r.containerState.initialBlankLine=!0,l++,y(E)}function g(E){return Ot(E)?(e.enter("listItemPrefixWhitespace"),e.consume(E),e.exit("listItemPrefixWhitespace"),y):n(E)}function y(E){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(E)}}function pB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Gc,i,l);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$t(e,t,"listItemIndent",r.containerState.size+1)(c)}function l(c){return r.containerState.furtherBlankLines||!Ot(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(hB,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,$t(e,e.attempt($r,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function gB(e,t,n){const r=this;return $t(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(l):n(l)}}function bB(e){e.exit(this.containerState.type)}function xB(e,t,n){const r=this;return $t(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!Ot(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const G_={name:"setextUnderline",resolveTo:yB,tokenize:EB};function yB(e,t){let n=e.length,r,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function EB(e,t,n){const r=this;let i;return l;function l(m){let p=r.events.length,g;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){g=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),i=m,o(m)):n(m)}function o(m){return e.enter("setextHeadingLineSequence"),c(m)}function c(m){return m===i?(e.consume(m),c):(e.exit("setextHeadingLineSequence"),Ot(m)?$t(e,d,"lineSuffix")(m):d(m))}function d(m){return m===null||ct(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const _B={tokenize:AB,partial:!0};function TB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:CB,continuation:{tokenize:SB},exit:NB}},text:{91:{name:"gfmFootnoteCall",tokenize:wB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vB,resolveTo:kB}}}}function vB(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const d=r.events[i][1];if(d.type==="labelImage"){o=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!o||!o._balanced)return n(d);const m=Qa(r.sliceSerialize({start:o.end,end:r.now()}));return m.codePointAt(0)!==94||!l.includes(m.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function kB(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function wB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,o;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(g){if(l>999||g===93&&!o||g===null||g===91||bn(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return i.includes(Qa(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return bn(g)||(o=!0),l++,e.consume(g),g===92?p:m}function p(g){return g===91||g===92||g===93?(e.consume(g),l++,m):m(g)}}function CB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,o=0,c;return d;function d(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(v)}function p(v){if(o>999||v===93&&!c||v===null||v===91||bn(v))return n(v);if(v===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=Qa(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return bn(v)||(c=!0),o++,e.consume(v),v===92?g:p}function g(v){return v===91||v===92||v===93?(e.consume(v),o++,p):p(v)}function y(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),i.includes(l)||i.push(l),$t(e,E,"gfmFootnoteDefinitionWhitespace")):n(v)}function E(v){return t(v)}}function SB(e,t,n){return e.check(Gc,t,e.attempt(_B,t,n))}function NB(e){e.exit("gfmFootnoteDefinition")}function AB(e,t,n){const r=this;return $t(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function RB(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,c){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let m=d;for(;m--;)if(o[m][0]==="exit"&&o[m][1].type==="strikethroughSequenceTemporary"&&o[m][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[m][1].end.offset-o[m][1].start.offset){o[d][1].type="strikethroughSequence",o[m][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},o[m][1].start),end:Object.assign({},o[d][1].end)},g={type:"strikethroughText",start:Object.assign({},o[m][1].end),end:Object.assign({},o[d][1].start)},y=[["enter",p,c],["enter",o[m][1],c],["exit",o[m][1],c],["enter",g,c]],E=c.parser.constructs.insideSpan.null;E&&sa(y,y.length,0,Fh(E,o.slice(m+1,d),c)),sa(y,y.length,0,[["exit",g,c],["enter",o[d][1],c],["exit",o[d][1],c],["exit",p,c]]),sa(o,m-1,d-m+3,y),d=m+y.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function l(o,c,d){const m=this.previous,p=this.events;let g=0;return y;function y(v){return m===126&&p[p.length-1][1].type!=="characterEscape"?d(v):(o.enter("strikethroughSequenceTemporary"),E(v))}function E(v){const w=Go(m);if(v===126)return g>1?d(v):(o.consume(v),g++,E);if(g<2&&!n)return d(v);const C=o.exit("strikethroughSequenceTemporary"),S=Go(v);return C._open=!S||S===2&&!!w,C._close=!w||w===2&&!!S,c(v)}}}class LB{constructor(){this.map=[]}add(t,n,r){IB(this,t,n,r)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0}}function IB(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function OB(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function DB(){return{flow:{null:{name:"table",tokenize:jB,resolveAll:MB}}}}function jB(e,t,n){const r=this;let i=0,l=0,o;return c;function c(M){let K=r.events.length-1;for(;K>-1;){const de=r.events[K][1].type;if(de==="lineEnding"||de==="linePrefix")K--;else break}const V=K>-1?r.events[K][1].type:null,he=V==="tableHead"||V==="tableRow"?U:d;return he===U&&r.parser.lazy[r.now().line]?n(M):he(M)}function d(M){return e.enter("tableHead"),e.enter("tableRow"),m(M)}function m(M){return M===124||(o=!0,l+=1),p(M)}function p(M){return M===null?n(M):ct(M)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),E):n(M):Ot(M)?$t(e,p,"whitespace")(M):(l+=1,o&&(o=!1,i+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),o=!0,p):(e.enter("data"),g(M)))}function g(M){return M===null||M===124||bn(M)?(e.exit("data"),p(M)):(e.consume(M),M===92?y:g)}function y(M){return M===92||M===124?(e.consume(M),g):g(M)}function E(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),o=!1,Ot(M)?$t(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):v(M))}function v(M){return M===45||M===58?C(M):M===124?(o=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),w):$(M)}function w(M){return Ot(M)?$t(e,C,"whitespace")(M):C(M)}function C(M){return M===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),S):M===45?(l+=1,S(M)):M===null||ct(M)?H(M):$(M)}function S(M){return M===45?(e.enter("tableDelimiterFiller"),N(M)):$(M)}function N(M){return M===45?(e.consume(M),N):M===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(M))}function A(M){return Ot(M)?$t(e,H,"whitespace")(M):H(M)}function H(M){return M===124?v(M):M===null||ct(M)?!o||i!==l?$(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):$(M)}function $(M){return n(M)}function U(M){return e.enter("tableRow"),P(M)}function P(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),P):M===null||ct(M)?(e.exit("tableRow"),t(M)):Ot(M)?$t(e,P,"whitespace")(M):(e.enter("data"),Y(M))}function Y(M){return M===null||M===124||bn(M)?(e.exit("data"),P(M)):(e.consume(M),M===92?fe:Y)}function fe(M){return M===92||M===124?(e.consume(M),Y):Y(M)}}function MB(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],o=[0,0,0,0],c=!1,d=0,m,p,g;const y=new LB;for(;++n<e.length;){const E=e[n],v=E[1];E[0]==="enter"?v.type==="tableHead"?(c=!1,d!==0&&(q_(y,t,d,m,p),p=void 0,d=0),m={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(n,0,[["enter",m,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,g=void 0,l=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},y.add(n,0,[["enter",p,t]])),i=v.type==="tableDelimiterRow"?2:p?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],g=Ef(y,t,l,i,void 0,g),l=[0,0,0,0]),o[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(o[0]=o[1],g=Ef(y,t,l,i,void 0,g)),l=o,o=[l[1],n,0,0])):v.type==="tableHead"?(c=!0,d=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(d=n,l[1]!==0?(o[0]=o[1],g=Ef(y,t,l,i,n,g)):o[1]!==0&&(g=Ef(y,t,o,i,n,g)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(o[3]=n)}for(d!==0&&q_(y,t,d,m,p),y.consume(t.events),n=-1;++n<t.events.length;){const E=t.events[n];E[0]==="enter"&&E[1].type==="table"&&(E[1]._align=OB(t.events,n))}return e}function Ef(e,t,n,r,i,l){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},Do(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const d=Do(t.events,n[1]);if(l={type:o,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const m=Do(t.events,n[2]),p=Do(t.events,n[3]),g={type:c,start:Object.assign({},m),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const y=t.events[n[2]],E=t.events[n[3]];if(y[1].end=Object.assign({},E[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,w=n[3]-n[2]-1;e.add(v,w,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return i!==void 0&&(l.end=Object.assign({},Do(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function q_(e,t,n,r,i){const l=[],o=Do(t.events,n);i&&(i.end=Object.assign({},o),l.push(["exit",i,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function Do(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const PB={name:"tasklistCheck",tokenize:UB};function BB(){return{text:{91:PB}}}function UB(e,t,n){const r=this;return i;function i(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),l)}function l(d){return bn(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),o):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),o):n(d)}function o(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return ct(d)?t(d):Ot(d)?e.check({tokenize:HB},t,n)(d):n(d)}}function HB(e,t,n){return $t(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function zB(e){return ow([K7(),TB(),RB(e),DB(),BB()])}const FB={};function $B(e){const t=this,n=e||FB,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(zB(n)),l.push(G7()),o.push(q7(n))}var VB=Object.defineProperty,GB=Object.defineProperties,qB=Object.getOwnPropertyDescriptors,Y_=Object.getOwnPropertySymbols,YB=Object.prototype.hasOwnProperty,WB=Object.prototype.propertyIsEnumerable,W_=(e,t,n)=>t in e?VB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kw=(e,t)=>{for(var n in t||(t={}))YB.call(t,n)&&W_(e,n,t[n]);if(Y_)for(var n of Y_(t))WB.call(t,n)&&W_(e,n,t[n]);return e},ww=(e,t)=>GB(e,qB(t)),Or=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},QB=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},XB=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!QB(e,n)&&(t+=1)}return t},qi=(e,t)=>{let n=!1,r=!1,i=-1;for(let l=0;l<e.length;l+=1){if(e[l]==="\\"&&l+1<e.length&&e[l+1]==="`"){l+=1;continue}if(e.substring(l,l+3)==="```"){r=!r,l+=2;continue}if(!r&&e[l]==="`")if(n){if(i<t&&t<l)return!0;n=!1,i=-1}else n=!0,i=l}return!1},KB=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,ZB=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(KB,(t,n,r,i)=>Or(e,i)?t:`${n}\\>${r}`),JB=/(\*\*)([^*]*\*?)$/,eU=/(__)([^_]*?)$/,tU=/(\*\*\*)([^*]*?)$/,nU=/(\*)([^*]*?)$/,rU=/(_)([^_]*?)$/,aU=/(`)([^`]*?)$/,sU=/(~~)([^~]*?)$/,$l=/^[\s_~*`]*$/,Cw=/^[\s]*[-*+][\s]+$/,iU=/[\p{L}\p{N}_]/u,lU=/^```[^`\n]*```?$/,oU=/^\*{4,}$/,uU=/(__)([^_]+)_$/,cU=/(~~)([^~]+)~$/,Q_=/~~/g,Yi=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:iU.test(e)},dU=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},Sw=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},$h=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},fU=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
260
+ `)return!1}return!1},Nw=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?fU(e,t):!1;if(e[n]===`
261
+ `)return!1}return!1},hU=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
262
+ `)return!1}return!1},G1=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
263
+ `){r=d+1;break}let i=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
264
+ `){i=d;break}let l=e.substring(r,i),o=0,c=!1;for(let d of l)if(d===n)o+=1;else if(d!==" "&&d!==" "){c=!0;break}return o>=3&&!c},mU=(e,t,n,r)=>n==="\\"||e.includes("$")&&$h(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&Yi(n)&&Yi(r)||(!n||n===" "||n===" "||n===`
265
+ `)&&(!r||r===" "||r===" "||r===`
266
+ `)),Aw=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let l=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";mU(e,i,l,o)||(t+=1)}return t},pU=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&$h(e,t)||Nw(e,t)||hU(e,t)||n==="_"||r==="_"||n&&r&&Yi(n)&&Yi(r)),gU=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let l=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";pU(e,i,l,o)||(t+=1)}return t},bU=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},q1=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},X_=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},xU=(e,t,n)=>{if(!t||$l.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
267
+ `),i=r===-1?0:r+1,l=e.substring(i,n);return Cw.test(l)&&t.includes(`
268
+ `)?!0:G1(e,n,"*")},yU=e=>{let t=e.match(JB);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Or(e,r)||qi(e,r)||xU(e,n,r)?e:q1(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},EU=(e,t,n)=>{if(!t||$l.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
269
+ `),i=r===-1?0:r+1,l=e.substring(i,n);return Cw.test(l)&&t.includes(`
270
+ `)?!0:G1(e,n,"_")},_U=e=>{let t=e.match(eU);if(!t){let i=e.match(uU);if(i){let l=e.lastIndexOf(i[1]);if(!(Or(e,l)||qi(e,l))&&X_(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Or(e,r)||qi(e,r)||EU(e,n,r)?e:X_(e)%2===1?`${e}__`:e},TU=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!$h(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
271
+ `)&&(!i||i===" "||i===" "||i===`
272
+ `)||r&&i&&Yi(r)&&Yi(i))continue;return n}}return-1},vU=e=>{if(!e.match(nU))return e;let t=TU(e);if(t===-1||Or(e,t)||qi(e,t))return e;let n=e.substring(t+1);return!n||$l.test(n)?e:Aw(e)%2===1?`${e}*`:e},Rw=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!$h(e,n)&&!Nw(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&Yi(r)&&Yi(i))continue;return n}}return-1},kU=e=>{let t=e.length;for(;t>0&&e[t-1]===`
273
+ `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},wU=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(q1(t)%2!==1)return null;let n=t.indexOf("**"),r=Rw(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},CU=e=>{if(!e.match(rU))return e;let t=Rw(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||$l.test(n)||Or(e,t)||qi(e,t))return e;if(gU(e)%2===1){let r=wU(e);return r!==null?r:kU(e)}return e},SU=e=>{let t=q1(e),n=Aw(e);return t%2===0&&n%2===0},NU=(e,t,n)=>!t||$l.test(t)||Or(e,n)||qi(e,n)?!0:G1(e,n,"*"),AU=e=>{if(oU.test(e))return e;let t=e.match(tU);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return NU(e,n,r)?e:bU(e)%2===1?SU(e)?e:`${e}***`:e},RU=/<[a-zA-Z/][^>]*$/,LU=e=>{let t=e.match(RU);return!t||t.index===void 0||Or(e,t.index)?e:e.substring(0,t.index).trimEnd()},IU=e=>!e.match(lU)||e.includes(`
274
+ `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,OU=e=>(e.match(/```/g)||[]).length%2===1,DU=e=>{let t=IU(e);if(t!==null)return t;let n=e.match(aU);if(n&&!OU(e)){let r=n[2];if(!r||$l.test(r))return e;if(XB(e)%2===1)return`${e}\``}return e},Lw=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",jU=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!Lw(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},MU=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!Lw(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},PU=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
275
+ `,t)!==-1&&!e.endsWith(`
276
+ `)?`${e}
277
+ $$`:`${e}$$`},BU=e=>jU(e)%2===0?e:PU(e),UU=e=>MU(e)%2===1?`${e}$`:e,HU=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=dU(e,t);if(r===-1||Or(e,r))return null;let i=r>0&&e[r-1]==="!",l=i?r-1:r,o=e.substring(0,l);if(i)return o;let c=e.substring(r+1,t);return n==="text-only"?`${o}${c}`:`${o}[${c}](streamdown:incomplete-link)`},K_=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Or(e,n)){if(n>0&&e[n-1]==="!")continue;let r=Sw(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},zU=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let l=e.substring(0,i);if(r)return l;if(n==="text-only"){let o=K_(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if(Sw(e,t)===-1){let l=e.substring(0,i);if(r)return l;if(n==="text-only"){let o=K_(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},Iw=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Or(e,n)){let r=HU(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Or(e,r)){let i=zU(e,r,t);if(i!==null)return i}return e},FU=/^-{1,2}$/,$U=/^[\s]*-{1,2}[\s]+$/,VU=/^={1,2}$/,GU=/^[\s]*={1,2}[\s]+$/,qU=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
278
+ `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(FU.test(i)&&!n.match($U)){let l=r.split(`
279
+ `).at(-1);if(l&&l.trim().length>0)return`${e}​`}if(VU.test(i)&&!n.match(GU)){let l=r.split(`
280
+ `).at(-1);if(l&&l.trim().length>0)return`${e}​`}return e},YU=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),WU=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(YU,(t,n)=>Or(e,n)?t:"\\~"),QU=e=>{var t,n;let r=e.match(sU);if(r){let i=r[2];if(!i||$l.test(i))return e;let l=e.lastIndexOf(r[1]);if(Or(e,l)||qi(e,l))return e;if(((t=e.match(Q_))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(cU);if(i){let l=e.lastIndexOf(i[0].slice(0,2));if(Or(e,l)||qi(e,l))return e;if(((n=e.match(Q_))==null?void 0:n.length)%2===1)return`${e}~`}}return e},O0=e=>e!==!1,XU=e=>e===!0,Rr={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},KU=[{handler:{name:"singleTilde",handle:WU,priority:Rr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:ZB,priority:Rr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:LU,priority:Rr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:qU,priority:Rr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:Iw,priority:Rr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:AU,priority:Rr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:yU,priority:Rr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:_U,priority:Rr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:vU,priority:Rr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:CU,priority:Rr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:DU,priority:Rr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:QU,priority:Rr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:BU,priority:Rr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:UU,priority:Rr.INLINE_KATEX},optionKey:"inlineKatex"}],ZU=e=>{var t;let n=(t=e==null?void 0:e.linkMode)!=null?t:"protocol";return KU.filter(({handler:r,optionKey:i})=>r.name==="links"?O0(e==null?void 0:e.links)||O0(e==null?void 0:e.images):r.name==="inlineKatex"?XU(e==null?void 0:e.inlineKatex):O0(e==null?void 0:e[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:ww(kw({},r),{handle:l=>Iw(l,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},JU=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=ZU(t),l=((n=t==null?void 0:t.handlers)!=null?n:[]).map(c=>{var d;return{handler:ww(kw({},c),{priority:(d=c.priority)!=null?d:Rr.DEFAULT}),earlyReturn:void 0}}),o=[...i,...l].sort((c,d)=>{var m,p;return((m=c.handler.priority)!=null?m:0)-((p=d.handler.priority)!=null?p:0)});for(let{handler:c,earlyReturn:d}of o)if(r=c.handle(r),d!=null&&d(r))return r;return r},eH=JU;function Ow(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ow(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Dw(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ow(e))&&(r&&(r+=" "),r+=t);return r}const tH=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},nH=(e,t)=>({classGroupId:e,validator:t}),jw=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hh="-",Z_=[],rH="arbitrary..",aH=e=>{const t=iH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return sH(o);const c=o.split(hh),d=c[0]===""&&c.length>1?1:0;return Mw(c,d,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const d=r[o],m=n[o];return d?m?tH(m,d):d:m||Z_}return n[o]||Z_}}},Mw=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],l=n.nextPart.get(i);if(l){const m=Mw(e,t+1,l);if(m)return m}const o=n.validators;if(o===null)return;const c=t===0?e.join(hh):e.slice(t).join(hh),d=o.length;for(let m=0;m<d;m++){const p=o[m];if(p.validator(c))return p.classGroupId}},sH=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?rH+r:void 0})(),iH=e=>{const{theme:t,classGroups:n}=e;return lH(n,t)},lH=(e,t)=>{const n=jw();for(const r in e){const i=e[r];Y1(i,n,r,t)}return n},Y1=(e,t,n,r)=>{const i=e.length;for(let l=0;l<i;l++){const o=e[l];oH(o,t,n,r)}},oH=(e,t,n,r)=>{if(typeof e=="string"){uH(e,t,n);return}if(typeof e=="function"){cH(e,t,n,r);return}dH(e,t,n,r)},uH=(e,t,n)=>{const r=e===""?t:Pw(t,e);r.classGroupId=n},cH=(e,t,n,r)=>{if(fH(e)){Y1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(nH(n,e))},dH=(e,t,n,r)=>{const i=Object.entries(e),l=i.length;for(let o=0;o<l;o++){const[c,d]=i[o];Y1(d,Pw(t,c),n,r)}},Pw=(e,t)=>{let n=e;const r=t.split(hh),i=r.length;for(let l=0;l<i;l++){const o=r[l];let c=n.nextPart.get(o);c||(c=jw(),n.nextPart.set(o,c)),n=c}return n},fH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,hH=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(l,o)=>{n[l]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let o=n[l];if(o!==void 0)return o;if((o=r[l])!==void 0)return i(l,o),o},set(l,o){l in n?n[l]=o:i(l,o)}}},Lg="!",J_=":",mH=[],eT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),pH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const l=[];let o=0,c=0,d=0,m;const p=i.length;for(let w=0;w<p;w++){const C=i[w];if(o===0&&c===0){if(C===J_){l.push(i.slice(d,w)),d=w+1;continue}if(C==="/"){m=w;continue}}C==="["?o++:C==="]"?o--:C==="("?c++:C===")"&&c--}const g=l.length===0?i:i.slice(d);let y=g,E=!1;g.endsWith(Lg)?(y=g.slice(0,-1),E=!0):g.startsWith(Lg)&&(y=g.slice(1),E=!0);const v=m&&m>d?m-d:void 0;return eT(l,E,y,v)};if(t){const i=t+J_,l=r;r=o=>o.startsWith(i)?l(o.slice(i.length)):eT(mH,!1,o,void 0,!0)}if(n){const i=r;r=l=>n({className:l,parseClassName:i})}return r},gH=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let l=0;l<n.length;l++){const o=n[l],c=o[0]==="[",d=t.has(o);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},bH=e=>({cache:hH(e.cacheSize),parseClassName:pH(e),sortModifiers:gH(e),...aH(e)}),xH=/\s+/,yH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:l}=t,o=[],c=e.trim().split(xH);let d="";for(let m=c.length-1;m>=0;m-=1){const p=c[m],{isExternal:g,modifiers:y,hasImportantModifier:E,baseClassName:v,maybePostfixModifierPosition:w}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let C=!!w,S=r(C?v.substring(0,w):v);if(!S){if(!C){d=p+(d.length>0?" "+d:d);continue}if(S=r(v),!S){d=p+(d.length>0?" "+d:d);continue}C=!1}const N=y.length===0?"":y.length===1?y[0]:l(y).join(":"),A=E?N+Lg:N,H=A+S;if(o.indexOf(H)>-1)continue;o.push(H);const $=i(S,C);for(let U=0;U<$.length;++U){const P=$[U];o.push(A+P)}d=p+(d.length>0?" "+d:d)}return d},EH=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=Bw(n))&&(i&&(i+=" "),i+=r);return i},Bw=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Bw(e[r]))&&(n&&(n+=" "),n+=t);return n},_H=(e,...t)=>{let n,r,i,l;const o=d=>{const m=t.reduce((p,g)=>g(p),e());return n=bH(m),r=n.cache.get,i=n.cache.set,l=c,c(d)},c=d=>{const m=r(d);if(m)return m;const p=yH(d,n);return i(d,p),p};return l=o,(...d)=>l(EH(...d))},TH=[],Wn=e=>{const t=n=>n[e]||TH;return t.isThemeGetter=!0,t},Uw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,vH=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wH=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,CH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oi=e=>vH.test(e),St=e=>!!e&&!Number.isNaN(Number(e)),Di=e=>!!e&&Number.isInteger(Number(e)),D0=e=>e.endsWith("%")&&St(e.slice(0,-1)),qs=e=>kH.test(e),zw=()=>!0,AH=e=>wH.test(e)&&!CH.test(e),W1=()=>!1,RH=e=>SH.test(e),LH=e=>NH.test(e),IH=e=>!Ue(e)&&!$e(e),OH=e=>Qi(e,Vw,W1),Ue=e=>Uw.test(e),Sl=e=>Qi(e,Gw,AH),tT=e=>Qi(e,zH,St),DH=e=>Qi(e,Yw,zw),jH=e=>Qi(e,qw,W1),nT=e=>Qi(e,Fw,W1),MH=e=>Qi(e,$w,LH),_f=e=>Qi(e,Ww,RH),$e=e=>Hw.test(e),ec=e=>Vl(e,Gw),PH=e=>Vl(e,qw),rT=e=>Vl(e,Fw),BH=e=>Vl(e,Vw),UH=e=>Vl(e,$w),Tf=e=>Vl(e,Ww,!0),HH=e=>Vl(e,Yw,!0),Qi=(e,t,n)=>{const r=Uw.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Vl=(e,t,n=!1)=>{const r=Hw.exec(e);return r?r[1]?t(r[1]):n:!1},Fw=e=>e==="position"||e==="percentage",$w=e=>e==="image"||e==="url",Vw=e=>e==="length"||e==="size"||e==="bg-size",Gw=e=>e==="length",zH=e=>e==="number",qw=e=>e==="family-name",Yw=e=>e==="number"||e==="weight",Ww=e=>e==="shadow",FH=()=>{const e=Wn("color"),t=Wn("font"),n=Wn("text"),r=Wn("font-weight"),i=Wn("tracking"),l=Wn("leading"),o=Wn("breakpoint"),c=Wn("container"),d=Wn("spacing"),m=Wn("radius"),p=Wn("shadow"),g=Wn("inset-shadow"),y=Wn("text-shadow"),E=Wn("drop-shadow"),v=Wn("blur"),w=Wn("perspective"),C=Wn("aspect"),S=Wn("ease"),N=Wn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],$=()=>[...H(),$e,Ue],U=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],Y=()=>[$e,Ue,d],fe=()=>[Oi,"full","auto",...Y()],M=()=>[Di,"none","subgrid",$e,Ue],K=()=>["auto",{span:["full",Di,$e,Ue]},Di,$e,Ue],V=()=>[Di,"auto",$e,Ue],he=()=>["auto","min","max","fr",$e,Ue],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...Y()],ee=()=>[Oi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Y()],Te=()=>[Oi,"screen","full","dvw","lvw","svw","min","max","fit",...Y()],De=()=>[Oi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Y()],L=()=>[e,$e,Ue],F=()=>[...H(),rT,nT,{position:[$e,Ue]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",BH,OH,{size:[$e,Ue]}],ke=()=>[D0,ec,Sl],Ae=()=>["","none","full",m,$e,Ue],_e=()=>["",St,ec,Sl],et=()=>["solid","dashed","dotted","double"],st=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Me=()=>[St,D0,rT,nT],dt=()=>["","none",v,$e,Ue],pt=()=>["none",St,$e,Ue],Dt=()=>["none",St,$e,Ue],kn=()=>[St,$e,Ue],bt=()=>[Oi,"full",...Y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qs],breakpoint:[qs],color:[zw],container:[qs],"drop-shadow":[qs],ease:["in","out","in-out"],font:[IH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qs],shadow:[qs],spacing:["px",St],text:[qs],"text-shadow":[qs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Oi,Ue,$e,C]}],container:["container"],columns:[{columns:[St,Ue,$e,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:$()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:fe()}],"inset-x":[{"inset-x":fe()}],"inset-y":[{"inset-y":fe()}],start:[{"inset-s":fe(),start:fe()}],end:[{"inset-e":fe(),end:fe()}],"inset-bs":[{"inset-bs":fe()}],"inset-be":[{"inset-be":fe()}],top:[{top:fe()}],right:[{right:fe()}],bottom:[{bottom:fe()}],left:[{left:fe()}],visibility:["visible","invisible","collapse"],z:[{z:[Di,"auto",$e,Ue]}],basis:[{basis:[Oi,"full","auto",c,...Y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[St,Oi,"auto","initial","none",Ue]}],grow:[{grow:["",St,$e,Ue]}],shrink:[{shrink:["",St,$e,Ue]}],order:[{order:[Di,"first","last","none",$e,Ue]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":he()}],"auto-rows":[{"auto-rows":he()}],gap:[{gap:Y()}],"gap-x":[{"gap-x":Y()}],"gap-y":[{"gap-y":Y()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:Y()}],px:[{px:Y()}],py:[{py:Y()}],ps:[{ps:Y()}],pe:[{pe:Y()}],pbs:[{pbs:Y()}],pbe:[{pbe:Y()}],pt:[{pt:Y()}],pr:[{pr:Y()}],pb:[{pb:Y()}],pl:[{pl:Y()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":Y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Y()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...Te()]}],"min-inline-size":[{"min-inline":["auto",...Te()]}],"max-inline-size":[{"max-inline":["none",...Te()]}],"block-size":[{block:["auto",...De()]}],"min-block-size":[{"min-block":["auto",...De()]}],"max-block-size":[{"max-block":["none",...De()]}],w:[{w:[c,"screen",...ee()]}],"min-w":[{"min-w":[c,"screen","none",...ee()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",n,ec,Sl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,HH,DH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",D0,Ue]}],"font-family":[{font:[PH,jH,t]}],"font-features":[{"font-features":[Ue]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,$e,Ue]}],"line-clamp":[{"line-clamp":[St,"none",$e,tT]}],leading:[{leading:[l,...Y()]}],"list-image":[{"list-image":["none",$e,Ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,Ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...et(),"wavy"]}],"text-decoration-thickness":[{decoration:[St,"from-font","auto",$e,Sl]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[St,"auto",$e,Ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e,Ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e,Ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Di,$e,Ue],radial:["",$e,Ue],conic:[Di,$e,Ue]},UH,MH]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ke()}],"gradient-via-pos":[{via:ke()}],"gradient-to-pos":[{to:ke()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:Ae()}],"rounded-s":[{"rounded-s":Ae()}],"rounded-e":[{"rounded-e":Ae()}],"rounded-t":[{"rounded-t":Ae()}],"rounded-r":[{"rounded-r":Ae()}],"rounded-b":[{"rounded-b":Ae()}],"rounded-l":[{"rounded-l":Ae()}],"rounded-ss":[{"rounded-ss":Ae()}],"rounded-se":[{"rounded-se":Ae()}],"rounded-ee":[{"rounded-ee":Ae()}],"rounded-es":[{"rounded-es":Ae()}],"rounded-tl":[{"rounded-tl":Ae()}],"rounded-tr":[{"rounded-tr":Ae()}],"rounded-br":[{"rounded-br":Ae()}],"rounded-bl":[{"rounded-bl":Ae()}],"border-w":[{border:_e()}],"border-w-x":[{"border-x":_e()}],"border-w-y":[{"border-y":_e()}],"border-w-s":[{"border-s":_e()}],"border-w-e":[{"border-e":_e()}],"border-w-bs":[{"border-bs":_e()}],"border-w-be":[{"border-be":_e()}],"border-w-t":[{"border-t":_e()}],"border-w-r":[{"border-r":_e()}],"border-w-b":[{"border-b":_e()}],"border-w-l":[{"border-l":_e()}],"divide-x":[{"divide-x":_e()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_e()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...et(),"hidden","none"]}],"divide-style":[{divide:[...et(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...et(),"none","hidden"]}],"outline-offset":[{"outline-offset":[St,$e,Ue]}],"outline-w":[{outline:["",St,ec,Sl]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,Tf,_f]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",g,Tf,_f]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:_e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[St,Sl]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":_e()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",y,Tf,_f]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[St,$e,Ue]}],"mix-blend":[{"mix-blend":[...st(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":st()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[St]}],"mask-image-linear-from-pos":[{"mask-linear-from":Me()}],"mask-image-linear-to-pos":[{"mask-linear-to":Me()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":Me()}],"mask-image-t-to-pos":[{"mask-t-to":Me()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":Me()}],"mask-image-r-to-pos":[{"mask-r-to":Me()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":Me()}],"mask-image-b-to-pos":[{"mask-b-to":Me()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":Me()}],"mask-image-l-to-pos":[{"mask-l-to":Me()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":Me()}],"mask-image-x-to-pos":[{"mask-x-to":Me()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":Me()}],"mask-image-y-to-pos":[{"mask-y-to":Me()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[$e,Ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":Me()}],"mask-image-radial-to-pos":[{"mask-radial-to":Me()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":H()}],"mask-image-conic-pos":[{"mask-conic":[St]}],"mask-image-conic-from-pos":[{"mask-conic-from":Me()}],"mask-image-conic-to-pos":[{"mask-conic-to":Me()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,Ue]}],filter:[{filter:["","none",$e,Ue]}],blur:[{blur:dt()}],brightness:[{brightness:[St,$e,Ue]}],contrast:[{contrast:[St,$e,Ue]}],"drop-shadow":[{"drop-shadow":["","none",E,Tf,_f]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",St,$e,Ue]}],"hue-rotate":[{"hue-rotate":[St,$e,Ue]}],invert:[{invert:["",St,$e,Ue]}],saturate:[{saturate:[St,$e,Ue]}],sepia:[{sepia:["",St,$e,Ue]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,Ue]}],"backdrop-blur":[{"backdrop-blur":dt()}],"backdrop-brightness":[{"backdrop-brightness":[St,$e,Ue]}],"backdrop-contrast":[{"backdrop-contrast":[St,$e,Ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",St,$e,Ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[St,$e,Ue]}],"backdrop-invert":[{"backdrop-invert":["",St,$e,Ue]}],"backdrop-opacity":[{"backdrop-opacity":[St,$e,Ue]}],"backdrop-saturate":[{"backdrop-saturate":[St,$e,Ue]}],"backdrop-sepia":[{"backdrop-sepia":["",St,$e,Ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Y()}],"border-spacing-x":[{"border-spacing-x":Y()}],"border-spacing-y":[{"border-spacing-y":Y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$e,Ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[St,"initial",$e,Ue]}],ease:[{ease:["linear","initial",S,$e,Ue]}],delay:[{delay:[St,$e,Ue]}],animate:[{animate:["none",N,$e,Ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,$e,Ue]}],"perspective-origin":[{"perspective-origin":$()}],rotate:[{rotate:pt()}],"rotate-x":[{"rotate-x":pt()}],"rotate-y":[{"rotate-y":pt()}],"rotate-z":[{"rotate-z":pt()}],scale:[{scale:Dt()}],"scale-x":[{"scale-x":Dt()}],"scale-y":[{"scale-y":Dt()}],"scale-z":[{"scale-z":Dt()}],"scale-3d":["scale-3d"],skew:[{skew:kn()}],"skew-x":[{"skew-x":kn()}],"skew-y":[{"skew-y":kn()}],transform:[{transform:[$e,Ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:$()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:bt()}],"translate-x":[{"translate-x":bt()}],"translate-y":[{"translate-y":bt()}],"translate-z":[{"translate-z":bt()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e,Ue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mbs":[{"scroll-mbs":Y()}],"scroll-mbe":[{"scroll-mbe":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pbs":[{"scroll-pbs":Y()}],"scroll-pbe":[{"scroll-pbe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e,Ue]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[St,ec,Sl,tT]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Qw=_H(FH),$H=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,GH={};function aT(e,t){return(GH.jsx?VH:$H).test(e)}var No={},j0,sT;function qH(){if(sT)return j0;sT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
281
+ `,m="/",p="*",g="",y="comment",E="declaration";function v(C,S){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];S=S||{};var N=1,A=1;function H(de){var ne=de.match(t);ne&&(N+=ne.length);var z=de.lastIndexOf(d);A=~z?de.length-z:A+de.length}function $(){var de={line:N,column:A};return function(ne){return ne.position=new U(de),fe(),ne}}function U(de){this.start=de,this.end={line:N,column:A},this.source=S.source}U.prototype.content=C;function P(de){var ne=new Error(S.source+":"+N+":"+A+": "+de);if(ne.reason=de,ne.filename=S.source,ne.line=N,ne.column=A,ne.source=C,!S.silent)throw ne}function Y(de){var ne=de.exec(C);if(ne){var z=ne[0];return H(z),C=C.slice(z.length),ne}}function fe(){Y(n)}function M(de){var ne;for(de=de||[];ne=K();)ne!==!1&&de.push(ne);return de}function K(){var de=$();if(!(m!=C.charAt(0)||p!=C.charAt(1))){for(var ne=2;g!=C.charAt(ne)&&(p!=C.charAt(ne)||m!=C.charAt(ne+1));)++ne;if(ne+=2,g===C.charAt(ne-1))return P("End of comment missing");var z=C.slice(2,ne-2);return A+=2,H(z),C=C.slice(ne),A+=2,de({type:y,comment:z})}}function V(){var de=$(),ne=Y(r);if(ne){if(K(),!Y(i))return P("property missing ':'");var z=Y(l),ee=de({type:E,property:w(ne[0].replace(e,g)),value:z?w(z[0].replace(e,g)):g});return Y(o),ee}}function he(){var de=[];M(de);for(var ne;ne=V();)ne!==!1&&(de.push(ne),M(de));return de}return fe(),he()}function w(C){return C?C.replace(c,g):g}return j0=v,j0}var iT;function YH(){if(iT)return No;iT=1;var e=No&&No.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(No,"__esModule",{value:!0}),No.default=n;const t=e(qH());function n(r,i){let l=null;if(!r||typeof r!="string")return l;const o=(0,t.default)(r),c=typeof i=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:m,value:p}=d;c?i(m,p,d):p&&(l=l||{},l[m]=p)}),l}return No}var tc={},lT;function WH(){if(lT)return tc;lT=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(m){return!m||n.test(m)||e.test(m)},o=function(m,p){return p.toUpperCase()},c=function(m,p){return"".concat(p,"-")},d=function(m,p){return p===void 0&&(p={}),l(m)?m:(m=m.toLowerCase(),p.reactCompat?m=m.replace(i,c):m=m.replace(r,c),m.replace(t,o))};return tc.camelCase=d,tc}var nc,oT;function QH(){if(oT)return nc;oT=1;var e=nc&&nc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(YH()),n=WH();function r(i,l){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(o[(0,n.camelCase)(c,l)]=d)}),o}return r.default=r,nc=r,nc}var XH=QH();const KH=Eh(XH);function _c(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?uT(e.position):"start"in e||"end"in e?uT(e):"line"in e||"column"in e?Ig(e):""}function Ig(e){return cT(e&&e.line)+":"+cT(e&&e.column)}function uT(e){return Ig(e&&e.start)+"-"+Ig(e&&e.end)}function cT(e){return e&&typeof e=="number"?e:1}class Tr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(o=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?l.ruleId=r:(l.source=r.slice(0,d),l.ruleId=r.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=_c(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Tr.prototype.file="";Tr.prototype.name="";Tr.prototype.reason="";Tr.prototype.message="";Tr.prototype.stack="";Tr.prototype.column=void 0;Tr.prototype.line=void 0;Tr.prototype.ancestors=void 0;Tr.prototype.cause=void 0;Tr.prototype.fatal=void 0;Tr.prototype.place=void 0;Tr.prototype.ruleId=void 0;Tr.prototype.source=void 0;const Q1={}.hasOwnProperty,ZH=new Map,JH=/[A-Z]/g,ez=new Set(["table","tbody","thead","tfoot","tr"]),tz=new Set(["td","th"]),Xw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=cz(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=uz(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?xs:Ko,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Kw(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Kw(e,t,n){if(t.type==="element")return rz(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return az(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return iz(e,t,n);if(t.type==="mdxjsEsm")return sz(e,t);if(t.type==="root")return lz(e,t,n);if(t.type==="text")return oz(e,t)}function rz(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=xs,e.schema=i),e.ancestors.push(t);const l=Jw(e,t.tagName,!1),o=dz(e,t);let c=K1(e,t);return ez.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!kh(d):!0})),Zw(e,o,l,t),X1(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function az(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Oc(e,t.position)}function sz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Oc(e,t.position)}function iz(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=xs,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:Jw(e,t.name,!0),o=fz(e,t),c=K1(e,t);return Zw(e,o,l,t),X1(o,c),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function lz(e,t,n){const r={};return X1(r,K1(e,t)),e.create(t,e.Fragment,r,n)}function oz(e,t){return t.value}function Zw(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function X1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function uz(e,t,n){return r;function r(i,l,o,c){const m=Array.isArray(o.children)?n:t;return c?m(l,o,c):m(l,o)}}function cz(e,t){return n;function n(r,i,l,o){const c=Array.isArray(l.children),d=ys(r);return t(i,l,o,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function dz(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Q1.call(t.properties,i)){const l=hz(e,i,t.properties[i]);if(l){const[o,c]=l;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&tz.has(t.tagName)?r=c:n[o]=c}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function fz(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Oc(e,t.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else Oc(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function K1(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ZH;for(;++r<t.children.length;){const l=t.children[r];let o;if(e.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const m=i.get(d)||0;o=d+"-"+m,i.set(d,m+1)}}const c=Kw(e,l,o);c!==void 0&&n.push(c)}return n}function hz(e,t,n){const r=Hc(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?f1(n):h1(n)),r.property==="style"){let i=typeof n=="object"?n:mz(e,String(n));return e.stylePropertyNameCase==="css"&&(i=pz(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?xR[r.property]||r.property:r.attribute,n]}}function mz(e,t){try{return KH(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Tr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Xw+"#cannot-parse-style-attribute",i}}function Jw(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,o;for(;++l<i.length;){const c=aT(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(l&&c.type==="Literal"),optional:!1}:c}r=o}else r=aT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Q1.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Oc(e)}function Oc(e,t){const n=new Tr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Xw+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pz(e){const t={};let n;for(n in e)Q1.call(e,n)&&(t[gz(n)]=e[n]);return t}function gz(e){let t=e.replace(JH,bz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function bz(e){return"-"+e.toLowerCase()}const M0={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"]},xz={tokenize:yz};function yz(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),$t(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),l(c)}function l(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return ct(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),o)}}const Ez={tokenize:_z},dT={tokenize:Tz};function _z(e){const t=this,n=[];let r=0,i,l,o;return c;function c(A){if(r<n.length){const H=n[r];return t.containerState=H[1],e.attempt(H[0].continuation,d,m)(A)}return m(A)}function d(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&N();const H=t.events.length;let $=H,U;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){U=t.events[$][1].end;break}S(r);let P=H;for(;P<t.events.length;)t.events[P][1].end={...U},P++;return sa(t.events,$+1,0,t.events.slice(H)),t.events.length=P,m(A)}return c(A)}function m(A){if(r===n.length){if(!i)return y(A);if(i.currentConstruct&&i.currentConstruct.concrete)return v(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dT,p,g)(A)}function p(A){return i&&N(),S(r),y(A)}function g(A){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,v(A)}function y(A){return t.containerState={},e.attempt(dT,E,v)(A)}function E(A){return r++,n.push([t.currentConstruct,t.containerState]),y(A)}function v(A){if(A===null){i&&N(),S(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),w(A)}function w(A){if(A===null){C(e.exit("chunkFlow"),!0),S(0),e.consume(A);return}return ct(A)?(e.consume(A),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(A),w)}function C(A,H){const $=t.sliceStream(A);if(H&&$.push(null),A.previous=l,l&&(l.next=A),l=A,i.defineSkip(A.start),i.write($),t.parser.lazy[A.start.line]){let U=i.events.length;for(;U--;)if(i.events[U][1].start.offset<o&&(!i.events[U][1].end||i.events[U][1].end.offset>o))return;const P=t.events.length;let Y=P,fe,M;for(;Y--;)if(t.events[Y][0]==="exit"&&t.events[Y][1].type==="chunkFlow"){if(fe){M=t.events[Y][1].end;break}fe=!0}for(S(r),U=P;U<t.events.length;)t.events[U][1].end={...M},U++;sa(t.events,Y+1,0,t.events.slice(P)),t.events.length=U}}function S(A){let H=n.length;for(;H-- >A;){const $=n[H];t.containerState=$[1],$[0].exit.call(t,e)}n.length=A}function N(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Tz(e,t,n){return $t(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const vz={tokenize:kz};function kz(e){const t=this,n=e.attempt(Gc,r,e.attempt(this.parser.constructs.flowInitial,i,$t(e,e.attempt(this.parser.constructs.flow,i,e.attempt(SP,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const wz={resolveAll:tC()},Cz=eC("string"),Sz=eC("text");function eC(e){return{resolveAll:tC(e==="text"?Nz:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,o,c);return o;function o(p){return m(p)?l(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return m(p)?(n.exit("data"),l(p)):(n.consume(p),d)}function m(p){if(p===null)return!0;const g=i[p];let y=-1;if(g)for(;++y<g.length;){const E=g[y];if(!E.previous||E.previous.call(r,r.previous))return!0}return!1}}}function tC(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function Nz(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let l=i.length,o=-1,c=0,d;for(;l--;){const m=i[l];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(m===-2)d=!0,c++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const m={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const Az={42:$r,43:$r,45:$r,48:$r,49:$r,50:$r,51:$r,52:$r,53:$r,54:$r,55:$r,56:$r,57:$r,62:bw},Rz={91:IP},Lz={[-2]:L0,[-1]:L0,32:L0},Iz={35:BP,42:Gf,45:[G_,Gf],60:FP,61:G_,95:Gf,96:$_,126:$_},Oz={38:yw,92:xw},Dz={[-5]:I0,[-4]:I0,[-3]:I0,33:iB,38:yw,42:Rg,60:[oP,QP],91:oB,92:[MP,xw],93:V1,95:Rg,96:_P},jz={null:[Rg,wz]},Mz={null:[42,95]},Pz={null:[]},Bz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Mz,contentInitial:Rz,disable:Pz,document:Az,flow:Iz,flowInitial:Lz,insideSpan:jz,string:Oz,text:Dz},Symbol.toStringTag,{value:"Module"}));function Uz(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let o=[],c=[];const d={attempt:P($),check:P(U),consume:N,enter:A,exit:H,interrupt:P(U,{interrupt:!0})},m={code:null,containerState:{},defineSkip:w,events:[],now:v,parser:e,previous:null,sliceSerialize:y,sliceStream:E,write:g};let p=t.tokenize.call(m,d);return t.resolveAll&&l.push(t),m;function g(K){return o=Ca(o,K),C(),o[o.length-1]!==null?[]:(Y(t,0),m.events=Fh(l,m.events,m),m.events)}function y(K,V){return zz(E(K),V)}function E(K){return Hz(o,K)}function v(){const{_bufferIndex:K,_index:V,line:he,column:de,offset:ne}=r;return{_bufferIndex:K,_index:V,line:he,column:de,offset:ne}}function w(K){i[K.line]=K.column,M()}function C(){let K;for(;r._index<o.length;){const V=o[r._index];if(typeof V=="string")for(K=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===K&&r._bufferIndex<V.length;)S(V.charCodeAt(r._bufferIndex));else S(V)}}function S(K){p=p(K)}function N(K){ct(K)?(r.line++,r.column=1,r.offset+=K===-3?2:1,M()):K!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=K}function A(K,V){const he=V||{};return he.type=K,he.start=v(),m.events.push(["enter",he,m]),c.push(he),he}function H(K){const V=c.pop();return V.end=v(),m.events.push(["exit",V,m]),V}function $(K,V){Y(K,V.from)}function U(K,V){V.restore()}function P(K,V){return he;function he(de,ne,z){let ee,Te,De,L;return Array.isArray(de)?se(de):"tokenize"in de?se([de]):F(de);function F(_e){return et;function et(st){const Me=st!==null&&_e[st],dt=st!==null&&_e.null,pt=[...Array.isArray(Me)?Me:Me?[Me]:[],...Array.isArray(dt)?dt:dt?[dt]:[]];return se(pt)(st)}}function se(_e){return ee=_e,Te=0,_e.length===0?z:O(_e[Te])}function O(_e){return et;function et(st){return L=fe(),De=_e,_e.partial||(m.currentConstruct=_e),_e.name&&m.parser.constructs.disable.null.includes(_e.name)?Ae():_e.tokenize.call(V?Object.assign(Object.create(m),V):m,d,ke,Ae)(st)}}function ke(_e){return K(De,L),ne}function Ae(_e){return L.restore(),++Te<ee.length?O(ee[Te]):z}}}function Y(K,V){K.resolveAll&&!l.includes(K)&&l.push(K),K.resolve&&sa(m.events,V,m.events.length-V,K.resolve(m.events.slice(V),m)),K.resolveTo&&(m.events=K.resolveTo(m.events,m))}function fe(){const K=v(),V=m.previous,he=m.currentConstruct,de=m.events.length,ne=Array.from(c);return{from:de,restore:z};function z(){r=K,m.previous=V,m.currentConstruct=he,m.events.length=de,c=ne,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Hz(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,l)];else{if(o=e.slice(n,i),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function zz(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
282
+ `;break}case-3:{o=`\r
283
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function Fz(e){const r={constructs:ow([Bz,...(e||{}).extensions||[]]),content:i(xz),defined:[],document:i(Ez),flow:i(vz),lazy:{},string:i(Cz),text:i(Sz)};return r;function i(l){return o;function o(c){return Uz(r,l,c)}}}function $z(e){for(;!Ew(e););return e}const fT=/[\0\t\n\r]/g;function Vz(){let e=1,t="",n=!0,r;return i;function i(l,o,c){const d=[];let m,p,g,y,E;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),g=0,t="",n&&(l.charCodeAt(0)===65279&&g++,n=void 0);g<l.length;){if(fT.lastIndex=g,m=fT.exec(l),y=m&&m.index!==void 0?m.index:l.length,E=l.charCodeAt(y),!m){t=l.slice(g);break}if(E===10&&g===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),g<y&&(d.push(l.slice(g,y)),e+=y-g),E){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}g=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const nC={}.hasOwnProperty;function Gz(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),qz(n)($z(Fz(n).document().write(Vz()(e,t,!0))))}function qz(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Ke),autolinkProtocol:fe,autolinkEmail:fe,atxHeading:l(He),blockQuote:l(dt),characterEscape:fe,characterReference:fe,codeFenced:l(pt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(pt,o),codeText:l(Dt,o),codeTextData:fe,data:fe,codeFlowValue:fe,definition:l(kn),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(bt),hardBreakEscape:l(Ve),hardBreakTrailing:l(Ve),htmlFlow:l(Qt,o),htmlFlowData:fe,htmlText:l(Qt,o),htmlTextData:fe,image:l(at),label:o,link:l(Ke),listItem:l(an),listItemValue:y,listOrdered:l(Ge,g),listUnordered:l(Ge),paragraph:l(xn),reference:O,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(He),strong:l(or),thematicBreak:l(Zn)},exit:{atxHeading:d(),atxHeadingSequence:$,autolink:d(),autolinkEmail:Me,autolinkProtocol:st,blockQuote:d(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:Ae,characterReferenceMarkerNumeric:Ae,characterReferenceValue:_e,characterReference:et,codeFenced:d(C),codeFencedFence:w,codeFencedFenceInfo:E,codeFencedFenceMeta:v,codeFlowValue:M,codeIndented:d(S),codeText:d(ne),codeTextData:M,data:M,definition:d(),definitionDestinationString:H,definitionLabelString:N,definitionTitleString:A,emphasis:d(),hardBreakEscape:d(V),hardBreakTrailing:d(V),htmlFlow:d(he),htmlFlowData:M,htmlText:d(de),htmlTextData:M,image:d(ee),label:De,labelText:Te,lineEnding:K,link:d(z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ke,resourceDestinationString:L,resourceTitleString:F,resource:se,setextHeading:d(Y),setextHeadingLineSequence:P,setextHeadingText:U,strong:d(),thematicBreak:d()}};rC(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(pe){let Ce={type:"root",children:[]};const Qe={stack:[Ce],tokenStack:[],config:t,enter:c,exit:m,buffer:o,resume:p,data:n},lt=[];let xt=-1;for(;++xt<pe.length;)if(pe[xt][1].type==="listOrdered"||pe[xt][1].type==="listUnordered")if(pe[xt][0]==="enter")lt.push(xt);else{const sn=lt.pop();xt=i(pe,sn,xt)}for(xt=-1;++xt<pe.length;){const sn=t[pe[xt][0]];nC.call(sn,pe[xt][1].type)&&sn[pe[xt][1].type].call(Object.assign({sliceSerialize:pe[xt][2].sliceSerialize},Qe),pe[xt][1])}if(Qe.tokenStack.length>0){const sn=Qe.tokenStack[Qe.tokenStack.length-1];(sn[1]||hT).call(Qe,void 0,sn[0])}for(Ce.position={start:ji(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:ji(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},xt=-1;++xt<t.transforms.length;)Ce=t.transforms[xt](Ce)||Ce;return Ce}function i(pe,Ce,Qe){let lt=Ce-1,xt=-1,sn=!1,mn,xe,Se,ze;for(;++lt<=Qe;){const Pe=pe[lt];switch(Pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pe[0]==="enter"?xt++:xt--,ze=void 0;break}case"lineEndingBlank":{Pe[0]==="enter"&&(mn&&!ze&&!xt&&!Se&&(Se=lt),ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ze=void 0}if(!xt&&Pe[0]==="enter"&&Pe[1].type==="listItemPrefix"||xt===-1&&Pe[0]==="exit"&&(Pe[1].type==="listUnordered"||Pe[1].type==="listOrdered")){if(mn){let Ze=lt;for(xe=void 0;Ze--;){const Q=pe[Ze];if(Q[1].type==="lineEnding"||Q[1].type==="lineEndingBlank"){if(Q[0]==="exit")continue;xe&&(pe[xe][1].type="lineEndingBlank",sn=!0),Q[1].type="lineEnding",xe=Ze}else if(!(Q[1].type==="linePrefix"||Q[1].type==="blockQuotePrefix"||Q[1].type==="blockQuotePrefixWhitespace"||Q[1].type==="blockQuoteMarker"||Q[1].type==="listItemIndent"))break}Se&&(!xe||Se<xe)&&(mn._spread=!0),mn.end=Object.assign({},xe?pe[xe][1].start:Pe[1].end),pe.splice(xe||lt,0,["exit",mn,Pe[2]]),lt++,Qe++}if(Pe[1].type==="listItemPrefix"){const Ze={type:"listItem",_spread:!1,start:Object.assign({},Pe[1].start),end:void 0};mn=Ze,pe.splice(lt,0,["enter",Ze,Pe[2]]),lt++,Qe++,Se=void 0,ze=!0}}}return pe[Ce][1]._spread=sn,Qe}function l(pe,Ce){return Qe;function Qe(lt){c.call(this,pe(lt),lt),Ce&&Ce.call(this,lt)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(pe,Ce,Qe){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Ce,Qe||void 0]),pe.position={start:ji(Ce.start),end:void 0}}function d(pe){return Ce;function Ce(Qe){pe&&pe.call(this,Qe),m.call(this,Qe)}}function m(pe,Ce){const Qe=this.stack.pop(),lt=this.tokenStack.pop();if(lt)lt[0].type!==pe.type&&(Ce?Ce.call(this,pe,lt[0]):(lt[1]||hT).call(this,pe,lt[0]));else throw new Error("Cannot close `"+pe.type+"` ("+_c({start:pe.start,end:pe.end})+"): it’s not open");Qe.position.end=ji(pe.end)}function p(){return H1(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(pe){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function E(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=pe}function v(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=pe}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe.replace(/(\r?\n|\r)$/g,"")}function N(pe){const Ce=this.resume(),Qe=this.stack[this.stack.length-1];Qe.label=Ce,Qe.identifier=Qa(this.sliceSerialize(pe)).toLowerCase()}function A(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=pe}function H(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=pe}function $(pe){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Qe=this.sliceSerialize(pe).length;Ce.depth=Qe}}function U(){this.data.setextHeadingSlurpLineEnding=!0}function P(pe){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function Y(){this.data.setextHeadingSlurpLineEnding=void 0}function fe(pe){const Qe=this.stack[this.stack.length-1].children;let lt=Qe[Qe.length-1];(!lt||lt.type!=="text")&&(lt=Bt(),lt.position={start:ji(pe.start),end:void 0},Qe.push(lt)),this.stack.push(lt)}function M(pe){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(pe),Ce.position.end=ji(pe.end)}function K(pe){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Qe=Ce.children[Ce.children.length-1];Qe.position.end=ji(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(fe.call(this,pe),M.call(this,pe))}function V(){this.data.atHardBreak=!0}function he(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe}function de(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe}function ne(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe}function z(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ce,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function ee(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ce,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function Te(pe){const Ce=this.sliceSerialize(pe),Qe=this.stack[this.stack.length-2];Qe.label=I7(Ce),Qe.identifier=Qa(Ce).toLowerCase()}function De(){const pe=this.stack[this.stack.length-1],Ce=this.resume(),Qe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Qe.type==="link"){const lt=pe.children;Qe.children=lt}else Qe.alt=Ce}function L(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=pe}function F(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=pe}function se(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ke(pe){const Ce=this.resume(),Qe=this.stack[this.stack.length-1];Qe.label=Ce,Qe.identifier=Qa(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function Ae(pe){this.data.characterReferenceType=pe.type}function _e(pe){const Ce=this.sliceSerialize(pe),Qe=this.data.characterReferenceType;let lt;Qe?(lt=lw(Ce,Qe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):lt=F1(Ce);const xt=this.stack[this.stack.length-1];xt.value+=lt}function et(pe){const Ce=this.stack.pop();Ce.position.end=ji(pe.end)}function st(pe){M.call(this,pe);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(pe)}function Me(pe){M.call(this,pe);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(pe)}function dt(){return{type:"blockquote",children:[]}}function pt(){return{type:"code",lang:null,meta:null,value:""}}function Dt(){return{type:"inlineCode",value:""}}function kn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function bt(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function Ve(){return{type:"break"}}function Qt(){return{type:"html",value:""}}function at(){return{type:"image",title:null,url:"",alt:null}}function Ke(){return{type:"link",title:null,url:"",children:[]}}function Ge(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function an(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function xn(){return{type:"paragraph",children:[]}}function or(){return{type:"strong",children:[]}}function Bt(){return{type:"text",value:""}}function Zn(){return{type:"thematicBreak"}}}function ji(e){return{line:e.line,column:e.column,offset:e.offset}}function rC(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?rC(e,r):Yz(e,r)}}function Yz(e,t){let n;for(n in t)if(nC.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function hT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_c({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_c({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_c({start:t.start,end:t.end})+") is still open")}function Wz(e){const t=this;t.parser=n;function n(r){return Gz(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Qz(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Xz(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
284
+ `}]}function Kz(e,t){const n=t.value?t.value+`
285
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function Zz(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jz(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eF(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=au(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const m={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,m),e.applyData(t,m)}function tF(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nF(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function aC(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function rF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return aC(e,t);const i={src:au(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function aF(e,t){const n={src:au(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function sF(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function iF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return aC(e,t);const i={href:au(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function lF(e,t){const n={href:au(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oF(e,t,n){const r=e.all(t),i=n?uF(n):sC(t),l={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
286
+ `}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
287
+ `});const m={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,m),e.applyData(t,m)}function uF(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=sC(n[r])}return t}function sC(e){const t=e.spread;return t??e.children.length>1}function cF(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function dF(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fF(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function hF(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mF(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=ys(t.children[1]),d=Hh(t.children[t.children.length-1]);c&&d&&(o.position={start:c,end:d}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function pF(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let d=-1;const m=[];for(;++d<c;){const g=t.children[d],y={},E=o?o[d]:void 0;E&&(y.align=E);let v={type:"element",tagName:l,properties:y,children:[]};g&&(v.children=e.all(g),e.patch(g,v),v=e.applyData(g,v)),m.push(v)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,p),e.applyData(t,p)}function gF(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mT=9,pT=32;function bF(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(gT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(gT(t.slice(i),i>0,!1)),l.join("")}function gT(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===mT||l===pT;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===mT||l===pT;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function xF(e,t){const n={type:"text",value:bF(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yF(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const EF={blockquote:Qz,break:Xz,code:Kz,delete:Zz,emphasis:Jz,footnoteReference:eF,heading:tF,html:nF,imageReference:rF,image:aF,inlineCode:sF,linkReference:iF,link:lF,listItem:oF,list:cF,paragraph:dF,root:fF,strong:hF,table:mF,tableCell:gF,tableRow:pF,text:xF,thematicBreak:yF,toml:vf,yaml:vf,definition:vf,footnoteDefinition:vf};function vf(){}function _F(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function TF(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function vF(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||_F,r=e.options.footnoteBackLabel||TF,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[d]);if(!m)continue;const p=e.all(m),g=String(m.identifier).toUpperCase(),y=au(g.toLowerCase());let E=0;const v=[],w=e.footnoteCounts.get(g);for(;w!==void 0&&++E<=w;){v.length>0&&v.push({type:"text",value:" "});let N=typeof n=="string"?n:n(d,E);typeof N=="string"&&(N={type:"text",value:N}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(E>1?"-"+E:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,E),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const N=C.children[C.children.length-1];N&&N.type==="text"?N.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...v)}else p.push(...v);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(m,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Bl(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
288
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
289
+ `}]}}const Og={}.hasOwnProperty,kF={};function wF(e,t){const n=t||kF,r=new Map,i=new Map,l=new Map,o={...EF,...n.handlers},c={all:m,applyData:SF,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:d,options:n,patch:CF,wrap:AF};return gs(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();g.has(y)||g.set(y,p)}}),c;function d(p,g){const y=p.type,E=c.handlers[y];if(Og.call(c.handlers,y)&&E)return E(c,p,g);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:w,...C}=p,S=Bl(C);return S.children=c.all(p),S}return Bl(p)}return(c.options.unknownHandler||NF)(c,p,g)}function m(p){const g=[];if("children"in p){const y=p.children;let E=-1;for(;++E<y.length;){const v=c.one(y[E],p);if(v){if(E&&y[E-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=bT(v.value)),!Array.isArray(v)&&v.type==="element")){const w=v.children[0];w&&w.type==="text"&&(w.value=bT(w.value))}Array.isArray(v)?g.push(...v):g.push(v)}}}return g}}function CF(e,t){e.position&&(t.position=M3(e))}function SF(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,Bl(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function NF(e,t){const n=t.data||{},r="value"in t&&!(Og.call(n,"hProperties")||Og.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function AF(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
290
+ `});++r<e.length;)r&&n.push({type:"text",value:`
291
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
292
+ `}),n}function bT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xT(e,t){const n=wF(e,t),r=n.one(e,void 0),i=vF(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
293
+ `},i),l}function RF(e,t){return e&&"run"in e?async function(n,r){const i=xT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xT(n,{file:r,...e||t})}}function yT(e){if(e)throw e}var P0,ET;function LF(){if(ET)return P0;ET=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},l=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var p=e.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!p&&!g)return!1;var y;for(y in m);return typeof y>"u"||e.call(m,y)},o=function(m,p){n&&p.name==="__proto__"?n(m,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):m[p.name]=p.newValue},c=function(m,p){if(p==="__proto__")if(e.call(m,p)){if(r)return r(m,p).value}else return;return m[p]};return P0=function d(){var m,p,g,y,E,v,w=arguments[0],C=1,S=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<S;++C)if(m=arguments[C],m!=null)for(p in m)g=c(w,p),y=c(m,p),w!==y&&(N&&y&&(l(y)||(E=i(y)))?(E?(E=!1,v=g&&i(g)?g:[]):v=g&&l(g)?g:{},o(w,{name:p,newValue:d(N,v,y)})):typeof y<"u"&&o(w,{name:p,newValue:y}));return w},P0}var IF=LF();const B0=Eh(IF);function Dg(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function OF(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...i);function c(d,...m){const p=e[++l];let g=-1;if(d){o(d);return}for(;++g<i.length;)(m[g]===null||m[g]===void 0)&&(m[g]=i[g]);i=m,p?DF(p,c)(...m):o(null,...m)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function DF(e,t){let n;return r;function r(...o){const c=e.length>o.length;let d;c&&o.push(i);try{d=e.apply(this,o)}catch(m){const p=m;if(c&&n)throw p;return i(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(l,i):d instanceof Error?i(d):l(d))}function i(o,...c){n||(n=!0,t(o,...c))}function l(o){i(null,o)}}const hs={basename:jF,dirname:MF,extname:PF,join:BF,sep:"/"};function jF(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qc(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else o<0&&(l=!0,o=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function MF(e){if(qc(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function PF(e){qc(e);let t=e.length,n=-1,r=0,i=-1,l=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function BF(...e){let t=-1,n;for(;++t<e.length;)qc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":UF(n)}function UF(e){qc(e);const t=e.codePointAt(0)===47;let n=HF(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function HF(e,t){let n="",r=0,i=-1,l=0,o=-1,c,d;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,l=0;continue}}else if(n.length>0){n="",r=0,i=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,l=0}else c===46&&l>-1?l++:l=-1}return n}function qc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const zF={cwd:FF};function FF(){return"/"}function jg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $F(e){if(typeof e=="string")e=new URL(e);else if(!jg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return VF(e)}function VF(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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const U0=["history","path","basename","stem","extname","dirname"];class GF{constructor(t){let n;t?jg(t)?n={path:t}:typeof t=="string"||qF(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":zF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<U0.length;){const l=U0[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)U0.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?hs.basename(this.path):void 0}set basename(t){z0(t,"basename"),H0(t,"basename"),this.path=hs.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?hs.dirname(this.path):void 0}set dirname(t){_T(this.basename,"dirname"),this.path=hs.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?hs.extname(this.path):void 0}set extname(t){if(H0(t,"extname"),_T(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=hs.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){jg(t)&&(t=$F(t)),z0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?hs.basename(this.path,this.extname):void 0}set stem(t){z0(t,"stem"),H0(t,"stem"),this.path=hs.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Tr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function H0(e,t){if(e&&e.includes(hs.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+hs.sep+"`")}function z0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _T(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function qF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const YF=(function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),WF={}.hasOwnProperty;class Z1 extends YF{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=OF()}copy(){const t=new Z1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(B0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(V0("data",this.frozen),this.namespace[t]=n,this):WF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(V0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=kf(t),r=this.parser||this.Parser;return F0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),F0("process",this.parser||this.Parser),$0("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,o){const c=kf(t),d=r.parse(c);r.run(d,c,function(p,g,y){if(p||!g||!y)return m(p);const E=g,v=r.stringify(E,y);KF(v)?y.value=v:y.result=v,m(p,y)});function m(p,g){p||!g?o(p):l?l(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),F0("processSync",this.parser||this.Parser),$0("processSync",this.compiler||this.Compiler),this.process(t,i),vT("processSync","process",n),r;function i(l,o){n=!0,yT(l),r=o}}run(t,n,r){TT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(o,c){const d=kf(n);i.run(t,d,m);function m(p,g,y){const E=g||t;p?c(p):o?o(E):r(void 0,E,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),vT("runSync","run",r),i;function l(o,c){yT(o),i=c,r=!0}}stringify(t,n){this.freeze();const r=kf(n),i=this.compiler||this.Compiler;return $0("stringify",i),TT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(V0("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(m){if(typeof m=="function")d(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[p,...g]=m;d(p,g)}else o(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function o(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");c(m.plugins),m.settings&&(i.settings=B0(!0,i.settings,m.settings))}function c(m){let p=-1;if(m!=null)if(Array.isArray(m))for(;++p<m.length;){const g=m[p];l(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function d(m,p){let g=-1,y=-1;for(;++g<r.length;)if(r[g][0]===m){y=g;break}if(y===-1)r.push([m,...p]);else if(p.length>0){let[E,...v]=p;const w=r[y][1];Dg(w)&&Dg(E)&&(E=B0(!0,w,E)),r[y]=[m,E,...v]}}}}const QF=new Z1().freeze();function F0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function $0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function V0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function TT(e){if(!Dg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function kf(e){return XF(e)?e:new GF(e)}function XF(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function KF(e){return typeof e=="string"||ZF(e)}function ZF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function J1(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Gl=J1();function iC(e){Gl=e}var Rl={exec:()=>null};function Vt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,l)=>{let o=typeof l=="string"?l:l.source;return o=o.replace(Ir.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,t)};return r}var JF=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Ir={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},e$=/^(?:[ \t]*(?:\n|$))+/,t$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,n$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Yc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,r$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,eb=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,lC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,oC=Vt(lC).replace(/bull/g,eb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),a$=Vt(lC).replace(/bull/g,eb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),tb=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,s$=/^[^\n]+/,nb=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,i$=Vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",nb).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),l$=Vt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,eb).getRegex(),Vh="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",rb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,o$=Vt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",rb).replace("tag",Vh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),uC=Vt(tb).replace("hr",Yc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vh).getRegex(),u$=Vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",uC).getRegex(),ab={blockquote:u$,code:t$,def:i$,fences:n$,heading:r$,hr:Yc,html:o$,lheading:oC,list:l$,newline:e$,paragraph:uC,table:Rl,text:s$},kT=Vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Yc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vh).getRegex(),c$={...ab,lheading:a$,table:kT,paragraph:Vt(tb).replace("hr",Yc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",kT).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vh).getRegex()},d$={...ab,html:Vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",rb).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Vt(tb).replace("hr",Yc).replace("heading",` *#{1,6} *[^
294
+ ]`).replace("lheading",oC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},f$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,h$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cC=/^( {2,}|\\)\n(?!\s*$)/,m$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,su=/[\p{P}\p{S}]/u,Gh=/[\s\p{P}\p{S}]/u,sb=/[^\s\p{P}\p{S}]/u,p$=Vt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Gh).getRegex(),dC=/(?!~)[\p{P}\p{S}]/u,g$=/(?!~)[\s\p{P}\p{S}]/u,b$=/(?:[^\s\p{P}\p{S}]|~)/u,x$=Vt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",JF?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,y$=Vt(fC,"u").replace(/punct/g,su).getRegex(),E$=Vt(fC,"u").replace(/punct/g,dC).getRegex(),hC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_$=Vt(hC,"gu").replace(/notPunctSpace/g,sb).replace(/punctSpace/g,Gh).replace(/punct/g,su).getRegex(),T$=Vt(hC,"gu").replace(/notPunctSpace/g,b$).replace(/punctSpace/g,g$).replace(/punct/g,dC).getRegex(),v$=Vt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,sb).replace(/punctSpace/g,Gh).replace(/punct/g,su).getRegex(),k$=Vt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,su).getRegex(),w$="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",C$=Vt(w$,"gu").replace(/notPunctSpace/g,sb).replace(/punctSpace/g,Gh).replace(/punct/g,su).getRegex(),S$=Vt(/\\(punct)/,"gu").replace(/punct/g,su).getRegex(),N$=Vt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),A$=Vt(rb).replace("(?:-->|$)","-->").getRegex(),R$=Vt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",A$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),mh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,L$=Vt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",mh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),mC=Vt(/^!?\[(label)\]\[(ref)\]/).replace("label",mh).replace("ref",nb).getRegex(),pC=Vt(/^!?\[(ref)\](?:\[\])?/).replace("ref",nb).getRegex(),I$=Vt("reflink|nolink(?!\\()","g").replace("reflink",mC).replace("nolink",pC).getRegex(),wT=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ib={_backpedal:Rl,anyPunctuation:S$,autolink:N$,blockSkip:x$,br:cC,code:h$,del:Rl,delLDelim:Rl,delRDelim:Rl,emStrongLDelim:y$,emStrongRDelimAst:_$,emStrongRDelimUnd:v$,escape:f$,link:L$,nolink:pC,punctuation:p$,reflink:mC,reflinkSearch:I$,tag:R$,text:m$,url:Rl},O$={...ib,link:Vt(/^!?\[(label)\]\((.*?)\)/).replace("label",mh).getRegex(),reflink:Vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",mh).getRegex()},Mg={...ib,emStrongRDelimAst:T$,emStrongLDelim:E$,delLDelim:k$,delRDelim:C$,url:Vt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",wT).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Vt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",wT).getRegex()},D$={...Mg,br:Vt(cC).replace("{2,}","*").getRegex(),text:Vt(Mg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},wf={normal:ab,gfm:c$,pedantic:d$},rc={normal:ib,gfm:Mg,breaks:D$,pedantic:O$},j$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},CT=e=>j$[e];function fs(e,t){if(t){if(Ir.escapeTest.test(e))return e.replace(Ir.escapeReplace,CT)}else if(Ir.escapeTestNoEncode.test(e))return e.replace(Ir.escapeReplaceNoEncode,CT);return e}function ST(e){try{e=encodeURI(e).replace(Ir.percentDecode,"%")}catch{return null}return e}function NT(e,t){var l;let n=e.replace(Ir.findPipe,(o,c,d)=>{let m=!1,p=c;for(;--p>=0&&d[p]==="\\";)m=!m;return m?"|":" |"}),r=n.split(Ir.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((l=r.at(-1))!=null&&l.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Ir.slashPipe,"|");return r}function ac(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function M$(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function P$(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let l=4-n%4;r+=" ".repeat(l),n+=l}else r+=i,n++;return r}function AT(e,t,n,r,i){let l=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:o,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,d}function B$(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
295
+ `).map(l=>{let o=l.match(n.other.beginningSpace);if(o===null)return l;let[c]=o;return c.length>=i.length?l.slice(i.length):l}).join(`
296
+ `)}var ph=class{constructor(e){oe(this,"options");oe(this,"rules");oe(this,"lexer");this.options=e||Gl}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ac(n,`
297
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=B$(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=ac(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ac(t[0],`
298
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=ac(t[0],`
299
+ `).split(`
300
+ `),r="",i="",l=[];for(;n.length>0;){let o=!1,c=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))c.push(n[d]),o=!0;else if(!o)c.push(n[d]);else break;n=n.slice(d);let m=c.join(`
301
+ `),p=m.replace(this.rules.other.blockquoteSetextReplace,`
302
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
303
+ ${m}`:m,i=i?`${i}
304
+ ${p}`:p;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,l,!0),this.lexer.state.top=g,n.length===0)break;let y=l.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let E=y,v=E.raw+`
305
+ `+n.join(`
306
+ `),w=this.blockquote(v);l[l.length-1]=w,r=r.substring(0,r.length-E.raw.length)+w.raw,i=i.substring(0,i.length-E.text.length)+w.text;break}else if((y==null?void 0:y.type)==="list"){let E=y,v=E.raw+`
307
+ `+n.join(`
308
+ `),w=this.list(v);l[l.length-1]=w,r=r.substring(0,r.length-y.raw.length)+w.raw,i=i.substring(0,i.length-E.raw.length)+w.raw,n=v.substring(l.at(-1).raw.length).split(`
309
+ `);continue}}return{type:"blockquote",raw:r,tokens:l,text:i}}}list(e){var n,r;let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim(),l=i.length>1,o={type:"list",raw:"",ordered:l,start:l?+i.slice(0,-1):"",loose:!1,items:[]};i=l?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=l?i:"[*+-]");let c=this.rules.other.listItemRegex(i),d=!1;for(;e;){let p=!1,g="",y="";if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;g=t[0],e=e.substring(g.length);let E=P$(t[2].split(`
310
+ `,1)[0],t[1].length),v=e.split(`
311
+ `,1)[0],w=!E.trim(),C=0;if(this.options.pedantic?(C=2,y=E.trimStart()):w?C=t[1].length+1:(C=E.search(this.rules.other.nonSpaceChar),C=C>4?1:C,y=E.slice(C),C+=t[1].length),w&&this.rules.other.blankLine.test(v)&&(g+=v+`
312
+ `,e=e.substring(v.length+1),p=!0),!p){let S=this.rules.other.nextBulletRegex(C),N=this.rules.other.hrRegex(C),A=this.rules.other.fencesBeginRegex(C),H=this.rules.other.headingBeginRegex(C),$=this.rules.other.htmlBeginRegex(C),U=this.rules.other.blockquoteBeginRegex(C);for(;e;){let P=e.split(`
313
+ `,1)[0],Y;if(v=P,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),Y=v):Y=v.replace(this.rules.other.tabCharGlobal," "),A.test(v)||H.test(v)||$.test(v)||U.test(v)||S.test(v)||N.test(v))break;if(Y.search(this.rules.other.nonSpaceChar)>=C||!v.trim())y+=`
314
+ `+Y.slice(C);else{if(w||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(E)||H.test(E)||N.test(E))break;y+=`
315
+ `+v}w=!v.trim(),g+=P+`
316
+ `,e=e.substring(P.length+1),E=Y.slice(C)}}o.loose||(d?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(d=!0)),o.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=g}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p of o.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),((n=p.tokens[0])==null?void 0:n.type)==="text"||((r=p.tokens[0])==null?void 0:r.type)==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(p.raw);if(g){let y={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};p.checked=y.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=y.raw+p.tokens[0].raw,p.tokens[0].text=y.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(y)):p.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):p.tokens.unshift(y)}}if(!o.loose){let g=p.tokens.filter(E=>E.type==="space"),y=g.length>0&&g.some(E=>this.rules.other.anyLine.test(E.raw));o.loose=y}}if(o.loose)for(let p of o.items){p.loose=!0;for(let g of p.tokens)g.type==="text"&&(g.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){var o;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=NT(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(o=t[3])!=null&&o.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
317
+ `):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let c of r)this.rules.other.tableAlignRight.test(c)?l.align.push("right"):this.rules.other.tableAlignCenter.test(c)?l.align.push("center"):this.rules.other.tableAlignLeft.test(c)?l.align.push("left"):l.align.push(null);for(let c=0;c<n.length;c++)l.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:l.align[c]});for(let c of i)l.rows.push(NT(c,l.header.length).map((d,m)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:l.align[m]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
318
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=ac(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=M$(t[2],"()");if(l===-2)return;if(l>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],i=l[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),AT(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return AT(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,l,o,c=i,d=0,m=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+i);(r=m.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(o=[...l].length,r[3]||r[4]){c+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){d+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+d);let p=[...r[0]][0].length,g=e.slice(0,i+r.index+p+o);if(Math.min(i,o)%2){let E=g.slice(1,-1);return{type:"em",raw:g,text:E,tokens:this.lexer.inlineTokens(E)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,l,o,c=i,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l||(o=[...l].length,o!==i))continue;if(r[3]||r[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let m=[...r[0]][0].length,p=e.slice(0,i+r.index+m+o),g=p.slice(i,-i);return{type:"del",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let l;do l=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(l!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Sa=class Pg{constructor(t){oe(this,"tokens");oe(this,"options");oe(this,"state");oe(this,"inlineQueue");oe(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Gl,this.options.tokenizer=this.options.tokenizer||new ph,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Ir,block:wf.normal,inline:rc.normal};this.options.pedantic?(n.block=wf.pedantic,n.inline=rc.pedantic):this.options.gfm&&(n.block=wf.gfm,this.options.breaks?n.inline=rc.breaks:n.inline=rc.gfm),this.tokenizer.rules=n}static get rules(){return{block:wf,inline:rc}}static lex(t,n){return new Pg(n).lex(t)}static lexInline(t,n){return new Pg(n).inlineTokens(t)}lex(t){t=t.replace(Ir.carriageReturn,`
319
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var i,l,o;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Ir.tabCharGlobal," ").replace(Ir.spaceLine,""));t;){let c;if((l=(i=this.options.extensions)==null?void 0:i.block)!=null&&l.some(m=>(c=m.call({lexer:this},t,n))?(t=t.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(t)){t=t.substring(c.raw.length);let m=n.at(-1);c.raw.length===1&&m!==void 0?m.raw+=`
320
+ `:n.push(c);continue}if(c=this.tokenizer.code(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
321
+ `)?"":`
322
+ `)+c.raw,m.text+=`
323
+ `+c.text,this.inlineQueue.at(-1).src=m.text):n.push(c);continue}if(c=this.tokenizer.fences(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
324
+ `)?"":`
325
+ `)+c.raw,m.text+=`
326
+ `+c.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(t)){t=t.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(t)){t=t.substring(c.raw.length),n.push(c);continue}let d=t;if((o=this.options.extensions)!=null&&o.startBlock){let m=1/0,p=t.slice(1),g;this.options.extensions.startBlock.forEach(y=>{g=y.call({lexer:this},p),typeof g=="number"&&g>=0&&(m=Math.min(m,g))}),m<1/0&&m>=0&&(d=t.substring(0,m+1))}if(this.state.top&&(c=this.tokenizer.paragraph(d))){let m=n.at(-1);r&&(m==null?void 0:m.type)==="paragraph"?(m.raw+=(m.raw.endsWith(`
327
+ `)?"":`
328
+ `)+c.raw,m.text+=`
329
+ `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):n.push(c),r=d.length!==t.length,t=t.substring(c.raw.length);continue}if(c=this.tokenizer.text(t)){t=t.substring(c.raw.length);let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=(m.raw.endsWith(`
330
+ `)?"":`
331
+ `)+c.raw,m.text+=`
332
+ `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):n.push(c);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var d,m,p,g,y;this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let E=Object.keys(this.tokens.links);if(E.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)E.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)l=i[2]?i[2].length:0,r=r.slice(0,i.index+l)+"["+"a".repeat(i[0].length-l-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((m=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:m.call({lexer:this},r))??r;let o=!1,c="";for(;t;){o||(c=""),o=!1;let E;if((g=(p=this.options.extensions)==null?void 0:p.inline)!=null&&g.some(w=>(E=w.call({lexer:this},t,n))?(t=t.substring(E.raw.length),n.push(E),!0):!1))continue;if(E=this.tokenizer.escape(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.tag(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.link(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(E.raw.length);let w=n.at(-1);E.type==="text"&&(w==null?void 0:w.type)==="text"?(w.raw+=E.raw,w.text+=E.text):n.push(E);continue}if(E=this.tokenizer.emStrong(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.codespan(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.br(t)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.del(t,r,c)){t=t.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.autolink(t)){t=t.substring(E.raw.length),n.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(t))){t=t.substring(E.raw.length),n.push(E);continue}let v=t;if((y=this.options.extensions)!=null&&y.startInline){let w=1/0,C=t.slice(1),S;this.options.extensions.startInline.forEach(N=>{S=N.call({lexer:this},C),typeof S=="number"&&S>=0&&(w=Math.min(w,S))}),w<1/0&&w>=0&&(v=t.substring(0,w+1))}if(E=this.tokenizer.inlineText(v)){t=t.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(c=E.raw.slice(-1)),o=!0;let w=n.at(-1);(w==null?void 0:w.type)==="text"?(w.raw+=E.raw,w.text+=E.text):n.push(E);continue}if(t){let w="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(w);break}else throw new Error(w)}}return n}},gh=class{constructor(t){oe(this,"options");oe(this,"parser");this.options=t||Gl}space(t){return""}code({text:t,lang:n,escaped:r}){var o;let i=(o=(n||"").match(Ir.notSpaceStart))==null?void 0:o[0],l=t.replace(Ir.endingNewline,"")+`
333
+ `;return i?'<pre><code class="language-'+fs(i)+'">'+(r?l:fs(l,!0))+`</code></pre>
334
+ `:"<pre><code>"+(r?l:fs(l,!0))+`</code></pre>
335
+ `}blockquote({tokens:t}){return`<blockquote>
336
+ ${this.parser.parse(t)}</blockquote>
337
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
338
+ `}hr(t){return`<hr>
339
+ `}list(t){let n=t.ordered,r=t.start,i="";for(let c=0;c<t.items.length;c++){let d=t.items[c];i+=this.listitem(d)}let l=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+l+o+`>
340
+ `+i+"</"+l+`>
341
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
342
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
343
+ `}table(t){let n="",r="";for(let l=0;l<t.header.length;l++)r+=this.tablecell(t.header[l]);n+=this.tablerow({text:r});let i="";for(let l=0;l<t.rows.length;l++){let o=t.rows[l];r="";for(let c=0;c<o.length;c++)r+=this.tablecell(o[c]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
344
+ <thead>
345
+ `+n+`</thead>
346
+ `+i+`</table>
347
+ `}tablerow({text:t}){return`<tr>
348
+ ${t}</tr>
349
+ `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
350
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${fs(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let i=this.parser.parseInline(r),l=ST(t);if(l===null)return i;t=l;let o='<a href="'+t+'"';return n&&(o+=' title="'+fs(n)+'"'),o+=">"+i+"</a>",o}image({href:t,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let l=ST(t);if(l===null)return fs(r);t=l;let o=`<img src="${t}" alt="${fs(r)}"`;return n&&(o+=` title="${fs(n)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:fs(t.text)}},lb=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},qa=class Bg{constructor(t){oe(this,"options");oe(this,"renderer");oe(this,"textRenderer");this.options=t||Gl,this.options.renderer=this.options.renderer||new gh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new lb}static parse(t,n){return new Bg(n).parse(t)}static parseInline(t,n){return new Bg(n).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let n="";for(let l=0;l<t.length;l++){let o=t[l];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[o.type]){let d=o,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=m||"";continue}}let c=o;switch(c.type){case"space":{n+=this.renderer.space(c);break}case"hr":{n+=this.renderer.hr(c);break}case"heading":{n+=this.renderer.heading(c);break}case"code":{n+=this.renderer.code(c);break}case"table":{n+=this.renderer.table(c);break}case"blockquote":{n+=this.renderer.blockquote(c);break}case"list":{n+=this.renderer.list(c);break}case"checkbox":{n+=this.renderer.checkbox(c);break}case"html":{n+=this.renderer.html(c);break}case"def":{n+=this.renderer.def(c);break}case"paragraph":{n+=this.renderer.paragraph(c);break}case"text":{n+=this.renderer.text(c);break}default:{let d='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(t,n=this.renderer){var i,l;this.renderer.parser=this;let r="";for(let o=0;o<t.length;o++){let c=t[o];if((l=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&l[c.type]){let m=this.options.extensions.renderers[c.type].call({parser:this},c);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=m||"";continue}}let d=c;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return r}},jf,uc=(jf=class{constructor(e){oe(this,"options");oe(this,"block");this.options=e||Gl}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Sa.lex:Sa.lexInline}provideParser(e=this.block){return e?qa.parse:qa.parseInline}},oe(jf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),oe(jf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),jf),U$=class{constructor(...t){oe(this,"defaults",J1());oe(this,"options",this.setOptions);oe(this,"parse",this.parseMarkdown(!0));oe(this,"parseInline",this.parseMarkdown(!1));oe(this,"Parser",qa);oe(this,"Renderer",gh);oe(this,"TextRenderer",lb);oe(this,"Lexer",Sa);oe(this,"Tokenizer",ph);oe(this,"Hooks",uc);this.use(...t)}walkTokens(t,n){var i,l;let r=[];for(let o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let c=o;for(let d of c.header)r=r.concat(this.walkTokens(d.tokens,n));for(let d of c.rows)for(let m of d)r=r.concat(this.walkTokens(m.tokens,n));break}case"list":{let c=o;r=r.concat(this.walkTokens(c.items,n));break}default:{let c=o;(l=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&l[c.type]?this.defaults.extensions.childTokens[c.type].forEach(d=>{let m=c[d].flat(1/0);r=r.concat(this.walkTokens(m,n))}):c.tokens&&(r=r.concat(this.walkTokens(c.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let o=n.renderers[l.name];o?n.renderers[l.name]=function(...c){let d=l.renderer.apply(this,c);return d===!1&&(d=o.apply(this,c)),d}:n.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[l.level];o?o.unshift(l.tokenizer):n[l.level]=[l.tokenizer],l.start&&(l.level==="block"?n.startBlock?n.startBlock.push(l.start):n.startBlock=[l.start]:l.level==="inline"&&(n.startInline?n.startInline.push(l.start):n.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(n.childTokens[l.name]=l.childTokens)}),i.extensions=n),r.renderer){let l=this.defaults.renderer||new gh(this.defaults);for(let o in r.renderer){if(!(o in l))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let c=o,d=r.renderer[c],m=l[c];l[c]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g||""}}i.renderer=l}if(r.tokenizer){let l=this.defaults.tokenizer||new ph(this.defaults);for(let o in r.tokenizer){if(!(o in l))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let c=o,d=r.tokenizer[c],m=l[c];l[c]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}i.tokenizer=l}if(r.hooks){let l=this.defaults.hooks||new uc;for(let o in r.hooks){if(!(o in l))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let c=o,d=r.hooks[c],m=l[c];uc.passThroughHooks.has(o)?l[c]=p=>{if(this.defaults.async&&uc.passThroughHooksRespectAsync.has(o))return(async()=>{let y=await d.call(l,p);return m.call(l,y)})();let g=d.call(l,p);return m.call(l,g)}:l[c]=(...p)=>{if(this.defaults.async)return(async()=>{let y=await d.apply(l,p);return y===!1&&(y=await m.apply(l,p)),y})();let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}i.hooks=l}if(r.walkTokens){let l=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(c){let d=[];return d.push(o.call(this,c)),l&&(d=d.concat(l.call(this,c))),d}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Sa.lex(t,n??this.defaults)}parser(t,n){return qa.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},l={...this.defaults,...i},o=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let c=l.hooks?await l.hooks.preprocess(n):n,d=await(l.hooks?await l.hooks.provideLexer(t):t?Sa.lex:Sa.lexInline)(c,l),m=l.hooks?await l.hooks.processAllTokens(d):d;l.walkTokens&&await Promise.all(this.walkTokens(m,l.walkTokens));let p=await(l.hooks?await l.hooks.provideParser(t):t?qa.parse:qa.parseInline)(m,l);return l.hooks?await l.hooks.postprocess(p):p})().catch(o);try{l.hooks&&(n=l.hooks.preprocess(n));let c=(l.hooks?l.hooks.provideLexer(t):t?Sa.lex:Sa.lexInline)(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let d=(l.hooks?l.hooks.provideParser(t):t?qa.parse:qa.parseInline)(c,l);return l.hooks&&(d=l.hooks.postprocess(d)),d}catch(c){return o(c)}}}onError(t,n){return r=>{if(r.message+=`
351
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+fs(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},Hl=new U$;function hn(e,t){return Hl.parse(e,t)}hn.options=hn.setOptions=function(e){return Hl.setOptions(e),hn.defaults=Hl.defaults,iC(hn.defaults),hn};hn.getDefaults=J1;hn.defaults=Gl;hn.use=function(...e){return Hl.use(...e),hn.defaults=Hl.defaults,iC(hn.defaults),hn};hn.walkTokens=function(e,t){return Hl.walkTokens(e,t)};hn.parseInline=Hl.parseInline;hn.Parser=qa;hn.parser=qa.parse;hn.Renderer=gh;hn.TextRenderer=lb;hn.Lexer=Sa;hn.lexer=Sa.lex;hn.Tokenizer=ph;hn.Hooks=uc;hn.parse=hn;hn.options;hn.setOptions;hn.use;hn.walkTokens;hn.parseInline;qa.parse;Sa.lex;var H$=300,z$="300px",F$=500;function $$(e={}){let{immediate:t=!1,debounceDelay:n=H$,rootMargin:r=z$,idleTimeout:i=F$}=e,[l,o]=T.useState(!1),c=T.useRef(null),d=T.useRef(null),m=T.useRef(null),p=T.useMemo(()=>E=>{let v=Date.now();return window.setTimeout(()=>{E({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),g=T.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(E,v)=>window.requestIdleCallback(E,v):p,[p]),y=T.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?E=>window.cancelIdleCallback(E):E=>{clearTimeout(E)},[]);return T.useEffect(()=>{if(t){o(!0);return}let E=c.current;if(!E)return;d.current&&(clearTimeout(d.current),d.current=null),m.current&&(y(m.current),m.current=null);let v=()=>{d.current&&(clearTimeout(d.current),d.current=null),m.current&&(y(m.current),m.current=null)},w=A=>{m.current=g(H=>{H.timeRemaining()>0||H.didTimeout?(o(!0),A.disconnect()):m.current=g(()=>{o(!0),A.disconnect()},{timeout:i/2})},{timeout:i})},C=A=>{v(),d.current=window.setTimeout(()=>{var H,$;let U=A.takeRecords();(U.length===0||($=(H=U.at(-1))==null?void 0:H.isIntersecting)!=null&&$)&&w(A)},n)},S=(A,H)=>{A.isIntersecting?C(H):v()},N=new IntersectionObserver(A=>{for(let H of A)S(H,N)},{rootMargin:r,threshold:0});return N.observe(E),()=>{d.current&&clearTimeout(d.current),m.current&&y(m.current),N.disconnect()}},[t,n,r,i,y,g]),{shouldRender:l,containerRef:c}}var gC=/\s/,V$=/^\s+$/,G$=new Set(["code","pre","svg","math","annotation"]),q$=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",Y$=e=>e.some(t=>q$(t)&&G$.has(t.tagName)),W$=e=>{let t=[],n="",r=!1;for(let i of e){let l=gC.test(i);l!==r&&n&&(t.push(n),n=""),n+=i,r=l}return n&&t.push(n),t},Q$=e=>{let t=[],n="";for(let r of e)gC.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},X$=(e,t,n,r,i,l)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return l&&(o+=`;--sd-delay:${l}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:o},children:[{type:"text",value:e}]}},K$=(e,t,n,r,i)=>{let l=t.at(-1);if(!(l&&"children"in l))return;if(Y$(t))return Mo;let o=l,c=o.children.indexOf(e);if(c===-1)return;let d=e.value;if(!d.trim()){i.count+=d.length;return}let m=n.sep==="char"?Q$(d):W$(d),p=r.prevContentLength,g=m.map(y=>{let E=i.count;if(i.count+=y.length,V$.test(y))return{type:"text",value:y};let v=p>0&&E<p,w=v?0:i.newIndex++*n.stagger;return X$(y,n.animation,n.duration,n.easing,v,w)});return o.children.splice(c,1,...g),c+g.length},Z$=0;function Ug(e){var t,n,r,i,l;let o={animation:(t=e==null?void 0:e.animation)!=null?t:"fadeIn",duration:(n=e==null?void 0:e.duration)!=null?n:150,easing:(r=e==null?void 0:e.easing)!=null?r:"ease",sep:(i=e==null?void 0:e.sep)!=null?i:"word",stagger:(l=e==null?void 0:e.stagger)!=null?l:40},c={prevContentLength:0,lastRenderCharCount:0},d=Z$++,m=()=>p=>{let g={count:0,newIndex:0};N1(p,"text",(y,E)=>K$(y,E,o,c,g)),c.lastRenderCharCount=g.count,c.prevContentLength=0};return Object.defineProperty(m,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:m,setPrevContentLength(p){c.prevContentLength=p},getLastRenderCharCount(){let p=c.lastRenderCharCount;return c.lastRenderCharCount=0,p}}}Ug();var bC=T.createContext(!1),J$=()=>T.useContext(bC),ob=(...e)=>Qw(Dw(e)),eV=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},tV=e=>e?(...t)=>eV(e,Qw(Dw(t))):ob,Ho=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,l=URL.createObjectURL(i),o=document.createElement("a");o.href=l,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(l)},Hg=T.createContext(ob),Rt=()=>T.useContext(Hg),nV=ob("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),rV=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),l=n.slice(r+1).trim();i&&l&&(t[i]=l)}}return t},aV=T.memo(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:l=!0,...o})=>{let c=Rt(),d=T.useMemo(()=>c(nV),[c]),m=T.useMemo(()=>{let p={};return t.bg&&(p["--sdm-bg"]=t.bg),t.fg&&(p["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(p,rV(t.rootStyle)),p},[t.bg,t.fg,t.rootStyle]);return f.jsx("div",{className:c(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...o,children:f.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:m,children:f.jsx("code",{className:l?c("[counter-increment:line_0] [counter-reset:line]"):void 0,style:l&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((p,g)=>f.jsx("span",{className:l?d:void 0,children:p.length===0||p.length===1&&p[0].content===""?`
352
+ `:p.map((y,E)=>{let v={},w=!!y.bgColor;if(y.color&&(v["--sdm-c"]=y.color),y.bgColor&&(v["--sdm-tbg"]=y.bgColor),y.htmlStyle)for(let[C,S]of Object.entries(y.htmlStyle))C==="color"?v["--sdm-c"]=S:C==="background-color"?(v["--sdm-tbg"]=S,w=!0):v[C]=S;return f.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",w&&"bg-[var(--sdm-tbg)]",w&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...y.htmlAttrs,children:y.content},E)})},g))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),sV=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let l=Rt();return f.jsx("div",{className:l("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},xC=T.createContext({code:""}),yC=()=>T.useContext(xC),iV=({language:e})=>{let t=Rt();return f.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:f.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},lV=e=>{let t=e.length;for(;t>0&&e[t-1]===`
353
+ `;)t--;return e.slice(0,t)},oV=T.lazy(()=>D(()=>import("./highlighted-body-OFNGDK62-DvEvXPo5.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),uV=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:l,lineNumbers:o,...c})=>{let d=Rt(),m=T.useMemo(()=>lV(e),[e]),p=T.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:m.split(`
354
+ `).map(g=>[{content:g,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[m]);return f.jsx(xC.Provider,{value:{code:e},children:f.jsxs(sV,{isIncomplete:i,language:t,children:[f.jsx(iV,{language:t}),r?f.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsx("div",{className:d("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,f.jsx(T.Suspense,{fallback:f.jsx(aV,{className:n,language:t,lineNumbers:o,result:p,startLine:l,...c}),children:f.jsx(oV,{className:n,code:m,language:t,lineNumbers:o,raw:p,startLine:l,...c})})]})})},cV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),dV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),fV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),hV=e=>f.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[f.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),mV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),pV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),gV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),bV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),xV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),yV=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),cc={CheckIcon:cV,CopyIcon:dV,DownloadIcon:fV,ExternalLinkIcon:bV,Loader2Icon:hV,Maximize2Icon:mV,RotateCcwIcon:pV,XIcon:gV,ZoomInIcon:xV,ZoomOutIcon:yV},EC=T.createContext(cc),EV=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},RT=({icons:e,children:t})=>{let n=T.useRef(e),r=T.useRef(e?{...cc,...e}:cc);EV(n.current,e)||(n.current=e,r.current=e?{...cc,...e}:cc);let i=r.current;return f.jsx(EC.Provider,{value:i,children:t})},Za=()=>T.useContext(EC),_C={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},zg=T.createContext(_C),ti=()=>T.useContext(zg),LT=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:l,...o})=>{let c=Rt(),[d,m]=T.useState(!1),p=T.useRef(0),{code:g}=yC(),{isAnimating:y}=T.useContext(ia),E=ti(),v=l??g,w=async()=>{var N;if(typeof window>"u"||!((N=navigator==null?void 0:navigator.clipboard)!=null&&N.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(v),m(!0),e==null||e(),p.current=window.setTimeout(()=>m(!1),n))}catch(A){t==null||t(A)}};T.useEffect(()=>()=>{window.clearTimeout(p.current)},[]);let C=Za(),S=d?C.CheckIcon:C.CopyIcon;return f.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:y,onClick:w,title:E.copyCode,type:"button",...o,children:r??f.jsx(S,{size:14})})},IT={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},_V=({onDownload:e,onError:t,language:n,children:r,className:i,code:l,...o})=>{let c=Rt(),{code:d}=yC(),{isAnimating:m}=T.useContext(ia),p=ti(),g=Za(),y=l??d,E=`file.${n&&n in IT?IT[n]:"txt"}`,v="text/plain",w=()=>{try{Ho(E,y,v),e==null||e()}catch(C){t==null||t(C)}};return f.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:m,onClick:w,title:p.downloadFile,type:"button",...o,children:r??f.jsx(g.DownloadIcon,{size:14})})},OT=()=>{let{Loader2Icon:e}=Za(),t=Rt();return f.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[f.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),f.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:f.jsx(e,{className:t("size-4 animate-spin")})})]})},TV=/\.[^/.]+$/,vV=({node:e,className:t,src:n,alt:r,onLoad:i,onError:l,...o})=>{let{DownloadIcon:c}=Za(),d=Rt(),m=T.useRef(null),[p,g]=T.useState(!1),[y,E]=T.useState(!1),v=ti(),w=o.width!=null||o.height!=null,C=(p||w)&&!y,S=y&&!w;T.useEffect(()=>{let $=m.current;if($!=null&&$.complete){let U=$.naturalWidth>0;g(U),E(!U)}},[]);let N=T.useCallback($=>{g(!0),E(!1),i==null||i($)},[i]),A=T.useCallback($=>{g(!1),E(!0),l==null||l($)},[l]),H=async()=>{if(n)try{let $=await(await fetch(n)).blob(),U=new URL(n,window.location.origin).pathname.split("/").pop()||"",P=U.split(".").pop(),Y=U.includes(".")&&P!==void 0&&P.length<=4,fe="";if(Y)fe=U;else{let M=$.type,K="png";M.includes("jpeg")||M.includes("jpg")?K="jpg":M.includes("png")?K="png":M.includes("svg")?K="svg":M.includes("gif")?K="gif":M.includes("webp")&&(K="webp"),fe=`${(r||U||"image").replace(TV,"")}.${K}`}Ho(fe,$,$.type)}catch{window.open(n,"_blank")}};return n?f.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[f.jsx("img",{alt:r,className:d("max-w-full rounded-lg",S&&"hidden",t),"data-streamdown":"image",onError:A,onLoad:N,ref:m,src:n,...o}),S&&f.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),f.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),C&&f.jsx("button",{className:d("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:H,title:v.downloadImage,type:"button",children:f.jsx(c,{size:14})})]}):null},Tc=0,ub=()=>{Tc+=1,Tc===1&&(document.body.style.overflow="hidden")},cb=()=>{Tc=Math.max(0,Tc-1),Tc===0&&(document.body.style.overflow="")},kV=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:l,ExternalLinkIcon:o,XIcon:c}=Za(),d=Rt(),[m,p]=T.useState(!1),g=ti(),y=T.useCallback(async()=>{try{await navigator.clipboard.writeText(e),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},[e]),E=T.useCallback(()=>{r(),n()},[r,n]);return T.useEffect(()=>{if(t){ub();let v=w=>{w.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),cb()}}},[t,n]),t?f.jsx("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:v=>{v.key==="Escape"&&n()},role:"button",tabIndex:0,children:f.jsxs("div",{className:d("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),role:"presentation",children:[f.jsx("button",{className:d("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:g.close,type:"button",children:f.jsx(c,{size:16})}),f.jsxs("div",{className:d("flex flex-col gap-2"),children:[f.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[f.jsx(o,{size:20}),f.jsx("span",{children:g.openExternalLink})]}),f.jsx("p",{className:d("text-muted-foreground text-sm"),children:g.externalLinkWarning})]}),f.jsx("div",{className:d("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),f.jsxs("div",{className:d("flex gap-2"),children:[f.jsx("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:y,type:"button",children:m?f.jsxs(f.Fragment,{children:[f.jsx(i,{size:14}),f.jsx("span",{children:g.copied})]}):f.jsxs(f.Fragment,{children:[f.jsx(l,{size:14}),f.jsx("span",{children:g.copyLink})]})}),f.jsxs("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:E,type:"button",children:[f.jsx(o,{size:14}),f.jsx("span",{children:g.openLink})]})]})]})}):null},Fg=T.createContext(null),db=()=>T.useContext(Fg),mY=()=>{var e;let t=db();return(e=t==null?void 0:t.code)!=null?e:null},fb=()=>{var e;let t=db();return(e=t==null?void 0:t.mermaid)!=null?e:null},wV=e=>{var t;let n=db();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},CV=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,l)=>{let o="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let d=document.createElement("canvas"),m=c.width*r,p=c.height*r;d.width=m,d.height=p;let g=d.getContext("2d");if(!g){l(new Error("Failed to create 2D canvas context for PNG export"));return}g.drawImage(c,0,0,m,p),d.toBlob(y=>{if(!y){l(new Error("Failed to create PNG blob"));return}i(y)},"image/png")},c.onerror=()=>l(new Error("Failed to load SVG image")),c.src=o})},SV=({chart:e,children:t,className:n,onDownload:r,config:i,onError:l})=>{let o=Rt(),[c,d]=T.useState(!1),m=T.useRef(null),{isAnimating:p}=T.useContext(ia),g=Za(),y=fb(),E=ti(),v=async w=>{try{if(w==="mmd"){Ho("diagram.mmd",e,"text/plain"),d(!1),r==null||r(w);return}if(!y){l==null||l(new Error("Mermaid plugin not available"));return}let C=y.getMermaid(i),S=e.split("").reduce((H,$)=>(H<<5)-H+$.charCodeAt(0)|0,0),N=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:A}=await C.render(N,e);if(!A){l==null||l(new Error("SVG not found. Please wait for the diagram to render."));return}if(w==="svg"){Ho("diagram.svg",A,"image/svg+xml"),d(!1),r==null||r(w);return}if(w==="png"){let H=await CV(A);Ho("diagram.png",H,"image/png"),r==null||r(w),d(!1);return}}catch(C){l==null||l(C)}};return T.useEffect(()=>{let w=C=>{let S=C.composedPath();m.current&&!S.includes(m.current)&&d(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]),f.jsxs("div",{className:o("relative"),ref:m,children:[f.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:p,onClick:()=>d(!c),title:E.downloadDiagram,type:"button",children:t??f.jsx(g.DownloadIcon,{size:14})}),c?f.jsxs("div",{className:o("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("svg"),title:E.downloadDiagramAsSvg,type:"button",children:E.mermaidFormatSvg}),f.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("png"),title:E.downloadDiagramAsPng,type:"button",children:E.mermaidFormatPng}),f.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("mmd"),title:E.downloadDiagramAsMmd,type:"button",children:E.mermaidFormatMmd})]}):null]})},NV=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...l})=>{let{Maximize2Icon:o,XIcon:c}=Za(),d=Rt(),[m,p]=T.useState(!1),{isAnimating:g,controls:y}=T.useContext(ia),E=ti(),v=(()=>{if(typeof y=="boolean")return y;let C=y.mermaid;return C===!1?!1:C===!0||C===void 0?!0:C.panZoom!==!1})(),w=()=>{p(!m)};return T.useEffect(()=>{if(m){ub();let C=S=>{S.key==="Escape"&&p(!1)};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C),cb()}}},[m]),T.useEffect(()=>{m?n==null||n():r&&r()},[m,n,r]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:d("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:g,onClick:w,title:E.viewFullscreen,type:"button",...l,children:f.jsx(o,{size:14})}),m?Qo.createPortal(f.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:w,onKeyDown:C=>{C.key==="Escape"&&w()},role:"button",tabIndex:0,children:[f.jsx("button",{className:d("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:w,title:E.exitFullscreen,type:"button",children:f.jsx(c,{size:20})}),f.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),role:"presentation",children:f.jsx(rS,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},TC=e=>{var t,n;let r=[],i=[],l=e.querySelectorAll("thead th");for(let c of l)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let o=e.querySelectorAll("tbody tr");for(let c of o){let d=[],m=c.querySelectorAll("td");for(let p of m)d.push(((n=p.textContent)==null?void 0:n.trim())||"");i.push(d)}return{headers:r,rows:i}},vC=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1,m=!1;for(let p of c){if(p==='"'){d=!0,m=!0;break}(p===","||p===`
355
+ `)&&(d=!0)}return d?m?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},i=t.length>0?n.length+1:n.length,l=new Array(i),o=0;t.length>0&&(l[o]=t.map(r).join(","),o+=1);for(let c of n)l[o]=c.map(r).join(","),o+=1;return l.join(`
356
+ `)},AV=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1;for(let p of c)if(p===" "||p===`
357
+ `||p==="\r"){d=!0;break}if(!d)return c;let m=[];for(let p of c)p===" "?m.push("\\t"):p===`
358
+ `?m.push("\\n"):p==="\r"?m.push("\\r"):m.push(p);return m.join("")},i=t.length>0?n.length+1:n.length,l=new Array(i),o=0;t.length>0&&(l[o]=t.map(r).join(" "),o+=1);for(let c of n)l[o]=c.map(r).join(" "),o+=1;return l.join(`
359
+ `)},G0=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},$g=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,l=t.map(c=>G0(c));r[i]=`| ${l.join(" | ")} |`,i+=1;let o=new Array(t.length);for(let c=0;c<t.length;c+=1)o[c]="---";r[i]=`| ${o.join(" | ")} |`,i+=1;for(let c of n)if(c.length<t.length){let d=new Array(t.length);for(let m=0;m<t.length;m+=1)d[m]=m<c.length?G0(c[m]):"";r[i]=`| ${d.join(" | ")} |`,i+=1}else{let d=c.map(m=>G0(m));r[i]=`| ${d.join(" | ")} |`,i+=1}return r.join(`
360
+ `)},kC=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let l=Rt(),[o,c]=T.useState(!1),[d,m]=T.useState(!1),p=T.useRef(null),g=T.useRef(0),{isAnimating:y}=T.useContext(ia),E=ti(),v=async S=>{var N,A;if(typeof window>"u"||!((N=navigator==null?void 0:navigator.clipboard)!=null&&N.write)){r==null||r(new Error("Clipboard API not available"));return}try{let H=(A=p.current)==null?void 0:A.closest('[data-streamdown="table-wrapper"]'),$=H==null?void 0:H.querySelector("table");if(!$){r==null||r(new Error("Table not found"));return}let U=TC($),P=({csv:vC,tsv:AV,md:$g}[S]||$g)(U),Y=new ClipboardItem({"text/plain":new Blob([P],{type:"text/plain"}),"text/html":new Blob([$.outerHTML],{type:"text/html"})});await navigator.clipboard.write([Y]),m(!0),c(!1),n==null||n(S),g.current=window.setTimeout(()=>m(!1),i)}catch(H){r==null||r(H)}};T.useEffect(()=>{let S=N=>{let A=N.composedPath();p.current&&!A.includes(p.current)&&c(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S),window.clearTimeout(g.current)}},[]);let w=Za(),C=d?w.CheckIcon:w.CopyIcon;return f.jsxs("div",{className:l("relative"),ref:p,children:[f.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:y,onClick:()=>c(!o),title:E.copyTable,type:"button",children:e??f.jsx(C,{height:14,width:14})}),o?f.jsxs("div",{className:l("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("md"),title:E.copyTableAsMarkdown,type:"button",children:E.tableFormatMarkdown}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("csv"),title:E.copyTableAsCsv,type:"button",children:E.tableFormatCsv}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("tsv"),title:E.copyTableAsTsv,type:"button",children:E.tableFormatTsv})]}):null]})},wC=({children:e,className:t,onDownload:n,onError:r})=>{let i=Rt(),[l,o]=T.useState(!1),c=T.useRef(null),{isAnimating:d}=T.useContext(ia),m=ti(),p=Za(),g=y=>{var E;try{let v=(E=c.current)==null?void 0:E.closest('[data-streamdown="table-wrapper"]'),w=v==null?void 0:v.querySelector("table");if(!w){r==null||r(new Error("Table not found"));return}let C=TC(w),S=y==="csv"?vC(C):$g(C);Ho(`table.${y==="csv"?"csv":"md"}`,S,y==="csv"?"text/csv":"text/markdown"),o(!1),n==null||n(y)}catch(v){r==null||r(v)}};return T.useEffect(()=>{let y=E=>{let v=E.composedPath();c.current&&!v.includes(c.current)&&o(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[]),f.jsxs("div",{className:i("relative"),ref:c,children:[f.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>o(!l),title:m.downloadTable,type:"button",children:e??f.jsx(p.DownloadIcon,{size:14})}),l?f.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("csv"),title:m.downloadTableAsCsv,type:"button",children:m.tableFormatCsv}),f.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>g("markdown"),title:m.downloadTableAsMarkdown,type:"button",children:m.tableFormatMarkdown})]}):null]})},RV=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:l}=Za(),o=Rt(),[c,d]=T.useState(!1),{isAnimating:m}=T.useContext(ia),p=ti(),g=()=>{d(!0)},y=()=>{d(!1)};return T.useEffect(()=>{if(c){ub();let E=v=>{v.key==="Escape"&&d(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),cb()}}},[c]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:m,onClick:g,title:p.viewFullscreen,type:"button",children:f.jsx(i,{size:14})}),c?Qo.createPortal(f.jsx("div",{"aria-label":p.viewFullscreen,"aria-modal":"true",className:o("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:y,onKeyDown:E=>{E.key==="Escape"&&y()},role:"dialog",children:f.jsxs("div",{className:o("flex h-full flex-col"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[f.jsxs("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?f.jsx(kC,{}):null,r?f.jsx(wC,{}):null,f.jsx("button",{className:o("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:y,title:p.exitFullscreen,type:"button",children:f.jsx(l,{size:20})})]}),f.jsx("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:f.jsx("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},LV=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:l=!0,...o})=>{let c=Rt(),d=n&&r,m=n&&i,p=n&&l,g=d||m||p;return f.jsxs("div",{className:c("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[g?f.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[d?f.jsx(kC,{}):null,m?f.jsx(wC,{}):null,p?f.jsx(RV,{showCopy:d,showDownload:m,children:e}):null]}):null,f.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:f.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},IV=/startLine=(\d+)/,OV=/\bnoLineNumbers\b/,DV=T.lazy(()=>D(()=>Promise.resolve().then(()=>lY),void 0).then(e=>({default:e.Mermaid}))),jV=/language-([^\s]+)/;function qh(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,l=t.position.end;return(n==null?void 0:n.line)===(r==null?void 0:r.line)&&(n==null?void 0:n.column)===(r==null?void 0:r.column)&&(i==null?void 0:i.line)===(l==null?void 0:l.line)&&(i==null?void 0:i.column)===(l==null?void 0:l.column)}function jn(e,t){return e.className===t.className&&qh(e.node,t.node)}var Vg=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,q0=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},DT=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Cf=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},hb=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>jn(e,t));hb.displayName="MarkdownOl";var CC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&qh(e.node,t.node));CC.displayName="MarkdownLi";var SC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>jn(e,t));SC.displayName="MarkdownUl";var NC=T.memo(({className:e,node:t,...n})=>{let r=Rt();return f.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>jn(e,t));NC.displayName="MarkdownHr";var AC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>jn(e,t));AC.displayName="MarkdownStrong";var MV=({children:e,className:t,href:n,node:r,...i})=>{let l=Rt(),{linkSafety:o}=T.useContext(ia),[c,d]=T.useState(!1),m=n==="streamdown:incomplete-link",p=T.useCallback(async v=>{if(!(!(o!=null&&o.enabled&&n)||m)){if(v.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[o,n,m]),g=T.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),y=T.useCallback(()=>{d(!1)},[]),E={url:n??"",isOpen:c,onClose:y,onConfirm:g};return o!=null&&o.enabled&&n?f.jsxs(f.Fragment,{children:[f.jsx("button",{className:l("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":m,"data-streamdown":"link",onClick:p,type:"button",children:e}),o.renderModal?o.renderModal(E):f.jsx(kV,{...E})]}):f.jsx("a",{className:l("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":m,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},RC=T.memo(MV,(e,t)=>jn(e,t)&&e.href===t.href);RC.displayName="MarkdownA";var LC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>jn(e,t));LC.displayName="MarkdownH1";var IC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>jn(e,t));IC.displayName="MarkdownH2";var OC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>jn(e,t));OC.displayName="MarkdownH3";var DC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>jn(e,t));DC.displayName="MarkdownH4";var jC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>jn(e,t));jC.displayName="MarkdownH5";var MC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>jn(e,t));MC.displayName="MarkdownH6";var PC=T.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=T.useContext(ia),l=Vg(i,"table"),o=q0(i,"copy"),c=q0(i,"download"),d=q0(i,"fullscreen");return f.jsx(LV,{className:t,showControls:l,showCopy:o,showDownload:c,showFullscreen:d,...r,children:e})},(e,t)=>jn(e,t));PC.displayName="MarkdownTable";var BC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>jn(e,t));BC.displayName="MarkdownThead";var UC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>jn(e,t));UC.displayName="MarkdownTbody";var HC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>jn(e,t));HC.displayName="MarkdownTr";var zC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>jn(e,t));zC.displayName="MarkdownTh";var FC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>jn(e,t));FC.displayName="MarkdownTd";var $C=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>jn(e,t));$C.displayName="MarkdownBlockquote";var VC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>jn(e,t));VC.displayName="MarkdownSup";var GC=T.memo(({children:e,className:t,node:n,...r})=>{let i=Rt();return f.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>jn(e,t));GC.displayName="MarkdownSub";var qC=T.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=o=>{var c,d;if(!T.isValidElement(o))return!1;let m=Array.isArray(o.props.children)?o.props.children:[o.props.children],p=!1,g=!1;for(let y of m)if(y){if(typeof y=="string")y.trim()!==""&&(p=!0);else if(T.isValidElement(y))if(((c=y.props)==null?void 0:c["data-footnote-backref"])!==void 0)g=!0;else{let E=Array.isArray(y.props.children)?y.props.children:[y.props.children];for(let v of E){if(typeof v=="string"&&v.trim()!==""){p=!0;break}if(T.isValidElement(v)&&((d=v.props)==null?void 0:d["data-footnote-backref"])===void 0){p=!0;break}}}}return g&&!p},l=Array.isArray(e)?e.map(o=>{if(!T.isValidElement(o))return o;if(o.type===hb){let c=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(d=>!i(d));return c.length===0?null:{...o,props:{...o.props,children:c}}}return o}):e;return(Array.isArray(l)?l.some(o=>o!==null):l!==null)?f.jsx("section",{className:t,...r,children:l}):null}return f.jsx("section",{className:t,...r,children:e})},(e,t)=>jn(e,t));qC.displayName="MarkdownSection";var PV=({node:e,className:t,children:n,...r})=>{var i,l;let o=Rt(),c=!("data-block"in r),{mermaid:d,controls:m,lineNumbers:p}=T.useContext(ia),g=fb(),y=J$(),E=t==null?void 0:t.match(jV),v=(i=E==null?void 0:E.at(1))!=null?i:"",w=wV(v);if(c)return f.jsx("code",{className:o("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let C=(l=e==null?void 0:e.properties)==null?void 0:l.metastring,S=C==null?void 0:C.match(IV),N=S?Number.parseInt(S[1],10):void 0,A=N!==void 0&&N>=1?N:void 0,H=!(C&&OV.test(C))&&p!==!1,$="";if(T.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?$=n.props.children:typeof n=="string"&&($=n),w){let fe=w.component;return f.jsx(T.Suspense,{fallback:f.jsx(OT,{}),children:f.jsx(fe,{code:$,isIncomplete:y,language:v,meta:C})})}if(v==="mermaid"&&g){let fe=Vg(m,"mermaid"),M=Cf(m,"download"),K=Cf(m,"copy"),V=Cf(m,"fullscreen"),he=Cf(m,"panZoom"),de=fe&&(M||K||V);return f.jsx(T.Suspense,{fallback:f.jsx(OT,{}),children:f.jsxs("div",{className:o("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[f.jsx("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:f.jsx("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),de?f.jsx("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsxs("div",{className:o("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[M?f.jsx(SV,{chart:$,config:d==null?void 0:d.config}):null,K?f.jsx(LT,{code:$}):null,V?f.jsx(NV,{chart:$,config:d==null?void 0:d.config}):null]})}):null,f.jsx("div",{className:o("rounded-md border border-border bg-background"),children:f.jsx(DV,{chart:$,config:d==null?void 0:d.config,showControls:he})})]})})}let U=Vg(m,"code"),P=DT(m,"download"),Y=DT(m,"copy");return f.jsx(uV,{className:t,code:$,isIncomplete:y,language:v,lineNumbers:H,startLine:A,children:U?f.jsxs(f.Fragment,{children:[P?f.jsx(_V,{code:$,language:v}):null,Y?f.jsx(LT,{}):null]}):null})},YC=T.memo(PV,(e,t)=>e.className===t.className&&qh(e.node,t.node));YC.displayName="MarkdownCode";var WC=T.memo(vV,(e,t)=>e.className===t.className&&qh(e.node,t.node));WC.displayName="MarkdownImg";var QC=T.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&T.isValidElement(r[0])){let i=r[0].props.node,l=i==null?void 0:i.tagName;if(l==="img")return f.jsx(f.Fragment,{children:e});if(l==="code"&&"data-block"in r[0].props)return f.jsx(f.Fragment,{children:e})}return f.jsx("p",{...n,children:e})},(e,t)=>jn(e,t));QC.displayName="MarkdownParagraph";var BV={ol:hb,li:CC,ul:SC,hr:NC,strong:AC,a:RC,h1:LC,h2:IC,h3:OC,h4:DC,h5:jC,h6:MC,table:PC,thead:BC,tbody:UC,tr:HC,th:zC,td:FC,blockquote:$C,code:YC,img:WC,pre:({children:e})=>T.isValidElement(e)?T.cloneElement(e,{"data-block":"true"}):e,sup:VC,sub:GC,p:QC,section:qC},UV=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,HV=new RegExp("\\p{L}","u");function jT(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(UV.test(n))return"rtl";if(HV.test(n))return"ltr"}return"ltr"}var zV=/^[ \t]{0,3}(`{3,}|~{3,})/,FV=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,MT=e=>{let t=e.split(`
361
+ `),n=null,r=0;for(let i of t){let l=zV.exec(i);if(n===null){if(l){let o=l[1];n=o[0],r=o.length}}else if(l){let o=l[1],c=o[0],d=o.length;c===n&&d>=r&&(n=null,r=0)}}return n!==null},$V=e=>{let t=e.split(`
362
+ `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&FV.test(r))return!0}return!1},VV=()=>e=>{gs(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},PT=[],BT={allowDangerousHtml:!0},Sf=new WeakMap,GV=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let p="default";return this.keyCache.set(e,p),p}let l=p=>{if(!p||p.length===0)return"";let g="";for(let y=0;y<p.length;y+=1){let E=p[y];if(y>0&&(g+=","),Array.isArray(E)){let[v,w]=E;if(typeof v=="function"){let C=Sf.get(v);C||(C=v.name,Sf.set(v,C)),g+=C}else g+=String(v);g+=":",g+=JSON.stringify(w)}else if(typeof E=="function"){let v=Sf.get(E);v||(v=E.name,Sf.set(E,v)),g+=v}else g+=String(E)}return g},o=l(n),c=l(r),d=i?JSON.stringify(i):"",m=`${c}::${o}::${d}`;return this.keyCache.set(e,m),m}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},UT=new GV,XC=e=>{let t=qV(e),n=e.children||"",r=t.runSync(t.parse(n),n);return JV(r,e)},qV=e=>{let t=UT.get(e);if(t)return t;let n=WV(e);return UT.set(e,n),n},YV=e=>e.some(t=>Array.isArray(t)?t[0]===Sg:t===Sg),WV=e=>{let t=e.rehypePlugins||PT,n=e.remarkPlugins||PT,r=YV(t)?n:[...n,VV],i=e.remarkRehypeOptions?{...BT,...e.remarkRehypeOptions}:BT;return QF().use(Wz).use(r).use(RF,i).use(t)},QV=e=>e,XV=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},KV=(e,t)=>{var n;for(let r in M0)if(Object.hasOwn(M0,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],l=M0[r];(l===null||l.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},ZV=(e,t,n,r,i,l)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&l&&typeof t=="number"&&(o=!l(e,t,n)),o},JV=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:l,unwrapDisallowed:o,urlTransform:c}=t;if(n||r||i||l||c){let d=c||QV;gs(e,(m,p,g)=>{if(m.type==="raw"&&g&&typeof p=="number")return XV(g,p,l,m.value),p;if(m.type==="element"&&(KV(m,d),ZV(m,p,g,r,i,n)&&g&&typeof p=="number"))return o&&m.children?g.children.splice(p,1,...m.children):g.children.splice(p,1),p})}return nz(e,{Fragment:f.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0})},eG=/\[\^[\w-]{1,200}\](?!:)/,tG=/\[\^[\w-]{1,200}\]:/,nG=/<(\w+)[\s>]/,rG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),HT=new Map,zT=new Map,aG=e=>{let t=e.toLowerCase(),n=HT.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return HT.set(t,r),r},sG=e=>{let t=e.toLowerCase(),n=zT.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return zT.set(t,r),r},FT=(e,t)=>{if(rG.has(t.toLowerCase()))return 0;let n=e.match(aG(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},$T=(e,t)=>{let n=e.match(sG(t));return n?n.length:0},iG=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},lG=e=>{let t=eG.test(e),n=tG.test(e);if(t||n)return[e];let r=Sa.lex(e,{gfm:!0}),i=[],l=[],o=!1;for(let c of r){let d=c.raw,m=i.length;if(l.length>0){i[m-1]+=d;let p=l.at(-1),g=FT(d,p),y=$T(d,p);for(let E=0;E<g;E+=1)l.push(p);for(let E=0;E<y;E+=1)l.length>0&&l.at(-1)===p&&l.pop();continue}if(c.type==="html"&&c.block){let p=d.match(nG);if(p){let g=p[1],y=FT(d,g),E=$T(d,g);y>E&&l.push(g)}}if(m>0&&!o){let p=i[m-1];if(iG(p)%2===1){i[m-1]=p+d;continue}}i.push(d),c.type!=="space"&&(o=c.type==="code")}return i},oG=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(l,o,c,d)=>{if(!c.includes(`
363
+
364
+ `))return o+c+d;let m=c.replace(/\n\n/g,`
365
+ <!---->
366
+ `),p=(m.startsWith(`
367
+ `)?"":`
368
+ `)+m+(m.endsWith(`
369
+ `)?"":`
370
+ `);return`${o}${p}${d}
371
+
372
+ `})}return n},uG=/([\\`*_~[\]|])/g,cG=e=>e.replace(uG,"\\$1"),dG=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(l,o,c,d)=>{let m=cG(c).replace(/\n\n/g,"&#10;&#10;");return o+m+d})}return n},KC=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(KC).join(""):"",fG=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));gs(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=KC(r);r.children=i?[{type:"text",value:i}]:[]}})},hG=()=>e=>{gs(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},mG=/^[ \t]*<[\w!/?-]/,pG=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,gG=e=>typeof e!="string"||e.length===0||!mG.test(e)?e:e.replace(pG,"$1"),VT,GT,qT,YT,qf={...Al,protocols:{...Al.protocols,href:[...(GT=(VT=Al.protocols)==null?void 0:VT.href)!=null?GT:[],"tel"]},attributes:{...Al.attributes,code:[...(YT=(qT=Al.attributes)==null?void 0:qT.code)!=null?YT:[],"metastring"]}},Gg={raw:Sg,sanitize:[V3,qf],harden:[D8,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},ZC={gfm:[$B,{}],codeMeta:hG},WT=Object.values(Gg),bG=Object.values(ZC),xG={block:" ▋",circle:" ●"},JC=["github-light","github-dark"],eS={enabled:!0},yG={shikiTheme:JC,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:eS},ia=T.createContext(yG),tS=T.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:l,animatePlugin:o,...c})=>{if(o){let p=o.getLastRenderCharCount();o.setPrevContentLength(p)}let d=typeof e=="string"&&n?gG(e):e,m=f.jsx(XC,{...c,children:d});return f.jsx(bC.Provider,{value:i,children:l?f.jsx("div",{dir:l,style:{display:"contents"},children:m}):m})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var l,o;return((l=e.components)==null?void 0:l[i])!==((o=t.components)==null?void 0:o[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});tS.displayName="Block";var nS=T.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:l,rehypePlugins:o=WT,remarkPlugins:c=bG,className:d,shikiTheme:m=JC,mermaid:p,controls:g=!0,isAnimating:y=!1,animated:E,BlockComponent:v=tS,parseMarkdownIntoBlocksFn:w=lG,caret:C,plugins:S,remend:N,linkSafety:A=eS,lineNumbers:H=!0,allowedTags:$,literalTagContent:U,translations:P,icons:Y,prefix:fe,onAnimationStart:M,onAnimationEnd:K,...V})=>{let he=T.useId(),[de,ne]=T.useTransition(),z=T.useMemo(()=>tV(fe),[fe]),ee=T.useRef(null),Te=T.useRef(M),De=T.useRef(K);Te.current=M,De.current=K,T.useEffect(()=>{var at,Ke,Ge;if(t==="static")return;let an=ee.current;if(ee.current=y,an===null){y&&((at=Te.current)==null||at.call(Te));return}y&&!an?(Ke=Te.current)==null||Ke.call(Te):!y&&an&&((Ge=De.current)==null||Ge.call(De))},[y,t]);let L=T.useMemo(()=>$?Object.keys($):[],[$]),F=T.useMemo(()=>{if(typeof e!="string")return"";let at=t==="streaming"&&r?eH(e,N):e;return U&&U.length>0&&(at=dG(at,U)),L.length>0&&(at=oG(at,L)),at},[e,t,r,N,L,U]),se=T.useMemo(()=>w(F),[F,w]),[O,ke]=T.useState(se);T.useEffect(()=>{t==="streaming"&&!Me?ne(()=>{ke(se)}):ke(se)},[se,t]);let Ae=t==="streaming"?O:se,_e=T.useMemo(()=>n==="auto"?Ae.map(jT):void 0,[Ae,n]),et=T.useMemo(()=>Ae.map((at,Ke)=>`${he}-${Ke}`),[Ae.length,he]),st=T.useMemo(()=>E===!0?"true":E?JSON.stringify(E):"",[E]),Me=T.useMemo(()=>st?st==="true"?Ug():Ug(E):null,[st]),dt=T.useMemo(()=>{var at,Ke;return{shikiTheme:(Ke=(at=S==null?void 0:S.code)==null?void 0:at.getThemes())!=null?Ke:m,controls:g,isAnimating:y,lineNumbers:H,mode:t,mermaid:p,linkSafety:A}},[m,g,y,H,t,p,A,S==null?void 0:S.code]),pt=T.useMemo(()=>P?JSON.stringify(P):"",[P]),Dt=T.useMemo(()=>({..._C,...P}),[pt]),kn=T.useMemo(()=>{let{inlineCode:at,...Ke}=l??{},Ge={...BV,...Ke};if(at){let an=Ge.code;Ge.code=xn=>"data-block"in xn?an?T.createElement(an,xn):null:T.createElement(at,xn)}return Ge},[l]),bt=T.useMemo(()=>{let at=[];return S!=null&&S.cjk&&(at=[...at,...S.cjk.remarkPluginsBefore]),at=[...at,...c],S!=null&&S.cjk&&(at=[...at,...S.cjk.remarkPluginsAfter]),S!=null&&S.math&&(at=[...at,S.math.remarkPlugin]),at},[c,S==null?void 0:S.math,S==null?void 0:S.cjk]),He=T.useMemo(()=>{var at;let Ke=o;if($&&Object.keys($).length>0&&o===WT){let Ge={...qf,tagNames:[...(at=qf.tagNames)!=null?at:[],...Object.keys($)],attributes:{...qf.attributes,...$}};Ke=[Gg.raw,[V3,Ge],Gg.harden]}return U&&U.length>0&&(Ke=[...Ke,[fG,U]]),S!=null&&S.math&&(Ke=[...Ke,S.math.rehypePlugin]),Me&&y&&(Ke=[...Ke,Me.rehypePlugin]),Ke},[o,S==null?void 0:S.math,Me,y,$,U]),Ve=T.useMemo(()=>{if(!y||Ae.length===0)return!1;let at=Ae.at(-1);return MT(at)||$V(at)},[y,Ae]),Qt=T.useMemo(()=>C&&y&&!Ve?{"--streamdown-caret":`"${xG[C]}"`}:void 0,[C,y,Ve]);return t==="static"?f.jsx(zg.Provider,{value:Dt,children:f.jsx(Fg.Provider,{value:S??null,children:f.jsx(ia.Provider,{value:dt,children:f.jsx(RT,{icons:Y,children:f.jsx(Hg.Provider,{value:z,children:f.jsx("div",{className:z("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?jT(F):n,children:f.jsx(XC,{components:kn,rehypePlugins:He,remarkPlugins:bt,...V,children:F})})})})})})}):f.jsx(zg.Provider,{value:Dt,children:f.jsx(Fg.Provider,{value:S??null,children:f.jsx(ia.Provider,{value:dt,children:f.jsx(RT,{icons:Y,children:f.jsx(Hg.Provider,{value:z,children:f.jsxs("div",{className:z("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",C&&!Ve?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:Qt,children:[Ae.length===0&&C&&y&&f.jsx("span",{}),Ae.map((at,Ke)=>{var Ge;let an=Ke===Ae.length-1,xn=y&&an&&MT(at);return f.jsx(v,{animatePlugin:Me,components:kn,content:at,dir:(Ge=_e==null?void 0:_e[Ke])!=null?Ge:n!=="auto"?n:void 0,index:Ke,isIncomplete:xn,rehypePlugins:He,remarkPlugins:bt,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...V},et[Ke])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);nS.displayName="Streamdown";var EG=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:l=!0,initialZoom:o=1,fullscreen:c=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:m,ZoomOutIcon:p}=Za(),g=Rt(),y=T.useRef(null),E=T.useRef(null),[v,w]=T.useState(o),[C,S]=T.useState({x:0,y:0}),[N,A]=T.useState(!1),[H,$]=T.useState({x:0,y:0}),[U,P]=T.useState({x:0,y:0}),Y=T.useCallback(z=>{w(ee=>Math.max(n,Math.min(r,ee+z)))},[n,r]),fe=T.useCallback(()=>{Y(i)},[Y,i]),M=T.useCallback(()=>{Y(-i)},[Y,i]),K=T.useCallback(()=>{w(o),S({x:0,y:0})},[o]),V=T.useCallback(z=>{z.preventDefault();let ee=z.deltaY>0?-i:i;Y(ee)},[Y,i]),he=T.useCallback(z=>{if(z.button!==0||z.isPrimary===!1)return;A(!0),$({x:z.clientX,y:z.clientY}),P(C);let ee=z.currentTarget;ee instanceof HTMLElement&&ee.setPointerCapture(z.pointerId)},[C]),de=T.useCallback(z=>{if(!N)return;z.preventDefault();let ee=z.clientX-H.x,Te=z.clientY-H.y;S({x:U.x+ee,y:U.y+Te})},[N,H,U]),ne=T.useCallback(z=>{A(!1);let ee=z.currentTarget;ee instanceof HTMLElement&&ee.releasePointerCapture(z.pointerId)},[]);return T.useEffect(()=>{let z=y.current;if(z)return z.addEventListener("wheel",V,{passive:!1}),()=>{z.removeEventListener("wheel",V)}},[V]),T.useEffect(()=>{let z=E.current;if(z&&N)return document.body.style.userSelect="none",z.addEventListener("pointermove",de,{passive:!1}),z.addEventListener("pointerup",ne),z.addEventListener("pointercancel",ne),()=>{document.body.style.userSelect="",z.removeEventListener("pointermove",de),z.removeEventListener("pointerup",ne),z.removeEventListener("pointercancel",ne)}},[N,de,ne]),f.jsxs("div",{className:g("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:y,style:{cursor:N?"grabbing":"grab"},children:[l?f.jsxs("div",{className:g("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[f.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v>=r,onClick:fe,title:"Zoom in",type:"button",children:f.jsx(m,{size:16})}),f.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v<=n,onClick:M,title:"Zoom out",type:"button",children:f.jsx(p,{size:16})}),f.jsx("button",{className:g("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:K,title:"Reset zoom and pan",type:"button",children:f.jsx(d,{size:16})})]}):null,f.jsx("div",{className:g("flex-1 origin-center transition-transform duration-150 ease-out",c?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:he,ref:E,role:"application",style:{transform:`translate(${C.x}px, ${C.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},rS=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let l=Rt(),[o,c]=T.useState(null),[d,m]=T.useState(!1),[p,g]=T.useState(""),[y,E]=T.useState(""),[v,w]=T.useState(0),{mermaid:C}=T.useContext(ia),S=fb(),N=C==null?void 0:C.errorComponent,{shouldRender:A,containerRef:H}=$$({immediate:r});if(T.useEffect(()=>{if(A){if(!S){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),m(!0);let U=S.getMermaid(n),P=e.split("").reduce((M,K)=>(M<<5)-M+K.charCodeAt(0)|0,0),Y=`mermaid-${Math.abs(P)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:fe}=await U.render(Y,e);g(fe),E(fe)}catch(U){if(!(y||p)){let P=U instanceof Error?U.message:"Failed to render Mermaid chart";c(P)}}finally{m(!1)}})()}},[e,n,v,A,S]),!(A||p||y))return f.jsx("div",{className:l("my-4 min-h-[200px]",t),ref:H});if(d&&!p&&!y)return f.jsx("div",{className:l("my-4 flex justify-center p-4",t),ref:H,children:f.jsxs("div",{className:l("flex items-center space-x-2 text-muted-foreground"),children:[f.jsx("div",{className:l("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),f.jsx("span",{className:l("text-sm"),children:"Loading diagram..."})]})});if(o&&!p&&!y){let U=()=>w(P=>P+1);return N?f.jsx("div",{ref:H,children:f.jsx(N,{chart:e,error:o,retry:U})}):f.jsxs("div",{className:l("rounded-md bg-red-50 p-4",t),ref:H,children:[f.jsxs("p",{className:l("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),f.jsxs("details",{className:l("mt-2"),children:[f.jsx("summary",{className:l("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),f.jsx("pre",{className:l("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let $=p||y;return f.jsx("div",{className:l("size-full",t),"data-streamdown":"mermaid",ref:H,children:f.jsx(EG,{className:l(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:f.jsx("div",{"aria-label":"Mermaid chart",className:l("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:$},role:"img"})})})};function aS({open:e,title:t,text:n,onClose:r}){return T.useEffect(()=>{if(!e)return;function i(l){l.key==="Escape"&&r()}return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[r,e]),e?Qo.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4 sm:p-6",children:[f.jsx("button",{type:"button","aria-label":"Close full text",onClick:r,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm"}),f.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] flex max-h-[min(82vh,52rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-stone-800 px-4 py-3 sm:px-5",children:[f.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:t}),f.jsx("button",{type:"button","aria-label":"Close dialog",onClick:r,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4 sm:px-5",children:f.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-200",children:n})})]})]}),document.body):null}const _G=[/^(?: {0,3})#{1,6}\s+\S/m,/^(?: {0,3})>{1,}\s*\S/m,/^(?: {0,3})(?:[-+*]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?\S/m,/^(?: {0,3})(?:```|~~~)/m,/^(?: {0,3})(?:[-*_]\s*){3,}$/m],TG=/^(?:\|?[^|\n]+\|[^|\n]+(?:\|[^|\n]+)*\|?\s*\n\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$)/m,vG=/!?\[[^\]\n]+\]\([^)]+\)/,kG=/`[^`\n]+`/,wG=/(?:\*\*[^*\n]+\*\*|__[^_\n]+__)/,CG=/(^|[^\w])(?:\*[^*\n]+\*|_[^_\n]+_)(?=[^\w]|$)/,SG=/~~[^~\n]+~~/;function NG(e){const t=e.trim();return t?_G.some(n=>n.test(t))||TG.test(t)?!0:/[`[\]*_~!]/.test(t)?vG.test(t)||kG.test(t)||wG.test(t)||CG.test(t)||SG.test(t):!1:!1}function Yh(e){return e?new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"Time unavailable"}function zo(e){return e?new Date(e).toLocaleString():"Time unavailable"}function sS(e){switch(e){case"idle":return"Idle";case"running":return"Running";case"interrupted":return"Interrupted";case"failed":return"Failed";case"not_loaded":return"Not Loaded";case"system_error":return"System Error"}}function AG(e){switch(e){case"idle":return"ui-status-neutral";case"running":return"ui-status-info";case"interrupted":return"ui-status-warning";case"failed":case"system_error":return"ui-status-danger";case"not_loaded":return"ui-status-neutral"}}function iS(e){switch(e){case"sending":return"Sending";case"completed":return"Completed";case"interrupted":return"Interrupted";case"failed":return"Failed";case"inProgress":return"Running"}}function _s(e){switch(e){case"userMessage":return"timeline-kind-user";case"agentMessage":return"timeline-kind-agent";case"image":return"timeline-kind-action";case"contextCompaction":return"timeline-kind-action";case"commandExecution":return"timeline-kind-command";case"webSearch":return"timeline-kind-search";case"reasoning":return"timeline-kind-reasoning";case"toolCall":return"timeline-kind-action";case"plan":return"timeline-kind-plan";case"fileChange":return"timeline-kind-file";case"hook":return"timeline-kind-action";case"other":return"ui-status-neutral"}}function lS(e){switch(e){case"userMessage":return"User";case"agentMessage":return"Agent";case"image":return"Image";case"contextCompaction":return"Context";case"commandExecution":return"Command";case"webSearch":return"Web Search";case"reasoning":return"Reasoning";case"toolCall":return"Tool";case"plan":return"Plan";case"fileChange":return"File Change";case"hook":return"Hook";case"other":return"Other"}}function RG(e){return e==="commandExecution"||e==="reasoning"}const QT=10,LG=10,qg=80;function Ts(e){switch(e){case"userMessage":return"timeline-user";case"agentMessage":return"timeline-agent";case"image":return"timeline-action";case"contextCompaction":return"timeline-action";case"commandExecution":return"timeline-command";case"webSearch":return"timeline-search";case"reasoning":return"timeline-reasoning";case"toolCall":return"timeline-action";case"plan":return"timeline-plan";case"fileChange":return"timeline-file-change";case"hook":return"timeline-action";case"other":return"timeline-other"}}function Ia(e){switch(e){case"user":return"timeline-overlay-badge timeline-overlay-badge-user";case"agent":return"timeline-overlay-badge timeline-overlay-badge-agent";case"command":return"timeline-overlay-badge timeline-overlay-badge-command";case"search":return"timeline-overlay-badge timeline-overlay-badge-search";case"action":return"timeline-overlay-badge timeline-overlay-badge-action"}}function XT(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M3.5 5.25h9"}),f.jsx("path",{d:"M5 8h6"}),f.jsx("path",{d:"M6.5 10.75h3"})]})}function IG(e){var n;const t=e.replace(/\r\n/g,`
373
+ `).split(`
374
+ `);for(;t.length>1&&((n=t.at(-1))==null?void 0:n.trim())==="";)t.pop();return t}function KT(e){return e.replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}function iu(e){const t=IG(e);return t.length===1?{firstLine:t[0]??"",showGap:!1,isTruncated:!1}:{firstLine:t[0]??"",showGap:!0,isTruncated:!0}}function Yg(e){const t=e.trim().match(/^<hook_prompt(?:\s+hook_run_id="([^"]+)")?>([\s\S]*)<\/hook_prompt>$/);if(!t)return null;const n=t[1]?KT(t[1]):null,r=KT(t[2]??"").trim(),i=(n==null?void 0:n.split(":")[0])??"hook",l=i==="stop"?"Stop":i,o=(n==null?void 0:n.split(":").slice(2).join(":"))||null;return{id:`live-hook-prompt:${n??"unknown"}`,kind:"hook",text:`${l} hook`,previewText:r||`${l} hook`,detailText:r||null,status:"Completed",hookEventName:i,hookEventLabel:l,hookHandlerType:"command",hookScope:"turn",hookSource:o?"project":null,hookSourcePath:o,hookStatusMessage:null,hookOutputEntries:r?[{kind:"warning",text:r}]:[]}}function ZT(e){const t=e.replace(/[\\/]+$/,"").trim();return t?t.split(/[\\/]/).filter(Boolean).at(-1)??t:""}function OG(e){var l;if(!e)return[];const t=/\[(PHOTO|FILE)\s+([^\]]+)\]/g,n=[];let r=0,i=0;for(const o of e.matchAll(t)){const c=o.index??0;c>r&&(n.push({type:"text",key:`text-${i}`,text:e.slice(r,c)}),i+=1);const d=o[1],m=((l=o[2])==null?void 0:l.trim())??"";d==="PHOTO"&&m?n.push({type:"photo",key:`photo-${i}`,path:m}):d==="FILE"&&m?n.push({type:"file",key:`file-${i}`,path:m}):n.push({type:"text",key:`text-${i}`,text:o[0]}),i+=1,r=c+o[0].length}return r<e.length&&n.push({type:"text",key:`text-${i}`,text:e.slice(r)}),n}function oS(e,t=42){const n=e.trim();if(!n)return"";const r=n.match(/(, \+\d+ more.*)$/),i=(r==null?void 0:r[1])??"",l=i?n.slice(0,-i.length):n;if(l.length<=t)return`${l}${i}`;const c=l.replace(/\\/g,"/").split("/").filter(Boolean);if(c.length>1){const d=[];let m=i.length+4;for(let p=c.length-1;p>=0;p-=1){const g=c[p],y=m+g.length+(d.length>0?1:0);if(d.length>0&&y>t)break;d.unshift(g),m=y}if(d.length>0)return`.../${d.join("/")}${i}`}return`...${l.slice(-(t-i.length-3))}${i}`}function DG(e){var r;const t=[];if(typeof e.changedFiles=="number"&&e.changedFiles>0&&t.push(`${e.changedFiles} ${e.changedFiles===1?"file":"files"}`),typeof e.addedLines=="number"&&e.addedLines>0&&t.push(`+${e.addedLines}`),typeof e.removedLines=="number"&&e.removedLines>0&&t.push(`-${e.removedLines}`),t.length>0)return t;const n=(r=e.previewText)==null?void 0:r.trim();return n?n.replace(/\bfiles changed\b/gi,"files").replace(/\bfile changed\b/gi,"file").split("·").map(i=>i.trim()).filter(Boolean):[]}function jG(e){return e==="userMessage"||e==="agentMessage"}function MG(e){return e==="commandExecution"||e==="webSearch"||e==="fileChange"||e==="image"||e==="contextCompaction"}function PG(e){return e==="agentMessage"||e==="reasoning"||e==="toolCall"||e==="plan"}function BG(e,t){if(!t)return e;const n=[...e],r=n.findIndex(l=>l.kind==="userMessage");if(r<0)return n;for(let l=r+1;l<n.length;l+=1){const o=n[l];if(!o||o.kind!=="userMessage")continue;let c=l+1;for(;c<n.length&&MG(n[c].kind);)c+=1;if(c===l+1)continue;const[d]=n.splice(l,1);n.splice(c-1,0,d),l=c-1}let i=!1;return n.map((l,o)=>l.kind!=="userMessage"?l:i?n.slice(o+1).some(d=>PG(d.kind))?l:{...l,status:"Awaiting response"}:(i=!0,l))}function UG(e,t){if(!t||t.length===0)return e;const n=new Set(e.map(l=>l.id)),r=t.filter(l=>!n.has(l.id));if(r.length===0)return e;const i=[...e,...r];return i.some(l=>typeof l.sequence=="number"&&Number.isFinite(l.sequence))?i.map((l,o)=>({item:l,index:o})).sort((l,o)=>{const c=typeof l.item.sequence=="number"&&Number.isFinite(l.item.sequence)?l.item.sequence:Number.POSITIVE_INFINITY,d=typeof o.item.sequence=="number"&&Number.isFinite(o.item.sequence)?o.item.sequence:Number.POSITIVE_INFINITY;return c===d?l.index-o.index:c-d}).map(l=>l.item):i}function HG(e,t){if(!e)return"";const n=t.filter(d=>d.kind==="agentMessage").map(d=>d.text).filter(d=>d.length>0),r=n.at(-1)??"";if(r){const d=e.lastIndexOf(r);if(d>=0){const m=e.slice(d+r.length);return m.trim()?m:""}}const i=n.join("");if(!i)return e;const l=Math.min(e.length,i.length);let o=0;for(;o<l&&e[o]===i[o];)o+=1;if(o===0)return e;const c=e.slice(o);return c.trim()?c:""}function bs(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("running")||t.includes("inprogress")||t.includes("in_progress")}function bh(e){return e==="inProgress"||e==="sending"}function Y0(e,t=qg){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function zG(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=Math.max(n.top,r.top),l=Math.min(n.bottom,r.bottom);return Math.max(0,l-i)>0}function FG(e){var r;const t=[];let n=0;for(;n<e.length;){const i=e[n];if(!i)break;if(i.kind!=="commandExecution"&&i.kind!=="fileChange"&&i.kind!=="webSearch"){t.push({kind:"item",key:i.id,item:i}),n+=1;continue}const l=[];for(;n<e.length&&((r=e[n])==null?void 0:r.kind)===i.kind;)l.push(e[n]),n+=1;if(l.length===1){t.push({kind:"item",key:l[0].id,item:l[0]});continue}const o=l.map(c=>c.id).join(":");if(i.kind==="commandExecution"){t.push({kind:"commandGroup",key:o,items:l});continue}if(i.kind==="fileChange"){t.push({kind:"fileChangeGroup",key:o,items:l});continue}t.push({kind:"searchGroup",key:o,items:l})}return t}function JT({kind:e}){return e==="userMessage"?f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M8 8a2.75 2.75 0 1 0 0-5.5A2.75 2.75 0 0 0 8 8Z"}),f.jsx("path",{d:"M3.5 13.25a4.5 4.5 0 0 1 9 0"})]}):f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"3.25",y:"3",width:"9.5",height:"7.5",rx:"2"}),f.jsx("path",{d:"M5.5 6.75h.01M10.5 6.75h.01M6.5 12.25h3"}),f.jsx("path",{d:"M6 10.5v1.75M10 10.5v1.75"})]})}function ev(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"m4 5 2 2-2 2"}),f.jsx("path",{d:"M7.75 9.5h4.25"})]})}function Wg(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M6.25 4.25 3.5 7l2.75 2.75"}),f.jsx("path",{d:"M9.75 4.25 12.5 7 9.75 9.75"}),f.jsx("path",{d:"M8.9 3.5 7.1 10.5"}),f.jsx("path",{d:"M3 12.25h10"})]})}function tv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M6.25 4.5v4.25a2.75 2.75 0 1 0 2.75 2.75V7.25"}),f.jsx("path",{d:"M9 7.25a2.75 2.75 0 1 0-2.75-2.75"})]})}function nv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"2.75",y:"3",width:"8.5",height:"3",rx:"1.1"}),f.jsx("rect",{x:"4.25",y:"6.5",width:"8.5",height:"3",rx:"1.1"}),f.jsx("rect",{x:"5.75",y:"10",width:"7.5",height:"3",rx:"1.1"}),f.jsx("path",{d:"m6.25 4.5 1 1-1 1"}),f.jsx("path",{d:"M7.9 5.5h1.7"}),f.jsx("path",{d:"m7.75 8 1 1-1 1"}),f.jsx("path",{d:"M9.4 9h1.7"})]})}function rv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("circle",{cx:"7",cy:"7",r:"3.75"}),f.jsx("path",{d:"m10.25 10.25 3 3"})]})}function av(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("circle",{cx:"6",cy:"6",r:"2.3"}),f.jsx("path",{d:"m8 8 1.6 1.6"}),f.jsx("circle",{cx:"9.3",cy:"8.8",r:"2"}),f.jsx("path",{d:"m10.75 10.25 1.65 1.65"}),f.jsx("circle",{cx:"11.2",cy:"4.75",r:"1.8"}),f.jsx("path",{d:"m12.45 6 1.1 1.1"})]})}function sv(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"2.75",y:"3",width:"10.5",height:"9.5",rx:"1.5"}),f.jsx("circle",{cx:"6.1",cy:"6.1",r:"1.1"}),f.jsx("path",{d:"m4.5 10 2.2-2.2 1.9 1.9 1.1-1.1 1.8 1.8"})]})}function xh(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),f.jsx("path",{d:"M9 2.75v2h2"}),f.jsx("path",{d:"M6.2 8h3.6"}),f.jsx("path",{d:"M6.2 10h1.7"})]})}function $G(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M4.25 4.75h7.5"}),f.jsx("path",{d:"M4.25 8h7.5"}),f.jsx("path",{d:"M4.25 11.25h4.5"}),f.jsx("path",{d:"M2.25 4.75h.01M2.25 8h.01M2.25 11.25h.01"})]})}function VG(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:f.jsx("path",{d:"m13.28 7.78 3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 0 0 1.06 1.06ZM2 17.25v-4.5a.75.75 0 0 1 1.5 0v2.69l3.22-3.22a.75.75 0 0 1 1.06 1.06L4.56 16.5h2.69a.75.75 0 0 1 0 1.5h-4.5a.747.747 0 0 1-.75-.75ZM12.22 13.28l3.22 3.22h-2.69a.75.75 0 0 0 0 1.5h4.5a.747.747 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v2.69l-3.22-3.22a.75.75 0 1 0-1.06 1.06ZM3.5 4.56l3.22 3.22a.75.75 0 0 0 1.06-1.06L4.56 3.5h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0V4.56Z"})})}function GG(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{x:"5.25",y:"3.25",width:"7.5",height:"9",rx:"1.5"}),f.jsx("path",{d:"M10.75 12.75H4.5a1.25 1.25 0 0 1-1.25-1.25V4.75A1.25 1.25 0 0 1 4.5 3.5h.75"})]})}function Vr({tone:e="amber"}){const t=e==="emerald"?"bg-sky-200/90":e==="sky"?"bg-sky-300/90":"bg-amber-200/90";return f.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>f.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${t}`,style:{animationDelay:`${n*180}ms`}},n))})}function Qg(e){const t=e.trim().toLowerCase();return t==="completed"||t==="done"||t==="complete"?"completed":t==="in_progress"||t==="in progress"||t==="inprogress"||t==="running"||t==="active"?"in_progress":t==="pending"||t==="todo"||t==="not_started"||t==="not started"||t==="queued"?"pending":t==="failed"||t==="error"?"failed":"other"}function qG(e){switch(e.kind){case"fileChange":case"webSearch":case"image":case"contextCompaction":return!0;case"commandExecution":case"toolCall":return!bs(e.status);default:return!1}}function YG(e,t,n){if(!e||!bh(n))return e;const r=e.plan.findIndex(c=>Qg(c.status)==="in_progress");if(r<0)return e;const i=e.plan.findIndex((c,d)=>d>r&&Qg(c.status)==="pending");if(i<0||!t.some(c=>qG(c)))return e;const o=e.plan.map((c,d)=>d===r?{...c,status:"completed"}:d===i?{...c,status:"in_progress"}:c);return{...e,plan:o}}function WG(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),f.jsx("path",{d:"M8 5.25v2.9l2.05 1.2"})]})}function QG({status:e}){const t=Qg(e),n=t==="completed"?"Plan step status: Completed":t==="in_progress"?"Plan step status: In progress":t==="pending"?"Plan step status: Pending":t==="failed"?"Plan step status: Failed":`Plan step status: ${e}`,r=t==="completed"?"ui-status-success":t==="in_progress"?"ui-status-info":t==="pending"?"border-stone-700/90 bg-stone-900/80 text-stone-300":t==="failed"?"border-rose-300/30 bg-rose-300/10 text-rose-100":"border-stone-700/90 bg-stone-900/80 text-stone-300";return f.jsx("span",{"aria-label":n,title:n.replace("Plan step status: ",""),className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border ${r}`,children:t==="completed"?f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):t==="in_progress"?f.jsx(Vr,{tone:"sky"}):t==="pending"?f.jsx(WG,{}):t==="failed"?f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})}):f.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.14em]",children:"?"})})}function iv({status:e}){const t=iS(e);return e==="completed"?f.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-success inline-flex h-4 w-4 items-center justify-center",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})})}):e==="failed"?f.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-failed inline-flex h-4 w-4 items-center justify-center",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})})}):e==="interrupted"?f.jsx("span",{"aria-label":t,title:t,className:"timeline-status-icon timeline-status-icon-warning inline-flex h-4 w-4 items-center justify-center",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M6 4.5v7M10 4.5v7"})})}):f.jsx("span",{"aria-label":t,title:t,className:"inline-flex min-w-[1.25rem] items-center justify-center text-sky-200",children:f.jsx(Vr,{tone:"emerald"})})}function lv({turn:e,variant:t="header"}){const n=iS(e.status),r=rq(e),i=tq(e),l=cS(e),o=bh(e.status),c=e.status==="failed"?"border-rose-300/20 bg-rose-300/[0.06] text-rose-100":o?"border-sky-300/22 bg-sky-300/[0.08] text-sky-100":"border-stone-700/90 bg-stone-900/70 text-stone-200";if(t==="footer")return f.jsxs("div",{className:`flex w-full flex-col gap-1.5 rounded-[0.95rem] border px-3 py-2 text-xs ${c}`,children:[f.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx(iv,{status:e.status}),f.jsx("span",{className:"timeline-soft-text min-w-0 truncate",children:r})]}),e.startedAt&&f.jsx("time",{dateTime:e.startedAt,title:zo(e.startedAt),className:"timeline-meta-text shrink-0 text-[11px]",children:Yh(e.startedAt)})]}),(l||i.length>0)&&f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[l?f.jsx("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${l.className}`,title:l.title,children:l.label}):null,i.map(m=>f.jsxs("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${m.className}`,title:m.title,children:[m.icon?f.jsx("span",{className:"mr-1",children:m.icon}):null,m.label]},m.id))]})]});const d=`${n} · ${r}`;return f.jsxs("span",{className:`inline-flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 text-[10px] sm:text-[11px] ${c}`,title:d,children:[f.jsx(iv,{status:e.status}),f.jsx("span",{className:"timeline-meta-text min-w-0 truncate",children:r})]})}function XG(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M8 2.75v8"}),f.jsx("path",{d:"m4.75 7.5 3.25 3.25L11.25 7.5"})]})}function KG(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M8 13.25v-8"}),f.jsx("path",{d:"m11.25 8.5-3.25-3.25L4.75 8.5"})]})}function ZG(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M3.25 5.25 8 2.75l4.75 2.5L8 7.75l-4.75-2.5Z"}),f.jsx("path",{d:"M3.25 8 8 10.5 12.75 8"}),f.jsx("path",{d:"M3.25 10.75 8 13.25l4.75-2.5"}),f.jsx("path",{d:"M3.25 5.25v5.5"}),f.jsx("path",{d:"M12.75 5.25v5.5"})]})}function JG(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M6.2 3.2a2.3 2.3 0 0 0-2.95 3.5A2.4 2.4 0 0 0 4.5 11h.2c.25 1.1 1.1 1.8 2.3 1.8h1.8c1.2 0 2.05-.7 2.3-1.8h.2A2.4 2.4 0 0 0 12.75 6.7 2.3 2.3 0 0 0 9.8 3.2"}),f.jsx("path",{d:"M6.3 6.15c.45-.42 1.02-.65 1.7-.65s1.25.23 1.7.65"}),f.jsx("path",{d:"M8 5.5v4.75"}),f.jsx("path",{d:"M6.75 9.05 8 10.25l1.25-1.2"})]})}function Nf(e){if(!Number.isFinite(e)||e<=0)return"0";if(e>=1e6){const t=e>=1e7?Math.round(e/1e6):e/1e6;return`${String(t.toFixed(1)).replace(/\.0$/,"")}m`}if(e>=1e3){const t=e>=1e4?Math.round(e/1e3):e/1e3;return`${String(t.toFixed(1)).replace(/\.0$/,"")}k`}return String(Math.round(e))}function eq(e){return!Number.isFinite(e)||e<=0?"$0":e>=100?`$${Math.round(e)}`:e>=10?`$${String(e.toFixed(1)).replace(/\.0$/,"")}`:e>=1?`$${String(e.toFixed(2)).replace(/0$/,"").replace(/\.$/,"")}`:e>=.1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>=.001?`$${e.toFixed(4)}`:"<$0.001"}function dc(e){return!Number.isFinite(e)||e<=0?"$0.0000":`$${e.toFixed(4)}`}function Af(e,t,n){const r=e??null;return!Number.isFinite(r??NaN)||r===null||t<=0||n<=0?null:r*n/t}function uS(e){var c,d,m,p,g;const t=(c=e.tokenUsage)==null?void 0:c.total;if(!t)return[];const n=Math.max(t.inputTokens-t.cachedInputTokens,0),r=Math.max(t.cachedInputTokens,0),i=Math.max(t.reasoningOutputTokens,0),l=Math.max(t.outputTokens-i,0);return[n>0?{id:"in",label:"Input",tokenCompactValue:Nf(n),tokenRawValue:n,usdCompactValue:e.priceEstimate?dc(e.priceEstimate.inputUsd):"--",usdRawValue:((d=e.priceEstimate)==null?void 0:d.inputUsd)??null,className:"token-badge-in",icon:f.jsx(XG,{})}:null,r>0?{id:"cache",label:"Cached input",tokenCompactValue:Nf(r),tokenRawValue:r,usdCompactValue:e.priceEstimate?dc(e.priceEstimate.cachedInputUsd):"--",usdRawValue:((m=e.priceEstimate)==null?void 0:m.cachedInputUsd)??null,className:"token-badge-cache",icon:f.jsx(ZG,{})}:null,l>0?{id:"out",label:"Output",tokenCompactValue:Nf(l),tokenRawValue:l,usdCompactValue:e.priceEstimate?dc(Af(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),l)??0):"--",usdRawValue:Af((p=e.priceEstimate)==null?void 0:p.outputUsd,Math.max(t.outputTokens,0),l),className:"token-badge-out",icon:f.jsx(KG,{})}:null,i>0?{id:"reason",label:"Reasoning",tokenCompactValue:Nf(i),tokenRawValue:i,usdCompactValue:e.priceEstimate?dc(Af(e.priceEstimate.outputUsd,Math.max(t.outputTokens,0),i)??0):"--",usdRawValue:Af((g=e.priceEstimate)==null?void 0:g.outputUsd,Math.max(t.outputTokens,0),i),className:"token-badge-reason",icon:f.jsx(JG,{})}:null].filter(y=>y!==null)}function tq(e){return uS(e).map(t=>({id:t.id,label:t.tokenCompactValue,title:`${t.label}: ${t.tokenRawValue} tokens`,className:t.className,icon:t.icon}))}function cS(e){return{label:e.priceEstimate?eq(e.priceEstimate.totalUsd):"--",title:e.priceEstimate===null||e.priceEstimate===void 0?"Price estimate unavailable for this model.":`Estimated cost: ${dc(e.priceEstimate.totalUsd)}`,className:e.priceEstimate?"token-badge-total":"token-badge-empty"}}const W0="inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-normal leading-none sm:text-[11px]";function nq({turn:e}){const t=uS(e),n=cS(e),[r,i]=T.useState(!1),[l,o]=T.useState(!1),[c,d]=T.useState(0),m=T.useRef(null),p=T.useRef(null),g=T.useRef(null);if(T.useLayoutEffect(()=>{if(!r||t.length===0){d(0);return}const E=()=>{const v=m.current,w=g.current;if(!v||!w)return;const C=v.getBoundingClientRect(),S=w.offsetWidth||w.getBoundingClientRect().width;if(S<=0)return;const N=window.innerWidth||document.documentElement.clientWidth,A=12,H=C.left+C.width/2-S/2,$=A,U=Math.max($,N-A-S),P=Math.min(Math.max(H,$),U);d(Math.round(P-H))};return E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[t.length,r]),T.useEffect(()=>{if(!r&&!l)return;const E=v=>{v.target instanceof Node&&(m.current&&!m.current.contains(v.target)&&i(!1),p.current&&!p.current.contains(v.target)&&o(!1))};return document.addEventListener("pointerdown",E),()=>{document.removeEventListener("pointerdown",E)}},[l,r]),!n&&t.length===0)return null;const y=()=>f.jsx("div",{className:"thread-token-popover min-w-[12rem] rounded-2xl border p-2.5 shadow-2xl shadow-black/20 backdrop-blur",children:f.jsx("div",{className:"space-y-1",children:t.map(E=>f.jsxs("div",{className:"thread-token-popover-row flex items-center justify-between gap-3 rounded-xl border px-2.5 py-1.5 text-[11px]",title:`${E.label}: ${E.tokenRawValue} tokens`,children:[f.jsxs("span",{className:"thread-token-popover-text inline-flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"inline-flex shrink-0",children:E.icon}),f.jsx("span",{className:"thread-token-popover-strong font-medium",children:E.usdCompactValue})]}),f.jsx("span",{className:"thread-token-popover-text shrink-0 font-medium",children:E.tokenCompactValue})]},E.id))})});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"hidden shrink-0 items-center gap-1.5 md:inline-flex",children:[n?f.jsxs("div",{ref:p,className:"relative shrink-0",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[f.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":l,onFocus:()=>o(!0),onBlur:()=>o(!1),className:`${W0} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}),l&&t.length>0?f.jsx("div",{className:"absolute left-1/2 top-full z-30 mt-1.5 -translate-x-1/2",children:y()}):null]}):null,t.map(E=>f.jsxs("span",{className:`${W0} ${E.className}`,title:`${E.label}: ${E.usdCompactValue}, ${E.tokenRawValue} tokens`,children:[E.icon,f.jsx("span",{className:"font-medium text-stone-100",children:E.tokenCompactValue})]},E.id))]}),f.jsxs("div",{ref:m,className:"relative shrink-0 md:hidden",children:[n?f.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":r,onClick:()=>i(E=>!E),className:`${W0} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}):null,r&&t.length>0?f.jsx("div",{ref:g,className:"absolute left-1/2 top-full z-30 mt-1.5",style:{transform:`translateX(${c}px) translateX(-50%)`},children:y()}):null]})]})}function rq(e){var r;const t=(r=e.model)!=null&&r.trim()?e.model.trim():"--";let n="--";return e.reasoningEffortAvailable===null||e.reasoningEffortAvailable===void 0?n="--":e.reasoningEffortAvailable===!1?n="-":n=e.reasoningEffort??"--",[t,n].join(" · ")}function aq({text:e,className:t="agent-markdown"}){return f.jsx(nS,{mode:"static",plugins:{code:S8},controls:!1,lineNumbers:!1,remarkPlugins:iq,className:t,children:e})}function sq(){return e=>{dS(e)}}const iq=[...Object.values(ZC),sq];function dS(e){if(!Array.isArray(e.children))return;const t=[];for(const n of e.children){if(n.type==="text"&&typeof n.value=="string"&&n.value.includes(`
375
+ `)){n.value.split(`
376
+ `).forEach((i,l)=>{l>0&&t.push({type:"break"}),i&&t.push({...n,value:i})});continue}dS(n),t.push(n)}e.children=t}const lq=/\b(?:https?:\/\/|www\.)[^\s<>"'`]+/gi,oq=/[),.;:!?]+$/;function uq(e){return e.startsWith("www.")?`https://${e}`:e}function yh({text:e}){var r;const t=[];let n=0;for(const i of e.matchAll(lq)){const l=i[0],o=i.index??0,c=((r=l.match(oq))==null?void 0:r[0])??"",d=c?l.slice(0,-c.length):l;d&&(o>n&&t.push(e.slice(n,o)),t.push(f.jsx("a",{href:uq(d),target:"_blank",rel:"noreferrer",className:"thread-inline-link",children:d},`${o}-${d}`)),c&&t.push(c),n=o+l.length)}return n<e.length&&t.push(e.slice(n)),f.jsx(f.Fragment,{children:t.length>0?t:e})}function fS({text:e,scrollRootRef:t,streaming:n=!1,containerClassName:r="",plainTextClassName:i="whitespace-pre-wrap break-words text-[15px] leading-6 text-stone-100",markdownClassName:l="agent-markdown"}){const o=T.useRef(null),c=NG(e),[d,m]=T.useState(n||typeof IntersectionObserver>"u");return T.useEffect(()=>{if(n||typeof IntersectionObserver>"u"){m(!0);return}if(d||!o.current)return;const p=new IntersectionObserver(g=>{for(const y of g)if(y.isIntersecting){m(!0),p.disconnect();break}},{root:t.current,threshold:0});return p.observe(o.current),()=>{p.disconnect()}},[d,t,n]),f.jsx("div",{ref:o,className:r,children:d&&c?f.jsx(aq,{text:e,className:l}):f.jsx("p",{className:i,children:f.jsx(yh,{text:e})})})}function cq({text:e,scrollRootRef:t,streaming:n=!1}){return f.jsx(fS,{text:e,scrollRootRef:t,streaming:n,containerClassName:"thread-message-prose"})}function dq({threadId:e,text:t}){const n=T.useMemo(()=>OG(t),[t]);return f.jsx("div",{className:"thread-message-prose whitespace-pre-wrap break-words text-[15px] leading-6 text-stone-300",children:n.map(r=>{if(r.type==="text")return f.jsx("span",{children:r.text},r.key);if(r.type==="photo"){const l=e?`/api/threads/${e}/assets/image?path=${encodeURIComponent(r.path)}`:null,o=ZT(r.path)||"Attached image";return f.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:f.jsxs("span",{className:"inline-flex max-w-full flex-col rounded-[1rem] border border-sky-300/28 bg-sky-300/[0.08] p-1.5 shadow-sm shadow-stone-950/20",children:[l?f.jsx("img",{src:l,alt:o,className:"h-[4.5rem] w-[6rem] rounded-[0.75rem] bg-stone-950 object-contain",loading:"lazy"}):f.jsx("span",{className:"inline-flex h-[4.5rem] w-[6rem] items-center justify-center rounded-[0.75rem] bg-stone-950 text-[10px] text-sky-100",children:"PHOTO"}),f.jsx("span",{className:"mt-1 max-w-[7rem] truncate text-[10px] font-medium tracking-[0.08em] text-sky-50",title:r.path,children:o})]})},r.key)}const i=ZT(r.path)||"Attached file";return f.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:f.jsxs("span",{className:"inline-flex max-w-[12rem] items-center gap-2 rounded-[0.95rem] border border-emerald-300/28 bg-emerald-300/[0.08] px-2.5 py-2 text-[10px] font-medium tracking-[0.08em] text-emerald-50 shadow-sm shadow-stone-950/20",title:r.path,children:[f.jsx("span",{className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/20 bg-emerald-300/12 text-[9px]",children:"FILE"}),f.jsx("span",{className:"min-w-0 truncate",children:i})]})},r.key)})})}function hS(e){return e==="completed"?"timeline-command-status-complete":"timeline-command-status-pending"}function mS({status:e}){return e==="completed"?f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})}):f.jsx(Vr,{tone:"emerald"})}const vc=T.memo(function({threadId:t,item:n,scrollRootRef:r,streaming:i=!1}){const[l,o]=T.useState("idle"),c=T.useRef(null),d=n.kind==="userMessage"?"thread-message-icon thread-message-icon-user":"thread-message-icon thread-message-icon-agent",m=n.kind==="userMessage"&&(n.status==="Steering"||n.status==="Accepted"||n.status==="Awaiting response"),p=n.status==="Steering"?"ui-status-warning":n.status==="Accepted"?"ui-status-success":"ui-status-info";T.useEffect(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);async function g(){try{await navigator.clipboard.writeText(n.text),o("copied"),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>o("idle"),1200)}catch{o("failed"),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>o("idle"),1600)}}return f.jsxs("div",{className:`timeline-item-frame ${n.kind==="agentMessage"?"timeline-has-corner-copy":""} relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${_s(n.kind)} ${Ts(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[m&&f.jsxs("span",{className:`absolute right-2.5 top-2.5 z-[1] inline-flex items-center gap-1 rounded-full border px-2 py-1 text-[10px] font-medium tracking-[0.12em] shadow-sm shadow-stone-950/20 ${p}`,children:[f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M3.25 8A4.75 4.75 0 0 1 8 3.25h2.75"}),f.jsx("path",{d:"m9.5 1.75 1.75 1.5-1.75 1.5"}),f.jsx("path",{d:"M12.75 8A4.75 4.75 0 0 1 8 12.75H5.25"}),f.jsx("path",{d:"m6.5 14.25-1.75-1.5 1.75-1.5"})]}),f.jsx("span",{children:n.status})]}),f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${d}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(JT,{kind:n.kind})})}),f.jsxs("div",{className:"timeline-message-content timeline-mobile-bubble-content flex min-w-0 items-start gap-0 pt-2 sm:gap-2.5 sm:pt-0",children:[f.jsxs("div",{className:"hidden",children:[f.jsx("span",{className:`hidden h-6 w-6 items-center justify-center rounded-full border sm:inline-flex ${d}`,children:f.jsx(JT,{kind:n.kind})}),i&&n.kind==="agentMessage"&&f.jsx("span",{className:"hidden sm:inline-flex",children:f.jsx(Vr,{tone:"emerald"})})]}),f.jsxs("div",{className:"min-w-0 flex-1",children:[n.kind==="agentMessage"?f.jsx(cq,{text:n.text,scrollRootRef:r,streaming:i}):f.jsx(dq,{threadId:t,text:n.text}),n.status&&!m&&f.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]}),i&&n.kind==="agentMessage"&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Vr,{tone:"emerald"})}),n.kind==="agentMessage"&&f.jsx("button",{type:"button","aria-label":"Copy agent reply",title:l==="copied"?"Copied":l==="failed"?"Copy failed":"Copy agent reply",onClick:()=>void g(),className:"timeline-corner-copy absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center transition",children:f.jsx("span",{className:`timeline-corner-copy-visual inline-flex items-center justify-center border shadow-sm shadow-stone-950/25 backdrop-blur transition ${l==="copied"?"ui-status-info":l==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:f.jsx(GG,{})})})]})}),fq=T.memo(function({item:t,onOpen:n}){const r=iu(t.text);return f.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${_s(t.kind)} ${Ts(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("command")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(ev,{})})}),bs(t.status)&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Vr,{})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-amber-300/25 bg-amber-300/10 text-amber-200",children:f.jsx(ev,{})}),bs(t.status)&&f.jsx(Vr,{})]}),f.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-label":t.status?`Command status: ${t.status}`:"Command status",title:t.status??"Command status",onClick:()=>n(t,"Command Output"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${hS(t.status)} hover:brightness-110`,children:f.jsx("span",{className:"scale-[0.72] sm:scale-100",children:f.jsx(mS,{status:t.status})})}),f.jsx("button",{type:"button","aria-label":"Open full command",onClick:()=>n(t,"Command Output"),className:"block w-full text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),hq=T.memo(function({item:t,onOpen:n}){const r=iu(t.text);return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${_s(t.kind)} ${Ts(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(Wg,{})})}),bs(t.status)&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Vr,{})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-fuchsia-300/25 bg-fuchsia-300/10 text-fuchsia-100",children:f.jsx(Wg,{})}),bs(t.status)&&f.jsx(Vr,{})]}),f.jsxs("div",{className:"timeline-item-inner relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-label":t.status?`Tool status: ${t.status}`:"Tool status",title:t.status??"Tool status",onClick:()=>n(t,"Tool Call Details"),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${hS(t.status)} hover:brightness-110`,children:f.jsx("span",{className:"scale-[0.72] sm:scale-100",children:f.jsx(mS,{status:t.status})})}),f.jsx("button",{type:"button","aria-label":"Open full tool call",onClick:()=>n(t,"Tool Call Details"),className:"block w-full text-left",children:f.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:r.firstLine}),r.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),mq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.filter(c=>bs(c.status)).length,o=t.length===1?"1 command":`${t.length} commands`;return f.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-command relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-warning px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("command")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(nv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-amber-300/30 bg-amber-300/[0.14] text-amber-100 shadow-sm shadow-stone-950/20",children:[f.jsx(nv,{}),f.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-amber-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-amber-100",children:t.length})]}),l>0&&f.jsx(Vr,{})]}),f.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} command entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[f.jsx("span",{className:"rounded-full border border-amber-300/28 bg-amber-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-amber-100",children:"Batch"}),f.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:o}),l>0&&f.jsx("span",{className:"inline-flex items-center text-xs text-amber-100/90",children:f.jsx(Vr,{})})]})}),n&&f.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-amber-300/12 pt-3 sm:space-y-2",children:t.map((c,d)=>{const m=iu(c.text);return f.jsxs("button",{type:"button","aria-label":`Open grouped command ${d+1}`,onClick:()=>i(c,`Command Output ${d+1}`),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs("span",{className:"rounded-full border border-amber-300/18 bg-amber-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-amber-100",children:["Step ",d+1]}),c.status&&f.jsx("span",{className:"timeline-meta-text text-xs",children:c.status})]}),f.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:m.firstLine}),m.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},c.id)})})]})]})]})}),pq=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.length===1?"1 search":`${t.length} searches`;return f.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-info px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(av,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-sky-300/30 bg-sky-300/[0.14] text-sky-100 shadow-sm shadow-stone-950/20",children:[f.jsx(av,{}),f.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-sky-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-sky-100",children:t.length})]})}),f.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} web search entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[f.jsx("span",{className:"rounded-full border border-sky-300/28 bg-sky-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-sky-100",children:"Batch"}),f.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:l})]})}),n&&f.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-sky-300/12 pt-3 sm:space-y-2",children:t.map((o,c)=>{var g,y;const d=((g=o.previewText)==null?void 0:g.trim())||o.text||"Web search",m=iu(d),p=((y=o.detailText)==null?void 0:y.trim())||o.text||"Web search";return f.jsxs("button",{type:"button","aria-label":`Open grouped web search ${c+1}`,onClick:()=>i(`Web Search ${c+1}`,p),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs("span",{className:"rounded-full border border-sky-300/18 bg-sky-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-100",children:["Search ",c+1]}),o.status&&f.jsx("span",{className:"timeline-meta-text text-xs",children:o.status})]}),f.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:m.firstLine}),m.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},o.id)})})]})]})]})}),gq=T.memo(function({item:t,scrollRootRef:n}){return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${_s(t.kind)} ${Ts(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx($G,{})})}),f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("span",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:lS(t.kind)}),t.status&&f.jsx("span",{className:"timeline-meta-text text-xs",children:t.status})]}),f.jsx("div",{className:"mt-1.5",children:f.jsx(fS,{text:t.text,scrollRootRef:n,plainTextClassName:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-300",markdownClassName:"agent-markdown text-sm"})})]})}),bq=T.memo(function({item:t}){const n=bs(t.status)||t.text==="Compacting context",r=n?"Compacting context":"Context compacted",i=t.detailText&&t.detailText!==r?t.detailText:null;return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${_s(t.kind)} ${Ts(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:"absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border border-teal-300/30 bg-teal-300/12 text-[10px] text-teal-100 shadow-sm shadow-stone-950/20 sm:hidden",children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(XT,{})})}),f.jsxs("div",{className:"flex min-w-0 items-center gap-2 pt-2 sm:pt-0",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 sm:flex",children:f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-teal-300/25 bg-teal-300/10 text-teal-100",children:f.jsx(XT,{})})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("p",{className:"timeline-primary-text truncate text-[13px] font-medium sm:text-sm",children:r}),n?f.jsx(Vr,{tone:"emerald"}):null]}),i?f.jsx("p",{className:"timeline-meta-text mt-0.5 truncate text-[11px] sm:text-xs",title:i,children:i}):null]})]})]})}),xq=T.memo(function({item:t,onOpen:n}){var o,c;const r=((o=t.previewText)==null?void 0:o.trim())||t.text||"Web search",i=((c=t.detailText)==null?void 0:c.trim())||t.text||"Web search",l=iu(r);return f.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-search relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${_s(t.kind)} ${Ts(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(rv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-sky-300/25 bg-sky-300/10 text-sky-100",children:f.jsx(rv,{})})}),f.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsx("button",{type:"button","aria-label":"Expand web search",title:"Expand web search",onClick:()=>n("Web Search Details",i),className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded-bl-[0.7rem] rounded-tr-[0.9rem] border shadow-sm shadow-stone-950/25 transition sm:right-2 sm:top-2 sm:h-7 sm:w-7 sm:rounded-full ${Ia("action")} hover:bg-stone-800`,children:f.jsx("span",{className:"scale-[0.72] sm:scale-100",children:f.jsx(VG,{})})}),t.status&&f.jsx("p",{className:"timeline-meta-text pr-8 text-xs sm:pr-10",children:t.status}),f.jsx("button",{type:"button","aria-label":"Open full web search",onClick:()=>n("Web Search Details",i),className:"block w-full text-left",children:f.jsxs("div",{className:"timeline-mobile-dense-line flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:l.firstLine}),l.showGap?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})]})]})]})}),yq=T.memo(function({threadId:t,item:n,onOpen:r}){const i=n.assetPath??n.detailText??null,l=t&&i?`/api/threads/${t}/assets/image?path=${encodeURIComponent(i)}`:null;return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${_s(n.kind)} ${Ts(n.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("search")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(sv,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-indigo-300/25 bg-indigo-300/10 text-indigo-100",children:f.jsx(sv,{})})}),f.jsxs("div",{className:"min-w-0 w-full flex-1",children:[l?f.jsx("button",{type:"button",onClick:()=>r("Image Path",i??n.text),className:"block w-full text-left",children:f.jsx("img",{src:l,alt:n.text||"Image preview",className:"max-h-[24rem] w-full rounded-xl border border-stone-700/80 bg-stone-950 object-contain",loading:"lazy"})}):f.jsx("div",{className:"timeline-item-inner rounded-xl border px-3 py-3 text-sm",children:n.text}),i&&f.jsx("button",{type:"button",onClick:()=>r("Image Path",i),className:"timeline-meta-text mt-2 block max-w-full truncate text-left text-xs hover:text-[var(--theme-fg)]",title:i,children:i}),n.status&&f.jsx("p",{className:"timeline-meta-text mt-1 text-xs",children:n.status})]})]})]})}),Eq=T.memo(function({item:t,onOpen:n}){var d,m,p;const r=(d=t.previewText)!=null&&d.trim()&&t.text.trim()!==t.previewText.trim()?t.text.trim():null,i=((m=t.detailText)==null?void 0:m.trim())||null,l=oS(r??((p=t.previewText)==null?void 0:p.trim())??t.text,48),o=DG(t),c=i?"button":"div";return f.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${_s(t.kind)} ${Ts(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(xh,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-lime-300/25 bg-lime-300/10 text-lime-100",children:f.jsx(xh,{})})}),f.jsx(c,{...i?{type:"button","aria-label":"Open file change details",onClick:()=>n("File Change Details",i)}:{},className:`timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2.5 py-2 text-left sm:rounded-xl sm:px-3 ${i?"transition hover:bg-[var(--theme-hover)] hover:text-[var(--theme-fg)]":""}`,children:f.jsxs("div",{className:"timeline-mobile-file-line flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip text-sm",title:r??l,children:l}),o.length>0&&f.jsx("div",{className:"inline-flex shrink-0 items-center justify-end gap-1.5 text-xs",children:o.map(g=>f.jsx("span",{className:`timeline-delta-badge border ${g.startsWith("+")?"timeline-delta-badge-add text-emerald-300":g.startsWith("-")?"timeline-delta-badge-remove text-rose-300":"timeline-delta-badge-neutral"}`,children:g},g))})]})})]})]})}),_q=T.memo(function({items:t,expanded:n,onToggleExpanded:r,onOpen:i}){const l=t.reduce((m,p)=>m+(p.changedFiles??0),0),o=t.reduce((m,p)=>m+(p.addedLines??0),0),c=t.reduce((m,p)=>m+(p.removedLines??0),0),d=t.length===1?"1 file change":`${t.length} file changes`;return f.jsxs("div",{className:"timeline-mobile-dense-event timeline-mobile-dense-file relative min-w-0 w-full overflow-hidden rounded-[1rem] border timeline-special-success px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3",children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(xh,{})})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:f.jsxs("span",{className:"relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border border-lime-300/30 bg-lime-300/[0.14] text-lime-100 shadow-sm shadow-stone-950/20",children:[f.jsx(xh,{}),f.jsx("span",{className:"absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border border-lime-200/35 bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 text-lime-100",children:t.length})]})}),f.jsxs("div",{className:"timeline-batch-inner timeline-mobile-dense-batch timeline-mobile-bubble-content min-w-0 flex-1 rounded-[0.9rem] border px-2 py-1.5 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsxs("button",{type:"button","aria-expanded":n,"aria-label":`${n?"Collapse":"Expand"} ${t.length} file change entries`,onClick:r,className:"timeline-mobile-dense-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:[f.jsxs("div",{className:"timeline-mobile-dense-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:[f.jsx("span",{className:"rounded-full border border-lime-300/28 bg-lime-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-lime-100",children:"Batch"}),f.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:d}),l>0&&f.jsxs("span",{className:"timeline-meta-text text-xs",children:[l," files"]})]}),f.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[o>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",o]}),c>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",c]})]})]}),n&&f.jsx("div",{className:"timeline-mobile-section-list mt-3 space-y-0 border-t border-lime-300/12 pt-3 sm:space-y-2",children:t.map((m,p)=>{var E,v,w,C;const g=((E=m.detailText)==null?void 0:E.trim())||((v=m.previewText)==null?void 0:v.trim())||m.text,y=(w=m.previewText)!=null&&w.trim()&&m.text.trim()!==m.previewText.trim()?m.text.trim():((C=m.previewText)==null?void 0:C.trim())||m.text;return f.jsx("button",{type:"button","aria-label":`Open grouped file change ${p+1}`,onClick:()=>i(`File Change ${p+1}`,g),className:"timeline-detail-row block w-full rounded-xl border px-3 py-2 text-left transition",children:f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"timeline-primary-text min-w-0 flex-1 text-sm leading-6",title:y,children:oS(y,34)}),f.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[(m.addedLines??0)>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-add rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["+",m.addedLines]}),(m.removedLines??0)>0&&f.jsxs("span",{className:"timeline-delta-badge timeline-delta-badge-remove rounded-full border px-1.5 py-0.5 text-[11px] font-medium",children:["-",m.removedLines]})]})]})},m.id)})})]})]})]})}),Tq=T.memo(function({item:t}){return f.jsxs("div",{className:`timeline-item-frame relative min-w-0 w-full overflow-hidden rounded-[1rem] border border-stone-800/80 ${_s(t.kind)} ${Ts(t.kind)} px-2.5 py-2 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(Wg,{})})}),f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[f.jsx("span",{className:"timeline-meta-text text-[10px] uppercase tracking-[0.16em]",children:lS(t.kind)}),t.status&&f.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),f.jsx("pre",{className:`timeline-soft-text mt-1 whitespace-pre-wrap break-words text-[13px] leading-5 ${RG(t.kind)?"max-h-56 overflow-auto":""}`,children:f.jsx(yh,{text:t.text})})]})}),vq=T.memo(function({item:t}){var d,m;const n=((d=t.hookOutputEntries)==null?void 0:d.map(p=>p.text.trim()).filter(Boolean).join(`
377
+ `).trim())??"",r=t.hookEventLabel?`${t.hookEventLabel} hook`:t.text,i=((m=t.hookStatusMessage)==null?void 0:m.trim())||(t.previewText&&t.previewText!==t.hookStatusMessage?t.previewText.trim():"")||t.text.trim(),o=iu(n||(i&&i!==r?i:r)),c=!!(n&&o.showGap);return f.jsxs("div",{className:`timeline-item-frame timeline-mobile-dense-event relative min-w-0 w-full overflow-hidden rounded-[1rem] border ${_s(t.kind)} ${Ts(t.kind)} px-2.5 py-2.5 sm:rounded-[1.2rem] sm:px-3`,children:[f.jsx("span",{className:`absolute left-0 top-0 z-[1] inline-flex h-5 w-5 items-center justify-center rounded-br-[0.7rem] rounded-tl-[0.95rem] border text-[10px] shadow-sm shadow-stone-950/20 sm:hidden ${Ia("action")}`,children:f.jsx("span",{className:"scale-[0.78]",children:f.jsx(tv,{})})}),bs(t.status)&&f.jsx("span",{className:"absolute left-5 top-0 inline-flex sm:hidden",children:f.jsx(Vr,{})}),f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsxs("div",{className:"mt-0.5 hidden shrink-0 items-center sm:flex",children:[f.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-fuchsia-300/25 bg-fuchsia-300/10 text-fuchsia-200",children:f.jsx(tv,{})}),bs(t.status)&&f.jsx(Vr,{})]}),f.jsxs("div",{className:"timeline-item-inner timeline-mobile-dense-inner timeline-mobile-bubble-content relative min-w-0 w-full flex-1 rounded-[0.9rem] border px-2.5 py-2.5 pt-6 sm:rounded-xl sm:px-3 sm:py-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1.5 leading-none",children:[f.jsxs("span",{className:"timeline-meta-text min-w-0 truncate text-[10px] uppercase tracking-[0.16em]",children:["Hook · ",t.hookEventLabel??t.text]}),t.status&&f.jsx("span",{className:"timeline-meta-text text-[10px]",children:t.status})]}),f.jsxs("div",{className:"timeline-mobile-dense-line mt-1.5 flex min-w-0 items-center gap-2 text-sm leading-6",children:[f.jsx("p",{className:"timeline-primary-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:n?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"timeline-meta-text mr-2 font-sans text-[11px] uppercase tracking-[0.12em]",children:r}),f.jsx(yh,{text:o.firstLine})]}):f.jsx(yh,{text:o.firstLine&&o.firstLine!==r?`${r} · ${o.firstLine}`:r})}),c?f.jsx("span",{className:"timeline-meta-text shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]})]})]})}),Xg=T.memo(function({threadId:t,item:n,scrollRootRef:r,onOpenExpandedText:i,onOpenCommandDetail:l,onOpenToolCallDetail:o}){return jG(n.kind)?f.jsx(vc,{threadId:t,item:n,scrollRootRef:r}):n.kind==="commandExecution"?f.jsx(fq,{item:n,onOpen:l}):n.kind==="toolCall"?f.jsx(hq,{item:n,onOpen:o}):n.kind==="webSearch"?f.jsx(xq,{item:n,onOpen:i}):n.kind==="image"?f.jsx(yq,{threadId:t,item:n,onOpen:i}):n.kind==="plan"?f.jsx(gq,{item:n,scrollRootRef:r}):n.kind==="fileChange"?f.jsx(Eq,{item:n,onOpen:i}):n.kind==="contextCompaction"?f.jsx(bq,{item:n}):n.kind==="hook"?f.jsx(vq,{item:n}):f.jsx(Tq,{item:n})});function Rf({request:e,busy:t=!1,onRespond:n}){const[r,i]=T.useState({}),[l,o]=T.useState({}),[c,d]=T.useState(null),m=e.questions[0]??null,p="__other__",g=e.kind==="planDecision"?"Plan":e.kind==="requestUserInput"?"Answer Required":e.title;function y(w){const C=/\s*\(recommended\)\s*$/i.test(w);return{rawLabel:w,displayLabel:w.replace(/\s*\(recommended\)\s*$/i,"").trim(),recommended:C}}function E(w){m&&(d(w),n==null||n(e.id,{answers:{[m.id]:{answers:[w]}}}))}function v(w){const C=r[w.id]??"";return C===p?(l[w.id]??"").trim():C.trim()}return f.jsxs("div",{className:"timeline-pending-card w-full rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem] sm:px-4",children:[f.jsx("div",{className:"flex items-center justify-between gap-3",children:f.jsxs("div",{children:[f.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:g}),e.kind!=="planDecision"&&e.description&&f.jsx("p",{className:"timeline-soft-text mt-1 text-[13px] leading-5",children:e.description})]})}),f.jsx("div",{className:"mt-3 space-y-3",children:e.questions.map(w=>f.jsxs("div",{className:"timeline-question-section rounded-xl border p-2.5 sm:p-3",children:[f.jsx("p",{className:"timeline-meta-text text-xs uppercase tracking-[0.2em]",children:w.header}),f.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5 sm:text-sm",children:w.question}),e.kind==="planDecision"&&w.options&&w.options.length>0?f.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:w.options.map((C,S)=>{const N=y(C.label),A=N.displayLabel.toLowerCase()==="implement";return f.jsxs("button",{type:"button",disabled:t,onClick:()=>E(C.label),className:`relative rounded-2xl border px-2.5 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${S===0?"ui-action-info":"border-stone-700 text-stone-200 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:C.description,children:[N.recommended?f.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/18 text-[10px] leading-none text-current",children:"✦"}):null,t&&c===C.label?A?"Starting...":"Saving...":N.displayLabel]},C.label)})}):w.options&&w.options.length>0?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[w.options.map(C=>{const S=y(C.label);return f.jsxs("button",{type:"button",disabled:t,onClick:()=>i(N=>({...N,[w.id]:C.label})),className:`relative rounded-2xl border px-3 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${r[w.id]===C.label?"ui-status-warning":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:C.description,children:[S.recommended?f.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/10 text-[10px] leading-none text-amber-100/90",children:"✦"}):null,S.displayLabel]},C.label)}),w.isOther&&f.jsx("button",{type:"button",disabled:t,onClick:()=>i(C=>({...C,[w.id]:p})),className:`rounded-2xl border px-3 py-1.5 text-[12px] leading-4 transition sm:text-[13px] ${r[w.id]===p?"ui-status-info":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Not from above"})]}),w.isOther&&r[w.id]===p&&f.jsx("input",{"aria-label":`${w.header} custom answer`,value:l[w.id]??"",onChange:C=>o(S=>({...S,[w.id]:C.target.value})),placeholder:"Enter a custom answer",className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-sky-300"})]}):f.jsx("input",{"aria-label":w.header,value:r[w.id]??"",onChange:C=>i(S=>({...S,[w.id]:C.target.value})),className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-amber-300"})]},w.id))}),e.kind!=="planDecision"&&f.jsx("div",{className:"mt-3 flex justify-end",children:f.jsx("button",{type:"button",disabled:t||e.questions.some(w=>!v(w)),onClick:()=>void(n==null?void 0:n(e.id,{answers:Object.fromEntries(e.questions.map(w=>[w.id,{answers:[v(w)]}]))})),className:"ui-action-info rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:t?"Submitting...":"Submit"})})]})}function Lf({note:e}){return f.jsxs("div",{className:"timeline-note-card w-full rounded-2xl border px-3 py-2.5",children:[f.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:e.title}),f.jsx("div",{className:"mt-1 space-y-1",children:e.summaryLines.map((t,n)=>f.jsxs("p",{className:"timeline-primary-text text-[13px] leading-5",children:["You selected ",t]},`${e.id}-${n}`))})]})}function Ao({note:e,onOpenThread:t}){const n=e.kind==="forkCreated"?"Fork":e.kind==="forkSource"?"Fork source":"System",r=e.kind==="forkCreated"?`Thread forked from Turn ${e.turnIndex??"?"}`:e.kind==="forkSource"?`Forked from ${e.linkedThreadTitle??"source thread"} at Turn ${e.turnIndex??"?"}`:e.text??"";return f.jsxs("div",{className:"timeline-activity-card w-full rounded-2xl border px-3 py-2.5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:n}),f.jsx("time",{dateTime:e.createdAt,title:zo(e.createdAt),className:"timeline-meta-text text-[10px]",children:Yh(e.createdAt)})]}),f.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5",children:r}),e.linkedThreadId?f.jsx("button",{type:"button",onClick:()=>{if(t){t(e.linkedThreadId);return}typeof window<"u"&&window.location.assign(`/threads/${e.linkedThreadId}`)},className:"relative z-10 mt-2 inline-flex cursor-pointer rounded-full border border-amber-300/30 px-3 py-1.5 text-xs text-amber-100 transition hover:bg-amber-300/10",children:e.kind==="forkCreated"?"Open fork":"Back to source"}):null]})}const ov=T.memo(function({threadId:t,turn:n,absoluteIndex:r,isCollapsed:i,livePlan:l,liveItems:o,liveOutput:c,onToggleCollapse:d,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g,scrollRootRef:y,articleRef:E}){const v=T.useMemo(()=>UG(n.items,o),[o,n.items]),w=T.useMemo(()=>YG(l,v,n.status),[l,v,n.status]),C=T.useMemo(()=>BG(v,bh(n.status)),[v,n.status]),S=T.useMemo(()=>FG(C),[C]),N=T.useMemo(()=>HG(c,v),[c,v]),A=T.useMemo(()=>Yg(N),[N]),[H,$]=T.useState({}),U=T.useCallback(P=>{$(Y=>({...Y,[P]:!Y[P]}))},[]);return f.jsxs("article",{ref:E,className:"px-2 py-1.5 sm:px-6 sm:py-2",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-1.5",children:[f.jsxs("div",{className:"min-w-0 flex flex-1 items-center gap-1.5 overflow-hidden",children:[f.jsxs("span",{className:"timeline-meta-text rounded-[0.6rem] border border-stone-700 px-1.5 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Turn ",r]}),f.jsx("time",{dateTime:n.startedAt??void 0,title:zo(n.startedAt),className:"timeline-meta-text shrink-0 text-[10px] sm:text-[11px]",children:Yh(n.startedAt)}),f.jsx(lv,{turn:n}),n.error&&f.jsx("p",{className:"hidden truncate text-[11px] text-rose-200 sm:block",children:n.error})]}),f.jsx(nq,{turn:n})]}),f.jsx("button",{type:"button","aria-label":`${i?"Expand":"Collapse"} turn ${r}`,title:i?"Expand turn":"Collapse turn",onClick:()=>d(n.id),className:"timeline-compact-action timeline-meta-text inline-flex h-5 w-5 shrink-0 items-center justify-center transition hover:text-[var(--theme-fg)]",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:i?f.jsx("path",{d:"m4.5 10 3.5-3.5L11.5 10"}):f.jsx("path",{d:"m4.5 6 3.5 3.5L11.5 6"})})})]}),n.error&&f.jsx("p",{className:"mt-1 text-[11px] text-rose-200 sm:hidden",children:n.error}),!i&&f.jsxs("div",{className:"mt-1.5 space-y-1.5",children:[S.map(P=>P.kind==="commandGroup"?f.jsx(mq,{items:P.items,expanded:H[P.key]??!1,onToggleExpanded:()=>U(P.key),onOpen:p},P.key):P.kind==="fileChangeGroup"?f.jsx(_q,{items:P.items,expanded:H[P.key]??!1,onToggleExpanded:()=>U(P.key),onOpen:m},P.key):P.kind==="searchGroup"?f.jsx(pq,{items:P.items,expanded:H[P.key]??!1,onToggleExpanded:()=>U(P.key),onOpen:m},P.key):f.jsx(Xg,{threadId:t,item:P.item,scrollRootRef:y,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g},P.key)),w&&f.jsxs("div",{className:"timeline-live-plan-card rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem]",children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[f.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:"Plan update"}),f.jsx("span",{className:"rounded-full border border-sky-300/40 px-2 py-1 text-[11px] uppercase tracking-[0.2em] text-sky-200",children:"Live"})]}),w.explanation&&f.jsx("p",{className:"timeline-soft-text mt-3 text-sm",children:w.explanation}),f.jsx("div",{className:"mt-3 space-y-2",children:w.plan.map((P,Y)=>f.jsxs("div",{className:"timeline-live-plan-step flex items-center justify-between gap-3 rounded-xl border px-3 py-2 text-sm",children:[f.jsx("span",{className:"timeline-primary-text min-w-0 flex-1",children:P.step}),f.jsx(QG,{status:P.status})]},`${w.turnId}-${Y}`))})]}),A?f.jsx(Xg,{threadId:t,item:A,scrollRootRef:y,onOpenExpandedText:m,onOpenCommandDetail:p,onOpenToolCallDetail:g}):N?f.jsx(vc,{item:{id:"live-agent-message",kind:"agentMessage",text:N},scrollRootRef:y,streaming:!0}):null,bh(n.status)&&f.jsx(lv,{turn:n,variant:"footer"})]})]})});function kq({threadId:e,turns:t,totalTurnCount:n,pendingRequests:r=[],pendingSteers:i=[],livePlan:l=null,liveItems:o=null,respondingRequestId:c=null,onRespondToRequest:d,liveOutput:m,scrollRequestKey:p=0,bottomSpacer:g=0,className:y="",onTailVisibilityChange:E,loadingEarlier:v=!1,onLoadEarlier:w,ephemeralUserNote:C=null,answeredRequestNotes:S=[],activityNotes:N=[],optimisticSteers:A=[],optimisticTurn:H=null,onLoadHistoryItemDetail:$,onOpenThread:U}){var ze,Pe,Ze;const P=T.useRef(null),Y=T.useRef(null),fe=T.useRef(p),M=T.useRef(null),K=T.useRef(g),V=T.useRef(0),he=T.useRef(null),de=T.useRef(!0),ne=T.useRef(!0),z=T.useRef(0),ee=T.useRef(new Map),[Te,De]=T.useState(QT),[L,F]=T.useState(0),[se,O]=T.useState(null),[ke,Ae]=T.useState({}),[_e,et]=T.useState(!0),st=T.useMemo(()=>JSON.stringify({turns:t.map(Q=>({id:Q.id,status:Q.status,startedAt:Q.startedAt,error:Q.error,items:Q.items.map(be=>({id:be.id,kind:be.kind,status:be.status,textLength:be.text.length}))})),pendingRequests:r.map(Q=>({id:Q.id,turnId:Q.turnId,title:Q.title})),pendingSteers:i.map(Q=>({id:Q.id,turnId:Q.turnId,prompt:Q.prompt,clientRequestId:Q.clientRequestId})),optimisticSteers:A.map(Q=>({id:Q.id,turnId:Q.turnId,prompt:Q.prompt,status:Q.status})),liveOutputLength:m.length,livePlan:l===null?null:{turnId:l.turnId,explanation:l.explanation,steps:l.plan.map(Q=>`${Q.status}:${Q.step}`)},liveItems:o===null?null:{turnId:o.turnId,items:o.items.map(Q=>({id:Q.id,kind:Q.kind,status:Q.status,textLength:Q.text.length}))},optimisticTurn:H===null?null:{id:H.id,status:H.status,error:H.error,items:H.items.map(Q=>({id:Q.id,kind:Q.kind,textLength:Q.text.length}))},answeredRequestNotes:S.map(Q=>({id:Q.id,turnId:Q.turnId??null,title:Q.title,createdAt:Q.createdAt??"",summaryLines:Q.summaryLines})),activityNotes:N.map(Q=>({id:Q.id,kind:Q.kind,text:Q.text,createdAt:Q.createdAt})),ephemeralUserNote:C,bottomSpacer:g}),[N,S,g,C,m,o,l,A,H,i,r,t]),Me=typeof w=="function"||n!==void 0,dt=T.useCallback(Q=>{Ae(be=>({...be,[Q]:!be[Q]}))},[]),pt=T.useCallback((Q,be)=>{O({title:Q,text:be})},[]),Dt=T.useCallback(async(Q,be)=>{var nt;const ot=((nt=Q.detailText)==null?void 0:nt.trim())||Q.text||"Command output";if(!Q.hasDeferredDetail||!$){O({title:be,text:ot});return}const je=ee.current.get(Q.id);if(je){O({title:je.title,text:je.text});return}const Fe=z.current+1;z.current=Fe,O({title:be,text:"Loading full command output..."});try{const zt=await $(Q.id);if(ee.current.set(Q.id,zt),z.current!==Fe)return;O({title:zt.title,text:zt.text})}catch(zt){if(z.current!==Fe)return;O({title:be,text:zt instanceof Error?zt.message:"Unable to load full command output."})}},[$]),kn=T.useCallback(async(Q,be)=>{var nt;const ot=((nt=Q.detailText)==null?void 0:nt.trim())||Q.text||"Tool call";if(!Q.hasDeferredDetail||!$){O({title:be,text:ot});return}const je=ee.current.get(Q.id);if(je){O({title:je.title,text:je.text});return}const Fe=z.current+1;z.current=Fe,O({title:be,text:"Loading full tool call details..."});try{const zt=await $(Q.id);if(ee.current.set(Q.id,zt),z.current!==Fe)return;O({title:zt.title,text:zt.text})}catch(zt){if(z.current!==Fe)return;O({title:be,text:zt instanceof Error?zt.message:"Unable to load full tool call details."})}},[$]),bt=T.useCallback(()=>{const Q=P.current,be=he.current;if(!Q)return;const ot=be?zG(Q,be):Y0(Q);de.current=ot,et(ot)},[]),He=T.useCallback(()=>{const Q=P.current;Q&&(ne.current=Y0(Q,qg)),bt()},[bt]),Ve=T.useCallback(()=>{const Q=P.current;Q&&(Q.scrollTop=Q.scrollHeight,V.current=Q.scrollHeight,de.current=!0,et(!0),ne.current=!0)},[]);T.useEffect(()=>{De(Q=>Q>=t.length-1?t.length:Math.max(Q,QT))},[t.length]),T.useEffect(()=>{const Q=P.current;Q&&(V.current=Q.scrollHeight,ne.current=Y0(Q,qg)),bt()},[g,S,C,m,o,l,r.length,bt,t.length,Te]),T.useEffect(()=>{const Q=p!==fe.current,be=M.current!==st;if(M.current=st,!(Q||be&&(_e||ne.current)))return;const je=window.requestAnimationFrame(()=>{Ve()});return p!==fe.current&&(fe.current=p),()=>{window.cancelAnimationFrame(je)}},[st,_e,Ve,p]),T.useEffect(()=>{const Q=P.current,be=Y.current;if(!Q||!be||typeof ResizeObserver>"u")return;V.current=Q.scrollHeight;const ot=new ResizeObserver(()=>{const je=Q.scrollHeight,Fe=V.current;V.current=je,!(je<=Fe)&&(ne.current||de.current)&&window.requestAnimationFrame(()=>{Ve()})});return ot.observe(be),()=>{ot.disconnect()}},[Ve]),T.useEffect(()=>{if(!_e){K.current=g;return}if(g===K.current)return;K.current=g;const Q=window.requestAnimationFrame(()=>{Ve()});return()=>{window.cancelAnimationFrame(Q)}},[g,_e,Ve]),T.useEffect(()=>{E==null||E(_e)},[_e,E]);const Qt=n??t.length,at=Math.max(0,t.length-Te),Ke=Me?t:t.slice(at),Ge=Me?Math.max(0,Qt-t.length):at,an=Qt+1,xn=Me?Math.max(0,Qt-t.length):t.length-Ke.length,or=!Me&&xn>0&&L>=2,Bt=m&&Ke.length>0?Ke.findLastIndex(Q=>bs(Q.status)):-1,Zn=Bt<0&&!!m&&!!H&&H.status!=="failed",pe=Bt>=0||Zn,Ce=new Set(Ke.map(Q=>Q.id)),Qe=S.reduce((Q,be)=>{if(!be.turnId||!Ce.has(be.turnId))return Q;const ot=Q.get(be.turnId)??[];return ot.push(be),Q.set(be.turnId,ot),Q},new Map),lt=r.reduce((Q,be)=>{if(!be.turnId||!Ce.has(be.turnId))return Q;const ot=Q.get(be.turnId)??[];return ot.push(be),Q.set(be.turnId,ot),Q},new Map),xt=[...i.map(Q=>({id:Q.id,prompt:Q.prompt,status:"Accepted",createdAt:Q.createdAt})),...A.map(Q=>({id:Q.id,prompt:Q.prompt,status:Q.status==="steering"?"Steering":null,createdAt:Q.createdAt}))].sort((Q,be)=>Q.createdAt.localeCompare(be.createdAt)),sn=S.filter(Q=>!Q.turnId||!Ce.has(Q.turnId)),mn=r.filter(Q=>!Q.turnId||!Ce.has(Q.turnId)),xe=T.useMemo(()=>{const Q=[...Ke.map(Fe=>({id:Fe.id,startedAt:Fe.startedAt??""})),...H?[{id:H.id,startedAt:H.startedAt??""}]:[]],be=new Map,ot=[],je=[...sn.map(Fe=>({kind:"note",id:Fe.id,createdAt:Fe.createdAt??"",note:Fe})),...mn.map(Fe=>({kind:"request",id:Fe.id,createdAt:Fe.createdAt,request:Fe}))].sort((Fe,nt)=>Fe.createdAt.localeCompare(nt.createdAt));for(const Fe of je){const nt=Q.find(ut=>Fe.createdAt&&ut.startedAt&&Fe.createdAt.localeCompare(ut.startedAt)<=0);if(!nt){ot.push(Fe);continue}const zt=be.get(nt.id)??[];zt.push(Fe),be.set(nt.id,zt)}return{beforeTurnId:be,trailing:ot}},[H,r,sn,mn,Ke]),Se=T.useMemo(()=>{const Q=[...N].sort((wt,pn)=>wt.createdAt.localeCompare(pn.createdAt)),be=[...Ke.map(wt=>({id:wt.id,startedAt:wt.startedAt??""})),...H?[{id:H.id,startedAt:H.startedAt??""}]:[]],ot=[],je=new Map,Fe=new Map,nt=[],ut=be.map(wt=>wt.startedAt).filter(wt=>!!wt).sort().at(-1)??null;for(const wt of Q){if(wt.anchorTurnId==="__leading__"){ot.push(wt);continue}if(wt.anchorTurnId){if(be.some(An=>An.id===wt.anchorTurnId)){const An=Fe.get(wt.anchorTurnId)??[];An.push(wt),Fe.set(wt.anchorTurnId,An)}else ot.push(wt);continue}const pn=be.find(An=>An.startedAt&&wt.createdAt.localeCompare(An.startedAt)<=0);if(!pn){!ut||wt.createdAt.localeCompare(ut)<=0?ot.push(wt):nt.push(wt);continue}const ua=je.get(pn.id)??[];ua.push(wt),je.set(pn.id,ua)}return{leading:ot,beforeTurnId:je,afterTurnId:Fe,trailing:nt}},[N,H,Ke]);return f.jsxs(f.Fragment,{children:[f.jsx("section",{className:`flex min-h-0 flex-1 flex-col ${y}`.trim(),children:f.jsx("div",{ref:P,"data-testid":"thread-scroll-container",onScroll:He,className:"thread-scroll-container min-h-0 flex-1 overflow-y-auto overscroll-contain",style:g>0?{paddingBottom:g}:void 0,children:f.jsxs("div",{ref:Y,children:[t.length>0&&f.jsx("div",{className:"px-2.5 pb-1 pt-2 sm:px-6 sm:pb-1.5 sm:pt-3",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 text-xs sm:text-sm",children:[xn>0&&f.jsx("button",{type:"button",onClick:()=>{if(Me){w==null||w();return}De(Q=>Math.min(t.length,Q+LG)),F(Q=>Q+1)},disabled:v,className:"rounded-full border border-stone-700 px-2.5 py-1.5 text-stone-300 transition hover:bg-stone-800",children:v?"Loading earlier...":"Load 10 earlier"}),or&&f.jsx("button",{type:"button",onClick:()=>De(t.length),className:"rounded-full border border-amber-300/40 px-2.5 py-1.5 text-amber-200 transition hover:bg-amber-300/10",children:"Load full history"}),f.jsxs("p",{className:"timeline-meta-text",children:["Showing ",Ke.length," of ",Qt," turns",xn>0?` · ${xn} earlier hidden`:""]})]})}),t.length===0&&!m&&!H&&f.jsx("div",{className:"timeline-meta-text px-2.5 py-8 text-sm sm:px-6",children:"Send the first prompt to start the thread."}),(Ke.length>0||H||Se.leading.length>0||Se.trailing.length>0)&&f.jsxs("div",{className:"divide-y divide-stone-800/80",children:[Se.leading.length>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:Se.leading.map(Q=>f.jsx(Ao,{note:Q,onOpenThread:U},Q.id))}):null,Ke.map((Q,be)=>{var ot,je,Fe,nt,zt;return f.jsxs("div",{children:[(((ot=Se.beforeTurnId.get(Q.id))==null?void 0:ot.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Se.beforeTurnId.get(Q.id)??[]).map(ut=>f.jsx(Ao,{note:ut,onOpenThread:U},ut.id))}):null,(((je=xe.beforeTurnId.get(Q.id))==null?void 0:je.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(xe.beforeTurnId.get(Q.id)??[]).map(ut=>ut.kind==="note"?f.jsx(Lf,{note:ut.note},ut.id):f.jsx(Rf,{request:ut.request,busy:c===ut.request.id,onRespond:d??void 0},ut.id))}):null,f.jsx(ov,{threadId:e,turn:Q,absoluteIndex:Ge+be+1,isCollapsed:ke[Q.id]??!1,livePlan:(l==null?void 0:l.turnId)===Q.id?l:null,liveItems:(o==null?void 0:o.turnId)===Q.id?o.items:null,liveOutput:be===Bt?m:"",onToggleCollapse:dt,onOpenExpandedText:pt,onOpenCommandDetail:Dt,onOpenToolCallDetail:kn,scrollRootRef:P,articleRef:void 0}),(((Fe=Se.afterTurnId.get(Q.id))==null?void 0:Fe.length)??0)>0?f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Se.afterTurnId.get(Q.id)??[]).map(ut=>f.jsx(Ao,{note:ut},ut.id))}):null,(nt=Qe.get(Q.id))!=null&&nt.length||(zt=lt.get(Q.id))!=null&&zt.length?f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...(Qe.get(Q.id)??[]).map(ut=>({kind:"note",id:ut.id,createdAt:ut.createdAt??"",note:ut})),...(lt.get(Q.id)??[]).map(ut=>({kind:"request",id:ut.id,createdAt:ut.createdAt,request:ut}))].sort((ut,wt)=>ut.createdAt.localeCompare(wt.createdAt)).map(ut=>ut.kind==="note"?f.jsx(Lf,{note:ut.note},ut.id):f.jsx(Rf,{request:ut.request,busy:c===ut.request.id,onRespond:d??void 0},ut.id))}):null]},Q.id)}),H&&f.jsxs(f.Fragment,{children:[(((ze=Se.beforeTurnId.get(H.id))==null?void 0:ze.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Se.beforeTurnId.get(H.id)??[]).map(Q=>f.jsx(Ao,{note:Q,onOpenThread:U},Q.id))}):null,(((Pe=xe.beforeTurnId.get(H.id))==null?void 0:Pe.length)??0)>0?f.jsx("div",{className:"space-y-3 border-b border-stone-800/80 px-2.5 py-4 sm:px-6",children:(xe.beforeTurnId.get(H.id)??[]).map(Q=>Q.kind==="note"?f.jsx(Lf,{note:Q.note},Q.id):f.jsx(Rf,{request:Q.request,busy:c===Q.request.id,onRespond:d??void 0},Q.id))}):null,f.jsx(ov,{threadId:e,turn:H,absoluteIndex:an,isCollapsed:ke[H.id]??!1,livePlan:null,liveItems:null,liveOutput:Zn?m:"",onToggleCollapse:dt,onOpenExpandedText:pt,onOpenCommandDetail:Dt,onOpenToolCallDetail:kn,scrollRootRef:P}),(((Ze=Se.afterTurnId.get(H.id))==null?void 0:Ze.length)??0)>0?f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:(Se.afterTurnId.get(H.id)??[]).map(Q=>f.jsx(Ao,{note:Q,onOpenThread:U},Q.id))}):null]})]}),xt.length>0&&f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:xt.map(Q=>f.jsx(vc,{threadId:e,item:{id:Q.id,kind:"userMessage",text:Q.prompt,status:Q.status},scrollRootRef:P},Q.id))}),(xe.trailing.length>0||Se.trailing.length>0)&&f.jsx("div",{className:"space-y-3 border-t border-stone-800/80 px-2.5 py-4 sm:px-6",children:[...Se.trailing.map(Q=>({kind:"activity",id:Q.id,createdAt:Q.createdAt,note:Q})),...xe.trailing].sort((Q,be)=>Q.createdAt.localeCompare(be.createdAt)).map(Q=>Q.kind==="activity"?f.jsx(Ao,{note:Q.note,onOpenThread:U},Q.id):Q.kind==="note"?f.jsx(Lf,{note:Q.note},Q.id):f.jsx(Rf,{request:Q.request,busy:c===Q.request.id,onRespond:d??void 0},Q.id))}),C&&f.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:f.jsx(vc,{threadId:e,item:{id:"ephemeral-plan-decision-note",kind:"userMessage",text:C},scrollRootRef:P})}),m&&!pe&&f.jsx("div",{className:"border-t border-stone-800/80 px-2.5 py-2.5 sm:px-6",children:Yg(m)?f.jsx(Xg,{threadId:e,item:Yg(m),scrollRootRef:P,onOpenExpandedText:pt,onOpenCommandDetail:Dt,onOpenToolCallDetail:kn}):f.jsx(vc,{threadId:e,item:{id:"live-agent-message-fallback",kind:"agentMessage",text:m},scrollRootRef:P,streaming:!0})}),f.jsx("div",{ref:he,"aria-hidden":"true",className:"h-px w-full"})]})})}),f.jsx(aS,{open:se!==null,title:(se==null?void 0:se.title)??"Full text",text:(se==null?void 0:se.text)??"",onClose:()=>{z.current+=1,O(null)}})]})}function mb({open:e,title:t,label:n,value:r,busy:i=!1,onChange:l,onCancel:o,onSubmit:c}){if(T.useEffect(()=>{if(!e)return;function m(p){p.key==="Escape"&&!i&&o()}return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[i,o,e]),!e)return null;function d(m){m.preventDefault(),c()}return Qo.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[f.jsx("button",{type:"button","aria-label":"Close rename dialog",onClick:o,disabled:i,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),f.jsxs("form",{role:"dialog","aria-modal":"true","aria-label":t,onSubmit:d,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),f.jsx("p",{className:"mt-1 text-sm text-stone-500",children:"Changes are saved only after confirmation."})]}),f.jsx("button",{type:"button","aria-label":"Close dialog",onClick:o,disabled:i,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),f.jsxs("div",{className:"mt-5",children:[f.jsx("label",{htmlFor:"rename-dialog-input",className:"text-sm font-medium text-stone-200",children:n}),f.jsx("input",{id:"rename-dialog-input","aria-label":n,autoFocus:!0,value:r,onChange:m=>l(m.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),f.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),f.jsx("button",{type:"submit",disabled:i||!r.trim(),className:"ui-action-success rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:"Save"})]})]})]}),document.body)}function wq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",children:f.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function Cq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:f.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function Sq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:f.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Z"})})}function uv({title:e,defaultOpen:t=!1,children:n}){const[r,i]=T.useState(t);return f.jsxs("section",{className:"border-t border-[var(--theme-border)] pt-4 first:border-t-0 first:pt-0",children:[f.jsxs("button",{type:"button",onClick:()=>i(l=>!l),"aria-expanded":r,className:"flex w-full items-center justify-between gap-3 text-left",children:[f.jsx("span",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:e}),f.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:r?"Hide":"Show"})]}),r&&f.jsx("div",{className:"mt-3",children:n})]})}function Nq({thread:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,showDeleteButton:c=!1,showSessionCopyButton:d=!1}){const[m,p]=T.useState("idle"),g=T.useRef(null),y=r[e.workspaceId],E=t===e.id;T.useEffect(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);async function v(){if(e.codexThreadId)try{await navigator.clipboard.writeText(e.codexThreadId),p("copied"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1200)}catch{p("failed"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1600)}}return f.jsxs("div",{role:"link",tabIndex:0,onClick:()=>i(e.id),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),i(e.id))},className:`thread-sidebar-card relative block rounded-[1.2rem] border px-3 py-2.5 transition ${E?"thread-sidebar-card-active shadow-lg shadow-stone-950/12":""} ${d&&e.codexThreadId?"pb-4":""}`,children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("p",{className:"min-w-0 w-fit max-w-[calc(100%-2rem)] truncate text-[13px] font-medium leading-5 text-[var(--theme-fg)]",title:e.title,children:e.title}),f.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),l(e)},"aria-label":`Rename thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition hover:text-[var(--theme-fg)]",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:f.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})}),c&&o&&f.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),o(e)},"aria-label":`Delete thread ${e.title}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-rose-300/90 transition hover:text-rose-200",children:f.jsx(Sq,{})})]}),y&&!n&&f.jsx("p",{className:"mt-1 truncate text-xs text-[var(--theme-fg-muted)]",children:y})]}),f.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[9px] uppercase tracking-[0.18em] ${AG(e.status)}`,children:sS(e.status)})]}),f.jsxs("div",{className:`mt-2 flex items-center justify-between gap-3 text-[11px] text-[var(--theme-fg-muted)] ${d&&e.codexThreadId?"pr-9":""}`,children:[f.jsx("time",{dateTime:e.lastTurnStartedAt??e.updatedAt,children:Yh(e.lastTurnStartedAt??e.updatedAt)}),f.jsx("span",{children:e.model??"No model"})]}),d&&e.codexThreadId&&f.jsx("button",{type:"button","aria-label":"Copy Codex session ID",title:m==="copied"?"Copied":m==="failed"?"Copy failed":"Copy Codex session ID",onClick:w=>{w.stopPropagation(),v()},className:`absolute bottom-2.5 right-2.5 inline-flex h-7 w-7 items-center justify-center rounded-full border shadow-sm shadow-stone-950/25 backdrop-blur transition ${m==="copied"?"border-sky-300/40 bg-sky-300/16 text-sky-100":m==="failed"?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-[var(--theme-border-strong)] bg-[var(--theme-surface-strong)] text-[var(--theme-fg-soft)] hover:bg-[var(--theme-hover)]"}`,children:f.jsx(Cq,{})})]})}function pS({threads:e,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r={},onOpenThread:i,onBeginRenameThread:l,onDeleteThread:o,scrollable:c=!1,maxHeightClassName:d="max-h-full",showDeleteButton:m=!1,showSessionCopyButton:p=!1}){const g=c?`min-h-0 overflow-y-auto overscroll-contain pr-1 ${d}`:"";return f.jsx("div",{className:g,children:f.jsx("div",{className:"space-y-1.5",children:e.map(y=>f.jsx(Nq,{thread:y,currentThreadId:t,currentWorkspaceId:n,workspaceLabels:r,onOpenThread:i,onBeginRenameThread:l,showDeleteButton:m,showSessionCopyButton:p,...o?{onDeleteThread:o}:{}},y.id))})})}function gS({threads:e,status:t,loading:n=!1,error:r,viewportConstrained:i=!1,showMobileAppMenu:l=!0,showMobileThreadNavToggle:o=!0,showMobileNewThreadShortcut:c=!0,mobileHeaderAction:d,currentThreadId:m,currentThreadLabel:p=null,currentWorkspaceId:g=null,currentWorkspaceLabel:y=null,workspaceLabels:E={},metaContent:v,settingsContent:w,onRenameThread:C,children:S}){const[N,A]=T.useState(!1),[H,$]=T.useState(null),[U,P]=T.useState(""),[Y,fe]=T.useState(null),M=Xa(),K=Pc(),V=T.useMemo(()=>[...g?e.filter(se=>se.workspaceId===g):e].sort((se,O)=>{if(se.id===m)return-1;if(O.id===m)return 1;const ke=Date.parse(se.lastTurnStartedAt??se.updatedAt);return Date.parse(O.lastTurnStartedAt??O.updatedAt)-ke}),[m,g,e]),he=y??(g?"Current workspace":"All threads"),de=p&&p.trim()?`${he} / ${p.trim()}`:he,ne=g?`/threads/new?workspaceId=${encodeURIComponent(g)}`:"/threads/new";async function z(F){if(!C)return;const se=U.trim();if(se){fe(F);try{await C(F,se),$(null),P("")}finally{fe(null)}}}function ee(F){$(F.id),P(F.title)}function Te(){$(null),P("")}function De(F){M(`/threads/${F}`),A(!1),K==null||K.closeNav()}function L(){return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("section",{children:[f.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-[var(--theme-fg-muted)]",children:"Thread List"}),f.jsxs("div",{className:"flex items-center gap-2",children:[n&&f.jsx("span",{className:"text-xs text-[var(--theme-fg-muted)]",children:"Refreshing..."}),f.jsx(Js,{to:ne,onClick:()=>{A(!1),K==null||K.closeNav()},className:"inline-flex h-7 items-center rounded-full bg-[var(--theme-accent-solid)] px-2.5 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:"New Thread"})]})]}),r&&f.jsx("div",{className:"rounded-2xl border border-rose-500/30 bg-rose-500/10 px-3 py-3 text-sm text-rose-100",children:r}),!r&&V.length===0&&!n&&f.jsx("div",{className:"rounded-2xl border border-dashed border-[var(--theme-border)] bg-[var(--theme-surface)] px-4 py-6 text-sm text-[var(--theme-fg-muted)]",children:"No threads available in this view."}),V.length>0&&f.jsx(pS,{threads:V,currentThreadId:m,currentWorkspaceId:g,workspaceLabels:E,onOpenThread:De,onBeginRenameThread:ee})]}),f.jsx(uv,{title:"Thread Meta",defaultOpen:!0,children:v??f.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"Select a thread to inspect metadata."})}),f.jsx(uv,{title:"Settings",children:w??f.jsx("p",{className:"text-sm text-[var(--theme-fg-muted)]",children:"No thread settings available."})})]})}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:i?"flex h-full max-h-full min-h-0 flex-col gap-2 overflow-hidden overscroll-none sm:gap-4 lg:grid lg:grid-cols-[320px_minmax(0,1fr)] xl:grid-cols-[340px_minmax(0,1fr)]":"flex min-h-[calc(100dvh-2rem)] flex-col gap-4 lg:grid lg:grid-cols-[320px_minmax(0,1fr)] xl:grid-cols-[340px_minmax(0,1fr)]",children:[f.jsx("div",{className:"lg:hidden",children:f.jsxs("div",{className:"relative",children:[f.jsxs("div",{className:`thread-topbar-surface grid h-10 items-center gap-1.5 border-b px-2.5 backdrop-blur ${l&&(c||d)?"grid-cols-[2.5rem_minmax(0,1fr)_auto]":l?"grid-cols-[2.5rem_minmax(0,1fr)]":"grid-cols-[minmax(0,1fr)]"}`,children:[l&&f.jsx(l1,{}),o?f.jsxs("button",{type:"button",onClick:()=>A(F=>!F),"aria-expanded":N,"aria-label":N?"Collapse thread navigation":"Expand thread navigation",className:"inline-flex min-w-0 items-center justify-center gap-1 px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:de,children:[f.jsx("span",{className:"min-w-0 truncate",children:de}),f.jsx("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--theme-fg-muted)] transition ${N?"rotate-180":""}`,children:f.jsx("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"m4.5 6.25 3.5 3.5 3.5-3.5"})})})]}):f.jsx("p",{className:"min-w-0 truncate px-1 text-center text-sm font-medium text-[var(--theme-fg)]",title:de,children:de}),l&&(d||(c?f.jsxs(Js,{to:ne,onClick:()=>{K==null||K.closeNav(),A(!1)},"aria-label":"New Thread",className:"inline-flex h-8 min-w-0 shrink-0 items-center justify-center gap-1 rounded-full bg-[var(--theme-accent-solid)] px-2 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-accent-solid-fg)] transition hover:bg-[var(--theme-accent-solid-hover)]",children:[f.jsx(wq,{}),f.jsx("span",{className:"hidden sm:inline",children:"New"})]}):null))]}),l&&f.jsx(o1,{className:"absolute left-2 top-[calc(100%+0.45rem)] z-20 w-[min(18rem,calc(100vw-1rem))]"}),o&&N&&f.jsx("aside",{className:"thread-sidebar-surface absolute inset-x-2 top-[calc(100%+0.35rem)] z-10 max-h-[40dvh] overflow-y-auto rounded-[1.35rem] border p-4 shadow-2xl shadow-stone-950/18 backdrop-blur",children:L()})]})}),f.jsx("aside",{className:"hidden min-h-0 lg:block",children:f.jsx("div",{className:`thread-sidebar-surface sticky top-4 rounded-[2rem] border p-4 shadow-2xl shadow-stone-950/12 backdrop-blur ${i?"h-full max-h-full overflow-y-auto":""}`,children:L()})}),f.jsx("section",{className:i?"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden":"min-w-0",children:S})]}),f.jsx(mb,{open:H!==null,title:"Rename Thread",label:"Thread Title",value:U,busy:Y!==null,onChange:P,onCancel:Te,onSubmit:()=>H?z(H):void 0})]})}const cv=10,Aq=1e3,Rq=2e3,Q0=5500,Lq=3e3,X0=0,Ro=1,If=3,Iq=["read-only","workspace-write","danger-full-access"];function Oq(e){return e.sandboxMode??(e.approvalMode==="guarded"?"workspace-write":"danger-full-access")}function Dq(e,t){const n=new Set(t.map(r=>r.id));return[...t,...e.filter(r=>!n.has(r.id))]}function Lo(e,t){const n=new Set(t.map(r=>r.id));return[...e.filter(r=>!n.has(r.id)),...t]}function sc(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}function bS(e){return`${e.threadId}:${e.objective}:${e.createdAt}`}function jq(e,t){const n=Date.parse(e.updatedAt)||0,i=(Date.parse(t.updatedAt)||0)>=n?t:e,l=i===t?e:t;return{...i,localGoalId:i.localGoalId??l.localGoalId??null}}function xS(e){const t=new Map;for(const n of e){const r=bS(n),i=t.get(r);t.set(r,i?jq(i,n):n)}return[...t.values()].sort((n,r)=>Date.parse(r.updatedAt)-Date.parse(n.updatedAt))}function Of(e,t){return xS([t,...e])}function Mq(e){const t=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});return e.tokenBudget===null?`${t.format(e.tokensUsed)} tok`:`${t.format(e.tokensUsed)}/${t.format(e.tokenBudget)} tok`}function Pq(e){const t=Math.max(0,Math.floor(e/60)),n=Math.floor(t/60),r=t%60;return n>0?`${n}h ${r}m`:`${t}m`}function dv(e,t){if(!t)return null;const n=e.find(r=>r.model===t);return n?n.supportedReasoningEfforts.length>1:null}function Bq(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`client-${Date.now()}-${Math.random().toString(16).slice(2,10)}`}function Uq(e,t){return(e==null?void 0:e.items.some(n=>n.kind==="userMessage"&&n.text.trim()===t))??!1}function Hq(e,t,n,r){let i=!1;const l=e.map(o=>o.id!==t?o:(i=!0,{...o,tokenUsage:n,priceEstimate:r}));return i?l:e}function zq(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:f.jsx("path",{d:"M5.75 1.75c-.97 0-1.75.78-1.75 1.75v.25H3.5c-.97 0-1.75.78-1.75 1.75v6c0 .97.78 1.75 1.75 1.75h4.75c.97 0 1.75-.78 1.75-1.75v-.25h.5c.97 0 1.75-.78 1.75-1.75v-6c0-.97-.78-1.75-1.75-1.75h-4.75Zm-.5 2V3.5c0-.28.22-.5.5-.5h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H10v-4.5c0-.97-.78-1.75-1.75-1.75h-3Zm-1.75 1.25h4.75c.28 0 .5.22.5.5v6a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-6c0-.28.22-.5.5-.5Z"})})}function Fq(){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M4.25 2.25h5.2l2.3 2.3v9.2h-7.5a2 2 0 0 1-2-2v-7.5a2 2 0 0 1 2-2Z"}),f.jsx("path",{d:"M9.25 2.5v2.25h2.25"}),f.jsx("path",{d:"M7 6.75v4"}),f.jsx("path",{d:"m5.45 9.35 1.55 1.55 1.55-1.55"})]})}function Df({status:e}){return f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M2.5 6.75A8.22 8.22 0 0 1 8 4.5c2.14 0 4.1.8 5.5 2.25"}),f.jsx("path",{d:"M4.75 9a4.95 4.95 0 0 1 6.5 0"}),f.jsx("path",{d:"M6.9 11.3a1.9 1.9 0 0 1 2.2 0"}),e==="connected"?f.jsx("path",{d:"m6.7 13.2.9.9 1.7-2"}):e==="offline"?f.jsx("path",{d:"M3 3l10 10"}):e==="detached"?null:f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M11.8 11.1a2.2 2.2 0 0 1-1.8 2.7"}),f.jsx("path",{d:"m10.7 11.35 1.3-.55-.55-1.3"})]})]})}function $q(e,t){if(!e)return"Thread disconnected";switch(t.status){case"connected":return"Realtime updates connected";case"reconnecting":return"Realtime updates reconnecting";case"offline":return"Browser offline";case"checking":return"Checking realtime connection"}}function Vq(){const{id:e=""}=XA(),t=Xa(),n=T.useRef(""),r=T.useRef(null),i=T.useRef(null),l=T.useRef(null),o=T.useRef(!1),c=T.useRef(null),d=T.useRef(null),m=T.useRef(typeof navigator>"u"?!0:navigator.onLine),p=T.useRef(!1),g=T.useRef(null),y=T.useRef(null),E=T.useRef(0),v=T.useRef(0),w=T.useRef(null),C=T.useRef(null),S=T.useRef(null),[N,A]=T.useState(null),[H,$]=T.useState([]),[U,P]=T.useState([]),[Y,fe]=T.useState(null),[M,K]=T.useState(""),[V,he]=T.useState(null),[de,ne]=T.useState(null),[z,ee]=T.useState(!0),[Te,De]=T.useState(0),[L,F]=T.useState(!0),[se,O]=T.useState(!1),[ke,Ae]=T.useState(!1),[_e,et]=T.useState("chat"),[st,Me]=T.useState({prompt:"",attachments:[]}),[dt,pt]=T.useState(!1),[Dt,kn]=T.useState(0),[bt,He]=T.useState(0),[Ve,Qt]=T.useState(0),[at,Ke]=T.useState(!1),[Ge,an]=T.useState(null),[xn,or]=T.useState(!1),[Bt,Zn]=T.useState(!1),[pe,Ce]=T.useState(!1),[Qe,lt]=T.useState(null),[xt,sn]=T.useState("idle"),[mn,xe]=T.useState({status:m.current?"checking":"offline",browserOnline:m.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null}),[Se,ze]=T.useState(null),[Pe,Ze]=T.useState([]),[Q,be]=T.useState({status:"idle",data:null,error:null}),[ot,je]=T.useState({status:"idle",data:null,error:null}),[Fe,nt]=T.useState({status:"idle",data:null,error:null}),[zt,ut]=T.useState({status:"idle",data:null,error:null}),[wt,pn]=T.useState({status:"idle",data:null,error:null}),[ua,An]=T.useState(!1),[qr,Dr]=T.useState(!1),[Xi,Jn]=T.useState(()=>new Set),[ni,er]=T.useState(!1),[Ja,vs]=T.useState(!1),[ur,ln]=T.useState({status:"idle",data:null,error:null}),[on,Nt]=T.useState(null),ks=T.useCallback(()=>{const q=n.current;n.current="",r.current=null,q&&K(Z=>Z+q)},[]),ri=T.useCallback(q=>{n.current+=q,r.current===null&&(r.current=window.requestAnimationFrame(()=>{ks()}))},[ks]),jr=T.useCallback(()=>{n.current="",r.current!==null&&(window.cancelAnimationFrame(r.current),r.current=null)},[]);T.useEffect(()=>{be({status:"idle",data:null,error:null}),je({status:"idle",data:null,error:null}),nt({status:"idle",data:null,error:null}),ut({status:"idle",data:null,error:null}),pn({status:"idle",data:null,error:null}),er(!1),ln({status:"idle",data:null,error:null})},[e]);const Ki=T.useCallback(async()=>{if(e){ln(q=>({status:"loading",data:q.data,error:null}));try{const q=await o6(e);ln({status:"ready",data:q,error:null})}catch(q){const Z=q instanceof Wt?q.payload.message:"Unable to load export turns.";ln(ue=>({status:"failed",data:ue.data,error:Z}))}}},[e]);async function es(q){if(e){Nt(null),vs(!0);try{const{blob:Z,filename:ue}=await c6(e,q),Oe=URL.createObjectURL(Z),Le=document.createElement("a");Le.href=Oe,Le.download=ue,document.body.append(Le),Le.click(),Le.remove(),window.setTimeout(()=>URL.revokeObjectURL(Oe),3e4),er(!1)}catch(Z){const ue=Z instanceof Wt?Z.payload.message:"Unable to export transcript.";Nt(ue)}finally{vs(!1)}}}async function vr(){if(e){pn(q=>{var Z;return{status:"loading",data:q.data??((Z=C.current)==null?void 0:Z.goal)??null,error:null}});try{const q=await _6(e);pn({status:"ready",data:q.goal,error:null}),A(Z=>Z&&(q.goal?{...Z,goal:q.goal,goalHistory:Of(Z.goalHistory??[],q.goal)}:{...Z,goal:q.goal}))}catch(q){pn(Z=>({status:"failed",data:Z.data,error:q instanceof Wt?q.payload.message:"Unable to load goal."}))}}}async function ca(q){if(e){pn(Z=>{var ue;return{status:"loading",data:Z.data??((ue=C.current)==null?void 0:ue.goal)??null,error:null}});try{const Z=await T6(e,q);pn({status:"ready",data:Z.goal,error:null}),A(ue=>ue&&(Z.goal?{...ue,goal:Z.goal,goalHistory:Of(ue.goalHistory??[],Z.goal)}:{...ue,goal:Z.goal}))}catch(Z){throw pn(ue=>({status:"failed",data:ue.data,error:Z instanceof Wt?Z.payload.message:"Unable to update goal."})),Z}}}async function cr(){if(e){pn(q=>{var Z;return{status:"loading",data:q.data??((Z=C.current)==null?void 0:Z.goal)??null,error:null}});try{const q=await v6(e);pn({status:"ready",data:null,error:null}),A(Z=>Z&&(q.goalHistory?{...Z,goal:null,goalHistory:q.goalHistory}:{...Z,goal:null}))}catch(q){throw pn(Z=>({status:"failed",data:Z.data,error:q instanceof Wt?q.payload.message:"Unable to clear goal."})),q}}}async function Da(q){Dr(!0);try{await ca({status:q})}finally{Dr(!1)}}async function ja(){Dr(!0);try{await cr()}finally{Dr(!1)}}async function un(){if(e){be(q=>({status:"loading",data:q.data,error:null}));try{const q=await w6(e);be({status:"ready",data:q,error:null})}catch(q){be(Z=>({status:"failed",data:Z.data,error:q instanceof Wt?q.payload.message:"Unable to load skills."}))}}}async function ts(){if(e){je(q=>({status:"loading",data:q.data,error:null}));try{const q=await C6(e);je({status:"ready",data:q,error:null})}catch(q){je(Z=>({status:"failed",data:Z.data,error:q instanceof Wt?q.payload.message:"Unable to load MCP servers."}))}}}async function tr(){if(e){nt(q=>({status:"loading",data:q.data,error:null}));try{const q=await S6(e);nt({status:"ready",data:q,error:null})}catch(q){nt(Z=>({status:"failed",data:Z.data,error:q instanceof Wt?q.payload.message:"Unable to load hooks."}))}}}async function dr(q){if(e){nt(Z=>({status:"loading",data:Z.data,error:null}));try{const Z=await N6(e,q);nt({status:"ready",data:Z,error:null})}catch(Z){throw nt(ue=>({status:"failed",data:ue.data,error:Z instanceof Wt?Z.payload.message:"Unable to create hook."})),Z}}}async function da(q){if(e){nt(Z=>({status:"loading",data:Z.data,error:null}));try{const Z=await A6(e,q);nt({status:"ready",data:Z,error:null})}catch(Z){throw nt(ue=>({status:"failed",data:ue.data,error:Z instanceof Wt?Z.payload.message:"Unable to update hook."})),Z}}}async function Zi(q){if(e){nt(Z=>({status:"loading",data:Z.data,error:null}));try{const Z=await R6(e,q);nt({status:"ready",data:Z,error:null})}catch(Z){throw nt(ue=>({status:"failed",data:ue.data,error:Z instanceof Wt?Z.payload.message:"Unable to trust hook."})),Z}}}async function Jt(q){if(e){nt(Z=>({status:"loading",data:Z.data,error:null}));try{const Z=await L6(e,q);nt({status:"ready",data:Z,error:null})}catch(Z){throw nt(ue=>({status:"failed",data:ue.data,error:Z instanceof Wt?Z.payload.message:"Unable to untrust hook."})),Z}}}async function ai(){if(e){ut(q=>({status:"loading",data:q.data,error:null}));try{const q=await k6(e);ut({status:"ready",data:q,error:null})}catch(q){ut(Z=>({status:"failed",data:Z.data,error:q instanceof Wt?q.payload.message:"Unable to load turns for forking."}))}}}async function si(){if(!e)return;const q=await a2(e,{mode:"latest"});$(Z=>sc(Z,q.thread.thread)),t(`/threads/${q.thread.thread.id}`)}async function fa(q){if(!e)return;const Z=await a2(e,{mode:"turn",turnId:q});$(ue=>sc(ue,Z.thread.thread)),t(`/threads/${Z.thread.thread.id}`)}const ns=T.useCallback(q=>{const Z=S.current,ue=Z&&Object.keys(Z).length>0?{...q,thread:{...q.thread,...Z}}:q;C.current=ue,he(ue.livePlan??null),ne(ue.liveItems??null),pn(Ye=>Ye.status==="idle"?Ye:{...Ye,data:ue.goal??null});const Oe=ue.thread.activeTurnId===null&&ue.thread.status!=="running";A(Ye=>Ye&&!ue.goalHistory?{...ue,turns:Lo(Ye.turns,ue.turns),...Ye.goalHistory?{goalHistory:Ye.goalHistory}:{}}:Ye?{...ue,turns:Lo(Ye.turns,ue.turns)}:ue),$(Ye=>sc(Ye,ue.thread));const Le=new Map(ue.turns.map(Ye=>[Ye.id,Ye])),gt=new Set((ue.pendingSteers??[]).map(Ye=>Ye.clientRequestId).filter(Ye=>!!Ye));Ze(Ye=>Ye.filter(wn=>{if(gt.has(wn.clientRequestId))return!1;const _n=Le.get(wn.turnId);return!(!_n||Uq(_n,wn.prompt)||ue.thread.activeTurnId!==wn.turnId&&_n.status!=="inProgress")})),ze(Ye=>{if(!Ye)return Ye;const wn=Ye.serverTurnId??Ye.id;return ue.turns.some(Mr=>Mr.id===wn)?null:Ye}),(Oe||w.current&&ue.turns.some(Ye=>Ye.id===w.current))&&(w.current=null,jr(),K(""),he(null),ne(null))},[jr]);T.useEffect(()=>{C.current=N},[N]);const kr=T.useCallback(async({seedThread:q}={})=>{const Z=v.current+1;v.current=Z;const[ue,Oe,Le]=await Promise.allSettled([Mv(),Dv(),jv()]);v.current===Z&&(ue.status==="fulfilled"?$(q?sc(ue.value,q):ue.value):q&&$(gt=>sc(gt,q)),Oe.status==="fulfilled"&&fe(Oe.value),Le.status==="fulfilled"&&P(Le.value))},[]),En=T.useCallback(async({showLoading:q=!0,clearError:Z=!0,reportError:ue=!0}={})=>{const Oe=E.current+1;E.current=Oe,q&&F(!0),Z&&Nt(null);try{const Le=await t2(e,{limit:cv});if(E.current!==Oe)return;ns(Le)}catch(Le){if(E.current!==Oe||!ue)return;Nt(Le instanceof Error?Le.message:"Unable to load thread detail.")}finally{E.current===Oe&&F(!1)}},[ns,e,kr]),Rn=T.useCallback(()=>{var wn;const q=((wn=i.current)==null?void 0:wn.readyState)??If,Z=q===Ro,ue=m.current,Oe=Date.now(),Le=c.current!==null&&Oe-Date.parse(c.current)<=Q0,gt=d.current!==null&&Oe-d.current<=Q0;let Ye;ue?Z&&Le&&gt?Ye="connected":q===X0||l.current!==null||Le||gt||o.current?Ye="reconnecting":Ye="checking":Ye="offline",xe(_n=>_n.status===Ye&&_n.browserOnline===ue&&_n.healthOk===Le&&_n.socketOpen===Z&&_n.lastHealthyAt===c.current?_n:{status:Ye,browserOnline:ue,healthOk:Le,socketOpen:Z,lastHealthyAt:c.current})},[]);T.useEffect(()=>{E.current+=1,v.current+=1,A(null),Me({prompt:"",attachments:[]}),O(!1),sn("idle"),ze(null),Ze([]),ne(null),S.current=null,w.current=null,c.current=null,d.current=null,p.current=!1,m.current=typeof navigator>"u"?!0:navigator.onLine,xe({status:m.current?"checking":"offline",browserOnline:m.current,healthOk:!1,socketOpen:!1,lastHealthyAt:null})},[e]),T.useEffect(()=>{if(xt==="idle")return;const q=window.setTimeout(()=>{sn("idle")},xt==="copied"?1200:1600);return()=>{window.clearTimeout(q)}},[xt]),T.useEffect(()=>{if(typeof document>"u")return;const{documentElement:q,body:Z}=document;return q.classList.add("thread-detail-scroll-locked"),Z.classList.add("thread-detail-scroll-locked"),()=>{q.classList.remove("thread-detail-scroll-locked"),Z.classList.remove("thread-detail-scroll-locked")}},[]),T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const q=window.matchMedia("(max-width: 639px)"),Z=()=>pt(q.matches);return Z(),q.addEventListener("change",Z),()=>{q.removeEventListener("change",Z)}},[]),T.useEffect(()=>{var Z,ue;if(typeof window>"u")return;const q=()=>{const Oe=window.visualViewport,Le=Oe?Math.max(0,Math.round(window.innerHeight-Oe.height-Oe.offsetTop)):0;Qt(Le),document.documentElement.style.setProperty("--thread-detail-keyboard-inset",`${Le}px`)};return q(),(Z=window.visualViewport)==null||Z.addEventListener("resize",q),(ue=window.visualViewport)==null||ue.addEventListener("scroll",q),window.addEventListener("resize",q),()=>{var Oe,Le;(Oe=window.visualViewport)==null||Oe.removeEventListener("resize",q),(Le=window.visualViewport)==null||Le.removeEventListener("scroll",q),window.removeEventListener("resize",q),document.documentElement.style.removeProperty("--thread-detail-keyboard-inset")}},[]),T.useEffect(()=>{if(typeof document>"u")return;const q=()=>{const Z=document.activeElement,ue=y.current,Oe=ue==null?void 0:ue.querySelector('[aria-label="Prompt"]');Ke(!!(Z&&Oe&&(Z===Oe||Oe.contains(Z))))};return q(),document.addEventListener("focusin",q),document.addEventListener("focusout",q),()=>{document.removeEventListener("focusin",q),document.removeEventListener("focusout",q)}},[_e,N==null?void 0:N.thread.id,dt]),T.useEffect(()=>{const q=y.current;if(!q||typeof ResizeObserver>"u")return;const Z=q.querySelector("form")??q,ue=()=>{kn(Math.max(q.getBoundingClientRect().height,Z.getBoundingClientRect().height))};ue();const Oe=new ResizeObserver(()=>{ue()});return Oe.observe(Z),()=>{Oe.disconnect()}},[_e,dt]),T.useEffect(()=>{var Oe,Le;const q=y.current;if(!q||!dt||_e!=="chat"){He(0);return}const Z=()=>{const gt=q.getBoundingClientRect();He(Math.max(0,Math.ceil(window.innerHeight-gt.top)))};Z(),window.addEventListener("resize",Z),(Oe=window.visualViewport)==null||Oe.addEventListener("resize",Z),(Le=window.visualViewport)==null||Le.addEventListener("scroll",Z);let ue=null;return typeof ResizeObserver<"u"&&(ue=new ResizeObserver(Z),ue.observe(q)),()=>{var gt,Ye;window.removeEventListener("resize",Z),(gt=window.visualViewport)==null||gt.removeEventListener("resize",Z),(Ye=window.visualViewport)==null||Ye.removeEventListener("scroll",Z),ue==null||ue.disconnect()}},[_e,N==null?void 0:N.thread.id,dt,Ve,at]),T.useEffect(()=>{En({showLoading:!0}),kr()},[kr,En]),T.useEffect(()=>{let q=!1,Z=null;const ue=()=>{En({showLoading:!1,clearError:!1,reportError:!1})},Oe=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},Le=()=>{q||!m.current||l.current!==null||(l.current=window.setTimeout(()=>{l.current=null,!q&&_n()},Aq),Rn())},gt=()=>{const Re=i.current;if(i.current=null,Re)try{Re.close()}catch{}},Ye=Re=>{if(Re.threadId===e){if(Re.type==="thread.output.delta"&&typeof Re.payload.delta=="string"){const Je=typeof Re.payload.turnId=="string"?Re.payload.turnId:null;ri(Re.payload.delta),Je&&ze(tt=>tt&&(tt.serverTurnId===null||tt.serverTurnId===Je)?{...tt,serverTurnId:Je,id:Je,status:tt.status==="failed"?tt.status:"inProgress",tokenUsage:tt.tokenUsage}:tt)}if(Re.type==="thread.context.updated"){const Je=Re.payload.contextUsage&&typeof Re.payload.contextUsage=="object"?Re.payload.contextUsage:null;if(Je){const tt=Je;A(Xt=>Xt&&{...Xt,thread:{...Xt.thread,contextUsage:tt}}),$(Xt=>Xt.map(Ct=>Ct.id===e?{...Ct,contextUsage:tt}:Ct))}}if(Re.type==="thread.turn.token.updated"&&typeof Re.payload.turnId=="string"&&Re.payload.tokenUsage&&typeof Re.payload.tokenUsage=="object"){const Je=Re.payload.turnId,tt=Re.payload.tokenUsage,Xt=Re.payload.priceEstimate&&typeof Re.payload.priceEstimate=="object"?Re.payload.priceEstimate:null;A(Ct=>{if(!Ct)return Ct;const Kt=Hq(Ct.turns,Je,tt,Xt);return Kt===Ct.turns?Ct:{...Ct,turns:Kt}}),ze(Ct=>Ct&&(Ct.serverTurnId===Je||Ct.id===Je)?{...Ct,tokenUsage:tt,priceEstimate:Xt}:Ct)}if(Re.type==="thread.turn.started"||Re.type==="thread.turn.completed"||Re.type==="thread.turn.failed"||Re.type==="thread.updated"||Re.type==="thread.goal.updated"||Re.type==="thread.goal.cleared"||Re.type==="thread.request.created"||Re.type==="thread.request.resolved"){if(Re.type==="thread.goal.updated"){const Je=Re.payload.goal&&typeof Re.payload.goal=="object"?Re.payload.goal:null,tt=Array.isArray(Re.payload.goalHistory)?Re.payload.goalHistory:null;pn({status:"ready",data:Je,error:null}),A(Xt=>Xt&&(tt?{...Xt,goal:Je,goalHistory:tt}:Je?{...Xt,goal:Je,goalHistory:Of(Xt.goalHistory??[],Je)}:{...Xt,goal:Je}))}if(Re.type==="thread.goal.cleared"){const Je=Array.isArray(Re.payload.goalHistory)?Re.payload.goalHistory:null;pn({status:"ready",data:null,error:null}),A(tt=>tt&&(Je?{...tt,goal:null,goalHistory:Je}:{...tt,goal:null}))}if(ue(),Re.type==="thread.turn.started"){jr(),K(""),ne(null),w.current=null;const Je=typeof Re.payload.turnId=="string"?Re.payload.turnId:null;Je&&ze(tt=>tt&&{...tt,serverTurnId:Je,id:Je,status:tt.status==="failed"?tt.status:"inProgress",error:null,tokenUsage:tt.tokenUsage})}if(Re.type==="thread.turn.completed"||Re.type==="thread.turn.failed"){ne(null);const Je=typeof Re.payload.turnId=="string"?Re.payload.turnId:null;Je&&(w.current=Je,Re.type==="thread.turn.failed"&&ze(tt=>tt&&(tt.serverTurnId===Je||tt.id===Je)?{...tt,status:"failed",error:typeof Re.payload.error=="string"?Re.payload.error:"Unable to complete the turn.",tokenUsage:tt.tokenUsage}:tt))}}if((Re.type==="thread.item.started"||Re.type==="thread.item.completed")&&Re.payload.item&&typeof Re.payload.item=="object"&&typeof Re.payload.turnId=="string"){const Je=Re.payload.turnId,tt=Re.payload.item;typeof tt.id=="string"&&typeof tt.text=="string"&&ne(Xt=>{const Kt=[...((Xt==null?void 0:Xt.turnId)===Je?Xt.items:[]).filter(Ln=>Ln.id!==tt.id),tt].sort((Ln,In)=>{const za=typeof Ln.sequence=="number"&&Number.isFinite(Ln.sequence)?Ln.sequence:Number.POSITIVE_INFINITY,ss=typeof In.sequence=="number"&&Number.isFinite(In.sequence)?In.sequence:Number.POSITIVE_INFINITY;return za===ss?0:za-ss});return{turnId:Je,items:Kt,updatedAt:new Date().toISOString()}})}Re.type==="thread.plan.updated"&&Array.isArray(Re.payload.plan)&&he({turnId:String(Re.payload.turnId??""),explanation:typeof Re.payload.explanation=="string"?Re.payload.explanation:null,plan:Re.payload.plan})}},wn=()=>{const Re=i.current;if(!(!Re||Re.readyState!==Ro))try{Re.send(JSON.stringify({type:"supervisor.ping",timestamp:new Date().toISOString()}))}catch{p.current=!0,gt(),Le(),Rn()}},_n=()=>{var tt;if(q||!m.current){Rn();return}const Re=((tt=i.current)==null?void 0:tt.readyState)??If;if(Re===X0||Re===Ro){Rn();return}const Je=Bv(Ye);i.current=Je,Rn(),Je.addEventListener("message",Xt=>{if(i.current===Je)try{const Ct=JSON.parse(Xt.data);(Ct.type==="supervisor.connected"||Ct.type==="supervisor.pong")&&(d.current=Date.now(),Rn())}catch{}}),Je.addEventListener("open",()=>{i.current===Je&&(p.current=!0,ue(),wn(),Rn())}),Je.addEventListener("close",()=>{i.current===Je&&(i.current=null),p.current=!0,Le(),Rn()}),Je.addEventListener("error",()=>{i.current===Je&&(i.current=null),p.current=!0,Le(),Rn()})},Mr=async()=>{var Re;if(!(q||!m.current||o.current)){o.current=!0,Rn();try{await i6();const Je=p.current;c.current=new Date().toISOString(),Je&&(p.current=!1,ue()),(((Re=i.current)==null?void 0:Re.readyState)??If)!==Ro&&_n()}catch{c.current=null,p.current=!0,Le()}finally{o.current=!1,Rn()}}},Ha=()=>{m.current=!0,p.current=!0,Rn(),_n(),Mr()},Gt=()=>{m.current=!1,c.current=null,d.current=null,p.current=!0,Oe(),gt(),Rn()},Ut=()=>{var tt;if(q||!m.current){Rn();return}const Re=((tt=i.current)==null?void 0:tt.readyState)??If,Je=d.current===null?null:Date.now()-d.current;Re===Ro&&Je!==null&&Je>Q0?(p.current=!0,gt(),Le()):Re===Ro?wn():Re!==X0&&_n(),Mr(),Rn()};return window.addEventListener("online",Ha),window.addEventListener("offline",Gt),_n(),Mr(),Z=window.setInterval(Ut,Rq),()=>{q=!0,window.removeEventListener("online",Ha),window.removeEventListener("offline",Gt),Oe(),Z!==null&&window.clearInterval(Z),jr(),gt()}},[jr,e,En,ri,Rn]),T.useEffect(()=>{if(!((N==null?void 0:N.thread.activeTurnId)!==null||(N==null?void 0:N.thread.status)==="running"||Se!==null||Pe.length>0||M.length>0||V!==null||de!==null))return;const Z=window.setInterval(()=>{En({showLoading:!1,clearError:!1,reportError:!1})},Lq);return()=>{window.clearInterval(Z)}},[N==null?void 0:N.thread.activeTurnId,N==null?void 0:N.thread.status,M.length,de,V,En,Pe.length,Se]);async function lu(){var q;if(!(!N||N.turns.length===0||se)){O(!0),Nt(null);try{const Z=(q=N.turns[0])==null?void 0:q.id,ue=await t2(e,{limit:cv,...Z?{beforeTurnId:Z}:{}});A(Oe=>Oe?{...ue,turns:Dq(Oe.turns,ue.turns)}:ue),$(Oe=>Oe.map(Le=>Le.id===ue.thread.id?ue.thread:Le))}catch(Z){Nt(Z instanceof Error?Z.message:"Unable to load earlier turns.")}finally{O(!1)}}}async function Ma(q){var Mr,Ha;if(_e==="shell"){if((N==null?void 0:N.thread.isLoaded)===!1){await gr({attachShell:!0});return}const Gt=((Mr=g.current)==null?void 0:Mr.sendCommand(q.prompt))??!1;Nt(Gt?null:"Connect the shell before sending commands.");return}Ae(!0),Nt(null),De(Gt=>Gt+1);const Z=C.current,ue=Z?{...Z.thread,...S.current??{}}:null,Oe=(ue==null?void 0:ue.model)??null,Le=(ue==null?void 0:ue.reasoningEffort)??null,gt=Bq(),Ye=`optimistic-${Date.now()}`,wn=`optimistic-steer-${gt}`,_n=new Date().toISOString();try{let Gt=C.current;if(Gt&&!Gt.thread.isLoaded){const Kt={...Gt.thread,...S.current??{}},Ln=await n2(e,{...Gt.thread.model?{model:Gt.thread.model}:{},...Gt.thread.sandboxMode?{sandboxMode:Gt.thread.sandboxMode}:{}}),In={...Ln,thread:{...Ln.thread,model:Kt.model??Ln.thread.model,reasoningEffort:Kt.reasoningEffort??Ln.thread.reasoningEffort,collaborationMode:Kt.collaborationMode??Ln.thread.collaborationMode,sandboxMode:Kt.sandboxMode??Ln.thread.sandboxMode??null}};Gt=In,C.current=In,A(za=>za?{...In,turns:Lo(za.turns,In.turns)}:In),$(za=>za.map(ss=>ss.id===In.thread.id?In.thread:ss))}const Ut=Gt?{...Gt.thread,...S.current??{}}:null,Re=(Ut==null?void 0:Ut.status)==="running"?Ut.activeTurnId:null,Je=_e==="chat"&&!!Re;Je&&Re?Ze(Kt=>[...Kt,{id:wn,clientRequestId:gt,turnId:Re,prompt:q.prompt,createdAt:_n,status:"steering"}]):(jr(),K(""),ze({id:Ye,serverTurnId:null,startedAt:_n,status:"sending",error:null,prompt:q.prompt,model:Oe,reasoningEffort:Le,reasoningEffortAvailable:dv(U,Oe),tokenUsage:null,priceEstimate:null}));const tt={prompt:q.prompt,clientRequestId:gt,...Ut!=null&&Ut.model?{model:Ut.model}:{},...Ut!=null&&Ut.reasoningEffort?{reasoningEffort:Ut.reasoningEffort}:{},...Ut!=null&&Ut.collaborationMode?{collaborationMode:Ut.collaborationMode}:{},...Ut!=null&&Ut.sandboxMode?{sandboxMode:Ut.sandboxMode}:{},...(Ha=q.attachments)!=null&&Ha.length?{attachments:q.attachments}:{}},Xt=await b6(e,tt),Ct=S.current&&Object.keys(S.current).length>0?{...Xt,...S.current}:Xt;A(Kt=>Kt&&{...Kt,thread:Ct}),$(Kt=>Kt.map(Ln=>Ln.id===Ct.id?Ct:Ln)),Je&&Re?Ct.activeTurnId!==null&&Ct.activeTurnId!==Re&&Ct.lastTurnStartedAt!==(Ut==null?void 0:Ut.lastTurnStartedAt)?(jr(),K(""),he(null),Ze(Ln=>Ln.filter(In=>In.id!==wn)),ze({id:Ye,serverTurnId:Ct.activeTurnId,startedAt:Ct.lastTurnStartedAt??_n,status:"inProgress",error:null,prompt:q.prompt,model:Oe,reasoningEffort:Le,reasoningEffortAvailable:dv(U,Oe),tokenUsage:null,priceEstimate:null})):Ze(Ln=>Ln.map(In=>In.id===wn?{...In,turnId:Ct.activeTurnId??In.turnId,status:"accepted"}:In)):(ze(Kt=>Kt&&Kt.id===Ye?{...Kt,id:Ct.activeTurnId??Kt.id,serverTurnId:Ct.activeTurnId??Kt.serverTurnId,status:"inProgress",error:null,tokenUsage:Kt.tokenUsage,priceEstimate:Kt.priceEstimate}:Kt),he(null)),Me({prompt:"",attachments:[]})}catch(Gt){const Ut=Gt instanceof Wt?Gt.payload.message:Gt instanceof Error?Gt.message:"Unable to send prompt.";Gt instanceof Wt?Nt(Gt.payload.message):Nt(Ut),Ze(Re=>Re.filter(Je=>Je.clientRequestId!==gt)),ze(Re=>Re&&Re.id===Ye?{...Re,status:"failed",error:Ut}:Re)}finally{Ae(!1)}}async function en(){const q=N==null?void 0:N.thread.codexThreadId;if(q)try{await navigator.clipboard.writeText(q),sn("copied")}catch{sn("failed")}}async function gr(q){if(N){Ae(!0),Nt(null),jr(),K("");try{if(N.thread.isLoaded){const ue=await g6(e);A(Oe=>Oe?{...ue,turns:Lo(Oe.turns,ue.turns)}:ue),an(null),$(Oe=>Oe.map(Le=>Le.id===ue.thread.id?ue.thread:Le)),or(!1);return}const Z=await n2(e,{...N.thread.model?{model:N.thread.model}:{},...N.thread.sandboxMode?{sandboxMode:N.thread.sandboxMode}:{}});A(ue=>ue?{...Z,turns:Lo(ue.turns,Z.turns)}:Z),$(ue=>ue.map(Oe=>Oe.id===Z.thread.id?Z.thread:Oe)),q!=null&&q.attachShell&&_e==="shell"&&or(!0)}catch(Z){Nt(Z instanceof Error?Z.message:"Unable to change connection state.")}finally{Ae(!1)}}}async function Yr(){var q;if(_e==="shell"){const Z=((q=g.current)==null?void 0:q.sendControl("ctrl_c"))??!1;Nt(Z?null:"Connect the shell before sending Ctrl-C.");return}Ae(!0),Nt(null);try{const Z=N!=null&&N.thread.activeTurnId?await r2(e,{turnId:N.thread.activeTurnId}):await r2(e);A(ue=>ue&&{...ue,thread:Z}),$(ue=>ue.map(Oe=>Oe.id===Z.id?Z:Oe)),jr(),K("")}catch(Z){Nt(Z instanceof Error?Z.message:"Unable to interrupt turn.")}finally{Ae(!1)}}async function nr(q){if(!N)return;const Z=N,ue={...S.current??{},...q.model!==void 0?{model:q.model}:{},...q.reasoningEffort!==void 0?{reasoningEffort:q.reasoningEffort}:{},...q.fastMode!==void 0?{fastMode:q.fastMode}:{},...q.collaborationMode!==void 0?{collaborationMode:q.collaborationMode}:{},...q.sandboxMode!==void 0?{sandboxMode:q.sandboxMode}:{}},Oe={...N.thread,...ue};Zn(!0),S.current=ue,C.current={...N,thread:Oe},A(Le=>Le&&{...Le,thread:Oe}),$(Le=>Le.map(gt=>gt.id===Oe.id?{...gt,...Oe}:gt));try{const Le=await y6(e,{...q.model!==void 0?{model:q.model}:{},...q.reasoningEffort!==void 0?{reasoningEffort:q.reasoningEffort}:{},...q.fastMode!==void 0?{fastMode:q.fastMode}:{},...q.collaborationMode!==void 0?{collaborationMode:q.collaborationMode}:{},...q.sandboxMode!==void 0?{sandboxMode:q.sandboxMode}:{}});S.current=null,C.current=Z?{...Z,thread:Le}:null,A(gt=>gt&&{...gt,thread:Le}),$(gt=>gt.map(Ye=>Ye.id===Le.id?Le:Ye))}catch(Le){S.current=null,C.current=Z,A(Z),$(gt=>gt.map(Ye=>Ye.id===Z.thread.id?Z.thread:Ye)),Nt(Le instanceof Error?Le.message:"Unable to update thread settings.")}finally{Zn(!1)}}async function Ji(q,Z){lt(q),Nt(null);try{const ue=await I6(e,q,Z);A(Oe=>Oe?{...ue,turns:Lo(Oe.turns,ue.turns)}:ue),he(ue.livePlan??null),ne(ue.liveItems??null)}catch(ue){Nt(ue instanceof Error?ue.message:"Unable to answer this request.")}finally{lt(null)}}async function el(){if(N){Ce(!0),Nt(null);try{const q=await E6(e);A(Z=>Z&&{...Z,thread:q}),$(Z=>Z.map(ue=>ue.id===q.id?q:ue))}catch(q){Nt(q instanceof Error?q.message:"Unable to compact this thread context.")}finally{Ce(!1)}}}async function tl(q,Z){try{const ue=await Pv(q,{title:Z});$(Oe=>Oe.map(Le=>Le.id===ue.id?{...Le,title:ue.title,updatedAt:ue.updatedAt}:Le)),A(Oe=>Oe&&Oe.thread.id===ue.id?{...Oe,thread:{...Oe.thread,title:ue.title,updatedAt:ue.updatedAt}}:Oe)}catch(ue){throw Nt(ue instanceof Error?ue.message:"Unable to rename thread."),ue}}function ha(){et(q=>q==="chat"?(N!=null&&N.thread.isLoaded&&or(!0),"shell"):"chat")}async function ii(){var Z;const q=await((Z=g.current)==null?void 0:Z.copyLastCommandOutput());Nt(q?null:"Unable to copy the last shell command output.")}function ws(q){var ue,Oe;const Z=q==="clear"?((ue=g.current)==null?void 0:ue.sendCommand("clear"))??!1:((Oe=g.current)==null?void 0:Oe.sendControl(q))??!1;Nt(Z?null:"Connect the shell before sending control input.")}T.useEffect(()=>{if(!(!xn||_e!=="shell"||!g.current||(N==null?void 0:N.thread.isLoaded)===!1||(Ge==null?void 0:Ge.loading)!==!1)){if((Ge==null?void 0:Ge.status)==="attached"){or(!1);return}or(!1),g.current.toggleConnection()}},[_e,N==null?void 0:N.thread.isLoaded,xn,Ge==null?void 0:Ge.loading,Ge==null?void 0:Ge.status]),T.useEffect(()=>{if(_e!=="shell")return;const q=window.requestAnimationFrame(()=>{var Z;(Z=g.current)==null||Z.refreshLayout({focus:!0})});return()=>{window.cancelAnimationFrame(q)}},[_e]);const wr=N&&N.workspacePathStatus==="missing"?"Restore this workspace path on the current machine before continuing.":null,li=dt&&_e==="chat",oi=li&&at?Ve:0,nl=Math.max(Dt,144),Cs=Math.max(bt,nl+oi),rl=li?Cs+12:0,ql=N?f.jsxs("dl",{className:"space-y-4 text-sm",children:[f.jsxs("div",{className:"relative pr-9",children:[f.jsx("dt",{className:"text-stone-500",children:"Session ID"}),f.jsx("dd",{className:"mt-1 break-all text-stone-100",children:N.thread.codexThreadId??"Unavailable"}),N.thread.codexThreadId&&f.jsx("button",{type:"button","aria-label":"Copy Codex session ID",title:xt==="copied"?"Copied":xt==="failed"?"Copy failed":"Copy Codex session ID",onClick:()=>void en(),className:`thread-mobile-hit-target absolute bottom-0 right-0 inline-flex h-5 w-5 items-center justify-center rounded-full border shadow-sm shadow-stone-950/25 backdrop-blur transition ${xt==="copied"?"ui-status-info":xt==="failed"?"ui-status-danger":"border-stone-700/90 bg-stone-900/60 text-stone-300 hover:bg-stone-800/92"}`,children:f.jsx("span",{className:"scale-[0.72]",children:f.jsx(zq,{})})})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Source"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:N.thread.source==="local_codex_import"?"Imported local Codex session":"Supervisor thread"})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Status"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:sS(N.thread.status)})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Created"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:zo(N.thread.createdAt)})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Workspace"}),f.jsx("dd",{className:"mt-1 break-words text-stone-100",children:N.workspace.absPath})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Workspace path"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:N.workspacePathStatus==="present"?"Present":"Missing on this machine"})]}),f.jsxs("div",{children:[f.jsx("dt",{className:"text-stone-500",children:"Active turn"}),f.jsx("dd",{className:"mt-1 text-stone-100",children:N.thread.activeTurnId??"None"})]})]}):null,ui=N?f.jsx("div",{className:"space-y-3",children:f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-stone-500",children:"Sandbox Mode"}),f.jsx("div",{className:"mt-2 space-y-1.5",children:Iq.map(q=>{const Z=Oq(N.thread)===q;return f.jsx("button",{type:"button",disabled:Bt,onClick:()=>void nr({sandboxMode:q}),className:`block w-full rounded-xl border px-3 py-2 text-left text-sm transition ${Z?"ui-status-warning":"border-stone-800 bg-stone-950/40 text-stone-300 hover:bg-stone-800/80"} disabled:cursor-not-allowed disabled:opacity-60`,children:q},q)})})]})}):null,Wr=Se&&!(N!=null&&N.turns.some(q=>q.id===(Se.serverTurnId??Se.id)))?{id:Se.id,startedAt:Se.startedAt,status:Se.status,error:Se.error,model:Se.model,reasoningEffort:Se.reasoningEffort,reasoningEffortAvailable:Se.reasoningEffortAvailable,tokenUsage:Se.tokenUsage,priceEstimate:Se.priceEstimate,items:[{id:`${Se.id}-user-message`,kind:"userMessage",text:Se.prompt}]}:null,Pa=(N==null?void 0:N.thread.isLoaded)??!1,rs=Pa?mn.status==="connected"?"ui-action-success shadow-lg shadow-stone-950/20":mn.status==="reconnecting"?"thread-live-connection-reconnecting ui-status-success shadow-lg shadow-stone-950/20":mn.status==="offline"?"ui-status-danger shadow-lg shadow-stone-950/20":"ui-status-warning shadow-lg shadow-stone-950/20":"border border-stone-700/90 bg-stone-900/85 text-stone-400 shadow-lg shadow-stone-950/20",Ba=$q(Pa,mn),Qr=[Ba,Pa?null:"Tap to connect this thread",mn.lastHealthyAt?`Last healthy ${zo(mn.lastHealthyAt)}`:null].filter(Boolean).join(" · "),Yl=Pa?f.jsx("div",{role:"status","aria-live":"polite","aria-label":Ba,title:Qr,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${rs}`,children:f.jsx(Df,{status:mn.status})}):f.jsx("button",{type:"button",onClick:()=>void gr(),disabled:ke||!N,"aria-label":ke?"Connecting thread":"Connect thread",title:ke?"Connecting thread":Qr,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition ${rs}`,children:f.jsx(Df,{status:"detached"})}),al=Pa?f.jsx("div",{title:Qr,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${rs}`,children:f.jsx(Df,{status:mn.status})}):f.jsx("button",{type:"button",onClick:()=>void gr(),disabled:ke||!N,title:ke?"Connecting thread":Qr,className:`hidden lg:inline-flex h-9 w-9 items-center justify-center rounded-full transition ${rs}`,children:f.jsx(Df,{status:"detached"})}),Xr=wt.data??(N==null?void 0:N.goal)??null,Ua=(N==null?void 0:N.goalHistory)??[],Cr=Xr?Of(Ua,Xr):xS(Ua),ci=f.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),f.jsx("circle",{cx:"8",cy:"8",r:"2"}),f.jsx("path",{d:"M8 1.7v2M8 12.3v2M1.7 8h2M12.3 8h2"})]}),as=ua?f.jsxs("div",{className:"w-96 max-w-[calc(100vw-1.5rem)] rounded-3xl border border-stone-700/80 bg-stone-950/92 p-3 text-left text-stone-100 shadow-2xl shadow-stone-950/35 backdrop-blur-xl",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-semibold",children:"Goal monitor"}),f.jsx("p",{className:"text-xs text-stone-500",children:"Current thread only"})]}),f.jsx("button",{type:"button",onClick:()=>An(!1),className:"rounded-full border border-stone-700 px-2.5 py-1 text-xs text-stone-300 transition hover:bg-stone-800",children:"Close"})]}),wt.error?f.jsx("p",{className:"mt-3 rounded-2xl border border-rose-400/30 bg-rose-400/10 px-3 py-2 text-xs text-rose-100",children:wt.error}):null,f.jsx("div",{className:"mt-3 max-h-[28rem] space-y-2 overflow-auto pr-1",children:Cr.length===0?f.jsx("p",{className:"rounded-2xl border border-stone-800 bg-stone-900/60 px-3 py-3 text-sm text-stone-400",children:"No goals in this thread yet."}):Cr.map(q=>{const Z=bS(q),ue=Xi.has(Z),Oe=["active","paused","budgetLimited"].includes(q.status);return f.jsxs("div",{className:`rounded-2xl border px-3 py-3 ${Oe?"ui-status-info":"border-stone-800 bg-stone-900/60"}`,children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsx("button",{type:"button",onClick:()=>Jn(Le=>{const gt=new Set(Le);return gt.has(Z)?gt.delete(Z):gt.add(Z),gt}),className:"min-w-0 flex-1 text-left",children:f.jsx("p",{className:`text-sm font-medium leading-5 ${ue?"":"line-clamp-2"}`,children:q.objective})}),f.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:q.status})]}),f.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px] text-stone-400",children:[f.jsx("span",{children:Pq(q.timeUsedSeconds)}),f.jsx("span",{children:Mq(q)}),f.jsxs("span",{title:zo(q.updatedAt),children:["Updated ",new Date(q.updatedAt).toLocaleTimeString()]})]}),Oe?f.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[f.jsx("button",{type:"button",disabled:qr||q.status==="active",onClick:()=>void Da("active"),className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-50",children:"Continue"}),f.jsx("button",{type:"button",disabled:qr||q.status==="paused",onClick:()=>void Da("paused"),className:"rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-50",children:"Pause"}),f.jsx("button",{type:"button",disabled:qr,onClick:()=>void ja(),className:"rounded-full border border-rose-400/35 px-3 py-1.5 text-xs text-rose-100 transition hover:bg-rose-400/10 disabled:cursor-not-allowed disabled:opacity-50",children:"Terminate"})]}):null]},Z)})})]}):null,Sr=f.jsx("button",{type:"button","aria-label":"Open goal monitor",title:"Open goal monitor",onClick:()=>{An(q=>!q),vr()},className:"ui-status-info inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full shadow-lg shadow-stone-950/20 transition lg:h-9 lg:w-9",children:ci}),Ss=f.jsx("button",{type:"button","aria-label":"Export transcript",title:"Export transcript",onClick:()=>er(!0),disabled:!N,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/85 text-stone-300 shadow-lg shadow-stone-950/20 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-50 lg:h-9 lg:w-9",children:f.jsx(Fq,{})}),Ns=f.jsxs("div",{className:"relative flex items-center justify-end gap-1.5",children:[Ss,Sr,Yl]});return f.jsx(gS,{threads:H,status:Y,loading:L,error:L?null:on,viewportConstrained:!0,currentThreadId:N==null?void 0:N.thread.id,currentThreadLabel:N==null?void 0:N.thread.title,currentWorkspaceId:N==null?void 0:N.thread.workspaceId,currentWorkspaceLabel:N==null?void 0:N.workspace.label,metaContent:ql,settingsContent:ui,showMobileNewThreadShortcut:!1,mobileHeaderAction:Ns,onRenameThread:tl,children:f.jsxs("div",{className:"thread-detail-surface relative flex h-full min-h-0 flex-1 flex-col overflow-hidden rounded-none border-y shadow-2xl shadow-stone-950/20 sm:flex-none sm:rounded-[2rem] sm:border",children:[f.jsx("div",{className:"pointer-events-none absolute right-4 top-4 z-30 hidden lg:block",children:f.jsx("div",{className:"pointer-events-auto flex flex-col items-end gap-2",children:f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[Ss,Sr,al]})})}),as?f.jsx("div",{className:"fixed right-3 top-20 z-50 lg:absolute lg:top-16 lg:right-4",children:as}):null,on&&!L&&f.jsx("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:on}),L?f.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Loading thread detail..."}):N?f.jsxs(f.Fragment,{children:[N.workspacePathStatus==="missing"&&f.jsxs("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:[f.jsx("p",{className:"font-medium text-rose-50",children:"Workspace path missing"}),f.jsx("p",{className:"mt-1 break-words text-rose-100/90",children:N.workspace.absPath})]}),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:_e==="chat"?"flex min-h-0 flex-1 flex-col":"hidden",children:[f.jsx(kq,{threadId:N.thread.id,turns:N.turns,totalTurnCount:N.totalTurnCount??N.turns.length,pendingRequests:N.pendingRequests,livePlan:V,liveItems:de,respondingRequestId:Qe,onRespondToRequest:Ji,liveOutput:M,scrollRequestKey:Te,bottomSpacer:rl,className:"thread-timeline-surface min-h-0 flex-1",onTailVisibilityChange:ee,loadingEarlier:se,onLoadEarlier:lu,onLoadHistoryItemDetail:q=>l6(N.thread.id,q),answeredRequestNotes:N.answeredRequestNotes??[],activityNotes:N.activityNotes??[],pendingSteers:N.pendingSteers??[],optimisticSteers:Pe,optimisticTurn:Wr}),li?f.jsx("div",{ref:y,className:"fixed inset-x-0 bottom-0 z-30 sm:hidden",style:{bottom:`${oi}px`,paddingBottom:"env(safe-area-inset-bottom)"},children:f.jsx(r0,{activeView:_e,edgeToEdgeMobile:!0,busy:_e==="chat"?ke:!1,settingsBusy:Bt,error:null,model:N.thread.model,reasoningEffort:N.thread.reasoningEffort,fastMode:N.thread.fastMode??!1,collaborationMode:N.thread.collaborationMode,modelOptions:U,contextUsage:N.thread.contextUsage,followTail:z,threadConnected:N.thread.isLoaded,disabled:!!wr,disabledPlaceholder:wr??void 0,shellControlState:Ge,draftPrompt:st.prompt,draftAttachments:st.attachments,onDraftChange:Me,canInterrupt:!!N.thread.activeTurnId,onSubmit:Ma,onInterrupt:Yr,onCompact:el,onOpenForkTurns:ai,onForkLatest:si,onForkTurn:fa,onOpenSkills:un,onOpenMcp:ts,onOpenHooks:tr,onCreateHook:dr,onUpdateHook:da,onTrustHook:Zi,onUntrustHook:Jt,goalState:wt,onOpenGoal:vr,onUpdateGoal:ca,onReadCodexConfig:()=>eg("config.toml"),onWriteCodexConfig:q=>tg("config.toml",{content:q}),onToggleFollow:()=>De(q=>q+1),onUpdateSettings:nr,onToggleView:ha,onShellCopy:ii,onShellControl:ws,compactBusy:pe,skillsState:Q,mcpState:ot,hooksState:Fe,forkTurnOptionsState:zt})}):f.jsx("div",{ref:y,children:f.jsx(r0,{activeView:_e,busy:_e==="chat"?ke:!1,settingsBusy:Bt,error:null,model:N.thread.model,reasoningEffort:N.thread.reasoningEffort,fastMode:N.thread.fastMode??!1,collaborationMode:N.thread.collaborationMode,modelOptions:U,contextUsage:N.thread.contextUsage,followTail:z,threadConnected:N.thread.isLoaded,disabled:!!wr,disabledPlaceholder:wr??void 0,shellControlState:Ge,draftPrompt:st.prompt,draftAttachments:st.attachments,onDraftChange:Me,canInterrupt:!!N.thread.activeTurnId,onSubmit:Ma,onInterrupt:Yr,onCompact:el,onOpenForkTurns:ai,onForkLatest:si,onForkTurn:fa,onOpenSkills:un,onOpenMcp:ts,onOpenHooks:tr,onCreateHook:dr,onUpdateHook:da,onTrustHook:Zi,onUntrustHook:Jt,goalState:wt,onOpenGoal:vr,onUpdateGoal:ca,onReadCodexConfig:()=>eg("config.toml"),onWriteCodexConfig:q=>tg("config.toml",{content:q}),onToggleFollow:()=>De(q=>q+1),onUpdateSettings:nr,onToggleView:ha,onShellCopy:ii,onShellControl:ws,compactBusy:pe,skillsState:Q,mcpState:ot,hooksState:Fe,forkTurnOptionsState:zt})})]}),f.jsxs("div",{className:_e==="shell"?"flex min-h-0 flex-1 flex-col":"hidden",children:[N.thread.isLoaded&&f.jsx(N4,{ref:g,threadId:N.thread.id,isVisible:_e==="shell",showHeader:!1,showFloatingToolbox:!1,onStateChange:an}),_e==="shell"&&!N.thread.isLoaded&&f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:f.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[f.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Thread disconnected"}),f.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Reconnect this thread before creating or attaching a shell."})]})}),_e==="shell"&&f.jsx(r0,{activeView:_e,busy:ke,settingsBusy:!1,error:N.thread.isLoaded?(Ge==null?void 0:Ge.error)??null:null,followTail:!1,threadConnected:N.thread.isLoaded,shellControlState:Ge,canInterrupt:!!(N.thread.isLoaded&&(Ge!=null&&Ge.isCommandRunning)),onSubmit:Ma,onInterrupt:Yr,onToggleView:ha,onShellCopy:ii,onShellControl:ws})]})]})]}):f.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-stone-400",children:"Unable to resolve this thread."}),f.jsx(q6,{open:ni,busy:Ja,turnsState:ur,onCancel:()=>{Ja||er(!1)},onLoadTurns:Ki,onExport:es})]})})}function Gq(){const e=Xa(),[t,n]=T.useState(""),[r,i]=T.useState(!1),[l,o]=T.useState(null);async function c(d){d.preventDefault();const m=t.trim();if(!m){o("Session ID is required.");return}i(!0),o(null);try{const p=await h6(m);e(`/threads/${p.thread.id}`)}catch(p){p instanceof Wt?o(p.payload.message):o(p instanceof Error?p.message:"Unable to import session.")}finally{i(!1)}}return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Import Session"}),f.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Bring in a local Codex session"}),f.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-6 text-stone-400",children:"Paste a session ID from this machine. Supervisor will recover the workspace path, reuse an existing workspace when possible, or create one with the last folder name as the default label."}),f.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-stone-500",children:"Imported history appears immediately, but sending a new prompt still requires a manual Resume / Connect."})]}),f.jsxs("form",{onSubmit:c,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"session-id",className:"text-sm font-medium text-stone-200",children:"Local session ID"}),f.jsx("input",{id:"session-id",value:t,onChange:d=>n(d.target.value),placeholder:"019d6fb7-7033-7a30-a2c7-74d0919e87d4",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),l&&f.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:l}),f.jsx("div",{className:"flex flex-wrap items-center gap-3",children:f.jsx("button",{type:"submit",disabled:r,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:r?"Importing...":"Import Session"})})]})]})}function qq(){const e=Xa(),[t]=Iv(),[n,r]=T.useState([]),[i,l]=T.useState([]),[o,c]=T.useState(""),[d,m]=T.useState(""),[p,g]=T.useState(""),[y,E]=T.useState("yolo"),[v,w]=T.useState(!0),[C,S]=T.useState(!1),[N,A]=T.useState(null),H=t.get("workspaceId");T.useEffect(()=>{Promise.all([i1(),jv()]).then(([P,Y])=>{var M,K,V;r(P),l(Y);const fe=P.some(he=>he.id===H)?H:((M=P[0])==null?void 0:M.id)??"";c(fe),m(((K=Y.find(he=>he.isDefault))==null?void 0:K.model)??((V=Y[0])==null?void 0:V.model)??"")}).catch(P=>{A(P instanceof Error?P.message:"Unable to load creation form data.")}).finally(()=>{w(!1)})},[t]);function $(){if(window.history.length>1){e(-1);return}if(H){e(`/threads?workspaceId=${encodeURIComponent(H)}`);return}e("/workspaces")}async function U(P){P.preventDefault(),S(!0),A(null);try{const Y=await f6(p.trim()?{workspaceId:o,model:d,approvalMode:y,title:p.trim()}:{workspaceId:o,model:d,approvalMode:y});e(`/threads/${Y.id}`)}catch(Y){Y instanceof Wt?A(Y.payload.message):A(Y instanceof Error?Y.message:"Unable to create thread.")}finally{S(!1)}}return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"New Thread"}),f.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Start a Codex session"}),f.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Choose the workspace, model, and approval mode that should back the new thread."})]}),v?f.jsx("div",{className:"rounded-3xl border border-stone-800 bg-stone-900 px-6 py-12 text-center text-stone-400",children:"Loading creation form..."}):f.jsxs("form",{onSubmit:U,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-workspace",children:"Workspace"}),f.jsx("select",{id:"thread-workspace",value:o,onChange:P=>c(P.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:n.map(P=>f.jsxs("option",{value:P.id,children:[P.label," · ",P.absPath]},P.id))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-model",children:"Model"}),f.jsx("select",{id:"thread-model",value:d,onChange:P=>m(P.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:i.map(P=>f.jsxs("option",{value:P.model,children:[P.displayName," · ",P.model]},P.id))})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-title",children:"Title"}),f.jsx("input",{id:"thread-title",value:p,onChange:P=>g(P.target.value),placeholder:"Optional. Falls back to first prompt.",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-stone-200",htmlFor:"thread-approval-mode",children:"Approval mode"}),f.jsxs("select",{id:"thread-approval-mode",value:y,onChange:P=>E(P.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300",children:[f.jsx("option",{value:"yolo",children:"yolo"}),f.jsx("option",{value:"guarded",children:"guarded"})]})]}),N&&f.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:N}),f.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[f.jsx("button",{type:"submit",disabled:C||!o||!d,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:C?"Creating...":"Create Thread"}),f.jsx("button",{type:"button",onClick:$,disabled:C,className:"rounded-full border border-stone-700 px-5 py-3 font-medium text-stone-200 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:border-stone-800 disabled:text-stone-500",children:"Cancel"})]})]})]})}function yS({open:e,title:t,description:n,confirmLabel:r="Delete",busy:i=!1,onCancel:l,onConfirm:o}){return T.useEffect(()=>{if(!e)return;function c(d){d.key==="Escape"&&!i&&l()}return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[i,l,e]),e?Qo.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[f.jsx("button",{type:"button","aria-label":"Close confirmation dialog",onClick:l,disabled:i,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),f.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("p",{className:"text-sm font-medium text-stone-100",children:t}),f.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]}),f.jsx("button",{type:"button","aria-label":"Close dialog",onClick:l,disabled:i,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:f.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),f.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:l,disabled:i,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),f.jsx("button",{type:"button",onClick:()=>void o(),disabled:i,className:"ui-action-danger rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:i?"Deleting...":r})]})]})]}),document.body):null}function Yq(e){const t=e.replace(/\s+/g," ").trim(),n=Array.from(t);return n.length<=15?t:`${n.slice(0,15).join("")}...`}function Wq(){const[e]=Iv(),t=Xa(),n=e.get("workspaceId"),[r,i]=T.useState([]),[l,o]=T.useState([]),[c,d]=T.useState(null),[m,p]=T.useState(!0),[g,y]=T.useState(null),[E,v]=T.useState(null),[w,C]=T.useState(""),[S,N]=T.useState(null),[A,H]=T.useState(null),[$,U]=T.useState(!1);async function P(){p(!0),y(null);try{const[ee,Te,De]=await Promise.all([Dv(),Mv(),i1()]);d(ee),i(Te),o(De)}catch(ee){y(ee instanceof Error?ee.message:"Unable to load threads.")}finally{p(!1)}}T.useEffect(()=>{if(n===null)return;P();const ee=Bv(Te=>{i(De=>De.map(L=>L.id===Te.threadId?{...L,status:typeof Te.payload.status=="string"?Te.payload.status:L.status,lastError:typeof Te.payload.error=="string"?Te.payload.error:L.lastError,title:typeof Te.payload.title=="string"?Te.payload.title:L.title}:L))});return()=>{ee.close()}},[n]);const Y=Object.fromEntries(l.map(ee=>[ee.id,ee.label])),fe=l.find(ee=>ee.id===n)??null,M=T.useMemo(()=>n?r.filter(ee=>ee.workspaceId===n):[],[n,r]),K=M.filter(ee=>ee.status==="running").length,V=n?`/threads/new?workspaceId=${encodeURIComponent(n)}`:"/threads/new";if(n===null)return f.jsx(c5,{to:"/workspaces",replace:!0});function he(){switch(c==null?void 0:c.state){case"ready":return"bg-emerald-400 shadow-[0_0_0_3px_rgba(52,211,153,0.14)]";case"starting":return"bg-amber-300 shadow-[0_0_0_3px_rgba(252,211,77,0.12)]";case"degraded":case"failed":return"bg-rose-400 shadow-[0_0_0_3px_rgba(251,113,133,0.14)]";default:return"bg-stone-500 shadow-[0_0_0_3px_rgba(120,113,108,0.14)]"}}async function de(ee,Te){try{const De=await Pv(ee,{title:Te});i(L=>L.map(F=>F.id===De.id?{...F,title:De.title,updatedAt:De.updatedAt}:F))}catch(De){throw y(De instanceof Error?De.message:"Unable to rename thread."),De}}async function ne(){if(!E)return;const ee=w.trim();if(ee){N(E);try{await de(E,ee),v(null),C("")}finally{N(null)}}}async function z(){if(A){U(!0);try{await x6(A.id),i(ee=>ee.filter(Te=>Te.id!==A.id)),H(null)}catch(ee){y(ee instanceof Error?ee.message:"Unable to delete thread.")}finally{U(!1)}}}return f.jsx(gS,{threads:r,workspaceLabels:Y,status:c,loading:m,error:g,viewportConstrained:n!==null,showMobileAppMenu:!0,showMobileThreadNavToggle:!1,showMobileNewThreadShortcut:!1,currentWorkspaceId:n,currentWorkspaceLabel:(fe==null?void 0:fe.label)??null,onRenameThread:de,children:f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-[2rem] border border-stone-800 bg-stone-900/85 shadow-2xl shadow-stone-950/20",children:[f.jsx("div",{className:"border-b border-stone-800 px-4 py-3 sm:px-6 sm:py-4",children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("h2",{className:"min-w-0 truncate text-base font-semibold text-stone-100 sm:text-lg",title:fe?`${fe.label} threads`:"All threads",children:fe?fe.label:"All Threads"}),f.jsx(Js,{to:V,className:"inline-flex h-9 shrink-0 items-center rounded-full bg-amber-300 px-3.5 text-xs font-medium uppercase tracking-[0.18em] text-stone-950 transition hover:bg-amber-200",children:"New Thread"})]})}),f.jsx("div",{className:"px-4 py-3 sm:px-6 sm:py-4",children:f.jsxs("article",{className:"inline-flex min-w-[12rem] max-w-full items-center gap-3 rounded-[1.25rem] border border-stone-800 bg-stone-950/70 px-3.5 py-2.5",children:[f.jsx("span",{"aria-hidden":"true",className:`h-2.5 w-2.5 shrink-0 rounded-full ${he()}`}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.22em] text-stone-500",children:"Supervisor"}),f.jsx("p",{className:"truncate text-sm text-stone-200",children:(c==null?void 0:c.lastError)??((c==null?void 0:c.state)==="ready"?"Ready":(c==null?void 0:c.state)??"Checking")})]})]})}),!m&&!g&&M.length>0&&f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-stone-800 px-4 py-4 sm:px-6 sm:py-5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.28em] text-stone-500",children:"Recent Threads"}),f.jsxs("span",{className:"rounded-full border border-amber-300/30 bg-amber-300/10 px-2 py-0.5 text-[11px] font-medium uppercase tracking-[0.18em] text-amber-200",children:[M.length," total"]}),K>0&&f.jsxs("span",{className:"text-xs text-stone-500",children:["· ",K," running"]})]}),f.jsx("div",{className:"mt-3 min-h-0 flex-1",children:f.jsx(pS,{threads:M,currentWorkspaceId:n,workspaceLabels:Y,onOpenThread:ee=>t(`/threads/${ee}`),onBeginRenameThread:ee=>{v(ee.id),C(ee.title)},onDeleteThread:ee=>H(ee),scrollable:!0,maxHeightClassName:"max-h-full",showDeleteButton:!0,showSessionCopyButton:!0})})]}),!m&&!g&&M.length===0&&f.jsx("div",{className:"border-t border-stone-800 px-4 py-6 text-sm text-stone-500 sm:px-6",children:"No threads available in this workspace."})]}),f.jsx(mb,{open:E!==null,title:"Rename Thread",label:"Thread Title",value:w,busy:S!==null,onChange:C,onCancel:()=>{v(null),C("")},onSubmit:()=>void ne()}),f.jsx(yS,{open:A!==null,title:"Delete Thread",description:A?`Delete ${Yq(A.title)} from supervisor. The Codex session id will no longer appear in this workspace list.`:"",confirmLabel:"Delete Thread",busy:$,onCancel:()=>{$||H(null)},onConfirm:()=>void z()})]})})}function fv(e){const t=e.trim(),n=t.replace(/[\\/]+$/,"");if(!n)return"";if(ES(t)){const i=(n.split(/[?#]/)[0]??n).split(/[/:]/).filter(Boolean).at(-1)??"";return i.endsWith(".git")?i.slice(0,-4):i}return n.split(/[\\/]/).filter(Boolean).at(-1)??""}function ES(e){const t=e.trim();return/^https?:\/\/.+/i.test(t)||/^ssh:\/\/.+/i.test(t)||/^git@[^:]+:.+/.test(t)}function Qq({initialPath:e="",initialLabel:t="",submitLabel:n="Save Workspace",error:r,busy:i=!1,onSubmit:l}){const o=fv(e),[c,d]=T.useState(e),[m,p]=T.useState(t||o),[g,y]=T.useState(null),E=T.useRef(o);T.useEffect(()=>{const w=fv(c);p(C=>!C.trim()||C===E.current?w:C),E.current=w},[c]);async function v(w){w.preventDefault();const C=c.trim();if(!C){y("Workspace path or Git URL is required.");return}y(null);const S=m.trim(),N=ES(C)?"gitUrl":"absPath";await l(S?{[N]:C,label:S}:{[N]:C})}return f.jsxs("form",{onSubmit:v,className:"space-y-5 rounded-3xl border border-stone-800 bg-stone-900 p-6",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"workspace-path",className:"text-sm font-medium text-stone-200",children:"Path or Git URL"}),f.jsx("input",{id:"workspace-path",name:"absPath",value:c,onChange:w=>d(w.target.value),placeholder:"/Users/name/project or https://github.com/owner/repo.git",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),f.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Absolute paths register local directories. Git URLs clone into the configured dev home."})]}),f.jsxs("div",{children:[f.jsx("label",{htmlFor:"workspace-label",className:"text-sm font-medium text-stone-200",children:"Display label"}),f.jsx("input",{id:"workspace-label",name:"label",value:m,onChange:w=>p(w.target.value),placeholder:"Optional override",className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"}),f.jsx("p",{className:"mt-2 text-xs text-stone-500",children:"Defaults to the last folder name. You can override it."})]}),(g||r)&&f.jsx("div",{className:"rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:g??r}),f.jsx("button",{type:"submit",disabled:i,className:"rounded-full bg-amber-300 px-5 py-3 font-medium text-stone-950 transition hover:bg-amber-200 disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300",children:i?"Saving...":n})]})}function Xq(){const e=Xa(),[t,n]=T.useState(null),[r,i]=T.useState(!1);async function l(o){i(!0),n(null);try{const c=await O6(o);e(`/threads?workspaceId=${encodeURIComponent(c.id)}`)}catch(c){c instanceof Wt?n(c.payload.message):n(c instanceof Error?c.message:"Unable to create workspace.")}finally{i(!1)}}return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-stone-500",children:"Add Workspace"}),f.jsx("h2",{className:"mt-2 text-3xl font-semibold text-stone-100",children:"Create a workspace"}),f.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-stone-400",children:"Register an existing local directory, create one missing child directory under dev home, or clone a Git repository into dev home."})]}),f.jsx(Qq,{busy:r,error:t,submitLabel:"Create Workspace",onSubmit:l})]})}function hv(e){return Date.parse(e.lastOpenedAt??e.createdAt)}function Kq(e,t){return e.isFavorite!==t.isFavorite?e.isFavorite?-1:1:hv(t)-hv(e)}function Zq(e){return e?new Date(e).toLocaleString():"Never opened"}function Jq(e,t=28){return e.length<=t?e:`...${e.slice(-(t-3))}`}function eY({active:e}){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:`h-3.5 w-3.5 fill-current ${e?"rotate-[18deg]":"rotate-[8deg]"}`,children:f.jsx("path",{d:"M10.7 1.75c.34 0 .62.28.62.63v1.24l1.43 1.42c.24.24.24.62 0 .86l-1.1 1.1v2.02c0 .17-.07.33-.19.45l-1.5 1.5v2.28c0 .28-.18.53-.44.6a.62.62 0 0 1-.69-.24L7.2 12.4l-2.83 2.83a.625.625 0 1 1-.88-.88l2.83-2.83-2.2-1.62a.62.62 0 0 1-.24-.69c.08-.26.32-.44.6-.44h2.28l1.5-1.5a.64.64 0 0 1 .45-.18h2.02l1.1-1.11-1.42-1.42H9.07a.63.63 0 0 1-.62-.63c0-.34.28-.62.62-.62h1.63Z"})})}function tY(){return f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-current",children:f.jsx("path",{d:"M6.1 1.75h3.8c.75 0 1.4.52 1.57 1.25h2.03c.35 0 .63.28.63.63 0 .34-.28.62-.63.62h-.66l-.62 8.03c-.08 1.09-.99 1.97-2.08 1.97H5.86c-1.09 0-2-.88-2.08-1.97l-.62-8.03H2.5a.62.62 0 1 1 0-1.25h2.03c.17-.73.82-1.25 1.57-1.25Zm0 1.25c-.07 0-.14.03-.19.08A.26.26 0 0 0 5.84 3h4.32a.26.26 0 0 0-.07-.17.26.26 0 0 0-.19-.08H6.1Zm-1.07 1.25.61 7.93c.03.44.4.79.84.79h3.04c.44 0 .81-.35.84-.79l.61-7.93H5.03Zm1.53 1.32c.35 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Zm2.82 0c.34 0 .62.28.62.62v4.19a.62.62 0 1 1-1.24 0V6.19c0-.34.28-.62.62-.62Z"})})}function nY(){const e=Xa(),[t,n]=T.useState([]),[r,i]=T.useState(!0),[l,o]=T.useState(null),[c,d]=T.useState(null),[m,p]=T.useState(""),[g,y]=T.useState(null),[E,v]=T.useState(null),[w,C]=T.useState(null),[S,N]=T.useState(!1);async function A(){i(!0),o(null);try{n(await i1())}catch(V){o(V instanceof Error?V.message:"Unable to load workspaces.")}finally{i(!1)}}T.useEffect(()=>{A()},[]);async function H(V){const he={...V,isFavorite:!V.isFavorite};n(de=>de.map(ne=>ne.id===V.id?he:ne));try{const de=await M6(V.id,{isFavorite:!V.isFavorite});n(ne=>ne.map(z=>z.id===de.id?de:z))}catch(de){n(ne=>ne.map(z=>z.id===V.id?V:z)),o(de instanceof Error?de.message:"Unable to update workspace.")}}async function $(V){const he=m.trim();if(he){y(V);try{const de=await D6(V,{label:he});n(ne=>ne.map(z=>z.id===de.id?de:z)),d(null),p("")}catch(de){o(de instanceof Error?de.message:"Unable to rename workspace.")}finally{y(null)}}}function U(V){d(V.id),p(V.label)}function P(){d(null),p("")}function Y(V){e(`/threads?workspaceId=${encodeURIComponent(V)}`)}async function fe(){if(w){N(!0);try{await j6(w.id),n(V=>V.filter(he=>he.id!==w.id)),C(null)}catch(V){o(V instanceof Error?V.message:"Unable to delete workspace.")}finally{N(!1)}}}function M(V,he){(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),Y(he))}const K=T.useMemo(()=>[...t].sort(Kq),[t]);return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"sticky top-[env(safe-area-inset-top)] z-20 -mx-4 border-b border-stone-800/90 bg-stone-950/96 px-2.5 py-2 backdrop-blur sm:mx-0 sm:rounded-[1.4rem] sm:border sm:px-4",children:f.jsxs("div",{className:"relative",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 sm:gap-2",children:[f.jsx(l1,{}),f.jsx(Js,{to:"/threads/import",className:"inline-flex h-8 shrink-0 items-center rounded-full border border-sky-400/30 bg-sky-400/10 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-sky-100 transition hover:border-sky-300/45 hover:bg-sky-400/16 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Import"}),f.jsx(Js,{to:"/workspaces/new",className:"inline-flex h-8 shrink-0 items-center rounded-full bg-amber-300 px-2.5 text-[11px] font-medium uppercase tracking-[0.14em] text-stone-950 transition hover:bg-amber-200 sm:px-3 sm:text-xs sm:tracking-[0.18em]",children:"Create"}),f.jsx("div",{className:"min-w-0 flex-1 text-right",children:f.jsx("p",{className:"truncate text-[11px] uppercase tracking-[0.24em] text-stone-500",children:"Workspaces"})})]}),f.jsx(o1,{className:"absolute left-0 top-[calc(100%+0.5rem)] z-30 w-[min(22rem,calc(100vw-1rem))]"})]})}),r&&f.jsx("div",{className:"rounded-[1.6rem] border border-stone-800 bg-stone-900/85 px-6 py-12 text-center text-stone-400",children:"Loading workspace registry..."}),l&&f.jsx("div",{className:"rounded-[1.4rem] border border-rose-500/30 bg-rose-500/10 px-4 py-4 text-rose-100",children:l}),!r&&!l&&t.length===0&&f.jsxs("div",{className:"rounded-[1.6rem] border border-dashed border-stone-700 bg-stone-900/80 px-6 py-12 text-center",children:[f.jsx("p",{className:"text-lg font-medium text-stone-100",children:"No workspaces yet"}),f.jsx("p",{className:"mt-2 text-sm text-stone-500",children:"Add a local directory inside the configured workspace root to start building the registry."})]}),!r&&K.length>0&&f.jsx("div",{className:"space-y-2 overflow-x-hidden",children:K.map(V=>f.jsxs("article",{role:"link",tabIndex:0,onClick:()=>Y(V.id),onKeyDown:he=>M(he,V.id),className:"relative overflow-hidden rounded-[1.35rem] border border-stone-800 bg-stone-900/88 px-4 py-3 shadow-lg shadow-stone-950/10 transition hover:border-stone-700 hover:bg-stone-900",children:[f.jsxs("div",{className:"absolute right-2.5 top-2.5 flex items-center gap-1.5",children:[f.jsx("button",{type:"button","aria-label":`Delete workspace ${V.label}`,title:"Delete workspace",onClick:he=>{he.stopPropagation(),C(V)},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-rose-400/20 bg-rose-400/10 text-rose-200 transition hover:bg-rose-400/18",children:f.jsx(tY,{})}),f.jsx("button",{type:"button","aria-label":V.isFavorite?`Unpin workspace ${V.label}`:`Pin workspace ${V.label}`,title:V.isFavorite?"Unpin workspace":"Pin workspace",onClick:he=>{he.stopPropagation(),H(V)},className:`inline-flex h-7 w-7 items-center justify-center rounded-full border transition ${V.isFavorite?"border-amber-300/40 bg-amber-300/15 text-amber-200":"border-stone-700 bg-stone-900/72 text-stone-500 hover:text-stone-200"}`,children:f.jsx(eY,{active:V.isFavorite})})]}),f.jsx("div",{className:"flex min-w-0 items-start gap-3 pr-[4.6rem]",children:f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[f.jsx("p",{className:"min-w-0 max-w-full truncate text-base font-semibold text-stone-100 sm:text-lg",title:V.label,children:V.label}),f.jsx("button",{type:"button",onClick:he=>{he.stopPropagation(),U(V)},"aria-label":`Rename workspace ${V.label}`,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-stone-500 transition hover:text-stone-100",children:f.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3 fill-current",children:f.jsx("path",{d:"m11.9 1.6 2.5 2.5-8.2 8.2-3.3.7.7-3.3 8.3-8.1Zm-7.3 8.7-.3 1.3 1.3-.3 6.9-6.9-1-1-6.9 6.9Zm8.8-7.8-1-1-1 1 1 1 1-1Z"})})})]}),f.jsx("button",{type:"button","aria-label":V.absPath,title:V.absPath,onClick:he=>{he.stopPropagation(),v(V.absPath)},className:"mt-1 inline-block max-w-full overflow-hidden whitespace-nowrap text-left text-[9px] leading-4 text-stone-500 transition hover:text-stone-300",children:Jq(V.absPath)}),f.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-stone-500",children:f.jsxs("span",{className:"min-w-0 truncate",children:["Last opened: ",Zq(V.lastOpenedAt)]})})]})})]},V.id))}),f.jsx(mb,{open:c!==null,title:"Rename Workspace",label:"Workspace Label",value:m,busy:g!==null,onChange:p,onCancel:P,onSubmit:()=>c?$(c):void 0}),f.jsx(aS,{open:E!==null,title:"Workspace Path",text:E??"",onClose:()=>v(null)}),f.jsx(yS,{open:w!==null,title:"Delete Workspace",description:w?`Delete ${w.label} from supervisor. This also removes its threads and local supervisor metadata.`:"",confirmLabel:"Delete Workspace",busy:S,onCancel:()=>{S||C(null)},onConfirm:()=>void fe()})]})}const _S="remote-codex-theme-mode";function rY(){if(typeof window>"u")return"system";const e=window.localStorage.getItem(_S);return e==="light"||e==="dark"||e==="system"?e:"system"}function aY(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function sY({themeMode:e,setThemeMode:t,effectiveTheme:n}){const[r,i]=T.useState(!1),[l,o]=T.useState(!1),c=oa(),d=/^\/threads\/[^/]+$/.test(c.pathname),m=c.pathname==="/threads",p=d||m,g=m||d,y=c.pathname==="/workspaces",E=y||m;return T.useEffect(()=>{i(!1)},[c.pathname,c.search]),f.jsxs(Ov.Provider,{value:{navOpen:r,openNav:()=>i(!0),toggleNav:()=>i(v=>!v),closeNav:()=>i(!1),settingsOpen:l,openSettings:()=>{i(!1),o(!0)},closeSettings:()=>o(!1),themeMode:e,setThemeMode:t,effectiveTheme:n},children:[f.jsxs("div",{className:`bg-[var(--app-bg)] text-[var(--app-fg)] ${p?"fixed inset-0 overflow-hidden overscroll-none":"min-h-screen"}`,children:[!E&&f.jsxs("div",{className:`fixed left-4 top-4 z-50 ${d?"hidden sm:block":""}`,children:[f.jsx(l1,{}),f.jsx(o1,{className:"mt-3 w-[min(22rem,calc(100vw-2rem))]"})]}),f.jsx("main",{className:`mx-auto w-full max-w-[1600px] ${p?"absolute inset-0 pb-0 sm:pb-4":"pb-4"} ${g?d||m?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-[calc(env(safe-area-inset-top)+4rem)] sm:pt-4":y?"pt-[env(safe-area-inset-top)] sm:pt-4":"pt-4"} ${p?"overflow-hidden overscroll-none px-0 sm:px-6":"px-4 sm:px-6"}`,children:f.jsx("section",{className:`min-w-0 ${p?"h-full overflow-hidden overscroll-none":""}`,children:f.jsx(d5,{})})})]}),f.jsx(F6,{})]})}function iY(){const[e,t]=T.useState(()=>rY()),[n,r]=T.useState(()=>aY()),i=e==="system"?n:e;return T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>{r(l.matches?"dark":"light")};return o(),typeof l.addEventListener=="function"?l.addEventListener("change",o):l.addListener(o),()=>{typeof l.removeEventListener=="function"?l.removeEventListener("change",o):l.removeListener(o)}},[]),T.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(_S,e)},[e]),T.useEffect(()=>{const l=document.documentElement;l.dataset.themeMode=e,l.dataset.themeEffective=i,l.style.colorScheme=i},[i,e]),f.jsx("div",{className:"theme-shell theme-scrollbar",children:f.jsx(B5,{children:f.jsxs(h5,{children:[f.jsx(Ys,{path:"/",element:f.jsx($6,{})}),f.jsxs(Ys,{element:f.jsx(sY,{themeMode:e,setThemeMode:t,effectiveTheme:i}),children:[f.jsx(Ys,{path:"/workspaces",element:f.jsx(nY,{})}),f.jsx(Ys,{path:"/workspaces/new",element:f.jsx(Xq,{})}),f.jsx(Ys,{path:"/threads",element:f.jsx(Wq,{})}),f.jsx(Ys,{path:"/threads/import",element:f.jsx(Gq,{})}),f.jsx(Ys,{path:"/threads/new",element:f.jsx(qq,{})}),f.jsx(Ys,{path:"/threads/:id",element:f.jsx(Vq,{})})]})]})})})}dA.createRoot(document.getElementById("root")).render(f.jsx(aA.StrictMode,{children:f.jsx(iY,{})}));const lY=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:rS},Symbol.toStringTag,{value:"Module"}));export{aV as A,mY as L,ia as R,Eh as g,f as j,T as r};