@dotobokuri/fleet-console 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/AGENTS.md +101 -0
  2. package/README.md +69 -0
  3. package/dist/cli-bin.d.ts +2 -0
  4. package/dist/cli-bin.mjs +35423 -0
  5. package/dist/cli.d.ts +116 -0
  6. package/dist/cli.mjs +35429 -0
  7. package/dist/client/assets/_baseUniq-Bx4tjoo0.js +1 -0
  8. package/dist/client/assets/arc-D2VjIIjy.js +1 -0
  9. package/dist/client/assets/architectureDiagram-Q4EWVU46-BZwp8oQE.js +36 -0
  10. package/dist/client/assets/blockDiagram-DXYQGD6D-BFOEZdvM.js +132 -0
  11. package/dist/client/assets/c4Diagram-AHTNJAMY-CSR3Fk7i.js +10 -0
  12. package/dist/client/assets/cascadia-code-arabic-wght-normal-BxRhwSzF.woff2 +0 -0
  13. package/dist/client/assets/cascadia-code-braille-wght-normal-Cj7wfYns.woff2 +0 -0
  14. package/dist/client/assets/cascadia-code-cyrillic-ext-wght-normal-Bq2rGQtZ.woff2 +0 -0
  15. package/dist/client/assets/cascadia-code-cyrillic-wght-normal-DC72kP-V.woff2 +0 -0
  16. package/dist/client/assets/cascadia-code-greek-wght-normal-DmKacV-0.woff2 +0 -0
  17. package/dist/client/assets/cascadia-code-hebrew-wght-normal-CYieC9BD.woff2 +0 -0
  18. package/dist/client/assets/cascadia-code-latin-ext-wght-normal-CeKCfnVW.woff2 +0 -0
  19. package/dist/client/assets/cascadia-code-latin-wght-normal-CCwG33-X.woff2 +0 -0
  20. package/dist/client/assets/cascadia-code-symbols2-wght-normal-o0G5EPJ1.woff2 +0 -0
  21. package/dist/client/assets/cascadia-code-vietnamese-wght-normal-DXbdGs8p.woff2 +0 -0
  22. package/dist/client/assets/channel-DEE95baa.js +1 -0
  23. package/dist/client/assets/chunk-4BX2VUAB-CS98Xbj0.js +1 -0
  24. package/dist/client/assets/chunk-4TB4RGXK-CS16wI2h.js +206 -0
  25. package/dist/client/assets/chunk-55IACEB6-CIO8gXOu.js +1 -0
  26. package/dist/client/assets/chunk-EDXVE4YY-Dp62WKTv.js +1 -0
  27. package/dist/client/assets/chunk-FMBD7UC4-P-iX66To.js +15 -0
  28. package/dist/client/assets/chunk-OYMX7WX6-KYR0A13Y.js +231 -0
  29. package/dist/client/assets/chunk-QZHKN3VN-Bxf_1qP2.js +1 -0
  30. package/dist/client/assets/chunk-YZCP3GAM-fOywdyl7.js +1 -0
  31. package/dist/client/assets/classDiagram-6PBFFD2Q-C48o24xA.js +1 -0
  32. package/dist/client/assets/classDiagram-v2-HSJHXN6E-C48o24xA.js +1 -0
  33. package/dist/client/assets/clone-UUGnmCaX.js +1 -0
  34. package/dist/client/assets/cose-bilkent-S5V4N54A-CFVfzokO.js +1 -0
  35. package/dist/client/assets/cytoscape.esm-DH6-wILU.js +321 -0
  36. package/dist/client/assets/dagre-KV5264BT-CfFJpw9h.js +4 -0
  37. package/dist/client/assets/defaultLocale-DX6XiGOO.js +1 -0
  38. package/dist/client/assets/diagram-5BDNPKRD-ULNbraD0.js +10 -0
  39. package/dist/client/assets/diagram-G4DWMVQ6-BbMRdy0R.js +24 -0
  40. package/dist/client/assets/diagram-MMDJMWI5-xMtFUvhH.js +43 -0
  41. package/dist/client/assets/diagram-TYMM5635-zoxhe65u.js +24 -0
  42. package/dist/client/assets/erDiagram-SMLLAGMA-Bsi2YaEX.js +85 -0
  43. package/dist/client/assets/flowDiagram-DWJPFMVM-CJi0VEgQ.js +162 -0
  44. package/dist/client/assets/fraunces-latin-ext-wght-normal-Ca2vKHc0.woff2 +0 -0
  45. package/dist/client/assets/fraunces-latin-wght-normal-ukD16Tqj.woff2 +0 -0
  46. package/dist/client/assets/fraunces-vietnamese-wght-normal-CnvboYUG.woff2 +0 -0
  47. package/dist/client/assets/ganttDiagram-T4ZO3ILL-C6zhjR-p.js +292 -0
  48. package/dist/client/assets/gitGraphDiagram-UUTBAWPF-BWwF6PIg.js +106 -0
  49. package/dist/client/assets/graph-B_LOrVuH.js +1 -0
  50. package/dist/client/assets/index-CUwIAcWy.js +734 -0
  51. package/dist/client/assets/index-qy_LXUbN.css +1 -0
  52. package/dist/client/assets/infoDiagram-42DDH7IO-lGXnGt9J.js +2 -0
  53. package/dist/client/assets/init-Gi6I4Gst.js +1 -0
  54. package/dist/client/assets/ishikawaDiagram-UXIWVN3A-BOLdpalb.js +70 -0
  55. package/dist/client/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  56. package/dist/client/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  57. package/dist/client/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  58. package/dist/client/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  59. package/dist/client/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  60. package/dist/client/assets/journeyDiagram-VCZTEJTY-BL3YNELi.js +139 -0
  61. package/dist/client/assets/kanban-definition-6JOO6SKY-hr-sYeeB.js +89 -0
  62. package/dist/client/assets/katex-DHMw6HUq.js +257 -0
  63. package/dist/client/assets/layout-BZ-MMmoc.js +1 -0
  64. package/dist/client/assets/linear-DC89C5fp.js +1 -0
  65. package/dist/client/assets/manrope-cyrillic-wght-normal-Dvxsihut.woff2 +0 -0
  66. package/dist/client/assets/manrope-greek-wght-normal-DL7QRZyv.woff2 +0 -0
  67. package/dist/client/assets/manrope-latin-ext-wght-normal-Ch3YOpNY.woff2 +0 -0
  68. package/dist/client/assets/manrope-latin-wght-normal-DHIcAJRg.woff2 +0 -0
  69. package/dist/client/assets/manrope-vietnamese-wght-normal-usUDDRr7.woff2 +0 -0
  70. package/dist/client/assets/mermaid.core-CwFfQIZ3.js +243 -0
  71. package/dist/client/assets/min-CQCIo8ng.js +1 -0
  72. package/dist/client/assets/mindmap-definition-QFDTVHPH-DST5EYZ1.js +96 -0
  73. package/dist/client/assets/ordinal-Cboi1Yqb.js +1 -0
  74. package/dist/client/assets/pieDiagram-DEJITSTG-B1cKU1RL.js +30 -0
  75. package/dist/client/assets/quadrantDiagram-34T5L4WZ-BAoS3KE9.js +7 -0
  76. package/dist/client/assets/requirementDiagram-MS252O5E-1Dy-goiy.js +84 -0
  77. package/dist/client/assets/sankeyDiagram-XADWPNL6-BiGdJMmS.js +10 -0
  78. package/dist/client/assets/sequenceDiagram-FGHM5R23-BF2eGtl0.js +157 -0
  79. package/dist/client/assets/stateDiagram-FHFEXIEX-Bbe8i846.js +1 -0
  80. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-C5NCIJbi.js +1 -0
  81. package/dist/client/assets/timeline-definition-GMOUNBTQ-C57TZcAM.js +120 -0
  82. package/dist/client/assets/vennDiagram-DHZGUBPP-CCLKJVMf.js +34 -0
  83. package/dist/client/assets/wardley-RL74JXVD-CkN25AoB.js +162 -0
  84. package/dist/client/assets/wardleyDiagram-NUSXRM2D-D7-EokFc.js +20 -0
  85. package/dist/client/assets/xychartDiagram-5P7HB3ND-Dr1PKcCW.js +7 -0
  86. package/dist/client/index.html +14 -0
  87. package/package.json +62 -0
  88. package/postinstall.mjs +37 -0
@@ -0,0 +1,734 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const y of l)if(y.type==="childList")for(const b of y.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&o(b)}).observe(document,{childList:!0,subtree:!0});function s(l){const y={};return l.integrity&&(y.integrity=l.integrity),l.referrerPolicy&&(y.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?y.credentials="include":l.crossOrigin==="anonymous"?y.credentials="omit":y.credentials="same-origin",y}function o(l){if(l.ep)return;l.ep=!0;const y=s(l);fetch(l.href,y)}})();function z1(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function YL(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var n=i.default;if(typeof n=="function"){var s=function o(){var l=!1;try{l=this instanceof o}catch{}return l?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};s.prototype=n.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(i).forEach(function(o){var l=Object.getOwnPropertyDescriptor(i,o);Object.defineProperty(s,o,l.get?l:{enumerable:!0,get:function(){return i[o]}})}),s}var fd={exports:{}},Oo={};var Im;function $1(){if(Im)return Oo;Im=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(o,l,y){var b=null;if(y!==void 0&&(b=""+y),l.key!==void 0&&(b=""+l.key),"key"in l){y={};for(var c in l)c!=="key"&&(y[c]=l[c])}else y=l;return l=y.ref,{$$typeof:i,type:o,key:b,ref:l!==void 0?l:null,props:y}}return Oo.Fragment=n,Oo.jsx=s,Oo.jsxs=s,Oo}var Hm;function U1(){return Hm||(Hm=1,fd.exports=$1()),fd.exports}var z=U1(),_d={exports:{}},Pe={};var zm;function P1(){if(zm)return Pe;zm=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),b=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),C=Symbol.iterator;function x(M){return M===null||typeof M!="object"?null:(M=C&&M[C]||M["@@iterator"],typeof M=="function"?M:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function S(M,U,V){this.props=M,this.context=U,this.refs=_,this.updater=V||A}S.prototype.isReactComponent={},S.prototype.setState=function(M,U){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,U,"setState")},S.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function p(){}p.prototype=S.prototype;function m(M,U,V){this.props=M,this.context=U,this.refs=_,this.updater=V||A}var E=m.prototype=new p;E.constructor=m,w(E,S.prototype),E.isPureReactComponent=!0;var R=Array.isArray;function L(){}var D={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function B(M,U,V){var ae=V.ref;return{$$typeof:i,type:M,key:U,ref:ae!==void 0?ae:null,props:V}}function W(M,U){return B(M.type,U,M.props)}function P(M){return typeof M=="object"&&M!==null&&M.$$typeof===i}function F(M){var U={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(V){return U[V]})}var I=/\/+/g;function Z(M,U){return typeof M=="object"&&M!==null&&M.key!=null?F(""+M.key):U.toString(36)}function ee(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(L,L):(M.status="pending",M.then(function(U){M.status==="pending"&&(M.status="fulfilled",M.value=U)},function(U){M.status==="pending"&&(M.status="rejected",M.reason=U)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function j(M,U,V,ae,ce){var me=typeof M;(me==="undefined"||me==="boolean")&&(M=null);var Q=!1;if(M===null)Q=!0;else switch(me){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(M.$$typeof){case i:case n:Q=!0;break;case v:return Q=M._init,j(Q(M._payload),U,V,ae,ce)}}if(Q)return ce=ce(M),Q=ae===""?"."+Z(M,0):ae,R(ce)?(V="",Q!=null&&(V=Q.replace(I,"$&/")+"/"),j(ce,U,V,"",function(pe){return pe})):ce!=null&&(P(ce)&&(ce=W(ce,V+(ce.key==null||M&&M.key===ce.key?"":(""+ce.key).replace(I,"$&/")+"/")+Q)),U.push(ce)),1;Q=0;var $=ae===""?".":ae+":";if(R(M))for(var oe=0;oe<M.length;oe++)ae=M[oe],me=$+Z(ae,oe),Q+=j(ae,U,V,me,ce);else if(oe=x(M),typeof oe=="function")for(M=oe.call(M),oe=0;!(ae=M.next()).done;)ae=ae.value,me=$+Z(ae,oe++),Q+=j(ae,U,V,me,ce);else if(me==="object"){if(typeof M.then=="function")return j(ee(M),U,V,ae,ce);throw U=String(M),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Q}function Y(M,U,V){if(M==null)return M;var ae=[],ce=0;return j(M,ae,"","",function(me){return U.call(V,me,ce++)}),ae}function K(M){if(M._status===-1){var U=M._result;U=U(),U.then(function(V){(M._status===0||M._status===-1)&&(M._status=1,M._result=V)},function(V){(M._status===0||M._status===-1)&&(M._status=2,M._result=V)}),M._status===-1&&(M._status=0,M._result=U)}if(M._status===1)return M._result.default;throw M._result}var O=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},H={map:Y,forEach:function(M,U,V){Y(M,function(){U.apply(this,arguments)},V)},count:function(M){var U=0;return Y(M,function(){U++}),U},toArray:function(M){return Y(M,function(U){return U})||[]},only:function(M){if(!P(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Pe.Activity=f,Pe.Children=H,Pe.Component=S,Pe.Fragment=s,Pe.Profiler=l,Pe.PureComponent=m,Pe.StrictMode=o,Pe.Suspense=u,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(M){return D.H.useMemoCache(M)}},Pe.cache=function(M){return function(){return M.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(M,U,V){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ae=w({},M.props),ce=M.key;if(U!=null)for(me in U.key!==void 0&&(ce=""+U.key),U)!T.call(U,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&U.ref===void 0||(ae[me]=U[me]);var me=arguments.length-2;if(me===1)ae.children=V;else if(1<me){for(var Q=Array(me),$=0;$<me;$++)Q[$]=arguments[$+2];ae.children=Q}return B(M.type,ce,ae)},Pe.createContext=function(M){return M={$$typeof:b,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:y,_context:M},M},Pe.createElement=function(M,U,V){var ae,ce={},me=null;if(U!=null)for(ae in U.key!==void 0&&(me=""+U.key),U)T.call(U,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=U[ae]);var Q=arguments.length-2;if(Q===1)ce.children=V;else if(1<Q){for(var $=Array(Q),oe=0;oe<Q;oe++)$[oe]=arguments[oe+2];ce.children=$}if(M&&M.defaultProps)for(ae in Q=M.defaultProps,Q)ce[ae]===void 0&&(ce[ae]=Q[ae]);return B(M,me,ce)},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(M){return{$$typeof:c,render:M}},Pe.isValidElement=P,Pe.lazy=function(M){return{$$typeof:v,_payload:{_status:-1,_result:M},_init:K}},Pe.memo=function(M,U){return{$$typeof:h,type:M,compare:U===void 0?null:U}},Pe.startTransition=function(M){var U=D.T,V={};D.T=V;try{var ae=M(),ce=D.S;ce!==null&&ce(V,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(L,O)}catch(me){O(me)}finally{U!==null&&V.types!==null&&(U.types=V.types),D.T=U}},Pe.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Pe.use=function(M){return D.H.use(M)},Pe.useActionState=function(M,U,V){return D.H.useActionState(M,U,V)},Pe.useCallback=function(M,U){return D.H.useCallback(M,U)},Pe.useContext=function(M){return D.H.useContext(M)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(M,U){return D.H.useDeferredValue(M,U)},Pe.useEffect=function(M,U){return D.H.useEffect(M,U)},Pe.useEffectEvent=function(M){return D.H.useEffectEvent(M)},Pe.useId=function(){return D.H.useId()},Pe.useImperativeHandle=function(M,U,V){return D.H.useImperativeHandle(M,U,V)},Pe.useInsertionEffect=function(M,U){return D.H.useInsertionEffect(M,U)},Pe.useLayoutEffect=function(M,U){return D.H.useLayoutEffect(M,U)},Pe.useMemo=function(M,U){return D.H.useMemo(M,U)},Pe.useOptimistic=function(M,U){return D.H.useOptimistic(M,U)},Pe.useReducer=function(M,U,V){return D.H.useReducer(M,U,V)},Pe.useRef=function(M){return D.H.useRef(M)},Pe.useState=function(M){return D.H.useState(M)},Pe.useSyncExternalStore=function(M,U,V){return D.H.useSyncExternalStore(M,U,V)},Pe.useTransition=function(){return D.H.useTransition()},Pe.version="19.2.7",Pe}var $m;function Af(){return $m||($m=1,_d.exports=P1()),_d.exports}var ie=Af(),pd={exports:{}},Bo={},gd={exports:{}},md={};var Um;function j1(){return Um||(Um=1,(function(i){function n(j,Y){var K=j.length;j.push(Y);e:for(;0<K;){var O=K-1>>>1,H=j[O];if(0<l(H,Y))j[O]=Y,j[K]=H,K=O;else break e}}function s(j){return j.length===0?null:j[0]}function o(j){if(j.length===0)return null;var Y=j[0],K=j.pop();if(K!==Y){j[0]=K;e:for(var O=0,H=j.length,M=H>>>1;O<M;){var U=2*(O+1)-1,V=j[U],ae=U+1,ce=j[ae];if(0>l(V,K))ae<H&&0>l(ce,V)?(j[O]=ce,j[ae]=K,O=ae):(j[O]=V,j[U]=K,O=U);else if(ae<H&&0>l(ce,K))j[O]=ce,j[ae]=K,O=ae;else break e}}return Y}function l(j,Y){var K=j.sortIndex-Y.sortIndex;return K!==0?K:j.id-Y.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var y=performance;i.unstable_now=function(){return y.now()}}else{var b=Date,c=b.now();i.unstable_now=function(){return b.now()-c}}var u=[],h=[],v=1,f=null,C=3,x=!1,A=!1,w=!1,_=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;function E(j){for(var Y=s(h);Y!==null;){if(Y.callback===null)o(h);else if(Y.startTime<=j)o(h),Y.sortIndex=Y.expirationTime,n(u,Y);else break;Y=s(h)}}function R(j){if(w=!1,E(j),!A)if(s(u)!==null)A=!0,L||(L=!0,F());else{var Y=s(h);Y!==null&&ee(R,Y.startTime-j)}}var L=!1,D=-1,T=5,B=-1;function W(){return _?!0:!(i.unstable_now()-B<T)}function P(){if(_=!1,L){var j=i.unstable_now();B=j;var Y=!0;try{e:{A=!1,w&&(w=!1,p(D),D=-1),x=!0;var K=C;try{t:{for(E(j),f=s(u);f!==null&&!(f.expirationTime>j&&W());){var O=f.callback;if(typeof O=="function"){f.callback=null,C=f.priorityLevel;var H=O(f.expirationTime<=j);if(j=i.unstable_now(),typeof H=="function"){f.callback=H,E(j),Y=!0;break t}f===s(u)&&o(u),E(j)}else o(u);f=s(u)}if(f!==null)Y=!0;else{var M=s(h);M!==null&&ee(R,M.startTime-j),Y=!1}}break e}finally{f=null,C=K,x=!1}Y=void 0}}finally{Y?F():L=!1}}}var F;if(typeof m=="function")F=function(){m(P)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,Z=I.port2;I.port1.onmessage=P,F=function(){Z.postMessage(null)}}else F=function(){S(P,0)};function ee(j,Y){D=S(function(){j(i.unstable_now())},Y)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(j){j.callback=null},i.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<j?Math.floor(1e3/j):5},i.unstable_getCurrentPriorityLevel=function(){return C},i.unstable_next=function(j){switch(C){case 1:case 2:case 3:var Y=3;break;default:Y=C}var K=C;C=Y;try{return j()}finally{C=K}},i.unstable_requestPaint=function(){_=!0},i.unstable_runWithPriority=function(j,Y){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var K=C;C=j;try{return Y()}finally{C=K}},i.unstable_scheduleCallback=function(j,Y,K){var O=i.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?O+K:O):K=O,j){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=K+H,j={id:v++,callback:Y,priorityLevel:j,startTime:K,expirationTime:H,sortIndex:-1},K>O?(j.sortIndex=K,n(h,j),s(u)===null&&j===s(h)&&(w?(p(D),D=-1):w=!0,ee(R,K-O))):(j.sortIndex=H,n(u,j),A||x||(A=!0,L||(L=!0,F()))),j},i.unstable_shouldYield=W,i.unstable_wrapCallback=function(j){var Y=C;return function(){var K=C;C=Y;try{return j.apply(this,arguments)}finally{C=K}}}})(md)),md}var Pm;function F1(){return Pm||(Pm=1,gd.exports=j1()),gd.exports}var vd={exports:{}},Ri={};var jm;function q1(){if(jm)return Ri;jm=1;var i=Af();function n(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var o={d:{f:s,r:function(){throw Error(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},l=Symbol.for("react.portal");function y(u,h,v){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:f==null?null:""+f,children:u,containerInfo:h,implementation:v}}var b=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ri.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Ri.createPortal=function(u,h){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return y(u,h,null,v)},Ri.flushSync=function(u){var h=b.T,v=o.p;try{if(b.T=null,o.p=2,u)return u()}finally{b.T=h,o.p=v,o.d.f()}},Ri.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(u,h))},Ri.prefetchDNS=function(u){typeof u=="string"&&o.d.D(u)},Ri.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var v=h.as,f=c(v,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?o.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:f,integrity:C,fetchPriority:x}):v==="script"&&o.d.X(u,{crossOrigin:f,integrity:C,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ri.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var v=c(h.as,h.crossOrigin);o.d.M(u,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(u)},Ri.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,f=c(v,h.crossOrigin);o.d.L(u,v,{crossOrigin:f,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Ri.preloadModule=function(u,h){if(typeof u=="string")if(h){var v=c(h.as,h.crossOrigin);o.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(u)},Ri.requestFormReset=function(u){o.d.r(u)},Ri.unstable_batchedUpdates=function(u,h){return u(h)},Ri.useFormState=function(u,h,v){return b.H.useFormState(u,h,v)},Ri.useFormStatus=function(){return b.H.useHostTransitionStatus()},Ri.version="19.2.7",Ri}var Fm;function W1(){if(Fm)return vd.exports;Fm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),vd.exports=q1(),vd.exports}var qm;function G1(){if(qm)return Bo;qm=1;var i=F1(),n=Af(),s=W1();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function y(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function b(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(y(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=y(e),t===null)throw Error(o(188));return t!==e?null:e}for(var r=e,a=t;;){var d=r.return;if(d===null)break;var g=d.alternate;if(g===null){if(a=d.return,a!==null){r=a;continue}break}if(d.child===g.child){for(g=d.child;g;){if(g===r)return u(d),e;if(g===a)return u(d),t;g=g.sibling}throw Error(o(188))}if(r.return!==a.return)r=d,a=g;else{for(var k=!1,N=d.child;N;){if(N===r){k=!0,r=d,a=g;break}if(N===a){k=!0,a=d,r=g;break}N=N.sibling}if(!k){for(N=g.child;N;){if(N===r){k=!0,r=g,a=d;break}if(N===a){k=!0,a=g,r=d;break}N=N.sibling}if(!k)throw Error(o(189))}}if(r.alternate!==a)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,C=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),m=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var I=Symbol.for("react.client.reference");function Z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===I?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case S:return"Profiler";case _:return"StrictMode";case R:return"Suspense";case L:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case m:return e.displayName||"Context";case p:return(e._context.displayName||"Context")+".Consumer";case E:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:Z(e.type)||"Memo";case T:t=e._payload,e=e._init;try{return Z(e(t))}catch{}}return null}var ee=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},O=[],H=-1;function M(e){return{current:e}}function U(e){0>H||(e.current=O[H],O[H]=null,H--)}function V(e,t){H++,O[H]=e.current,e.current=t}var ae=M(null),ce=M(null),me=M(null),Q=M(null);function $(e,t){switch(V(me,t),V(ce,e),V(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sm(t),e=am(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(ae),V(ae,e)}function oe(){U(ae),U(ce),U(me)}function pe(e){e.memoizedState!==null&&V(Q,e);var t=ae.current,r=am(t,e.type);t!==r&&(V(ce,e),V(ae,r))}function Se(e){ce.current===e&&(U(ae),U(ce)),Q.current===e&&(U(Q),Lo._currentValue=K)}var be,ze;function je(e){if(be===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||"",ze=-1<r.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+be+e+ze}var Ke=!1;function Ct(e,t){if(!e||Ke)return"";Ke=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(le){var se=le}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(le){se=le}e.call(fe.prototype)}}else{try{throw Error()}catch(le){se=le}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(le){if(le&&se&&typeof le.stack=="string")return[le.stack,se.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=a.DetermineComponentFrameRoot(),k=g[0],N=g[1];if(k&&N){var G=k.split(`
4
+ `),re=N.split(`
5
+ `);for(d=a=0;a<G.length&&!G[a].includes("DetermineComponentFrameRoot");)a++;for(;d<re.length&&!re[d].includes("DetermineComponentFrameRoot");)d++;if(a===G.length||d===re.length)for(a=G.length-1,d=re.length-1;1<=a&&0<=d&&G[a]!==re[d];)d--;for(;1<=a&&0<=d;a--,d--)if(G[a]!==re[d]){if(a!==1||d!==1)do if(a--,d--,0>d||G[a]!==re[d]){var ue=`
6
+ `+G[a].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=a&&0<=d);break}}}finally{Ke=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?je(r):""}function Oe(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je("Lazy");case 13:return e.child!==t&&t!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return Ct(e.type,!1);case 11:return Ct(e.type.render,!1);case 1:return Ct(e.type,!0);case 31:return je("Activity");default:return""}}function Qt(e){try{var t="",r=null;do t+=Oe(e,r),r=e,e=e.return;while(e);return t}catch(a){return`
7
+ Error generating stack: `+a.message+`
8
+ `+a.stack}}var gi=Object.prototype.hasOwnProperty,mi=i.unstable_scheduleCallback,un=i.unstable_cancelCallback,Tn=i.unstable_shouldYield,Jt=i.unstable_requestPaint,lt=i.unstable_now,Gt=i.unstable_getCurrentPriorityLevel,It=i.unstable_ImmediatePriority,Ht=i.unstable_UserBlockingPriority,ei=i.unstable_NormalPriority,An=i.unstable_LowPriority,Ti=i.unstable_IdlePriority,Xi=i.log,ut=i.unstable_setDisableYieldValue,Ii=null,Kt=null;function Yt(e){if(typeof Xi=="function"&&ut(e),Kt&&typeof Kt.setStrictMode=="function")try{Kt.setStrictMode(Ii,e)}catch{}}var zt=Math.clz32?Math.clz32:Ps,us=Math.log,er=Math.LN2;function Ps(e){return e>>>=0,e===0?32:31-(us(e)/er|0)|0}var Rn=256,Pn=262144,tr=4194304;function ti(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function X(e,t,r){var a=e.pendingLanes;if(a===0)return 0;var d=0,g=e.suspendedLanes,k=e.pingedLanes;e=e.warmLanes;var N=a&134217727;return N!==0?(a=N&~g,a!==0?d=ti(a):(k&=N,k!==0?d=ti(k):r||(r=N&~e,r!==0&&(d=ti(r))))):(N=a&~g,N!==0?d=ti(N):k!==0?d=ti(k):r||(r=a&~e,r!==0&&(d=ti(r)))),d===0?0:t!==0&&t!==d&&(t&g)===0&&(g=d&-d,r=t&-t,g>=r||g===32&&(r&4194048)!==0)?t:d}function he(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ve(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ne(){var e=tr;return tr<<=1,(tr&62914560)===0&&(tr=4194304),e}function St(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ee(e,t,r,a,d,g){var k=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var N=e.entanglements,G=e.expirationTimes,re=e.hiddenUpdates;for(r=k&~r;0<r;){var ue=31-zt(r),fe=1<<ue;N[ue]=0,G[ue]=-1;var se=re[ue];if(se!==null)for(re[ue]=null,ue=0;ue<se.length;ue++){var le=se[ue];le!==null&&(le.lane&=-536870913)}r&=~fe}a!==0&&Ce(e,a,0),g!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=g&~(k&~t))}function Ce(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-zt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|r&261930}function Ie(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var a=31-zt(r),d=1<<a;d&t|e[a]&t&&(e[a]|=t),r&=~d}}function Bt(e,t){var r=t&-t;return r=(r&42)!==0?1:Qe(r),(r&(e.suspendedLanes|t))!==0?0:r}function Qe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function vi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ir(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Lm(e.type))}function nr(e,t){var r=Y.p;try{return Y.p=e,t()}finally{Y.p=r}}var Hi=Math.random().toString(36).slice(2),xt="__reactFiber$"+Hi,wt="__reactProps$"+Hi,Ln="__reactContainer$"+Hi,Mr="__reactEvents$"+Hi,js="__reactListeners$"+Hi,rr="__reactHandles$"+Hi,hs="__reactResources$"+Hi,jn="__reactMarker$"+Hi;function Me(e){delete e[xt],delete e[wt],delete e[Mr],delete e[js],delete e[rr]}function q(e){var t=e[xt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ln]||r[xt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=fm(e);e!==null;){if(r=e[xt])return r;e=fm(e)}return t}e=r,r=e.parentNode}return null}function _e(e){if(e=e[xt]||e[Ln]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function we(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function it(e){var t=e[hs];return t||(t=e[hs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ye(e){e[jn]=!0}var Tt=new Set,$t={};function Ut(e,t){ge(e,t),ge(e+"Capture",t)}function ge(e,t){for($t[e]=t,e=0;e<t.length;e++)Tt.add(t[e])}var Le=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]*$"),De={},rt={};function Mt(e){return gi.call(rt,e)?!0:gi.call(De,e)?!1:Le.test(e)?rt[e]=!0:(De[e]=!0,!1)}function Ai(e,t,r){if(Mt(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function Zi(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function zi(e,t,r,a){if(a===null)e.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+a)}}function Et(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qi(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cl(e,t,r){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var d=a.get,g=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(k){r=""+k,g.call(this,k)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(k){r=""+k},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fs(e){if(!e._valueTracker){var t=Qi(e)?"checked":"value";e._valueTracker=cl(e,t,""+e[t])}}function Pa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=Qi(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function qs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var du=/[\n"\\]/g;function $i(e){return e.replace(du,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ja(e,t,r,a,d,g,k,N){e.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.type=k:e.removeAttribute("type"),t!=null?k==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Et(t)):e.value!==""+Et(t)&&(e.value=""+Et(t)):k!=="submit"&&k!=="reset"||e.removeAttribute("value"),t!=null?Ws(e,k,Et(t)):r!=null?Ws(e,k,Et(r)):a!=null&&e.removeAttribute("value"),d==null&&g!=null&&(e.defaultChecked=!!g),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Et(N):e.removeAttribute("name")}function ds(e,t,r,a,d,g,k,N){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.type=g),t!=null||r!=null){if(!(g!=="submit"&&g!=="reset"||t!=null)){Fs(e);return}r=r!=null?""+Et(r):"",t=t!=null?""+Et(t):r,N||t===e.value||(e.value=t),e.defaultValue=t}a=a??d,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=N?e.checked:!!a,e.defaultChecked=!!a,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(e.name=k),Fs(e)}function Ws(e,t,r){t==="number"&&qs(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function bi(e,t,r,a){if(e=e.options,t){t={};for(var d=0;d<r.length;d++)t["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=t.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&a&&(e[r].defaultSelected=!0)}else{for(r=""+Et(r),t=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,a&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function ul(e,t,r){if(t!=null&&(t=""+Et(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+Et(r):""}function Gs(e,t,r,a){if(t==null){if(a!=null){if(r!=null)throw Error(o(92));if(ee(a)){if(1<a.length)throw Error(o(93));a=a[0]}r=a}r==null&&(r=""),t=r}r=Et(t),e.defaultValue=r,a=e.textContent,a===r&&a!==""&&a!==null&&(e.value=a),Fs(e)}function $e(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var hl=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 ii(e,t,r){var a=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,r):typeof r!="number"||r===0||hl.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function dt(e,t,r){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,r!=null){for(var a in r)!r.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var d in t)a=t[d],t.hasOwnProperty(d)&&r[d]!==a&&ii(e,d,a)}else for(var g in t)t.hasOwnProperty(g)&&ii(e,g,t[g])}function Dr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var sr=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"]]),Fa=/^[\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 Or(e){return Fa.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ye(){}var Ae=null;function Fe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Je=null,Nt=null;function hn(e){var t=_e(e);if(t&&(e=t.stateNode)){var r=e[wt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ja(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+$i(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var a=r[t];if(a!==e&&a.form===e.form){var d=a[wt]||null;if(!d)throw Error(o(90));ja(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<r.length;t++)a=r[t],a.form===e.form&&Pa(a)}break e;case"textarea":ul(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&bi(e,!!r.multiple,t,!1)}}}var qa=!1;function dl(e,t,r){if(qa)return e(t,r);qa=!0;try{var a=e(t);return a}finally{if(qa=!1,(Je!==null||Nt!==null)&&(Jl(),Je&&(t=Je,e=Nt,Nt=Je=null,hn(t),e)))for(t=0;t<e.length;t++)hn(e[t])}}function Wa(e,t){var r=e.stateNode;if(r===null)return null;var a=r[wt]||null;if(a===null)return null;r=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(o(231,t,typeof r));return r}var ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fu=!1;if(ar)try{var Ga={};Object.defineProperty(Ga,"passive",{get:function(){fu=!0}}),window.addEventListener("test",Ga,Ga),window.removeEventListener("test",Ga,Ga)}catch{fu=!1}var Br=null,_u=null,fl=null;function a_(){if(fl)return fl;var e,t=_u,r=t.length,a,d="value"in Br?Br.value:Br.textContent,g=d.length;for(e=0;e<r&&t[e]===d[e];e++);var k=r-e;for(a=1;a<=k&&t[r-a]===d[g-a];a++);return fl=d.slice(e,1<a?1-a:void 0)}function _l(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pl(){return!0}function o_(){return!1}function Ui(e){function t(r,a,d,g,k){this._reactName=r,this._targetInst=d,this.type=a,this.nativeEvent=g,this.target=k,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(r=e[N],this[N]=r?r(g):g[N]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?pl:o_,this.isPropagationStopped=o_,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=pl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=pl)},persist:function(){},isPersistent:pl}),t}var fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gl=Ui(fs),Ka=f({},fs,{view:0,detail:0}),IS=Ui(Ka),pu,gu,Ya,ml=f({},Ka,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ya&&(Ya&&e.type==="mousemove"?(pu=e.screenX-Ya.screenX,gu=e.screenY-Ya.screenY):gu=pu=0,Ya=e),pu)},movementY:function(e){return"movementY"in e?e.movementY:gu}}),l_=Ui(ml),HS=f({},ml,{dataTransfer:0}),zS=Ui(HS),$S=f({},Ka,{relatedTarget:0}),mu=Ui($S),US=f({},fs,{animationName:0,elapsedTime:0,pseudoElement:0}),PS=Ui(US),jS=f({},fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),FS=Ui(jS),qS=f({},fs,{data:0}),c_=Ui(qS),WS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},GS={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"},KS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=KS[e])?!!t[e]:!1}function vu(){return YS}var VS=f({},Ka,{key:function(e){if(e.key){var t=WS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_l(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?GS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(e){return e.type==="keypress"?_l(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_l(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),XS=Ui(VS),ZS=f({},ml,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),u_=Ui(ZS),QS=f({},Ka,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),JS=Ui(QS),ey=f({},fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),ty=Ui(ey),iy=f({},ml,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ny=Ui(iy),ry=f({},fs,{newState:0,oldState:0}),sy=Ui(ry),ay=[9,13,27,32],bu=ar&&"CompositionEvent"in window,Va=null;ar&&"documentMode"in document&&(Va=document.documentMode);var oy=ar&&"TextEvent"in window&&!Va,h_=ar&&(!bu||Va&&8<Va&&11>=Va),d_=" ",f_=!1;function __(e,t){switch(e){case"keyup":return ay.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function p_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function ly(e,t){switch(e){case"compositionend":return p_(t);case"keypress":return t.which!==32?null:(f_=!0,d_);case"textInput":return e=t.data,e===d_&&f_?null:e;default:return null}}function cy(e,t){if(Ks)return e==="compositionend"||!bu&&__(e,t)?(e=a_(),fl=_u=Br=null,Ks=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return h_&&t.locale!=="ko"?null:t.data;default:return null}}var uy={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 g_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uy[e.type]:t==="textarea"}function m_(e,t,r,a){Je?Nt?Nt.push(a):Nt=[a]:Je=a,t=ac(t,"onChange"),0<t.length&&(r=new gl("onChange","change",null,r,a),e.push({event:r,listeners:t}))}var Xa=null,Za=null;function hy(e){Jg(e,0)}function vl(e){var t=we(e);if(Pa(t))return e}function v_(e,t){if(e==="change")return t}var b_=!1;if(ar){var Su;if(ar){var yu="oninput"in document;if(!yu){var S_=document.createElement("div");S_.setAttribute("oninput","return;"),yu=typeof S_.oninput=="function"}Su=yu}else Su=!1;b_=Su&&(!document.documentMode||9<document.documentMode)}function y_(){Xa&&(Xa.detachEvent("onpropertychange",C_),Za=Xa=null)}function C_(e){if(e.propertyName==="value"&&vl(Za)){var t=[];m_(t,Za,e,Fe(e)),dl(hy,t)}}function dy(e,t,r){e==="focusin"?(y_(),Xa=t,Za=r,Xa.attachEvent("onpropertychange",C_)):e==="focusout"&&y_()}function fy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vl(Za)}function _y(e,t){if(e==="click")return vl(t)}function py(e,t){if(e==="input"||e==="change")return vl(t)}function gy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ji=typeof Object.is=="function"?Object.is:gy;function Qa(e,t){if(Ji(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var d=r[a];if(!gi.call(t,d)||!Ji(e[d],t[d]))return!1}return!0}function w_(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function E_(e,t){var r=w_(e);e=0;for(var a;r;){if(r.nodeType===3){if(a=e+r.textContent.length,e<=t&&a>=t)return{node:r,offset:t-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=w_(r)}}function x_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?x_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function T_(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qs(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=qs(e.document)}return t}function Cu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var my=ar&&"documentMode"in document&&11>=document.documentMode,Ys=null,wu=null,Ja=null,Eu=!1;function A_(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Eu||Ys==null||Ys!==qs(a)||(a=Ys,"selectionStart"in a&&Cu(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ja&&Qa(Ja,a)||(Ja=a,a=ac(wu,"onSelect"),0<a.length&&(t=new gl("onSelect","select",null,t,r),e.push({event:t,listeners:a}),t.target=Ys)))}function _s(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Vs={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionrun:_s("Transition","TransitionRun"),transitionstart:_s("Transition","TransitionStart"),transitioncancel:_s("Transition","TransitionCancel"),transitionend:_s("Transition","TransitionEnd")},xu={},R_={};ar&&(R_=document.createElement("div").style,"AnimationEvent"in window||(delete Vs.animationend.animation,delete Vs.animationiteration.animation,delete Vs.animationstart.animation),"TransitionEvent"in window||delete Vs.transitionend.transition);function ps(e){if(xu[e])return xu[e];if(!Vs[e])return e;var t=Vs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in R_)return xu[e]=t[r];return e}var L_=ps("animationend"),k_=ps("animationiteration"),M_=ps("animationstart"),vy=ps("transitionrun"),by=ps("transitionstart"),Sy=ps("transitioncancel"),D_=ps("transitionend"),O_=new Map,Tu="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(" ");Tu.push("scrollEnd");function kn(e,t){O_.set(e,t),Ut(t,[e])}var bl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},dn=[],Xs=0,Au=0;function Sl(){for(var e=Xs,t=Au=Xs=0;t<e;){var r=dn[t];dn[t++]=null;var a=dn[t];dn[t++]=null;var d=dn[t];dn[t++]=null;var g=dn[t];if(dn[t++]=null,a!==null&&d!==null){var k=a.pending;k===null?d.next=d:(d.next=k.next,k.next=d),a.pending=d}g!==0&&B_(r,d,g)}}function yl(e,t,r,a){dn[Xs++]=e,dn[Xs++]=t,dn[Xs++]=r,dn[Xs++]=a,Au|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Ru(e,t,r,a){return yl(e,t,r,a),Cl(e)}function gs(e,t){return yl(e,null,null,t),Cl(e)}function B_(e,t,r){e.lanes|=r;var a=e.alternate;a!==null&&(a.lanes|=r);for(var d=!1,g=e.return;g!==null;)g.childLanes|=r,a=g.alternate,a!==null&&(a.childLanes|=r),g.tag===22&&(e=g.stateNode,e===null||e._visibility&1||(d=!0)),e=g,g=g.return;return e.tag===3?(g=e.stateNode,d&&t!==null&&(d=31-zt(r),e=g.hiddenUpdates,a=e[d],a===null?e[d]=[t]:a.push(t),t.lane=r|536870912),g):null}function Cl(e){if(50<Co)throw Co=0,Hh=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zs={};function yy(e,t,r,a){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(e,t,r,a){return new yy(e,t,r,a)}function Lu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function or(e,t){var r=e.alternate;return r===null?(r=en(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function N_(e,t){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function wl(e,t,r,a,d,g){var k=0;if(a=e,typeof e=="function")Lu(e)&&(k=1);else if(typeof e=="string")k=T1(e,r,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=en(31,r,t,d),e.elementType=B,e.lanes=g,e;case w:return ms(r.children,d,g,t);case _:k=8,d|=24;break;case S:return e=en(12,r,t,d|2),e.elementType=S,e.lanes=g,e;case R:return e=en(13,r,t,d),e.elementType=R,e.lanes=g,e;case L:return e=en(19,r,t,d),e.elementType=L,e.lanes=g,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case m:k=10;break e;case p:k=9;break e;case E:k=11;break e;case D:k=14;break e;case T:k=16,a=null;break e}k=29,r=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=en(k,r,t,d),t.elementType=e,t.type=a,t.lanes=g,t}function ms(e,t,r,a){return e=en(7,e,a,t),e.lanes=r,e}function ku(e,t,r){return e=en(6,e,null,t),e.lanes=r,e}function I_(e){var t=en(18,null,null,0);return t.stateNode=e,t}function Mu(e,t,r){return t=en(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var H_=new WeakMap;function fn(e,t){if(typeof e=="object"&&e!==null){var r=H_.get(e);return r!==void 0?r:(t={value:e,source:t,stack:Qt(t)},H_.set(e,t),t)}return{value:e,source:t,stack:Qt(t)}}var Qs=[],Js=0,El=null,eo=0,_n=[],pn=0,Nr=null,Fn=1,qn="";function lr(e,t){Qs[Js++]=eo,Qs[Js++]=El,El=e,eo=t}function z_(e,t,r){_n[pn++]=Fn,_n[pn++]=qn,_n[pn++]=Nr,Nr=e;var a=Fn;e=qn;var d=32-zt(a)-1;a&=~(1<<d),r+=1;var g=32-zt(t)+d;if(30<g){var k=d-d%5;g=(a&(1<<k)-1).toString(32),a>>=k,d-=k,Fn=1<<32-zt(t)+d|r<<d|a,qn=g+e}else Fn=1<<g|r<<d|a,qn=e}function Du(e){e.return!==null&&(lr(e,1),z_(e,1,0))}function Ou(e){for(;e===El;)El=Qs[--Js],Qs[Js]=null,eo=Qs[--Js],Qs[Js]=null;for(;e===Nr;)Nr=_n[--pn],_n[pn]=null,qn=_n[--pn],_n[pn]=null,Fn=_n[--pn],_n[pn]=null}function $_(e,t){_n[pn++]=Fn,_n[pn++]=qn,_n[pn++]=Nr,Fn=t.id,qn=t.overflow,Nr=e}var Si=null,At=null,nt=!1,Ir=null,gn=!1,Bu=Error(o(519));function Hr(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw to(fn(t,e)),Bu}function U_(e){var t=e.stateNode,r=e.type,a=e.memoizedProps;switch(t[xt]=e,t[wt]=a,r){case"dialog":Xe("cancel",t),Xe("close",t);break;case"iframe":case"object":case"embed":Xe("load",t);break;case"video":case"audio":for(r=0;r<Eo.length;r++)Xe(Eo[r],t);break;case"source":Xe("error",t);break;case"img":case"image":case"link":Xe("error",t),Xe("load",t);break;case"details":Xe("toggle",t);break;case"input":Xe("invalid",t),ds(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Xe("invalid",t);break;case"textarea":Xe("invalid",t),Gs(t,a.value,a.defaultValue,a.children)}r=a.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||a.suppressHydrationWarning===!0||nm(t.textContent,r)?(a.popover!=null&&(Xe("beforetoggle",t),Xe("toggle",t)),a.onScroll!=null&&Xe("scroll",t),a.onScrollEnd!=null&&Xe("scrollend",t),a.onClick!=null&&(t.onclick=ye),t=!0):t=!1,t||Hr(e,!0)}function P_(e){for(Si=e.return;Si;)switch(Si.tag){case 5:case 31:case 13:gn=!1;return;case 27:case 3:gn=!0;return;default:Si=Si.return}}function ea(e){if(e!==Si)return!1;if(!nt)return P_(e),nt=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Qh(e.type,e.memoizedProps)),r=!r),r&&At&&Hr(e),P_(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));At=dm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));At=dm(e)}else t===27?(t=At,Zr(e.type)?(e=nd,nd=null,At=e):At=t):At=Si?vn(e.stateNode.nextSibling):null;return!0}function vs(){At=Si=null,nt=!1}function Nu(){var e=Ir;return e!==null&&(qi===null?qi=e:qi.push.apply(qi,e),Ir=null),e}function to(e){Ir===null?Ir=[e]:Ir.push(e)}var Iu=M(null),bs=null,cr=null;function zr(e,t,r){V(Iu,t._currentValue),t._currentValue=r}function ur(e){e._currentValue=Iu.current,U(Iu)}function Hu(e,t,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===r)break;e=e.return}}function zu(e,t,r,a){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var g=d.dependencies;if(g!==null){var k=d.child;g=g.firstContext;e:for(;g!==null;){var N=g;g=d;for(var G=0;G<t.length;G++)if(N.context===t[G]){g.lanes|=r,N=g.alternate,N!==null&&(N.lanes|=r),Hu(g.return,r,e),a||(k=null);break e}g=N.next}}else if(d.tag===18){if(k=d.return,k===null)throw Error(o(341));k.lanes|=r,g=k.alternate,g!==null&&(g.lanes|=r),Hu(k,r,e),k=null}else k=d.child;if(k!==null)k.return=d;else for(k=d;k!==null;){if(k===e){k=null;break}if(d=k.sibling,d!==null){d.return=k.return,k=d;break}k=k.return}d=k}}function ta(e,t,r,a){e=null;for(var d=t,g=!1;d!==null;){if(!g){if((d.flags&524288)!==0)g=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var k=d.alternate;if(k===null)throw Error(o(387));if(k=k.memoizedProps,k!==null){var N=d.type;Ji(d.pendingProps.value,k.value)||(e!==null?e.push(N):e=[N])}}else if(d===Q.current){if(k=d.alternate,k===null)throw Error(o(387));k.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Lo):e=[Lo])}d=d.return}e!==null&&zu(t,e,r,a),t.flags|=262144}function xl(e){for(e=e.firstContext;e!==null;){if(!Ji(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ss(e){bs=e,cr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function yi(e){return j_(bs,e)}function Tl(e,t){return bs===null&&Ss(e),j_(e,t)}function j_(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},cr===null){if(e===null)throw Error(o(308));cr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else cr=cr.next=t;return r}var Cy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},wy=i.unstable_scheduleCallback,Ey=i.unstable_NormalPriority,ni={$$typeof:m,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $u(){return{controller:new Cy,data:new Map,refCount:0}}function io(e){e.refCount--,e.refCount===0&&wy(Ey,function(){e.controller.abort()})}var no=null,Uu=0,ia=0,na=null;function xy(e,t){if(no===null){var r=no=[];Uu=0,ia=Fh(),na={status:"pending",value:void 0,then:function(a){r.push(a)}}}return Uu++,t.then(F_,F_),t}function F_(){if(--Uu===0&&no!==null){na!==null&&(na.status="fulfilled");var e=no;no=null,ia=0,na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ty(e,t){var r=[],a={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var d=0;d<r.length;d++)(0,r[d])(t)},function(d){for(a.status="rejected",a.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),a}var q_=j.S;j.S=function(e,t){Ag=lt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&xy(e,t),q_!==null&&q_(e,t)};var ys=M(null);function Pu(){var e=ys.current;return e!==null?e:yt.pooledCache}function Al(e,t){t===null?V(ys,ys.current):V(ys,t.pool)}function W_(){var e=Pu();return e===null?null:{parent:ni._currentValue,pool:e}}var ra=Error(o(460)),ju=Error(o(474)),Rl=Error(o(542)),Ll={then:function(){}};function G_(e){return e=e.status,e==="fulfilled"||e==="rejected"}function K_(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(ye,ye),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,V_(e),e;default:if(typeof t.status=="string")t.then(ye,ye);else{if(e=yt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=a}},function(a){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,V_(e),e}throw ws=t,ra}}function Cs(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(ws=r,ra):r}}var ws=null;function Y_(){if(ws===null)throw Error(o(459));var e=ws;return ws=null,e}function V_(e){if(e===ra||e===Rl)throw Error(o(483))}var sa=null,ro=0;function kl(e){var t=ro;return ro+=1,sa===null&&(sa=[]),K_(sa,e,t)}function so(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ml(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function X_(e){function t(te,J){if(e){var ne=te.deletions;ne===null?(te.deletions=[J],te.flags|=16):ne.push(J)}}function r(te,J){if(!e)return null;for(;J!==null;)t(te,J),J=J.sibling;return null}function a(te){for(var J=new Map;te!==null;)te.key!==null?J.set(te.key,te):J.set(te.index,te),te=te.sibling;return J}function d(te,J){return te=or(te,J),te.index=0,te.sibling=null,te}function g(te,J,ne){return te.index=ne,e?(ne=te.alternate,ne!==null?(ne=ne.index,ne<J?(te.flags|=67108866,J):ne):(te.flags|=67108866,J)):(te.flags|=1048576,J)}function k(te){return e&&te.alternate===null&&(te.flags|=67108866),te}function N(te,J,ne,de){return J===null||J.tag!==6?(J=ku(ne,te.mode,de),J.return=te,J):(J=d(J,ne),J.return=te,J)}function G(te,J,ne,de){var Be=ne.type;return Be===w?ue(te,J,ne.props.children,de,ne.key):J!==null&&(J.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===T&&Cs(Be)===J.type)?(J=d(J,ne.props),so(J,ne),J.return=te,J):(J=wl(ne.type,ne.key,ne.props,null,te.mode,de),so(J,ne),J.return=te,J)}function re(te,J,ne,de){return J===null||J.tag!==4||J.stateNode.containerInfo!==ne.containerInfo||J.stateNode.implementation!==ne.implementation?(J=Mu(ne,te.mode,de),J.return=te,J):(J=d(J,ne.children||[]),J.return=te,J)}function ue(te,J,ne,de,Be){return J===null||J.tag!==7?(J=ms(ne,te.mode,de,Be),J.return=te,J):(J=d(J,ne),J.return=te,J)}function fe(te,J,ne){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=ku(""+J,te.mode,ne),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return ne=wl(J.type,J.key,J.props,null,te.mode,ne),so(ne,J),ne.return=te,ne;case A:return J=Mu(J,te.mode,ne),J.return=te,J;case T:return J=Cs(J),fe(te,J,ne)}if(ee(J)||F(J))return J=ms(J,te.mode,ne,null),J.return=te,J;if(typeof J.then=="function")return fe(te,kl(J),ne);if(J.$$typeof===m)return fe(te,Tl(te,J),ne);Ml(te,J)}return null}function se(te,J,ne,de){var Be=J!==null?J.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Be!==null?null:N(te,J,""+ne,de);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:return ne.key===Be?G(te,J,ne,de):null;case A:return ne.key===Be?re(te,J,ne,de):null;case T:return ne=Cs(ne),se(te,J,ne,de)}if(ee(ne)||F(ne))return Be!==null?null:ue(te,J,ne,de,null);if(typeof ne.then=="function")return se(te,J,kl(ne),de);if(ne.$$typeof===m)return se(te,J,Tl(te,ne),de);Ml(te,ne)}return null}function le(te,J,ne,de,Be){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return te=te.get(ne)||null,N(J,te,""+de,Be);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case x:return te=te.get(de.key===null?ne:de.key)||null,G(J,te,de,Be);case A:return te=te.get(de.key===null?ne:de.key)||null,re(J,te,de,Be);case T:return de=Cs(de),le(te,J,ne,de,Be)}if(ee(de)||F(de))return te=te.get(ne)||null,ue(J,te,de,Be,null);if(typeof de.then=="function")return le(te,J,ne,kl(de),Be);if(de.$$typeof===m)return le(te,J,ne,Tl(J,de),Be);Ml(J,de)}return null}function xe(te,J,ne,de){for(var Be=null,st=null,Re=J,We=J=0,tt=null;Re!==null&&We<ne.length;We++){Re.index>We?(tt=Re,Re=null):tt=Re.sibling;var at=se(te,Re,ne[We],de);if(at===null){Re===null&&(Re=tt);break}e&&Re&&at.alternate===null&&t(te,Re),J=g(at,J,We),st===null?Be=at:st.sibling=at,st=at,Re=tt}if(We===ne.length)return r(te,Re),nt&&lr(te,We),Be;if(Re===null){for(;We<ne.length;We++)Re=fe(te,ne[We],de),Re!==null&&(J=g(Re,J,We),st===null?Be=Re:st.sibling=Re,st=Re);return nt&&lr(te,We),Be}for(Re=a(Re);We<ne.length;We++)tt=le(Re,te,We,ne[We],de),tt!==null&&(e&&tt.alternate!==null&&Re.delete(tt.key===null?We:tt.key),J=g(tt,J,We),st===null?Be=tt:st.sibling=tt,st=tt);return e&&Re.forEach(function(is){return t(te,is)}),nt&&lr(te,We),Be}function He(te,J,ne,de){if(ne==null)throw Error(o(151));for(var Be=null,st=null,Re=J,We=J=0,tt=null,at=ne.next();Re!==null&&!at.done;We++,at=ne.next()){Re.index>We?(tt=Re,Re=null):tt=Re.sibling;var is=se(te,Re,at.value,de);if(is===null){Re===null&&(Re=tt);break}e&&Re&&is.alternate===null&&t(te,Re),J=g(is,J,We),st===null?Be=is:st.sibling=is,st=is,Re=tt}if(at.done)return r(te,Re),nt&&lr(te,We),Be;if(Re===null){for(;!at.done;We++,at=ne.next())at=fe(te,at.value,de),at!==null&&(J=g(at,J,We),st===null?Be=at:st.sibling=at,st=at);return nt&&lr(te,We),Be}for(Re=a(Re);!at.done;We++,at=ne.next())at=le(Re,te,We,at.value,de),at!==null&&(e&&at.alternate!==null&&Re.delete(at.key===null?We:at.key),J=g(at,J,We),st===null?Be=at:st.sibling=at,st=at);return e&&Re.forEach(function(H1){return t(te,H1)}),nt&&lr(te,We),Be}function mt(te,J,ne,de){if(typeof ne=="object"&&ne!==null&&ne.type===w&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:e:{for(var Be=ne.key;J!==null;){if(J.key===Be){if(Be=ne.type,Be===w){if(J.tag===7){r(te,J.sibling),de=d(J,ne.props.children),de.return=te,te=de;break e}}else if(J.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===T&&Cs(Be)===J.type){r(te,J.sibling),de=d(J,ne.props),so(de,ne),de.return=te,te=de;break e}r(te,J);break}else t(te,J);J=J.sibling}ne.type===w?(de=ms(ne.props.children,te.mode,de,ne.key),de.return=te,te=de):(de=wl(ne.type,ne.key,ne.props,null,te.mode,de),so(de,ne),de.return=te,te=de)}return k(te);case A:e:{for(Be=ne.key;J!==null;){if(J.key===Be)if(J.tag===4&&J.stateNode.containerInfo===ne.containerInfo&&J.stateNode.implementation===ne.implementation){r(te,J.sibling),de=d(J,ne.children||[]),de.return=te,te=de;break e}else{r(te,J);break}else t(te,J);J=J.sibling}de=Mu(ne,te.mode,de),de.return=te,te=de}return k(te);case T:return ne=Cs(ne),mt(te,J,ne,de)}if(ee(ne))return xe(te,J,ne,de);if(F(ne)){if(Be=F(ne),typeof Be!="function")throw Error(o(150));return ne=Be.call(ne),He(te,J,ne,de)}if(typeof ne.then=="function")return mt(te,J,kl(ne),de);if(ne.$$typeof===m)return mt(te,J,Tl(te,ne),de);Ml(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,J!==null&&J.tag===6?(r(te,J.sibling),de=d(J,ne),de.return=te,te=de):(r(te,J),de=ku(ne,te.mode,de),de.return=te,te=de),k(te)):r(te,J)}return function(te,J,ne,de){try{ro=0;var Be=mt(te,J,ne,de);return sa=null,Be}catch(Re){if(Re===ra||Re===Rl)throw Re;var st=en(29,Re,null,te.mode);return st.lanes=de,st.return=te,st}}}var Es=X_(!0),Z_=X_(!1),$r=!1;function Fu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ur(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pr(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ct&2)!==0){var d=a.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),a.pending=t,t=Cl(e),B_(e,null,r),t}return yl(e,a,t,r),Cl(e)}function ao(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Ie(e,r)}}function Wu(e,t){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var d=null,g=null;if(r=r.firstBaseUpdate,r!==null){do{var k={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};g===null?d=g=k:g=g.next=k,r=r.next}while(r!==null);g===null?d=g=t:g=g.next=t}else d=g=t;r={baseState:a.baseState,firstBaseUpdate:d,lastBaseUpdate:g,shared:a.shared,callbacks:a.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Gu=!1;function oo(){if(Gu){var e=na;if(e!==null)throw e}}function lo(e,t,r,a){Gu=!1;var d=e.updateQueue;$r=!1;var g=d.firstBaseUpdate,k=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var G=N,re=G.next;G.next=null,k===null?g=re:k.next=re,k=G;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,N=ue.lastBaseUpdate,N!==k&&(N===null?ue.firstBaseUpdate=re:N.next=re,ue.lastBaseUpdate=G))}if(g!==null){var fe=d.baseState;k=0,ue=re=G=null,N=g;do{var se=N.lane&-536870913,le=se!==N.lane;if(le?(et&se)===se:(a&se)===se){se!==0&&se===ia&&(Gu=!0),ue!==null&&(ue=ue.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var xe=e,He=N;se=t;var mt=r;switch(He.tag){case 1:if(xe=He.payload,typeof xe=="function"){fe=xe.call(mt,fe,se);break e}fe=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=He.payload,se=typeof xe=="function"?xe.call(mt,fe,se):xe,se==null)break e;fe=f({},fe,se);break e;case 2:$r=!0}}se=N.callback,se!==null&&(e.flags|=64,le&&(e.flags|=8192),le=d.callbacks,le===null?d.callbacks=[se]:le.push(se))}else le={lane:se,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ue===null?(re=ue=le,G=fe):ue=ue.next=le,k|=se;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;le=N,N=le.next,le.next=null,d.lastBaseUpdate=le,d.shared.pending=null}}while(!0);ue===null&&(G=fe),d.baseState=G,d.firstBaseUpdate=re,d.lastBaseUpdate=ue,g===null&&(d.shared.lanes=0),Gr|=k,e.lanes=k,e.memoizedState=fe}}function Q_(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function J_(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Q_(r[e],t)}var aa=M(null),Dl=M(0);function ep(e,t){e=br,V(Dl,e),V(aa,t),br=e|t.baseLanes}function Ku(){V(Dl,br),V(aa,aa.current)}function Yu(){br=Dl.current,U(aa),U(Dl)}var tn=M(null),mn=null;function jr(e){var t=e.alternate;V(Vt,Vt.current&1),V(tn,e),mn===null&&(t===null||aa.current!==null||t.memoizedState!==null)&&(mn=e)}function Vu(e){V(Vt,Vt.current),V(tn,e),mn===null&&(mn=e)}function tp(e){e.tag===22?(V(Vt,Vt.current),V(tn,e),mn===null&&(mn=e)):Fr()}function Fr(){V(Vt,Vt.current),V(tn,tn.current)}function nn(e){U(tn),mn===e&&(mn=null),U(Vt)}var Vt=M(0);function Ol(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||td(r)||id(r)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var hr=0,qe=null,pt=null,ri=null,Bl=!1,oa=!1,xs=!1,Nl=0,co=0,la=null,Ay=0;function Pt(){throw Error(o(321))}function Xu(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ji(e[r],t[r]))return!1;return!0}function Zu(e,t,r,a,d,g){return hr=g,qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?zp:dh,xs=!1,g=r(a,d),xs=!1,oa&&(g=np(t,r,a,d)),ip(e),g}function ip(e){j.H=fo;var t=pt!==null&&pt.next!==null;if(hr=0,ri=pt=qe=null,Bl=!1,co=0,la=null,t)throw Error(o(300));e===null||si||(e=e.dependencies,e!==null&&xl(e)&&(si=!0))}function np(e,t,r,a){qe=e;var d=0;do{if(oa&&(la=null),co=0,oa=!1,25<=d)throw Error(o(301));if(d+=1,ri=pt=null,e.updateQueue!=null){var g=e.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}j.H=$p,g=t(r,a)}while(oa);return g}function Ry(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?uo(t):t,e=e.useState()[0],(pt!==null?pt.memoizedState:null)!==e&&(qe.flags|=1024),t}function Qu(){var e=Nl!==0;return Nl=0,e}function Ju(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function eh(e){if(Bl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bl=!1}hr=0,ri=pt=qe=null,oa=!1,co=Nl=0,la=null}function ki(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ri===null?qe.memoizedState=ri=e:ri=ri.next=e,ri}function Xt(){if(pt===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=pt.next;var t=ri===null?qe.memoizedState:ri.next;if(t!==null)ri=t,pt=e;else{if(e===null)throw qe.alternate===null?Error(o(467)):Error(o(310));pt=e,e={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},ri===null?qe.memoizedState=ri=e:ri=ri.next=e}return ri}function Il(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function uo(e){var t=co;return co+=1,la===null&&(la=[]),e=K_(la,e,t),t=qe,(ri===null?t.memoizedState:ri.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?zp:dh),e}function Hl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return uo(e);if(e.$$typeof===m)return yi(e)}throw Error(o(438,String(e)))}function th(e){var t=null,r=qe.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var a=qe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=Il(),qe.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),a=0;a<e;a++)r[a]=W;return t.index++,r}function dr(e,t){return typeof t=="function"?t(e):t}function zl(e){var t=Xt();return ih(t,pt,e)}function ih(e,t,r){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=r;var d=e.baseQueue,g=a.pending;if(g!==null){if(d!==null){var k=d.next;d.next=g.next,g.next=k}t.baseQueue=d=g,a.pending=null}if(g=e.baseState,d===null)e.memoizedState=g;else{t=d.next;var N=k=null,G=null,re=t,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(et&fe)===fe:(hr&fe)===fe){var se=re.revertLane;if(se===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===ia&&(ue=!0);else if((hr&se)===se){re=re.next,se===ia&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},G===null?(N=G=fe,k=g):G=G.next=fe,qe.lanes|=se,Gr|=se;fe=re.action,xs&&r(g,fe),g=re.hasEagerState?re.eagerState:r(g,fe)}else se={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},G===null?(N=G=se,k=g):G=G.next=se,qe.lanes|=fe,Gr|=fe;re=re.next}while(re!==null&&re!==t);if(G===null?k=g:G.next=N,!Ji(g,e.memoizedState)&&(si=!0,ue&&(r=na,r!==null)))throw r;e.memoizedState=g,e.baseState=k,e.baseQueue=G,a.lastRenderedState=g}return d===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function nh(e){var t=Xt(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var a=r.dispatch,d=r.pending,g=t.memoizedState;if(d!==null){r.pending=null;var k=d=d.next;do g=e(g,k.action),k=k.next;while(k!==d);Ji(g,t.memoizedState)||(si=!0),t.memoizedState=g,t.baseQueue===null&&(t.baseState=g),r.lastRenderedState=g}return[g,a]}function rp(e,t,r){var a=qe,d=Xt(),g=nt;if(g){if(r===void 0)throw Error(o(407));r=r()}else r=t();var k=!Ji((pt||d).memoizedState,r);if(k&&(d.memoizedState=r,si=!0),d=d.queue,ah(op.bind(null,a,d,e),[e]),d.getSnapshot!==t||k||ri!==null&&ri.memoizedState.tag&1){if(a.flags|=2048,ca(9,{destroy:void 0},ap.bind(null,a,d,r,t),null),yt===null)throw Error(o(349));g||(hr&127)!==0||sp(a,t,r)}return r}function sp(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=qe.updateQueue,t===null?(t=Il(),qe.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function ap(e,t,r,a){t.value=r,t.getSnapshot=a,lp(t)&&cp(e)}function op(e,t,r){return r(function(){lp(t)&&cp(e)})}function lp(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ji(e,r)}catch{return!0}}function cp(e){var t=gs(e,2);t!==null&&Wi(t,e,2)}function rh(e){var t=ki();if(typeof e=="function"){var r=e;if(e=r(),xs){Yt(!0);try{r()}finally{Yt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:e},t}function up(e,t,r,a){return e.baseState=r,ih(e,pt,typeof a=="function"?a:dr)}function Ly(e,t,r,a,d){if(Pl(e))throw Error(o(485));if(e=t.action,e!==null){var g={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){g.listeners.push(k)}};j.T!==null?r(!0):g.isTransition=!1,a(g),r=t.pending,r===null?(g.next=t.pending=g,hp(t,g)):(g.next=r.next,t.pending=r.next=g)}}function hp(e,t){var r=t.action,a=t.payload,d=e.state;if(t.isTransition){var g=j.T,k={};j.T=k;try{var N=r(d,a),G=j.S;G!==null&&G(k,N),dp(e,t,N)}catch(re){sh(e,t,re)}finally{g!==null&&k.types!==null&&(g.types=k.types),j.T=g}}else try{g=r(d,a),dp(e,t,g)}catch(re){sh(e,t,re)}}function dp(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(a){fp(e,t,a)},function(a){return sh(e,t,a)}):fp(e,t,r)}function fp(e,t,r){t.status="fulfilled",t.value=r,_p(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,hp(e,r)))}function sh(e,t,r){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=r,_p(t),t=t.next;while(t!==a)}e.action=null}function _p(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function pp(e,t){return t}function gp(e,t){if(nt){var r=yt.formState;if(r!==null){e:{var a=qe;if(nt){if(At){t:{for(var d=At,g=gn;d.nodeType!==8;){if(!g){d=null;break t}if(d=vn(d.nextSibling),d===null){d=null;break t}}g=d.data,d=g==="F!"||g==="F"?d:null}if(d){At=vn(d.nextSibling),a=d.data==="F!";break e}}Hr(a)}a=!1}a&&(t=r[0])}}return r=ki(),r.memoizedState=r.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pp,lastRenderedState:t},r.queue=a,r=Np.bind(null,qe,a),a.dispatch=r,a=rh(!1),g=hh.bind(null,qe,!1,a.queue),a=ki(),d={state:t,dispatch:null,action:e,pending:null},a.queue=d,r=Ly.bind(null,qe,d,g,r),d.dispatch=r,a.memoizedState=e,[t,r,!1]}function mp(e){var t=Xt();return vp(t,pt,e)}function vp(e,t,r){if(t=ih(e,t,pp)[0],e=zl(dr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=uo(t)}catch(k){throw k===ra?Rl:k}else a=t;t=Xt();var d=t.queue,g=d.dispatch;return r!==t.memoizedState&&(qe.flags|=2048,ca(9,{destroy:void 0},ky.bind(null,d,r),null)),[a,g,e]}function ky(e,t){e.action=t}function bp(e){var t=Xt(),r=pt;if(r!==null)return vp(t,r,e);Xt(),t=t.memoizedState,r=Xt();var a=r.queue.dispatch;return r.memoizedState=e,[t,a,!1]}function ca(e,t,r,a){return e={tag:e,create:r,deps:a,inst:t,next:null},t=qe.updateQueue,t===null&&(t=Il(),qe.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(a=r.next,r.next=e,e.next=a,t.lastEffect=e),e}function Sp(){return Xt().memoizedState}function $l(e,t,r,a){var d=ki();qe.flags|=e,d.memoizedState=ca(1|t,{destroy:void 0},r,a===void 0?null:a)}function Ul(e,t,r,a){var d=Xt();a=a===void 0?null:a;var g=d.memoizedState.inst;pt!==null&&a!==null&&Xu(a,pt.memoizedState.deps)?d.memoizedState=ca(t,g,r,a):(qe.flags|=e,d.memoizedState=ca(1|t,g,r,a))}function yp(e,t){$l(8390656,8,e,t)}function ah(e,t){Ul(2048,8,e,t)}function My(e){qe.flags|=4;var t=qe.updateQueue;if(t===null)t=Il(),qe.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function Cp(e){var t=Xt().memoizedState;return My({ref:t,nextImpl:e}),function(){if((ct&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function wp(e,t){return Ul(4,2,e,t)}function Ep(e,t){return Ul(4,4,e,t)}function xp(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Tp(e,t,r){r=r!=null?r.concat([e]):null,Ul(4,4,xp.bind(null,t,e),r)}function oh(){}function Ap(e,t){var r=Xt();t=t===void 0?null:t;var a=r.memoizedState;return t!==null&&Xu(t,a[1])?a[0]:(r.memoizedState=[e,t],e)}function Rp(e,t){var r=Xt();t=t===void 0?null:t;var a=r.memoizedState;if(t!==null&&Xu(t,a[1]))return a[0];if(a=e(),xs){Yt(!0);try{e()}finally{Yt(!1)}}return r.memoizedState=[a,t],a}function lh(e,t,r){return r===void 0||(hr&1073741824)!==0&&(et&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Lg(),qe.lanes|=e,Gr|=e,r)}function Lp(e,t,r,a){return Ji(r,t)?r:aa.current!==null?(e=lh(e,r,a),Ji(e,t)||(si=!0),e):(hr&42)===0||(hr&1073741824)!==0&&(et&261930)===0?(si=!0,e.memoizedState=r):(e=Lg(),qe.lanes|=e,Gr|=e,t)}function kp(e,t,r,a,d){var g=Y.p;Y.p=g!==0&&8>g?g:8;var k=j.T,N={};j.T=N,hh(e,!1,t,r);try{var G=d(),re=j.S;if(re!==null&&re(N,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ue=Ty(G,a);ho(e,t,ue,an(e))}else ho(e,t,a,an(e))}catch(fe){ho(e,t,{then:function(){},status:"rejected",reason:fe},an())}finally{Y.p=g,k!==null&&N.types!==null&&(k.types=N.types),j.T=k}}function Dy(){}function ch(e,t,r,a){if(e.tag!==5)throw Error(o(476));var d=Mp(e).queue;kp(e,d,t,K,r===null?Dy:function(){return Dp(e),r(a)})}function Mp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:K},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Dp(e){var t=Mp(e);t.next===null&&(t=e.alternate.memoizedState),ho(e,t.next.queue,{},an())}function uh(){return yi(Lo)}function Op(){return Xt().memoizedState}function Bp(){return Xt().memoizedState}function Oy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=an();e=Ur(r);var a=Pr(t,e,r);a!==null&&(Wi(a,t,r),ao(a,t,r)),t={cache:$u()},e.payload=t;return}t=t.return}}function By(e,t,r){var a=an();r={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Pl(e)?Ip(t,r):(r=Ru(e,t,r,a),r!==null&&(Wi(r,e,a),Hp(r,t,a)))}function Np(e,t,r){var a=an();ho(e,t,r,a)}function ho(e,t,r,a){var d={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Pl(e))Ip(t,d);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=t.lastRenderedReducer,g!==null))try{var k=t.lastRenderedState,N=g(k,r);if(d.hasEagerState=!0,d.eagerState=N,Ji(N,k))return yl(e,t,d,0),yt===null&&Sl(),!1}catch{}if(r=Ru(e,t,d,a),r!==null)return Wi(r,e,a),Hp(r,t,a),!0}return!1}function hh(e,t,r,a){if(a={lane:2,revertLane:Fh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Pl(e)){if(t)throw Error(o(479))}else t=Ru(e,r,a,2),t!==null&&Wi(t,e,2)}function Pl(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function Ip(e,t){oa=Bl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Hp(e,t,r){if((r&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Ie(e,r)}}var fo={readContext:yi,use:Hl,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};fo.useEffectEvent=Pt;var zp={readContext:yi,use:Hl,useCallback:function(e,t){return ki().memoizedState=[e,t===void 0?null:t],e},useContext:yi,useEffect:yp,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,$l(4194308,4,xp.bind(null,t,e),r)},useLayoutEffect:function(e,t){return $l(4194308,4,e,t)},useInsertionEffect:function(e,t){$l(4,2,e,t)},useMemo:function(e,t){var r=ki();t=t===void 0?null:t;var a=e();if(xs){Yt(!0);try{e()}finally{Yt(!1)}}return r.memoizedState=[a,t],a},useReducer:function(e,t,r){var a=ki();if(r!==void 0){var d=r(t);if(xs){Yt(!0);try{r(t)}finally{Yt(!1)}}}else d=t;return a.memoizedState=a.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},a.queue=e,e=e.dispatch=By.bind(null,qe,e),[a.memoizedState,e]},useRef:function(e){var t=ki();return e={current:e},t.memoizedState=e},useState:function(e){e=rh(e);var t=e.queue,r=Np.bind(null,qe,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:oh,useDeferredValue:function(e,t){var r=ki();return lh(r,e,t)},useTransition:function(){var e=rh(!1);return e=kp.bind(null,qe,e.queue,!0,!1),ki().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var a=qe,d=ki();if(nt){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),yt===null)throw Error(o(349));(et&127)!==0||sp(a,t,r)}d.memoizedState=r;var g={value:r,getSnapshot:t};return d.queue=g,yp(op.bind(null,a,g,e),[e]),a.flags|=2048,ca(9,{destroy:void 0},ap.bind(null,a,g,r,t),null),r},useId:function(){var e=ki(),t=yt.identifierPrefix;if(nt){var r=qn,a=Fn;r=(a&~(1<<32-zt(a)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Nl++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=Ay++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:uh,useFormState:gp,useActionState:gp,useOptimistic:function(e){var t=ki();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=hh.bind(null,qe,!0,r),r.dispatch=t,[e,t]},useMemoCache:th,useCacheRefresh:function(){return ki().memoizedState=Oy.bind(null,qe)},useEffectEvent:function(e){var t=ki(),r={impl:e};return t.memoizedState=r,function(){if((ct&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},dh={readContext:yi,use:Hl,useCallback:Ap,useContext:yi,useEffect:ah,useImperativeHandle:Tp,useInsertionEffect:wp,useLayoutEffect:Ep,useMemo:Rp,useReducer:zl,useRef:Sp,useState:function(){return zl(dr)},useDebugValue:oh,useDeferredValue:function(e,t){var r=Xt();return Lp(r,pt.memoizedState,e,t)},useTransition:function(){var e=zl(dr)[0],t=Xt().memoizedState;return[typeof e=="boolean"?e:uo(e),t]},useSyncExternalStore:rp,useId:Op,useHostTransitionStatus:uh,useFormState:mp,useActionState:mp,useOptimistic:function(e,t){var r=Xt();return up(r,pt,e,t)},useMemoCache:th,useCacheRefresh:Bp};dh.useEffectEvent=Cp;var $p={readContext:yi,use:Hl,useCallback:Ap,useContext:yi,useEffect:ah,useImperativeHandle:Tp,useInsertionEffect:wp,useLayoutEffect:Ep,useMemo:Rp,useReducer:nh,useRef:Sp,useState:function(){return nh(dr)},useDebugValue:oh,useDeferredValue:function(e,t){var r=Xt();return pt===null?lh(r,e,t):Lp(r,pt.memoizedState,e,t)},useTransition:function(){var e=nh(dr)[0],t=Xt().memoizedState;return[typeof e=="boolean"?e:uo(e),t]},useSyncExternalStore:rp,useId:Op,useHostTransitionStatus:uh,useFormState:bp,useActionState:bp,useOptimistic:function(e,t){var r=Xt();return pt!==null?up(r,pt,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:th,useCacheRefresh:Bp};$p.useEffectEvent=Cp;function fh(e,t,r,a){t=e.memoizedState,r=r(a,t),r=r==null?t:f({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var _h={enqueueSetState:function(e,t,r){e=e._reactInternals;var a=an(),d=Ur(a);d.payload=t,r!=null&&(d.callback=r),t=Pr(e,d,a),t!==null&&(Wi(t,e,a),ao(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var a=an(),d=Ur(a);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=Pr(e,d,a),t!==null&&(Wi(t,e,a),ao(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=an(),a=Ur(r);a.tag=2,t!=null&&(a.callback=t),t=Pr(e,a,r),t!==null&&(Wi(t,e,r),ao(t,e,r))}};function Up(e,t,r,a,d,g,k){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,g,k):t.prototype&&t.prototype.isPureReactComponent?!Qa(r,a)||!Qa(d,g):!0}function Pp(e,t,r,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,a),t.state!==e&&_h.enqueueReplaceState(t,t.state,null)}function Ts(e,t){var r=t;if("ref"in t){r={};for(var a in t)a!=="ref"&&(r[a]=t[a])}if(e=e.defaultProps){r===t&&(r=f({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function jp(e){bl(e)}function Fp(e){console.error(e)}function qp(e){bl(e)}function jl(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Wp(e,t,r){try{var a=e.onCaughtError;a(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function ph(e,t,r){return r=Ur(r),r.tag=3,r.payload={element:null},r.callback=function(){jl(e,t)},r}function Gp(e){return e=Ur(e),e.tag=3,e}function Kp(e,t,r,a){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var g=a.value;e.payload=function(){return d(g)},e.callback=function(){Wp(t,r,a)}}var k=r.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(e.callback=function(){Wp(t,r,a),typeof d!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var N=a.stack;this.componentDidCatch(a.value,{componentStack:N!==null?N:""})})}function Ny(e,t,r,a,d){if(r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=r.alternate,t!==null&&ta(t,r,d,!0),r=tn.current,r!==null){switch(r.tag){case 31:case 13:return mn===null?ec():r.alternate===null&&jt===0&&(jt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,a===Ll?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([a]):t.add(a),Uh(e,a,d)),!1;case 22:return r.flags|=65536,a===Ll?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([a]):r.add(a)),Uh(e,a,d)),!1}throw Error(o(435,r.tag))}return Uh(e,a,d),ec(),!1}if(nt)return t=tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,a!==Bu&&(e=Error(o(422),{cause:a}),to(fn(e,r)))):(a!==Bu&&(t=Error(o(423),{cause:a}),to(fn(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,a=fn(a,r),d=ph(e.stateNode,a,d),Wu(e,d),jt!==4&&(jt=2)),!1;var g=Error(o(520),{cause:a});if(g=fn(g,r),yo===null?yo=[g]:yo.push(g),jt!==4&&(jt=2),t===null)return!0;a=fn(a,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=ph(r.stateNode,a,e),Wu(r,e),!1;case 1:if(t=r.type,g=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Kr===null||!Kr.has(g))))return r.flags|=65536,d&=-d,r.lanes|=d,d=Gp(d),Kp(d,e,r,a),Wu(r,d),!1}r=r.return}while(r!==null);return!1}var gh=Error(o(461)),si=!1;function Ci(e,t,r,a){t.child=e===null?Z_(t,null,r,a):Es(t,e.child,r,a)}function Yp(e,t,r,a,d){r=r.render;var g=t.ref;if("ref"in a){var k={};for(var N in a)N!=="ref"&&(k[N]=a[N])}else k=a;return Ss(t),a=Zu(e,t,r,k,g,d),N=Qu(),e!==null&&!si?(Ju(e,t,d),fr(e,t,d)):(nt&&N&&Du(t),t.flags|=1,Ci(e,t,a,d),t.child)}function Vp(e,t,r,a,d){if(e===null){var g=r.type;return typeof g=="function"&&!Lu(g)&&g.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=g,Xp(e,t,g,a,d)):(e=wl(r.type,null,a,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,!Eh(e,d)){var k=g.memoizedProps;if(r=r.compare,r=r!==null?r:Qa,r(k,a)&&e.ref===t.ref)return fr(e,t,d)}return t.flags|=1,e=or(g,a),e.ref=t.ref,e.return=t,t.child=e}function Xp(e,t,r,a,d){if(e!==null){var g=e.memoizedProps;if(Qa(g,a)&&e.ref===t.ref)if(si=!1,t.pendingProps=a=g,Eh(e,d))(e.flags&131072)!==0&&(si=!0);else return t.lanes=e.lanes,fr(e,t,d)}return mh(e,t,r,a,d)}function Zp(e,t,r,a){var d=a.children,g=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(g=g!==null?g.baseLanes|r:r,e!==null){for(a=t.child=e.child,d=0;a!==null;)d=d|a.lanes|a.childLanes,a=a.sibling;a=d&~g}else a=0,t.child=null;return Qp(e,t,g,r,a)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Al(t,g!==null?g.cachePool:null),g!==null?ep(t,g):Ku(),tp(t);else return a=t.lanes=536870912,Qp(e,t,g!==null?g.baseLanes|r:r,r,a)}else g!==null?(Al(t,g.cachePool),ep(t,g),Fr(),t.memoizedState=null):(e!==null&&Al(t,null),Ku(),Fr());return Ci(e,t,d,r),t.child}function _o(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Qp(e,t,r,a,d){var g=Pu();return g=g===null?null:{parent:ni._currentValue,pool:g},t.memoizedState={baseLanes:r,cachePool:g},e!==null&&Al(t,null),Ku(),tp(t),e!==null&&ta(e,t,a,!0),t.childLanes=d,null}function Fl(e,t){return t=Wl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jp(e,t,r){return Es(t,e.child,null,r),e=Fl(t,t.pendingProps),e.flags|=2,nn(t),t.memoizedState=null,e}function Iy(e,t,r){var a=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(nt){if(a.mode==="hidden")return e=Fl(t,a),t.lanes=536870912,_o(null,e);if(Vu(t),(e=At)?(e=hm(e,gn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Nr!==null?{id:Fn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},r=I_(e),r.return=t,t.child=r,Si=t,At=null)):e=null,e===null)throw Hr(t);return t.lanes=536870912,null}return Fl(t,a)}var g=e.memoizedState;if(g!==null){var k=g.dehydrated;if(Vu(t),d)if(t.flags&256)t.flags&=-257,t=Jp(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(si||ta(e,t,r,!1),d=(r&e.childLanes)!==0,si||d){if(a=yt,a!==null&&(k=Bt(a,r),k!==0&&k!==g.retryLane))throw g.retryLane=k,gs(e,k),Wi(a,e,k),gh;ec(),t=Jp(e,t,r)}else e=g.treeContext,At=vn(k.nextSibling),Si=t,nt=!0,Ir=null,gn=!1,e!==null&&$_(t,e),t=Fl(t,a),t.flags|=4096;return t}return e=or(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ql(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(o(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function mh(e,t,r,a,d){return Ss(t),r=Zu(e,t,r,a,void 0,d),a=Qu(),e!==null&&!si?(Ju(e,t,d),fr(e,t,d)):(nt&&a&&Du(t),t.flags|=1,Ci(e,t,r,d),t.child)}function eg(e,t,r,a,d,g){return Ss(t),t.updateQueue=null,r=np(t,a,r,d),ip(e),a=Qu(),e!==null&&!si?(Ju(e,t,g),fr(e,t,g)):(nt&&a&&Du(t),t.flags|=1,Ci(e,t,r,g),t.child)}function tg(e,t,r,a,d){if(Ss(t),t.stateNode===null){var g=Zs,k=r.contextType;typeof k=="object"&&k!==null&&(g=yi(k)),g=new r(a,g),t.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=_h,t.stateNode=g,g._reactInternals=t,g=t.stateNode,g.props=a,g.state=t.memoizedState,g.refs={},Fu(t),k=r.contextType,g.context=typeof k=="object"&&k!==null?yi(k):Zs,g.state=t.memoizedState,k=r.getDerivedStateFromProps,typeof k=="function"&&(fh(t,r,k,a),g.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(k=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),k!==g.state&&_h.enqueueReplaceState(g,g.state,null),lo(t,a,g,d),oo(),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){g=t.stateNode;var N=t.memoizedProps,G=Ts(r,N);g.props=G;var re=g.context,ue=r.contextType;k=Zs,typeof ue=="object"&&ue!==null&&(k=yi(ue));var fe=r.getDerivedStateFromProps;ue=typeof fe=="function"||typeof g.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,ue||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(N||re!==k)&&Pp(t,g,a,k),$r=!1;var se=t.memoizedState;g.state=se,lo(t,a,g,d),oo(),re=t.memoizedState,N||se!==re||$r?(typeof fe=="function"&&(fh(t,r,fe,a),re=t.memoizedState),(G=$r||Up(t,r,G,a,se,re,k))?(ue||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=re),g.props=a,g.state=re,g.context=k,a=G):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{g=t.stateNode,qu(e,t),k=t.memoizedProps,ue=Ts(r,k),g.props=ue,fe=t.pendingProps,se=g.context,re=r.contextType,G=Zs,typeof re=="object"&&re!==null&&(G=yi(re)),N=r.getDerivedStateFromProps,(re=typeof N=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k!==fe||se!==G)&&Pp(t,g,a,G),$r=!1,se=t.memoizedState,g.state=se,lo(t,a,g,d),oo();var le=t.memoizedState;k!==fe||se!==le||$r||e!==null&&e.dependencies!==null&&xl(e.dependencies)?(typeof N=="function"&&(fh(t,r,N,a),le=t.memoizedState),(ue=$r||Up(t,r,ue,a,se,le,G)||e!==null&&e.dependencies!==null&&xl(e.dependencies))?(re||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(a,le,G),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(a,le,G)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||k===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=le),g.props=a,g.state=le,g.context=G,a=ue):(typeof g.componentDidUpdate!="function"||k===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),a=!1)}return g=a,ql(e,t),a=(t.flags&128)!==0,g||a?(g=t.stateNode,r=a&&typeof r.getDerivedStateFromError!="function"?null:g.render(),t.flags|=1,e!==null&&a?(t.child=Es(t,e.child,null,d),t.child=Es(t,null,r,d)):Ci(e,t,r,d),t.memoizedState=g.state,e=t.child):e=fr(e,t,d),e}function ig(e,t,r,a){return vs(),t.flags|=256,Ci(e,t,r,a),t.child}var vh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bh(e){return{baseLanes:e,cachePool:W_()}}function Sh(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=sn),e}function ng(e,t,r){var a=t.pendingProps,d=!1,g=(t.flags&128)!==0,k;if((k=g)||(k=e!==null&&e.memoizedState===null?!1:(Vt.current&2)!==0),k&&(d=!0,t.flags&=-129),k=(t.flags&32)!==0,t.flags&=-33,e===null){if(nt){if(d?jr(t):Fr(),(e=At)?(e=hm(e,gn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Nr!==null?{id:Fn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},r=I_(e),r.return=t,t.child=r,Si=t,At=null)):e=null,e===null)throw Hr(t);return id(e)?t.lanes=32:t.lanes=536870912,null}var N=a.children;return a=a.fallback,d?(Fr(),d=t.mode,N=Wl({mode:"hidden",children:N},d),a=ms(a,d,r,null),N.return=t,a.return=t,N.sibling=a,t.child=N,a=t.child,a.memoizedState=bh(r),a.childLanes=Sh(e,k,r),t.memoizedState=vh,_o(null,a)):(jr(t),yh(t,N))}var G=e.memoizedState;if(G!==null&&(N=G.dehydrated,N!==null)){if(g)t.flags&256?(jr(t),t.flags&=-257,t=Ch(e,t,r)):t.memoizedState!==null?(Fr(),t.child=e.child,t.flags|=128,t=null):(Fr(),N=a.fallback,d=t.mode,a=Wl({mode:"visible",children:a.children},d),N=ms(N,d,r,null),N.flags|=2,a.return=t,N.return=t,a.sibling=N,t.child=a,Es(t,e.child,null,r),a=t.child,a.memoizedState=bh(r),a.childLanes=Sh(e,k,r),t.memoizedState=vh,t=_o(null,a));else if(jr(t),id(N)){if(k=N.nextSibling&&N.nextSibling.dataset,k)var re=k.dgst;k=re,a=Error(o(419)),a.stack="",a.digest=k,to({value:a,source:null,stack:null}),t=Ch(e,t,r)}else if(si||ta(e,t,r,!1),k=(r&e.childLanes)!==0,si||k){if(k=yt,k!==null&&(a=Bt(k,r),a!==0&&a!==G.retryLane))throw G.retryLane=a,gs(e,a),Wi(k,e,a),gh;td(N)||ec(),t=Ch(e,t,r)}else td(N)?(t.flags|=192,t.child=e.child,t=null):(e=G.treeContext,At=vn(N.nextSibling),Si=t,nt=!0,Ir=null,gn=!1,e!==null&&$_(t,e),t=yh(t,a.children),t.flags|=4096);return t}return d?(Fr(),N=a.fallback,d=t.mode,G=e.child,re=G.sibling,a=or(G,{mode:"hidden",children:a.children}),a.subtreeFlags=G.subtreeFlags&65011712,re!==null?N=or(re,N):(N=ms(N,d,r,null),N.flags|=2),N.return=t,a.return=t,a.sibling=N,t.child=a,_o(null,a),a=t.child,N=e.child.memoizedState,N===null?N=bh(r):(d=N.cachePool,d!==null?(G=ni._currentValue,d=d.parent!==G?{parent:G,pool:G}:d):d=W_(),N={baseLanes:N.baseLanes|r,cachePool:d}),a.memoizedState=N,a.childLanes=Sh(e,k,r),t.memoizedState=vh,_o(e.child,a)):(jr(t),r=e.child,e=r.sibling,r=or(r,{mode:"visible",children:a.children}),r.return=t,r.sibling=null,e!==null&&(k=t.deletions,k===null?(t.deletions=[e],t.flags|=16):k.push(e)),t.child=r,t.memoizedState=null,r)}function yh(e,t){return t=Wl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Wl(e,t){return e=en(22,e,null,t),e.lanes=0,e}function Ch(e,t,r){return Es(t,e.child,null,r),e=yh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rg(e,t,r){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Hu(e.return,t,r)}function wh(e,t,r,a,d,g){var k=e.memoizedState;k===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:d,treeForkCount:g}:(k.isBackwards=t,k.rendering=null,k.renderingStartTime=0,k.last=a,k.tail=r,k.tailMode=d,k.treeForkCount=g)}function sg(e,t,r){var a=t.pendingProps,d=a.revealOrder,g=a.tail;a=a.children;var k=Vt.current,N=(k&2)!==0;if(N?(k=k&1|2,t.flags|=128):k&=1,V(Vt,k),Ci(e,t,a,r),a=nt?eo:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rg(e,r,t);else if(e.tag===19)rg(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=t.child,d=null;r!==null;)e=r.alternate,e!==null&&Ol(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),wh(t,!1,d,r,g,a);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Ol(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}wh(t,!0,r,null,g,a);break;case"together":wh(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function fr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Gr|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(ta(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,r=or(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=or(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Eh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&xl(e)))}function Hy(e,t,r){switch(t.tag){case 3:$(t,t.stateNode.containerInfo),zr(t,ni,e.memoizedState.cache),vs();break;case 27:case 5:pe(t);break;case 4:$(t,t.stateNode.containerInfo);break;case 10:zr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Vu(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(jr(t),t.flags|=128,null):(r&t.child.childLanes)!==0?ng(e,t,r):(jr(t),e=fr(e,t,r),e!==null?e.sibling:null);jr(t);break;case 19:var d=(e.flags&128)!==0;if(a=(r&t.childLanes)!==0,a||(ta(e,t,r,!1),a=(r&t.childLanes)!==0),d){if(a)return sg(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),V(Vt,Vt.current),a)break;return null;case 22:return t.lanes=0,Zp(e,t,r,t.pendingProps);case 24:zr(t,ni,e.memoizedState.cache)}return fr(e,t,r)}function ag(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)si=!0;else{if(!Eh(e,r)&&(t.flags&128)===0)return si=!1,Hy(e,t,r);si=(e.flags&131072)!==0}else si=!1,nt&&(t.flags&1048576)!==0&&z_(t,eo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Cs(t.elementType),t.type=e,typeof e=="function")Lu(e)?(a=Ts(e,a),t.tag=1,t=tg(null,t,e,a,r)):(t.tag=0,t=mh(null,t,e,a,r));else{if(e!=null){var d=e.$$typeof;if(d===E){t.tag=11,t=Yp(null,t,e,a,r);break e}else if(d===D){t.tag=14,t=Vp(null,t,e,a,r);break e}}throw t=Z(e)||e,Error(o(306,t,""))}}return t;case 0:return mh(e,t,t.type,t.pendingProps,r);case 1:return a=t.type,d=Ts(a,t.pendingProps),tg(e,t,a,d,r);case 3:e:{if($(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var g=t.memoizedState;d=g.element,qu(e,t),lo(t,a,null,r);var k=t.memoizedState;if(a=k.cache,zr(t,ni,a),a!==g.cache&&zu(t,[ni],r,!0),oo(),a=k.element,g.isDehydrated)if(g={element:a,isDehydrated:!1,cache:k.cache},t.updateQueue.baseState=g,t.memoizedState=g,t.flags&256){t=ig(e,t,a,r);break e}else if(a!==d){d=fn(Error(o(424)),t),to(d),t=ig(e,t,a,r);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,At=vn(e.firstChild),Si=t,nt=!0,Ir=null,gn=!0,r=Z_(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(vs(),a===d){t=fr(e,t,r);break e}Ci(e,t,a,r)}t=t.child}return t;case 26:return ql(e,t),e===null?(r=mm(t.type,null,t.pendingProps,null))?t.memoizedState=r:nt||(r=t.type,e=t.pendingProps,a=oc(me.current).createElement(r),a[xt]=t,a[wt]=e,wi(a,r,e),Ye(a),t.stateNode=a):t.memoizedState=mm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&nt&&(a=t.stateNode=_m(t.type,t.pendingProps,me.current),Si=t,gn=!0,d=At,Zr(t.type)?(nd=d,At=vn(a.firstChild)):At=d),Ci(e,t,t.pendingProps.children,r),ql(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&nt&&((d=a=At)&&(a=f1(a,t.type,t.pendingProps,gn),a!==null?(t.stateNode=a,Si=t,At=vn(a.firstChild),gn=!1,d=!0):d=!1),d||Hr(t)),pe(t),d=t.type,g=t.pendingProps,k=e!==null?e.memoizedProps:null,a=g.children,Qh(d,g)?a=null:k!==null&&Qh(d,k)&&(t.flags|=32),t.memoizedState!==null&&(d=Zu(e,t,Ry,null,null,r),Lo._currentValue=d),ql(e,t),Ci(e,t,a,r),t.child;case 6:return e===null&&nt&&((e=r=At)&&(r=_1(r,t.pendingProps,gn),r!==null?(t.stateNode=r,Si=t,At=null,e=!0):e=!1),e||Hr(t)),null;case 13:return ng(e,t,r);case 4:return $(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Es(t,null,a,r):Ci(e,t,a,r),t.child;case 11:return Yp(e,t,t.type,t.pendingProps,r);case 7:return Ci(e,t,t.pendingProps,r),t.child;case 8:return Ci(e,t,t.pendingProps.children,r),t.child;case 12:return Ci(e,t,t.pendingProps.children,r),t.child;case 10:return a=t.pendingProps,zr(t,t.type,a.value),Ci(e,t,a.children,r),t.child;case 9:return d=t.type._context,a=t.pendingProps.children,Ss(t),d=yi(d),a=a(d),t.flags|=1,Ci(e,t,a,r),t.child;case 14:return Vp(e,t,t.type,t.pendingProps,r);case 15:return Xp(e,t,t.type,t.pendingProps,r);case 19:return sg(e,t,r);case 31:return Iy(e,t,r);case 22:return Zp(e,t,r,t.pendingProps);case 24:return Ss(t),a=yi(ni),e===null?(d=Pu(),d===null&&(d=yt,g=$u(),d.pooledCache=g,g.refCount++,g!==null&&(d.pooledCacheLanes|=r),d=g),t.memoizedState={parent:a,cache:d},Fu(t),zr(t,ni,d)):((e.lanes&r)!==0&&(qu(e,t),lo(t,null,null,r),oo()),d=e.memoizedState,g=t.memoizedState,d.parent!==a?(d={parent:a,cache:a},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),zr(t,ni,a)):(a=g.cache,zr(t,ni,a),a!==d.cache&&zu(t,[ni],r,!0))),Ci(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function _r(e){e.flags|=4}function xh(e,t,r,a,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Og())e.flags|=8192;else throw ws=Ll,ju}else e.flags&=-16777217}function og(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Cm(t))if(Og())e.flags|=8192;else throw ws=Ll,ju}function Gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ne():536870912,e.lanes|=t,fa|=t)}function po(e,t){if(!nt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,a=0;if(t)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,a|=d.subtreeFlags&65011712,a|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,a|=d.subtreeFlags,a|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=a,e.childLanes=r,t}function zy(e,t,r){var a=t.pendingProps;switch(Ou(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(t),null;case 1:return Rt(t),null;case 3:return r=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ur(ni),oe(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ea(t)?_r(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nu())),Rt(t),null;case 26:var d=t.type,g=t.memoizedState;return e===null?(_r(t),g!==null?(Rt(t),og(t,g)):(Rt(t),xh(t,d,null,a,r))):g?g!==e.memoizedState?(_r(t),Rt(t),og(t,g)):(Rt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&_r(t),Rt(t),xh(t,d,e,a,r)),null;case 27:if(Se(t),r=me.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&_r(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Rt(t),null}e=ae.current,ea(t)?U_(t):(e=_m(d,a,r),t.stateNode=e,_r(t))}return Rt(t),null;case 5:if(Se(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&_r(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Rt(t),null}if(g=ae.current,ea(t))U_(t);else{var k=oc(me.current);switch(g){case 1:g=k.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:g=k.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":g=k.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":g=k.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":g=k.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof a.is=="string"?k.createElement("select",{is:a.is}):k.createElement("select"),a.multiple?g.multiple=!0:a.size&&(g.size=a.size);break;default:g=typeof a.is=="string"?k.createElement(d,{is:a.is}):k.createElement(d)}}g[xt]=t,g[wt]=a;e:for(k=t.child;k!==null;){if(k.tag===5||k.tag===6)g.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===t)break e;for(;k.sibling===null;){if(k.return===null||k.return===t)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}t.stateNode=g;e:switch(wi(g,d,a),d){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&_r(t)}}return Rt(t),xh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&_r(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=me.current,ea(t)){if(e=t.stateNode,r=t.memoizedProps,a=null,d=Si,d!==null)switch(d.tag){case 27:case 5:a=d.memoizedProps}e[xt]=t,e=!!(e.nodeValue===r||a!==null&&a.suppressHydrationWarning===!0||nm(e.nodeValue,r)),e||Hr(t,!0)}else e=oc(e).createTextNode(a),e[xt]=t,t.stateNode=e}return Rt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(a=ea(t),r!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[xt]=t}else vs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Rt(t),e=!1}else r=Nu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(nn(t),t):(nn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Rt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ea(t),a!==null&&a.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[xt]=t}else vs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Rt(t),d=!1}else d=Nu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(nn(t),t):(nn(t),null)}return nn(t),(t.flags&128)!==0?(t.lanes=r,t):(r=a!==null,e=e!==null&&e.memoizedState!==null,r&&(a=t.child,d=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(d=a.alternate.memoizedState.cachePool.pool),g=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(g=a.memoizedState.cachePool.pool),g!==d&&(a.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),Gl(t,t.updateQueue),Rt(t),null);case 4:return oe(),e===null&&Kh(t.stateNode.containerInfo),Rt(t),null;case 10:return ur(t.type),Rt(t),null;case 19:if(U(Vt),a=t.memoizedState,a===null)return Rt(t),null;if(d=(t.flags&128)!==0,g=a.rendering,g===null)if(d)po(a,!1);else{if(jt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(g=Ol(e),g!==null){for(t.flags|=128,po(a,!1),e=g.updateQueue,t.updateQueue=e,Gl(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)N_(r,e),r=r.sibling;return V(Vt,Vt.current&1|2),nt&&lr(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&lt()>Zl&&(t.flags|=128,d=!0,po(a,!1),t.lanes=4194304)}else{if(!d)if(e=Ol(g),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,Gl(t,e),po(a,!0),a.tail===null&&a.tailMode==="hidden"&&!g.alternate&&!nt)return Rt(t),null}else 2*lt()-a.renderingStartTime>Zl&&r!==536870912&&(t.flags|=128,d=!0,po(a,!1),t.lanes=4194304);a.isBackwards?(g.sibling=t.child,t.child=g):(e=a.last,e!==null?e.sibling=g:t.child=g,a.last=g)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=lt(),e.sibling=null,r=Vt.current,V(Vt,d?r&1|2:r&1),nt&&lr(t,a.treeForkCount),e):(Rt(t),null);case 22:case 23:return nn(t),Yu(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(r&536870912)!==0&&(t.flags&128)===0&&(Rt(t),t.subtreeFlags&6&&(t.flags|=8192)):Rt(t),r=t.updateQueue,r!==null&&Gl(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==r&&(t.flags|=2048),e!==null&&U(ys),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ur(ni),Rt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function $y(e,t){switch(Ou(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ur(ni),oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(nn(t),t.alternate===null)throw Error(o(340));vs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(nn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));vs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Vt),null;case 4:return oe(),null;case 10:return ur(t.type),null;case 22:case 23:return nn(t),Yu(),e!==null&&U(ys),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ur(ni),null;case 25:return null;default:return null}}function lg(e,t){switch(Ou(t),t.tag){case 3:ur(ni),oe();break;case 26:case 27:case 5:Se(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&nn(t);break;case 13:nn(t);break;case 19:U(Vt);break;case 10:ur(t.type);break;case 22:case 23:nn(t),Yu(),e!==null&&U(ys);break;case 24:ur(ni)}}function go(e,t){try{var r=t.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var d=a.next;r=d;do{if((r.tag&e)===e){a=void 0;var g=r.create,k=r.inst;a=g(),k.destroy=a}r=r.next}while(r!==d)}}catch(N){_t(t,t.return,N)}}function qr(e,t,r){try{var a=t.updateQueue,d=a!==null?a.lastEffect:null;if(d!==null){var g=d.next;a=g;do{if((a.tag&e)===e){var k=a.inst,N=k.destroy;if(N!==void 0){k.destroy=void 0,d=t;var G=r,re=N;try{re()}catch(ue){_t(d,G,ue)}}}a=a.next}while(a!==g)}}catch(ue){_t(t,t.return,ue)}}function cg(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{J_(t,r)}catch(a){_t(e,e.return,a)}}}function ug(e,t,r){r.props=Ts(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(a){_t(e,t,a)}}function mo(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof r=="function"?e.refCleanup=r(a):r.current=a}}catch(d){_t(e,t,d)}}function Wn(e,t){var r=e.ref,a=e.refCleanup;if(r!==null)if(typeof a=="function")try{a()}catch(d){_t(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){_t(e,t,d)}else r.current=null}function hg(e){var t=e.type,r=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&a.focus();break e;case"img":r.src?a.src=r.src:r.srcSet&&(a.srcset=r.srcSet)}}catch(d){_t(e,e.return,d)}}function Th(e,t,r){try{var a=e.stateNode;o1(a,e.type,r,t),a[wt]=t}catch(d){_t(e,e.return,d)}}function dg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zr(e.type)||e.tag===4}function Ah(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rh(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ye));else if(a!==4&&(a===27&&Zr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Rh(e,t,r),e=e.sibling;e!==null;)Rh(e,t,r),e=e.sibling}function Kl(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(a!==4&&(a===27&&Zr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Kl(e,t,r),e=e.sibling;e!==null;)Kl(e,t,r),e=e.sibling}function fg(e){var t=e.stateNode,r=e.memoizedProps;try{for(var a=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);wi(t,a,r),t[xt]=e,t[wt]=r}catch(g){_t(e,e.return,g)}}var pr=!1,ai=!1,Lh=!1,_g=typeof WeakSet=="function"?WeakSet:Set,hi=null;function Uy(e,t){if(e=e.containerInfo,Xh=_c,e=T_(e),Cu(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var d=a.anchorOffset,g=a.focusNode;a=a.focusOffset;try{r.nodeType,g.nodeType}catch{r=null;break e}var k=0,N=-1,G=-1,re=0,ue=0,fe=e,se=null;t:for(;;){for(var le;fe!==r||d!==0&&fe.nodeType!==3||(N=k+d),fe!==g||a!==0&&fe.nodeType!==3||(G=k+a),fe.nodeType===3&&(k+=fe.nodeValue.length),(le=fe.firstChild)!==null;)se=fe,fe=le;for(;;){if(fe===e)break t;if(se===r&&++re===d&&(N=k),se===g&&++ue===a&&(G=k),(le=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=le}r=N===-1||G===-1?null:{start:N,end:G}}else r=null}r=r||{start:0,end:0}}else r=null;for(Zh={focusedElem:e,selectionRange:r},_c=!1,hi=t;hi!==null;)if(t=hi,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,hi=e;else for(;hi!==null;){switch(t=hi,g=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&g!==null){e=void 0,r=t,d=g.memoizedProps,g=g.memoizedState,a=r.stateNode;try{var xe=Ts(r.type,d);e=a.getSnapshotBeforeUpdate(xe,g),a.__reactInternalSnapshotBeforeUpdate=e}catch(He){_t(r,r.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)ed(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ed(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,hi=e;break}hi=t.return}}function pg(e,t,r){var a=r.flags;switch(r.tag){case 0:case 11:case 15:mr(e,r),a&4&&go(5,r);break;case 1:if(mr(e,r),a&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(k){_t(r,r.return,k)}else{var d=Ts(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(k){_t(r,r.return,k)}}a&64&&cg(r),a&512&&mo(r,r.return);break;case 3:if(mr(e,r),a&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{J_(e,t)}catch(k){_t(r,r.return,k)}}break;case 27:t===null&&a&4&&fg(r);case 26:case 5:mr(e,r),t===null&&a&4&&hg(r),a&512&&mo(r,r.return);break;case 12:mr(e,r);break;case 31:mr(e,r),a&4&&vg(e,r);break;case 13:mr(e,r),a&4&&bg(e,r),a&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=Vy.bind(null,r),p1(e,r))));break;case 22:if(a=r.memoizedState!==null||pr,!a){t=t!==null&&t.memoizedState!==null||ai,d=pr;var g=ai;pr=a,(ai=t)&&!g?vr(e,r,(r.subtreeFlags&8772)!==0):mr(e,r),pr=d,ai=g}break;case 30:break;default:mr(e,r)}}function gg(e){var t=e.alternate;t!==null&&(e.alternate=null,gg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Me(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Dt=null,Pi=!1;function gr(e,t,r){for(r=r.child;r!==null;)mg(e,t,r),r=r.sibling}function mg(e,t,r){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(Ii,r)}catch{}switch(r.tag){case 26:ai||Wn(r,t),gr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:ai||Wn(r,t);var a=Dt,d=Pi;Zr(r.type)&&(Dt=r.stateNode,Pi=!1),gr(e,t,r),To(r.stateNode),Dt=a,Pi=d;break;case 5:ai||Wn(r,t);case 6:if(a=Dt,d=Pi,Dt=null,gr(e,t,r),Dt=a,Pi=d,Dt!==null)if(Pi)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(r.stateNode)}catch(g){_t(r,t,g)}else try{Dt.removeChild(r.stateNode)}catch(g){_t(r,t,g)}break;case 18:Dt!==null&&(Pi?(e=Dt,cm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),ya(e)):cm(Dt,r.stateNode));break;case 4:a=Dt,d=Pi,Dt=r.stateNode.containerInfo,Pi=!0,gr(e,t,r),Dt=a,Pi=d;break;case 0:case 11:case 14:case 15:qr(2,r,t),ai||qr(4,r,t),gr(e,t,r);break;case 1:ai||(Wn(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"&&ug(r,t,a)),gr(e,t,r);break;case 21:gr(e,t,r);break;case 22:ai=(a=ai)||r.memoizedState!==null,gr(e,t,r),ai=a;break;default:gr(e,t,r)}}function vg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ya(e)}catch(r){_t(t,t.return,r)}}}function bg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ya(e)}catch(r){_t(t,t.return,r)}}function Py(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _g),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _g),t;default:throw Error(o(435,e.tag))}}function Yl(e,t){var r=Py(e);t.forEach(function(a){if(!r.has(a)){r.add(a);var d=Xy.bind(null,e,a);a.then(d,d)}})}function ji(e,t){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var d=r[a],g=e,k=t,N=k;e:for(;N!==null;){switch(N.tag){case 27:if(Zr(N.type)){Dt=N.stateNode,Pi=!1;break e}break;case 5:Dt=N.stateNode,Pi=!1;break e;case 3:case 4:Dt=N.stateNode.containerInfo,Pi=!0;break e}N=N.return}if(Dt===null)throw Error(o(160));mg(g,k,d),Dt=null,Pi=!1,g=d.alternate,g!==null&&(g.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sg(t,e),t=t.sibling}var Mn=null;function Sg(e,t){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ji(t,e),Fi(e),a&4&&(qr(3,e,e.return),go(3,e),qr(5,e,e.return));break;case 1:ji(t,e),Fi(e),a&512&&(ai||r===null||Wn(r,r.return)),a&64&&pr&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?a:r.concat(a))));break;case 26:var d=Mn;if(ji(t,e),Fi(e),a&512&&(ai||r===null||Wn(r,r.return)),a&4){var g=r!==null?r.memoizedState:null;if(a=e.memoizedState,r===null)if(a===null)if(e.stateNode===null){e:{a=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(a){case"title":g=d.getElementsByTagName("title")[0],(!g||g[jn]||g[xt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=d.createElement(a),d.head.insertBefore(g,d.querySelector("head > title"))),wi(g,a,r),g[xt]=e,Ye(g),a=g;break e;case"link":var k=Sm("link","href",d).get(a+(r.href||""));if(k){for(var N=0;N<k.length;N++)if(g=k[N],g.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&g.getAttribute("rel")===(r.rel==null?null:r.rel)&&g.getAttribute("title")===(r.title==null?null:r.title)&&g.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){k.splice(N,1);break t}}g=d.createElement(a),wi(g,a,r),d.head.appendChild(g);break;case"meta":if(k=Sm("meta","content",d).get(a+(r.content||""))){for(N=0;N<k.length;N++)if(g=k[N],g.getAttribute("content")===(r.content==null?null:""+r.content)&&g.getAttribute("name")===(r.name==null?null:r.name)&&g.getAttribute("property")===(r.property==null?null:r.property)&&g.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&g.getAttribute("charset")===(r.charSet==null?null:r.charSet)){k.splice(N,1);break t}}g=d.createElement(a),wi(g,a,r),d.head.appendChild(g);break;default:throw Error(o(468,a))}g[xt]=e,Ye(g),a=g}e.stateNode=a}else ym(d,e.type,e.stateNode);else e.stateNode=bm(d,a,e.memoizedProps);else g!==a?(g===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):g.count--,a===null?ym(d,e.type,e.stateNode):bm(d,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Th(e,e.memoizedProps,r.memoizedProps)}break;case 27:ji(t,e),Fi(e),a&512&&(ai||r===null||Wn(r,r.return)),r!==null&&a&4&&Th(e,e.memoizedProps,r.memoizedProps);break;case 5:if(ji(t,e),Fi(e),a&512&&(ai||r===null||Wn(r,r.return)),e.flags&32){d=e.stateNode;try{$e(d,"")}catch(xe){_t(e,e.return,xe)}}a&4&&e.stateNode!=null&&(d=e.memoizedProps,Th(e,d,r!==null?r.memoizedProps:d)),a&1024&&(Lh=!0);break;case 6:if(ji(t,e),Fi(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,r=e.stateNode;try{r.nodeValue=a}catch(xe){_t(e,e.return,xe)}}break;case 3:if(uc=null,d=Mn,Mn=lc(t.containerInfo),ji(t,e),Mn=d,Fi(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{ya(t.containerInfo)}catch(xe){_t(e,e.return,xe)}Lh&&(Lh=!1,yg(e));break;case 4:a=Mn,Mn=lc(e.stateNode.containerInfo),ji(t,e),Fi(e),Mn=a;break;case 12:ji(t,e),Fi(e);break;case 31:ji(t,e),Fi(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Yl(e,a)));break;case 13:ji(t,e),Fi(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Xl=lt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Yl(e,a)));break;case 22:d=e.memoizedState!==null;var G=r!==null&&r.memoizedState!==null,re=pr,ue=ai;if(pr=re||d,ai=ue||G,ji(t,e),ai=ue,pr=re,Fi(e),a&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||G||pr||ai||As(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){G=r=t;try{if(g=G.stateNode,d)k=g.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{N=G.stateNode;var fe=G.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;N.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(xe){_t(G,G.return,xe)}}}else if(t.tag===6){if(r===null){G=t;try{G.stateNode.nodeValue=d?"":G.memoizedProps}catch(xe){_t(G,G.return,xe)}}}else if(t.tag===18){if(r===null){G=t;try{var le=G.stateNode;d?um(le,!0):um(G.stateNode,!1)}catch(xe){_t(G,G.return,xe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(r=a.retryQueue,r!==null&&(a.retryQueue=null,Yl(e,r))));break;case 19:ji(t,e),Fi(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Yl(e,a)));break;case 30:break;case 21:break;default:ji(t,e),Fi(e)}}function Fi(e){var t=e.flags;if(t&2){try{for(var r,a=e.return;a!==null;){if(dg(a)){r=a;break}a=a.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var d=r.stateNode,g=Ah(e);Kl(e,g,d);break;case 5:var k=r.stateNode;r.flags&32&&($e(k,""),r.flags&=-33);var N=Ah(e);Kl(e,N,k);break;case 3:case 4:var G=r.stateNode.containerInfo,re=Ah(e);Rh(e,re,G);break;default:throw Error(o(161))}}catch(ue){_t(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function mr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pg(e,t.alternate,t),t=t.sibling}function As(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qr(4,t,t.return),As(t);break;case 1:Wn(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&ug(t,t.return,r),As(t);break;case 27:To(t.stateNode);case 26:case 5:Wn(t,t.return),As(t);break;case 22:t.memoizedState===null&&As(t);break;case 30:As(t);break;default:As(t)}e=e.sibling}}function vr(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,d=e,g=t,k=g.flags;switch(g.tag){case 0:case 11:case 15:vr(d,g,r),go(4,g);break;case 1:if(vr(d,g,r),a=g,d=a.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(re){_t(a,a.return,re)}if(a=g,d=a.updateQueue,d!==null){var N=a.stateNode;try{var G=d.shared.hiddenCallbacks;if(G!==null)for(d.shared.hiddenCallbacks=null,d=0;d<G.length;d++)Q_(G[d],N)}catch(re){_t(a,a.return,re)}}r&&k&64&&cg(g),mo(g,g.return);break;case 27:fg(g);case 26:case 5:vr(d,g,r),r&&a===null&&k&4&&hg(g),mo(g,g.return);break;case 12:vr(d,g,r);break;case 31:vr(d,g,r),r&&k&4&&vg(d,g);break;case 13:vr(d,g,r),r&&k&4&&bg(d,g);break;case 22:g.memoizedState===null&&vr(d,g,r),mo(g,g.return);break;case 30:break;default:vr(d,g,r)}t=t.sibling}}function kh(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&io(r))}function Mh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&io(e))}function Dn(e,t,r,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Cg(e,t,r,a),t=t.sibling}function Cg(e,t,r,a){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Dn(e,t,r,a),d&2048&&go(9,t);break;case 1:Dn(e,t,r,a);break;case 3:Dn(e,t,r,a),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&io(e)));break;case 12:if(d&2048){Dn(e,t,r,a),e=t.stateNode;try{var g=t.memoizedProps,k=g.id,N=g.onPostCommit;typeof N=="function"&&N(k,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){_t(t,t.return,G)}}else Dn(e,t,r,a);break;case 31:Dn(e,t,r,a);break;case 13:Dn(e,t,r,a);break;case 23:break;case 22:g=t.stateNode,k=t.alternate,t.memoizedState!==null?g._visibility&2?Dn(e,t,r,a):vo(e,t):g._visibility&2?Dn(e,t,r,a):(g._visibility|=2,ua(e,t,r,a,(t.subtreeFlags&10256)!==0||!1)),d&2048&&kh(k,t);break;case 24:Dn(e,t,r,a),d&2048&&Mh(t.alternate,t);break;default:Dn(e,t,r,a)}}function ua(e,t,r,a,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var g=e,k=t,N=r,G=a,re=k.flags;switch(k.tag){case 0:case 11:case 15:ua(g,k,N,G,d),go(8,k);break;case 23:break;case 22:var ue=k.stateNode;k.memoizedState!==null?ue._visibility&2?ua(g,k,N,G,d):vo(g,k):(ue._visibility|=2,ua(g,k,N,G,d)),d&&re&2048&&kh(k.alternate,k);break;case 24:ua(g,k,N,G,d),d&&re&2048&&Mh(k.alternate,k);break;default:ua(g,k,N,G,d)}t=t.sibling}}function vo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,a=t,d=a.flags;switch(a.tag){case 22:vo(r,a),d&2048&&kh(a.alternate,a);break;case 24:vo(r,a),d&2048&&Mh(a.alternate,a);break;default:vo(r,a)}t=t.sibling}}var bo=8192;function ha(e,t,r){if(e.subtreeFlags&bo)for(e=e.child;e!==null;)wg(e,t,r),e=e.sibling}function wg(e,t,r){switch(e.tag){case 26:ha(e,t,r),e.flags&bo&&e.memoizedState!==null&&A1(r,Mn,e.memoizedState,e.memoizedProps);break;case 5:ha(e,t,r);break;case 3:case 4:var a=Mn;Mn=lc(e.stateNode.containerInfo),ha(e,t,r),Mn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=bo,bo=16777216,ha(e,t,r),bo=a):ha(e,t,r));break;default:ha(e,t,r)}}function Eg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function So(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var a=t[r];hi=a,Tg(a,e)}Eg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)xg(e),e=e.sibling}function xg(e){switch(e.tag){case 0:case 11:case 15:So(e),e.flags&2048&&qr(9,e,e.return);break;case 3:So(e);break;case 12:So(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):So(e);break;default:So(e)}}function Vl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var a=t[r];hi=a,Tg(a,e)}Eg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qr(8,t,t.return),Vl(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function Tg(e,t){for(;hi!==null;){var r=hi;switch(r.tag){case 0:case 11:case 15:qr(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var a=r.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:io(r.memoizedState.cache)}if(a=r.child,a!==null)a.return=r,hi=a;else e:for(r=e;hi!==null;){a=hi;var d=a.sibling,g=a.return;if(gg(a),a===r){hi=null;break e}if(d!==null){d.return=g,hi=d;break e}hi=g}}}var jy={getCacheForType:function(e){var t=yi(ni),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return yi(ni).controller.signal}},Fy=typeof WeakMap=="function"?WeakMap:Map,ct=0,yt=null,Ve=null,et=0,ft=0,rn=null,Wr=!1,da=!1,Dh=!1,br=0,jt=0,Gr=0,Rs=0,Oh=0,sn=0,fa=0,yo=null,qi=null,Bh=!1,Xl=0,Ag=0,Zl=1/0,Ql=null,Kr=null,ui=0,Yr=null,_a=null,Sr=0,Nh=0,Ih=null,Rg=null,Co=0,Hh=null;function an(){return(ct&2)!==0&&et!==0?et&-et:j.T!==null?Fh():ir()}function Lg(){if(sn===0)if((et&536870912)===0||nt){var e=Pn;Pn<<=1,(Pn&3932160)===0&&(Pn=262144),sn=e}else sn=536870912;return e=tn.current,e!==null&&(e.flags|=32),sn}function Wi(e,t,r){(e===yt&&(ft===2||ft===9)||e.cancelPendingCommit!==null)&&(pa(e,0),Vr(e,et,sn,!1)),ht(e,r),((ct&2)===0||e!==yt)&&(e===yt&&((ct&2)===0&&(Rs|=r),jt===4&&Vr(e,et,sn,!1)),Gn(e))}function kg(e,t,r){if((ct&6)!==0)throw Error(o(327));var a=!r&&(t&127)===0&&(t&e.expiredLanes)===0||he(e,t),d=a?Gy(e,t):$h(e,t,!0),g=a;do{if(d===0){da&&!a&&Vr(e,t,0,!1);break}else{if(r=e.current.alternate,g&&!qy(r)){d=$h(e,t,!1),g=!1;continue}if(d===2){if(g=t,e.errorRecoveryDisabledLanes&g)var k=0;else k=e.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){t=k;e:{var N=e;d=yo;var G=N.current.memoizedState.isDehydrated;if(G&&(pa(N,k).flags|=256),k=$h(N,k,!1),k!==2){if(Dh&&!G){N.errorRecoveryDisabledLanes|=g,Rs|=g,d=4;break e}g=qi,qi=d,g!==null&&(qi===null?qi=g:qi.push.apply(qi,g))}d=k}if(g=!1,d!==2)continue}}if(d===1){pa(e,0),Vr(e,t,0,!0);break}e:{switch(a=e,g=d,g){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Vr(a,t,sn,!Wr);break e;case 2:qi=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=Xl+300-lt(),10<d)){if(Vr(a,t,sn,!Wr),X(a,0,!0)!==0)break e;Sr=t,a.timeoutHandle=om(Mg.bind(null,a,r,qi,Ql,Bh,t,sn,Rs,fa,Wr,g,"Throttled",-0,0),d);break e}Mg(a,r,qi,Ql,Bh,t,sn,Rs,fa,Wr,g,null,-0,0)}}break}while(!0);Gn(e)}function Mg(e,t,r,a,d,g,k,N,G,re,ue,fe,se,le){if(e.timeoutHandle=-1,fe=t.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ye},wg(t,g,fe);var xe=(g&62914560)===g?Xl-lt():(g&4194048)===g?Ag-lt():0;if(xe=R1(fe,xe),xe!==null){Sr=g,e.cancelPendingCommit=xe($g.bind(null,e,t,g,r,a,d,k,N,G,ue,fe,null,se,le)),Vr(e,g,k,!re);return}}$g(e,t,g,r,a,d,k,N,G)}function qy(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var a=0;a<r.length;a++){var d=r[a],g=d.getSnapshot;d=d.value;try{if(!Ji(g(),d))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vr(e,t,r,a){t&=~Oh,t&=~Rs,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var d=t;0<d;){var g=31-zt(d),k=1<<g;a[g]=-1,d&=~k}r!==0&&Ce(e,r,t)}function Jl(){return(ct&6)===0?(wo(0),!1):!0}function zh(){if(Ve!==null){if(ft===0)var e=Ve.return;else e=Ve,cr=bs=null,eh(e),sa=null,ro=0,e=Ve;for(;e!==null;)lg(e.alternate,e),e=e.return;Ve=null}}function pa(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,u1(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Sr=0,zh(),yt=e,Ve=r=or(e.current,null),et=t,ft=0,rn=null,Wr=!1,da=he(e,t),Dh=!1,fa=sn=Oh=Rs=Gr=jt=0,qi=yo=null,Bh=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var d=31-zt(a),g=1<<d;t|=e[d],a&=~g}return br=t,Sl(),r}function Dg(e,t){qe=null,j.H=fo,t===ra||t===Rl?(t=Y_(),ft=3):t===ju?(t=Y_(),ft=4):ft=t===gh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,rn=t,Ve===null&&(jt=1,jl(e,fn(t,e.current)))}function Og(){var e=tn.current;return e===null?!0:(et&4194048)===et?mn===null:(et&62914560)===et||(et&536870912)!==0?e===mn:!1}function Bg(){var e=j.H;return j.H=fo,e===null?fo:e}function Ng(){var e=j.A;return j.A=jy,e}function ec(){jt=4,Wr||(et&4194048)!==et&&tn.current!==null||(da=!0),(Gr&134217727)===0&&(Rs&134217727)===0||yt===null||Vr(yt,et,sn,!1)}function $h(e,t,r){var a=ct;ct|=2;var d=Bg(),g=Ng();(yt!==e||et!==t)&&(Ql=null,pa(e,t)),t=!1;var k=jt;e:do try{if(ft!==0&&Ve!==null){var N=Ve,G=rn;switch(ft){case 8:zh(),k=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(t=!0);var re=ft;if(ft=0,rn=null,ga(e,N,G,re),r&&da){k=0;break e}break;default:re=ft,ft=0,rn=null,ga(e,N,G,re)}}Wy(),k=jt;break}catch(ue){Dg(e,ue)}while(!0);return t&&e.shellSuspendCounter++,cr=bs=null,ct=a,j.H=d,j.A=g,Ve===null&&(yt=null,et=0,Sl()),k}function Wy(){for(;Ve!==null;)Ig(Ve)}function Gy(e,t){var r=ct;ct|=2;var a=Bg(),d=Ng();yt!==e||et!==t?(Ql=null,Zl=lt()+500,pa(e,t)):da=he(e,t);e:do try{if(ft!==0&&Ve!==null){t=Ve;var g=rn;t:switch(ft){case 1:ft=0,rn=null,ga(e,t,g,1);break;case 2:case 9:if(G_(g)){ft=0,rn=null,Hg(t);break}t=function(){ft!==2&&ft!==9||yt!==e||(ft=7),Gn(e)},g.then(t,t);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:G_(g)?(ft=0,rn=null,Hg(t)):(ft=0,rn=null,ga(e,t,g,7));break;case 5:var k=null;switch(Ve.tag){case 26:k=Ve.memoizedState;case 5:case 27:var N=Ve;if(k?Cm(k):N.stateNode.complete){ft=0,rn=null;var G=N.sibling;if(G!==null)Ve=G;else{var re=N.return;re!==null?(Ve=re,tc(re)):Ve=null}break t}}ft=0,rn=null,ga(e,t,g,5);break;case 6:ft=0,rn=null,ga(e,t,g,6);break;case 8:zh(),jt=6;break e;default:throw Error(o(462))}}Ky();break}catch(ue){Dg(e,ue)}while(!0);return cr=bs=null,j.H=a,j.A=d,ct=r,Ve!==null?0:(yt=null,et=0,Sl(),jt)}function Ky(){for(;Ve!==null&&!Tn();)Ig(Ve)}function Ig(e){var t=ag(e.alternate,e,br);e.memoizedProps=e.pendingProps,t===null?tc(e):Ve=t}function Hg(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=eg(r,t,t.pendingProps,t.type,void 0,et);break;case 11:t=eg(r,t,t.pendingProps,t.type.render,t.ref,et);break;case 5:eh(t);default:lg(r,t),t=Ve=N_(t,br),t=ag(r,t,br)}e.memoizedProps=e.pendingProps,t===null?tc(e):Ve=t}function ga(e,t,r,a){cr=bs=null,eh(t),sa=null,ro=0;var d=t.return;try{if(Ny(e,d,t,r,et)){jt=1,jl(e,fn(r,e.current)),Ve=null;return}}catch(g){if(d!==null)throw Ve=d,g;jt=1,jl(e,fn(r,e.current)),Ve=null;return}t.flags&32768?(nt||a===1?e=!0:da||(et&536870912)!==0?e=!1:(Wr=e=!0,(a===2||a===9||a===3||a===6)&&(a=tn.current,a!==null&&a.tag===13&&(a.flags|=16384))),zg(t,e)):tc(t)}function tc(e){var t=e;do{if((t.flags&32768)!==0){zg(t,Wr);return}e=t.return;var r=zy(t.alternate,t,br);if(r!==null){Ve=r;return}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);jt===0&&(jt=5)}function zg(e,t){do{var r=$y(e.alternate,e);if(r!==null){r.flags&=32767,Ve=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=r}while(e!==null);jt=6,Ve=null}function $g(e,t,r,a,d,g,k,N,G){e.cancelPendingCommit=null;do ic();while(ui!==0);if((ct&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(g=t.lanes|t.childLanes,g|=Au,Ee(e,r,g,k,N,G),e===yt&&(Ve=yt=null,et=0),_a=t,Yr=e,Sr=r,Nh=g,Ih=d,Rg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Zy(ei,function(){return qg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=j.T,j.T=null,d=Y.p,Y.p=2,k=ct,ct|=4;try{Uy(e,t,r)}finally{ct=k,Y.p=d,j.T=a}}ui=1,Ug(),Pg(),jg()}}function Ug(){if(ui===1){ui=0;var e=Yr,t=_a,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=j.T,j.T=null;var a=Y.p;Y.p=2;var d=ct;ct|=4;try{Sg(t,e);var g=Zh,k=T_(e.containerInfo),N=g.focusedElem,G=g.selectionRange;if(k!==N&&N&&N.ownerDocument&&x_(N.ownerDocument.documentElement,N)){if(G!==null&&Cu(N)){var re=G.start,ue=G.end;if(ue===void 0&&(ue=re),"selectionStart"in N)N.selectionStart=re,N.selectionEnd=Math.min(ue,N.value.length);else{var fe=N.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var le=se.getSelection(),xe=N.textContent.length,He=Math.min(G.start,xe),mt=G.end===void 0?He:Math.min(G.end,xe);!le.extend&&He>mt&&(k=mt,mt=He,He=k);var te=E_(N,He),J=E_(N,mt);if(te&&J&&(le.rangeCount!==1||le.anchorNode!==te.node||le.anchorOffset!==te.offset||le.focusNode!==J.node||le.focusOffset!==J.offset)){var ne=fe.createRange();ne.setStart(te.node,te.offset),le.removeAllRanges(),He>mt?(le.addRange(ne),le.extend(J.node,J.offset)):(ne.setEnd(J.node,J.offset),le.addRange(ne))}}}}for(fe=[],le=N;le=le.parentNode;)le.nodeType===1&&fe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<fe.length;N++){var de=fe[N];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}_c=!!Xh,Zh=Xh=null}finally{ct=d,Y.p=a,j.T=r}}e.current=t,ui=2}}function Pg(){if(ui===2){ui=0;var e=Yr,t=_a,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=j.T,j.T=null;var a=Y.p;Y.p=2;var d=ct;ct|=4;try{pg(e,t.alternate,t)}finally{ct=d,Y.p=a,j.T=r}}ui=3}}function jg(){if(ui===4||ui===3){ui=0,Jt();var e=Yr,t=_a,r=Sr,a=Rg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ui=5:(ui=0,_a=Yr=null,Fg(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Kr=null),vi(r),t=t.stateNode,Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(Ii,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=j.T,d=Y.p,Y.p=2,j.T=null;try{for(var g=e.onRecoverableError,k=0;k<a.length;k++){var N=a[k];g(N.value,{componentStack:N.stack})}}finally{j.T=t,Y.p=d}}(Sr&3)!==0&&ic(),Gn(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Hh?Co++:(Co=0,Hh=e):Co=0,wo(0)}}function Fg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,io(t)))}function ic(){return Ug(),Pg(),jg(),qg()}function qg(){if(ui!==5)return!1;var e=Yr,t=Nh;Nh=0;var r=vi(Sr),a=j.T,d=Y.p;try{Y.p=32>r?32:r,j.T=null,r=Ih,Ih=null;var g=Yr,k=Sr;if(ui=0,_a=Yr=null,Sr=0,(ct&6)!==0)throw Error(o(331));var N=ct;if(ct|=4,xg(g.current),Cg(g,g.current,k,r),ct=N,wo(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(Ii,g)}catch{}return!0}finally{Y.p=d,j.T=a,Fg(e,t)}}function Wg(e,t,r){t=fn(r,t),t=ph(e.stateNode,t,2),e=Pr(e,t,2),e!==null&&(ht(e,2),Gn(e))}function _t(e,t,r){if(e.tag===3)Wg(e,e,r);else for(;t!==null;){if(t.tag===3){Wg(t,e,r);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Kr===null||!Kr.has(a))){e=fn(r,e),r=Gp(2),a=Pr(t,r,2),a!==null&&(Kp(r,a,t,e),ht(a,2),Gn(a));break}}t=t.return}}function Uh(e,t,r){var a=e.pingCache;if(a===null){a=e.pingCache=new Fy;var d=new Set;a.set(t,d)}else d=a.get(t),d===void 0&&(d=new Set,a.set(t,d));d.has(r)||(Dh=!0,d.add(r),e=Yy.bind(null,e,t,r),t.then(e,e))}function Yy(e,t,r){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,yt===e&&(et&r)===r&&(jt===4||jt===3&&(et&62914560)===et&&300>lt()-Xl?(ct&2)===0&&pa(e,0):Oh|=r,fa===et&&(fa=0)),Gn(e)}function Gg(e,t){t===0&&(t=Ne()),e=gs(e,t),e!==null&&(ht(e,t),Gn(e))}function Vy(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Gg(e,r)}function Xy(e,t){var r=0;switch(e.tag){case 31:case 13:var a=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),Gg(e,r)}function Zy(e,t){return mi(e,t)}var nc=null,ma=null,Ph=!1,rc=!1,jh=!1,Xr=0;function Gn(e){e!==ma&&e.next===null&&(ma===null?nc=ma=e:ma=ma.next=e),rc=!0,Ph||(Ph=!0,Jy())}function wo(e,t){if(!jh&&rc){jh=!0;do for(var r=!1,a=nc;a!==null;){if(e!==0){var d=a.pendingLanes;if(d===0)var g=0;else{var k=a.suspendedLanes,N=a.pingedLanes;g=(1<<31-zt(42|e)+1)-1,g&=d&~(k&~N),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(r=!0,Xg(a,g))}else g=et,g=X(a,a===yt?g:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(g&3)===0||he(a,g)||(r=!0,Xg(a,g));a=a.next}while(r);jh=!1}}function Qy(){Kg()}function Kg(){rc=Ph=!1;var e=0;Xr!==0&&c1()&&(e=Xr);for(var t=lt(),r=null,a=nc;a!==null;){var d=a.next,g=Yg(a,t);g===0?(a.next=null,r===null?nc=d:r.next=d,d===null&&(ma=r)):(r=a,(e!==0||(g&3)!==0)&&(rc=!0)),a=d}ui!==0&&ui!==5||wo(e),Xr!==0&&(Xr=0)}function Yg(e,t){for(var r=e.suspendedLanes,a=e.pingedLanes,d=e.expirationTimes,g=e.pendingLanes&-62914561;0<g;){var k=31-zt(g),N=1<<k,G=d[k];G===-1?((N&r)===0||(N&a)!==0)&&(d[k]=ve(N,t)):G<=t&&(e.expiredLanes|=N),g&=~N}if(t=yt,r=et,r=X(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,r===0||e===t&&(ft===2||ft===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&un(a),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||he(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(a!==null&&un(a),vi(r)){case 2:case 8:r=Ht;break;case 32:r=ei;break;case 268435456:r=Ti;break;default:r=ei}return a=Vg.bind(null,e),r=mi(r,a),e.callbackPriority=t,e.callbackNode=r,t}return a!==null&&a!==null&&un(a),e.callbackPriority=2,e.callbackNode=null,2}function Vg(e,t){if(ui!==0&&ui!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(ic()&&e.callbackNode!==r)return null;var a=et;return a=X(e,e===yt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(kg(e,a,t),Yg(e,lt()),e.callbackNode!=null&&e.callbackNode===r?Vg.bind(null,e):null)}function Xg(e,t){if(ic())return null;kg(e,t,!0)}function Jy(){h1(function(){(ct&6)!==0?mi(It,Qy):Kg()})}function Fh(){if(Xr===0){var e=ia;e===0&&(e=Rn,Rn<<=1,(Rn&261888)===0&&(Rn=256)),Xr=e}return Xr}function Zg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Or(""+e)}function Qg(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function e1(e,t,r,a,d){if(t==="submit"&&r&&r.stateNode===d){var g=Zg((d[wt]||null).action),k=a.submitter;k&&(t=(t=k[wt]||null)?Zg(t.formAction):k.getAttribute("formAction"),t!==null&&(g=t,k=null));var N=new gl("action","action",null,a,d);e.push({event:N,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Xr!==0){var G=k?Qg(d,k):new FormData(d);ch(r,{pending:!0,data:G,method:d.method,action:g},null,G)}}else typeof g=="function"&&(N.preventDefault(),G=k?Qg(d,k):new FormData(d),ch(r,{pending:!0,data:G,method:d.method,action:g},g,G))},currentTarget:d}]})}}for(var qh=0;qh<Tu.length;qh++){var Wh=Tu[qh],t1=Wh.toLowerCase(),i1=Wh[0].toUpperCase()+Wh.slice(1);kn(t1,"on"+i1)}kn(L_,"onAnimationEnd"),kn(k_,"onAnimationIteration"),kn(M_,"onAnimationStart"),kn("dblclick","onDoubleClick"),kn("focusin","onFocus"),kn("focusout","onBlur"),kn(vy,"onTransitionRun"),kn(by,"onTransitionStart"),kn(Sy,"onTransitionCancel"),kn(D_,"onTransitionEnd"),ge("onMouseEnter",["mouseout","mouseover"]),ge("onMouseLeave",["mouseout","mouseover"]),ge("onPointerEnter",["pointerout","pointerover"]),ge("onPointerLeave",["pointerout","pointerover"]),Ut("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ut("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ut("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ut("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eo="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(" "),n1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Eo));function Jg(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var a=e[r],d=a.event;a=a.listeners;e:{var g=void 0;if(t)for(var k=a.length-1;0<=k;k--){var N=a[k],G=N.instance,re=N.currentTarget;if(N=N.listener,G!==g&&d.isPropagationStopped())break e;g=N,d.currentTarget=re;try{g(d)}catch(ue){bl(ue)}d.currentTarget=null,g=G}else for(k=0;k<a.length;k++){if(N=a[k],G=N.instance,re=N.currentTarget,N=N.listener,G!==g&&d.isPropagationStopped())break e;g=N,d.currentTarget=re;try{g(d)}catch(ue){bl(ue)}d.currentTarget=null,g=G}}}}function Xe(e,t){var r=t[Mr];r===void 0&&(r=t[Mr]=new Set);var a=e+"__bubble";r.has(a)||(em(t,e,2,!1),r.add(a))}function Gh(e,t,r){var a=0;t&&(a|=4),em(r,e,a,t)}var sc="_reactListening"+Math.random().toString(36).slice(2);function Kh(e){if(!e[sc]){e[sc]=!0,Tt.forEach(function(r){r!=="selectionchange"&&(n1.has(r)||Gh(r,!1,e),Gh(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sc]||(t[sc]=!0,Gh("selectionchange",!1,t))}}function em(e,t,r,a){switch(Lm(t)){case 2:var d=M1;break;case 8:d=D1;break;default:d=ld}r=d.bind(null,t,r,e),d=void 0,!fu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),a?d!==void 0?e.addEventListener(t,r,{capture:!0,passive:d}):e.addEventListener(t,r,!0):d!==void 0?e.addEventListener(t,r,{passive:d}):e.addEventListener(t,r,!1)}function Yh(e,t,r,a,d){var g=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var k=a.tag;if(k===3||k===4){var N=a.stateNode.containerInfo;if(N===d)break;if(k===4)for(k=a.return;k!==null;){var G=k.tag;if((G===3||G===4)&&k.stateNode.containerInfo===d)return;k=k.return}for(;N!==null;){if(k=q(N),k===null)return;if(G=k.tag,G===5||G===6||G===26||G===27){a=g=k;continue e}N=N.parentNode}}a=a.return}dl(function(){var re=g,ue=Fe(r),fe=[];e:{var se=O_.get(e);if(se!==void 0){var le=gl,xe=e;switch(e){case"keypress":if(_l(r)===0)break e;case"keydown":case"keyup":le=XS;break;case"focusin":xe="focus",le=mu;break;case"focusout":xe="blur",le=mu;break;case"beforeblur":case"afterblur":le=mu;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=l_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=zS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=JS;break;case L_:case k_:case M_:le=PS;break;case D_:le=ty;break;case"scroll":case"scrollend":le=IS;break;case"wheel":le=ny;break;case"copy":case"cut":case"paste":le=FS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=u_;break;case"toggle":case"beforetoggle":le=sy}var He=(t&4)!==0,mt=!He&&(e==="scroll"||e==="scrollend"),te=He?se!==null?se+"Capture":null:se;He=[];for(var J=re,ne;J!==null;){var de=J;if(ne=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ne===null||te===null||(de=Wa(J,te),de!=null&&He.push(xo(J,de,ne))),mt)break;J=J.return}0<He.length&&(se=new le(se,xe,null,r,ue),fe.push({event:se,listeners:He}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",le=e==="mouseout"||e==="pointerout",se&&r!==Ae&&(xe=r.relatedTarget||r.fromElement)&&(q(xe)||xe[Ln]))break e;if((le||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,le?(xe=r.relatedTarget||r.toElement,le=re,xe=xe?q(xe):null,xe!==null&&(mt=y(xe),He=xe.tag,xe!==mt||He!==5&&He!==27&&He!==6)&&(xe=null)):(le=null,xe=re),le!==xe)){if(He=l_,de="onMouseLeave",te="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(He=u_,de="onPointerLeave",te="onPointerEnter",J="pointer"),mt=le==null?se:we(le),ne=xe==null?se:we(xe),se=new He(de,J+"leave",le,r,ue),se.target=mt,se.relatedTarget=ne,de=null,q(ue)===re&&(He=new He(te,J+"enter",xe,r,ue),He.target=ne,He.relatedTarget=mt,de=He),mt=de,le&&xe)t:{for(He=r1,te=le,J=xe,ne=0,de=te;de;de=He(de))ne++;de=0;for(var Be=J;Be;Be=He(Be))de++;for(;0<ne-de;)te=He(te),ne--;for(;0<de-ne;)J=He(J),de--;for(;ne--;){if(te===J||J!==null&&te===J.alternate){He=te;break t}te=He(te),J=He(J)}He=null}else He=null;le!==null&&tm(fe,se,le,He,!1),xe!==null&&mt!==null&&tm(fe,mt,xe,He,!0)}}e:{if(se=re?we(re):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var st=v_;else if(g_(se))if(b_)st=py;else{st=fy;var Re=dy}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&Dr(re.elementType)&&(st=v_):st=_y;if(st&&(st=st(e,re))){m_(fe,st,r,ue);break e}Re&&Re(e,se,re),e==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&Ws(se,"number",se.value)}switch(Re=re?we(re):window,e){case"focusin":(g_(Re)||Re.contentEditable==="true")&&(Ys=Re,wu=re,Ja=null);break;case"focusout":Ja=wu=Ys=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,A_(fe,r,ue);break;case"selectionchange":if(my)break;case"keydown":case"keyup":A_(fe,r,ue)}var We;if(bu)e:{switch(e){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else Ks?__(e,r)&&(tt="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(tt="onCompositionStart");tt&&(h_&&r.locale!=="ko"&&(Ks||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Ks&&(We=a_()):(Br=ue,_u="value"in Br?Br.value:Br.textContent,Ks=!0)),Re=ac(re,tt),0<Re.length&&(tt=new c_(tt,e,null,r,ue),fe.push({event:tt,listeners:Re}),We?tt.data=We:(We=p_(r),We!==null&&(tt.data=We)))),(We=oy?ly(e,r):cy(e,r))&&(tt=ac(re,"onBeforeInput"),0<tt.length&&(Re=new c_("onBeforeInput","beforeinput",null,r,ue),fe.push({event:Re,listeners:tt}),Re.data=We)),e1(fe,e,re,r,ue)}Jg(fe,t)})}function xo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ac(e,t){for(var r=t+"Capture",a=[];e!==null;){var d=e,g=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||g===null||(d=Wa(e,r),d!=null&&a.unshift(xo(e,d,g)),d=Wa(e,t),d!=null&&a.push(xo(e,d,g))),e.tag===3)return a;e=e.return}return[]}function r1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tm(e,t,r,a,d){for(var g=t._reactName,k=[];r!==null&&r!==a;){var N=r,G=N.alternate,re=N.stateNode;if(N=N.tag,G!==null&&G===a)break;N!==5&&N!==26&&N!==27||re===null||(G=re,d?(re=Wa(r,g),re!=null&&k.unshift(xo(r,re,G))):d||(re=Wa(r,g),re!=null&&k.push(xo(r,re,G)))),r=r.return}k.length!==0&&e.push({event:t,listeners:k})}var s1=/\r\n?/g,a1=/\u0000|\uFFFD/g;function im(e){return(typeof e=="string"?e:""+e).replace(s1,`
9
+ `).replace(a1,"")}function nm(e,t){return t=im(t),im(e)===t}function gt(e,t,r,a,d,g){switch(r){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||$e(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&$e(e,""+a);break;case"className":Zi(e,"class",a);break;case"tabIndex":Zi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Zi(e,r,a);break;case"style":dt(e,a,g);break;case"data":if(t!=="object"){Zi(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(r);break}a=Or(""+a),e.setAttribute(r,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(r,"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 g=="function"&&(r==="formAction"?(t!=="input"&&gt(e,t,"name",d.name,d,null),gt(e,t,"formEncType",d.formEncType,d,null),gt(e,t,"formMethod",d.formMethod,d,null),gt(e,t,"formTarget",d.formTarget,d,null)):(gt(e,t,"encType",d.encType,d,null),gt(e,t,"method",d.method,d,null),gt(e,t,"target",d.target,d,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(r);break}a=Or(""+a),e.setAttribute(r,a);break;case"onClick":a!=null&&(e.onclick=ye);break;case"onScroll":a!=null&&Xe("scroll",e);break;case"onScrollEnd":a!=null&&Xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(r=a.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}r=Or(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(r,""+a):e.removeAttribute(r);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":a===!0?e.setAttribute(r,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(r,a):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(r,a):e.removeAttribute(r);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(r):e.setAttribute(r,a);break;case"popover":Xe("beforetoggle",e),Xe("toggle",e),Ai(e,"popover",a);break;case"xlinkActuate":zi(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":zi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":zi(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":zi(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":zi(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":zi(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":zi(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":zi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":zi(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Ai(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=sr.get(r)||r,Ai(e,r,a))}}function Vh(e,t,r,a,d,g){switch(r){case"style":dt(e,a,g);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(r=a.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"children":typeof a=="string"?$e(e,a):(typeof a=="number"||typeof a=="bigint")&&$e(e,""+a);break;case"onScroll":a!=null&&Xe("scroll",e);break;case"onScrollEnd":a!=null&&Xe("scrollend",e);break;case"onClick":a!=null&&(e.onclick=ye);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$t.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),t=r.slice(2,d?r.length-7:void 0),g=e[wt]||null,g=g!=null?g[r]:null,typeof g=="function"&&e.removeEventListener(t,g,d),typeof a=="function")){typeof g!="function"&&g!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,a,d);break e}r in e?e[r]=a:a===!0?e.setAttribute(r,""):Ai(e,r,a)}}}function wi(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",e),Xe("load",e);var a=!1,d=!1,g;for(g in r)if(r.hasOwnProperty(g)){var k=r[g];if(k!=null)switch(g){case"src":a=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:gt(e,t,g,k,r,null)}}d&&gt(e,t,"srcSet",r.srcSet,r,null),a&&gt(e,t,"src",r.src,r,null);return;case"input":Xe("invalid",e);var N=g=k=d=null,G=null,re=null;for(a in r)if(r.hasOwnProperty(a)){var ue=r[a];if(ue!=null)switch(a){case"name":d=ue;break;case"type":k=ue;break;case"checked":G=ue;break;case"defaultChecked":re=ue;break;case"value":g=ue;break;case"defaultValue":N=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(o(137,t));break;default:gt(e,t,a,ue,r,null)}}ds(e,g,N,G,re,k,d,!1);return;case"select":Xe("invalid",e),a=k=g=null;for(d in r)if(r.hasOwnProperty(d)&&(N=r[d],N!=null))switch(d){case"value":g=N;break;case"defaultValue":k=N;break;case"multiple":a=N;default:gt(e,t,d,N,r,null)}t=g,r=k,e.multiple=!!a,t!=null?bi(e,!!a,t,!1):r!=null&&bi(e,!!a,r,!0);return;case"textarea":Xe("invalid",e),g=d=a=null;for(k in r)if(r.hasOwnProperty(k)&&(N=r[k],N!=null))switch(k){case"value":a=N;break;case"defaultValue":d=N;break;case"children":g=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(o(91));break;default:gt(e,t,k,N,r,null)}Gs(e,a,d,g);return;case"option":for(G in r)r.hasOwnProperty(G)&&(a=r[G],a!=null)&&(G==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":gt(e,t,G,a,r,null));return;case"dialog":Xe("beforetoggle",e),Xe("toggle",e),Xe("cancel",e),Xe("close",e);break;case"iframe":case"object":Xe("load",e);break;case"video":case"audio":for(a=0;a<Eo.length;a++)Xe(Eo[a],e);break;case"image":Xe("error",e),Xe("load",e);break;case"details":Xe("toggle",e);break;case"embed":case"source":case"link":Xe("error",e),Xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in r)if(r.hasOwnProperty(re)&&(a=r[re],a!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:gt(e,t,re,a,r,null)}return;default:if(Dr(t)){for(ue in r)r.hasOwnProperty(ue)&&(a=r[ue],a!==void 0&&Vh(e,t,ue,a,r,void 0));return}}for(N in r)r.hasOwnProperty(N)&&(a=r[N],a!=null&&gt(e,t,N,a,r,null))}function o1(e,t,r,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,g=null,k=null,N=null,G=null,re=null,ue=null;for(le in r){var fe=r[le];if(r.hasOwnProperty(le)&&fe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":G=fe;default:a.hasOwnProperty(le)||gt(e,t,le,null,a,fe)}}for(var se in a){var le=a[se];if(fe=r[se],a.hasOwnProperty(se)&&(le!=null||fe!=null))switch(se){case"type":g=le;break;case"name":d=le;break;case"checked":re=le;break;case"defaultChecked":ue=le;break;case"value":k=le;break;case"defaultValue":N=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,t));break;default:le!==fe&&gt(e,t,se,le,a,fe)}}ja(e,k,N,G,re,ue,g,d);return;case"select":le=k=N=se=null;for(g in r)if(G=r[g],r.hasOwnProperty(g)&&G!=null)switch(g){case"value":break;case"multiple":le=G;default:a.hasOwnProperty(g)||gt(e,t,g,null,a,G)}for(d in a)if(g=a[d],G=r[d],a.hasOwnProperty(d)&&(g!=null||G!=null))switch(d){case"value":se=g;break;case"defaultValue":N=g;break;case"multiple":k=g;default:g!==G&&gt(e,t,d,g,a,G)}t=N,r=k,a=le,se!=null?bi(e,!!r,se,!1):!!a!=!!r&&(t!=null?bi(e,!!r,t,!0):bi(e,!!r,r?[]:"",!1));return;case"textarea":le=se=null;for(N in r)if(d=r[N],r.hasOwnProperty(N)&&d!=null&&!a.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:gt(e,t,N,null,a,d)}for(k in a)if(d=a[k],g=r[k],a.hasOwnProperty(k)&&(d!=null||g!=null))switch(k){case"value":se=d;break;case"defaultValue":le=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==g&&gt(e,t,k,d,a,g)}ul(e,se,le);return;case"option":for(var xe in r)se=r[xe],r.hasOwnProperty(xe)&&se!=null&&!a.hasOwnProperty(xe)&&(xe==="selected"?e.selected=!1:gt(e,t,xe,null,a,se));for(G in a)se=a[G],le=r[G],a.hasOwnProperty(G)&&se!==le&&(se!=null||le!=null)&&(G==="selected"?e.selected=se&&typeof se!="function"&&typeof se!="symbol":gt(e,t,G,se,a,le));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 He in r)se=r[He],r.hasOwnProperty(He)&&se!=null&&!a.hasOwnProperty(He)&&gt(e,t,He,null,a,se);for(re in a)if(se=a[re],le=r[re],a.hasOwnProperty(re)&&se!==le&&(se!=null||le!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,t));break;default:gt(e,t,re,se,a,le)}return;default:if(Dr(t)){for(var mt in r)se=r[mt],r.hasOwnProperty(mt)&&se!==void 0&&!a.hasOwnProperty(mt)&&Vh(e,t,mt,void 0,a,se);for(ue in a)se=a[ue],le=r[ue],!a.hasOwnProperty(ue)||se===le||se===void 0&&le===void 0||Vh(e,t,ue,se,a,le);return}}for(var te in r)se=r[te],r.hasOwnProperty(te)&&se!=null&&!a.hasOwnProperty(te)&&gt(e,t,te,null,a,se);for(fe in a)se=a[fe],le=r[fe],!a.hasOwnProperty(fe)||se===le||se==null&&le==null||gt(e,t,fe,se,a,le)}function rm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function l1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),a=0;a<r.length;a++){var d=r[a],g=d.transferSize,k=d.initiatorType,N=d.duration;if(g&&N&&rm(k)){for(k=0,N=d.responseEnd,a+=1;a<r.length;a++){var G=r[a],re=G.startTime;if(re>N)break;var ue=G.transferSize,fe=G.initiatorType;ue&&rm(fe)&&(G=G.responseEnd,k+=ue*(G<N?1:(N-re)/(G-re)))}if(--a,t+=8*(g+k)/(d.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Xh=null,Zh=null;function oc(e){return e.nodeType===9?e:e.ownerDocument}function sm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function am(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Qh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Jh=null;function c1(){var e=window.event;return e&&e.type==="popstate"?e===Jh?!1:(Jh=e,!0):(Jh=null,!1)}var om=typeof setTimeout=="function"?setTimeout:void 0,u1=typeof clearTimeout=="function"?clearTimeout:void 0,lm=typeof Promise=="function"?Promise:void 0,h1=typeof queueMicrotask=="function"?queueMicrotask:typeof lm<"u"?function(e){return lm.resolve(null).then(e).catch(d1)}:om;function d1(e){setTimeout(function(){throw e})}function Zr(e){return e==="head"}function cm(e,t){var r=t,a=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(a===0){e.removeChild(d),ya(t);return}a--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")a++;else if(r==="html")To(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,To(r);for(var g=r.firstChild;g;){var k=g.nextSibling,N=g.nodeName;g[jn]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&g.rel.toLowerCase()==="stylesheet"||r.removeChild(g),g=k}}else r==="body"&&To(e.ownerDocument.body);r=d}while(r);ya(t)}function um(e,t){var r=e;e=0;do{var a=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=a}while(r)}function ed(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":ed(r),Me(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function f1(e,t,r,a){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[jn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(g=e.getAttribute("rel"),g==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(g!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(g=e.getAttribute("src"),(g!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&g&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var g=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===g)return e}else return e;if(e=vn(e.nextSibling),e===null)break}return null}function _1(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=vn(e.nextSibling),e===null))return null;return e}function hm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=vn(e.nextSibling),e===null))return null;return e}function td(e){return e.data==="$?"||e.data==="$~"}function id(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function p1(e,t){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||r.readyState!=="loading")t();else{var a=function(){t(),r.removeEventListener("DOMContentLoaded",a)};r.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function vn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var nd=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return vn(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function _m(e,t,r){switch(t=oc(r),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function To(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Me(e)}var bn=new Map,pm=new Set;function lc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yr=Y.d;Y.d={f:g1,r:m1,D:v1,C:b1,L:S1,m:y1,X:w1,S:C1,M:E1};function g1(){var e=yr.f(),t=Jl();return e||t}function m1(e){var t=_e(e);t!==null&&t.tag===5&&t.type==="form"?Dp(t):yr.r(e)}var va=typeof document>"u"?null:document;function gm(e,t,r){var a=va;if(a&&typeof t=="string"&&t){var d=$i(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),pm.has(d)||(pm.add(d),e={rel:e,crossOrigin:r,href:t},a.querySelector(d)===null&&(t=a.createElement("link"),wi(t,"link",e),Ye(t),a.head.appendChild(t)))}}function v1(e){yr.D(e),gm("dns-prefetch",e,null)}function b1(e,t){yr.C(e,t),gm("preconnect",e,t)}function S1(e,t,r){yr.L(e,t,r);var a=va;if(a&&e&&t){var d='link[rel="preload"][as="'+$i(t)+'"]';t==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+$i(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+$i(r.imageSizes)+'"]')):d+='[href="'+$i(e)+'"]';var g=d;switch(t){case"style":g=ba(e);break;case"script":g=Sa(e)}bn.has(g)||(e=f({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),bn.set(g,e),a.querySelector(d)!==null||t==="style"&&a.querySelector(Ao(g))||t==="script"&&a.querySelector(Ro(g))||(t=a.createElement("link"),wi(t,"link",e),Ye(t),a.head.appendChild(t)))}}function y1(e,t){yr.m(e,t);var r=va;if(r&&e){var a=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+$i(a)+'"][href="'+$i(e)+'"]',g=d;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Sa(e)}if(!bn.has(g)&&(e=f({rel:"modulepreload",href:e},t),bn.set(g,e),r.querySelector(d)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Ro(g)))return}a=r.createElement("link"),wi(a,"link",e),Ye(a),r.head.appendChild(a)}}}function C1(e,t,r){yr.S(e,t,r);var a=va;if(a&&e){var d=it(a).hoistableStyles,g=ba(e);t=t||"default";var k=d.get(g);if(!k){var N={loading:0,preload:null};if(k=a.querySelector(Ao(g)))N.loading=5;else{e=f({rel:"stylesheet",href:e,"data-precedence":t},r),(r=bn.get(g))&&rd(e,r);var G=k=a.createElement("link");Ye(G),wi(G,"link",e),G._p=new Promise(function(re,ue){G.onload=re,G.onerror=ue}),G.addEventListener("load",function(){N.loading|=1}),G.addEventListener("error",function(){N.loading|=2}),N.loading|=4,cc(k,t,a)}k={type:"stylesheet",instance:k,count:1,state:N},d.set(g,k)}}}function w1(e,t){yr.X(e,t);var r=va;if(r&&e){var a=it(r).hoistableScripts,d=Sa(e),g=a.get(d);g||(g=r.querySelector(Ro(d)),g||(e=f({src:e,async:!0},t),(t=bn.get(d))&&sd(e,t),g=r.createElement("script"),Ye(g),wi(g,"link",e),r.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},a.set(d,g))}}function E1(e,t){yr.M(e,t);var r=va;if(r&&e){var a=it(r).hoistableScripts,d=Sa(e),g=a.get(d);g||(g=r.querySelector(Ro(d)),g||(e=f({src:e,async:!0,type:"module"},t),(t=bn.get(d))&&sd(e,t),g=r.createElement("script"),Ye(g),wi(g,"link",e),r.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},a.set(d,g))}}function mm(e,t,r,a){var d=(d=me.current)?lc(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=ba(r.href),r=it(d).hoistableStyles,a=r.get(t),a||(a={type:"style",instance:null,count:0,state:null},r.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=ba(r.href);var g=it(d).hoistableStyles,k=g.get(e);if(k||(d=d.ownerDocument||d,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(e,k),(g=d.querySelector(Ao(e)))&&!g._p&&(k.instance=g,k.state.loading=5),bn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},bn.set(e,r),g||x1(d,e,r,k.state))),t&&a===null)throw Error(o(528,""));return k}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Sa(r),r=it(d).hoistableScripts,a=r.get(t),a||(a={type:"script",instance:null,count:0,state:null},r.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ba(e){return'href="'+$i(e)+'"'}function Ao(e){return'link[rel="stylesheet"]['+e+"]"}function vm(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function x1(e,t,r,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),wi(t,"link",r),Ye(t),e.head.appendChild(t))}function Sa(e){return'[src="'+$i(e)+'"]'}function Ro(e){return"script[async]"+e}function bm(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+$i(r.href)+'"]');if(a)return t.instance=a,Ye(a),a;var d=f({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ye(a),wi(a,"style",d),cc(a,r.precedence,e),t.instance=a;case"stylesheet":d=ba(r.href);var g=e.querySelector(Ao(d));if(g)return t.state.loading|=4,t.instance=g,Ye(g),g;a=vm(r),(d=bn.get(d))&&rd(a,d),g=(e.ownerDocument||e).createElement("link"),Ye(g);var k=g;return k._p=new Promise(function(N,G){k.onload=N,k.onerror=G}),wi(g,"link",a),t.state.loading|=4,cc(g,r.precedence,e),t.instance=g;case"script":return g=Sa(r.src),(d=e.querySelector(Ro(g)))?(t.instance=d,Ye(d),d):(a=r,(d=bn.get(g))&&(a=f({},r),sd(a,d)),e=e.ownerDocument||e,d=e.createElement("script"),Ye(d),wi(d,"link",a),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,cc(a,r.precedence,e));return t.instance}function cc(e,t,r){for(var a=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=a.length?a[a.length-1]:null,g=d,k=0;k<a.length;k++){var N=a[k];if(N.dataset.precedence===t)g=N;else if(g!==d)break}g?g.parentNode.insertBefore(e,g.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function rd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function sd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var uc=null;function Sm(e,t,r){if(uc===null){var a=new Map,d=uc=new Map;d.set(r,a)}else d=uc,a=d.get(r),a||(a=new Map,d.set(r,a));if(a.has(e))return a;for(a.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var g=r[d];if(!(g[jn]||g[xt]||e==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var k=g.getAttribute(t)||"";k=e+k;var N=a.get(k);N?N.push(g):a.set(k,[g])}}return a}function ym(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function T1(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Cm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function A1(e,t,r,a){if(r.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=ba(a.href),g=t.querySelector(Ao(d));if(g){t=g._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=hc.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=g,Ye(g);return}g=t.ownerDocument||t,a=vm(a),(d=bn.get(d))&&rd(a,d),g=g.createElement("link"),Ye(g);var k=g;k._p=new Promise(function(N,G){k.onload=N,k.onerror=G}),wi(g,"link",a),r.instance=g}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=hc.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var ad=0;function R1(e,t){return e.stylesheets&&e.count===0&&fc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var a=setTimeout(function(){if(e.stylesheets&&fc(e,e.stylesheets),e.unsuspend){var g=e.unsuspend;e.unsuspend=null,g()}},6e4+t);0<e.imgBytes&&ad===0&&(ad=62500*l1());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fc(e,e.stylesheets),e.unsuspend)){var g=e.unsuspend;e.unsuspend=null,g()}},(e.imgBytes>ad?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(d)}}:null}function hc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var dc=null;function fc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dc=new Map,t.forEach(L1,e),dc=null,hc.call(e))}function L1(e,t){if(!(t.state.loading&4)){var r=dc.get(e);if(r)var a=r.get(null);else{r=new Map,dc.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<d.length;g++){var k=d[g];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(r.set(k.dataset.precedence,k),a=k)}a&&r.set(null,a)}d=t.instance,k=d.getAttribute("data-precedence"),g=r.get(k)||a,g===a&&r.set(null,d),r.set(k,d),this.count++,a=hc.bind(this),d.addEventListener("load",a),d.addEventListener("error",a),g?g.parentNode.insertBefore(d,g.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Lo={$$typeof:m,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function k1(e,t,r,a,d,g,k,N,G){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=St(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=St(0),this.hiddenUpdates=St(null),this.identifierPrefix=a,this.onUncaughtError=d,this.onCaughtError=g,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function wm(e,t,r,a,d,g,k,N,G,re,ue,fe){return e=new k1(e,t,r,k,G,re,ue,fe,N),t=1,g===!0&&(t|=24),g=en(3,null,null,t),e.current=g,g.stateNode=e,t=$u(),t.refCount++,e.pooledCache=t,t.refCount++,g.memoizedState={element:a,isDehydrated:r,cache:t},Fu(g),e}function Em(e){return e?(e=Zs,e):Zs}function xm(e,t,r,a,d,g){d=Em(d),a.context===null?a.context=d:a.pendingContext=d,a=Ur(t),a.payload={element:r},g=g===void 0?null:g,g!==null&&(a.callback=g),r=Pr(e,a,t),r!==null&&(Wi(r,e,t),ao(r,e,t))}function Tm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function od(e,t){Tm(e,t),(e=e.alternate)&&Tm(e,t)}function Am(e){if(e.tag===13||e.tag===31){var t=gs(e,67108864);t!==null&&Wi(t,e,67108864),od(e,67108864)}}function Rm(e){if(e.tag===13||e.tag===31){var t=an();t=Qe(t);var r=gs(e,t);r!==null&&Wi(r,e,t),od(e,t)}}var _c=!0;function M1(e,t,r,a){var d=j.T;j.T=null;var g=Y.p;try{Y.p=2,ld(e,t,r,a)}finally{Y.p=g,j.T=d}}function D1(e,t,r,a){var d=j.T;j.T=null;var g=Y.p;try{Y.p=8,ld(e,t,r,a)}finally{Y.p=g,j.T=d}}function ld(e,t,r,a){if(_c){var d=cd(a);if(d===null)Yh(e,t,a,pc,r),km(e,a);else if(B1(d,e,t,r,a))a.stopPropagation();else if(km(e,a),t&4&&-1<O1.indexOf(e)){for(;d!==null;){var g=_e(d);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var k=ti(g.pendingLanes);if(k!==0){var N=g;for(N.pendingLanes|=2,N.entangledLanes|=2;k;){var G=1<<31-zt(k);N.entanglements[1]|=G,k&=~G}Gn(g),(ct&6)===0&&(Zl=lt()+500,wo(0))}}break;case 31:case 13:N=gs(g,2),N!==null&&Wi(N,g,2),Jl(),od(g,2)}if(g=cd(a),g===null&&Yh(e,t,a,pc,r),g===d)break;d=g}d!==null&&a.stopPropagation()}else Yh(e,t,a,null,r)}}function cd(e){return e=Fe(e),ud(e)}var pc=null;function ud(e){if(pc=null,e=q(e),e!==null){var t=y(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=b(t),e!==null)return e;e=null}else if(r===31){if(e=c(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pc=e,null}function Lm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Gt()){case It:return 2;case Ht:return 8;case ei:case An:return 32;case Ti:return 268435456;default:return 32}default:return 32}}var hd=!1,Qr=null,Jr=null,es=null,ko=new Map,Mo=new Map,ts=[],O1="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 km(e,t){switch(e){case"focusin":case"focusout":Qr=null;break;case"dragenter":case"dragleave":Jr=null;break;case"mouseover":case"mouseout":es=null;break;case"pointerover":case"pointerout":ko.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mo.delete(t.pointerId)}}function Do(e,t,r,a,d,g){return e===null||e.nativeEvent!==g?(e={blockedOn:t,domEventName:r,eventSystemFlags:a,nativeEvent:g,targetContainers:[d]},t!==null&&(t=_e(t),t!==null&&Am(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function B1(e,t,r,a,d){switch(t){case"focusin":return Qr=Do(Qr,e,t,r,a,d),!0;case"dragenter":return Jr=Do(Jr,e,t,r,a,d),!0;case"mouseover":return es=Do(es,e,t,r,a,d),!0;case"pointerover":var g=d.pointerId;return ko.set(g,Do(ko.get(g)||null,e,t,r,a,d)),!0;case"gotpointercapture":return g=d.pointerId,Mo.set(g,Do(Mo.get(g)||null,e,t,r,a,d)),!0}return!1}function Mm(e){var t=q(e.target);if(t!==null){var r=y(t);if(r!==null){if(t=r.tag,t===13){if(t=b(r),t!==null){e.blockedOn=t,nr(e.priority,function(){Rm(r)});return}}else if(t===31){if(t=c(r),t!==null){e.blockedOn=t,nr(e.priority,function(){Rm(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=cd(e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);Ae=a,r.target.dispatchEvent(a),Ae=null}else return t=_e(r),t!==null&&Am(t),e.blockedOn=r,!1;t.shift()}return!0}function Dm(e,t,r){gc(e)&&r.delete(t)}function N1(){hd=!1,Qr!==null&&gc(Qr)&&(Qr=null),Jr!==null&&gc(Jr)&&(Jr=null),es!==null&&gc(es)&&(es=null),ko.forEach(Dm),Mo.forEach(Dm)}function mc(e,t){e.blockedOn===t&&(e.blockedOn=null,hd||(hd=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,N1)))}var vc=null;function Om(e){vc!==e&&(vc=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){vc===e&&(vc=null);for(var t=0;t<e.length;t+=3){var r=e[t],a=e[t+1],d=e[t+2];if(typeof a!="function"){if(ud(a||r)===null)continue;break}var g=_e(r);g!==null&&(e.splice(t,3),t-=3,ch(g,{pending:!0,data:d,method:r.method,action:a},a,d))}}))}function ya(e){function t(G){return mc(G,e)}Qr!==null&&mc(Qr,e),Jr!==null&&mc(Jr,e),es!==null&&mc(es,e),ko.forEach(t),Mo.forEach(t);for(var r=0;r<ts.length;r++){var a=ts[r];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ts.length&&(r=ts[0],r.blockedOn===null);)Mm(r),r.blockedOn===null&&ts.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(a=0;a<r.length;a+=3){var d=r[a],g=r[a+1],k=d[wt]||null;if(typeof g=="function")k||Om(r);else if(k){var N=null;if(g&&g.hasAttribute("formAction")){if(d=g,k=g[wt]||null)N=k.formAction;else if(ud(d)!==null)continue}else N=k.action;typeof N=="function"?r[a+1]=N:(r.splice(a,3),a-=3),Om(r)}}}function Bm(){function e(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(k){return d=k})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),a||setTimeout(r,20)}function r(){if(!a&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function dd(e){this._internalRoot=e}bc.prototype.render=dd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var r=t.current,a=an();xm(r,a,e,t,null,null)},bc.prototype.unmount=dd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xm(e.current,2,null,e,null,null),Jl(),t[Ln]=null}};function bc(e){this._internalRoot=e}bc.prototype.unstable_scheduleHydration=function(e){if(e){var t=ir();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ts.length&&t!==0&&t<ts[r].priority;r++);ts.splice(r,0,e),r===0&&Mm(e)}};var Nm=n.version;if(Nm!=="19.2.7")throw Error(o(527,Nm,"19.2.7"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var I1={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sc.isDisabled&&Sc.supportsFiber)try{Ii=Sc.inject(I1),Kt=Sc}catch{}}return Bo.createRoot=function(e,t){if(!l(e))throw Error(o(299));var r=!1,a="",d=jp,g=Fp,k=qp;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(g=t.onCaughtError),t.onRecoverableError!==void 0&&(k=t.onRecoverableError)),t=wm(e,1,!1,null,null,r,a,null,d,g,k,Bm),e[Ln]=t.current,Kh(e),new dd(t)},Bo.hydrateRoot=function(e,t,r){if(!l(e))throw Error(o(299));var a=!1,d="",g=jp,k=Fp,N=qp,G=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(g=r.onUncaughtError),r.onCaughtError!==void 0&&(k=r.onCaughtError),r.onRecoverableError!==void 0&&(N=r.onRecoverableError),r.formState!==void 0&&(G=r.formState)),t=wm(e,1,!0,t,r??null,a,d,G,g,k,N,Bm),t.context=Em(null),r=t.current,a=an(),a=Qe(a),d=Ur(a),d.callback=null,Pr(r,d,a),r=a,t.current.lanes=r,ht(t,r),Gn(t),e[Ln]=t.current,Kh(e),new bc(t)},Bo.version="19.2.7",Bo}var Wm;function K1(){if(Wm)return pd.exports;Wm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),pd.exports=G1(),pd.exports}var Y1=K1();var Gm="popstate";function Km(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function V1(i={}){function n(o,l){let y=l.state?.masked,{pathname:b,search:c,hash:u}=y||o.location;return Qd("",{pathname:b,search:c,hash:u},l.state&&l.state.usr||null,l.state&&l.state.key||"default",y?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function s(o,l){return typeof l=="string"?l:tl(l)}return Z1(n,s,null,i)}function Ot(i,n){if(i===!1||i===null||typeof i>"u")throw new Error(n)}function Hn(i,n){if(!i){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function X1(){return Math.random().toString(36).substring(2,10)}function Ym(i,n){return{usr:i.state,key:i.key,idx:n,masked:i.mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Qd(i,n,s=null,o,l){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof n=="string"?Ba(n):n,state:s,key:n&&n.key||o||X1(),mask:l}}function tl({pathname:i="/",search:n="",hash:s=""}){return n&&n!=="?"&&(i+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(i+=s.charAt(0)==="#"?s:"#"+s),i}function Ba(i){let n={};if(i){let s=i.indexOf("#");s>=0&&(n.hash=i.substring(s),i=i.substring(0,s));let o=i.indexOf("?");o>=0&&(n.search=i.substring(o),i=i.substring(0,o)),i&&(n.pathname=i)}return n}function Z1(i,n,s,o={}){let{window:l=document.defaultView,v5Compat:y=!1}=o,b=l.history,c="POP",u=null,h=v();h==null&&(h=0,b.replaceState({...b.state,idx:h},""));function v(){return(b.state||{idx:null}).idx}function f(){c="POP";let _=v(),S=_==null?null:_-h;h=_,u&&u({action:c,location:w.location,delta:S})}function C(_,S){c="PUSH";let p=Km(_)?_:Qd(w.location,_,S);h=v()+1;let m=Ym(p,h),E=w.createHref(p.mask||p);try{b.pushState(m,"",E)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;l.location.assign(E)}y&&u&&u({action:c,location:w.location,delta:1})}function x(_,S){c="REPLACE";let p=Km(_)?_:Qd(w.location,_,S);h=v();let m=Ym(p,h),E=w.createHref(p.mask||p);b.replaceState(m,"",E),y&&u&&u({action:c,location:w.location,delta:0})}function A(_){return Q1(l,_)}let w={get action(){return c},get location(){return i(l,b)},listen(_){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Gm,f),u=_,()=>{l.removeEventListener(Gm,f),u=null}},createHref(_){return n(l,_)},createURL:A,encodeLocation(_){let S=A(_);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:C,replace:x,go(_){return b.go(_)}};return w}function Q1(i,n,s=!1){let o="http://localhost";i&&(o=i.location.origin!=="null"?i.location.origin:i.location.href),Ot(o,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:tl(n);return l=l.replace(/ $/,"%20"),!s&&l.startsWith("//")&&(l=o+l),new URL(l,o)}function T0(i,n,s="/"){return J1(i,n,s,!1)}function J1(i,n,s,o,l){let y=typeof n=="string"?Ba(n):n,b=Lr(y.pathname||"/",s);if(b==null)return null;let c=eC(i),u=null,h=dC(b);for(let v=0;u==null&&v<c.length;++v)u=uC(c[v],h,o);return u}function eC(i){let n=A0(i);return tC(n),n}function A0(i,n=[],s=[],o="",l=!1){let y=(b,c,u=l,h)=>{let v={relativePath:h===void 0?b.path||"":h,caseSensitive:b.caseSensitive===!0,childrenIndex:c,route:b};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(o)&&u)return;Ot(v.relativePath.startsWith(o),`Absolute route path "${v.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(o.length)}let f=In([o,v.relativePath]),C=s.concat(v);b.children&&b.children.length>0&&(Ot(b.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),A0(b.children,n,C,f,u)),!(b.path==null&&!b.index)&&n.push({path:f,score:lC(f,b.index),routesMeta:C})};return i.forEach((b,c)=>{if(b.path===""||!b.path?.includes("?"))y(b,c);else for(let u of R0(b.path))y(b,c,!0,u)}),n}function R0(i){let n=i.split("/");if(n.length===0)return[];let[s,...o]=n,l=s.endsWith("?"),y=s.replace(/\?$/,"");if(o.length===0)return l?[y,""]:[y];let b=R0(o.join("/")),c=[];return c.push(...b.map(u=>u===""?y:[y,u].join("/"))),l&&c.push(...b),c.map(u=>i.startsWith("/")&&u===""?"/":u)}function tC(i){i.sort((n,s)=>n.score!==s.score?s.score-n.score:cC(n.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var iC=/^:[\w-]+$/,nC=3,rC=2,sC=1,aC=10,oC=-2,Vm=i=>i==="*";function lC(i,n){let s=i.split("/"),o=s.length;return s.some(Vm)&&(o+=oC),n&&(o+=rC),s.filter(l=>!Vm(l)).reduce((l,y)=>l+(iC.test(y)?nC:y===""?sC:aC),o)}function cC(i,n){return i.length===n.length&&i.slice(0,-1).every((o,l)=>o===n[l])?i[i.length-1]-n[n.length-1]:0}function uC(i,n,s=!1){let{routesMeta:o}=i,l={},y="/",b=[];for(let c=0;c<o.length;++c){let u=o[c],h=c===o.length-1,v=y==="/"?n:n.slice(y.length)||"/",f=Wc({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},v),C=u.route;if(!f&&h&&s&&!o[o.length-1].route.index&&(f=Wc({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},v)),!f)return null;Object.assign(l,f.params),b.push({params:l,pathname:In([y,f.pathname]),pathnameBase:gC(In([y,f.pathnameBase])),route:C}),f.pathnameBase!=="/"&&(y=In([y,f.pathnameBase]))}return b}function Wc(i,n){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[s,o]=hC(i.path,i.caseSensitive,i.end),l=n.match(s);if(!l)return null;let y=l[0],b=y.replace(/(.)\/+$/,"$1"),c=l.slice(1);return{params:o.reduce((h,{paramName:v,isOptional:f},C)=>{if(v==="*"){let A=c[C]||"";b=y.slice(0,y.length-A.length).replace(/(.)\/+$/,"$1")}const x=c[C];return f&&!x?h[v]=void 0:h[v]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:y,pathnameBase:b,pattern:i}}function hC(i,n=!1,s=!0){Hn(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let o=[],l="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(b,c,u,h,v)=>{if(o.push({paramName:c,isOptional:u!=null}),u){let f=v.charAt(h+b.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),l+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":i!==""&&i!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),o]}function dC(i){try{return i.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Hn(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),i}}function Lr(i,n){if(n==="/")return i;if(!i.toLowerCase().startsWith(n.toLowerCase()))return null;let s=n.endsWith("/")?n.length-1:n.length,o=i.charAt(s);return o&&o!=="/"?null:i.slice(s)||"/"}var fC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function _C(i,n="/"){let{pathname:s,search:o="",hash:l=""}=typeof i=="string"?Ba(i):i,y;return s?(s=L0(s),s.startsWith("/")?y=Xm(s.substring(1),"/"):y=Xm(s,n)):y=n,{pathname:y,search:mC(o),hash:vC(l)}}function Xm(i,n){let s=Gc(n).split("/");return i.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function bd(i,n,s,o){return`Cannot include a '${i}' character in a manually specified \`to.${n}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function pC(i){return i.filter((n,s)=>s===0||n.route.path&&n.route.path.length>0)}function Rf(i){let n=pC(i);return n.map((s,o)=>o===n.length-1?s.pathname:s.pathnameBase)}function ru(i,n,s,o=!1){let l;typeof i=="string"?l=Ba(i):(l={...i},Ot(!l.pathname||!l.pathname.includes("?"),bd("?","pathname","search",l)),Ot(!l.pathname||!l.pathname.includes("#"),bd("#","pathname","hash",l)),Ot(!l.search||!l.search.includes("#"),bd("#","search","hash",l)));let y=i===""||l.pathname==="",b=y?"/":l.pathname,c;if(b==null)c=s;else{let f=n.length-1;if(!o&&b.startsWith("..")){let C=b.split("/");for(;C[0]==="..";)C.shift(),f-=1;l.pathname=C.join("/")}c=f>=0?n[f]:"/"}let u=_C(l,c),h=b&&b!=="/"&&b.endsWith("/"),v=(y||b===".")&&s.endsWith("/");return!u.pathname.endsWith("/")&&(h||v)&&(u.pathname+="/"),u}var L0=i=>i.replace(/\/\/+/g,"/"),In=i=>L0(i.join("/")),Gc=i=>i.replace(/\/+$/,""),gC=i=>Gc(i).replace(/^\/*/,"/"),mC=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,vC=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,bC=class{constructor(i,n,s,o=!1){this.status=i,this.statusText=n||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function SC(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function yC(i){let n=i.map(s=>s.route.path).filter(Boolean);return In(n)||"/"}var k0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function M0(i,n){let s=i;if(typeof s!="string"||!fC.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let o=s,l=!1;if(k0)try{let y=new URL(window.location.href),b=s.startsWith("//")?new URL(y.protocol+s):new URL(s),c=Lr(b.pathname,n);b.origin===y.origin&&c!=null?s=c+b.search+b.hash:l=!0}catch{Hn(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:l,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var D0=["POST","PUT","PATCH","DELETE"];new Set(D0);var CC=["GET",...D0];new Set(CC);var Na=ie.createContext(null);Na.displayName="DataRouter";var su=ie.createContext(null);su.displayName="DataRouterState";var O0=ie.createContext(!1);function wC(){return ie.useContext(O0)}var B0=ie.createContext({isTransitioning:!1});B0.displayName="ViewTransition";var EC=ie.createContext(new Map);EC.displayName="Fetchers";var xC=ie.createContext(null);xC.displayName="Await";var ln=ie.createContext(null);ln.displayName="Navigation";var rl=ie.createContext(null);rl.displayName="Location";var Zn=ie.createContext({outlet:null,matches:[],isDataRoute:!1});Zn.displayName="Route";var Lf=ie.createContext(null);Lf.displayName="RouteError";var N0="REACT_ROUTER_ERROR",TC="REDIRECT",AC="ROUTE_ERROR_RESPONSE";function RC(i){if(i.startsWith(`${N0}:${TC}:{`))try{let n=JSON.parse(i.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function LC(i){if(i.startsWith(`${N0}:${AC}:{`))try{let n=JSON.parse(i.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new bC(n.status,n.statusText,n.data)}catch{}}function kC(i,{relative:n}={}){Ot(Ia(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=ie.useContext(ln),{hash:l,pathname:y,search:b}=sl(i,{relative:n}),c=y;return s!=="/"&&(c=y==="/"?s:In([s,y])),o.createHref({pathname:c,search:b,hash:l})}function Ia(){return ie.useContext(rl)!=null}function $n(){return Ot(Ia(),"useLocation() may be used only in the context of a <Router> component."),ie.useContext(rl).location}var I0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function H0(i){ie.useContext(ln).static||ie.useLayoutEffect(i)}function z0(){let{isDataRoute:i}=ie.useContext(Zn);return i?FC():MC()}function MC(){Ot(Ia(),"useNavigate() may be used only in the context of a <Router> component.");let i=ie.useContext(Na),{basename:n,navigator:s}=ie.useContext(ln),{matches:o}=ie.useContext(Zn),{pathname:l}=$n(),y=JSON.stringify(Rf(o)),b=ie.useRef(!1);return H0(()=>{b.current=!0}),ie.useCallback((u,h={})=>{if(Hn(b.current,I0),!b.current)return;if(typeof u=="number"){s.go(u);return}let v=ru(u,JSON.parse(y),l,h.relative==="path");i==null&&n!=="/"&&(v.pathname=v.pathname==="/"?n:In([n,v.pathname])),(h.replace?s.replace:s.push)(v,h.state,h)},[n,s,y,l,i])}ie.createContext(null);function sl(i,{relative:n}={}){let{matches:s}=ie.useContext(Zn),{pathname:o}=$n(),l=JSON.stringify(Rf(s));return ie.useMemo(()=>ru(i,JSON.parse(l),o,n==="path"),[i,l,o,n])}function DC(i,n){return $0(i,n)}function $0(i,n,s){Ot(Ia(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=ie.useContext(ln),{matches:l}=ie.useContext(Zn),y=l[l.length-1],b=y?y.params:{},c=y?y.pathname:"/",u=y?y.pathnameBase:"/",h=y&&y.route;{let _=h&&h.path||"";P0(c,!h||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${_}">) 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.
10
+
11
+ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let v=$n(),f;if(n){let _=typeof n=="string"?Ba(n):n;Ot(u==="/"||_.pathname?.startsWith(u),`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 "${u}" but pathname "${_.pathname}" was given in the \`location\` prop.`),f=_}else f=v;let C=f.pathname||"/",x=C;if(u!=="/"){let _=u.replace(/^\//,"").split("/");x="/"+C.replace(/^\//,"").split("/").slice(_.length).join("/")}let A=s&&s.state.matches.length?s.state.matches.map(_=>Object.assign(_,{route:s.manifest[_.route.id]||_.route})):T0(i,{pathname:x});Hn(h||A!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),Hn(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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=HC(A&&A.map(_=>Object.assign({},_,{params:Object.assign({},b,_.params),pathname:In([u,o.encodeLocation?o.encodeLocation(_.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?u:In([u,o.encodeLocation?o.encodeLocation(_.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,s);return n&&w?ie.createElement(rl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},w):w}function OC(){let i=jC(),n=SC(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),s=i instanceof Error?i.stack:null,o="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:o},y={padding:"2px 4px",backgroundColor:o},b=null;return console.error("Error handled by React Router default ErrorBoundary:",i),b=ie.createElement(ie.Fragment,null,ie.createElement("p",null,"💿 Hey developer 👋"),ie.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",ie.createElement("code",{style:y},"ErrorBoundary")," or"," ",ie.createElement("code",{style:y},"errorElement")," prop on your route.")),ie.createElement(ie.Fragment,null,ie.createElement("h2",null,"Unexpected Application Error!"),ie.createElement("h3",{style:{fontStyle:"italic"}},n),s?ie.createElement("pre",{style:l},s):null,b)}var BC=ie.createElement(OC,null),U0=class extends ie.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,n){return n.location!==i.location||n.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:n.error,location:n.location,revalidation:i.revalidation||n.revalidation}}componentDidCatch(i,n){this.props.onError?this.props.onError(i,n):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const s=LC(i.digest);s&&(i=s)}let n=i!==void 0?ie.createElement(Zn.Provider,{value:this.props.routeContext},ie.createElement(Lf.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?ie.createElement(NC,{error:i},n):n}};U0.contextType=O0;var Sd=new WeakMap;function NC({children:i,error:n}){let{basename:s}=ie.useContext(ln);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=RC(n.digest);if(o){let l=Sd.get(n);if(l)throw l;let y=M0(o.location,s);if(k0&&!Sd.get(n))if(y.isExternal||o.reloadDocument)window.location.href=y.absoluteURL||y.to;else{const b=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(y.to,{replace:o.replace}));throw Sd.set(n,b),b}return ie.createElement("meta",{httpEquiv:"refresh",content:`0;url=${y.absoluteURL||y.to}`})}}return i}function IC({routeContext:i,match:n,children:s}){let o=ie.useContext(Na);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),ie.createElement(Zn.Provider,{value:i},s)}function HC(i,n=[],s){let o=s?.state;if(i==null){if(!o)return null;if(o.errors)i=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)i=o.matches;else return null}let l=i,y=o?.errors;if(y!=null){let v=l.findIndex(f=>f.route.id&&y?.[f.route.id]!==void 0);Ot(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(y).join(",")}`),l=l.slice(0,Math.min(l.length,v+1))}let b=!1,c=-1;if(s&&o){b=o.renderFallback;for(let v=0;v<l.length;v++){let f=l[v];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=v),f.route.id){let{loaderData:C,errors:x}=o,A=f.route.loader&&!C.hasOwnProperty(f.route.id)&&(!x||x[f.route.id]===void 0);if(f.route.lazy||A){s.isStatic&&(b=!0),c>=0?l=l.slice(0,c+1):l=[l[0]];break}}}}let u=s?.onError,h=o&&u?(v,f)=>{u(v,{location:o.location,params:o.matches?.[0]?.params??{},pattern:yC(o.matches),errorInfo:f})}:void 0;return l.reduceRight((v,f,C)=>{let x,A=!1,w=null,_=null;o&&(x=y&&f.route.id?y[f.route.id]:void 0,w=f.route.errorElement||BC,b&&(c<0&&C===0?(P0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,_=null):c===C&&(A=!0,_=f.route.hydrateFallbackElement||null)));let S=n.concat(l.slice(0,C+1)),p=()=>{let m;return x?m=w:A?m=_:f.route.Component?m=ie.createElement(f.route.Component,null):f.route.element?m=f.route.element:m=v,ie.createElement(IC,{match:f,routeContext:{outlet:v,matches:S,isDataRoute:o!=null},children:m})};return o&&(f.route.ErrorBoundary||f.route.errorElement||C===0)?ie.createElement(U0,{location:o.location,revalidation:o.revalidation,component:w,error:x,children:p(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):p()},null)}function kf(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zC(i){let n=ie.useContext(Na);return Ot(n,kf(i)),n}function $C(i){let n=ie.useContext(su);return Ot(n,kf(i)),n}function UC(i){let n=ie.useContext(Zn);return Ot(n,kf(i)),n}function Mf(i){let n=UC(i),s=n.matches[n.matches.length-1];return Ot(s.route.id,`${i} can only be used on routes that contain a unique "id"`),s.route.id}function PC(){return Mf("useRouteId")}function jC(){let i=ie.useContext(Lf),n=$C("useRouteError"),s=Mf("useRouteError");return i!==void 0?i:n.errors?.[s]}function FC(){let{router:i}=zC("useNavigate"),n=Mf("useNavigate"),s=ie.useRef(!1);return H0(()=>{s.current=!0}),ie.useCallback(async(l,y={})=>{Hn(s.current,I0),s.current&&(typeof l=="number"?await i.navigate(l):await i.navigate(l,{fromRouteId:n,...y}))},[i,n])}var Zm={};function P0(i,n,s){!n&&!Zm[i]&&(Zm[i]=!0,Hn(!1,s))}ie.memo(qC);function qC({routes:i,manifest:n,future:s,state:o,isStatic:l,onError:y}){return $0(i,void 0,{manifest:n,state:o,isStatic:l,onError:y})}function WC({to:i,replace:n,state:s,relative:o}){Ot(Ia(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=ie.useContext(ln);Hn(!l,"<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:y}=ie.useContext(Zn),{pathname:b}=$n(),c=z0(),u=ru(i,Rf(y),b,o==="path"),h=JSON.stringify(u);return ie.useEffect(()=>{c(JSON.parse(h),{replace:n,state:s,relative:o})},[c,h,o,n,s]),null}function Go(i){Ot(!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 GC({basename:i="/",children:n=null,location:s,navigationType:o="POP",navigator:l,static:y=!1,useTransitions:b}){Ot(!Ia(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=i.replace(/^\/*/,"/"),u=ie.useMemo(()=>({basename:c,navigator:l,static:y,useTransitions:b,future:{}}),[c,l,y,b]);typeof s=="string"&&(s=Ba(s));let{pathname:h="/",search:v="",hash:f="",state:C=null,key:x="default",mask:A}=s,w=ie.useMemo(()=>{let _=Lr(h,c);return _==null?null:{location:{pathname:_,search:v,hash:f,state:C,key:x,mask:A},navigationType:o}},[c,h,v,f,C,x,o,A]);return Hn(w!=null,`<Router basename="${c}"> is not able to match the URL "${h}${v}${f}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:ie.createElement(ln.Provider,{value:u},ie.createElement(rl.Provider,{children:n,value:w}))}function KC({children:i,location:n}){return DC(Jd(i),n)}function Jd(i,n=[]){let s=[];return ie.Children.forEach(i,(o,l)=>{if(!ie.isValidElement(o))return;let y=[...n,l];if(o.type===ie.Fragment){s.push.apply(s,Jd(o.props.children,y));return}Ot(o.type===Go,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ot(!o.props.index||!o.props.children,"An index route cannot have child routes.");let b={id:o.props.id||y.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(b.children=Jd(o.props.children,y)),s.push(b)}),s}var Nc="get",Ic="application/x-www-form-urlencoded";function au(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function YC(i){return au(i)&&i.tagName.toLowerCase()==="button"}function VC(i){return au(i)&&i.tagName.toLowerCase()==="form"}function XC(i){return au(i)&&i.tagName.toLowerCase()==="input"}function ZC(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function QC(i,n){return i.button===0&&(!n||n==="_self")&&!ZC(i)}var yc=null;function JC(){if(yc===null)try{new FormData(document.createElement("form"),0),yc=!1}catch{yc=!0}return yc}var ew=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function yd(i){return i!=null&&!ew.has(i)?(Hn(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ic}"`),null):i}function tw(i,n){let s,o,l,y,b;if(VC(i)){let c=i.getAttribute("action");o=c?Lr(c,n):null,s=i.getAttribute("method")||Nc,l=yd(i.getAttribute("enctype"))||Ic,y=new FormData(i)}else if(YC(i)||XC(i)&&(i.type==="submit"||i.type==="image")){let c=i.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=i.getAttribute("formaction")||c.getAttribute("action");if(o=u?Lr(u,n):null,s=i.getAttribute("formmethod")||c.getAttribute("method")||Nc,l=yd(i.getAttribute("formenctype"))||yd(c.getAttribute("enctype"))||Ic,y=new FormData(c,i),!JC()){let{name:h,type:v,value:f}=i;if(v==="image"){let C=h?`${h}.`:"";y.append(`${C}x`,"0"),y.append(`${C}y`,"0")}else h&&y.append(h,f)}}else{if(au(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Nc,o=null,l=Ic,b=i}return y&&l==="text/plain"&&(b=y,y=void 0),{action:o,method:s.toLowerCase(),encType:l,formData:y,body:b}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Df(i,n){if(i===!1||i===null||typeof i>"u")throw new Error(n)}function j0(i,n,s,o){let l=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return s?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${o}`:l.pathname=`${l.pathname}.${o}`:l.pathname==="/"?l.pathname=`_root.${o}`:n&&Lr(l.pathname,n)==="/"?l.pathname=`${Gc(n)}/_root.${o}`:l.pathname=`${Gc(l.pathname)}.${o}`,l}async function iw(i,n){if(i.id in n)return n[i.id];try{let s=await import(i.module);return n[i.id]=s,s}catch(s){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function nw(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function rw(i,n,s){let o=await Promise.all(i.map(async l=>{let y=n.routes[l.route.id];if(y){let b=await iw(y,s);return b.links?b.links():[]}return[]}));return lw(o.flat(1).filter(nw).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function Qm(i,n,s,o,l,y){let b=(u,h)=>s[h]?u.route.id!==s[h].route.id:!0,c=(u,h)=>s[h].pathname!==u.pathname||s[h].route.path?.endsWith("*")&&s[h].params["*"]!==u.params["*"];return y==="assets"?n.filter((u,h)=>b(u,h)||c(u,h)):y==="data"?n.filter((u,h)=>{let v=o.routes[u.route.id];if(!v||!v.hasLoader)return!1;if(b(u,h)||c(u,h))return!0;if(u.route.shouldRevalidate){let f=u.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(i,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function sw(i,n,{includeHydrateFallback:s}={}){return aw(i.map(o=>{let l=n.routes[o.route.id];if(!l)return[];let y=[l.module];return l.clientActionModule&&(y=y.concat(l.clientActionModule)),l.clientLoaderModule&&(y=y.concat(l.clientLoaderModule)),s&&l.hydrateFallbackModule&&(y=y.concat(l.hydrateFallbackModule)),l.imports&&(y=y.concat(l.imports)),y}).flat(1))}function aw(i){return[...new Set(i)]}function ow(i){let n={},s=Object.keys(i).sort();for(let o of s)n[o]=i[o];return n}function lw(i,n){let s=new Set;return new Set(n),i.reduce((o,l)=>{let y=JSON.stringify(ow(l));return s.has(y)||(s.add(y),o.push({key:y,link:l})),o},[])}function Of(){let i=ie.useContext(Na);return Df(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function cw(){let i=ie.useContext(su);return Df(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Bf=ie.createContext(void 0);Bf.displayName="FrameworkContext";function Nf(){let i=ie.useContext(Bf);return Df(i,"You must render this element inside a <HydratedRouter> element"),i}function uw(i,n){let s=ie.useContext(Bf),[o,l]=ie.useState(!1),[y,b]=ie.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:v,onTouchStart:f}=n,C=ie.useRef(null);ie.useEffect(()=>{if(i==="render"&&b(!0),i==="viewport"){let w=S=>{S.forEach(p=>{b(p.isIntersecting)})},_=new IntersectionObserver(w,{threshold:.5});return C.current&&_.observe(C.current),()=>{_.disconnect()}}},[i]),ie.useEffect(()=>{if(o){let w=setTimeout(()=>{b(!0)},100);return()=>{clearTimeout(w)}}},[o]);let x=()=>{l(!0)},A=()=>{l(!1),b(!1)};return s?i!=="intent"?[y,C,{}]:[y,C,{onFocus:No(c,x),onBlur:No(u,A),onMouseEnter:No(h,x),onMouseLeave:No(v,A),onTouchStart:No(f,x)}]:[!1,C,{}]}function No(i,n){return s=>{i&&i(s),s.defaultPrevented||n(s)}}function hw({page:i,...n}){let s=wC(),{router:o}=Of(),l=ie.useMemo(()=>T0(o.routes,i,o.basename),[o.routes,i,o.basename]);return l?s?ie.createElement(fw,{page:i,matches:l,...n}):ie.createElement(_w,{page:i,matches:l,...n}):null}function dw(i){let{manifest:n,routeModules:s}=Nf(),[o,l]=ie.useState([]);return ie.useEffect(()=>{let y=!1;return rw(i,n,s).then(b=>{y||l(b)}),()=>{y=!0}},[i,n,s]),o}function fw({page:i,matches:n,...s}){let o=$n(),{future:l}=Nf(),{basename:y}=Of(),b=ie.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let c=j0(i,y,l.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,h=[];for(let v of n)typeof v.route.shouldRevalidate=="function"?u=!0:h.push(v.route.id);return u&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[y,l.v8_trailingSlashAwareDataRequests,i,o,n]);return ie.createElement(ie.Fragment,null,b.map(c=>ie.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...s})))}function _w({page:i,matches:n,...s}){let o=$n(),{future:l,manifest:y,routeModules:b}=Nf(),{basename:c}=Of(),{loaderData:u,matches:h}=cw(),v=ie.useMemo(()=>Qm(i,n,h,y,o,"data"),[i,n,h,y,o]),f=ie.useMemo(()=>Qm(i,n,h,y,o,"assets"),[i,n,h,y,o]),C=ie.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let w=new Set,_=!1;if(n.forEach(p=>{let m=y.routes[p.route.id];!m||!m.hasLoader||(!v.some(E=>E.route.id===p.route.id)&&p.route.id in u&&b[p.route.id]?.shouldRevalidate||m.hasClientLoader?_=!0:w.add(p.route.id))}),w.size===0)return[];let S=j0(i,c,l.v8_trailingSlashAwareDataRequests,"data");return _&&w.size>0&&S.searchParams.set("_routes",n.filter(p=>w.has(p.route.id)).map(p=>p.route.id).join(",")),[S.pathname+S.search]},[c,l.v8_trailingSlashAwareDataRequests,u,o,y,v,n,i,b]),x=ie.useMemo(()=>sw(f,y),[f,y]),A=dw(f);return ie.createElement(ie.Fragment,null,C.map(w=>ie.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...s})),x.map(w=>ie.createElement("link",{key:w,rel:"modulepreload",href:w,...s})),A.map(({key:w,link:_})=>ie.createElement("link",{key:w,nonce:s.nonce,..._,crossOrigin:_.crossOrigin??s.crossOrigin})))}function pw(...i){return n=>{i.forEach(s=>{typeof s=="function"?s(n):s!=null&&(s.current=n)})}}var gw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{gw&&(window.__reactRouterVersion="7.17.0")}catch{}function mw({basename:i,children:n,useTransitions:s,window:o}){let l=ie.useRef();l.current==null&&(l.current=V1({window:o,v5Compat:!0}));let y=l.current,[b,c]=ie.useState({action:y.action,location:y.location}),u=ie.useCallback(h=>{s===!1?c(h):ie.startTransition(()=>c(h))},[s]);return ie.useLayoutEffect(()=>y.listen(u),[y,u]),ie.createElement(GC,{basename:i,children:n,location:b.location,navigationType:b.action,navigator:y,useTransitions:s})}var F0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,If=ie.forwardRef(function({onClick:n,discover:s="render",prefetch:o="none",relative:l,reloadDocument:y,replace:b,mask:c,state:u,target:h,to:v,preventScrollReset:f,viewTransition:C,defaultShouldRevalidate:x,...A},w){let{basename:_,navigator:S,useTransitions:p}=ie.useContext(ln),m=typeof v=="string"&&F0.test(v),E=M0(v,_);v=E.to;let R=kC(v,{relative:l}),L=$n(),D=null;if(c){let ee=ru(c,[],L.mask?L.mask.pathname:"/",!0);_!=="/"&&(ee.pathname=ee.pathname==="/"?_:In([_,ee.pathname])),D=S.createHref(ee)}let[T,B,W]=uw(o,A),P=Sw(v,{replace:b,mask:c,state:u,target:h,preventScrollReset:f,relative:l,viewTransition:C,defaultShouldRevalidate:x,useTransitions:p});function F(ee){n&&n(ee),ee.defaultPrevented||P(ee)}let I=!(E.isExternal||y),Z=ie.createElement("a",{...A,...W,href:(I?D:void 0)||E.absoluteURL||R,onClick:I?F:n,ref:pw(w,B),target:h,"data-discover":!m&&s==="render"?"true":void 0});return T&&!m?ie.createElement(ie.Fragment,null,Z,ie.createElement(hw,{page:R})):Z});If.displayName="Link";var q0=ie.forwardRef(function({"aria-current":n="page",caseSensitive:s=!1,className:o="",end:l=!1,style:y,to:b,viewTransition:c,children:u,...h},v){let f=sl(b,{relative:h.relative}),C=$n(),x=ie.useContext(su),{navigator:A,basename:w}=ie.useContext(ln),_=x!=null&&xw(f)&&c===!0,S=A.encodeLocation?A.encodeLocation(f).pathname:f.pathname,p=C.pathname,m=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;s||(p=p.toLowerCase(),m=m?m.toLowerCase():null,S=S.toLowerCase()),m&&w&&(m=Lr(m,w)||m);const E=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let R=p===S||!l&&p.startsWith(S)&&p.charAt(E)==="/",L=m!=null&&(m===S||!l&&m.startsWith(S)&&m.charAt(S.length)==="/"),D={isActive:R,isPending:L,isTransitioning:_},T=R?n:void 0,B;typeof o=="function"?B=o(D):B=[o,R?"active":null,L?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let W=typeof y=="function"?y(D):y;return ie.createElement(If,{...h,"aria-current":T,className:B,ref:v,style:W,to:b,viewTransition:c},typeof u=="function"?u(D):u)});q0.displayName="NavLink";var vw=ie.forwardRef(({discover:i="render",fetcherKey:n,navigate:s,reloadDocument:o,replace:l,state:y,method:b=Nc,action:c,onSubmit:u,relative:h,preventScrollReset:v,viewTransition:f,defaultShouldRevalidate:C,...x},A)=>{let{useTransitions:w}=ie.useContext(ln),_=ww(),S=Ew(c,{relative:h}),p=b.toLowerCase()==="get"?"get":"post",m=typeof c=="string"&&F0.test(c),E=R=>{if(u&&u(R),R.defaultPrevented)return;R.preventDefault();let L=R.nativeEvent.submitter,D=L?.getAttribute("formmethod")||b,T=()=>_(L||R.currentTarget,{fetcherKey:n,method:D,navigate:s,replace:l,state:y,relative:h,preventScrollReset:v,viewTransition:f,defaultShouldRevalidate:C});w&&s!==!1?ie.startTransition(()=>T()):T()};return ie.createElement("form",{ref:A,method:p,action:S,onSubmit:o?u:E,...x,"data-discover":!m&&i==="render"?"true":void 0})});vw.displayName="Form";function bw(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function W0(i){let n=ie.useContext(Na);return Ot(n,bw(i)),n}function Sw(i,{target:n,replace:s,mask:o,state:l,preventScrollReset:y,relative:b,viewTransition:c,defaultShouldRevalidate:u,useTransitions:h}={}){let v=z0(),f=$n(),C=sl(i,{relative:b});return ie.useCallback(x=>{if(QC(x,n)){x.preventDefault();let A=s!==void 0?s:tl(f)===tl(C),w=()=>v(i,{replace:A,mask:o,state:l,preventScrollReset:y,relative:b,viewTransition:c,defaultShouldRevalidate:u});h?ie.startTransition(()=>w()):w()}},[f,v,C,s,o,l,n,i,y,b,c,u,h])}var yw=0,Cw=()=>`__${String(++yw)}__`;function ww(){let{router:i}=W0("useSubmit"),{basename:n}=ie.useContext(ln),s=PC(),o=i.fetch,l=i.navigate;return ie.useCallback(async(y,b={})=>{let{action:c,method:u,encType:h,formData:v,body:f}=tw(y,n);if(b.navigate===!1){let C=b.fetcherKey||Cw();await o(C,s,b.action||c,{defaultShouldRevalidate:b.defaultShouldRevalidate,preventScrollReset:b.preventScrollReset,formData:v,body:f,formMethod:b.method||u,formEncType:b.encType||h,flushSync:b.flushSync})}else await l(b.action||c,{defaultShouldRevalidate:b.defaultShouldRevalidate,preventScrollReset:b.preventScrollReset,formData:v,body:f,formMethod:b.method||u,formEncType:b.encType||h,replace:b.replace,state:b.state,fromRouteId:s,flushSync:b.flushSync,viewTransition:b.viewTransition})},[o,l,n,s])}function Ew(i,{relative:n}={}){let{basename:s}=ie.useContext(ln),o=ie.useContext(Zn);Ot(o,"useFormAction must be used inside a RouteContext");let[l]=o.matches.slice(-1),y={...sl(i||".",{relative:n})},b=$n();if(i==null){y.search=b.search;let c=new URLSearchParams(y.search),u=c.getAll("index");if(u.some(v=>v==="")){c.delete("index"),u.filter(f=>f).forEach(f=>c.append("index",f));let v=c.toString();y.search=v?`?${v}`:""}}return(!i||i===".")&&l.route.index&&(y.search=y.search?y.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(y.pathname=y.pathname==="/"?s:In([s,y.pathname])),tl(y)}function xw(i,{relative:n}={}){let s=ie.useContext(B0);Ot(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=W0("useViewTransitionState"),l=sl(i,{relative:n});if(!s.isTransitioning)return!1;let y=Lr(s.currentLocation.pathname,o)||s.currentLocation.pathname,b=Lr(s.nextLocation.pathname,o)||s.nextLocation.pathname;return Wc(l.pathname,b)!=null||Wc(l.pathname,y)!=null}class cn extends Error{status;constructor(n,s){super(s),this.name="ApiError",this.status=n}}async function G0(i){const n=await fetch("/observer/tenants",{signal:i});await Un(n);const s=await n.json();if(!Array.isArray(s.tenants))throw new cn(n.status,"Invalid tenants response");return s.tenants.map(o=>Hw(o,n.status))}async function Tw(i){const n=await fetch("/observer/jobs",{signal:i});return await Un(n),(await n.json()).tenants}async function Aw(i){const n=await fetch("/observer/events",{signal:i});if(await Un(n),!n.body)throw new cn(n.status,"Observer stream unavailable");return n.body.getReader()}async function Rw(i){const n=await fetch("/observer/theaters",{signal:i});await Un(n);const s=await n.json();if(!Array.isArray(s.theaters))throw new cn(n.status,"Invalid Theater response");return s.theaters.map(o=>Y0(o,n.status))}async function Lw(i,n){const s=i?`?theaterId=${encodeURIComponent(i)}`:"",o=await fetch(`/observer/status${s}`,{signal:n});return await Un(o),zw(await o.json(),o.status)}async function kw(i){const n=await fetch("/observer/carriers",{signal:i});await Un(n);const s=await n.json();if(!Array.isArray(s.carriers))throw new cn(n.status,"Invalid carrier readiness response");return s.carriers.map(o=>$w(o,n.status))}async function Mw(i){const n=await fetch("/observer/theaters",{method:"POST",signal:i});await Un(n);const s=await n.json();return typeof s=="object"&&s!==null&&s.cancelled===!0?{cancelled:!0}:Y0(s,n.status)}async function Dw(i,n){const s=await fetch(`/observer/theaters/${encodeURIComponent(i)}/sessions`,{method:"POST",signal:n});return await Un(s),K0(await s.json(),s.status)}async function Ow(i,n){const s=await fetch(`/terminal/sessions/${encodeURIComponent(i)}`,{method:"DELETE",signal:n});await Un(s)}async function Bw(i){const n=await fetch("/terminal/sessions",{signal:i});await Un(n);const s=await n.json();if(!Array.isArray(s.sessions))throw new cn(n.status,"Invalid terminal sessions response");return s.sessions.map(o=>K0(o,n.status))}async function Nw(i,n){const s=Iw(n),o=await fetch("/terminal/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:i,...s.kind?{kind:s.kind}:{}}),signal:s.signal});await Un(o);const l=await o.json();if(typeof l.ticket!="string"||typeof l.ttlMs!="number")throw new cn(o.status,"Invalid terminal ticket response");return{ticket:l.ticket,ttlMs:l.ttlMs}}function Iw(i){return i?i instanceof AbortSignal?{signal:i}:i:{}}function K0(i,n){const s=i;if(!s||typeof s.sessionId!="string"||typeof s.cwdLabel!="string"||typeof s.status!="string"||typeof s.createdAt!="number")throw new cn(n,"Invalid terminal session response");return{sessionId:s.sessionId,terminalSessionId:typeof s.terminalSessionId=="string"?s.terminalSessionId:s.sessionId,cwdLabel:s.cwdLabel,status:s.status,createdAt:s.createdAt,theaterId:typeof s.theaterId=="string"?s.theaterId:void 0,tenantId:typeof s.tenantId=="string"?s.tenantId:void 0,registrationId:typeof s.registrationId=="string"?s.registrationId:void 0}}function Hw(i,n){const s=i;if(!s||typeof s.tenantId!="string"||typeof s.tenantLabel!="string"||typeof s.createdAt!="number"||typeof s.sessions!="number"||"cwd"in s)throw new cn(n,"Invalid tenants response");return{tenantId:s.tenantId,tenantLabel:s.tenantLabel,createdAt:s.createdAt,sessions:s.sessions,status:s.status,cliRunId:typeof s.cliRunId=="string"?s.cliRunId:void 0,registrationId:typeof s.registrationId=="string"?s.registrationId:void 0,theaterId:typeof s.theaterId=="string"?s.theaterId:void 0,terminalSessionId:typeof s.terminalSessionId=="string"?s.terminalSessionId:void 0}}function zw(i,n){const s=i;if(!s||typeof s.workspaces!="number"||typeof s.jobs!="number"||typeof s.version!="string"||s.channel!=="stable"&&s.channel!=="local"&&s.channel!=="unknown"||typeof s.port!="number"||s.wikiServerStatus!=="available"&&s.wikiServerStatus!=="unavailable"&&s.wikiServerStatus!=="unknown"||"token"in s||"path"in s||"cwd"in s||"knowledgeRoot"in s)throw new cn(n,"Invalid observer status response");return{workspaces:s.workspaces,jobs:s.jobs,version:s.version,channel:s.channel,port:s.port,wikiServerStatus:s.wikiServerStatus}}function $w(i,n){const s=i;if(!s||typeof s.carrierId!="string"||typeof s.displayName!="string"||s.role!==null&&typeof s.role!="string"||typeof s.model!="string"||s.effort!==null&&typeof s.effort!="string"||typeof s.taskForceBackendCount!="number"||typeof s.subagentMode!="boolean"||s.category!==void 0&&s.category!=="strategy"&&s.category!=="planning"&&s.category!=="operations"||typeof s.slot!="number"||typeof s.cliType!="string"||"token"in s||"key"in s||"credential"in s||"cwd"in s||"path"in s||"persona"in s||"prompt"in s||"toolAllowlist"in s||"allowedExecutorTools"in s)throw new cn(n,"Invalid carrier readiness response");return{carrierId:s.carrierId,displayName:s.displayName,role:s.role,model:s.model,effort:s.effort,taskForceBackendCount:s.taskForceBackendCount,subagentMode:s.subagentMode,...s.category?{category:s.category}:{},slot:s.slot,cliType:s.cliType}}function Y0(i,n){const s=i;if(!s||typeof s.id!="string"||typeof s.label!="string"||"path"in s||typeof s.createdAt!="string"||typeof s.lastOpenedAt!="string"||typeof s.hasWiki!="boolean"||typeof s.activeAdmiralCount!="number")throw new cn(n,"Invalid Theater response");return{id:s.id,label:s.label,createdAt:s.createdAt,lastOpenedAt:s.lastOpenedAt,hasWiki:s.hasWiki,activeAdmiralCount:s.activeAdmiralCount}}async function Un(i){if(i.ok)return;let n=i.statusText;try{n=(await i.json()).error??n}catch{}throw new cn(i.status,n||`HTTP ${i.status}`)}const Jm=120,Uw="active",ef=new Set(["done","error","aborted"]);function Pw(i,n){let s=X0(i,n.jobId,n.updatedAt);for(const o of n.events)s=V0(s,o);return ef.has(n.status)&&!ef.has(s.status)&&(s={...s,status:n.status}),s}function V0(i,n){if(n.id<=i.lastEventId)return i;const s=n.event,o={...i,updatedAt:n.at,lastEventId:n.id,recentEvents:qw(i.recentEvents,n)};switch(n.type){case"job:registered":return jw(o,s);case"job:finalized":return{...o,status:oi(s.status)??"done",finishedAt:ss(s.finishedAt)??n.at,summary:oi(s.summary),error:oi(s.error)};case"track:begin":return Ca(o,s,l=>({...l,startedAt:ss(s.startedAt)??n.at,requestPreview:oi(s.requestPreview)}));case"track:status":return Ca(o,s,l=>({...l,status:oi(s.status)??l.status}));case"track:text":return Ca(o,s,l=>({...l,status:"stream",text:l.text+(oi(s.text)??""),sentTextLength:l.sentTextLength+(ss(s.textLength)??oi(s.text)?.length??0)}));case"track:thought":return Ca(o,s,l=>({...l,thought:l.thought+(oi(s.text)??""),sentThoughtLength:l.sentThoughtLength+(ss(s.textLength)??oi(s.text)?.length??0)}));case"track:tool":return Ca(o,s,l=>({...l,status:"stream",tools:Fw(l.tools,s)}));case"track:finalized":return Ca(o,s,l=>{const y=ev(l.text,l.sentTextLength,oi(s.fallbackText),ss(s.fallbackTextLength)),b=ev(l.thought,l.sentThoughtLength,oi(s.fallbackThought),ss(s.fallbackThoughtLength));return{...l,status:oi(s.status)??"done",finishedAt:ss(s.finishedAt)??n.at,error:oi(s.error),text:y.text,sentTextLength:y.sentLength,thought:b.text,sentThoughtLength:b.sentLength}});default:return o}}function X0(i,n,s){return{jobId:n,tenantId:i,status:Uw,updatedAt:s,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Zo(i){return ef.has(i)}function jw(i,n){const s=Array.isArray(n.tracks)?n.tracks:[];let o=i.trackOrder,l=i.tracks;for(const y of s){if(!y.trackId)continue;const b=l[y.trackId],c={...b??Z0(y.trackId),displayName:y.displayName??b?.displayName??y.trackId,displayCli:y.displayCli??b?.displayCli,model:y.model??b?.model,effort:y.effort??b?.effort,subtitle:y.subtitle??b?.subtitle,kind:y.kind??b?.kind,startedAt:y.startedAt??b?.startedAt};b||(o=[...o,y.trackId]),l={...l,[y.trackId]:c}}return{...i,label:oi(n.label)??i.label,ownerCarrierId:oi(n.ownerCarrierId)??i.ownerCarrierId,kind:oi(n.kind)??i.kind,startedAt:ss(n.startedAt)??i.startedAt,trackOrder:o,tracks:l}}function Ca(i,n,s){const o=oi(n.trackId);if(!o)return i;const l=i.tracks[o],y=s(l??Z0(o));return{...i,trackOrder:l?i.trackOrder:[...i.trackOrder,o],tracks:{...i.tracks,[o]:y}}}function Z0(i){return{trackId:i,displayName:i,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function ev(i,n,s,o){const l=o??s?.length??0;return s!==void 0&&l>i.length?{text:s,sentLength:Math.max(l,n)}:{text:i,sentLength:Math.max(n,l)}}function Fw(i,n){const s=oi(n.title)??"tool",o=oi(n.status)??"",l=oi(n.toolCallId),y=l??`${s}#${i.length}`;if(l){const b=i.findIndex(c=>c.key===l);if(b>=0){const c=[...i];return c[b]={key:l,title:s,status:o},c}}return[...i,{key:y,title:s,status:o}]}function qw(i,n){const s=[...i,n];return s.length>Jm?s.slice(-Jm):s}function oi(i){return typeof i=="string"?i:void 0}function ss(i){return typeof i=="number"&&Number.isFinite(i)?i:void 0}const tf=200,nf="fleet-console.activeTheaterId",Q0="fleet-console.activeTheme",Cd="maritime",rf=new Set;let Ue={connection:"connecting",connectionError:null,activeTheme:ob(),tenants:[],theaters:[],activeTheaterId:null,addingTheater:!1,theaterError:null,sessions:{},sessionOrder:[],activeTerminalSessionId:null,creatingTerminalSession:!1,terminalSessionError:null,tenantJobs:{},tenantOrder:[],timelineOpen:!1,shellOpen:!1,selectedJobId:null};function tv(){return Ue}function Ww(i){return rf.add(i),()=>{rf.delete(i)}}function bt(i){Ue={...Ue,...i},lb()}function Gw(){J0(ob())}function Kw(i){gE(i),J0(i),bt({activeTheme:i})}function J0(i){if(!(typeof document>"u")){if(i==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",i)}}function Yw(i){const n={};for(const l of i)n[l.sessionId]=rb(l);const s=[...i].sort((l,y)=>y.createdAt-l.createdAt).map(l=>l.sessionId),o=sb(n,Ue.tenants);bt({sessions:o,sessionOrder:s,activeTerminalSessionId:al(Ue.activeTheaterId,o,s,Ue.activeTerminalSessionId)})}function Vw(i){const n=_E(i,Ue.activeTheaterId);bt({theaters:i,activeTheaterId:n,activeTerminalSessionId:al(n,Ue.sessions,Ue.sessionOrder,Ue.activeTerminalSessionId),selectedJobId:null})}function Xw(i){ab(i),bt({activeTheaterId:i,activeTerminalSessionId:al(i,Ue.sessions,Ue.sessionOrder,null),selectedJobId:null})}function Zw(){bt({addingTheater:!0,theaterError:null})}function Qw(i){const n=[i,...Ue.theaters.filter(s=>s.id!==i.id)];ab(i.id),bt({theaters:n,activeTheaterId:i.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:al(i.id,Ue.sessions,Ue.sessionOrder,null),selectedJobId:null})}function Jw(){bt({addingTheater:!1,theaterError:null})}function eE(i){bt({addingTheater:!1,theaterError:i})}function tE(i){bt({activeTerminalSessionId:i,selectedJobId:null})}function iE(){bt({creatingTerminalSession:!0,terminalSessionError:null})}function nE(i){const n=rb(i);bt({sessions:{...Ue.sessions,[n.sessionId]:n},sessionOrder:[n.sessionId,...Ue.sessionOrder.filter(s=>s!==n.sessionId)],activeTerminalSessionId:!Ue.activeTheaterId||Kc(n,Ue.activeTheaterId)?n.sessionId:Ue.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function rE(i){bt({creatingTerminalSession:!1,terminalSessionError:i})}function sE(){bt({timelineOpen:!Ue.timelineOpen})}function eb(){bt({shellOpen:!Ue.shellOpen})}function Cc(){bt({shellOpen:!1})}function aE(i){bt({terminalSessionError:i})}function tb(i){if(!Ue.sessions[i])return;const n={...Ue.sessions};delete n[i];const s=Ue.sessionOrder.filter(l=>l!==i),o=Ue.activeTerminalSessionId===i;bt({sessions:n,sessionOrder:s,activeTerminalSessionId:o?s[0]??null:Ue.activeTerminalSessionId,selectedJobId:o?null:Ue.selectedJobId})}function oE(i){bt({selectedJobId:Ue.selectedJobId===i?null:i})}function wd(){bt({selectedJobId:null})}function ib(i){const n=new Set(i.map(l=>l.tenantId)),s=sb(Ue.sessions,i),o=[...i.map(l=>l.tenantId),...Ue.tenantOrder.filter(l=>!n.has(l)&&Ue.tenantJobs[l])];bt({tenants:i,sessions:s,tenantOrder:o,activeTerminalSessionId:al(Ue.activeTheaterId,s,Ue.sessionOrder,Ue.activeTerminalSessionId)})}function lE(i){const n={},s=[];for(const l of i){const y={};for(const c of l.jobs)y[c.jobId]=Pw(l.tenantId,c);const b=Object.values(y).sort((c,u)=>(c.startedAt??c.updatedAt)-(u.startedAt??u.updatedAt)).map(c=>c.jobId);n[l.tenantId]={tenantId:l.tenantId,tenantLabel:l.tenantLabel,jobOrder:b,jobs:y,truncation:l.truncation},s.push(l.tenantId)}const o=[...Ue.tenantOrder.filter(l=>n[l]),...s.filter(l=>!Ue.tenantOrder.includes(l))];bt({tenantJobs:n,tenantOrder:o.length>0?o:s})}function cE(i,n){const s=Ue.tenantJobs[i.tenantId],o=!s&&!Ue.tenants.some(c=>c.tenantId===i.tenantId),l=s??{tenantId:i.tenantId,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let y=n&&l.tenantLabel!==n?{...l,tenantLabel:n}:l;if(i.jobId){const c=y.jobs[i.jobId],u=V0(c??X0(i.tenantId,i.jobId,i.at),i),h=c?y.jobOrder:[...y.jobOrder,i.jobId];y={...y,jobs:mE({...y.jobs,[i.jobId]:u},h),jobOrder:h.slice(-tf)}}const b={...Ue.tenantJobs,[i.tenantId]:y};return Ue={...Ue,connection:"live",connectionError:null,tenantJobs:b,tenantOrder:Ue.tenantOrder.includes(i.tenantId)?Ue.tenantOrder:[...Ue.tenantOrder,i.tenantId]},lb(),{unknownTenant:o}}function uE(i,n,s){const o=Ue.tenantJobs[i]??{tenantId:i,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};bt({tenantJobs:{...Ue.tenantJobs,[i]:{...o,truncation:s}},tenantOrder:Ue.tenantOrder.includes(i)?Ue.tenantOrder:[...Ue.tenantOrder,i]})}function hE(i){if(!i.selectedJobId||i.activeTheaterId&&i.activeTerminalSessionId&&!Hf(i).includes(i.activeTerminalSessionId))return null;const n=dE(i);return n?i.tenantJobs[n]?.jobs[i.selectedJobId]??null:null}function dE(i){return i.activeTerminalSessionId?nb(i.sessions[i.activeTerminalSessionId]):null}function Hf(i){return i.activeTheaterId?i.sessionOrder.filter(n=>Kc(i.sessions[n],i.activeTheaterId)):[]}function fE(i,n){const s=nb(n);if(!s)return[];const o=i.tenantJobs[s];if(!o)return[];const l=[];for(const y of o.jobOrder){const b=o.jobs[y];b&&l.push({job:b,tenant:o})}return l}function nb(i){return i?.tenantId??i?.sessionId??null}function rb(i){return{...i,terminalSessionId:i.terminalSessionId??i.sessionId,status:i.status==="starting"&&i.tenantId?"registered":i.status}}function sb(i,n){const s={...i};for(const o of n){if(!o.terminalSessionId)continue;const l=s[o.terminalSessionId];l&&(s[o.terminalSessionId]={...l,status:o.status==="deregistered"?"closed":"registered",tenantId:o.tenantId,registrationId:o.registrationId,theaterId:o.theaterId??l.theaterId})}return s}function _E(i,n){const s=new Set(i.map(l=>l.id)),o=pE();return o&&s.has(o)?o:n&&s.has(n)?n:i[0]?.id??null}function al(i,n,s,o){return i?o&&Kc(n[o],i)?o:s.find(l=>Kc(n[l],i))??null:o&&n[o]?o:s[0]??null}function Kc(i,n){return!i||!n?!1:i.theaterId===n}function pE(){if(typeof window>"u")return null;try{return window.localStorage.getItem(nf)}catch{return null}}function ab(i){if(!(typeof window>"u"))try{i?window.localStorage.setItem(nf,i):window.localStorage.removeItem(nf)}catch{}}function ob(){if(typeof window>"u")return Cd;try{const i=window.localStorage.getItem(Q0);return i==="maritime"||i==="carbon"?i:Cd}catch{return Cd}}function gE(i){if(!(typeof window>"u"))try{window.localStorage.setItem(Q0,i)}catch{}}function mE(i,n){if(n.length<=tf)return i;const s=new Set(n.slice(-tf)),o={};for(const l of Object.keys(i))s.has(l)&&(o[l]=i[l]);return o}function lb(){for(const i of rf)i()}var Ed={exports:{}},iv;function vE(){return iv||(iv=1,(function(i,n){(function(s,o){i.exports=o()})(self,(()=>(()=>{var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const y=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(y._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,y=l._renderService.dimensions;if(y.css.cell.width===0||y.css.cell.height===0)return;const b=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),h=Math.max(0,parseInt(c.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),f=u-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),C=h-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-b;return{cols:Math.max(2,Math.floor(C/y.css.cell.width)),rows:Math.max(1,Math.floor(f/y.css.cell.height))}}}})(),s})()))})(Ed)),Ed.exports}var bE=vE();var SE=(i,n,s,o)=>{for(var l=n,y=i.length-1,b;y>=0;y--)(b=i[y])&&(l=b(l)||l);return l},yE=(i,n)=>(s,o)=>n(s,o,i),CE=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(i){setTimeout(()=>{throw i.stack?nv.isErrorNoTelemetry(i)?new nv(i.message+`
12
+
13
+ `+i.stack):new Error(i.message+`
14
+
15
+ `+i.stack):i},0)}}addListener(i){return this.listeners.push(i),()=>{this._removeListener(i)}}emit(i){this.listeners.forEach(n=>{n(i)})}_removeListener(i){this.listeners.splice(this.listeners.indexOf(i),1)}setUnexpectedErrorHandler(i){this.unexpectedErrorHandler=i}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(i){this.unexpectedErrorHandler(i),this.emit(i)}onUnexpectedExternalError(i){this.unexpectedErrorHandler(i)}},wE=new CE;function xd(i){EE(i)||wE.onUnexpectedError(i)}var sf="Canceled";function EE(i){return i instanceof xE?!0:i instanceof Error&&i.name===sf&&i.message===sf}var xE=class extends Error{constructor(){super(sf),this.name=this.message}},nv=class af extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof af)return n;let s=new af;return s.message=n.message,s.stack=n.stack,s}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},TE;(i=>{function n(y){return y<0}i.isLessThan=n;function s(y){return y<=0}i.isLessThanOrEqual=s;function o(y){return y>0}i.isGreaterThan=o;function l(y){return y===0}i.isNeitherLessOrGreaterThan=l,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(TE||={});function AE(i,n){let s=this,o=!1,l;return function(){return o||(o=!0,n||(l=i.apply(s,arguments))),l}}var cb;(i=>{function n(E){return E&&typeof E=="object"&&typeof E[Symbol.iterator]=="function"}i.is=n;let s=Object.freeze([]);function o(){return s}i.empty=o;function*l(E){yield E}i.single=l;function y(E){return n(E)?E:l(E)}i.wrap=y;function b(E){return E||s}i.from=b;function*c(E){for(let R=E.length-1;R>=0;R--)yield E[R]}i.reverse=c;function u(E){return!E||E[Symbol.iterator]().next().done===!0}i.isEmpty=u;function h(E){return E[Symbol.iterator]().next().value}i.first=h;function v(E,R){let L=0;for(let D of E)if(R(D,L++))return!0;return!1}i.some=v;function f(E,R){for(let L of E)if(R(L))return L}i.find=f;function*C(E,R){for(let L of E)R(L)&&(yield L)}i.filter=C;function*x(E,R){let L=0;for(let D of E)yield R(D,L++)}i.map=x;function*A(E,R){let L=0;for(let D of E)yield*R(D,L++)}i.flatMap=A;function*w(...E){for(let R of E)yield*R}i.concat=w;function _(E,R,L){let D=L;for(let T of E)D=R(D,T);return D}i.reduce=_;function*S(E,R,L=E.length){for(R<0&&(R+=E.length),L<0?L+=E.length:L>E.length&&(L=E.length);R<L;R++)yield E[R]}i.slice=S;function p(E,R=Number.POSITIVE_INFINITY){let L=[];if(R===0)return[L,E];let D=E[Symbol.iterator]();for(let T=0;T<R;T++){let B=D.next();if(B.done)return[L,i.empty()];L.push(B.value)}return[L,{[Symbol.iterator](){return D}}]}i.consume=p;async function m(E){let R=[];for await(let L of E)R.push(L);return Promise.resolve(R)}i.asyncToArray=m})(cb||={});function ub(i){if(cb.is(i)){let n=[];for(let s of i)if(s)try{s.dispose()}catch(o){n.push(o)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function hb(...i){return Li(()=>ub(i))}function Li(i){return{dispose:AE(()=>{i()})}}var db=class fb{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ub(this._toDispose)}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?fb.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(n),n}delete(n){if(n){if(n===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(n),n.dispose()}}deleteAndLeak(n){n&&this._toDispose.has(n)&&(this._toDispose.delete(n),void 0)}};db.DISABLE_DISPOSED_WARNING=!1;var Da=db,zn=class{constructor(){this._store=new Da,this._store}dispose(){this._store.dispose()}_register(n){if(n===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(n)}};zn.None=Object.freeze({dispose(){}});var Io=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(n){this._isDisposed||n===this._value||(this._value?.dispose(),this._value=n)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let n=this._value;return this._value=void 0,n}},zf=typeof process<"u"&&"title"in process,ou=zf?"node":navigator.userAgent,RE=zf?"node":navigator.platform,LE=ou.includes("Firefox"),kE=ou.includes("Edge"),_b=/^((?!chrome|android).)*safari/i.test(ou);function ME(){if(!_b)return 0;let i=ou.match(/Version\/(\d+)/);return i===null||i.length<2?0:parseInt(i[1])}RE.indexOf("Linux")>=0;var DE="",fi=0,_i=0,pi=0,Wt=0,yn={css:"#00000000",rgba:0},Oi;(i=>{function n(l,y,b,c){return c!==void 0?`#${Ls(l)}${Ls(y)}${Ls(b)}${Ls(c)}`:`#${Ls(l)}${Ls(y)}${Ls(b)}`}i.toCss=n;function s(l,y,b,c=255){return(l<<24|y<<16|b<<8|c)>>>0}i.toRgba=s;function o(l,y,b,c){return{css:i.toCss(l,y,b,c),rgba:i.toRgba(l,y,b,c)}}i.toColor=o})(Oi||={});var Ko;(i=>{function n(u,h){if(Wt=(h.rgba&255)/255,Wt===1)return{css:h.css,rgba:h.rgba};let v=h.rgba>>24&255,f=h.rgba>>16&255,C=h.rgba>>8&255,x=u.rgba>>24&255,A=u.rgba>>16&255,w=u.rgba>>8&255;fi=x+Math.round((v-x)*Wt),_i=A+Math.round((f-A)*Wt),pi=w+Math.round((C-w)*Wt);let _=Oi.toCss(fi,_i,pi),S=Oi.toRgba(fi,_i,pi);return{css:_,rgba:S}}i.blend=n;function s(u){return(u.rgba&255)===255}i.isOpaque=s;function o(u,h,v){let f=Os.ensureContrastRatio(u.rgba,h.rgba,v);if(f)return Oi.toColor(f>>24&255,f>>16&255,f>>8&255)}i.ensureContrastRatio=o;function l(u){let h=(u.rgba|255)>>>0;return[fi,_i,pi]=Os.toChannels(h),{css:Oi.toCss(fi,_i,pi),rgba:h}}i.opaque=l;function y(u,h){return Wt=Math.round(h*255),[fi,_i,pi]=Os.toChannels(u.rgba),{css:Oi.toCss(fi,_i,pi,Wt),rgba:Oi.toRgba(fi,_i,pi,Wt)}}i.opacity=y;function b(u,h){return Wt=u.rgba&255,y(u,Wt*h/255)}i.multiplyOpacity=b;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}i.toColorRGB=c})(Ko||={});var OE;(i=>{let n,s;try{let l=document.createElement("canvas");l.width=1,l.height=1;let y=l.getContext("2d",{willReadFrequently:!0});y&&(n=y,n.globalCompositeOperation="copy",s=n.createLinearGradient(0,0,1,1))}catch{}function o(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return fi=parseInt(l.slice(1,2).repeat(2),16),_i=parseInt(l.slice(2,3).repeat(2),16),pi=parseInt(l.slice(3,4).repeat(2),16),Oi.toColor(fi,_i,pi);case 5:return fi=parseInt(l.slice(1,2).repeat(2),16),_i=parseInt(l.slice(2,3).repeat(2),16),pi=parseInt(l.slice(3,4).repeat(2),16),Wt=parseInt(l.slice(4,5).repeat(2),16),Oi.toColor(fi,_i,pi,Wt);case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}let y=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(y)return fi=parseInt(y[1]),_i=parseInt(y[2]),pi=parseInt(y[3]),Wt=Math.round((y[5]===void 0?1:parseFloat(y[5]))*255),Oi.toColor(fi,_i,pi,Wt);if(!n||!s)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=s,n.fillStyle=l,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[fi,_i,pi,Wt]=n.getImageData(0,0,1,1).data,Wt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Oi.toRgba(fi,_i,pi,Wt),css:l}}i.toColor=o})(OE||={});var Mi;(i=>{function n(o){return s(o>>16&255,o>>8&255,o&255)}i.relativeLuminance=n;function s(o,l,y){let b=o/255,c=l/255,u=y/255,h=b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4),v=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),f=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return h*.2126+v*.7152+f*.0722}i.relativeLuminance2=s})(Mi||={});var Os;(i=>{function n(b,c){if(Wt=(c&255)/255,Wt===1)return c;let u=c>>24&255,h=c>>16&255,v=c>>8&255,f=b>>24&255,C=b>>16&255,x=b>>8&255;return fi=f+Math.round((u-f)*Wt),_i=C+Math.round((h-C)*Wt),pi=x+Math.round((v-x)*Wt),Oi.toRgba(fi,_i,pi)}i.blend=n;function s(b,c,u){let h=Mi.relativeLuminance(b>>8),v=Mi.relativeLuminance(c>>8);if(Cr(h,v)<u){if(v<h){let x=o(b,c,u),A=Cr(h,Mi.relativeLuminance(x>>8));if(A<u){let w=l(b,c,u),_=Cr(h,Mi.relativeLuminance(w>>8));return A>_?x:w}return x}let f=l(b,c,u),C=Cr(h,Mi.relativeLuminance(f>>8));if(C<u){let x=o(b,c,u),A=Cr(h,Mi.relativeLuminance(x>>8));return C>A?f:x}return f}}i.ensureContrastRatio=s;function o(b,c,u){let h=b>>24&255,v=b>>16&255,f=b>>8&255,C=c>>24&255,x=c>>16&255,A=c>>8&255,w=Cr(Mi.relativeLuminance2(C,x,A),Mi.relativeLuminance2(h,v,f));for(;w<u&&(C>0||x>0||A>0);)C-=Math.max(0,Math.ceil(C*.1)),x-=Math.max(0,Math.ceil(x*.1)),A-=Math.max(0,Math.ceil(A*.1)),w=Cr(Mi.relativeLuminance2(C,x,A),Mi.relativeLuminance2(h,v,f));return(C<<24|x<<16|A<<8|255)>>>0}i.reduceLuminance=o;function l(b,c,u){let h=b>>24&255,v=b>>16&255,f=b>>8&255,C=c>>24&255,x=c>>16&255,A=c>>8&255,w=Cr(Mi.relativeLuminance2(C,x,A),Mi.relativeLuminance2(h,v,f));for(;w<u&&(C<255||x<255||A<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),w=Cr(Mi.relativeLuminance2(C,x,A),Mi.relativeLuminance2(h,v,f));return(C<<24|x<<16|A<<8|255)>>>0}i.increaseLuminance=l;function y(b){return[b>>24&255,b>>16&255,b>>8&255,b&255]}i.toChannels=y})(Os||={});function Ls(i){let n=i.toString(16);return n.length<2?"0"+n:n}function Cr(i,n){return i<n?(n+.05)/(i+.05):(i+.05)/(n+.05)}function li(i){if(!i)throw new Error("value must not be falsy");return i}function $f(i){return 57508<=i&&i<=57558}function BE(i){return 57520<=i&&i<=57527}function NE(i){return 57344<=i&&i<=63743}function IE(i){return 9472<=i&&i<=9631}function HE(i){return i>=128512&&i<=128591||i>=127744&&i<=128511||i>=128640&&i<=128767||i>=9728&&i<=9983||i>=9984&&i<=10175||i>=65024&&i<=65039||i>=129280&&i<=129535||i>=127462&&i<=127487}function zE(i,n,s,o){return n===1&&s>Math.ceil(o*1.5)&&i!==void 0&&i>255&&!HE(i)&&!$f(i)&&!NE(i)}function pb(i){return $f(i)||IE(i)}function $E(){return{css:{canvas:wc(),cell:wc()},device:{canvas:wc(),cell:wc(),char:{width:0,height:0,left:0,top:0}}}}function wc(){return{width:0,height:0}}function UE(i,n,s=0){return(i-(Math.round(n)*2-s))%(Math.round(n)*2)}var Ei=0,di=0,Kn=!1,wr=!1,Ec=!1,Gi,Td=0,PE=class{constructor(i,n,s,o,l,y){this._terminal=i,this._optionService=n,this._selectionRenderModel=s,this._decorationService=o,this._coreBrowserService=l,this._themeService=y,this.result={fg:0,bg:0,ext:0}}resolve(i,n,s,o){if(this.result.bg=i.bg,this.result.fg=i.fg,this.result.ext=i.bg&268435456?i.extended.ext:0,di=0,Ei=0,wr=!1,Kn=!1,Ec=!1,Gi=this._themeService.colors,Td=0,i.getCode()!==0&&i.extended.underlineStyle===4){let l=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Td=n*o%(Math.round(l)*2)}if(this._decorationService.forEachDecorationAtCell(n,s,"bottom",l=>{l.backgroundColorRGB&&(di=l.backgroundColorRGB.rgba>>8&16777215,wr=!0),l.foregroundColorRGB&&(Ei=l.foregroundColorRGB.rgba>>8&16777215,Kn=!0)}),Ec=this._selectionRenderModel.isCellSelected(this._terminal,n,s),Ec){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:di=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:di=(this.result.fg&16777215)<<8|255;break;default:di=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:di=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:di=(this.result.bg&16777215)<<8|255;break}di=Os.blend(di,(this._coreBrowserService.isFocused?Gi.selectionBackgroundOpaque:Gi.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else di=(this._coreBrowserService.isFocused?Gi.selectionBackgroundOpaque:Gi.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(wr=!0,Gi.selectionForeground&&(Ei=Gi.selectionForeground.rgba>>8&16777215,Kn=!0),pb(i.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Ei=(this._coreBrowserService.isFocused?Gi.selectionBackgroundOpaque:Gi.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Ei=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Ei=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Ei=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Ei=(this.result.fg&16777215)<<8|255;break;default:Ei=this._themeService.colors.foreground.rgba}Ei=Os.blend(Ei,(this._coreBrowserService.isFocused?Gi.selectionBackgroundOpaque:Gi.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Kn=!0}}this._decorationService.forEachDecorationAtCell(n,s,"top",l=>{l.backgroundColorRGB&&(di=l.backgroundColorRGB.rgba>>8&16777215,wr=!0),l.foregroundColorRGB&&(Ei=l.foregroundColorRGB.rgba>>8&16777215,Kn=!0)}),wr&&(Ec?di=i.bg&-16777216&-134217729|di|50331648:di=i.bg&-16777216|di|50331648),Kn&&(Ei=i.fg&-16777216&-67108865|Ei|50331648),this.result.fg&67108864&&(wr&&!Kn&&((this.result.bg&50331648)===0?Ei=this.result.fg&-134217728|Gi.background.rgba>>8&16777215&16777215|50331648:Ei=this.result.fg&-134217728|this.result.bg&67108863,Kn=!0),!wr&&Kn&&((this.result.fg&50331648)===0?di=this.result.bg&-67108864|Gi.foreground.rgba>>8&16777215&16777215|50331648:di=this.result.bg&-67108864|this.result.fg&67108863,wr=!0)),Gi=void 0,this.result.bg=wr?di:this.result.bg,this.result.fg=Kn?Ei:this.result.fg,this.result.ext&=536870911,this.result.ext|=Td<<29&3758096384}},jE=.5,gb=LE||kE?"bottom":"ideographic",FE={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},qE={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},WE={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(i,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(i,n)=>`M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1`},"╒":{1:(i,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(i,n)=>`M${.5-i},1 L${.5-i},.5 L1,.5 M${.5+i},.5 L${.5+i},1`},"╔":{1:(i,n)=>`M1,${.5-n} L${.5-i},${.5-n} L${.5-i},1 M1,${.5+n} L${.5+i},${.5+n} L${.5+i},1`},"╕":{1:(i,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(i,n)=>`M${.5+i},1 L${.5+i},.5 L0,.5 M${.5-i},.5 L${.5-i},1`},"╗":{1:(i,n)=>`M0,${.5+n} L${.5-i},${.5+n} L${.5-i},1 M0,${.5-n} L${.5+i},${.5-n} L${.5+i},1`},"╘":{1:(i,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(i,n)=>`M1,.5 L${.5-i},.5 L${.5-i},0 M${.5+i},.5 L${.5+i},0`},"╚":{1:(i,n)=>`M1,${.5-n} L${.5+i},${.5-n} L${.5+i},0 M1,${.5+n} L${.5-i},${.5+n} L${.5-i},0`},"╛":{1:(i,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(i,n)=>`M0,.5 L${.5+i},.5 L${.5+i},0 M${.5-i},.5 L${.5-i},0`},"╝":{1:(i,n)=>`M0,${.5-n} L${.5-i},${.5-n} L${.5-i},0 M0,${.5+n} L${.5+i},${.5+n} L${.5+i},0`},"╞":{1:(i,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(i,n)=>`M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1 M${.5+i},.5 L1,.5`},"╠":{1:(i,n)=>`M${.5-i},0 L${.5-i},1 M1,${.5+n} L${.5+i},${.5+n} L${.5+i},1 M1,${.5-n} L${.5+i},${.5-n} L${.5+i},0`},"╡":{1:(i,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(i,n)=>`M0,.5 L${.5-i},.5 M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1`},"╣":{1:(i,n)=>`M${.5+i},0 L${.5+i},1 M0,${.5+n} L${.5-i},${.5+n} L${.5-i},1 M0,${.5-n} L${.5-i},${.5-n} L${.5-i},0`},"╤":{1:(i,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(i,n)=>`M0,.5 L1,.5 M${.5-i},.5 L${.5-i},1 M${.5+i},.5 L${.5+i},1`},"╦":{1:(i,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-i},${.5+n} L${.5-i},1 M1,${.5+n} L${.5+i},${.5+n} L${.5+i},1`},"╧":{1:(i,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(i,n)=>`M0,.5 L1,.5 M${.5-i},.5 L${.5-i},0 M${.5+i},.5 L${.5+i},0`},"╩":{1:(i,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-i},${.5-n} L${.5-i},0 M1,${.5-n} L${.5+i},${.5-n} L${.5+i},0`},"╪":{1:(i,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(i,n)=>`M0,.5 L1,.5 M${.5-i},0 L${.5-i},1 M${.5+i},0 L${.5+i},1`},"╬":{1:(i,n)=>`M0,${.5+n} L${.5-i},${.5+n} L${.5-i},1 M1,${.5+n} L${.5+i},${.5+n} L${.5+i},1 M0,${.5-n} L${.5-i},${.5-n} L${.5-i},0 M1,${.5-n} L${.5+i},${.5-n} L${.5+i},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(i,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(i,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(i,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(i,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},il={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};il[""]=il[""];il[""]=il[""];function GE(i,n,s,o,l,y,b,c){let u=FE[n];if(u)return KE(i,u,s,o,l,y),!0;let h=qE[n];if(h)return YE(i,h,s,o,l,y),!0;let v=WE[n];if(v)return VE(i,v,s,o,l,y,c),!0;let f=il[n];return f?(XE(i,f,s,o,l,y,b,c),!0):!1}function KE(i,n,s,o,l,y){for(let b=0;b<n.length;b++){let c=n[b],u=l/8,h=y/8;i.fillRect(s+c.x*u,o+c.y*h,c.w*u,c.h*h)}}var rv=new Map;function YE(i,n,s,o,l,y){let b=rv.get(n);b||(b=new Map,rv.set(n,b));let c=i.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=b.get(c);if(!u){let h=n[0].length,v=n.length,f=i.canvas.ownerDocument.createElement("canvas");f.width=h,f.height=v;let C=li(f.getContext("2d")),x=new ImageData(h,v),A,w,_,S;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),w=parseInt(c.slice(3,5),16),_=parseInt(c.slice(5,7),16),S=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,w,_,S]=c.substring(5,c.length-1).split(",").map(p=>parseFloat(p));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let p=0;p<v;p++)for(let m=0;m<h;m++)x.data[(p*h+m)*4]=A,x.data[(p*h+m)*4+1]=w,x.data[(p*h+m)*4+2]=_,x.data[(p*h+m)*4+3]=n[p][m]*(S*255);C.putImageData(x,0,0),u=li(i.createPattern(f,null)),b.set(c,u)}i.fillStyle=u,i.fillRect(s,o,l,y)}function VE(i,n,s,o,l,y,b){i.strokeStyle=i.fillStyle;for(let[c,u]of Object.entries(n)){i.beginPath(),i.lineWidth=b*Number.parseInt(c);let h;if(typeof u=="function"){let v=.15/y*l;h=u(.15,v)}else h=u;for(let v of h.split(" ")){let f=v[0],C=mb[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let x=v.substring(1).split(",");!x[0]||!x[1]||C(i,vb(x,l,y,s,o,!0,b))}i.stroke(),i.closePath()}}function XE(i,n,s,o,l,y,b,c){let u=new Path2D;u.rect(s,o,l,y),i.clip(u),i.beginPath();let h=b/12;i.lineWidth=c*h;for(let v of n.d.split(" ")){let f=v[0],C=mb[f];if(!C){console.error(`Could not find drawing instructions for "${f}"`);continue}let x=v.substring(1).split(",");!x[0]||!x[1]||C(i,vb(x,l,y,s,o,!1,c,(n.leftPadding??0)*(h/2),(n.rightPadding??0)*(h/2)))}n.type===1?(i.strokeStyle=i.fillStyle,i.stroke()):i.fill(),i.closePath()}function sv(i,n,s=0){return Math.max(Math.min(i,n),s)}var mb={C:(i,n)=>i.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(i,n)=>i.lineTo(n[0],n[1]),M:(i,n)=>i.moveTo(n[0],n[1])};function vb(i,n,s,o,l,y,b,c=0,u=0){let h=i.map(v=>parseFloat(v)||parseInt(v));if(h.length<2)throw new Error("Too few arguments for instruction");for(let v=0;v<h.length;v+=2)h[v]*=n-c*b-u*b,y&&h[v]!==0&&(h[v]=sv(Math.round(h[v]+.5)-.5,n,0)),h[v]+=o+c*b;for(let v=1;v<h.length;v+=2)h[v]*=s,y&&h[v]!==0&&(h[v]=sv(Math.round(h[v]+.5)-.5,s,0)),h[v]+=l;return h}var av=class{constructor(){this._data={}}set(i,n,s){this._data[i]||(this._data[i]={}),this._data[i][n]=s}get(i,n){return this._data[i]?this._data[i][n]:void 0}clear(){this._data={}}},ov=class{constructor(){this._data=new av}set(i,n,s,o,l){this._data.get(i,n)||this._data.set(i,n,new av),this._data.get(i,n).set(s,o,l)}get(i,n,s,o){return this._data.get(i,n)?.get(s,o)}clear(){this._data.clear()}},bb=class{constructor(){this._tasks=[],this._i=0}enqueue(i){this._tasks.push(i),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(i){this._idleCallback=void 0;let n=0,s=0,o=i.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),s=Math.max(n,s),l=i.timeRemaining(),s*1.5>l){o-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-n))}ms`),this._start();return}o=l}this.clear()}},ZE=class extends bb{_requestCallback(i){return setTimeout(()=>i(this._createDeadline(16)))}_cancelCallback(i){clearTimeout(i)}_createDeadline(i){let n=performance.now()+i;return{timeRemaining:()=>Math.max(0,n-performance.now())}}},QE=class extends bb{_requestCallback(i){return requestIdleCallback(i)}_cancelCallback(i){cancelIdleCallback(i)}},JE=!zf&&"requestIdleCallback"in window?QE:ZE,La=class Sb{constructor(){this.fg=0,this.bg=0,this.extended=new yb}static toColorRGB(n){return[n>>>16&255,n>>>8&255,n&255]}static fromColorRGB(n){return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255}clone(){let n=new Sb;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},yb=class Cb{constructor(n=0,s=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=s}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(n){this._ext&=-67108864,this._ext|=n&67108863}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){let n=(this._ext&3758096384)>>29;return n<0?n^4294967288:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}clone(){return new Cb(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ex=globalThis.performance&&typeof globalThis.performance.now=="function",tx=class wb{static create(n){return new wb(n)}constructor(n){this._now=ex&&n===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Rr;(i=>{i.None=()=>zn.None;function n(F,I){return f(F,()=>{},0,void 0,!0,void 0,I)}i.defer=n;function s(F){return(I,Z=null,ee)=>{let j=!1,Y;return Y=F(K=>{if(!j)return Y?Y.dispose():j=!0,I.call(Z,K)},null,ee),j&&Y.dispose(),Y}}i.once=s;function o(F,I,Z){return h((ee,j=null,Y)=>F(K=>ee.call(j,I(K)),null,Y),Z)}i.map=o;function l(F,I,Z){return h((ee,j=null,Y)=>F(K=>{I(K),ee.call(j,K)},null,Y),Z)}i.forEach=l;function y(F,I,Z){return h((ee,j=null,Y)=>F(K=>I(K)&&ee.call(j,K),null,Y),Z)}i.filter=y;function b(F){return F}i.signal=b;function c(...F){return(I,Z=null,ee)=>{let j=hb(...F.map(Y=>Y(K=>I.call(Z,K))));return v(j,ee)}}i.any=c;function u(F,I,Z,ee){let j=Z;return o(F,Y=>(j=I(j,Y),j),ee)}i.reduce=u;function h(F,I){let Z,ee={onWillAddFirstListener(){Z=F(j.fire,j)},onDidRemoveLastListener(){Z?.dispose()}},j=new kt(ee);return I?.add(j),j.event}function v(F,I){return I instanceof Array?I.push(F):I&&I.add(F),F}function f(F,I,Z=100,ee=!1,j=!1,Y,K){let O,H,M,U=0,V,ae={leakWarningThreshold:Y,onWillAddFirstListener(){O=F(me=>{U++,H=I(H,me),ee&&!M&&(ce.fire(H),H=void 0),V=()=>{let Q=H;H=void 0,M=void 0,(!ee||U>1)&&ce.fire(Q),U=0},typeof Z=="number"?(clearTimeout(M),M=setTimeout(V,Z)):M===void 0&&(M=0,queueMicrotask(V))})},onWillRemoveListener(){j&&U>0&&V?.()},onDidRemoveLastListener(){V=void 0,O.dispose()}},ce=new kt(ae);return K?.add(ce),ce.event}i.debounce=f;function C(F,I=0,Z){return i.debounce(F,(ee,j)=>ee?(ee.push(j),ee):[j],I,void 0,!0,void 0,Z)}i.accumulate=C;function x(F,I=(ee,j)=>ee===j,Z){let ee=!0,j;return y(F,Y=>{let K=ee||!I(Y,j);return ee=!1,j=Y,K},Z)}i.latch=x;function A(F,I,Z){return[i.filter(F,I,Z),i.filter(F,ee=>!I(ee),Z)]}i.split=A;function w(F,I=!1,Z=[],ee){let j=Z.slice(),Y=F(H=>{j?j.push(H):O.fire(H)});ee&&ee.add(Y);let K=()=>{j?.forEach(H=>O.fire(H)),j=null},O=new kt({onWillAddFirstListener(){Y||(Y=F(H=>O.fire(H)),ee&&ee.add(Y))},onDidAddFirstListener(){j&&(I?setTimeout(K):K())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return ee&&ee.add(O),O.event}i.buffer=w;function _(F,I){return(Z,ee,j)=>{let Y=I(new p);return F(function(K){let O=Y.evaluate(K);O!==S&&Z.call(ee,O)},void 0,j)}}i.chain=_;let S=Symbol("HaltChainable");class p{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(Z=>(I(Z),Z)),this}filter(I){return this.steps.push(Z=>I(Z)?Z:S),this}reduce(I,Z){let ee=Z;return this.steps.push(j=>(ee=I(ee,j),ee)),this}latch(I=(Z,ee)=>Z===ee){let Z=!0,ee;return this.steps.push(j=>{let Y=Z||!I(j,ee);return Z=!1,ee=j,Y?j:S}),this}evaluate(I){for(let Z of this.steps)if(I=Z(I),I===S)break;return I}}function m(F,I,Z=ee=>ee){let ee=(...O)=>K.fire(Z(...O)),j=()=>F.on(I,ee),Y=()=>F.removeListener(I,ee),K=new kt({onWillAddFirstListener:j,onDidRemoveLastListener:Y});return K.event}i.fromNodeEventEmitter=m;function E(F,I,Z=ee=>ee){let ee=(...O)=>K.fire(Z(...O)),j=()=>F.addEventListener(I,ee),Y=()=>F.removeEventListener(I,ee),K=new kt({onWillAddFirstListener:j,onDidRemoveLastListener:Y});return K.event}i.fromDOMEventEmitter=E;function R(F){return new Promise(I=>s(F)(I))}i.toPromise=R;function L(F){let I=new kt;return F.then(Z=>{I.fire(Z)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}i.fromPromise=L;function D(F,I){return F(Z=>I.fire(Z))}i.forward=D;function T(F,I,Z){return I(Z),F(ee=>I(ee))}i.runAndSubscribe=T;class B{constructor(I,Z){this._observable=I,this._counter=0,this._hasChanged=!1;let ee={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new kt(ee),Z&&Z.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,Z){this._hasChanged=!0}endUpdate(I){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(F,I){return new B(F,I).emitter.event}i.fromObservable=W;function P(F){return(I,Z,ee)=>{let j=0,Y=!1,K={beginUpdate(){j++},endUpdate(){j--,j===0&&(F.reportChanges(),Y&&(Y=!1,I.call(Z)))},handlePossibleChange(){},handleChange(){Y=!0}};F.addObserver(K),F.reportChanges();let O={dispose(){F.removeObserver(K)}};return ee instanceof Da?ee.add(O):Array.isArray(ee)&&ee.push(O),O}}i.fromObservableLight=P})(Rr||={});var of=class lf{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${lf._idPool++}`,lf.all.add(this)}start(n){this._stopWatch=new tx,this.listenerCount=n}stop(){if(this._stopWatch){let n=this._stopWatch.elapsed();this.durations.push(n),this.elapsedOverall+=n,this.invocationCount+=1,this._stopWatch=void 0}}};of.all=new Set,of._idPool=0;var ix=of,nx=-1,Eb=class xb{constructor(n,s,o=(xb._idPool++).toString(16).padStart(3,"0")){this._errorHandler=n,this.threshold=s,this.name=o,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(n,s){let o=this.threshold;if(o<=0||s<o)return;this._stacks||(this._stacks=new Map);let l=this._stacks.get(n.value)||0;if(this._stacks.set(n.value,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let[y,b]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${b}):`;console.warn(c),console.warn(y);let u=new ax(c,y);this._errorHandler(u)}return()=>{let y=this._stacks.get(n.value)||0;this._stacks.set(n.value,y-1)}}getMostFrequentStack(){if(!this._stacks)return;let n,s=0;for(let[o,l]of this._stacks)(!n||s<l)&&(n=[o,l],s=l);return n}};Eb._idPool=1;var rx=Eb,sx=class Tb{constructor(n){this.value=n}static create(){let n=new Error;return new Tb(n.stack??"")}print(){console.warn(this.value.split(`
16
+ `).slice(2).join(`
17
+ `))}},ax=class extends Error{constructor(i,n){super(i),this.name="ListenerLeakError",this.stack=n}},ox=class extends Error{constructor(i,n){super(i),this.name="ListenerRefusalError",this.stack=n}},lx=0,Ad=class{constructor(n){this.value=n,this.id=lx++}},cx=2,ux,kt=class{constructor(n){this._size=0,this._options=n,this._leakageMon=this._options?.leakWarningThreshold?new rx(n?.onListenerError??xd,this._options?.leakWarningThreshold??nx):void 0,this._perfMon=this._options?._profName?new ix(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(n,s,o)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new ox(`${c}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||xd)(h),zn.None}if(this._disposed)return zn.None;s&&(n=n.bind(s));let l=new Ad(n),y;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(l.stack=sx.create(),y=this._leakageMon.check(l.stack,this._size+1)),this._listeners?this._listeners instanceof Ad?(this._deliveryQueue??=new hx,this._listeners=[this._listeners,l]):this._listeners.push(l):(this._options?.onWillAddFirstListener?.(this),this._listeners=l,this._options?.onDidAddFirstListener?.(this)),this._size++;let b=Li(()=>{y?.(),this._removeListener(l)});return o instanceof Da?o.add(b):Array.isArray(o)&&o.push(b),b},this._event}_removeListener(n){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let s=this._listeners,o=s.indexOf(n);if(o===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[o]=void 0;let l=this._deliveryQueue.current===this;if(this._size*cx<=s.length){let y=0;for(let b=0;b<s.length;b++)s[b]?s[y++]=s[b]:l&&(this._deliveryQueue.end--,y<this._deliveryQueue.i&&this._deliveryQueue.i--);s.length=y}}_deliver(n,s){if(!n)return;let o=this._options?.onListenerError||xd;if(!o){n.value(s);return}try{n.value(s)}catch(l){o(l)}}_deliverQueue(n){let s=n.current._listeners;for(;n.i<n.end;)this._deliver(s[n.i++],n.value);n.reset()}fire(n){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Ad)this._deliver(this._listeners,n);else{let s=this._deliveryQueue;s.enqueue(this,n,this._listeners.length),this._deliverQueue(s)}this._perfMon?.stop()}hasListeners(){return this._size>0}},hx=class{constructor(){this.i=-1,this.end=0}enqueue(i,n,s){this.i=0,this.end=s,this.current=i,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},lv={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},Ho=2,zo,as=class Ta{constructor(n,s,o){this._document=n,this._config=s,this._unicodeService=o,this._didWarmUp=!1,this._cacheMap=new ov,this._cacheMapCombined=new ov,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new La,this._textureSize=512,this._onAddTextureAtlasCanvas=new kt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new kt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Ab(n,this._config.deviceCellWidth*4+Ho*2,this._config.deviceCellHeight+Ho*2),this._tmpCtx=li(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let n of this.pages)n.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let n=new JE;for(let s=33;s<126;s++)n.enqueue(()=>{if(!this._cacheMap.get(s,0,0,0)){let o=this._drawToCache(s,0,0,0,!1,void 0);this._cacheMap.set(s,0,0,0,o)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let n of this._pages)n.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Ta.maxAtlasPages&&this._pages.length>=Math.max(4,Ta.maxAtlasPages)){let s=this._pages.filter(h=>h.canvas.width*2<=(Ta.maxTextureSize||4096)).sort((h,v)=>v.canvas.width!==h.canvas.width?v.canvas.width-h.canvas.width:v.percentageUsed-h.percentageUsed),o=-1,l=0;for(let h=0;h<s.length;h++)if(s[h].canvas.width!==l)o=h,l=s[h].canvas.width;else if(h-o===3)break;let y=s.slice(o,o+4),b=y.map(h=>h.glyphs[0].texturePage).sort((h,v)=>h>v?1:-1),c=this.pages.length-y.length,u=this._mergePages(y,c);u.version++;for(let h=b.length-1;h>=0;h--)this._deletePage(b[h]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let n=new Rd(this._document,this._textureSize);return this._pages.push(n),this._activePages.push(n),this._onAddTextureAtlasCanvas.fire(n.canvas),n}_mergePages(n,s){let o=n[0].canvas.width*2,l=new Rd(this._document,o,n);for(let[y,b]of n.entries()){let c=y*b.canvas.width%o,u=Math.floor(y/2)*b.canvas.height;l.ctx.drawImage(b.canvas,c,u);for(let v of b.glyphs)v.texturePage=s,v.sizeClipSpace.x=v.size.x/o,v.sizeClipSpace.y=v.size.y/o,v.texturePosition.x+=c,v.texturePosition.y+=u,v.texturePositionClipSpace.x=v.texturePosition.x/o,v.texturePositionClipSpace.y=v.texturePosition.y/o;this._onRemoveTextureAtlasCanvas.fire(b.canvas);let h=this._activePages.indexOf(b);h!==-1&&this._activePages.splice(h,1)}return l}_deletePage(n){this._pages.splice(n,1);for(let s=n;s<this._pages.length;s++){let o=this._pages[s];for(let l of o.glyphs)l.texturePage--;o.version++}}getRasterizedGlyphCombinedChar(n,s,o,l,y,b){return this._getFromCacheMap(this._cacheMapCombined,n,s,o,l,y,b)}getRasterizedGlyph(n,s,o,l,y,b){return this._getFromCacheMap(this._cacheMap,n,s,o,l,y,b)}_getFromCacheMap(n,s,o,l,y,b,c){return zo=n.get(s,o,l,y),zo||(zo=this._drawToCache(s,o,l,y,b,c),n.set(s,o,l,y,zo)),zo}_getColorFromAnsiIndex(n){if(n>=this._config.colors.ansi.length)throw new Error("No color found for idx "+n);return this._config.colors.ansi[n]}_getBackgroundColor(n,s,o,l){if(this._config.allowTransparency)return yn;let y;switch(n){case 16777216:case 33554432:y=this._getColorFromAnsiIndex(s);break;case 50331648:let b=La.toColorRGB(s);y=Oi.toColor(b[0],b[1],b[2]);break;default:o?y=Ko.opaque(this._config.colors.foreground):y=this._config.colors.background;break}return this._config.allowTransparency||(y=Ko.opaque(y)),y}_getForegroundColor(n,s,o,l,y,b,c,u,h,v){let f=this._getMinimumContrastColor(n,s,o,l,y,b,c,h,u,v);if(f)return f;let C;switch(y){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&b<8&&(b+=8),C=this._getColorFromAnsiIndex(b);break;case 50331648:let x=La.toColorRGB(b);C=Oi.toColor(x[0],x[1],x[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=Ko.opaque(C)),u&&(C=Ko.multiplyOpacity(C,jE)),C}_resolveBackgroundRgba(n,s,o){switch(n){case 16777216:case 33554432:return this._getColorFromAnsiIndex(s).rgba;case 50331648:return s<<8;default:return o?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(n,s,o,l){switch(n){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&l&&s<8&&(s+=8),this._getColorFromAnsiIndex(s).rgba;case 50331648:return s<<8;default:return o?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(n,s,o,l,y,b,c,u,h,v){if(this._config.minimumContrastRatio===1||v)return;let f=this._getContrastCache(h),C=f.getColor(n,l);if(C!==void 0)return C||void 0;let x=this._resolveBackgroundRgba(s,o,c),A=this._resolveForegroundRgba(y,b,c,u),w=Os.ensureContrastRatio(x,A,this._config.minimumContrastRatio/(h?2:1));if(!w){f.setColor(n,l,null);return}let _=Oi.toColor(w>>24&255,w>>16&255,w>>8&255);return f.setColor(n,l,_),_}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,s,o,l,y,b){let c=typeof n=="number"?String.fromCharCode(n):n;b&&this._tmpCanvas.parentElement!==b&&(this._tmpCanvas.style.display="none",b.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+Ho*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let h=Math.min(this._config.deviceCellHeight+Ho*4,this._textureSize);if(this._tmpCanvas.height<h&&(this._tmpCanvas.height=h),this._tmpCtx.save(),this._workAttributeData.fg=o,this._workAttributeData.bg=s,this._workAttributeData.extended.ext=l,!!this._workAttributeData.isInvisible())return lv;let v=!!this._workAttributeData.isBold(),f=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),w=!!this._workAttributeData.isStrikethrough(),_=!!this._workAttributeData.isOverline(),S=this._workAttributeData.getFgColor(),p=this._workAttributeData.getFgColorMode(),m=this._workAttributeData.getBgColor(),E=this._workAttributeData.getBgColorMode();if(f){let H=S;S=m,m=H;let M=p;p=E,E=M}let R=this._getBackgroundColor(E,m,f,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let L=v?this._config.fontWeightBold:this._config.fontWeight,D=x?"italic":"";this._tmpCtx.font=`${D} ${L} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=gb;let T=c.length===1&&$f(c.charCodeAt(0)),B=c.length===1&&BE(c.charCodeAt(0)),W=this._getForegroundColor(s,E,m,o,p,S,f,C,v,pb(c.charCodeAt(0)));this._tmpCtx.fillStyle=W.css;let P=B?0:Ho*2,F=!1;this._config.customGlyphs!==!1&&(F=GE(this._tmpCtx,c,P,P,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let I=!T,Z;if(typeof n=="number"?Z=this._unicodeService.wcwidth(n):Z=this._unicodeService.getStringCellWidth(n),A){this._tmpCtx.save();let H=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),M=H%2===1?.5:0;if(this._tmpCtx.lineWidth=H,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())I=!1,this._tmpCtx.strokeStyle=`rgb(${La.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{I=!1;let Q=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Q<8&&(Q+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Q).css}this._tmpCtx.beginPath();let U=P,V=Math.ceil(P+this._config.deviceCharHeight)-M-(y?H*2:0),ae=V+H,ce=V+H*2,me=this._workAttributeData.getUnderlineVariantOffset();for(let Q=0;Q<Z;Q++){this._tmpCtx.save();let $=U+Q*this._config.deviceCellWidth,oe=U+(Q+1)*this._config.deviceCellWidth,pe=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,V),this._tmpCtx.lineTo(oe,V),this._tmpCtx.moveTo($,ce),this._tmpCtx.lineTo(oe,ce);break;case 3:let Se=H<=1?ce:Math.ceil(P+this._config.deviceCharHeight-H/2)-M,be=H<=1?V:Math.ceil(P+this._config.deviceCharHeight+H/2)-M,ze=new Path2D;ze.rect($,V,this._config.deviceCellWidth,ce-V),this._tmpCtx.clip(ze),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,be,$,be,$,ae),this._tmpCtx.bezierCurveTo($,Se,pe,Se,pe,ae),this._tmpCtx.bezierCurveTo(pe,be,oe,be,oe,ae),this._tmpCtx.bezierCurveTo(oe,Se,oe+this._config.deviceCellWidth/2,Se,oe+this._config.deviceCellWidth/2,ae);break;case 4:let je=me===0?0:me>=H?H*2-me:H-me;me>=H||je===0?(this._tmpCtx.setLineDash([Math.round(H),Math.round(H)]),this._tmpCtx.moveTo($+je,V),this._tmpCtx.lineTo(oe,V)):(this._tmpCtx.setLineDash([Math.round(H),Math.round(H)]),this._tmpCtx.moveTo($,V),this._tmpCtx.lineTo($+je,V),this._tmpCtx.moveTo($+je+H,V),this._tmpCtx.lineTo(oe,V)),me=UE(oe-$,H,me);break;case 5:let Ke=.6,Ct=.3,Oe=oe-$,Qt=Math.floor(Ke*Oe),gi=Math.floor(Ct*Oe),mi=Oe-Qt-gi;this._tmpCtx.setLineDash([Qt,gi,mi]),this._tmpCtx.moveTo($,V),this._tmpCtx.lineTo(oe,V);break;default:this._tmpCtx.moveTo($,V),this._tmpCtx.lineTo(oe,V);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!F&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Q=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Q&&Q.actualBoundingBoxDescent>0){this._tmpCtx.save();let $=new Path2D;$.rect(U,V-Math.ceil(H/2),this._config.deviceCellWidth*Z,ce-V+Math.ceil(H/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=R.css,this._tmpCtx.strokeText(c,P,P+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(_){let H=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),M=H%2===1?.5:0;this._tmpCtx.lineWidth=H,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+M),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*Z,P+M),this._tmpCtx.stroke()}if(F||this._tmpCtx.fillText(c,P,P+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let H=Ld(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),R,W,I);if(H)for(let M=1;M<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,P,P+this._config.deviceCharHeight-M),H=Ld(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),R,W,I),!!H);M++);}if(w){let H=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),M=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=H,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+Math.floor(this._config.deviceCharHeight/2)-M),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*Z,P+Math.floor(this._config.deviceCharHeight/2)-M),this._tmpCtx.stroke()}this._tmpCtx.restore();let ee=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),j;if(this._config.allowTransparency?j=dx(ee):j=Ld(ee,R,W,I),j)return lv;let Y=this._findGlyphBoundingBox(ee,this._workBoundingBox,u,B,F,P),K,O;for(;;){if(this._activePages.length===0){let H=this._createNewPage();K=H,O=H.currentRow,O.height=Y.size.y;break}K=this._activePages[this._activePages.length-1],O=K.currentRow;for(let H of this._activePages)Y.size.y<=H.currentRow.height&&(K=H,O=H.currentRow);for(let H=this._activePages.length-1;H>=0;H--)for(let M of this._activePages[H].fixedRows)M.height<=O.height&&Y.size.y<=M.height&&(K=this._activePages[H],O=M);if(Y.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Rd(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),K=this._overflowSizePage,O=this._overflowSizePage.currentRow,O.x+Y.size.x>=K.canvas.width&&(O.x=0,O.y+=O.height,O.height=0);break}if(O.y+Y.size.y>=K.canvas.height||O.height>Y.size.y+2){let H=!1;if(K.currentRow.y+K.currentRow.height+Y.size.y>=K.canvas.height){let M;for(let U of this._activePages)if(U.currentRow.y+U.currentRow.height+Y.size.y<U.canvas.height){M=U;break}if(M)K=M;else if(Ta.maxAtlasPages&&this._pages.length>=Ta.maxAtlasPages&&O.y+Y.size.y<=K.canvas.height&&O.height>=Y.size.y&&O.x+Y.size.x<=K.canvas.width)H=!0;else{let U=this._createNewPage();K=U,O=U.currentRow,O.height=Y.size.y,H=!0}}H||(K.currentRow.height>0&&K.fixedRows.push(K.currentRow),O={x:0,y:K.currentRow.y+K.currentRow.height,height:Y.size.y},K.fixedRows.push(O),K.currentRow={x:0,y:O.y+O.height,height:0})}if(O.x+Y.size.x<=K.canvas.width)break;O===K.currentRow?(O.x=0,O.y+=O.height,O.height=0):K.fixedRows.splice(K.fixedRows.indexOf(O),1)}return Y.texturePage=this._pages.indexOf(K),Y.texturePosition.x=O.x,Y.texturePosition.y=O.y,Y.texturePositionClipSpace.x=O.x/K.canvas.width,Y.texturePositionClipSpace.y=O.y/K.canvas.height,Y.sizeClipSpace.x/=K.canvas.width,Y.sizeClipSpace.y/=K.canvas.height,O.height=Math.max(O.height,Y.size.y),O.x+=Y.size.x,K.ctx.putImageData(ee,Y.texturePosition.x-this._workBoundingBox.left,Y.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Y.size.x,Y.size.y),K.addGlyph(Y),K.version++,Y}_findGlyphBoundingBox(n,s,o,l,y,b){s.top=0;let c=l?this._config.deviceCellHeight:this._tmpCanvas.height,u=l?this._config.deviceCellWidth:o,h=!1;for(let v=0;v<c;v++){for(let f=0;f<u;f++){let C=v*this._tmpCanvas.width*4+f*4+3;if(n.data[C]!==0){s.top=v,h=!0;break}}if(h)break}s.left=0,h=!1;for(let v=0;v<b+u;v++){for(let f=0;f<c;f++){let C=f*this._tmpCanvas.width*4+v*4+3;if(n.data[C]!==0){s.left=v,h=!0;break}}if(h)break}s.right=u,h=!1;for(let v=b+u-1;v>=b;v--){for(let f=0;f<c;f++){let C=f*this._tmpCanvas.width*4+v*4+3;if(n.data[C]!==0){s.right=v,h=!0;break}}if(h)break}s.bottom=c,h=!1;for(let v=c-1;v>=0;v--){for(let f=0;f<u;f++){let C=v*this._tmpCanvas.width*4+f*4+3;if(n.data[C]!==0){s.bottom=v,h=!0;break}}if(h)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:s.right-s.left+1,y:s.bottom-s.top+1},sizeClipSpace:{x:s.right-s.left+1,y:s.bottom-s.top+1},offset:{x:-s.left+b+(l||y?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-s.top+b+(l||y?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Rd=class{constructor(i,n,s){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],s)for(let o of s)this._glyphs.push(...o.glyphs),this._usedPixels+=o._usedPixels;this.canvas=Ab(i,n,n),this.ctx=li(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(i){this._glyphs.push(i),this._usedPixels+=i.size.x*i.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function Ld(i,n,s,o){let l=n.rgba>>>24,y=n.rgba>>>16&255,b=n.rgba>>>8&255,c=s.rgba>>>24,u=s.rgba>>>16&255,h=s.rgba>>>8&255,v=Math.floor((Math.abs(l-c)+Math.abs(y-u)+Math.abs(b-h))/12),f=!0;for(let C=0;C<i.data.length;C+=4)i.data[C]===l&&i.data[C+1]===y&&i.data[C+2]===b||o&&Math.abs(i.data[C]-l)+Math.abs(i.data[C+1]-y)+Math.abs(i.data[C+2]-b)<v?i.data[C+3]=0:f=!1;return f}function dx(i){for(let n=0;n<i.data.length;n+=4)if(i.data[n+3]>0)return!1;return!0}function Ab(i,n,s){let o=i.createElement("canvas");return o.width=n,o.height=s,o}function fx(i,n,s,o,l,y,b,c){let u={foreground:y.foreground,background:y.background,cursor:yn,cursorAccent:yn,selectionForeground:yn,selectionBackgroundTransparent:yn,selectionBackgroundOpaque:yn,selectionInactiveBackgroundTransparent:yn,selectionInactiveBackgroundOpaque:yn,overviewRulerBorder:yn,scrollbarSliderBackground:yn,scrollbarSliderHoverBackground:yn,scrollbarSliderActiveBackground:yn,ansi:y.ansi.slice(),contrastCache:y.contrastCache,halfContrastCache:y.halfContrastCache};return{customGlyphs:l.customGlyphs,devicePixelRatio:b,deviceMaxTextureSize:c,letterSpacing:l.letterSpacing,lineHeight:l.lineHeight,deviceCellWidth:i,deviceCellHeight:n,deviceCharWidth:s,deviceCharHeight:o,fontFamily:l.fontFamily,fontSize:l.fontSize,fontWeight:l.fontWeight,fontWeightBold:l.fontWeightBold,allowTransparency:l.allowTransparency,drawBoldTextInBrightColors:l.drawBoldTextInBrightColors,minimumContrastRatio:l.minimumContrastRatio,colors:u}}function cv(i,n){for(let s=0;s<i.colors.ansi.length;s++)if(i.colors.ansi[s].rgba!==n.colors.ansi[s].rgba)return!1;return i.devicePixelRatio===n.devicePixelRatio&&i.customGlyphs===n.customGlyphs&&i.lineHeight===n.lineHeight&&i.letterSpacing===n.letterSpacing&&i.fontFamily===n.fontFamily&&i.fontSize===n.fontSize&&i.fontWeight===n.fontWeight&&i.fontWeightBold===n.fontWeightBold&&i.allowTransparency===n.allowTransparency&&i.deviceCharWidth===n.deviceCharWidth&&i.deviceCharHeight===n.deviceCharHeight&&i.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&i.minimumContrastRatio===n.minimumContrastRatio&&i.colors.foreground.rgba===n.colors.foreground.rgba&&i.colors.background.rgba===n.colors.background.rgba}function _x(i){return(i&50331648)===16777216||(i&50331648)===33554432}var En=[];function Rb(i,n,s,o,l,y,b,c,u){let h=fx(o,l,y,b,n,s,c,u);for(let C=0;C<En.length;C++){let x=En[C],A=x.ownedBy.indexOf(i);if(A>=0){if(cv(x.config,h))return x.atlas;x.ownedBy.length===1?(x.atlas.dispose(),En.splice(C,1)):x.ownedBy.splice(A,1);break}}for(let C=0;C<En.length;C++){let x=En[C];if(cv(x.config,h))return x.ownedBy.push(i),x.atlas}let v=i._core,f={atlas:new as(document,h,v.unicodeService),config:h,ownedBy:[i]};return En.push(f),f.atlas}function uv(i){for(let n=0;n<En.length;n++){let s=En[n].ownedBy.indexOf(i);if(s!==-1){En[n].ownedBy.length===1?(En[n].atlas.dispose(),En.splice(n,1)):En[n].ownedBy.splice(s,1);break}}}var xc=600,px=class{constructor(i,n){this._renderCallback=i,this._coreBrowserService=n,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(i=xc){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=xc-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,n>0){this._restartInterval(n);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let n=xc-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(n);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},xc)},i)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function hv(i,n,s){let o=new n.ResizeObserver(l=>{let y=l.find(u=>u.target===i);if(!y)return;if(!("devicePixelContentBoxSize"in y)){o?.disconnect(),o=void 0;return}let b=y.devicePixelContentBoxSize[0].inlineSize,c=y.devicePixelContentBoxSize[0].blockSize;b>0&&c>0&&s(b,c)});try{o.observe(i,{box:["device-pixel-content-box"]})}catch{o.disconnect(),o=void 0}return Li(()=>o?.disconnect())}function gx(i){return i>65535?(i-=65536,String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):String.fromCharCode(i)}var dv=class Lb extends La{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new yb,this.combinedData=""}static fromCharData(n){let s=new Lb;return s.setFromCharData(n),s}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?gx(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(n){this.fg=n[0],this.bg=0;let s=!1;if(n[1].length>2)s=!0;else if(n[1].length===2){let o=n[1].charCodeAt(0);if(55296<=o&&o<=56319){let l=n[1].charCodeAt(1);56320<=l&&l<=57343?this.content=(o-55296)*1024+l-56320+65536|n[2]<<22:s=!0}else s=!0}else this.content=n[1].charCodeAt(0)|n[2]<<22;s&&(this.combinedData=n[1],this.content=2097152|n[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},kb=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function Mb(i,n,s){let o=li(i.createProgram());if(i.attachShader(o,li(fv(i,i.VERTEX_SHADER,n))),i.attachShader(o,li(fv(i,i.FRAGMENT_SHADER,s))),i.linkProgram(o),i.getProgramParameter(o,i.LINK_STATUS))return o;console.error(i.getProgramInfoLog(o)),i.deleteProgram(o)}function fv(i,n,s){let o=li(i.createShader(n));if(i.shaderSource(o,s),i.compileShader(o),i.getShaderParameter(o,i.COMPILE_STATUS))return o;console.error(i.getShaderInfoLog(o)),i.deleteShader(o)}function mx(i,n){let s=Math.min(i.length*2,n),o=new Float32Array(s);for(let l=0;l<i.length;l++)o[l]=i[l];return o}var vx=class{constructor(i){this.texture=i,this.version=-1}},bx=`#version 300 es
18
+ layout (location = 0) in vec2 a_unitquad;
19
+ layout (location = 1) in vec2 a_cellpos;
20
+ layout (location = 2) in vec2 a_offset;
21
+ layout (location = 3) in vec2 a_size;
22
+ layout (location = 4) in float a_texpage;
23
+ layout (location = 5) in vec2 a_texcoord;
24
+ layout (location = 6) in vec2 a_texsize;
25
+
26
+ uniform mat4 u_projection;
27
+ uniform vec2 u_resolution;
28
+
29
+ out vec2 v_texcoord;
30
+ flat out int v_texpage;
31
+
32
+ void main() {
33
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
34
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
35
+ v_texpage = int(a_texpage);
36
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
37
+ }`;function Sx(i){let n="";for(let s=1;s<i;s++)n+=` else if (v_texpage == ${s}) { outColor = texture(u_texture[${s}], v_texcoord); }`;return`#version 300 es
38
+ precision lowp float;
39
+
40
+ in vec2 v_texcoord;
41
+ flat in int v_texpage;
42
+
43
+ uniform sampler2D u_texture[${i}];
44
+
45
+ out vec4 outColor;
46
+
47
+ void main() {
48
+ if (v_texpage == 0) {
49
+ outColor = texture(u_texture[0], v_texcoord);
50
+ } ${n}
51
+ }`}var os=11,wa=os*Float32Array.BYTES_PER_ELEMENT,yx=2,Ft=0,Lt,kd=0,$o=0,Cx=class extends zn{constructor(i,n,s,o){super(),this._terminal=i,this._gl=n,this._dimensions=s,this._optionsService=o,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let l=this._gl;as.maxAtlasPages===void 0&&(as.maxAtlasPages=Math.min(32,li(l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS))),as.maxTextureSize=li(l.getParameter(l.MAX_TEXTURE_SIZE))),this._program=li(Mb(l,bx,Sx(as.maxAtlasPages))),this._register(Li(()=>l.deleteProgram(this._program))),this._projectionLocation=li(l.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=li(l.getUniformLocation(this._program,"u_resolution")),this._textureLocation=li(l.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let y=new Float32Array([0,0,1,0,0,1,1,1]),b=l.createBuffer();this._register(Li(()=>l.deleteBuffer(b))),l.bindBuffer(l.ARRAY_BUFFER,b),l.bufferData(l.ARRAY_BUFFER,y,l.STATIC_DRAW),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=l.createBuffer();this._register(Li(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=li(l.createBuffer()),this._register(Li(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,2,l.FLOAT,!1,wa,0),l.vertexAttribDivisor(2,1),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,l.FLOAT,!1,wa,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(3,1),l.enableVertexAttribArray(4),l.vertexAttribPointer(4,1,l.FLOAT,!1,wa,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(4,1),l.enableVertexAttribArray(5),l.vertexAttribPointer(5,2,l.FLOAT,!1,wa,5*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(5,1),l.enableVertexAttribArray(6),l.vertexAttribPointer(6,2,l.FLOAT,!1,wa,7*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(6,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,wa,9*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.useProgram(this._program);let h=new Int32Array(as.maxAtlasPages);for(let v=0;v<as.maxAtlasPages;v++)h[v]=v;l.uniform1iv(this._textureLocation,h),l.uniformMatrix4fv(this._projectionLocation,!1,kb),this._atlasTextures=[];for(let v=0;v<as.maxAtlasPages;v++){let f=new vx(li(l.createTexture()));this._register(Li(()=>l.deleteTexture(f.texture))),l.activeTexture(l.TEXTURE0+v),l.bindTexture(l.TEXTURE_2D,f.texture),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[v]=f}l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(i,n,s,o,l,y,b,c,u){this._updateCell(this._vertices.attributes,i,n,s,o,l,y,b,c,u)}_updateCell(i,n,s,o,l,y,b,c,u,h){if(Ft=(s*this._terminal.cols+n)*os,o===0||o===void 0){i.fill(0,Ft,Ft+os-1-yx);return}this._atlas&&(c&&c.length>1?Lt=this._atlas.getRasterizedGlyphCombinedChar(c,l,y,b,!1,this._terminal.element):Lt=this._atlas.getRasterizedGlyph(o,l,y,b,!1,this._terminal.element),kd=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),l!==h&&Lt.offset.x>kd?($o=Lt.offset.x-kd,i[Ft]=-(Lt.offset.x-$o)+this._dimensions.device.char.left,i[Ft+1]=-Lt.offset.y+this._dimensions.device.char.top,i[Ft+2]=(Lt.size.x-$o)/this._dimensions.device.canvas.width,i[Ft+3]=Lt.size.y/this._dimensions.device.canvas.height,i[Ft+4]=Lt.texturePage,i[Ft+5]=Lt.texturePositionClipSpace.x+$o/this._atlas.pages[Lt.texturePage].canvas.width,i[Ft+6]=Lt.texturePositionClipSpace.y,i[Ft+7]=Lt.sizeClipSpace.x-$o/this._atlas.pages[Lt.texturePage].canvas.width,i[Ft+8]=Lt.sizeClipSpace.y):(i[Ft]=-Lt.offset.x+this._dimensions.device.char.left,i[Ft+1]=-Lt.offset.y+this._dimensions.device.char.top,i[Ft+2]=Lt.size.x/this._dimensions.device.canvas.width,i[Ft+3]=Lt.size.y/this._dimensions.device.canvas.height,i[Ft+4]=Lt.texturePage,i[Ft+5]=Lt.texturePositionClipSpace.x,i[Ft+6]=Lt.texturePositionClipSpace.y,i[Ft+7]=Lt.sizeClipSpace.x,i[Ft+8]=Lt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&zE(o,u,Lt.size.x,this._dimensions.device.cell.width)&&(i[Ft+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let i=this._terminal,n=i.cols*i.rows*os;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let s=0;for(;s<this._vertices.attributesBuffers.length;s++)this._vertices.count!==n?this._vertices.attributesBuffers[s]=new Float32Array(n):this._vertices.attributesBuffers[s].fill(0);this._vertices.count=n,s=0;for(let o=0;o<i.rows;o++)for(let l=0;l<i.cols;l++)this._vertices.attributes[s+9]=l/i.cols,this._vertices.attributes[s+10]=o/i.rows,s+=os}handleResize(){let i=this._gl;i.useProgram(this._program),i.viewport(0,0,i.canvas.width,i.canvas.height),i.uniform2f(this._resolutionLocation,i.canvas.width,i.canvas.height),this.clear()}render(i){if(!this._atlas)return;let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let s=this._vertices.attributesBuffers[this._activeBuffer],o=0;for(let l=0;l<i.lineLengths.length;l++){let y=l*this._terminal.cols*os,b=this._vertices.attributes.subarray(y,y+i.lineLengths[l]*os);s.set(b,o),o+=b.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,s.subarray(0,o),n.STREAM_DRAW);for(let l=0;l<this._atlas.pages.length;l++)this._atlas.pages[l].version!==this._atlasTextures[l].version&&this._bindAtlasPageTexture(n,this._atlas,l);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,o/os)}setAtlas(i){this._atlas=i;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(i,n,s){i.activeTexture(i.TEXTURE0+s),i.bindTexture(i.TEXTURE_2D,this._atlasTextures[s].texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n.pages[s].canvas),i.generateMipmap(i.TEXTURE_2D),this._atlasTextures[s].version=n.pages[s].version}setDimensions(i){this._dimensions=i}},wx=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(i,n,s,o=!1){if(this.selectionStart=n,this.selectionEnd=s,!n||!s||n[0]===s[0]&&n[1]===s[1]){this.clear();return}let l=i.buffers.active.ydisp,y=n[1]-l,b=s[1]-l,c=Math.max(y,0),u=Math.min(b,i.rows-1);if(c>=i.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=o,this.viewportStartRow=y,this.viewportEndRow=b,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=n[0],this.endCol=s[0]}isCellSelected(i,n,s){return this.hasSelection?(s-=i.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&s>=this.viewportCappedStartRow&&n<this.endCol&&s<=this.viewportCappedEndRow:n<this.startCol&&s>=this.viewportCappedStartRow&&n>=this.endCol&&s<=this.viewportCappedEndRow:s>this.viewportStartRow&&s<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&s===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportStartRow&&n>=this.startCol):!1}};function Ex(){return new wx}var Yc=4,Hc=1,zc=2,Md=3,xx=2147483648,Tx=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=Ex()}resize(i,n){let s=i*n*Yc;s!==this.cells.length&&(this.cells=new Uint32Array(s),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},Ax=`#version 300 es
52
+ layout (location = 0) in vec2 a_position;
53
+ layout (location = 1) in vec2 a_size;
54
+ layout (location = 2) in vec4 a_color;
55
+ layout (location = 3) in vec2 a_unitquad;
56
+
57
+ uniform mat4 u_projection;
58
+
59
+ out vec4 v_color;
60
+
61
+ void main() {
62
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
63
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
64
+ v_color = a_color;
65
+ }`,Rx=`#version 300 es
66
+ precision lowp float;
67
+
68
+ in vec4 v_color;
69
+
70
+ out vec4 outColor;
71
+
72
+ void main() {
73
+ outColor = v_color;
74
+ }`,Ar=8,Dd=Ar*Float32Array.BYTES_PER_ELEMENT,Lx=20*Ar,_v=class{constructor(){this.attributes=new Float32Array(Lx),this.count=0}},Er=0,pv=0,gv=0,mv=0,vv=0,bv=0,Sv=0,kx=class extends zn{constructor(i,n,s,o){super(),this._terminal=i,this._gl=n,this._dimensions=s,this._themeService=o,this._vertices=new _v,this._verticesCursor=new _v;let l=this._gl;this._program=li(Mb(l,Ax,Rx)),this._register(Li(()=>l.deleteProgram(this._program))),this._projectionLocation=li(l.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let y=new Float32Array([0,0,1,0,0,1,1,1]),b=l.createBuffer();this._register(Li(()=>l.deleteBuffer(b))),l.bindBuffer(l.ARRAY_BUFFER,b),l.bufferData(l.ARRAY_BUFFER,y,l.STATIC_DRAW),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=l.createBuffer();this._register(Li(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=li(l.createBuffer()),this._register(Li(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,l.FLOAT,!1,Dd,0),l.vertexAttribDivisor(0,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,Dd,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,4,l.FLOAT,!1,Dd,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(2,1),this._updateCachedColors(o.colors),this._register(this._themeService.onChangeColors(h=>{this._updateCachedColors(h),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(i){let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,kb),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,i.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,i.count)}handleResize(){this._updateViewportRectangle()}setDimensions(i){this._dimensions=i}_updateCachedColors(i){this._bgFloat=this._colorToFloat32Array(i.background),this._cursorFloat=this._colorToFloat32Array(i.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(i){let n=this._terminal,s=this._vertices,o=1,l,y,b,c,u,h,v,f,C,x,A;for(l=0;l<n.rows;l++){for(b=-1,c=0,u=0,h=!1,y=0;y<n.cols;y++)v=(l*n.cols+y)*Yc,f=i.cells[v+Hc],C=i.cells[v+zc],x=!!(C&67108864),(f!==c||C!==u&&(h||x))&&((c!==0||h&&u!==0)&&(A=o++*Ar,this._updateRectangle(s,A,u,c,b,y,l)),b=y,c=f,u=C,h=x);(c!==0||h&&u!==0)&&(A=o++*Ar,this._updateRectangle(s,A,u,c,b,n.cols,l))}s.count=o}updateCursor(i){let n=this._verticesCursor,s=i.cursor;if(!s||s.style==="block"){n.count=0;return}let o,l=0;(s.style==="bar"||s.style==="outline")&&(o=l++*Ar,this._addRectangleFloat(n.attributes,o,s.x*this._dimensions.device.cell.width,s.y*this._dimensions.device.cell.height,s.style==="bar"?s.dpr*s.cursorWidth:s.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(s.style==="underline"||s.style==="outline")&&(o=l++*Ar,this._addRectangleFloat(n.attributes,o,s.x*this._dimensions.device.cell.width,(s.y+1)*this._dimensions.device.cell.height-s.dpr,s.width*this._dimensions.device.cell.width,s.dpr,this._cursorFloat)),s.style==="outline"&&(o=l++*Ar,this._addRectangleFloat(n.attributes,o,s.x*this._dimensions.device.cell.width,s.y*this._dimensions.device.cell.height,s.width*this._dimensions.device.cell.width,s.dpr,this._cursorFloat),o=l++*Ar,this._addRectangleFloat(n.attributes,o,(s.x+s.width)*this._dimensions.device.cell.width-s.dpr,s.y*this._dimensions.device.cell.height,s.dpr,this._dimensions.device.cell.height,this._cursorFloat)),n.count=l}_updateRectangle(i,n,s,o,l,y,b){if(s&67108864)switch(s&50331648){case 16777216:case 33554432:Er=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:Er=(s&16777215)<<8;break;default:Er=this._themeService.colors.foreground.rgba}else switch(o&50331648){case 16777216:case 33554432:Er=this._themeService.colors.ansi[o&255].rgba;break;case 50331648:Er=(o&16777215)<<8;break;default:Er=this._themeService.colors.background.rgba}i.attributes.length<n+4&&(i.attributes=mx(i.attributes,this._terminal.rows*this._terminal.cols*Ar)),pv=l*this._dimensions.device.cell.width,gv=b*this._dimensions.device.cell.height,mv=(Er>>24&255)/255,vv=(Er>>16&255)/255,bv=(Er>>8&255)/255,Sv=1,this._addRectangle(i.attributes,n,pv,gv,(y-l)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,mv,vv,bv,Sv)}_addRectangle(i,n,s,o,l,y,b,c,u,h){i[n]=s/this._dimensions.device.canvas.width,i[n+1]=o/this._dimensions.device.canvas.height,i[n+2]=l/this._dimensions.device.canvas.width,i[n+3]=y/this._dimensions.device.canvas.height,i[n+4]=b,i[n+5]=c,i[n+6]=u,i[n+7]=h}_addRectangleFloat(i,n,s,o,l,y,b){i[n]=s/this._dimensions.device.canvas.width,i[n+1]=o/this._dimensions.device.canvas.height,i[n+2]=l/this._dimensions.device.canvas.width,i[n+3]=y/this._dimensions.device.canvas.height,i[n+4]=b[0],i[n+5]=b[1],i[n+6]=b[2],i[n+7]=b[3]}_colorToFloat32Array(i){return new Float32Array([(i.rgba>>24&255)/255,(i.rgba>>16&255)/255,(i.rgba>>8&255)/255,(i.rgba&255)/255])}},Mx=class extends zn{constructor(i,n,s,o,l,y,b,c){super(),this._container=n,this._alpha=l,this._coreBrowserService=y,this._optionsService=b,this._themeService=c,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${s}-layer`),this._canvas.style.zIndex=o.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(u=>{this._refreshCharAtlas(i,u),this.reset(i)})),this._register(Li(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=li(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(i){}handleFocus(i){}handleCursorMove(i){}handleGridChanged(i,n,s){}handleSelectionChanged(i,n,s,o=!1){}_setTransparency(i,n){if(n===this._alpha)return;let s=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,s),this._refreshCharAtlas(i,this._themeService.colors),this.handleGridChanged(i,0,i.rows-1)}_refreshCharAtlas(i,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Rb(i,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(i,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(i,this._themeService.colors)}_fillBottomLineAtCells(i,n,s=1){this._ctx.fillRect(i*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,s*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(i,n,s,o){this._alpha?this._ctx.clearRect(i*this._deviceCellWidth,n*this._deviceCellHeight,s*this._deviceCellWidth,o*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(i*this._deviceCellWidth,n*this._deviceCellHeight,s*this._deviceCellWidth,o*this._deviceCellHeight))}_fillCharTrueColor(i,n,s,o){this._ctx.font=this._getFont(i,!1,!1),this._ctx.textBaseline=gb,this._clipCell(s,o,n.getWidth()),this._ctx.fillText(n.getChars(),s*this._deviceCellWidth+this._deviceCharLeft,o*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(i,n,s){this._ctx.beginPath(),this._ctx.rect(i*this._deviceCellWidth,n*this._deviceCellHeight,s*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(i,n,s){let o=n?i.options.fontWeightBold:i.options.fontWeight;return`${s?"italic":""} ${o} ${i.options.fontSize*this._coreBrowserService.dpr}px ${i.options.fontFamily}`}},Dx=class extends Mx{constructor(i,n,s,o,l,y,b){super(s,i,"link",n,!0,l,y,b),this._register(o.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(o.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(i,n){super.resize(i,n),this._state=void 0}reset(i){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let i=this._state.y2-this._state.y1-1;i>0&&this._clearCells(0,this._state.y1+1,this._state.cols,i),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(i){if(i.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:i.fg!==void 0&&_x(i.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[i.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,i.y1===i.y2)this._fillBottomLineAtCells(i.x1,i.y1,i.x2-i.x1);else{this._fillBottomLineAtCells(i.x1,i.y1,i.cols-i.x1);for(let n=i.y1+1;n<i.y2;n++)this._fillBottomLineAtCells(0,n,i.cols);this._fillBottomLineAtCells(0,i.y2,i.x2)}this._state=i}_handleHideLinkUnderline(i){this._clearCurrentLink()}},Ds=typeof window=="object"?window:globalThis,cf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new kt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new kt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(n){return this.mapWindowIdToZoomLevel.get(this.getWindowId(n))??0}setZoomLevel(n,s){if(this.getZoomLevel(s)===n)return;let o=this.getWindowId(s);this.mapWindowIdToZoomLevel.set(o,n),this._onDidChangeZoomLevel.fire(o)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,s){this.mapWindowIdToZoomFactor.set(this.getWindowId(s),n)}setFullscreen(n,s){if(this.isFullscreen(s)===n)return;let o=this.getWindowId(s);this.mapWindowIdToFullScreen.set(o,n),this._onDidChangeFullscreen.fire(o)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}};cf.INSTANCE=new cf;var Db=cf;function Ox(i,n,s){typeof n=="string"&&(n=i.matchMedia(n)),n.addEventListener("change",s)}Db.INSTANCE.onDidChangeZoomLevel;Db.INSTANCE.onDidChangeFullscreen;var Ha=typeof navigator=="object"?navigator.userAgent:"";Ha.indexOf("Firefox")>=0;Ha.indexOf("AppleWebKit")>=0;var Bx=Ha.indexOf("Chrome")>=0;!Bx&&Ha.indexOf("Safari")>=0;Ha.indexOf("Electron/")>=0;Ha.indexOf("Android")>=0;var Od=!1;if(typeof Ds.matchMedia=="function"){let i=Ds.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Ds.matchMedia("(display-mode: fullscreen)");Od=i.matches,Ox(Ds,i,({matches:s})=>{Od&&n.matches||(Od=s)})}var ka="en",Bd=!1,Ob=!1,Tc,$c=ka,yv=ka,Nx,xr,Bs=globalThis,on;typeof Bs.vscode<"u"&&typeof Bs.vscode.process<"u"?on=Bs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(on=process);var Ix=typeof on?.versions?.electron=="string",Hx=Ix&&on?.type==="renderer";if(typeof on=="object"){on.platform,on.platform,Bd=on.platform==="linux",Bd&&on.env.SNAP&&on.env.SNAP_REVISION,on.env.CI||on.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Tc=ka,$c=ka;let i=on.env.VSCODE_NLS_CONFIG;if(i)try{let n=JSON.parse(i);Tc=n.userLocale,yv=n.osLocale,$c=n.resolvedLanguage||ka,Nx=n.languagePack?.translationsConfigFile}catch{}Ob=!0}else typeof navigator=="object"&&!Hx?(xr=navigator.userAgent,xr.indexOf("Windows")>=0,xr.indexOf("Macintosh")>=0,(xr.indexOf("Macintosh")>=0||xr.indexOf("iPad")>=0||xr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Bd=xr.indexOf("Linux")>=0,xr?.indexOf("Mobi")>=0,$c=globalThis._VSCODE_NLS_LANGUAGE||ka,Tc=navigator.language.toLowerCase(),yv=Tc):console.error("Unable to resolve platform.");var Cv=Ob,Vn=xr,ns=$c,zx;(i=>{function n(){return ns}i.value=n;function s(){return ns.length===2?ns==="en":ns.length>=3?ns[0]==="e"&&ns[1]==="n"&&ns[2]==="-":!1}i.isDefaultVariant=s;function o(){return ns==="en"}i.isDefault=o})(zx||={});var $x=typeof Bs.postMessage=="function"&&!Bs.importScripts;(()=>{if($x){let i=[];Bs.addEventListener("message",s=>{if(s.data&&s.data.vscodeScheduleAsyncWork)for(let o=0,l=i.length;o<l;o++){let y=i[o];if(y.id===s.data.vscodeScheduleAsyncWork){i.splice(o,1),y.callback();return}}});let n=0;return s=>{let o=++n;i.push({id:o,callback:s}),Bs.postMessage({vscodeScheduleAsyncWork:o},"*")}}return i=>setTimeout(i)})();var Ux=!!(Vn&&Vn.indexOf("Chrome")>=0);Vn&&Vn.indexOf("Firefox")>=0;!Ux&&Vn&&Vn.indexOf("Safari")>=0;Vn&&Vn.indexOf("Edg/")>=0;Vn&&Vn.indexOf("Android")>=0;var Ea=typeof navigator=="object"?navigator:{};Cv||document.queryCommandSupported&&document.queryCommandSupported("copy")||Ea&&Ea.clipboard&&Ea.clipboard.writeText,Cv||Ea&&Ea.clipboard&&Ea.clipboard.readText;var Uf=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(i,n){this._keyCodeToStr[i]=n,this._strToKeyCode[n.toLowerCase()]=i}keyCodeToStr(i){return this._keyCodeToStr[i]}strToKeyCode(i){return this._strToKeyCode[i.toLowerCase()]||0}},Nd=new Uf,wv=new Uf,Ev=new Uf;new Array(230);var Px;(i=>{function n(c){return Nd.keyCodeToStr(c)}i.toString=n;function s(c){return Nd.strToKeyCode(c)}i.fromString=s;function o(c){return wv.keyCodeToStr(c)}i.toUserSettingsUS=o;function l(c){return Ev.keyCodeToStr(c)}i.toUserSettingsGeneral=l;function y(c){return wv.strToKeyCode(c)||Ev.strToKeyCode(c)}i.fromUserSettings=y;function b(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Nd.keyCodeToStr(c)}i.toElectronAccelerator=b})(Px||={});var Bb=Object.freeze(function(i,n){let s=setTimeout(i.bind(n),0);return{dispose(){clearTimeout(s)}}}),jx;(i=>{function n(s){return s===i.None||s===i.Cancelled||s instanceof Fx?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}i.isCancellationToken=n,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Rr.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Bb})})(jx||={});var Fx=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Bb:(this._emitter||(this._emitter=new kt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},qx;(i=>{async function n(o){let l,y=await Promise.all(o.map(b=>b.then(c=>c,c=>{l||(l=c)})));if(typeof l<"u")throw l;return y}i.settled=n;function s(o){return new Promise(async(l,y)=>{try{await o(l,y)}catch(b){y(b)}})}i.withAsyncBody=s})(qx||={});var xv=class Cn{static fromArray(n){return new Cn(s=>{s.emitMany(n)})}static fromPromise(n){return new Cn(async s=>{s.emitMany(await n)})}static fromPromises(n){return new Cn(async s=>{await Promise.all(n.map(async o=>s.emitOne(await o)))})}static merge(n){return new Cn(async s=>{await Promise.all(n.map(async o=>{for await(let l of o)s.emitOne(l)}))})}constructor(n,s){this._state=0,this._results=[],this._error=null,this._onReturn=s,this._onStateChanged=new kt,queueMicrotask(async()=>{let o={emitOne:l=>this.emitOne(l),emitMany:l=>this.emitMany(l),reject:l=>this.reject(l)};try{await Promise.resolve(n(o)),this.resolve()}catch(l){this.reject(l)}finally{o.emitOne=void 0,o.emitMany=void 0,o.reject=void 0}})}[Symbol.asyncIterator](){let n=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(n<this._results.length)return{done:!1,value:this._results[n++]};if(this._state===1)return{done:!0,value:void 0};await Rr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(n,s){return new Cn(async o=>{for await(let l of n)o.emitOne(s(l))})}map(n){return Cn.map(this,n)}static filter(n,s){return new Cn(async o=>{for await(let l of n)s(l)&&o.emitOne(l)})}filter(n){return Cn.filter(this,n)}static coalesce(n){return Cn.filter(n,s=>!!s)}coalesce(){return Cn.coalesce(this)}static async toPromise(n){let s=[];for await(let o of n)s.push(o);return s}toPromise(){return Cn.toPromise(this)}emitOne(n){this._state===0&&(this._results.push(n),this._onStateChanged.fire())}emitMany(n){this._state===0&&(this._results=this._results.concat(n),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(n){this._state===0&&(this._state=2,this._error=n,this._onStateChanged.fire())}};xv.EMPTY=xv.fromArray([]);var{getWindow:Wx}=(function(){let i=new Map,n={window:Ds,disposables:new Da};i.set(Ds.vscodeWindowId,n);let s=new kt,o=new kt,l=new kt;function y(b,c){return(typeof b=="number"?i.get(b):void 0)??(c?n:void 0)}return{onDidRegisterWindow:s.event,onWillUnregisterWindow:l.event,onDidUnregisterWindow:o.event,registerWindow(b){if(i.has(b.vscodeWindowId))return zn.None;let c=new Da,u={window:b,disposables:c.add(new Da)};return i.set(b.vscodeWindowId,u),c.add(Li(()=>{i.delete(b.vscodeWindowId),o.fire(b)})),c.add(uf(b,Kx.BEFORE_UNLOAD,()=>{l.fire(b)})),s.fire(u),c},getWindows(){return i.values()},getWindowsCount(){return i.size},getWindowId(b){return b.vscodeWindowId},hasWindow(b){return i.has(b)},getWindowById:y,getWindow(b){let c=b;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=b;return u?.view?u.view.window:Ds},getDocument(b){return Wx(b).document}}})(),Gx=class{constructor(i,n,s,o){this._node=i,this._type=n,this._handler=s,this._options=o||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function uf(i,n,s,o){return new Gx(i,n,s,o)}var Kx={BEFORE_UNLOAD:"beforeunload"},Yx=class extends zn{constructor(i,n,s,o,l,y,b,c,u){super(),this._terminal=i,this._characterJoinerService=n,this._charSizeService=s,this._coreBrowserService=o,this._coreService=l,this._decorationService=y,this._optionsService=b,this._themeService=c,this._cursorBlinkStateManager=new Io,this._charAtlasDisposable=this._register(new Io),this._observerDisposable=this._register(new Io),this._model=new Tx,this._workCell=new dv,this._workCell2=new dv,this._rectangleRenderer=this._register(new Io),this._glyphRenderer=this._register(new Io),this._onChangeTextureAtlas=this._register(new kt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new kt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new kt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new kt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new kt),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let h={antialias:!1,depth:!1,preserveDrawingBuffer:u};if(this._gl=this._canvas.getContext("webgl2",h),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new PE(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new Dx(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,b,this._themeService)],this.dimensions=$E(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(b.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(uf(this._canvas,"webglcontextlost",v=>{console.log("webglcontextlost event received"),v.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(v)},3e3)})),this._register(uf(this._canvas,"webglcontextrestored",v=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,uv(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=hv(this._canvas,this._coreBrowserService.window,(v,f)=>this._setCanvasDevicePixelDimensions(v,f)),this._register(this._coreBrowserService.onWindowChange(v=>{this._observerDisposable.value=hv(this._canvas,v,(f,C)=>this._setCanvasDevicePixelDimensions(f,C))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Li(()=>{for(let v of this._renderLayers)v.dispose();this._canvas.parentElement?.removeChild(this._canvas),uv(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(i,n){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let s of this._renderLayers)s.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let i of this._renderLayers)i.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let i of this._renderLayers)i.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(i,n,s){for(let o of this._renderLayers)o.handleSelectionChanged(this._terminal,i,n,s);this._model.selection.update(this._core,i,n,s),this._requestRedrawViewport()}handleCursorMove(){for(let i of this._renderLayers)i.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new kx(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Cx(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let i=Rb(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==i&&(this._onChangeTextureAtlas.fire(i.pages[0].canvas),this._charAtlasDisposable.value=hb(Rr.forward(i.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Rr.forward(i.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=i,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(i){this._model.clear(),i&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let i of this._renderLayers)i.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(i,n){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let s of this._renderLayers)s.handleGridChanged(this._terminal,i,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(i,n),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new px(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(i,n){let s=this._core,o=this._workCell,l,y,b,c,u,h,v=0,f=!0,C,x,A,w,_,S,p,m,E;i=Tv(i,s.rows-1,0),n=Tv(n,s.rows-1,0);let R=this._coreService.decPrivateModes.cursorStyle??s.options.cursorStyle??"block",L=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,D=L-s.buffer.ydisp,T=Math.min(this._terminal.buffer.active.cursorX,s.cols-1),B=-1,W=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let P=!1;for(y=i;y<=n;y++)for(b=y+s.buffer.ydisp,c=s.buffer.lines.get(b),this._model.lineLengths[y]=0,A=L===b,v=0,u=this._characterJoinerService.getJoinedCharacters(b),m=0;m<s.cols;m++){if(l=this._cellColorResolver.result.bg,c.loadCell(m,o),m===0&&(l=this._cellColorResolver.result.bg),h=!1,f=m>=v,C=m,u.length>0&&m===u[0][0]&&f){x=u.shift();let F=this._model.selection.isCellSelected(this._terminal,x[0],b);for(p=x[0]+1;p<x[1];p++)f&&=F===this._model.selection.isCellSelected(this._terminal,p,b);f&&=!A||T<x[0]||T>=x[1],f?(h=!0,o=new Vx(o,c.translateToString(!0,x[0],x[1]),x[1]-x[0]),C=x[1]-1):v=x[1]}if(w=o.getChars(),_=o.getCode(),p=(y*s.cols+m)*Yc,this._cellColorResolver.resolve(o,m,b,this.dimensions.device.cell.width),W&&b===L&&(m===T&&(this._model.cursor={x:T,y:D,width:o.getWidth(),style:this._coreBrowserService.isFocused?R:s.options.cursorInactiveStyle,cursorWidth:s.options.cursorWidth,dpr:this._devicePixelRatio},B=T+o.getWidth()-1),m>=T&&m<=B&&(this._coreBrowserService.isFocused&&R==="block"||this._coreBrowserService.isFocused===!1&&s.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),_!==0&&(this._model.lineLengths[y]=m+1),!(this._model.cells[p]===_&&this._model.cells[p+Hc]===this._cellColorResolver.result.bg&&this._model.cells[p+zc]===this._cellColorResolver.result.fg&&this._model.cells[p+Md]===this._cellColorResolver.result.ext)&&(P=!0,w.length>1&&(_|=xx),this._model.cells[p]=_,this._model.cells[p+Hc]=this._cellColorResolver.result.bg,this._model.cells[p+zc]=this._cellColorResolver.result.fg,this._model.cells[p+Md]=this._cellColorResolver.result.ext,S=o.getWidth(),this._glyphRenderer.value.updateCell(m,y,_,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,w,S,l),h)){for(o=this._workCell,m++;m<=C;m++)E=(y*s.cols+m)*Yc,this._glyphRenderer.value.updateCell(m,y,0,0,0,0,DE,0,0),this._model.cells[E]=0,this._model.cells[E+Hc]=this._cellColorResolver.result.bg,this._model.cells[E+zc]=this._cellColorResolver.result.fg,this._model.cells[E+Md]=this._cellColorResolver.result.ext;m--}}P&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(i,n){this._canvas.width===i&&this._canvas.height===n||(this._canvas.width=i,this._canvas.height=n,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let i=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:i,end:i})}},Vx=class extends La{constructor(i,n,s){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=n,this._width=s}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Tv(i,n,s=0){return Math.max(Math.min(i,n),s)}var Av="di$target",Rv="di$dependencies",Id=new Map;function Qn(i){if(Id.has(i))return Id.get(i);let n=function(s,o,l){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Xx(n,s,l)};return n._id=i,Id.set(i,n),n}function Xx(i,n,s){n[Av]===n?n[Rv].push({id:i,index:s}):(n[Rv]=[{id:i,index:s}],n[Av]=n)}Qn("BufferService");Qn("CoreMouseService");Qn("CoreService");Qn("CharsetService");Qn("InstantiationService");Qn("LogService");var Zx=Qn("OptionsService");Qn("OscLinkService");Qn("UnicodeService");Qn("DecorationService");var Qx={trace:0,debug:1,info:2,warn:3,error:4,off:5},Jx="xterm.js: ",Lv=class extends zn{constructor(i){super(),this._optionsService=i,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Qx[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(i){for(let n=0;n<i.length;n++)typeof i[n]=="function"&&(i[n]=i[n]())}_log(i,n,s){this._evalLazyOptionalParams(s),i.call(console,(this._optionsService.options.logger?"":Jx)+n,...s)}trace(i,...n){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,i,n)}debug(i,...n){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,i,n)}info(i,...n){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,i,n)}warn(i,...n){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,i,n)}error(i,...n){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,i,n)}};Lv=SE([yE(0,Zx)],Lv);var e5=class extends zn{constructor(i){if(_b&&ME()<16){let n={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",n))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=i,this._onChangeTextureAtlas=this._register(new kt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new kt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new kt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new kt),this.onContextLoss=this._onContextLoss.event}activate(i){let n=i._core;if(!i.element){this._register(n.onWillOpen(()=>this.activate(i)));return}this._terminal=i;let s=n.coreService,o=n.optionsService,l=n,y=l._renderService,b=l._characterJoinerService,c=l._charSizeService,u=l._coreBrowserService,h=l._decorationService;l._logService;let v=l._themeService;this._renderer=this._register(new Yx(i,b,c,u,s,h,o,v,this._preserveDrawingBuffer)),this._register(Rr.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Rr.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Rr.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Rr.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),y.setRenderer(this._renderer),this._register(Li(()=>{if(this._terminal._core._store._isDisposed)return;let f=this._terminal._core._renderService;f.setRenderer(this._terminal._core._createRenderer()),f.handleResize(i.cols,i.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},Hd={exports:{}},kv;function t5(){return kv||(kv=1,(function(i,n){(function(s,o){i.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(b,c,u){var h=this&&this.__decorate||function(p,m,E,R){var L,D=arguments.length,T=D<3?m:R===null?R=Object.getOwnPropertyDescriptor(m,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,m,E,R);else for(var B=p.length-1;B>=0;B--)(L=p[B])&&(T=(D<3?L(T):D>3?L(m,E,T):L(m,E))||T);return D>3&&T&&Object.defineProperty(m,E,T),T},v=this&&this.__param||function(p,m){return function(E,R){m(E,R,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const f=u(9042),C=u(9924),x=u(844),A=u(4725),w=u(2585),_=u(3656);let S=c.AccessibilityManager=class extends x.Disposable{constructor(p,m,E,R){super(),this._terminal=p,this._coreBrowserService=E,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let L=0;L<this._terminal.rows;L++)this._rowElements[L]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[L]);if(this._topBoundaryFocusListener=L=>this._handleBoundaryFocus(L,0),this._bottomBoundaryFocusListener=L=>this._handleBoundaryFocus(L,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((L=>this._handleResize(L.rows)))),this.register(this._terminal.onRender((L=>this._refreshRows(L.start,L.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((L=>this._handleChar(L)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
75
+ `)))),this.register(this._terminal.onA11yTab((L=>this._handleTab(L)))),this.register(this._terminal.onKey((L=>this._handleKey(L.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,_.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(p){for(let m=0;m<p;m++)this._handleChar(" ")}_handleChar(p){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===`
76
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,m){this._liveRegionDebouncer.refresh(p,m,this._terminal.rows)}_renderRows(p,m){const E=this._terminal.buffer,R=E.lines.length.toString();for(let L=p;L<=m;L++){const D=E.lines.get(E.ydisp+L),T=[],B=D?.translateToString(!0,void 0,void 0,T)||"",W=(E.ydisp+L+1).toString(),P=this._rowElements[L];P&&(B.length===0?(P.innerText=" ",this._rowColumns.set(P,[0,1])):(P.textContent=B,this._rowColumns.set(P,T)),P.setAttribute("aria-posinset",W),P.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(p,m){const E=p.target,R=this._rowElements[m===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(m===0?"1":`${this._terminal.buffer.lines.length}`)||p.relatedTarget!==R)return;let L,D;if(m===0?(L=E,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(L=this._rowElements.shift(),D=E,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(m===0?-1:1),this._rowElements[m===0?1:this._rowElements.length-2].focus(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let m={node:p.anchorNode,offset:p.anchorOffset},E={node:p.focusNode,offset:p.focusOffset};if((m.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||m.node===E.node&&m.offset>E.offset)&&([m,E]=[E,m]),m.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(m={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(m.node))return;const R=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:R,offset:R.textContent?.length??0}),!this._rowContainer.contains(E.node))return;const L=({node:B,offset:W})=>{const P=B instanceof Text?B.parentNode:B;let F=parseInt(P?.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const I=this._rowColumns.get(P);if(!I)return console.warn("columns is null. Race condition?"),null;let Z=W<I.length?I[W]:I.slice(-1)[0]+1;return Z>=this._terminal.cols&&(++F,Z=0),{row:F,column:Z}},D=L(m),T=L(E);if(D&&T){if(D.row>T.row||D.row===T.row&&D.column>=T.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(T.row-D.row)*this._terminal.cols-D.column+T.column)}}_handleResize(p){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let m=this._rowContainer.children.length;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);for(;this._rowElements.length>p;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let p=0;p<this._terminal.rows;p++)this._refreshRowDimensions(this._rowElements[p])}}_refreshRowDimensions(p){p.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=S=h([v(1,w.IInstantiationService),v(2,A.ICoreBrowserService),v(3,A.IRenderService)],S)},3614:(b,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,x){return x?"\x1B[200~"+C+"\x1B[201~":C}function v(C,x,A,w){C=h(C=u(C),A.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(C,!0),x.value=""}function f(C,x,A){const w=A.getBoundingClientRect(),_=C.clientX-w.left-10,S=C.clientY-w.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${_}px`,x.style.top=`${S}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=u,c.bracketTextForPaste=h,c.copyHandler=function(C,x){C.clipboardData&&C.clipboardData.setData("text/plain",x.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,x,A,w){C.stopPropagation(),C.clipboardData&&v(C.clipboardData.getData("text/plain"),x,A,w)},c.paste=v,c.moveTextAreaUnderMouseCursor=f,c.rightClickHandler=function(C,x,A,w,_){f(C,x,A),_&&w.rightClickSelect(C),x.value=w.selectionText,x.select()}},7239:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const h=u(1505);c.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(v,f,C){this._css.set(v,f,C)}getCss(v,f){return this._css.get(v,f)}setColor(v,f,C){this._color.set(v,f,C)}getColor(v,f){return this._color.get(v,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,h,v,f){u.addEventListener(h,v,f);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,v,f))}}}},3551:function(b,c,u){var h=this&&this.__decorate||function(S,p,m,E){var R,L=arguments.length,D=L<3?p:E===null?E=Object.getOwnPropertyDescriptor(p,m):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,p,m,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(L<3?R(D):L>3?R(p,m,D):R(p,m))||D);return L>3&&D&&Object.defineProperty(p,m,D),D},v=this&&this.__param||function(S,p){return function(m,E){p(m,E,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const f=u(3656),C=u(8460),x=u(844),A=u(2585),w=u(4725);let _=c.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(S,p,m,E,R){super(),this._element=S,this._mouseService=p,this._renderService=m,this._bufferService=E,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const p=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const m=S.composedPath();for(let E=0;E<m.length;E++){const R=m[E];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,p){this._activeProviderReplies&&p||(this._activeProviderReplies?.forEach((E=>{E?.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let m=!1;for(const[E,R]of this._linkProviderService.linkProviders.entries())p?this._activeProviderReplies?.get(E)&&(m=this._checkLinkProviderResult(E,S,m)):R.provideLinks(S.y,(L=>{if(this._isMouseOut)return;const D=L?.map((T=>({link:T})));this._activeProviderReplies?.set(E,D),m=this._checkLinkProviderResult(E,S,m),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,p){const m=new Set;for(let E=0;E<p.size;E++){const R=p.get(E);if(R)for(let L=0;L<R.length;L++){const D=R[L],T=D.link.range.start.y<S?0:D.link.range.start.x,B=D.link.range.end.y>S?this._bufferService.cols:D.link.range.end.x;for(let W=T;W<=B;W++){if(m.has(W)){R.splice(L--,1);break}m.add(W)}}}}_checkLinkProviderResult(S,p,m){if(!this._activeProviderReplies)return m;const E=this._activeProviderReplies.get(S);let R=!1;for(let L=0;L<S;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(R=!0);if(!R&&E){const L=E.find((D=>this._linkAtPosition(D.link,p)));L&&(m=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!m)for(let L=0;L<this._activeProviderReplies.size;L++){const D=this._activeProviderReplies.get(L)?.find((T=>this._linkAtPosition(T.link,p)));if(D){m=!0,this._handleNewLink(D);break}}return m}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const p=this._positionFromMouseEvent(S,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,p){this._currentLink&&this._lastMouseEvent&&(!S||!p||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(S.link,p)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:m=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==m&&(this._currentLink.state.decorations.pointerCursor=m,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",m))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:m=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==m&&(this._currentLink.state.decorations.underline=m,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,m))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((m=>{if(!this._currentLink)return;const E=m.start===0?0:m.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+m.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(E,R),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(S,p,m){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(m,p.text)}_fireUnderlineEvent(S,p){const m=S.range,E=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(m.start.x-1,m.start.y-E-1,m.end.x,m.end.y-E-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(S,p,m){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(m,p.text)}_linkAtPosition(S,p){const m=S.range.start.y*this._bufferService.cols+S.range.start.x,E=S.range.end.y*this._bufferService.cols+S.range.end.x,R=p.y*this._bufferService.cols+p.x;return m<=R&&R<=E}_positionFromMouseEvent(S,p,m){const E=m.getCoords(S,p,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,p,m,E,R){return{x1:S,y1:p,x2:m,y2:E,cols:this._bufferService.cols,fg:R}}};c.Linkifier=_=h([v(1,w.IMouseService),v(2,w.IRenderService),v(3,A.IBufferService),v(4,w.ILinkProviderService)],_)},9042:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(b,c,u){var h=this&&this.__decorate||function(w,_,S,p){var m,E=arguments.length,R=E<3?_:p===null?p=Object.getOwnPropertyDescriptor(_,S):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,_,S,p);else for(var L=w.length-1;L>=0;L--)(m=w[L])&&(R=(E<3?m(R):E>3?m(_,S,R):m(_,S))||R);return E>3&&R&&Object.defineProperty(_,S,R),R},v=this&&this.__param||function(w,_){return function(S,p){_(S,p,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const f=u(511),C=u(2585);let x=c.OscLinkProvider=class{constructor(w,_,S){this._bufferService=w,this._optionsService=_,this._oscLinkService=S}provideLinks(w,_){const S=this._bufferService.buffer.lines.get(w-1);if(!S)return void _(void 0);const p=[],m=this._optionsService.rawOptions.linkHandler,E=new f.CellData,R=S.getTrimmedLength();let L=-1,D=-1,T=!1;for(let B=0;B<R;B++)if(D!==-1||S.hasContent(B)){if(S.loadCell(B,E),E.hasExtendedAttrs()&&E.extended.urlId){if(D===-1){D=B,L=E.extended.urlId;continue}T=E.extended.urlId!==L}else D!==-1&&(T=!0);if(T||D!==-1&&B===R-1){const W=this._oscLinkService.getLinkData(L)?.uri;if(W){const P={start:{x:D+1,y:w},end:{x:B+(T||B!==R-1?0:1),y:w}};let F=!1;if(!m?.allowNonHttpProtocols)try{const I=new URL(W);["http:","https:"].includes(I.protocol)||(F=!0)}catch{F=!0}F||p.push({text:W,range:P,activate:(I,Z)=>m?m.activate(I,Z,P):A(0,Z),hover:(I,Z)=>m?.hover?.(I,Z,P),leave:(I,Z)=>m?.leave?.(I,Z,P)})}T=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=B,L=E.extended.urlId):(D=-1,L=-1)}}_(p)}};function A(w,_){if(confirm(`Do you want to navigate to ${_}?
77
+
78
+ WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=x=h([v(0,C.IBufferService),v(1,C.IOptionsService),v(2,C.IOscLinkService)],x)},6193:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,v){this._rowCount=v,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const h=u(3614),v=u(3656),f=u(3551),C=u(9042),x=u(3730),A=u(1680),w=u(3107),_=u(5744),S=u(2950),p=u(1296),m=u(428),E=u(4269),R=u(5114),L=u(8934),D=u(3230),T=u(9312),B=u(4725),W=u(6731),P=u(8055),F=u(8969),I=u(8460),Z=u(844),ee=u(6114),j=u(8437),Y=u(2584),K=u(7399),O=u(5941),H=u(9074),M=u(2585),U=u(5435),V=u(4567),ae=u(779);class ce extends F.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Q={}){super(Q),this.browser=ee,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Z.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(H.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,oe)=>this.refresh($,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,Z.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const $ of Q){let oe,pe="";switch($.index){case 256:oe="foreground",pe="10";break;case 257:oe="background",pe="11";break;case 258:oe="cursor",pe="12";break;default:oe="ansi",pe="4;"+$.index}switch($.type){case 0:const Se=P.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${pe};${(0,O.toRgbString)(Se)}${Y.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((be=>be.ansi[$.index]=P.channels.toColor(...$.color)));else{const be=oe;this._themeService.modifyColors((ze=>ze[be]=P.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Q=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(Q);if(!$)return;const oe=Math.min(this.buffer.x,this.cols-1),pe=this._renderService.dimensions.css.cell.height,Se=$.getWidth(oe),be=this._renderService.dimensions.css.cell.width*Se,ze=this.buffer.y*this._renderService.dimensions.css.cell.height,je=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=ze+"px",this.textarea.style.width=be+"px",this.textarea.style.height=pe+"px",this.textarea.style.lineHeight=pe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,h.copyHandler)($,this._selectionService)})));const Q=$=>(0,h.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,v.addDisposableDomListener)(this.element,"paste",Q)),ee.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,h.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Q.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,v.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),ee.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(m.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(W.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(B.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(p.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,$=this.element;function oe(be){const ze=Q._mouseService.getMouseReportCoords(be,Q.screenElement);if(!ze)return!1;let je,Ke;switch(be.overrideType||be.type){case"mousemove":Ke=32,be.buttons===void 0?(je=3,be.button!==void 0&&(je=be.button<3?be.button:3)):je=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":Ke=0,je=be.button<3?be.button:3;break;case"mousedown":Ke=1,je=be.button<3?be.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(be)===!1||Q.viewport.getLinesScrolled(be)===0)return!1;Ke=be.deltaY<0?0:1,je=4;break;default:return!1}return!(Ke===void 0||je===void 0||je>4)&&Q.coreMouseService.triggerMouseEvent({col:ze.col,row:ze.row,x:ze.x,y:ze.y,button:je,action:Ke,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const pe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:be=>(oe(be),be.buttons||(this._document.removeEventListener("mouseup",pe.mouseup),pe.mousedrag&&this._document.removeEventListener("mousemove",pe.mousedrag)),this.cancel(be)),wheel:be=>(oe(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&oe(be)},mousemove:be=>{be.buttons||oe(be)}};this.register(this.coreMouseService.onProtocolChange((be=>{be?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(be)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&be?pe.mousemove||($.addEventListener("mousemove",Se.mousemove),pe.mousemove=Se.mousemove):($.removeEventListener("mousemove",pe.mousemove),pe.mousemove=null),16&be?pe.wheel||($.addEventListener("wheel",Se.wheel,{passive:!1}),pe.wheel=Se.wheel):($.removeEventListener("wheel",pe.wheel),pe.wheel=null),2&be?pe.mouseup||(pe.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",pe.mouseup),pe.mouseup=null),4&be?pe.mousedrag||(pe.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",pe.mousedrag),pe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)($,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return oe(be),pe.mouseup&&this._document.addEventListener("mouseup",pe.mouseup),pe.mousedrag&&this._document.addEventListener("mousemove",pe.mousedrag),this.cancel(be)}))),this.register((0,v.addDisposableDomListener)($,"wheel",(be=>{if(!pe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const ze=this.viewport.getLinesScrolled(be);if(ze===0)return;const je=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let Ke="";for(let Ct=0;Ct<Math.abs(ze);Ct++)Ke+=je;return this.coreService.triggerDataEvent(Ke,!0),this.cancel(be,!0)}return this.viewport.handleWheel(be)?this.cancel(be):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)($,"touchstart",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,v.addDisposableDomListener)($,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(Q,$){this._renderService?.refreshRows(Q,$)}updateCursorStyle(Q){this._selectionService?.shouldColumnSelect(Q)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Q,$,oe=0){oe===1?(super.scrollLines(Q,$,oe),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Q)}paste(Q){(0,h.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,$,oe){this._selectionService.setSelection(Q,$,oe)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(Q,$){this._selectionService?.selectLines(Q,$)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!$&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,K.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),oe.type===3||oe.type===2){const pe=this.rows-1;return this.scrollLines(oe.type===2?-pe:pe),this.cancel(Q,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(oe.cancel&&this.cancel(Q,!0),!oe.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==Y.C0.ETX&&oe.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,$){const oe=Q.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||Q.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||Q.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?oe:oe&&(!$.keyCode||$.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)$=Q.charCode;else if(Q.which===null||Q.which===void 0)$=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;$=Q.which}return!(!$||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=Q.data;return this.coreService.triggerDataEvent($,!0),this.cancel(Q),!0}return!1}resize(Q,$){Q!==this.cols||$!==this.rows?super.resize(Q,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,$){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Q=1;Q<this.rows;Q++)this.buffer.lines.push(this.buffer.getBlankLine(j.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case U.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${oe};${$}t`);break;case U.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const pe=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${Se};${pe}t`)}}cancel(Q,$){if(this.options.cancelEvents||$)return Q.preventDefault(),Q.stopPropagation(),!1}}c.Terminal=ce},9924:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,v){this._rowCount=v,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=f-this._lastRefreshMs,x=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(b,c,u){var h=this&&this.__decorate||function(S,p,m,E){var R,L=arguments.length,D=L<3?p:E===null?E=Object.getOwnPropertyDescriptor(p,m):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,p,m,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(L<3?R(D):L>3?R(p,m,D):R(p,m))||D);return L>3&&D&&Object.defineProperty(p,m,D),D},v=this&&this.__param||function(S,p){return function(m,E){p(m,E,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const f=u(3656),C=u(4725),x=u(8460),A=u(844),w=u(2585);let _=c.Viewport=class extends A.Disposable{constructor(S,p,m,E,R,L,D,T){super(),this._viewportElement=S,this._scrollArea=p,this._bufferService=m,this._optionsService=E,this._charSizeService=R,this._renderService=L,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,p){const m=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&m<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const p=this._getPixelsScrolled(S);return p!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+p:this._smoothScrollState.target+=p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=p,this._bubbleScroll(S,p))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const p=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let p=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?p*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._currentRowHeight*this._bufferService.rows),p}getBufferElements(S,p){let m,E="";const R=[],L=p??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let T=S;T<L;T++){const B=D.get(T);if(!B)continue;const W=D.get(T+1)?.isWrapped;if(E+=B.translateToString(!W),!W||T===D.length-1){const P=document.createElement("div");P.textContent=E,R.push(P),E.length>0&&(m=P),E=""}}return{bufferElements:R,cursorElement:m}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let p=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(S,p){const m=this._optionsService.rawOptions.fastScrollModifier;return m==="alt"&&p.altKey||m==="ctrl"&&p.ctrlKey||m==="shift"&&p.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const p=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(S,p))}};c.Viewport=_=h([v(2,w.IBufferService),v(3,w.IOptionsService),v(4,C.ICharSizeService),v(5,C.IRenderService),v(6,C.ICoreBrowserService),v(7,C.IThemeService)],_)},3107:function(b,c,u){var h=this&&this.__decorate||function(w,_,S,p){var m,E=arguments.length,R=E<3?_:p===null?p=Object.getOwnPropertyDescriptor(_,S):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,_,S,p);else for(var L=w.length-1;L>=0;L--)(m=w[L])&&(R=(E<3?m(R):E>3?m(_,S,R):m(_,S))||R);return E>3&&R&&Object.defineProperty(_,S,R),R},v=this&&this.__param||function(w,_){return function(S,p){_(S,p,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const f=u(4725),C=u(844),x=u(2585);let A=c.BufferDecorationRenderer=class extends C.Disposable{constructor(w,_,S,p,m){super(),this._screenElement=w,this._bufferService=_,this._coreBrowserService=S,this._decorationService=p,this._renderService=m,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,C.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){const _=this._coreBrowserService.mainDocument.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",w?.options?.layer==="top"),_.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",_.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=w.options.x??0;return S&&S>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(w,_),_}_refreshStyle(w){const _=w.marker.line-this._bufferService.buffers.active.ydisp;if(_<0||_>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let S=this._decorationElements.get(w);S||(S=this._createElement(w),w.element=S,this._decorationElements.set(w,S),this._container.appendChild(S),w.onDispose((()=>{this._decorationElements.delete(w),S.remove()}))),S.style.top=_*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(S)}}_refreshXPosition(w,_=w.element){if(!_)return;const S=w.options.x??0;(w.options.anchor||"left")==="right"?_.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":_.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){this._decorationElements.get(w)?.remove(),this._decorationElements.delete(w),w.dispose()}};c.BufferDecorationRenderer=A=h([v(1,x.IBufferService),v(2,f.ICoreBrowserService),v(3,x.IDecorationService),v(4,f.IRenderService)],A)},5871:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,v){return h>=u.startBufferLine-this._linePadding[v||"full"]&&h<=u.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(b,c,u){var h=this&&this.__decorate||function(m,E,R,L){var D,T=arguments.length,B=T<3?E:L===null?L=Object.getOwnPropertyDescriptor(E,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(m,E,R,L);else for(var W=m.length-1;W>=0;W--)(D=m[W])&&(B=(T<3?D(B):T>3?D(E,R,B):D(E,R))||B);return T>3&&B&&Object.defineProperty(E,R,B),B},v=this&&this.__param||function(m,E){return function(R,L){E(R,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const f=u(5871),C=u(4725),x=u(844),A=u(2585),w={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let p=c.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(m,E,R,L,D,T,B){super(),this._viewportElement=m,this._screenElement=E,this._bufferService=R,this._decorationService=L,this._renderService=D,this._optionsService=T,this._coreBrowserService=B,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const W=this._canvas.getContext("2d");if(!W)throw new Error("Ctx cannot be null");this._ctx=W,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const m=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=m,_.center=E,_.right=m,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=_.left,S.right=_.left+_.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const m=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(m,12),6)*this._coreBrowserService.dpr);w.left=E,w.center=E,w.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const m=this._colorZoneStore.zones;for(const E of m)E.position!=="full"&&this._renderColorZone(E);for(const E of m)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(m){this._ctx.fillStyle=m.color,this._ctx.fillRect(S[m.position||"full"],Math.round((this._canvas.height-1)*(m.startBufferLine/this._bufferService.buffers.active.lines.length)-w[m.position||"full"]/2),_[m.position||"full"],Math.round((this._canvas.height-1)*((m.endBufferLine-m.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[m.position||"full"]))}_queueRefresh(m,E){this._shouldUpdateDimensions=m||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=p=h([v(2,A.IBufferService),v(3,A.IDecorationService),v(4,C.IRenderService),v(5,A.IOptionsService),v(6,C.ICoreBrowserService)],p)},2950:function(b,c,u){var h=this&&this.__decorate||function(w,_,S,p){var m,E=arguments.length,R=E<3?_:p===null?p=Object.getOwnPropertyDescriptor(_,S):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,_,S,p);else for(var L=w.length-1;L>=0;L--)(m=w[L])&&(R=(E<3?m(R):E>3?m(_,S,R):m(_,S))||R);return E>3&&R&&Object.defineProperty(_,S,R),R},v=this&&this.__param||function(w,_){return function(S,p){_(S,p,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const f=u(4725),C=u(2585),x=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,_,S,p,m,E){this._textarea=w,this._compositionView=_,this._bufferService=S,this._optionsService=p,this._coreService=m,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const _={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,_.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(_.start,_.end):this._textarea.value.substring(_.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const _=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(_,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const _=this._textarea.value,S=_.replace(w,"");this._dataAlreadySent=S,_.length>w.length?this._coreService.triggerDataEvent(S,!0):_.length<w.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):_.length===w.length&&_!==w&&this._coreService.triggerDataEvent(_,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const _=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,p=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,m=_*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=m+"px",this._compositionView.style.top=p+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=m+"px",this._textarea.style.top=p+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=A=h([v(2,C.IBufferService),v(3,C.IOptionsService),v(4,C.ICoreService),v(5,f.IRenderService)],A)},9806:(b,c)=>{function u(h,v,f){const C=f.getBoundingClientRect(),x=h.getComputedStyle(f),A=parseInt(x.getPropertyValue("padding-left")),w=parseInt(x.getPropertyValue("padding-top"));return[v.clientX-C.left-A,v.clientY-C.top-w]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,v,f,C,x,A,w,_,S){if(!A)return;const p=u(h,v,f);return p?(p[0]=Math.ceil((p[0]+(S?w/2:0))/w),p[1]=Math.ceil(p[1]/_),p[0]=Math.min(Math.max(p[0],1),C+(S?1:0)),p[1]=Math.min(Math.max(p[1],1),x),p):void 0}},9504:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function v(_,S,p,m){const E=_-f(_,p),R=S-f(S,p),L=Math.abs(E-R)-(function(D,T,B){let W=0;const P=D-f(D,B),F=T-f(T,B);for(let I=0;I<Math.abs(P-F);I++){const Z=C(D,T)==="A"?-1:1;B.buffer.lines.get(P+Z*I)?.isWrapped&&W++}return W})(_,S,p);return w(L,A(C(_,S),m))}function f(_,S){let p=0,m=S.buffer.lines.get(_),E=m?.isWrapped;for(;E&&_>=0&&_<S.rows;)p++,m=S.buffer.lines.get(--_),E=m?.isWrapped;return p}function C(_,S){return _>S?"A":"B"}function x(_,S,p,m,E,R){let L=_,D=S,T="";for(;L!==p||D!==m;)L+=E?1:-1,E&&L>R.cols-1?(T+=R.buffer.translateBufferLineToString(D,!1,_,L),L=0,_=0,D++):!E&&L<0&&(T+=R.buffer.translateBufferLineToString(D,!1,0,_+1),L=R.cols-1,_=L,D--);return T+R.buffer.translateBufferLineToString(D,!1,_,L)}function A(_,S){const p=S?"O":"[";return h.C0.ESC+p+_}function w(_,S){_=Math.floor(_);let p="";for(let m=0;m<_;m++)p+=S;return p}c.moveToCellSequence=function(_,S,p,m){const E=p.buffer.x,R=p.buffer.y;if(!p.buffer.hasScrollback)return(function(T,B,W,P,F,I){return v(B,P,F,I).length===0?"":w(x(T,B,T,B-f(B,F),!1,F).length,A("D",I))})(E,R,0,S,p,m)+v(R,S,p,m)+(function(T,B,W,P,F,I){let Z;Z=v(B,P,F,I).length>0?P-f(P,F):B;const ee=P,j=(function(Y,K,O,H,M,U){let V;return V=v(O,H,M,U).length>0?H-f(H,M):K,Y<O&&V<=H||Y>=O&&V<H?"C":"D"})(T,B,W,P,F,I);return w(x(T,Z,W,ee,j==="C",F).length,A(j,I))})(E,R,_,S,p,m);let L;if(R===S)return L=E>_?"D":"C",w(Math.abs(E-_),A(L,m));L=R>S?"D":"C";const D=Math.abs(R-S);return w((function(T,B){return B.cols-T})(R>S?_:E,p)+(D-1)*p.cols+1+((R>S?E:_)-1),A(L,m))}},1296:function(b,c,u){var h=this&&this.__decorate||function(I,Z,ee,j){var Y,K=arguments.length,O=K<3?Z:j===null?j=Object.getOwnPropertyDescriptor(Z,ee):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(I,Z,ee,j);else for(var H=I.length-1;H>=0;H--)(Y=I[H])&&(O=(K<3?Y(O):K>3?Y(Z,ee,O):Y(Z,ee))||O);return K>3&&O&&Object.defineProperty(Z,ee,O),O},v=this&&this.__param||function(I,Z){return function(ee,j){Z(ee,j,I)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const f=u(3787),C=u(2550),x=u(2223),A=u(6171),w=u(6052),_=u(4725),S=u(8055),p=u(8460),m=u(844),E=u(2585),R="xterm-dom-renderer-owner-",L="xterm-rows",D="xterm-fg-",T="xterm-bg-",B="xterm-focus",W="xterm-selection";let P=1,F=c.DomRenderer=class extends m.Disposable{constructor(I,Z,ee,j,Y,K,O,H,M,U,V,ae,ce){super(),this._terminal=I,this._document=Z,this._element=ee,this._screenElement=j,this._viewportElement=Y,this._helperContainer=K,this._linkifier2=O,this._charSizeService=M,this._optionsService=U,this._bufferService=V,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=P++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(L),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(W),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=H.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,m.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const ee of this._rowElements)ee.style.width=`${this.dimensions.css.canvas.width}px`,ee.style.height=`${this.dimensions.css.cell.height}px`,ee.style.lineHeight=`${this.dimensions.css.cell.height}px`,ee.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Z=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Z,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Z=`${this._terminalSelector} .${L} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Z+=`${this._terminalSelector} .${L} .xterm-dim { color: ${S.color.multiplyOpacity(I.foreground,.5).css};}`,Z+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const ee=`blink_underline_${this._terminalClass}`,j=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;Z+=`@keyframes ${ee} { 50% { border-bottom-style: hidden; }}`,Z+=`@keyframes ${j} { 50% { box-shadow: none; }}`,Z+=`@keyframes ${Y} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,Z+=`${this._terminalSelector} .${L}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${L}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${L}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Z+=`${this._terminalSelector} .${W} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${W} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${W} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[K,O]of I.ansi.entries())Z+=`${this._terminalSelector} .${D}${K} { color: ${O.css}; }${this._terminalSelector} .${D}${K}.xterm-dim { color: ${S.color.multiplyOpacity(O,.5).css}; }${this._terminalSelector} .${T}${K} { background-color: ${O.css}; }`;Z+=`${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(I.background).css}; }${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${T}${x.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=Z}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,Z){for(let ee=this._rowElements.length;ee<=Z;ee++){const j=this._document.createElement("div");this._rowContainer.appendChild(j),this._rowElements.push(j)}for(;this._rowElements.length>Z;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,Z){this._refreshRowElements(I,Z),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,Z,ee){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,Z,ee),this.renderRows(0,this._bufferService.rows-1),!I||!Z)return;this._selectionRenderModel.update(this._terminal,I,Z,ee);const j=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,O=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||O<0)return;const H=this._document.createDocumentFragment();if(ee){const M=I[0]>Z[0];H.appendChild(this._createSelectionElement(K,M?Z[0]:I[0],M?I[0]:Z[0],O-K+1))}else{const M=j===K?I[0]:0,U=K===Y?Z[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement(K,M,U));const V=O-K-1;if(H.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,V)),K!==O){const ae=Y===O?Z[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement(O,0,ae))}}this._selectionContainer.appendChild(H)}_createSelectionElement(I,Z,ee,j=1){const Y=this._document.createElement("div"),K=Z*this.dimensions.css.cell.width;let O=this.dimensions.css.cell.width*(ee-Z);return K+O>this.dimensions.css.canvas.width&&(O=this.dimensions.css.canvas.width-K),Y.style.height=j*this.dimensions.css.cell.height+"px",Y.style.top=I*this.dimensions.css.cell.height+"px",Y.style.left=`${K}px`,Y.style.width=`${O}px`,Y}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const I of this._rowElements)I.replaceChildren()}renderRows(I,Z){const ee=this._bufferService.buffer,j=ee.ybase+ee.y,Y=Math.min(ee.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,O=this._optionsService.rawOptions.cursorStyle,H=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=I;M<=Z;M++){const U=M+ee.ydisp,V=this._rowElements[M],ae=ee.lines.get(U);if(!V||!ae)break;V.replaceChildren(...this._rowFactory.createRow(ae,U,U===j,O,H,Y,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,Z,ee,j,Y,K){ee<0&&(I=0),j<0&&(Z=0);const O=this._bufferService.rows-1;ee=Math.max(Math.min(ee,O),0),j=Math.max(Math.min(j,O),0),Y=Math.min(Y,this._bufferService.cols);const H=this._bufferService.buffer,M=H.ybase+H.y,U=Math.min(H.x,Y-1),V=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=ee;me<=j;++me){const Q=me+H.ydisp,$=this._rowElements[me],oe=H.lines.get(Q);if(!$||!oe)break;$.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===M,ae,ce,U,V,this.dimensions.css.cell.width,this._widthCache,K?me===ee?I:0:-1,K?(me===j?Z:Y)-1:-1))}}};c.DomRenderer=F=h([v(7,E.IInstantiationService),v(8,_.ICharSizeService),v(9,E.IOptionsService),v(10,E.IBufferService),v(11,_.ICoreBrowserService),v(12,_.IThemeService)],F)},3787:function(b,c,u){var h=this&&this.__decorate||function(L,D,T,B){var W,P=arguments.length,F=P<3?D:B===null?B=Object.getOwnPropertyDescriptor(D,T):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(L,D,T,B);else for(var I=L.length-1;I>=0;I--)(W=L[I])&&(F=(P<3?W(F):P>3?W(D,T,F):W(D,T))||F);return P>3&&F&&Object.defineProperty(D,T,F),F},v=this&&this.__param||function(L,D){return function(T,B){D(T,B,L)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const f=u(2223),C=u(643),x=u(511),A=u(2585),w=u(8055),_=u(4725),S=u(4269),p=u(6171),m=u(3734);let E=c.DomRendererRowFactory=class{constructor(L,D,T,B,W,P,F){this._document=L,this._characterJoinerService=D,this._optionsService=T,this._coreBrowserService=B,this._coreService=W,this._decorationService=P,this._themeService=F,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,D,T){this._selectionStart=L,this._selectionEnd=D,this._columnSelectMode=T}createRow(L,D,T,B,W,P,F,I,Z,ee,j){const Y=[],K=this._characterJoinerService.getJoinedCharacters(D),O=this._themeService.colors;let H,M=L.getNoBgTrimmedLength();T&&M<P+1&&(M=P+1);let U=0,V="",ae=0,ce=0,me=0,Q=!1,$=0,oe=!1,pe=0;const Se=[],be=ee!==-1&&j!==-1;for(let ze=0;ze<M;ze++){L.loadCell(ze,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Ke=!1,Ct=ze,Oe=this._workCell;if(K.length>0&&ze===K[0][0]){Ke=!0;const ut=K.shift();Oe=new S.JoinedCellData(this._workCell,L.translateToString(!0,ut[0],ut[1]),ut[1]-ut[0]),Ct=ut[1]-1,je=Oe.getWidth()}const Qt=this._isCellInSelection(ze,D),gi=T&&ze===P,mi=be&&ze>=ee&&ze<=j;let un=!1;this._decorationService.forEachDecorationAtCell(ze,D,void 0,(ut=>{un=!0}));let Tn=Oe.getChars()||C.WHITESPACE_CELL_CHAR;if(Tn===" "&&(Oe.isUnderline()||Oe.isOverline())&&(Tn=" "),pe=je*I-Z.get(Tn,Oe.isBold(),Oe.isItalic()),H){if(U&&(Qt&&oe||!Qt&&!oe&&Oe.bg===ae)&&(Qt&&oe&&O.selectionForeground||Oe.fg===ce)&&Oe.extended.ext===me&&mi===Q&&pe===$&&!gi&&!Ke&&!un){Oe.isInvisible()?V+=C.WHITESPACE_CELL_CHAR:V+=Tn,U++;continue}U&&(H.textContent=V),H=this._document.createElement("span"),U=0,V=""}else H=this._document.createElement("span");if(ae=Oe.bg,ce=Oe.fg,me=Oe.extended.ext,Q=mi,$=pe,oe=Qt,Ke&&P>=ze&&P<=Ct&&(P=ze),!this._coreService.isCursorHidden&&gi&&this._coreService.isCursorInitialized){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&Se.push("xterm-cursor-blink"),Se.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(W)switch(W){case"outline":Se.push("xterm-cursor-outline");break;case"block":Se.push("xterm-cursor-block");break;case"bar":Se.push("xterm-cursor-bar");break;case"underline":Se.push("xterm-cursor-underline")}}if(Oe.isBold()&&Se.push("xterm-bold"),Oe.isItalic()&&Se.push("xterm-italic"),Oe.isDim()&&Se.push("xterm-dim"),V=Oe.isInvisible()?C.WHITESPACE_CELL_CHAR:Oe.getChars()||C.WHITESPACE_CELL_CHAR,Oe.isUnderline()&&(Se.push(`xterm-underline-${Oe.extended.underlineStyle}`),V===" "&&(V=" "),!Oe.isUnderlineColorDefault()))if(Oe.isUnderlineColorRGB())H.style.textDecorationColor=`rgb(${m.AttributeData.toColorRGB(Oe.getUnderlineColor()).join(",")})`;else{let ut=Oe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Oe.isBold()&&ut<8&&(ut+=8),H.style.textDecorationColor=O.ansi[ut].css}Oe.isOverline()&&(Se.push("xterm-overline"),V===" "&&(V=" ")),Oe.isStrikethrough()&&Se.push("xterm-strikethrough"),mi&&(H.style.textDecoration="underline");let Jt=Oe.getFgColor(),lt=Oe.getFgColorMode(),Gt=Oe.getBgColor(),It=Oe.getBgColorMode();const Ht=!!Oe.isInverse();if(Ht){const ut=Jt;Jt=Gt,Gt=ut;const Ii=lt;lt=It,It=Ii}let ei,An,Ti,Xi=!1;switch(this._decorationService.forEachDecorationAtCell(ze,D,void 0,(ut=>{ut.options.layer!=="top"&&Xi||(ut.backgroundColorRGB&&(It=50331648,Gt=ut.backgroundColorRGB.rgba>>8&16777215,ei=ut.backgroundColorRGB),ut.foregroundColorRGB&&(lt=50331648,Jt=ut.foregroundColorRGB.rgba>>8&16777215,An=ut.foregroundColorRGB),Xi=ut.options.layer==="top")})),!Xi&&Qt&&(ei=this._coreBrowserService.isFocused?O.selectionBackgroundOpaque:O.selectionInactiveBackgroundOpaque,Gt=ei.rgba>>8&16777215,It=50331648,Xi=!0,O.selectionForeground&&(lt=50331648,Jt=O.selectionForeground.rgba>>8&16777215,An=O.selectionForeground)),Xi&&Se.push("xterm-decoration-top"),It){case 16777216:case 33554432:Ti=O.ansi[Gt],Se.push(`xterm-bg-${Gt}`);break;case 50331648:Ti=w.channels.toColor(Gt>>16,Gt>>8&255,255&Gt),this._addStyle(H,`background-color:#${R((Gt>>>0).toString(16),"0",6)}`);break;default:Ht?(Ti=O.foreground,Se.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Ti=O.background}switch(ei||Oe.isDim()&&(ei=w.color.multiplyOpacity(Ti,.5)),lt){case 16777216:case 33554432:Oe.isBold()&&Jt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Jt+=8),this._applyMinimumContrast(H,Ti,O.ansi[Jt],Oe,ei,void 0)||Se.push(`xterm-fg-${Jt}`);break;case 50331648:const ut=w.channels.toColor(Jt>>16&255,Jt>>8&255,255&Jt);this._applyMinimumContrast(H,Ti,ut,Oe,ei,An)||this._addStyle(H,`color:#${R(Jt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(H,Ti,O.foreground,Oe,ei,An)||Ht&&Se.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}Se.length&&(H.className=Se.join(" "),Se.length=0),gi||Ke||un?H.textContent=V:U++,pe!==this.defaultSpacing&&(H.style.letterSpacing=`${pe}px`),Y.push(H),ze=Ct}return H&&U&&(H.textContent=V),Y}_applyMinimumContrast(L,D,T,B,W,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const F=this._getContrastCache(B);let I;if(W||P||(I=F.getColor(D.rgba,T.rgba)),I===void 0){const Z=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);I=w.color.ensureContrastRatio(W||D,P||T,Z),F.setColor((W||D).rgba,(P||T).rgba,I??null)}return!!I&&(this._addStyle(L,`color:${I.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,D){L.setAttribute("style",`${L.getAttribute("style")||""}${D};`)}_isCellInSelection(L,D){const T=this._selectionStart,B=this._selectionEnd;return!(!T||!B)&&(this._columnSelectMode?T[0]<=B[0]?L>=T[0]&&D>=T[1]&&L<B[0]&&D<=B[1]:L<T[0]&&D>=T[1]&&L>=B[0]&&D<=B[1]:D>T[1]&&D<B[1]||T[1]===B[1]&&D===T[1]&&L>=T[0]&&L<B[0]||T[1]<B[1]&&D===B[1]&&L<B[0]||T[1]<B[1]&&D===T[1]&&L>=T[0])}};function R(L,D,T){for(;L.length<T;)L=D+L;return L}c.DomRendererRowFactory=E=h([v(1,_.ICharacterJoinerService),v(2,A.IOptionsService),v(3,_.ICoreBrowserService),v(4,A.ICoreService),v(5,A.IDecorationService),v(6,_.IThemeService)],E)},2550:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const v=u.createElement("span");v.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[v,f,C,x],this._container.appendChild(v),this._container.appendChild(f),this._container.appendChild(C),this._container.appendChild(x),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,h,v,f){u===this._font&&h===this._fontSize&&v===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=h,this._weight=v,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,h,v){let f=0;if(!h&&!v&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const A=this._measure(u,0);return A>0&&(this._flat[f]=A),A}let C=u;h&&(C+="B"),v&&(C+="I");let x=this._holey.get(C);if(x===void 0){let A=0;h&&(A|=1),v&&(A|=2),x=this._measure(u,A),x>0&&this._holey.set(C,x)}return x}_measure(u,h){const v=this._measureElements[h];return v.textContent=u.repeat(32),v.offsetWidth/32}}},2223:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(b,c)=>{function u(v){return 57508<=v&&v<=57558}function h(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},c.isEmoji=h,c.allowRescaling=function(v,f,C,x){return f===1&&C>Math.ceil(1.5*x)&&v!==void 0&&v>255&&!h(v)&&!u(v)&&!(function(A){return 57344<=A&&A<=63743})(v)},c.treatGlyphAsBackgroundColor=function(v){return u(v)||(function(f){return 9472<=f&&f<=9631})(v)},c.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},c.computeNextVariantOffset=function(v,f,C=0){return(v-(2*Math.round(f)-C))%(2*Math.round(f))}},6052:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,f,C,x=!1){if(this.selectionStart=f,this.selectionEnd=C,!f||!C||f[0]===C[0]&&f[1]===C[1])return void this.clear();const A=v.buffers.active.ydisp,w=f[1]-A,_=C[1]-A,S=Math.max(w,0),p=Math.min(_,v.rows-1);S>=v.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=w,this.viewportEndRow=_,this.viewportCappedStartRow=S,this.viewportCappedEndRow=p,this.startCol=f[0],this.endCol=C[0])}isCellSelected(v,f,C){return!!this.hasSelection&&(C-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&C>=this.viewportCappedStartRow&&f<this.endCol&&C<=this.viewportCappedEndRow:f<this.startCol&&C>=this.viewportCappedStartRow&&f>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&f>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(b,c,u){var h=this&&this.__decorate||function(p,m,E,R){var L,D=arguments.length,T=D<3?m:R===null?R=Object.getOwnPropertyDescriptor(m,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,m,E,R);else for(var B=p.length-1;B>=0;B--)(L=p[B])&&(T=(D<3?L(T):D>3?L(m,E,T):L(m,E))||T);return D>3&&T&&Object.defineProperty(m,E,T),T},v=this&&this.__param||function(p,m){return function(E,R){m(E,R,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const f=u(2585),C=u(8460),x=u(844);let A=c.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,m,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new _(p,m,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};c.CharSizeService=A=h([v(2,f.IOptionsService)],A);class w extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(m,E){m!==void 0&&m>0&&E!==void 0&&E>0&&(this._result.width=m,this._result.height=E)}}class _ extends w{constructor(m,E,R){super(),this._document=m,this._parentElement=E,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class S extends w{constructor(m){super(),this._optionsService=m,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const m=this._ctx.measureText("W");return this._validateAndSet(m.width,m.fontBoundingBoxAscent+m.fontBoundingBoxDescent),this._result}}},4269:function(b,c,u){var h=this&&this.__decorate||function(S,p,m,E){var R,L=arguments.length,D=L<3?p:E===null?E=Object.getOwnPropertyDescriptor(p,m):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,p,m,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(L<3?R(D):L>3?R(p,m,D):R(p,m))||D);return L>3&&D&&Object.defineProperty(p,m,D),D},v=this&&this.__param||function(S,p){return function(m,E){p(m,E,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const f=u(3734),C=u(643),x=u(511),A=u(2585);class w extends f.AttributeData{constructor(p,m,E){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=m,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=w;let _=c.CharacterJoinerService=class Nb{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(p){const m={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(m),m.id}deregister(p){for(let m=0;m<this._characterJoiners.length;m++)if(this._characterJoiners[m].id===p)return this._characterJoiners.splice(m,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const m=this._bufferService.buffer.lines.get(p);if(!m||m.length===0)return[];const E=[],R=m.translateToString(!0);let L=0,D=0,T=0,B=m.getFg(0),W=m.getBg(0);for(let P=0;P<m.getTrimmedLength();P++)if(m.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==W){if(P-L>1){const F=this._getJoinedRanges(R,T,D,m,L);for(let I=0;I<F.length;I++)E.push(F[I])}L=P,T=D,B=this._workCell.fg,W=this._workCell.bg}D+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const P=this._getJoinedRanges(R,T,D,m,L);for(let F=0;F<P.length;F++)E.push(P[F])}return E}_getJoinedRanges(p,m,E,R,L){const D=p.substring(m,E);let T=[];try{T=this._characterJoiners[0].handler(D)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const W=this._characterJoiners[B].handler(D);for(let P=0;P<W.length;P++)Nb._mergeRanges(T,W[P])}catch(W){console.error(W)}return this._stringRangesToCellRanges(T,R,L),T}_stringRangesToCellRanges(p,m,E){let R=0,L=!1,D=0,T=p[R];if(T){for(let B=E;B<this._bufferService.cols;B++){const W=m.getWidth(B),P=m.getString(B).length||C.WHITESPACE_CELL_CHAR.length;if(W!==0){if(!L&&T[0]<=D&&(T[0]=B,L=!0),T[1]<=D){if(T[1]=B,T=p[++R],!T)break;T[0]<=D?(T[0]=B,L=!0):L=!1}D+=P}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(p,m){let E=!1;for(let R=0;R<p.length;R++){const L=p[R];if(E){if(m[1]<=L[0])return p[R-1][1]=m[1],p;if(m[1]<=L[1])return p[R-1][1]=Math.max(m[1],L[1]),p.splice(R,1),p;p.splice(R,1),R--}else{if(m[1]<=L[0])return p.splice(R,0,m),p;if(m[1]<=L[1])return L[0]=Math.min(m[0],L[0]),p;m[0]<L[1]&&(L[0]=Math.min(m[0],L[0]),E=!0)}}return E?p[p.length-1][1]=m[1]:p.push(m),p}};c.CharacterJoinerService=_=h([v(0,A.IBufferService)],_)},5114:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),v=u(8460),f=u(3656);class C extends h.Disposable{constructor(w,_,S){super(),this._textarea=w,this._window=_,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((p=>this._screenDprMonitor.setWindow(p)))),this.register((0,v.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}c.CoreBrowserService=C;class x extends h.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const h=u(844);class v extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const x=this.linkProviders.indexOf(C);x!==-1&&this.linkProviders.splice(x,1)}}}}c.LinkProviderService=v},8934:function(b,c,u){var h=this&&this.__decorate||function(A,w,_,S){var p,m=arguments.length,E=m<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,w,_,S);else for(var R=A.length-1;R>=0;R--)(p=A[R])&&(E=(m<3?p(E):m>3?p(w,_,E):p(w,_))||E);return m>3&&E&&Object.defineProperty(w,_,E),E},v=this&&this.__param||function(A,w){return function(_,S){w(_,S,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const f=u(4725),C=u(9806);let x=c.MouseService=class{constructor(A,w){this._renderService=A,this._charSizeService=w}getCoords(A,w,_,S,p){return(0,C.getCoords)(window,A,w,_,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(A,w){const _=(0,C.getCoordsRelativeToElement)(window,A,w);if(this._charSizeService.hasValidSize)return _[0]=Math.min(Math.max(_[0],0),this._renderService.dimensions.css.canvas.width-1),_[1]=Math.min(Math.max(_[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(_[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(_[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(_[0]),y:Math.floor(_[1])}}};c.MouseService=x=h([v(0,f.IRenderService),v(1,f.ICharSizeService)],x)},3230:function(b,c,u){var h=this&&this.__decorate||function(p,m,E,R){var L,D=arguments.length,T=D<3?m:R===null?R=Object.getOwnPropertyDescriptor(m,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,m,E,R);else for(var B=p.length-1;B>=0;B--)(L=p[B])&&(T=(D<3?L(T):D>3?L(m,E,T):L(m,E))||T);return D>3&&T&&Object.defineProperty(m,E,T),T},v=this&&this.__param||function(p,m){return function(E,R){m(E,R,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const f=u(6193),C=u(4725),x=u(8460),A=u(844),w=u(7226),_=u(2585);let S=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,m,E,R,L,D,T,B){super(),this._rowCount=p,this._charSizeService=R,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((W,P)=>this._renderRows(W,P)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,m),this.register(T.onWindowChange((W=>this._registerIntersectionObserver(W,m))))}_registerIntersectionObserver(p,m){if("IntersectionObserver"in p){const E=new p.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});E.observe(m),this._observerDisposable.value=(0,A.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(p,m,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,m,this._rowCount))}_renderRows(p,m){this._renderer.value&&(p=Math.min(p,this._rowCount-1),m=Math.min(m,this._rowCount-1),this._renderer.value.renderRows(p,m),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:m}),this._onRender.fire({start:p,end:m}),this._isNextRenderRedrawOnly=!0)}resize(p,m){this._rowCount=m,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(p){this._renderer.value=p,this._renderer.value&&(this._renderer.value.onRequestRedraw((m=>this.refreshRows(m.start,m.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,m){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(p,m))):this._renderer.value.handleResize(p,m),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(p,m,E){this._selectionState.start=p,this._selectionState.end=m,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(p,m,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=S=h([v(2,_.IOptionsService),v(3,C.ICharSizeService),v(4,_.IDecorationService),v(5,_.IBufferService),v(6,C.ICoreBrowserService),v(7,C.IThemeService)],S)},9312:function(b,c,u){var h=this&&this.__decorate||function(T,B,W,P){var F,I=arguments.length,Z=I<3?B:P===null?P=Object.getOwnPropertyDescriptor(B,W):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(T,B,W,P);else for(var ee=T.length-1;ee>=0;ee--)(F=T[ee])&&(Z=(I<3?F(Z):I>3?F(B,W,Z):F(B,W))||Z);return I>3&&Z&&Object.defineProperty(B,W,Z),Z},v=this&&this.__param||function(T,B){return function(W,P){B(W,P,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const f=u(9806),C=u(9504),x=u(456),A=u(4725),w=u(8460),_=u(844),S=u(6114),p=u(4841),m=u(511),E=u(2585),R=" ",L=new RegExp(R,"g");let D=c.SelectionService=class extends _.Disposable{constructor(T,B,W,P,F,I,Z,ee,j){super(),this._element=T,this._screenElement=B,this._linkifier=W,this._bufferService=P,this._coreService=F,this._mouseService=I,this._optionsService=Z,this._renderService=ee,this._coreBrowserService=j,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new m.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,_.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!T||!B||T[0]===B[0]&&T[1]===B[1])}get selectionText(){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!T||!B)return"";const W=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(T[0]===B[0])return"";const F=T[0]<B[0]?T[0]:B[0],I=T[0]<B[0]?B[0]:T[0];for(let Z=T[1];Z<=B[1];Z++){const ee=W.translateBufferLineToString(Z,!0,F,I);P.push(ee)}}else{const F=T[1]===B[1]?B[0]:void 0;P.push(W.translateBufferLineToString(T[1],!0,T[0],F));for(let I=T[1]+1;I<=B[1]-1;I++){const Z=W.lines.get(I),ee=W.translateBufferLineToString(I,!0);Z?.isWrapped?P[P.length-1]+=ee:P.push(ee)}if(T[1]!==B[1]){const I=W.lines.get(B[1]),Z=W.translateBufferLineToString(B[1],!0,0,B[0]);I&&I.isWrapped?P[P.length-1]+=Z:P.push(Z)}}return P.map((F=>F.replace(L," "))).join(S.isWindows?`\r
79
+ `:`
80
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&T&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(T){const B=this._getMouseBufferCoords(T),W=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(W&&P&&B)&&this._areCoordsInSelection(B,W,P)}isCellInSelection(T,B){const W=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!W||!P)&&this._areCoordsInSelection([T,B],W,P)}_areCoordsInSelection(T,B,W){return T[1]>B[1]&&T[1]<W[1]||B[1]===W[1]&&T[1]===B[1]&&T[0]>=B[0]&&T[0]<W[0]||B[1]<W[1]&&T[1]===W[1]&&T[0]<W[0]||B[1]<W[1]&&T[1]===B[1]&&T[0]>=B[0]}_selectWordAtCursor(T,B){const W=this._linkifier.currentLink?.link?.range;if(W)return this._model.selectionStart=[W.start.x-1,W.start.y-1],this._model.selectionStartLength=(0,p.getRangeLength)(W,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(T);return!!P&&(this._selectWordAt(P,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,B){this._model.clearSelection(),T=Math.max(T,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const B=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(T){let B=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const W=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=W?0:(B>W&&(B-=W),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(T){return S.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const B=this._getMouseBufferCoords(T);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(T){return T.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const B=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const W=this._bufferService.buffer;if(this._model.selectionEnd[1]<W.lines.length){const P=W.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}B&&B[0]===this._model.selectionEnd[0]&&B[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const B=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const W=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(W&&W[0]!==void 0&&W[1]!==void 0){const P=(0,C.moveToCellSequence)(W[0]-1,W[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,W=!(!T||!B||T[0]===B[0]&&T[1]===B[1]);W?T&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,B,W)):this._oldHasSelection&&this._fireOnSelectionChange(T,B,W)}_fireOnSelectionChange(T,B,W){this._oldSelectionStart=T,this._oldSelectionEnd=B,this._oldHasSelection=W,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(T,B){let W=B;for(let P=0;B>=P;P++){const F=T.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?W--:F>1&&B!==P&&(W+=F-1)}return W}setSelection(T,B,W){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,B],this._model.selectionStartLength=W,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,B,W=!0,P=!0){if(T[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,I=F.lines.get(T[1]);if(!I)return;const Z=F.translateBufferLineToString(T[1],!1);let ee=this._convertViewportColToCharacterIndex(I,T[0]),j=ee;const Y=T[0]-ee;let K=0,O=0,H=0,M=0;if(Z.charAt(ee)===" "){for(;ee>0&&Z.charAt(ee-1)===" ";)ee--;for(;j<Z.length&&Z.charAt(j+1)===" ";)j++}else{let ae=T[0],ce=T[0];I.getWidth(ae)===0&&(K++,ae--),I.getWidth(ce)===2&&(O++,ce++);const me=I.getString(ce).length;for(me>1&&(M+=me-1,j+=me-1);ae>0&&ee>0&&!this._isCharWordSeparator(I.loadCell(ae-1,this._workCell));){I.loadCell(ae-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,ae--):Q>1&&(H+=Q-1,ee-=Q-1),ee--,ae--}for(;ce<I.length&&j+1<Z.length&&!this._isCharWordSeparator(I.loadCell(ce+1,this._workCell));){I.loadCell(ce+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(O++,ce++):Q>1&&(M+=Q-1,j+=Q-1),j++,ce++}}j++;let U=ee+Y-K+H,V=Math.min(this._bufferService.cols,j-ee+K+O-H-M);if(B||Z.slice(ee,j).trim()!==""){if(W&&U===0&&I.getCodePoint(0)!==32){const ae=F.lines.get(T[1]-1);if(ae&&I.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(ce){const me=this._bufferService.cols-ce.start;U-=me,V+=me}}}if(P&&U+V===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const ae=F.lines.get(T[1]+1);if(ae?.isWrapped&&ae.getCodePoint(0)!==32){const ce=this._getWordAt([0,T[1]+1],!1,!1,!0);ce&&(V+=ce.length)}}return{start:U,length:V}}}_selectWordAt(T,B){const W=this._getWordAt(T,B);if(W){for(;W.start<0;)W.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[W.start,T[1]],this._model.selectionStartLength=W.length}}_selectToWordAt(T){const B=this._getWordAt(T,!0);if(B){let W=T[1];for(;B.start<0;)B.start+=this._bufferService.cols,W--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,W++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,W]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const B=this._bufferService.buffer.getWrappedRangeForLine(T),W={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)(W,this._bufferService.cols)}};c.SelectionService=D=h([v(3,E.IBufferService),v(4,E.ICoreService),v(5,A.IMouseService),v(6,E.IOptionsService),v(7,A.IRenderService),v(8,A.ICoreBrowserService)],D)},4725:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const h=u(8343);c.ICharSizeService=(0,h.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),c.IMouseService=(0,h.createDecorator)("MouseService"),c.IRenderService=(0,h.createDecorator)("RenderService"),c.ISelectionService=(0,h.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,h.createDecorator)("ThemeService"),c.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(b,c,u){var h=this&&this.__decorate||function(D,T,B,W){var P,F=arguments.length,I=F<3?T:W===null?W=Object.getOwnPropertyDescriptor(T,B):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(D,T,B,W);else for(var Z=D.length-1;Z>=0;Z--)(P=D[Z])&&(I=(F<3?P(I):F>3?P(T,B,I):P(T,B))||I);return F>3&&I&&Object.defineProperty(T,B,I),I},v=this&&this.__param||function(D,T){return function(B,W){T(B,W,D)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),C=u(8055),x=u(8460),A=u(844),w=u(2585),_=C.css.toColor("#ffffff"),S=C.css.toColor("#000000"),p=C.css.toColor("#ffffff"),m=C.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let B=0;B<216;B++){const W=T[B/36%6|0],P=T[B/6%6|0],F=T[B%6];D.push({css:C.channels.toCss(W,P,F),rgba:C.channels.toRgba(W,P,F)})}for(let B=0;B<24;B++){const W=8+10*B;D.push({css:C.channels.toCss(W,W,W),rgba:C.channels.toRgba(W,W,W)})}return D})());let R=c.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:_,background:S,cursor:p,cursorAccent:m,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:C.color.blend(S,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:C.color.blend(S,E),ansi:c.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const T=this._colors;if(T.foreground=L(D.foreground,_),T.background=L(D.background,S),T.cursor=L(D.cursor,p),T.cursorAccent=L(D.cursorAccent,m),T.selectionBackgroundTransparent=L(D.selectionBackground,E),T.selectionBackgroundOpaque=C.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=L(D.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=C.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=D.selectionForeground?L(D.selectionForeground,C.NULL_COLOR):void 0,T.selectionForeground===C.NULL_COLOR&&(T.selectionForeground=void 0),C.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=C.color.opacity(T.selectionBackgroundTransparent,.3)),C.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=C.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=c.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=L(D.black,c.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=L(D.red,c.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=L(D.green,c.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=L(D.yellow,c.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=L(D.blue,c.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=L(D.magenta,c.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=L(D.cyan,c.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=L(D.white,c.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=L(D.brightBlack,c.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=L(D.brightRed,c.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=L(D.brightGreen,c.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=L(D.brightYellow,c.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=L(D.brightBlue,c.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=L(D.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=L(D.brightCyan,c.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=L(D.brightWhite,c.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const B=Math.min(T.ansi.length-16,D.extendedAnsi.length);for(let W=0;W<B;W++)T.ansi[W+16]=L(D.extendedAnsi[W],c.DEFAULT_ANSI_COLORS[W+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function L(D,T){if(D!==void 0)try{return C.css.toColor(D)}catch{}return T}c.ThemeService=R=h([v(0,w.IOptionsService)],R)},6349:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),v=u(844);class f extends v.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const A=new Array(x);for(let w=0;w<Math.min(x,this.length);w++)A[w]=this._array[this._getCyclicIndex(w)];this._array=A,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let A=this._length;A<x;A++)this._array[A]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,A){this._array[this._getCyclicIndex(x)]=A}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,A,...w){if(A){for(let _=x;_<this._length-A;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+A)];this._length-=A,this.onDeleteEmitter.fire({index:x,amount:A})}for(let _=this._length-1;_>=x;_--)this._array[this._getCyclicIndex(_+w.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<w.length;_++)this._array[this._getCyclicIndex(x+_)]=w[_];if(w.length&&this.onInsertEmitter.fire({index:x,amount:w.length}),this._length+w.length>this._maxLength){const _=this._length+w.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=w.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,A,w){if(!(A<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let S=A-1;S>=0;S--)this.set(x+S+w,this.get(x+S));const _=x+A+w-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<A;_++)this.set(x+_+w,this.get(x+_))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}c.CircularList=f},1439:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,v=5){if(typeof h!="object")return h;const f=Array.isArray(h)?[]:{};for(const C in h)f[C]=v<=1?h[C]:h[C]&&u(h[C],v-1);return f}},8055:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let u=0,h=0,v=0,f=0;var C,x,A,w,_;function S(m){const E=m.toString(16);return E.length<2?"0"+E:E}function p(m,E){return m<E?(E+.05)/(m+.05):(m+.05)/(E+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(m){m.toCss=function(E,R,L,D){return D!==void 0?`#${S(E)}${S(R)}${S(L)}${S(D)}`:`#${S(E)}${S(R)}${S(L)}`},m.toRgba=function(E,R,L,D=255){return(E<<24|R<<16|L<<8|D)>>>0},m.toColor=function(E,R,L,D){return{css:m.toCss(E,R,L,D),rgba:m.toRgba(E,R,L,D)}}})(C||(c.channels=C={})),(function(m){function E(R,L){return f=Math.round(255*L),[u,h,v]=_.toChannels(R.rgba),{css:C.toCss(u,h,v,f),rgba:C.toRgba(u,h,v,f)}}m.blend=function(R,L){if(f=(255&L.rgba)/255,f===1)return{css:L.css,rgba:L.rgba};const D=L.rgba>>24&255,T=L.rgba>>16&255,B=L.rgba>>8&255,W=R.rgba>>24&255,P=R.rgba>>16&255,F=R.rgba>>8&255;return u=W+Math.round((D-W)*f),h=P+Math.round((T-P)*f),v=F+Math.round((B-F)*f),{css:C.toCss(u,h,v),rgba:C.toRgba(u,h,v)}},m.isOpaque=function(R){return(255&R.rgba)==255},m.ensureContrastRatio=function(R,L,D){const T=_.ensureContrastRatio(R.rgba,L.rgba,D);if(T)return C.toColor(T>>24&255,T>>16&255,T>>8&255)},m.opaque=function(R){const L=(255|R.rgba)>>>0;return[u,h,v]=_.toChannels(L),{css:C.toCss(u,h,v),rgba:L}},m.opacity=E,m.multiplyOpacity=function(R,L){return f=255&R.rgba,E(R,f*L/255)},m.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(x||(c.color=x={})),(function(m){let E,R;try{const L=document.createElement("canvas");L.width=1,L.height=1;const D=L.getContext("2d",{willReadFrequently:!0});D&&(E=D,E.globalCompositeOperation="copy",R=E.createLinearGradient(0,0,1,1))}catch{}m.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return u=parseInt(L.slice(1,2).repeat(2),16),h=parseInt(L.slice(2,3).repeat(2),16),v=parseInt(L.slice(3,4).repeat(2),16),C.toColor(u,h,v);case 5:return u=parseInt(L.slice(1,2).repeat(2),16),h=parseInt(L.slice(2,3).repeat(2),16),v=parseInt(L.slice(3,4).repeat(2),16),f=parseInt(L.slice(4,5).repeat(2),16),C.toColor(u,h,v,f);case 7:return{css:L,rgba:(parseInt(L.slice(1),16)<<8|255)>>>0};case 9:return{css:L,rgba:parseInt(L.slice(1),16)>>>0}}const D=L.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),h=parseInt(D[2]),v=parseInt(D[3]),f=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),C.toColor(u,h,v,f);if(!E||!R)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=R,E.fillStyle=L,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[u,h,v,f]=E.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,v,f),css:L}}})(A||(c.css=A={})),(function(m){function E(R,L,D){const T=R/255,B=L/255,W=D/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*(W<=.03928?W/12.92:Math.pow((W+.055)/1.055,2.4))}m.relativeLuminance=function(R){return E(R>>16&255,R>>8&255,255&R)},m.relativeLuminance2=E})(w||(c.rgb=w={})),(function(m){function E(L,D,T){const B=L>>24&255,W=L>>16&255,P=L>>8&255;let F=D>>24&255,I=D>>16&255,Z=D>>8&255,ee=p(w.relativeLuminance2(F,I,Z),w.relativeLuminance2(B,W,P));for(;ee<T&&(F>0||I>0||Z>0);)F-=Math.max(0,Math.ceil(.1*F)),I-=Math.max(0,Math.ceil(.1*I)),Z-=Math.max(0,Math.ceil(.1*Z)),ee=p(w.relativeLuminance2(F,I,Z),w.relativeLuminance2(B,W,P));return(F<<24|I<<16|Z<<8|255)>>>0}function R(L,D,T){const B=L>>24&255,W=L>>16&255,P=L>>8&255;let F=D>>24&255,I=D>>16&255,Z=D>>8&255,ee=p(w.relativeLuminance2(F,I,Z),w.relativeLuminance2(B,W,P));for(;ee<T&&(F<255||I<255||Z<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),I=Math.min(255,I+Math.ceil(.1*(255-I))),Z=Math.min(255,Z+Math.ceil(.1*(255-Z))),ee=p(w.relativeLuminance2(F,I,Z),w.relativeLuminance2(B,W,P));return(F<<24|I<<16|Z<<8|255)>>>0}m.blend=function(L,D){if(f=(255&D)/255,f===1)return D;const T=D>>24&255,B=D>>16&255,W=D>>8&255,P=L>>24&255,F=L>>16&255,I=L>>8&255;return u=P+Math.round((T-P)*f),h=F+Math.round((B-F)*f),v=I+Math.round((W-I)*f),C.toRgba(u,h,v)},m.ensureContrastRatio=function(L,D,T){const B=w.relativeLuminance(L>>8),W=w.relativeLuminance(D>>8);if(p(B,W)<T){if(W<B){const I=E(L,D,T),Z=p(B,w.relativeLuminance(I>>8));if(Z<T){const ee=R(L,D,T);return Z>p(B,w.relativeLuminance(ee>>8))?I:ee}return I}const P=R(L,D,T),F=p(B,w.relativeLuminance(P>>8));if(F<T){const I=E(L,D,T);return F>p(B,w.relativeLuminance(I>>8))?P:I}return P}},m.reduceLuminance=E,m.increaseLuminance=R,m.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(_||(c.rgba=_={})),c.toPaddedHex=S,c.contrastRatio=p},8969:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),v=u(2585),f=u(4348),C=u(7866),x=u(744),A=u(7302),w=u(6975),_=u(8460),S=u(1753),p=u(1480),m=u(7994),E=u(9282),R=u(5435),L=u(5981),D=u(2660);let T=!1;class B extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new _.EventEmitter),this._onScroll.event((P=>{this._onScrollApi?.fire(P.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(P){for(const F in P)this.optionsService.options[F]=P[F]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new _.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new A.OptionsService(P)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(p.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(m.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,_.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,_.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,_.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,_.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new L.WriteBuffer(((F,I)=>this._inputHandler.parse(F,I)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,F){this._writeBuffer.write(P,F)}writeSync(P,F){this._logService.logLevel<=v.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(P,F)}input(P,F=!0){this.coreService.triggerDataEvent(P,F)}resize(P,F){isNaN(P)||isNaN(F)||(P=Math.max(P,x.MINIMUM_COLS),F=Math.max(F,x.MINIMUM_ROWS),this._bufferService.resize(P,F))}scroll(P,F=!1){this._bufferService.scroll(P,F)}scrollLines(P,F,I){this._bufferService.scrollLines(P,F,I)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const F=P-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(P,F){return this._inputHandler.registerEscHandler(P,F)}registerDcsHandler(P,F){return this._inputHandler.registerDcsHandler(P,F)}registerCsiHandler(P,F){return this._inputHandler.registerCsiHandler(P,F)}registerOscHandler(P,F){return this._inputHandler.registerOscHandler(P,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?P=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const F of P)F.dispose()}))}}}c.CoreTerminal=B},8460:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const v=[];for(let f=0;f<this._listeners.length;f++)v.push(this._listeners[f]);for(let f=0;f<v.length;f++)v[f].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,h){return u((v=>h.fire(v)))},c.runAndSubscribe=function(u,h){return h(void 0),u((v=>h(v)))}},5435:function(b,c,u){var h=this&&this.__decorate||function(K,O,H,M){var U,V=arguments.length,ae=V<3?O:M===null?M=Object.getOwnPropertyDescriptor(O,H):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(K,O,H,M);else for(var ce=K.length-1;ce>=0;ce--)(U=K[ce])&&(ae=(V<3?U(ae):V>3?U(O,H,ae):U(O,H))||ae);return V>3&&ae&&Object.defineProperty(O,H,ae),ae},v=this&&this.__param||function(K,O){return function(H,M){O(H,M,K)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const f=u(2584),C=u(7116),x=u(2015),A=u(844),w=u(482),_=u(8437),S=u(8460),p=u(643),m=u(511),E=u(3734),R=u(2585),L=u(1480),D=u(6242),T=u(6351),B=u(5941),W={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function F(K,O){if(K>24)return O.setWinLines||!1;switch(K){case 1:return!!O.restoreWin;case 2:return!!O.minimizeWin;case 3:return!!O.setWinPosition;case 4:return!!O.setWinSizePixels;case 5:return!!O.raiseWin;case 6:return!!O.lowerWin;case 7:return!!O.refreshWin;case 8:return!!O.setWinSizeChars;case 9:return!!O.maximizeWin;case 10:return!!O.fullscreenWin;case 11:return!!O.getWinState;case 13:return!!O.getWinPosition;case 14:return!!O.getWinSizePixels;case 15:return!!O.getScreenSizePixels;case 16:return!!O.getCellSizePixels;case 18:return!!O.getWinSizeChars;case 19:return!!O.getScreenSizeChars;case 20:return!!O.getIconTitle;case 21:return!!O.getWinTitle;case 22:return!!O.pushTitle;case 23:return!!O.popTitle;case 24:return!!O.setWinLines}return!1}var I;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(c.WindowsOptionsReportType=I={}));let Z=0;class ee extends A.Disposable{getAttrData(){return this._curAttrData}constructor(O,H,M,U,V,ae,ce,me,Q=new x.EscapeSequenceParser){super(),this._bufferService=O,this._charsetService=H,this._coreService=M,this._logService=U,this._optionsService=V,this._oscLinkService=ae,this._coreMouseService=ce,this._unicodeService=me,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new m.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new j(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:oe.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,oe,pe)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:oe,data:pe})})),this._parser.setDcsHandlerFallback((($,oe,pe)=>{oe==="HOOK"&&(pe=pe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:oe,payload:pe})})),this._parser.setPrintHandler((($,oe,pe)=>this.print($,oe,pe))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new D.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new D.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new D.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new D.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new D.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new D.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new D.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new D.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new D.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new D.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new D.OscHandler(($=>this.restoreCursorColor($)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const $ in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler((($,oe)=>this.requestStatusString($,oe))))}_preserveStack(O,H,M,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=O,this._parseStack.cursorStartY=H,this._parseStack.decodedLength=M,this._parseStack.position=U}_logSlowResolvingAsync(O){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([O,new Promise(((H,M)=>setTimeout((()=>M("#SLOW_TIMEOUT")),5e3)))]).catch((H=>{if(H!=="#SLOW_TIMEOUT")throw H;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(O,H){let M,U=this._activeBuffer.x,V=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,H))return this._logSlowResolvingAsync(M),M;U=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,O.length>P&&(ae=this._parseStack.position+P)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof O=="string"?` "${O}"`:` "${Array.prototype.map.call(O,($=>String.fromCharCode($))).join("")}"`),typeof O=="string"?O.split("").map(($=>$.charCodeAt(0))):O),this._parseBuffer.length<O.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(O.length,P))),ce||this._dirtyRowTracker.clearRange(),O.length>P)for(let $=ae;$<O.length;$+=P){const oe=$+P<O.length?$+P:O.length,pe=typeof O=="string"?this._stringDecoder.decode(O.substring($,oe),this._parseBuffer):this._utf8Decoder.decode(O.subarray($,oe),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,pe))return this._preserveStack(U,V,pe,$),this._logSlowResolvingAsync(M),M}else if(!ce){const $=typeof O=="string"?this._stringDecoder.decode(O,this._parseBuffer):this._utf8Decoder.decode(O,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,$))return this._preserveStack(U,V,$,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===U&&this._activeBuffer.y===V||this._onCursorMove.fire();const me=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(me,this._bufferService.rows-1))}print(O,H,M){let U,V;const ae=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,oe=this._curAttrData;let pe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-H>0&&pe.getWidth(this._activeBuffer.x-1)===2&&pe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let Se=this._parser.precedingJoinState;for(let be=H;be<M;++be){if(U=O[be],U<127&&ae){const Ct=ae[String.fromCharCode(U)];Ct&&(U=Ct.charCodeAt(0))}const ze=this._unicodeService.charProperties(U,Se);V=L.UnicodeService.extractWidth(ze);const je=L.UnicodeService.extractShouldJoin(ze),Ke=je?L.UnicodeService.extractWidth(Se):0;if(Se=ze,ce&&this._onA11yChar.fire((0,w.stringFromCodePoint)(U)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+V-Ke>me){if(Q){const Ct=pe;let Oe=this._activeBuffer.x-Ke;for(this._activeBuffer.x=Ke,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),pe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ke>0&&pe instanceof _.BufferLine&&pe.copyCellsFrom(Ct,Oe,0,Ke,!1);Oe<me;)Ct.setCellFromCodepoint(Oe++,0,1,oe)}else if(this._activeBuffer.x=me-1,V===2)continue}if(je&&this._activeBuffer.x){const Ct=pe.getWidth(this._activeBuffer.x-1)?1:2;pe.addCodepointToCell(this._activeBuffer.x-Ct,U,V);for(let Oe=V-Ke;--Oe>=0;)pe.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if($&&(pe.insertCells(this._activeBuffer.x,V-Ke,this._activeBuffer.getNullCell(oe)),pe.getWidth(me-1)===2&&pe.setCellFromCodepoint(me-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,oe)),pe.setCellFromCodepoint(this._activeBuffer.x++,U,V,oe),V>0)for(;--V;)pe.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=Se,this._activeBuffer.x<me&&M-H>0&&pe.getWidth(this._activeBuffer.x)===0&&!pe.hasContent(this._activeBuffer.x)&&pe.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(O,H){return O.final!=="t"||O.prefix||O.intermediates?this._parser.registerCsiHandler(O,H):this._parser.registerCsiHandler(O,(M=>!F(M.params[0],this._optionsService.rawOptions.windowOptions)||H(M)))}registerDcsHandler(O,H){return this._parser.registerDcsHandler(O,new T.DcsHandler(H))}registerEscHandler(O,H){return this._parser.registerEscHandler(O,H)}registerOscHandler(O,H){return this._parser.registerOscHandler(O,new D.OscHandler(H))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const O=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-O),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(O=this._bufferService.cols-1){this._activeBuffer.x=Math.min(O,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(O,H){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=O,this._activeBuffer.y=this._activeBuffer.scrollTop+H):(this._activeBuffer.x=O,this._activeBuffer.y=H),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(O,H){this._restrictCursor(),this._setCursor(this._activeBuffer.x+O,this._activeBuffer.y+H)}cursorUp(O){const H=this._activeBuffer.y-this._activeBuffer.scrollTop;return H>=0?this._moveCursor(0,-Math.min(H,O.params[0]||1)):this._moveCursor(0,-(O.params[0]||1)),!0}cursorDown(O){const H=this._activeBuffer.scrollBottom-this._activeBuffer.y;return H>=0?this._moveCursor(0,Math.min(H,O.params[0]||1)):this._moveCursor(0,O.params[0]||1),!0}cursorForward(O){return this._moveCursor(O.params[0]||1,0),!0}cursorBackward(O){return this._moveCursor(-(O.params[0]||1),0),!0}cursorNextLine(O){return this.cursorDown(O),this._activeBuffer.x=0,!0}cursorPrecedingLine(O){return this.cursorUp(O),this._activeBuffer.x=0,!0}cursorCharAbsolute(O){return this._setCursor((O.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(O){return this._setCursor(O.length>=2?(O.params[1]||1)-1:0,(O.params[0]||1)-1),!0}charPosAbsolute(O){return this._setCursor((O.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(O){return this._moveCursor(O.params[0]||1,0),!0}linePosAbsolute(O){return this._setCursor(this._activeBuffer.x,(O.params[0]||1)-1),!0}vPositionRelative(O){return this._moveCursor(0,O.params[0]||1),!0}hVPosition(O){return this.cursorPosition(O),!0}tabClear(O){const H=O.params[0];return H===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:H===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=O.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=O.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(O){const H=O.params[0];return H===1&&(this._curAttrData.bg|=536870912),H!==2&&H!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(O,H,M,U=!1,V=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);ae.replaceCells(H,M,this._activeBuffer.getNullCell(this._eraseAttrData()),V),U&&(ae.isWrapped=!1)}_resetBufferLine(O,H=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),H),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+O),M.isWrapped=!1)}eraseInDisplay(O,H=!1){let M;switch(this._restrictCursor(this._bufferService.cols),O.params[0]){case 0:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);M<this._bufferService.rows;M++)this._resetBufferLine(M,H);this._dirtyRowTracker.markDirty(M);break;case 1:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M,0,this._activeBuffer.x+1,!0,H),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,H);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,H);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(O,H=!1){switch(this._restrictCursor(this._bufferService.cols),O.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,H);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,H)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(O){this._restrictCursor();let H=O.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y,U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-U+1;for(;H--;)this._activeBuffer.lines.splice(V-1,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(O){this._restrictCursor();let H=O.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y;let U;for(U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-U;H--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(U,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(O){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.insertCells(this._activeBuffer.x,O.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(O){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.deleteCells(this._activeBuffer.x,O.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(O){let H=O.params[0]||1;for(;H--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(O){let H=O.params[0]||1;for(;H--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(_.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=O.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);U.deleteCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=O.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);U.insertCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=O.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);U.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=O.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);U.deleteCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(O){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(O.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(O){const H=this._parser.precedingJoinState;if(!H)return!0;const M=O.params[0]||1,U=L.UnicodeService.extractWidth(H),V=this._activeBuffer.x-U,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(V),ce=new Uint32Array(ae.length*M);let me=0;for(let $=0;$<ae.length;){const oe=ae.codePointAt($)||0;ce[me++]=oe,$+=oe>65535?2:1}let Q=me;for(let $=1;$<M;++$)ce.copyWithin(Q,0,me),Q+=me;return this.print(ce,0,Q),!0}sendDeviceAttributesPrimary(O){return O.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(O){return O.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(O.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(O){return(this._optionsService.rawOptions.termName+"").indexOf(O)===0}setMode(O){for(let H=0;H<O.length;H++)switch(O.params[H]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(O){for(let H=0;H<O.length;H++)switch(O.params[H]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(O){for(let H=0;H<O.length;H++)switch(O.params[H]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(O){for(let H=0;H<O.length;H++)switch(O.params[H]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),O.params[H]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(O,H){const M=this._coreService.decPrivateModes,{activeProtocol:U,activeEncoding:V}=this._coreMouseService,ae=this._coreService,{buffers:ce,cols:me}=this._bufferService,{active:Q,alt:$}=ce,oe=this._optionsService.rawOptions,pe=je=>je?1:2,Se=O.params[0];return be=Se,ze=H?Se===2?4:Se===4?pe(ae.modes.insertMode):Se===12?3:Se===20?pe(oe.convertEol):0:Se===1?pe(M.applicationCursorKeys):Se===3?oe.windowOptions.setWinLines?me===80?2:me===132?1:0:0:Se===6?pe(M.origin):Se===7?pe(M.wraparound):Se===8?3:Se===9?pe(U==="X10"):Se===12?pe(oe.cursorBlink):Se===25?pe(!ae.isCursorHidden):Se===45?pe(M.reverseWraparound):Se===66?pe(M.applicationKeypad):Se===67?4:Se===1e3?pe(U==="VT200"):Se===1002?pe(U==="DRAG"):Se===1003?pe(U==="ANY"):Se===1004?pe(M.sendFocus):Se===1005?4:Se===1006?pe(V==="SGR"):Se===1015?4:Se===1016?pe(V==="SGR_PIXELS"):Se===1048?1:Se===47||Se===1047||Se===1049?pe(Q===$):Se===2004?pe(M.bracketedPasteMode):0,ae.triggerDataEvent(`${f.C0.ESC}[${H?"":"?"}${be};${ze}$y`),!0;var be,ze}_updateAttrColor(O,H,M,U,V){return H===2?(O|=50331648,O&=-16777216,O|=E.AttributeData.fromColorRGB([M,U,V])):H===5&&(O&=-50331904,O|=33554432|255&M),O}_extractColor(O,H,M){const U=[0,0,-1,0,0,0];let V=0,ae=0;do{if(U[ae+V]=O.params[H+ae],O.hasSubParams(H+ae)){const ce=O.getSubParams(H+ae);let me=0;do U[1]===5&&(V=1),U[ae+me+1+V]=ce[me];while(++me<ce.length&&me+ae+1+V<U.length);break}if(U[1]===5&&ae+V>=2||U[1]===2&&ae+V>=5)break;U[1]&&(V=1)}while(++ae+H<O.length&&ae+V<U.length);for(let ce=2;ce<U.length;++ce)U[ce]===-1&&(U[ce]=0);switch(U[0]){case 38:M.fg=this._updateAttrColor(M.fg,U[1],U[3],U[4],U[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,U[1],U[3],U[4],U[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,U[1],U[3],U[4],U[5])}return ae}_processUnderline(O,H){H.extended=H.extended.clone(),(!~O||O>5)&&(O=1),H.extended.underlineStyle=O,H.fg|=268435456,O===0&&(H.fg&=-268435457),H.updateExtended()}_processSGR0(O){O.fg=_.DEFAULT_ATTR_DATA.fg,O.bg=_.DEFAULT_ATTR_DATA.bg,O.extended=O.extended.clone(),O.extended.underlineStyle=0,O.extended.underlineColor&=-67108864,O.updateExtended()}charAttributes(O){if(O.length===1&&O.params[0]===0)return this._processSGR0(this._curAttrData),!0;const H=O.length;let M;const U=this._curAttrData;for(let V=0;V<H;V++)M=O.params[V],M>=30&&M<=37?(U.fg&=-50331904,U.fg|=16777216|M-30):M>=40&&M<=47?(U.bg&=-50331904,U.bg|=16777216|M-40):M>=90&&M<=97?(U.fg&=-50331904,U.fg|=16777224|M-90):M>=100&&M<=107?(U.bg&=-50331904,U.bg|=16777224|M-100):M===0?this._processSGR0(U):M===1?U.fg|=134217728:M===3?U.bg|=67108864:M===4?(U.fg|=268435456,this._processUnderline(O.hasSubParams(V)?O.getSubParams(V)[0]:1,U)):M===5?U.fg|=536870912:M===7?U.fg|=67108864:M===8?U.fg|=1073741824:M===9?U.fg|=2147483648:M===2?U.bg|=134217728:M===21?this._processUnderline(2,U):M===22?(U.fg&=-134217729,U.bg&=-134217729):M===23?U.bg&=-67108865:M===24?(U.fg&=-268435457,this._processUnderline(0,U)):M===25?U.fg&=-536870913:M===27?U.fg&=-67108865:M===28?U.fg&=-1073741825:M===29?U.fg&=2147483647:M===39?(U.fg&=-67108864,U.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):M===49?(U.bg&=-67108864,U.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?V+=this._extractColor(O,V,U):M===53?U.bg|=1073741824:M===55?U.bg&=-1073741825:M===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):M===100?(U.fg&=-67108864,U.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(O){switch(O.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const H=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${H};${M}R`)}return!0}deviceStatusPrivate(O){if(O.params[0]===6){const H=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${H};${M}R`)}return!0}softReset(O){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(O){const H=O.params[0]||1;switch(H){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const M=H%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(O){const H=O.params[0]||1;let M;return(O.length<2||(M=O.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>H&&(this._activeBuffer.scrollTop=H-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(O){if(!F(O.params[0],this._optionsService.rawOptions.windowOptions))return!0;const H=O.length>1?O.params[1]:0;switch(O.params[0]){case 14:H!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:H!==0&&H!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),H!==0&&H!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:H!==0&&H!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),H!==0&&H!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(O){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(O){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(O){return this._windowTitle=O,this._onTitleChange.fire(O),!0}setIconName(O){return this._iconName=O,!0}setOrReportIndexedColor(O){const H=[],M=O.split(";");for(;M.length>1;){const U=M.shift(),V=M.shift();if(/^\d+$/.exec(U)){const ae=parseInt(U);if(Y(ae))if(V==="?")H.push({type:0,index:ae});else{const ce=(0,B.parseColor)(V);ce&&H.push({type:1,index:ae,color:ce})}}}return H.length&&this._onColor.fire(H),!0}setHyperlink(O){const H=O.split(";");return!(H.length<2)&&(H[1]?this._createHyperlink(H[0],H[1]):!H[0]&&this._finishHyperlink())}_createHyperlink(O,H){this._getCurrentLinkId()&&this._finishHyperlink();const M=O.split(":");let U;const V=M.findIndex((ae=>ae.startsWith("id=")));return V!==-1&&(U=M[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:H}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(O,H){const M=O.split(";");for(let U=0;U<M.length&&!(H>=this._specialColors.length);++U,++H)if(M[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[H]}]);else{const V=(0,B.parseColor)(M[U]);V&&this._onColor.fire([{type:1,index:this._specialColors[H],color:V}])}return!0}setOrReportFgColor(O){return this._setOrReportSpecialColor(O,0)}setOrReportBgColor(O){return this._setOrReportSpecialColor(O,1)}setOrReportCursorColor(O){return this._setOrReportSpecialColor(O,2)}restoreIndexedColor(O){if(!O)return this._onColor.fire([{type:2}]),!0;const H=[],M=O.split(";");for(let U=0;U<M.length;++U)if(/^\d+$/.exec(M[U])){const V=parseInt(M[U]);Y(V)&&H.push({type:2,index:V})}return H.length&&this._onColor.fire(H),!0}restoreFgColor(O){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(O){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(O){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),!0}selectCharset(O){return O.length!==2?(this.selectDefaultCharset(),!0):(O[0]==="/"||this._charsetService.setgCharset(W[O[0]],C.CHARSETS[O[1]]||C.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const O=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,O,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(O){return this._charsetService.setgLevel(O),!0}screenAlignmentPattern(){const O=new m.CellData;O.content=4194373,O.fg=this._curAttrData.fg,O.bg=this._curAttrData.bg,this._setCursor(0,0);for(let H=0;H<this._bufferService.rows;++H){const M=this._activeBuffer.ybase+this._activeBuffer.y+H,U=this._activeBuffer.lines.get(M);U&&(U.fill(O),U.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(O,H){const M=this._bufferService.buffer,U=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${V}${f.C0.ESC}\\`),!0))(O==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:O==='"p'?'P1$r61;1"p':O==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:O==="m"?"P1$r0m":O===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(O,H){this._dirtyRowTracker.markRangeDirty(O,H)}}c.InputHandler=ee;let j=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,O){K>O&&(Z=K,K=O,O=Z),K<this.start&&(this.start=K),O>this.end&&(this.end=O)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(K){return 0<=K&&K<256}j=h([v(0,R.IBufferService)],j)},844:(b,c)=>{function u(h){for(const v of h)v.dispose();h.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const v=this._disposables.indexOf(h);v!==-1&&this._disposables.splice(v,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},c.toDisposable=function(h){return{dispose:h}},c.disposeArray=u,c.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(v,f,C){this._data[v]||(this._data[v]={}),this._data[v][f]=C}get(v,f){return this._data[v]?this._data[v][f]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,v,f,C,x){this._data.get(h,v)||this._data.set(h,v,new u),this._data.get(h,v).set(f,C,x)}get(h,v,f,C){return this._data.get(h,v)?.get(f,C)}clear(){this._data.clear()}}},6114:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const u=c.isNode?"node":navigator.userAgent,h=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const v=u.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),c.isIpad=h==="iPad",c.isIphone=h==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),c.isLinux=h.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(u)},6106:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const v=this._getKey(h);if(v===void 0||(u=this._search(v),u===-1)||this._getKey(this._array[u])!==v)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===v);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,v){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do v(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let v=0,f=this._array.length-1;for(;f>=v;){let C=v+f>>1;const x=this._getKey(this._array[C]);if(x>h)f=C-1;else{if(!(x<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}v=C+1}}return v}}},7226:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let A=0,w=0,_=x.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),w=Math.max(A,w),S=x.timeRemaining(),1.5*w>S)return _-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-A))}ms`),void this._start();_=S}this.clear()}}class f extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const A=Date.now()+x;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}c.PriorityTaskQueue=f,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:f,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const h=u(643);c.updateWindowsModeWrappedState=function(v){const f=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),C=f?.get(v.cols-1),x=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);x&&C&&(x.isWrapped=C[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&C[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new u;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}c.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,C=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=C}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=h},9092:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const h=u(6349),v=u(7226),f=u(3734),C=u(8437),x=u(4634),A=u(511),w=u(643),_=u(4863),S=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(p,m,E){this._hasScrollback=p,this._optionsService=m,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,m){return new C.BufferLine(this._bufferService.cols,this.getNullCell(p),m)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&p<this._rows}_getCorrectBufferLength(p){if(!this._hasScrollback)return p;const m=p+this._optionsService.rawOptions.scrollback;return m>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:m}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=C.DEFAULT_ATTR_DATA);let m=this._rows;for(;m--;)this.lines.push(this.getBlankLine(p))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(p,m){const E=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=0;const L=this._getCorrectBufferLength(m);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<p)for(let T=0;T<this.lines.length;T++)R+=+this.lines.get(T).resize(p,E);let D=0;if(this._rows<m)for(let T=this._rows;T<m;T++)this.lines.length<m+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(p,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new C.BufferLine(p,E)));else for(let T=this._rows;T>m;T--)this.lines.length>m+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const T=this.lines.length-L;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=L}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,m-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=m-1,this._isReflowEnabled&&(this._reflow(p,m),this._cols>p))for(let D=0;D<this.lines.length;D++)R+=+this.lines.get(D).resize(p,E);this._cols=p,this._rows=m,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let m=0;for(;this._memoryCleanupPosition<this.lines.length;)if(m+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),m>100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,m){this._cols!==p&&(p>this._cols?this._reflowLarger(p,m):this._reflowSmaller(p,m))}_reflowLarger(p,m){const E=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(E.length>0){const R=(0,x.reflowLargerCreateNewLayout)(this.lines,E);(0,x.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(p,m,R.countRemoved)}}_reflowLargerAdjustViewport(p,m,E){const R=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=E;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<m&&this.lines.push(new C.BufferLine(p,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(p,m){const E=this.getNullCell(C.DEFAULT_ATTR_DATA),R=[];let L=0;for(let D=this.lines.length-1;D>=0;D--){let T=this.lines.get(D);if(!T||!T.isWrapped&&T.getTrimmedLength()<=p)continue;const B=[T];for(;T.isWrapped&&D>0;)T=this.lines.get(--D),B.unshift(T);const W=this.ybase+this.y;if(W>=D&&W<D+B.length)continue;const P=B[B.length-1].getTrimmedLength(),F=(0,x.reflowSmallerGetNewLineLengths)(B,this._cols,p),I=F.length-B.length;let Z;Z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const ee=[];for(let M=0;M<I;M++){const U=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);ee.push(U)}ee.length>0&&(R.push({start:D+B.length+L,newLines:ee}),L+=ee.length),B.push(...ee);let j=F.length-1,Y=F[j];Y===0&&(j--,Y=F[j]);let K=B.length-I-1,O=P;for(;K>=0;){const M=Math.min(O,Y);if(B[j]===void 0)break;if(B[j].copyCellsFrom(B[K],O-M,Y-M,M,!0),Y-=M,Y===0&&(j--,Y=F[j]),O-=M,O===0){K--;const U=Math.max(K,0);O=(0,x.getWrappedLineTrimmedLength)(B,U,this._cols)}}for(let M=0;M<B.length;M++)F[M]<p&&B[M].setCell(F[M],E);let H=I-Z;for(;H-- >0;)this.ybase===0?this.y<m-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-m&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+m-1)}if(R.length>0){const D=[],T=[];for(let j=0;j<this.lines.length;j++)T.push(this.lines.get(j));const B=this.lines.length;let W=B-1,P=0,F=R[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let I=0;for(let j=Math.min(this.lines.maxLength-1,B+L-1);j>=0;j--)if(F&&F.start>W+I){for(let Y=F.newLines.length-1;Y>=0;Y--)this.lines.set(j--,F.newLines[Y]);j++,D.push({index:W+1,amount:F.newLines.length}),I+=F.newLines.length,F=R[++P]}else this.lines.set(j,T[W--]);let Z=0;for(let j=D.length-1;j>=0;j--)D[j].index+=Z,this.lines.onInsertEmitter.fire(D[j]),Z+=D[j].amount;const ee=Math.max(0,B+L-this.lines.maxLength);ee>0&&this.lines.onTrimEmitter.fire(ee)}}translateBufferLineToString(p,m,E=0,R){const L=this.lines.get(p);return L?L.translateToString(m,E,R):""}getWrappedRangeForLine(p){let m=p,E=p;for(;m>0&&this.lines.get(m).isWrapped;)m--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:m,last:E}}setupTabStops(p){for(p!=null?this.tabs[p]||(p=this.prevStop(p)):(this.tabs={},p=0);p<this._cols;p+=this._optionsService.rawOptions.tabStopWidth)this.tabs[p]=!0}prevStop(p){for(p==null&&(p=this.x);!this.tabs[--p]&&p>0;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p<this._cols;);return p>=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].line===p&&(this.markers[m].dispose(),this.markers.splice(m--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].dispose(),this.markers.splice(p--,1);this._isClearing=!1}addMarker(p){const m=new _.Marker(p);return this.markers.push(m),m.register(this.lines.onTrim((E=>{m.line-=E,m.line<0&&m.dispose()}))),m.register(this.lines.onInsert((E=>{m.line>=E.index&&(m.line+=E.amount)}))),m.register(this.lines.onDelete((E=>{m.line>=E.index&&m.line<E.index+E.amount&&m.dispose(),m.line>E.index&&(m.line-=E.amount)}))),m.register(m.onDispose((()=>this._removeMarker(m)))),m}_removeMarker(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),v=u(511),f=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let x=0;class A{constructor(_,S,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const m=S||v.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let E=0;E<_;++E)this.setCell(E,m);this.length=_}get(_){const S=this._data[3*_+0],p=2097151&S;return[this._data[3*_+1],2097152&S?this._combined[_]:p?(0,C.stringFromCodePoint)(p):"",S>>22,2097152&S?this._combined[_].charCodeAt(this._combined[_].length-1):p]}set(_,S){this._data[3*_+1]=S[f.CHAR_DATA_ATTR_INDEX],S[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[_]=S[1],this._data[3*_+0]=2097152|_|S[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*_+0]=S[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(_){return this._data[3*_+0]>>22}hasWidth(_){return 12582912&this._data[3*_+0]}getFg(_){return this._data[3*_+1]}getBg(_){return this._data[3*_+2]}hasContent(_){return 4194303&this._data[3*_+0]}getCodePoint(_){const S=this._data[3*_+0];return 2097152&S?this._combined[_].charCodeAt(this._combined[_].length-1):2097151&S}isCombined(_){return 2097152&this._data[3*_+0]}getString(_){const S=this._data[3*_+0];return 2097152&S?this._combined[_]:2097151&S?(0,C.stringFromCodePoint)(2097151&S):""}isProtected(_){return 536870912&this._data[3*_+2]}loadCell(_,S){return x=3*_,S.content=this._data[x+0],S.fg=this._data[x+1],S.bg=this._data[x+2],2097152&S.content&&(S.combinedData=this._combined[_]),268435456&S.bg&&(S.extended=this._extendedAttrs[_]),S}setCell(_,S){2097152&S.content&&(this._combined[_]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[_]=S.extended),this._data[3*_+0]=S.content,this._data[3*_+1]=S.fg,this._data[3*_+2]=S.bg}setCellFromCodepoint(_,S,p,m){268435456&m.bg&&(this._extendedAttrs[_]=m.extended),this._data[3*_+0]=S|p<<22,this._data[3*_+1]=m.fg,this._data[3*_+2]=m.bg}addCodepointToCell(_,S,p){let m=this._data[3*_+0];2097152&m?this._combined[_]+=(0,C.stringFromCodePoint)(S):2097151&m?(this._combined[_]=(0,C.stringFromCodePoint)(2097151&m)+(0,C.stringFromCodePoint)(S),m&=-2097152,m|=2097152):m=S|4194304,p&&(m&=-12582913,m|=p<<22),this._data[3*_+0]=m}insertCells(_,S,p){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,p),S<this.length-_){const m=new v.CellData;for(let E=this.length-_-S-1;E>=0;--E)this.setCell(_+S+E,this.loadCell(_+E,m));for(let E=0;E<S;++E)this.setCell(_+E,p)}else for(let m=_;m<this.length;++m)this.setCell(m,p);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,p)}deleteCells(_,S,p){if(_%=this.length,S<this.length-_){const m=new v.CellData;for(let E=0;E<this.length-_-S;++E)this.setCell(_+E,this.loadCell(_+S+E,m));for(let E=this.length-S;E<this.length;++E)this.setCell(E,p)}else for(let m=_;m<this.length;++m)this.setCell(m,p);_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,p),this.getWidth(_)!==0||this.hasContent(_)||this.setCellFromCodepoint(_,0,1,p)}replaceCells(_,S,p,m=!1){if(m)for(_&&this.getWidth(_-1)===2&&!this.isProtected(_-1)&&this.setCellFromCodepoint(_-1,0,1,p),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,p);_<S&&_<this.length;)this.isProtected(_)||this.setCell(_,p),_++;else for(_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,p),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,p);_<S&&_<this.length;)this.setCell(_++,p)}resize(_,S){if(_===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const p=3*_;if(_>this.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const m=new Uint32Array(p);m.set(this._data),this._data=m}for(let m=this.length;m<_;++m)this.setCell(m,S)}else{this._data=this._data.subarray(0,p);const m=Object.keys(this._combined);for(let R=0;R<m.length;R++){const L=parseInt(m[R],10);L>=_&&delete this._combined[L]}const E=Object.keys(this._extendedAttrs);for(let R=0;R<E.length;R++){const L=parseInt(E[R],10);L>=_&&delete this._extendedAttrs[L]}}return this.length=_,4*p*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const _=new Uint32Array(this._data.length);return _.set(this._data),this._data=_,1}return 0}fill(_,S=!1){if(S)for(let p=0;p<this.length;++p)this.isProtected(p)||this.setCell(p,_);else{this._combined={},this._extendedAttrs={};for(let p=0;p<this.length;++p)this.setCell(p,_)}}copyFrom(_){this.length!==_.length?this._data=new Uint32Array(_._data):this._data.set(_._data),this.length=_.length,this._combined={};for(const S in _._combined)this._combined[S]=_._combined[S];this._extendedAttrs={};for(const S in _._extendedAttrs)this._extendedAttrs[S]=_._extendedAttrs[S];this.isWrapped=_.isWrapped}clone(){const _=new A(0);_._data=new Uint32Array(this._data),_.length=this.length;for(const S in this._combined)_._combined[S]=this._combined[S];for(const S in this._extendedAttrs)_._extendedAttrs[S]=this._extendedAttrs[S];return _.isWrapped=this.isWrapped,_}getTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0])return _+(this._data[3*_+0]>>22);return 0}getNoBgTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0]||50331648&this._data[3*_+2])return _+(this._data[3*_+0]>>22);return 0}copyCellsFrom(_,S,p,m,E){const R=_._data;if(E)for(let D=m-1;D>=0;D--){for(let T=0;T<3;T++)this._data[3*(p+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[p+D]=_._extendedAttrs[S+D])}else for(let D=0;D<m;D++){for(let T=0;T<3;T++)this._data[3*(p+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[p+D]=_._extendedAttrs[S+D])}const L=Object.keys(_._combined);for(let D=0;D<L.length;D++){const T=parseInt(L[D],10);T>=S&&(this._combined[T-S+p]=_._combined[T])}}translateToString(_,S,p,m){S=S??0,p=p??this.length,_&&(p=Math.min(p,this.getTrimmedLength())),m&&(m.length=0);let E="";for(;S<p;){const R=this._data[3*S+0],L=2097151&R,D=2097152&R?this._combined[S]:L?(0,C.stringFromCodePoint)(L):f.WHITESPACE_CELL_CHAR;if(E+=D,m)for(let T=0;T<D.length;++T)m.push(S);S+=R>>22||1}return m&&m.push(S),E}}c.BufferLine=A},4841:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(b,c)=>{function u(h,v,f){if(v===h.length-1)return h[v].getTrimmedLength();const C=!h[v].hasContent(f-1)&&h[v].getWidth(f-1)===1,x=h[v+1].getWidth(0)===2;return C&&x?f-1:f}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,v,f,C,x){const A=[];for(let w=0;w<h.length-1;w++){let _=w,S=h.get(++_);if(!S.isWrapped)continue;const p=[h.get(w)];for(;_<h.length&&S.isWrapped;)p.push(S),S=h.get(++_);if(C>=w&&C<_){w+=p.length-1;continue}let m=0,E=u(p,m,v),R=1,L=0;for(;R<p.length;){const T=u(p,R,v),B=T-L,W=f-E,P=Math.min(B,W);p[m].copyCellsFrom(p[R],L,E,P,!1),E+=P,E===f&&(m++,E=0),L+=P,L===T&&(R++,L=0),E===0&&m!==0&&p[m-1].getWidth(f-1)===2&&(p[m].copyCellsFrom(p[m-1],f-1,E++,1,!1),p[m-1].setCell(f-1,x))}p[m].replaceCells(E,f,x);let D=0;for(let T=p.length-1;T>0&&(T>m||p[T].getTrimmedLength()===0);T--)D++;D>0&&(A.push(w+p.length-D),A.push(D)),w+=p.length-1}return A},c.reflowLargerCreateNewLayout=function(h,v){const f=[];let C=0,x=v[C],A=0;for(let w=0;w<h.length;w++)if(x===w){const _=v[++C];h.onDeleteEmitter.fire({index:w-A,amount:_}),w+=_-1,A+=_,x=v[++C]}else f.push(w);return{layout:f,countRemoved:A}},c.reflowLargerApplyNewLayout=function(h,v){const f=[];for(let C=0;C<v.length;C++)f.push(h.get(v[C]));for(let C=0;C<f.length;C++)h.set(C,f[C]);h.length=v.length},c.reflowSmallerGetNewLineLengths=function(h,v,f){const C=[],x=h.map(((S,p)=>u(h,p,v))).reduce(((S,p)=>S+p));let A=0,w=0,_=0;for(;_<x;){if(x-_<f){C.push(x-_);break}A+=f;const S=u(h,w,v);A>S&&(A-=S,w++);const p=h[w].getWidth(A-1)===2;p&&A--;const m=p?f-1:f;C.push(m),_+=m}return C},c.getWrappedLineTrimmedLength=u},5295:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),v=u(844),f=u(9092);class C extends v.Disposable{constructor(A,w){super(),this._optionsService=A,this._bufferService=w,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(A,w){this._normal.resize(A,w),this._alt.resize(A,w),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}c.BufferSet=C},511:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const h=u(482),v=u(643),f=u(3734);class C extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const w=new C;return w.setFromCharData(A),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(A[v.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(A[v.CHAR_DATA_CHAR_INDEX].length===2){const _=A[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const S=A[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(_-55296)+S-56320+65536|A[v.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=A[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[v.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=A[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const h=u(8460),v=u(844);class f{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}c.Marker=f,f._nextId=1},7116:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(b,c)=>{var u,h,v;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
81
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(u||(c.C0=u={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(h||(c.C1=h={})),(function(f){f.ST=`${u.ESC}\\`})(v||(c.C1_ESCAPED=v={}))},7399:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),v={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};c.evaluateKeyboardEvent=function(f,C,x,A){const w={type:0,cancel:!1,key:void 0},_=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?w.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":h.C0.DEL,f.altKey&&(w.key=h.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=h.C0.ESC+"[Z";break}w.key=h.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,w.cancel=!0;break;case 27:w.key=h.C0.ESC,f.altKey&&(w.key=h.C0.ESC+h.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;_?(w.key=h.C0.ESC+"[1;"+(_+1)+"D",w.key===h.C0.ESC+"[1;3D"&&(w.key=h.C0.ESC+(x?"b":"[1;5D"))):w.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(f.metaKey)break;_?(w.key=h.C0.ESC+"[1;"+(_+1)+"C",w.key===h.C0.ESC+"[1;3C"&&(w.key=h.C0.ESC+(x?"f":"[1;5C"))):w.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(f.metaKey)break;_?(w.key=h.C0.ESC+"[1;"+(_+1)+"A",x||w.key!==h.C0.ESC+"[1;3A"||(w.key=h.C0.ESC+"[1;5A")):w.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(f.metaKey)break;_?(w.key=h.C0.ESC+"[1;"+(_+1)+"B",x||w.key!==h.C0.ESC+"[1;3B"||(w.key=h.C0.ESC+"[1;5B")):w.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=h.C0.ESC+"[2~");break;case 46:w.key=_?h.C0.ESC+"[3;"+(_+1)+"~":h.C0.ESC+"[3~";break;case 36:w.key=_?h.C0.ESC+"[1;"+(_+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:w.key=_?h.C0.ESC+"[1;"+(_+1)+"F":C?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=h.C0.ESC+"[5;"+(_+1)+"~":w.key=h.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=h.C0.ESC+"[6;"+(_+1)+"~":w.key=h.C0.ESC+"[6~";break;case 112:w.key=_?h.C0.ESC+"[1;"+(_+1)+"P":h.C0.ESC+"OP";break;case 113:w.key=_?h.C0.ESC+"[1;"+(_+1)+"Q":h.C0.ESC+"OQ";break;case 114:w.key=_?h.C0.ESC+"[1;"+(_+1)+"R":h.C0.ESC+"OR";break;case 115:w.key=_?h.C0.ESC+"[1;"+(_+1)+"S":h.C0.ESC+"OS";break;case 116:w.key=_?h.C0.ESC+"[15;"+(_+1)+"~":h.C0.ESC+"[15~";break;case 117:w.key=_?h.C0.ESC+"[17;"+(_+1)+"~":h.C0.ESC+"[17~";break;case 118:w.key=_?h.C0.ESC+"[18;"+(_+1)+"~":h.C0.ESC+"[18~";break;case 119:w.key=_?h.C0.ESC+"[19;"+(_+1)+"~":h.C0.ESC+"[19~";break;case 120:w.key=_?h.C0.ESC+"[20;"+(_+1)+"~":h.C0.ESC+"[20~";break;case 121:w.key=_?h.C0.ESC+"[21;"+(_+1)+"~":h.C0.ESC+"[21~";break;case 122:w.key=_?h.C0.ESC+"[23;"+(_+1)+"~":h.C0.ESC+"[23~";break;case 123:w.key=_?h.C0.ESC+"[24;"+(_+1)+"~":h.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(x&&!A||!f.altKey||f.metaKey)!x||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?w.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(w.key=h.C0.US),f.key==="@"&&(w.key=h.C0.NUL)):f.keyCode===65&&(w.type=1);else{const S=v[f.keyCode],p=S?.[f.shiftKey?1:0];if(p)w.key=h.C0.ESC+p;else if(f.keyCode>=65&&f.keyCode<=90){const m=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(m);f.shiftKey&&(E=E.toUpperCase()),w.key=h.C0.ESC+E}else if(f.keyCode===32)w.key=h.C0.ESC+(f.ctrlKey?h.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let m=f.code.slice(3,4);f.shiftKey||(m=m.toLowerCase()),w.key=h.C0.ESC+m,w.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?w.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?w.key=h.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=h.C0.DEL:f.keyCode===219?w.key=h.C0.ESC:f.keyCode===220?w.key=h.C0.FS:f.keyCode===221&&(w.key=h.C0.GS)}return w}},482:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,h=0,v=u.length){let f="";for(let C=h;C<v;++C){let x=u[C];x>65535?(x-=65536,f+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):f+=String.fromCharCode(x)}return f},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const v=u.length;if(!v)return 0;let f=0,C=0;if(this._interim){const x=u.charCodeAt(C++);56320<=x&&x<=57343?h[f++]=1024*(this._interim-55296)+x-56320+65536:(h[f++]=this._interim,h[f++]=x),this._interim=0}for(let x=C;x<v;++x){const A=u.charCodeAt(x);if(55296<=A&&A<=56319){if(++x>=v)return this._interim=A,f;const w=u.charCodeAt(x);56320<=w&&w<=57343?h[f++]=1024*(A-55296)+w-56320+65536:(h[f++]=A,h[f++]=w)}else A!==65279&&(h[f++]=A)}return f}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const v=u.length;if(!v)return 0;let f,C,x,A,w=0,_=0,S=0;if(this.interim[0]){let E=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let L,D=0;for(;(L=63&this.interim[++D])&&D<4;)R<<=6,R|=L;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=T-D;for(;S<B;){if(S>=v)return 0;if(L=u[S++],(192&L)!=128){S--,E=!0;break}this.interim[D++]=L,R<<=6,R|=63&L}E||(T===2?R<128?S--:h[w++]=R:T===3?R<2048||R>=55296&&R<=57343||R===65279||(h[w++]=R):R<65536||R>1114111||(h[w++]=R)),this.interim.fill(0)}const p=v-4;let m=S;for(;m<v;){for(;!(!(m<p)||128&(f=u[m])||128&(C=u[m+1])||128&(x=u[m+2])||128&(A=u[m+3]));)h[w++]=f,h[w++]=C,h[w++]=x,h[w++]=A,m+=4;if(f=u[m++],f<128)h[w++]=f;else if((224&f)==192){if(m>=v)return this.interim[0]=f,w;if(C=u[m++],(192&C)!=128){m--;continue}if(_=(31&f)<<6|63&C,_<128){m--;continue}h[w++]=_}else if((240&f)==224){if(m>=v)return this.interim[0]=f,w;if(C=u[m++],(192&C)!=128){m--;continue}if(m>=v)return this.interim[0]=f,this.interim[1]=C,w;if(x=u[m++],(192&x)!=128){m--;continue}if(_=(15&f)<<12|(63&C)<<6|63&x,_<2048||_>=55296&&_<=57343||_===65279)continue;h[w++]=_}else if((248&f)==240){if(m>=v)return this.interim[0]=f,w;if(C=u[m++],(192&C)!=128){m--;continue}if(m>=v)return this.interim[0]=f,this.interim[1]=C,w;if(x=u[m++],(192&x)!=128){m--;continue}if(m>=v)return this.interim[0]=f,this.interim[1]=C,this.interim[2]=x,w;if(A=u[m++],(192&A)!=128){m--;continue}if(_=(7&f)<<18|(63&C)<<12|(63&x)<<6|63&A,_<65536||_>1114111)continue;h[w++]=_}}return w}}},225:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),v=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let x=0;x<v.length;++x)C.fill(0,v[x][0],v[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?C[x]:(function(A,w){let _,S=0,p=w.length-1;if(A<w[0][0]||A>w[p][1])return!1;for(;p>=S;)if(_=S+p>>1,A>w[_][1])S=_+1;else{if(!(A<w[_][0]))return!0;p=_-1}return!1})(x,f)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,A){let w=this.wcwidth(x),_=w===0&&A!==0;if(_){const S=h.UnicodeService.extractWidth(A);S===0?_=!1:S>w&&(w=S)}return h.UnicodeService.createPropertyValue(0,w,_)}}},5981:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),v=u(844);class f extends v.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const _=this._callbacks.shift();_&&_()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(A)}_innerWrite(x=0,A=!0){const w=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const _=this._writeBuffer[this._bufferOffset],S=this._action(_,A);if(S){const m=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void S.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(m)}const p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=_.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}c.WriteBuffer=f},5941:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function v(f,C){const x=f.toString(16),A=x.length<2?"0"+x:x;switch(C){case 4:return x[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}c.parseColor=function(f){if(!f)return;let C=f.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const x=u.exec(C);if(x){const A=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/A*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/A*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/A*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const x=C.length/3,A=[0,0,0];for(let w=0;w<3;++w){const _=parseInt(C.slice(x*w,x*w+x),16);A[w]=x===1?_<<4:x===2?_:x===3?_>>4:_>>8}return A}},c.toRgbString=function(f,C=16){const[x,A,w]=f;return`rgb:${v(x,C)}/${v(A,C)}/${v(w,C)}`}},5770:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const h=u(482),v=u(8742),f=u(5770),C=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(A,w){this._handlers[A]===void 0&&(this._handlers[A]=[]);const _=this._handlers[A];return _.push(w),{dispose:()=>{const S=_.indexOf(w);S!==-1&&_.splice(S,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(A,w){if(this.reset(),this._ident=A,this._active=this._handlers[A]||C,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(A,w,_){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(A,w,_);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,w,_))}unhook(A,w=!0){if(this._active.length){let _=!1,S=this._active.length-1,p=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,_=w,p=this._stack.fallThrough,this._stack.paused=!1),!p&&_===!1){for(;S>=0&&(_=this._active[S].unhook(A),_!==!0);S--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,_;S--}for(;S>=0;S--)if(_=this._active[S].unhook(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,_}else this._handlerFb(this._ident,"UNHOOK",A);this._active=C,this._ident=0}};const x=new v.Params;x.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=x,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():x,this._data="",this._hitLimit=!1}put(A,w,_){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,w,_),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let w=!1;if(this._hitLimit)w=!1;else if(A&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((_=>(this._params=x,this._data="",this._hitLimit=!1,_)));return this._params=x,this._data="",this._hitLimit=!1,w}}},2015:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),v=u(8742),f=u(6242),C=u(6351);class x{constructor(S){this.table=new Uint8Array(S)}setDefault(S,p){this.table.fill(S<<4|p)}add(S,p,m,E){this.table[p<<8|S]=m<<4|E}addMany(S,p,m,E){for(let R=0;R<S.length;R++)this.table[p<<8|S[R]]=m<<4|E}}c.TransitionTable=x;const A=160;c.VT500_TRANSITION_TABLE=(function(){const _=new x(4095),S=Array.apply(null,Array(256)).map(((D,T)=>T)),p=(D,T)=>S.slice(D,T),m=p(32,127),E=p(0,24);E.push(25),E.push.apply(E,p(28,32));const R=p(0,14);let L;for(L in _.setDefault(1,0),_.addMany(m,0,2,0),R)_.addMany([24,26,153,154],L,3,0),_.addMany(p(128,144),L,3,0),_.addMany(p(144,152),L,3,0),_.add(156,L,0,0),_.add(27,L,11,1),_.add(157,L,4,8),_.addMany([152,158,159],L,0,7),_.add(155,L,11,3),_.add(144,L,11,9);return _.addMany(E,0,3,0),_.addMany(E,1,3,1),_.add(127,1,0,1),_.addMany(E,8,0,8),_.addMany(E,3,3,3),_.add(127,3,0,3),_.addMany(E,4,3,4),_.add(127,4,0,4),_.addMany(E,6,3,6),_.addMany(E,5,3,5),_.add(127,5,0,5),_.addMany(E,2,3,2),_.add(127,2,0,2),_.add(93,1,4,8),_.addMany(m,8,5,8),_.add(127,8,5,8),_.addMany([156,27,24,26,7],8,6,0),_.addMany(p(28,32),8,0,8),_.addMany([88,94,95],1,0,7),_.addMany(m,7,0,7),_.addMany(E,7,0,7),_.add(156,7,0,0),_.add(127,7,0,7),_.add(91,1,11,3),_.addMany(p(64,127),3,7,0),_.addMany(p(48,60),3,8,4),_.addMany([60,61,62,63],3,9,4),_.addMany(p(48,60),4,8,4),_.addMany(p(64,127),4,7,0),_.addMany([60,61,62,63],4,0,6),_.addMany(p(32,64),6,0,6),_.add(127,6,0,6),_.addMany(p(64,127),6,0,0),_.addMany(p(32,48),3,9,5),_.addMany(p(32,48),5,9,5),_.addMany(p(48,64),5,0,6),_.addMany(p(64,127),5,7,0),_.addMany(p(32,48),4,9,5),_.addMany(p(32,48),1,9,2),_.addMany(p(32,48),2,9,2),_.addMany(p(48,127),2,10,0),_.addMany(p(48,80),1,10,0),_.addMany(p(81,88),1,10,0),_.addMany([89,90,92],1,10,0),_.addMany(p(96,127),1,10,0),_.add(80,1,11,9),_.addMany(E,9,0,9),_.add(127,9,0,9),_.addMany(p(28,32),9,0,9),_.addMany(p(32,48),9,9,12),_.addMany(p(48,60),9,8,10),_.addMany([60,61,62,63],9,9,10),_.addMany(E,11,0,11),_.addMany(p(32,128),11,0,11),_.addMany(p(28,32),11,0,11),_.addMany(E,10,0,10),_.add(127,10,0,10),_.addMany(p(28,32),10,0,10),_.addMany(p(48,60),10,8,10),_.addMany([60,61,62,63],10,0,11),_.addMany(p(32,48),10,9,12),_.addMany(E,12,0,12),_.add(127,12,0,12),_.addMany(p(28,32),12,0,12),_.addMany(p(32,48),12,9,12),_.addMany(p(48,64),12,0,11),_.addMany(p(64,127),12,12,13),_.addMany(p(64,127),10,12,13),_.addMany(p(64,127),9,12,13),_.addMany(E,13,13,13),_.addMany(m,13,13,13),_.add(127,13,0,13),_.addMany([27,156,24,26],13,14,0),_.add(A,0,2,0),_.add(A,8,5,8),_.add(A,6,0,6),_.add(A,11,0,11),_.add(A,13,13,13),_})();class w extends h.Disposable{constructor(S=c.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(p,m,E)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,m)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,p=[64,126]){let m=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(m=S.prefix.charCodeAt(0),m&&60>m||m>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<S.intermediates.length;++R){const L=S.intermediates.charCodeAt(R);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");m<<=8,m|=L}}if(S.final.length!==1)throw new Error("final must be a single byte");const E=S.final.charCodeAt(0);if(p[0]>E||E>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return m<<=8,m|=E,m}identToString(S){const p=[];for(;S;)p.push(String.fromCharCode(255&S)),S>>=8;return p.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,p){const m=this._identifier(S,[48,126]);this._escHandlers[m]===void 0&&(this._escHandlers[m]=[]);const E=this._escHandlers[m];return E.push(p),{dispose:()=>{const R=E.indexOf(p);R!==-1&&E.splice(R,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,p){this._executeHandlers[S.charCodeAt(0)]=p}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,p){const m=this._identifier(S);this._csiHandlers[m]===void 0&&(this._csiHandlers[m]=[]);const E=this._csiHandlers[m];return E.push(p),{dispose:()=>{const R=E.indexOf(p);R!==-1&&E.splice(R,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,p){return this._dcsParser.registerHandler(this._identifier(S),p)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,p){return this._oscParser.registerHandler(S,p)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(S,p,m,E,R){this._parseStack.state=S,this._parseStack.handlers=p,this._parseStack.handlerPos=m,this._parseStack.transition=E,this._parseStack.chunkPos=R}parse(S,p,m){let E,R=0,L=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(m===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(m===!1&&B>-1){for(;B>=0&&(E=T[B](this._params),E!==!0);B--)if(E instanceof Promise)return this._parseStack.handlerPos=B,E}this._parseStack.handlers=[];break;case 4:if(m===!1&&B>-1){for(;B>=0&&(E=T[B](),E!==!0);B--)if(E instanceof Promise)return this._parseStack.handlerPos=B,E}this._parseStack.handlers=[];break;case 6:if(R=S[this._parseStack.chunkPos],E=this._dcsParser.unhook(R!==24&&R!==26,m),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=S[this._parseStack.chunkPos],E=this._oscParser.end(R!==24&&R!==26,m),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=D;T<p;++T){switch(R=S[T],L=this._transitions.table[this.currentState<<8|(R<160?R:A)],L>>4){case 2:for(let I=T+1;;++I){if(I>=p||(R=S[I])<32||R>126&&R<A){this._printHandler(S,T,I),T=I-1;break}if(++I>=p||(R=S[I])<32||R>126&&R<A){this._printHandler(S,T,I),T=I-1;break}if(++I>=p||(R=S[I])<32||R>126&&R<A){this._printHandler(S,T,I),T=I-1;break}if(++I>=p||(R=S[I])<32||R>126&&R<A){this._printHandler(S,T,I),T=I-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:T,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|R];let W=B?B.length-1:-1;for(;W>=0&&(E=B[W](this._params),E!==!0);W--)if(E instanceof Promise)return this._preserveStack(3,B,W,L,T),E;W<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++T<p&&(R=S[T])>47&&R<60);T--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const P=this._escHandlers[this._collect<<8|R];let F=P?P.length-1:-1;for(;F>=0&&(E=P[F](),E!==!0);F--)if(E instanceof Promise)return this._preserveStack(4,P,F,L,T),E;F<0&&this._escHandlerFb(this._collect<<8|R),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|R,this._params);break;case 13:for(let I=T+1;;++I)if(I>=p||(R=S[I])===24||R===26||R===27||R>127&&R<A){this._dcsParser.put(S,T,I),T=I-1;break}break;case 14:if(E=this._dcsParser.unhook(R!==24&&R!==26),E)return this._preserveStack(6,[],0,L,T),E;R===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let I=T+1;;I++)if(I>=p||(R=S[I])<32||R>127&&R<A){this._oscParser.put(S,T,I),T=I-1;break}break;case 6:if(E=this._oscParser.end(R!==24&&R!==26),E)return this._preserveStack(5,[],0,L,T),E;R===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}c.EscapeSequenceParser=w},6242:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),v=u(482),f=[];c.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,x){this._handlers[C]===void 0&&(this._handlers[C]=[]);const A=this._handlers[C];return A.push(x),{dispose:()=>{const w=A.indexOf(x);w!==-1&&A.splice(w,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,x,A){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(C,x,A);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(C,x,A))}start(){this.reset(),this._state=1}put(C,x,A){if(this._state!==3){if(this._state===1)for(;x<A;){const w=C[x++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&A-x>0&&this._put(C,x,A)}}end(C,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,w=this._active.length-1,_=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,A=x,_=this._stack.fallThrough,this._stack.paused=!1),!_&&A===!1){for(;w>=0&&(A=this._active[w].end(C),A!==!0);w--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,A;w--}for(;w>=0;w--)if(A=this._active[w].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",C);this._active=f,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,x,A){this._hitLimit||(this._data+=(0,v.utf32ToString)(C,x,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let x=!1;if(this._hitLimit)x=!1;else if(C&&(x=this._handler(this._data),x instanceof Promise))return x.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,x}}},8742:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(f){const C=new h;if(!f.length)return C;for(let x=Array.isArray(f[0])?1:0;x<f.length;++x){const A=f[x];if(Array.isArray(A))for(let w=0;w<A.length;++w)C.addSubParam(A[w]);else C.addParam(A)}return C}constructor(f=32,C=32){if(this.maxLength=f,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new h(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let C=0;C<this.length;++C){f.push(this.params[C]);const x=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-x>0&&f.push(Array.prototype.slice.call(this._subParams,x,A))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>u?u:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const C=this._subParamsIdx[f]>>8,x=255&this._subParamsIdx[f];return x-C>0?this._subParams.subarray(C,x):null}getSubParamsAll(){const f={};for(let C=0;C<this.length;++C){const x=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-x>0&&(f[C]=this._subParams.slice(x,A))}return f}addDigit(f){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,A=x[C-1];x[C-1]=~A?Math.min(10*A+f,u):f}}c.Params=h},5741:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const v={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(v),h.dispose=()=>this._wrappedAddonDispose(v),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===u){h=v;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(h,1)}}},8771:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const h=u(3785),v=u(511);c.BufferApiView=class{constructor(f,C){this._buffer=f,this.type=C}init(f){return this._buffer=f,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(f){const C=this._buffer.lines.get(f);if(C)return new h.BufferLineApiView(C)}getNullCell(){return new v.CellData}}},3785:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,f){if(!(v<0||v>=this._line.length))return f?(this._line.loadCell(v,f),f):this._line.loadCell(v,new h.CellData)}translateToString(v,f,C){return this._line.translateToString(v,f,C)}}},8285:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),v=u(8460),f=u(844);class C extends f.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}c.BufferNamespaceApi=C},7975:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(v=>h(v.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((v,f)=>h(v,f.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(b,c,u){var h=this&&this.__decorate||function(_,S,p,m){var E,R=arguments.length,L=R<3?S:m===null?m=Object.getOwnPropertyDescriptor(S,p):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(_,S,p,m);else for(var D=_.length-1;D>=0;D--)(E=_[D])&&(L=(R<3?E(L):R>3?E(S,p,L):E(S,p))||L);return R>3&&L&&Object.defineProperty(S,p,L),L},v=this&&this.__param||function(_,S){return function(p,m){S(p,m,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const f=u(8460),C=u(844),x=u(5295),A=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let w=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(_){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(_.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(_.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(_,this))}resize(_,S){this.cols=_,this.rows=S,this.buffers.resize(_,S),this._onResize.fire({cols:_,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(_,S=!1){const p=this.buffer;let m;m=this._cachedBlankLine,m&&m.length===this.cols&&m.getFg(0)===_.fg&&m.getBg(0)===_.bg||(m=p.getBlankLine(_,S),this._cachedBlankLine=m),m.isWrapped=S;const E=p.ybase+p.scrollTop,R=p.ybase+p.scrollBottom;if(p.scrollTop===0){const L=p.lines.isFull;R===p.lines.length-1?L?p.lines.recycle().copyFrom(m):p.lines.push(m.clone()):p.lines.splice(R+1,0,m.clone()),L?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const L=R-E+1;p.lines.shiftElements(E+1,L-1,-1),p.lines.set(R,m.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(_,S,p){const m=this.buffer;if(_<0){if(m.ydisp===0)return;this.isUserScrolling=!0}else _+m.ydisp>=m.ybase&&(this.isUserScrolling=!1);const E=m.ydisp;m.ydisp=Math.max(Math.min(m.ydisp+_,m.ybase),0),E!==m.ydisp&&(S||this._onScroll.fire(m.ydisp))}};c.BufferService=w=h([v(0,A.IOptionsService)],w)},7994:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(b,c,u){var h=this&&this.__decorate||function(m,E,R,L){var D,T=arguments.length,B=T<3?E:L===null?L=Object.getOwnPropertyDescriptor(E,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(m,E,R,L);else for(var W=m.length-1;W>=0;W--)(D=m[W])&&(B=(T<3?D(B):T>3?D(E,R,B):D(E,R))||B);return T>3&&B&&Object.defineProperty(E,R,B),B},v=this&&this.__param||function(m,E){return function(R,L){E(R,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const f=u(2585),C=u(8460),x=u(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:m=>m.button!==4&&m.action===1&&(m.ctrl=!1,m.alt=!1,m.shift=!1,!0)},VT200:{events:19,restrict:m=>m.action!==32},DRAG:{events:23,restrict:m=>m.action!==32||m.button!==3},ANY:{events:31,restrict:m=>!0}};function w(m,E){let R=(m.ctrl?16:0)|(m.shift?4:0)|(m.alt?8:0);return m.button===4?(R|=64,R|=m.action):(R|=3&m.button,4&m.button&&(R|=64),8&m.button&&(R|=128),m.action===32?R|=32:m.action!==0||E||(R|=3)),R}const _=String.fromCharCode,S={DEFAULT:m=>{const E=[w(m,!1)+32,m.col+32,m.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${_(E[0])}${_(E[1])}${_(E[2])}`},SGR:m=>{const E=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${w(m,!0)};${m.col};${m.row}${E}`},SGR_PIXELS:m=>{const E=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${w(m,!0)};${m.x};${m.y}${E}`}};let p=c.CoreMouseService=class extends x.Disposable{constructor(m,E){super(),this._bufferService=m,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(A))this.addProtocol(R,A[R]);for(const R of Object.keys(S))this.addEncoding(R,S[R]);this.reset()}addProtocol(m,E){this._protocols[m]=E}addEncoding(m,E){this._encodings[m]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(m){if(!this._protocols[m])throw new Error(`unknown protocol "${m}"`);this._activeProtocol=m,this._onProtocolChange.fire(this._protocols[m].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(m){if(!this._encodings[m])throw new Error(`unknown encoding "${m}"`);this._activeEncoding=m}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(m){if(m.col<0||m.col>=this._bufferService.cols||m.row<0||m.row>=this._bufferService.rows||m.button===4&&m.action===32||m.button===3&&m.action!==32||m.button!==4&&(m.action===2||m.action===3)||(m.col++,m.row++,m.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,m,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(m))return!1;const E=this._encodings[this._activeEncoding](m);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=m,!0}explainEvents(m){return{down:!!(1&m),up:!!(2&m),drag:!!(4&m),move:!!(8&m),wheel:!!(16&m)}}_equalEvents(m,E,R){if(R){if(m.x!==E.x||m.y!==E.y)return!1}else if(m.col!==E.col||m.row!==E.row)return!1;return m.button===E.button&&m.action===E.action&&m.ctrl===E.ctrl&&m.alt===E.alt&&m.shift===E.shift}};c.CoreMouseService=p=h([v(0,f.IBufferService),v(1,f.ICoreService)],p)},6975:function(b,c,u){var h=this&&this.__decorate||function(p,m,E,R){var L,D=arguments.length,T=D<3?m:R===null?R=Object.getOwnPropertyDescriptor(m,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,m,E,R);else for(var B=p.length-1;B>=0;B--)(L=p[B])&&(T=(D<3?L(T):D>3?L(m,E,T):L(m,E))||T);return D>3&&T&&Object.defineProperty(m,E,T),T},v=this&&this.__param||function(p,m){return function(E,R){m(E,R,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const f=u(1439),C=u(8460),x=u(844),A=u(2585),w=Object.freeze({insertMode:!1}),_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=c.CoreService=class extends x.Disposable{constructor(p,m,E){super(),this._bufferService=p,this._logService=m,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(_)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(_)}triggerDataEvent(p,m=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;m&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),m&&this._onUserInput.fire(),this._logService.debug(`sending data "${p}"`,(()=>p.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,(()=>p.split("").map((m=>m.charCodeAt(0))))),this._onBinary.fire(p))}};c.CoreService=S=h([v(0,A.IBufferService),v(1,A.ILogService),v(2,A.IOptionsService)],S)},9074:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),v=u(8460),f=u(844),C=u(6106);let x=0,A=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((p=>p?.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(p){if(p.marker.isDisposed)return;const m=new _(p);if(m){const E=m.marker.onDispose((()=>m.dispose()));m.onDispose((()=>{m&&(this._decorations.delete(m)&&this._onDecorationRemoved.fire(m),E.dispose())})),this._decorations.insert(m),this._onDecorationRegistered.fire(m)}return m}reset(){for(const p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,m,E){let R=0,L=0;for(const D of this._decorations.getKeyIterator(m))R=D.options.x??0,L=R+(D.options.width??1),p>=R&&p<L&&(!E||(D.options.layer??"bottom")===E)&&(yield D)}forEachDecorationAtCell(p,m,E,R){this._decorations.forEachByKey(m,(L=>{x=L.options.x??0,A=x+(L.options.width??1),p>=x&&p<A&&(!E||(L.options.layer??"bottom")===E)&&R(L)}))}}c.DecorationService=w;class _ extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(p){super(),this.options=p,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=p.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),v=u(8343);class f{constructor(...x){this._entries=new Map;for(const[A,w]of x)this.set(A,w)}set(x,A){const w=this._entries.get(x);return this._entries.set(x,A),w}forEach(x){for(const[A,w]of this._entries.entries())x(A,w)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}c.ServiceCollection=f,c.InstantiationService=class{constructor(){this._services=new f,this._services.set(h.IInstantiationService,this)}setService(C,x){this._services.set(C,x)}getService(C){return this._services.get(C)}createInstance(C,...x){const A=(0,v.getServiceDependencies)(C).sort(((S,p)=>S.index-p.index)),w=[];for(const S of A){const p=this._services.get(S.id);if(!p)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${S.id}.`);w.push(p)}const _=A.length>0?A[0].index:x.length;if(x.length!==_)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${_+1} conflicts with ${x.length} static arguments`);return new C(...x,...w)}}},7866:function(b,c,u){var h=this&&this.__decorate||function(_,S,p,m){var E,R=arguments.length,L=R<3?S:m===null?m=Object.getOwnPropertyDescriptor(S,p):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(_,S,p,m);else for(var D=_.length-1;D>=0;D--)(E=_[D])&&(L=(R<3?E(L):R>3?E(S,p,L):E(S,p))||L);return R>3&&L&&Object.defineProperty(S,p,L),L},v=this&&this.__param||function(_,S){return function(p,m){S(p,m,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const f=u(844),C=u(2585),x={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let A,w=c.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(_){for(let S=0;S<_.length;S++)typeof _[S]=="function"&&(_[S]=_[S]())}_log(_,S,p){this._evalLazyOptionalParams(p),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...p)}trace(_,...S){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,_,S)}debug(_,...S){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,_,S)}info(_,...S){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,_,S)}warn(_,...S){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,_,S)}error(_,...S){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,_,S)}};c.LogService=w=h([v(0,C.IOptionsService)],w),c.setTraceLogger=function(_){A=_},c.traceCall=function(_,S,p){if(typeof p.value!="function")throw new Error("not supported");const m=p.value;p.value=function(...E){if(A.logLevel!==C.LogLevelEnum.TRACE)return m.apply(this,E);A.trace(`GlyphRenderer#${m.name}(${E.map((L=>JSON.stringify(L))).join(", ")})`);const R=m.apply(this,E);return A.trace(`GlyphRenderer#${m.name} return`,R),R}}},7302:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),v=u(844),f=u(6114);c.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends v.Disposable{constructor(w){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...c.DEFAULT_OPTIONS};for(const S in w)if(S in _)try{const p=w[S];_[S]=this._sanitizeAndValidateOption(S,p)}catch(p){console.error(p)}this.rawOptions=_,this.options={..._},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,_){return this.onOptionChange((S=>{S===w&&_(this.rawOptions[w])}))}onMultipleOptionChange(w,_){return this.onOptionChange((S=>{w.indexOf(S)!==-1&&_()}))}_setupOptions(){const w=S=>{if(!(S in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},_=(S,p)=>{if(!(S in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);p=this._sanitizeAndValidateOption(S,p),this.rawOptions[S]!==p&&(this.rawOptions[S]=p,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const p={get:w.bind(this,S),set:_.bind(this,S)};Object.defineProperty(this.options,S,p)}}_sanitizeAndValidateOption(w,_){switch(w){case"cursorStyle":if(_||(_=c.DEFAULT_OPTIONS[w]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(_))throw new Error(`"${_}" is not a valid value for ${w}`);break;case"wordSeparator":_||(_=c.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=C.includes(_)?_:c.DEFAULT_OPTIONS[w];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${w} cannot be less than 1, value: ${_}`);break;case"minimumContrastRatio":_=Math.max(1,Math.min(21,Math.round(10*_)/10));break;case"scrollback":if((_=Math.min(_,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${_}`);break;case"rows":case"cols":if(!_&&_!==0)throw new Error(`${w} must be numeric, value: ${_}`);break;case"windowsPty":_=_??{}}return _}}c.OptionsService=x},2660:function(b,c,u){var h=this&&this.__decorate||function(x,A,w,_){var S,p=arguments.length,m=p<3?A:_===null?_=Object.getOwnPropertyDescriptor(A,w):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(x,A,w,_);else for(var E=x.length-1;E>=0;E--)(S=x[E])&&(m=(p<3?S(m):p>3?S(A,w,m):S(A,w))||m);return p>3&&m&&Object.defineProperty(A,w,m),m},v=this&&this.__param||function(x,A){return function(w,_){A(w,_,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const f=u(2585);let C=c.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const A=this._bufferService.buffer;if(x.id===void 0){const E=A.addMarker(A.ybase+A.y),R={data:x,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(R,E))),this._dataByLinkId.set(R.id,R),R.id}const w=x,_=this._getEntryIdKey(w),S=this._entriesWithId.get(_);if(S)return this.addLineToLink(S.id,A.ybase+A.y),S.id;const p=A.addMarker(A.ybase+A.y),m={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(m,p))),this._entriesWithId.set(m.key,m),this._dataByLinkId.set(m.id,m),m.id}addLineToLink(x,A){const w=this._dataByLinkId.get(x);if(w&&w.lines.every((_=>_.line!==A))){const _=this._bufferService.buffer.addMarker(A);w.lines.push(_),_.onDispose((()=>this._removeMarkerFromLink(w,_)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,A){const w=x.lines.indexOf(A);w!==-1&&(x.lines.splice(w,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};c.OscLinkService=C=h([v(0,f.IBufferService)],C)},8343:(b,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="di$target",h="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(v){return v[h]||[]},c.createDecorator=function(v){if(c.serviceRegistry.has(v))return c.serviceRegistry.get(v);const f=function(C,x,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,_,S){_[u]===_?_[h].push({id:w,index:S}):(_[h]=[{id:w,index:S}],_[u]=_)})(f,C,A)};return f.toString=()=>v,c.serviceRegistry.set(v,f),f}},2585:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const h=u(8343);var v;c.IBufferService=(0,h.createDecorator)("BufferService"),c.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),c.ICoreService=(0,h.createDecorator)("CoreService"),c.ICharsetService=(0,h.createDecorator)("CharsetService"),c.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(v||(c.LogLevelEnum=v={})),c.ILogService=(0,h.createDecorator)("LogService"),c.IOptionsService=(0,h.createDecorator)("OptionsService"),c.IOscLinkService=(0,h.createDecorator)("OscLinkService"),c.IUnicodeService=(0,h.createDecorator)("UnicodeService"),c.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(b,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(8460),v=u(225);class f{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,A,w=!1){return(16777215&x)<<3|(3&A)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const x=new v.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let A=0,w=0;const _=x.length;for(let S=0;S<_;++S){let p=x.charCodeAt(S);if(55296<=p&&p<=56319){if(++S>=_)return A+this.wcwidth(p);const R=x.charCodeAt(S);56320<=R&&R<=57343?p=1024*(p-55296)+R-56320+65536:A+=this.wcwidth(R)}const m=this.charProperties(p,w);let E=f.extractWidth(m);f.extractShouldJoin(m)&&(E-=f.extractWidth(w)),A+=E,w=m}return A}charProperties(x,A){return this._activeProvider.charProperties(x,A)}}c.UnicodeService=f}},o={};function l(b){var c=o[b];if(c!==void 0)return c.exports;var u=o[b]={exports:{}};return s[b].call(u.exports,u,u.exports,l),u.exports}var y={};return(()=>{var b=y;Object.defineProperty(b,"__esModule",{value:!0}),b.Terminal=void 0;const c=l(9042),u=l(3236),h=l(844),v=l(5741),f=l(8285),C=l(7975),x=l(7090),A=["cols","rows"];class w extends h.Disposable{constructor(S){super(),this._core=this.register(new u.Terminal(S)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const p=E=>this._core.options[E],m=(E,R)=>{this._checkReadonlyOptions(E),this._core.options[E]=R};for(const E in this._core.options){const R={get:p.bind(this,E),set:m.bind(this,E)};Object.defineProperty(this._publicOptions,E,R)}}_checkReadonlyOptions(S){if(A.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const p in S)this._publicOptions[p]=S[p]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,p=!0){this._core.input(S,p)}resize(S,p){this._verifyIntegers(S,p),this._core.resize(S,p)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,p,m){this._verifyIntegers(S,p,m),this._core.select(S,p,m)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,p){this._verifyIntegers(S,p),this._core.selectLines(S,p)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,p){this._core.write(S,p)}writeln(S,p){this._core.write(S),this._core.write(`\r
82
+ `,p)}paste(S){this._core.paste(S)}refresh(S,p){this._verifyIntegers(S,p),this._core.refresh(S,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return c}_verifyIntegers(...S){for(const p of S)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const p of S)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}b.Terminal=w})(),y})()))})(Hd)),Hd.exports}var i5=t5();function Ib(){return ie.useSyncExternalStore(Ww,tv,tv)}const Mv=250,n5=5e3,Dv=1,r5=4e3,s5=4001;function a5(i){const n=new AbortController,s=new TextEncoder;let o=Mv,l=null,y=null,b=null,c=!1;const u=()=>{y?.dispose(),y=null},h=(C,x)=>{b={cols:C,rows:x},l?.readyState===Dv&&l.send(JSON.stringify({type:"resize",cols:C,rows:x}))},v=async()=>{for(;!n.signal.aborted;){i.onStatus?.("connecting");try{const C=i.fetchTicket??Nw,{ticket:x}=await C(i.sessionId,{kind:i.kind,signal:n.signal});if(n.signal.aborted)return;await f(o5(x,i.location),i),o=Mv}catch(C){if(n.signal.aborted)return;i.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await c5(o,n.signal),o=Math.min(o*2,n5)}},f=async(C,x)=>{await new Promise((A,w)=>{const _=(x.webSocketFactory??l5)(C);l=_,_.binaryType="arraybuffer",_.onopen=()=>{x.onStatus?.("live"),u(),y=x.terminal.onData(S=>{_.readyState===Dv&&_.send(s.encode(S))}),b&&h(b.cols,b.rows)},_.onmessage=S=>{S.data instanceof ArrayBuffer&&x.terminal.write(new Uint8Array(S.data))},_.onerror=()=>{w(new Error("Terminal WebSocket error"))},_.onclose=S=>{u(),l===_&&(l=null);const p=S?.code;p===r5?n.abort():p===s5&&(n.abort(),x.onExit?.()),A()}})};return{start:()=>{c||(c=!0,v())},resize:h,dispose:()=>{n.abort(),u(),i.onStatus?.("closed"),l?.close(),l=null}}}function o5(i,n=window.location){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}/terminal/ws?ticket=${encodeURIComponent(i)}`}function l5(i){return new WebSocket(i)}async function c5(i,n){await new Promise(s=>{const o=()=>{clearTimeout(l),n.removeEventListener("abort",o),s()},l=setTimeout(o,i);n.addEventListener("abort",o)})}const u5={allowProposedApi:!1,convertEol:!0,cursorBlink:!0,cursorStyle:"block",fontFamily:'"Cascadia Code", "Cascadia Mono", "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',fontSize:14,lineHeight:1.2},h5={background:"oklch(23% 0.03 248)",foreground:"oklch(86% 0.018 90)",cursor:"oklch(82% 0.13 195)",selectionBackground:"oklch(78% 0.13 75 / 28%)",black:"oklch(18% 0.045 248)",brightBlack:"oklch(48% 0.03 248)",red:"oklch(72% 0.17 25)",green:"oklch(82% 0.13 195)",yellow:"oklch(86% 0.16 78)",blue:"oklch(70% 0.08 248)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(82% 0.13 195)",white:"oklch(82% 0.018 90)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(88% 0.14 195)",brightYellow:"oklch(90% 0.16 78)",brightBlue:"oklch(78% 0.09 248)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(88% 0.14 195)",brightWhite:"oklch(96% 0.012 88)"},d5={background:"oklch(19% 0.008 252)",foreground:"oklch(85% 0.005 250)",cursor:"oklch(80% 0.105 205)",selectionBackground:"oklch(76% 0.115 62 / 28%)",black:"oklch(16% 0.008 252)",brightBlack:"oklch(46% 0.006 250)",red:"oklch(72% 0.17 25)",green:"oklch(80% 0.11 205)",yellow:"oklch(84% 0.14 64)",blue:"oklch(68% 0.05 250)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(80% 0.11 205)",white:"oklch(81% 0.005 250)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(86% 0.13 205)",brightYellow:"oklch(88% 0.15 66)",brightBlue:"oklch(74% 0.06 250)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(86% 0.13 205)",brightWhite:"oklch(95% 0.003 250)"};function Hb({sessionId:i,kind:n,onExit:s}){const o=Ib().activeTheme,l=ie.useRef(null),y=ie.useRef(null),b=ie.useRef(null),c=ie.useRef(s);c.current=s;const[u,h]=ie.useState("connecting");ie.useEffect(()=>{const f=l.current;if(!f)return;let C=!1;const x=new i5.Terminal({...u5,theme:Ov(o)});y.current=x;const A=new bE.FitAddon;x.loadAddon(A),x.open(f),x.attachCustomKeyEventHandler(m=>m.key==="Enter"&&m.shiftKey?(m.type==="keydown"&&x.input(`
83
+ `),!1):!0);try{const m=new e5;m.onContextLoss(()=>{C||m.dispose()}),x.loadAddon(m)}catch{}const w=a5({sessionId:i,kind:n,terminal:x,onExit:()=>c.current?.(),onStatus:(m,E)=>{h(E?`${m}: ${E}`:m)}});b.current=w;const _=()=>{A.fit(),w.resize(x.cols,x.rows)},S=async()=>{await document.fonts?.ready,!C&&(_(),w.start(),x.focus())},p=new ResizeObserver(_);return p.observe(f),S(),()=>{C=!0,p.disconnect(),w.dispose(),y.current=null,b.current=null;try{x.dispose()}catch{}}},[n,i]),ie.useEffect(()=>{const f=y.current;f&&(f.options.theme=Ov(o))},[o]);const v=u.startsWith("live");return z.jsx("section",{className:"terminal-stage","aria-label":n==="shell"?"Shell terminal":"Fleet terminal",children:z.jsxs("div",{className:"terminal-shell",children:[v?null:z.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[z.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),u]}),z.jsx("div",{className:"terminal-canvas",ref:l})]})})}function Ov(i){return i==="carbon"?d5:h5}const Bv="shell";function f5({state:i}){const n=ie.useRef(null);return i.shellOpen&&n.current===null&&(n.current=document.activeElement),ie.useEffect(()=>{if(!i.shellOpen)return;const s=o=>{o.key==="Escape"&&Cc()};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s);const o=n.current;n.current=null,o?.focus?.()}},[i.shellOpen]),i.shellOpen?z.jsxs("div",{className:"shell-overlay",role:"dialog","aria-modal":"true","aria-label":"Shell",children:[z.jsx("button",{type:"button",className:"shell-overlay-scrim",onClick:Cc,"aria-label":"Close shell"}),z.jsxs("section",{className:"shell-overlay-card",children:[z.jsxs("header",{className:"shell-overlay-header",children:[z.jsx("span",{className:"shell-overlay-kicker",children:"Free Shell"}),z.jsx("h2",{children:"Local Shell"})]}),z.jsx("button",{type:"button",className:"shell-overlay-close",onClick:Cc,"aria-label":"Close shell",children:"×"}),z.jsx("div",{className:"shell-overlay-terminal",children:z.jsx(Hb,{sessionId:Bv,kind:"shell",onExit:Cc},Bv)})]})]}):null}function _5({open:i,title:n,message:s,tone:o="info",onDismiss:l}){return i?z.jsx("div",{className:"app-toast-host",children:z.jsxs("div",{className:`app-toast app-toast--${o}`,role:"status","aria-live":"polite",children:[z.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),z.jsxs("div",{className:"app-toast-body",children:[z.jsx("p",{className:"app-toast-title",children:n}),s?z.jsx("p",{className:"app-toast-message",children:s}):null]}),l?z.jsx("button",{type:"button",className:"app-toast-close",onClick:l,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}const p5=[{to:"/operations",label:"Operation",end:!1,icon:"operations"},{to:"/codex",label:"Codex",end:!1,icon:"codex"}],zd=[{id:"maritime",label:"Maritime",swatch:["oklch(78% 0.13 75)","oklch(82% 0.13 195)","oklch(32% 0.04 248)"]},{id:"carbon",label:"Carbon",swatch:["oklch(76% 0.115 62)","oklch(80% 0.105 205)","oklch(25% 0.007 252)"]}];function g5({state:i}){const n=i.connectionError!==null,s=$n().pathname,o=s.startsWith("/codex")?z.jsx(Iv,{}):s.startsWith("/operations")?z.jsx(Nv,{}):z.jsx(y5,{});return z.jsxs("header",{className:"topbar",children:[z.jsxs(If,{className:"topbar-brand",to:"/","aria-label":"Welcome으로 이동",children:[z.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:i.connectionError??void 0,children:o}),z.jsxs("h1",{className:"topbar-title",children:["Fleet",z.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),z.jsx(m5,{state:i}),z.jsxs("div",{className:"topbar-meta",children:[z.jsx("nav",{className:"topbar-nav","aria-label":"주 내비게이션",children:p5.map(l=>z.jsxs(q0,{to:l.to,end:l.end,className:({isActive:y})=>`topbar-nav-link ${y?"is-active":""}`,children:[z.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:l.icon==="operations"?z.jsx(Nv,{}):z.jsx(Iv,{})}),z.jsx("span",{children:l.label})]},l.to))}),z.jsxs("button",{type:"button",className:"topbar-shell-button",onMouseDown:l=>l.preventDefault(),onClick:eb,"aria-label":"Shell",title:"Shell (⌘`)",children:[z.jsx(w5,{}),z.jsx("span",{children:"Shell"})]}),z.jsx(v5,{activeTheme:i.activeTheme})]})]})}function m5({state:i}){const[n,s]=ie.useState(!1),o=ie.useRef(null),l=ie.useRef(null),y=ie.useRef(null),b=i.theaters.find(f=>f.id===i.activeTheaterId)??null,c=b?.label??(i.theaters.length===0?"No Theaters":"Theater");ie.useEffect(()=>{if(!n)return;const f=x=>{o.current?.contains(x.target)||s(!1)},C=x=>{x.key==="Escape"&&(s(!1),l.current?.focus())};return document.addEventListener("mousedown",f),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",C)}},[n]),ie.useEffect(()=>{if(!n)return;const f=y.current;if(!f)return;(f.querySelector('[data-active="true"]')??f.querySelector("[role^='menuitem']"))?.focus()},[n]);const u=f=>{Xw(f),s(!1),l.current?.focus()},h=async()=>{s(!1),Zw();try{const f=await Mw();if("cancelled"in f){Jw();return}Qw(f)}catch(f){eE(f instanceof Error?f.message:String(f))}},v=f=>{if(f.key!=="ArrowDown"&&f.key!=="ArrowUp")return;f.preventDefault();const C=Array.from(y.current?.querySelectorAll("[role^='menuitem']")??[]);if(C.length===0)return;const x=C.indexOf(document.activeElement),A=f.key==="ArrowDown"?1:-1,w=(x+A+C.length)%C.length;C[w]?.focus()};return z.jsxs("div",{className:"theater-control",ref:o,children:[z.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),z.jsxs("button",{type:"button",ref:l,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:b?.label??i.theaterError??void 0,onClick:()=>s(f=>!f),children:[z.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:z.jsx(b5,{})}),z.jsx("span",{className:"theater-trigger-label",children:c}),z.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:z.jsx(zb,{})})]}),n?z.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:y,onKeyDown:v,children:[i.theaters.length>0?z.jsx("ul",{className:"theater-menu-list",children:i.theaters.map(f=>{const C=f.id===i.activeTheaterId;return z.jsx("li",{children:z.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":C,"data-active":C?"true":void 0,className:`theater-menu-item ${C?"is-active":""}`,title:f.label,onClick:()=>u(f.id),children:[z.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:C?z.jsx($b,{}):null}),z.jsx("span",{className:"theater-menu-label",children:f.label})]})},f.id)})}):z.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),z.jsx("div",{className:"theater-menu-divider",role:"separator"}),z.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:i.addingTheater,onClick:h,children:[z.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:z.jsx(C5,{})}),z.jsx("span",{className:"theater-menu-label",children:i.addingTheater?"Adding Theater…":"Add Theater…"})]}),i.theaterError?z.jsx("p",{className:"theater-menu-error",children:i.theaterError}):null]}):null]})}function v5({activeTheme:i}){const[n,s]=ie.useState(!1),o=ie.useRef(null),l=ie.useRef(null),y=ie.useRef(null),b=zd.find(h=>h.id===i)??zd[0];ie.useEffect(()=>{if(!n)return;const h=f=>{o.current?.contains(f.target)||s(!1)},v=f=>{f.key==="Escape"&&(s(!1),l.current?.focus())};return document.addEventListener("mousedown",h),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",v)}},[n]),ie.useEffect(()=>{if(!n)return;const h=y.current;if(!h)return;(h.querySelector('[data-active="true"]')??h.querySelector("[role^='menuitem']"))?.focus()},[n]);const c=h=>{Kw(h),s(!1),l.current?.focus()},u=h=>{if(h.key!=="ArrowDown"&&h.key!=="ArrowUp")return;h.preventDefault();const v=Array.from(y.current?.querySelectorAll("[role^='menuitem']")??[]);if(v.length===0)return;const f=v.indexOf(document.activeElement),C=h.key==="ArrowDown"?1:-1,x=(f+C+v.length)%v.length;v[x]?.focus()};return z.jsxs("div",{className:"theme-control",ref:o,children:[z.jsxs("button",{type:"button",ref:l,className:`theme-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theme",onClick:()=>s(h=>!h),children:[z.jsx(S5,{}),z.jsx("span",{className:"theme-trigger-label",children:b.label}),z.jsx("span",{className:"theme-trigger-caret","aria-hidden":"true",children:z.jsx(zb,{})})]}),n?z.jsx("div",{className:"theme-menu",role:"menu","aria-label":"Theme",ref:y,onKeyDown:u,children:zd.map(h=>{const v=h.id===i;return z.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,"data-active":v?"true":void 0,className:`theme-menu-item ${v?"is-active":""}`,onClick:()=>c(h.id),children:[z.jsx("span",{className:"theme-swatch","aria-hidden":"true",children:h.swatch.map(f=>z.jsx("i",{style:{background:f}},f))}),z.jsx("span",{className:"theme-menu-label",children:h.label}),z.jsx("span",{className:"theme-menu-check","aria-hidden":"true",children:v?z.jsx($b,{}):null})]},h.id)})}):null]})}function b5(){return z.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[z.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),z.jsx("path",{d:"M8 4.7v8.1M4.3 8.2H11.7M3.4 9.1A4.7 4.7 0 0 0 12.6 9.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function zb(){return z.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:z.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function $b(){return z.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:z.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function S5(){return z.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[z.jsx("path",{d:"M8 2.6a5.4 5.4 0 0 0-5.4 5.5c0 2.4 1.8 4.5 4.2 5 .8.2 1.2-.2 1.2-.8 0-.5-.4-.8-.4-1.3 0-.7.6-1.1 1.3-1.1h1.1c1.9 0 3.4-1.5 3.4-3.3C13.4 4.4 11 2.6 8 2.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"}),z.jsx("circle",{cx:"5.6",cy:"6.4",r:".75",fill:"currentColor"}),z.jsx("circle",{cx:"8",cy:"5.2",r:".75",fill:"currentColor"}),z.jsx("circle",{cx:"10.4",cy:"6.5",r:".75",fill:"currentColor"})]})}function y5(){return z.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[z.jsx("path",{d:"M8 1.8 9.5 6.5 14.2 8 9.5 9.5 8 14.2 6.5 9.5 1.8 8 6.5 6.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),z.jsx("path",{d:"M8 4.7 8.7 7.3 11.3 8 8.7 8.7 8 11.3 7.3 8.7 4.7 8 7.3 7.3Z",fill:"currentColor"})]})}function Nv(){return z.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[z.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),z.jsx("path",{d:"M8 3.7v2.1M8 10.2v2.1M3.7 8h2.1M10.2 8h2.1M8 8l3.1-2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),z.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function Iv(){return z.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[z.jsx("circle",{cx:"12",cy:"12",r:"9"}),z.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),z.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),z.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function C5(){return z.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:z.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function w5(){return z.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[z.jsx("path",{d:"M2.8 4.2h10.4v7.6H2.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),z.jsx("path",{d:"M5 6.7 6.8 8 5 9.3M8.2 9.4h2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function E5(){let i="";return n=>{i+=n;const s=[];let o=i.indexOf(`
84
+
85
+ `);for(;o>=0;){const l=i.slice(0,o);i=i.slice(o+2);const y=T5(l);y&&s.push(y),o=i.indexOf(`
86
+
87
+ `)}return s}}function x5(i){if(!i.data)return null;let n;try{n=JSON.parse(i.data)}catch{return null}if(i.event==="observer:truncated"){const o=n.tenant?.tenantId;return!o||!n.truncation?null:{kind:"truncation",tenantId:o,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}const s=Hv(n.event)??Hv(n);return s?{kind:"event",tenantId:s.tenantId,tenantLabel:n.tenant?.tenantLabel,event:s}:null}function T5(i){const n=i.split(`
88
+ `),s=n.find(l=>l.startsWith("event:"))?.slice(6).trim()??"message",o=n.filter(l=>l.startsWith("data:")).map(l=>l.slice(5).trim()).join(`
89
+ `);return!o&&s==="message"?null:{event:s,data:o}}function Hv(i){if(typeof i!="object"||i===null)return null;const n=i;return typeof n.id!="number"||typeof n.tenantId!="string"||typeof n.type!="string"||typeof n.at!="number"?null:typeof n.event!="object"||n.event===null?{...n,event:{}}:n}const zv=250,A5=5e3;function R5(){const i=new AbortController;return L5(i.signal),()=>i.abort()}async function L5(i){let n=zv,s=!1;const o=async()=>{if(!s){s=!0;try{ib(await G0(i))}catch{}finally{s=!1}}};for(;!i.aborted;){bt({connection:"connecting"});try{await M5(i);const l=await Aw(i);bt({connection:"live",connectionError:null}),n=zv,await k5(l,i,o),i.aborted||bt({connection:"connecting",connectionError:null})}catch(l){if(i.aborted)return;bt({connection:"connecting",connectionError:l instanceof Error?l.message:String(l)})}if(i.aborted)return;await D5(n,i),n=Math.min(n*2,A5)}}async function k5(i,n,s){const o=new TextDecoder,l=E5();for(;!n.aborted;){const y=await i.read();if(y.done)return;for(const b of l(o.decode(y.value,{stream:!0}))){const c=x5(b);if(c){if(c.kind==="truncation"&&c.truncation){uE(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.event){const{unknownTenant:u}=cE(c.event,c.tenantLabel);u&&s()}}}}}async function M5(i){const[n,s]=await Promise.all([G0(i),Tw(i)]);ib(n),lE(s)}async function D5(i,n){await new Promise(s=>{const o=()=>{clearTimeout(l),n.removeEventListener("abort",o),s()},l=setTimeout(o,i);n.addEventListener("abort",o)})}function Te(i){return i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ze(i){return Te(i).replace(/"/g,"&quot;")}const O5="contextual-knowledge-not-instructions";function B5(i,n,s){const o=s?.whyThisMatched??i.frontmatter.whyThisMatched,l=jb(i,n);return`
90
+ <div class="context-actions-grid">
91
+ <button class="context-action-btn" type="button" data-action="copy-compact-context">
92
+ <span class="context-action-label">Compact context</span>
93
+ <span class="context-action-meta">${Uc(Ub(i))} tok</span>
94
+ </button>
95
+ <button class="context-action-btn" type="button" data-action="copy-provenance-context">
96
+ <span class="context-action-label">Provenance</span>
97
+ <span class="context-action-meta">${Uc(Pb(i))} tok</span>
98
+ </button>
99
+ <button class="context-action-btn" type="button" data-action="copy-related-context">
100
+ <span class="context-action-label">Context pack</span>
101
+ <span class="context-action-meta">${Uc(l)} tok</span>
102
+ </button>
103
+ ${o?`
104
+ <button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
105
+ <span class="context-action-label">Why this matched</span>
106
+ </button>
107
+ <div class="context-why-matched" hidden>${Te(o)}</div>
108
+ `:""}
109
+ </div>
110
+ `}function Ub(i){const n={id:i.frontmatter.id,title:i.frontmatter.title,status:i.frontmatter.status??null,tags:i.frontmatter.tags,updated:i.frontmatter.updated,summary:Pf(i.body)};return JSON.stringify({...n,token_estimate:Uc(JSON.stringify(n))},null,2)}function Pb(i){return[`# ${i.frontmatter.title} (\`${i.frontmatter.id}\`)`,"",`- updated: ${i.frontmatter.updated}`,`- status: ${i.frontmatter.status??"unknown"}`,`- raw_source_ref: ${i.frontmatter.rawSourceRef??"(none)"}`,`- raw_source_refs: ${(i.frontmatter.rawSourceRefs??[]).join(", ")||"(none)"}`,"","## Summary",Pf(i.body)].join(`
111
+ `)}function jb(i,n){const s=new Set([...i.frontmatter.related??[]]),o=n.filter(l=>s.has(l.id)).sort((l,y)=>l.title.localeCompare(y.title));return[`<fleet-wiki-context boundary="${O5}">`,"# Fleet Wiki Context Pack","",`## Entry: ${i.frontmatter.title} (\`${i.frontmatter.id}\`)`,"",`- updated: ${i.frontmatter.updated}`,`- status: ${i.frontmatter.status??"unknown"}`,`- tags: ${i.frontmatter.tags.join(", ")||"(none)"}`,"","### Summary",Pf(i.body),"","### Related Entries",...o.length>0?o.map(l=>`- [[wiki:${l.id}]] — ${l.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
112
+ `)}function Uc(i){return Math.max(1,Math.ceil(i.length/4))}function Pf(i){return i.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function N5(){return Jn(Vi("/health"))}async function I5(){return Jn(Vi("/workspaces"))}async function H5(){return Jn(Vi("/index"))}async function z5(){return qb(Vi("/index-md"))}async function $5(i){return Jn(Vi(`/entry/${encodeURIComponent(i)}`))}async function U5(i,n=[],s=!1){const o=new URLSearchParams;i&&o.set("q",i),n.length>0&&o.set("tags",n.join(",")),s&&o.set("enhanced","true");const l=o.toString();return Jn(Vi(`/search${l?`?${l}`:""}`))}async function P5(i){return qb(Vi(`/raw?ref=${encodeURIComponent(i)}`))}async function lu(i){return Jn(Vi(`/queue?status=${encodeURIComponent(i)}`))}async function j5(i){return Jn(Vi(`/queue/${encodeURIComponent(i)}`))}async function F5(i){return Wb(Vi(`/queue/${encodeURIComponent(i)}/approve`),{})}async function q5(i,n){return Wb(Vi(`/queue/${encodeURIComponent(i)}/reject`),{reason:n})}async function Fb(){return Jn(Vi("/conflicts"))}async function W5(i){return Jn(Vi(`/conflicts/${encodeURIComponent(i)}`))}async function G5(i){const n=typeof i=="number"?`?limit=${encodeURIComponent(String(i))}`:"";return Jn(Vi(`/log${n}`))}function Vi(i){const n=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),s=i.startsWith("/")?i:`/${i}`;return n?`/console/codex/w/${encodeURIComponent(decodeURIComponent(n[1]??""))}/api${s}`:`/console/codex/api${s}`}async function Jn(i){const n=await fetch(i,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await jf(i,n));return n.json()}async function qb(i){const n=await fetch(i,{headers:{accept:"text/markdown,text/plain"}});if(!n.ok)throw new Error(await jf(i,n));return n.text()}async function Wb(i,n){const s=await fetch(i,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!s.ok)throw new Error(await jf(i,s));return s.json()}async function jf(i,n){return(await n.json().catch(()=>null))?.error??`${i} request failed: ${n.status}`}const K5=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{3}Z-[0-9a-f]{8}$/,Nn="/console/codex",hf=new Set;function ol(){const i=t2(i2(Xb(window.location.pathname)).pathname);return i.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:i}function df(){return Vb(Xb(window.location.pathname))?.wsId??null}function Is(i){i!==window.location.pathname+window.location.search&&(window.history.pushState({},"",i),Ff(ol()))}function Y5(i){window.history.replaceState({},"",i),Ff(ol())}function V5(i){return hf.add(i),()=>hf.delete(i)}function X5(){window.addEventListener("popstate",()=>Ff(ol()))}function kr(i){return Xn(`/entry/${encodeURIComponent(i)}`)}function Gb(i){return Xn(`/raw/${encodeURIComponent(i)}`)}function Oa(i="pending"){return Xn(i==="archived"?"/queue?tab=archived":"/queue")}function Z5(i){return Xn(`/queue/${encodeURIComponent(i)}`)}function Q5(){return Xn("/conflicts")}function J5(i){return Xn(`/conflicts/${encodeURIComponent(i)}`)}function e2(){return Xn("/index-md")}function Kb(i){return Xn(typeof i!="number"?"/log":`/log?limit=${encodeURIComponent(String(i))}`)}function Yb(){return Xn("/")}function $v(i){return`${Nn}/w/${encodeURIComponent(i)}/`}function t2(i){if(i==="/index"||i==="/index-md")return{name:"index-md"};if(i==="/log"){const y=new URLSearchParams(window.location.search).get("limit"),b=Number(y??20);return{name:"log",limit:Number.isInteger(b)?b:20}}if(i==="/conflicts")return{name:"conflicts"};const n=i.match(/^\/conflicts\/([^/]+)$/);if(n)return{name:"conflict-detail",id:decodeURIComponent(n[1]??"")};const s=i.match(/^\/entry\/([^/]+)$/);if(s)return{name:"entry",id:decodeURIComponent(s[1]??"")};const o=i.match(/^\/raw\/(.+)$/);if(o)return{name:"raw",ref:decodeURIComponent(o[1]??"")};if(i==="/queue")return{name:"queue",tab:"pending"};const l=i.match(/^\/queue\/([^/]+)$/);if(l){const y=decodeURIComponent(l[1]??"");return K5.test(y)?{name:"queue-detail",patchId:y}:{name:"home"}}return{name:"home"}}function Xn(i){const n=df();return n?`${Nn}/w/${encodeURIComponent(n)}${i}`:`${Nn}${i}`}function i2(i){const n=Vb(i);return n?{pathname:n.pathname,wsId:n.wsId}:{pathname:i,wsId:null}}function Vb(i){const n=i.match(/^\/w\/([^/]+)(\/.*)?$/);return n?{wsId:decodeURIComponent(n[1]??""),pathname:n[2]??"/"}:null}function Xb(i){return i===Nn||i===`${Nn}/`?"/":i.startsWith(`${Nn}/`)?i.slice(Nn.length)||"/":i}function Ff(i){for(const n of hf)n(i)}const Zb="fleet-wiki-web-recent",ff=new Set,Hs={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:h2(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Pc(){return Hs}function n2(i){return ff.add(i),()=>ff.delete(i)}async function r2(){Zt({loading:!0,error:null});try{const[i,n,s,o]=await Promise.all([N5(),H5(),lu("pending").catch(()=>null),I5().catch(()=>null)]);Zt({health:i,index:n,pendingPatchCount:s?.pendingCount??0,currentWorkspaceId:o?.currentWorkspaceId??null,workspaces:o?.workspaces??[],loading:!1})}catch(i){Zt({loading:!1,error:za(i)})}}async function s2(i){Zt({loading:!0,error:null,currentEntry:null,currentMatchHint:Hs.currentMatchHint?.id===i?Hs.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const n=await $5(i),s=u2(i);Zt({currentEntry:n,currentConflict:null,indexMarkdown:null,log:null,recentIds:s,loading:!1})}catch(n){Zt({loading:!1,error:za(n)})}}async function a2(){Zt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Zt({indexMarkdown:await z5(),loading:!1})}catch(i){Zt({loading:!1,error:za(i)})}}async function o2(i){Zt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Zt({log:await G5(i),loading:!1})}catch(n){Zt({loading:!1,error:za(n)})}}async function l2(){Zt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Zt({conflicts:await Fb(),loading:!1})}catch(i){Zt({loading:!1,error:za(i)})}}async function c2(i){Zt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[n,s]=await Promise.all([W5(i),Fb().catch(()=>Hs.conflicts)]);Zt({currentConflict:n,conflicts:s,loading:!1})}catch(n){Zt({loading:!1,error:za(n)})}}function $d(){Zt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function Qb(i){Zt({currentMatchHint:i})}function qf(i){Zt({pendingPatchCount:i})}function Zt(i){Object.assign(Hs,i);for(const n of ff)n(Hs)}function u2(i){const n=[i,...Hs.recentIds.filter(s=>s!==i)].slice(0,8);return window.localStorage.setItem(Zb,JSON.stringify(n)),n}function h2(){try{const i=window.localStorage.getItem(Zb),n=i?JSON.parse(i):[];return Array.isArray(n)?n.filter(s=>typeof s=="string").slice(0,8):[]}catch{return[]}}function za(i){return i instanceof Error?i.message:String(i)}const ke={open:!1,query:"",selectedIndex:0,results:[],debounceId:null,searchSeq:0,previousBodyOverflow:null,previousActiveElement:null};let _f=[],Wf=[];function d2(i,n){_f=i,Wf=n,ke.open&&!ke.query&&(ke.results=Gf(),ke.selectedIndex=0,Vc())}function Jb(){if(ke.open){Pv();return}ke.open=!0,ke.query="",ke.selectedIndex=0,ke.results=Gf(),ke.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,x2(),S2(),Vc(),Pv()}function Qo(){ke.open&&(ke.open=!1,ke.searchSeq++,ke.debounceId!==null&&(window.clearTimeout(ke.debounceId),ke.debounceId=null),y2(),T2(),A2())}function f2(){document.addEventListener("keydown",_2),document.addEventListener("input",p2),document.addEventListener("click",g2),document.addEventListener("mouseover",m2)}function _2(i){if((i.metaKey||i.ctrlKey)&&i.key.toLowerCase()==="k"){i.preventDefault(),ke.open?Qo():Jb();return}if(ke.open){if(i.key==="Tab"){R2(i);return}if(i.key==="Escape"){i.preventDefault(),Qo();return}if(i.key==="ArrowDown"){i.preventDefault(),ke.selectedIndex=Math.min(ke.selectedIndex+1,Math.max(0,ke.results.length-1)),pf({scroll:!0});return}if(i.key==="ArrowUp"){i.preventDefault(),ke.selectedIndex=Math.max(0,ke.selectedIndex-1),pf({scroll:!0});return}if(i.key==="Enter"){i.preventDefault();const s=ke.results[ke.selectedIndex];if(!s)return;Qb(s),Is(kr(s.id)),Qo()}}}function p2(i){const n=i.target;!(n instanceof HTMLInputElement)||n.id!=="command-input"||(ke.query=n.value.trim(),ke.selectedIndex=0,ke.debounceId!==null&&window.clearTimeout(ke.debounceId),ke.debounceId=window.setTimeout(()=>{v2(ke.query)},150))}function g2(i){const n=i.target;if(!(n instanceof Element))return;if(n.matches("[data-action='open-command']")||n.closest("[data-action='open-command']")){Jb();return}if(!ke.open)return;if(n.classList.contains("command-overlay")){Qo();return}const s=n.closest("[data-command-entry-id]");if(s){const o=ke.results.find(l=>l.id===(s.dataset.commandEntryId??""));Qb(o??null),Is(kr(s.dataset.commandEntryId??"")),Qo()}}function m2(i){if(!ke.open)return;const n=i.target;if(!(n instanceof Element))return;const s=n.closest("[data-command-index]");if(!s)return;const o=Number(s.dataset.commandIndex);!Number.isInteger(o)||o<0||o>=ke.results.length||(ke.selectedIndex=o,pf({scroll:!1}))}async function v2(i){const n=++ke.searchSeq;if(!i){ke.results=Gf(),ke.selectedIndex=0,Vc();return}let s;try{s=await U5(i)}catch{s=[]}n!==ke.searchSeq||!ke.open||(ke.results=s,ke.selectedIndex=0,Vc())}function b2(){let i=document.querySelector("#command-palette-root");return i||(i=document.createElement("div"),i.id="command-palette-root",document.body.append(i)),i}function S2(){const i=b2();i.querySelector(".command-overlay")||(i.innerHTML=C2())}function y2(){const i=document.querySelector("#command-palette-root");i&&(i.innerHTML="")}function Vc(){const i=document.querySelector("#command-results-list");if(i){if(ke.results.length===0){i.innerHTML=`<p class="empty-state">${Te("No results found.")}</p>`;return}i.innerHTML=ke.query?ke.results.map(eS).join(""):w2()}}function pf(i={scroll:!0}){const n=document.querySelectorAll(".command-result");n.forEach((o,l)=>{o.classList.toggle("active",l===ke.selectedIndex)});const s=n[ke.selectedIndex];i.scroll&&s?.scrollIntoView({block:"nearest"})}function C2(){const i=Ze("Command palette"),n=Ze("Search titles · tags · content");return`
113
+ <div class="command-overlay">
114
+ <section class="command-card" role="dialog" aria-modal="true" aria-label="${i}" tabindex="-1">
115
+ <div class="command-search">
116
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
117
+ <circle cx="11" cy="11" r="6.5" />
118
+ <path d="m20 20-3.5-3.5" />
119
+ </svg>
120
+ <input id="command-input" type="search" autocomplete="off" spellcheck="false" placeholder="${n}" />
121
+ <kbd>esc</kbd>
122
+ </div>
123
+ <div class="command-results" id="command-results-list"></div>
124
+ </section>
125
+ </div>
126
+ `}function eS(i,n){const s=n===ke.selectedIndex?" active":"",o=Ze(i.title),l=i.tags.slice(0,2),y=i.tags.length-l.length,b=D2(i),c=l.map(h=>`<span class="chip chip-tag">${Te(h)}</span>`).join(""),u=y>0?`<span class="chip chip-muted">+${y}</span>`:"";return`
127
+ <button class="command-result${s}" type="button" data-command-entry-id="${Ze(i.id)}" data-command-index="${n}" title="${o}">
128
+ <span class="command-result-text">
129
+ <strong>${k2(i.title,ke.query)}</strong>
130
+ <small>${Te(M2(i))}</small>
131
+ ${b?`<small class="command-result-excerpt">${Te(b)}</small>`:""}
132
+ </span>
133
+ <span class="command-result-aside">${c}${u}</span>
134
+ </button>
135
+ `}function w2(){const i=E2(),n=ke.results.slice(0,i),s=ke.results.slice(i);return[n.length>0?Uv("Recent",n,0):"",s.length>0?Uv("All",s,i):""].join("")}function Uv(i,n,s){return`
136
+ <div class="command-section-heading">${Te(i)}</div>
137
+ ${n.map((o,l)=>eS(o,s+l)).join("")}
138
+ `}function Gf(){const i=new Set(Wf),n=tS().map(o=>_f.find(l=>l.id===o)).filter(o=>!!o),s=_f.filter(o=>!i.has(o.id));return[...n,...s].slice(0,12).map((o,l)=>({id:o.id,title:o.title,score:Math.max(1,100-l),reason:"title",excerpt:"",path:o.path,tags:o.tags,updated:o.updated}))}function E2(){return tS().filter((i,n)=>ke.results[n]?.id===i).length}function tS(){return Array.from(new Set(Wf))}function x2(){ke.previousBodyOverflow===null&&(ke.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function T2(){ke.previousBodyOverflow!==null&&(document.body.style.overflow=ke.previousBodyOverflow,ke.previousBodyOverflow=null)}function A2(){const i=ke.previousActiveElement;ke.previousActiveElement=null,i?.isConnected&&i.focus()}function Pv(){window.setTimeout(()=>{const i=document.querySelector("#command-input");i&&(i.focus(),i.select())},0)}function R2(i){const n=document.querySelector(".command-card");if(!n)return;const s=L2(n);if(s.length===0){i.preventDefault(),n.focus();return}const o=document.activeElement,l=o instanceof HTMLElement?s.indexOf(o):-1,y=i.shiftKey?l<=0?s.length-1:l-1:l===-1||l===s.length-1?0:l+1;(l===-1||i.shiftKey&&l===0||!i.shiftKey&&l===s.length-1)&&(i.preventDefault(),s[y]?.focus())}function L2(i){const n=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(i.querySelectorAll(n)).filter(s=>!s.hasAttribute("hidden")&&s.offsetParent!==null)}function k2(i,n){if(!n)return Te(i);const s=i.toLocaleLowerCase(),o=n.toLocaleLowerCase();if(!o)return Te(i);let l=0,y="";for(;l<i.length;){const b=s.indexOf(o,l);if(b===-1)break;y+=Te(i.slice(l,b)),y+=`<mark class="command-highlight">${Te(i.slice(b,b+n.length))}</mark>`,l=b+n.length}return y+Te(i.slice(l))}function M2(i){switch(i.reason){case"id":return"id match";case"alias":return"alias match";case"tag":return"tag match";case"title":return"title match";case"body":return"body match";default:return"match"}}function D2(i){const n=i.matchedSnippets?.find(o=>o.field==="body")?.snippet;if(i.reason!=="body")return"";const s=n??i.excerpt;return O2(s??"")}function O2(i){return N2(B2(i)).replace(/\s+/g," ").trim().slice(0,180)}function B2(i){return i.replace(/<<<[^>]*>>>/g," ")}function N2(i){return i.replace(/!\[[^\]]*]\([^)]*\)/g," ").replace(/\[\[wiki:([^\]\|]+)(?:\|[^\]]*)?]]/g,"$1").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s*(?:[-*]\s+|\d+\.\s+)/gm,"").replace(/^\s*>\s?/gm,"").replace(/`+/g,"").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*\n]+)\*/g,"$1").replace(/_([^_\n]+)_/g,"$1")}function Kf(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Us=Kf();function iS(i){Us=i}var Jo={exec:()=>null};function ot(i,n=""){let s=typeof i=="string"?i:i.source,o={replace:(l,y)=>{let b=typeof y=="string"?y:y.source;return b=b.replace(Bi.caret,"$1"),s=s.replace(l,b),o},getRegex:()=>new RegExp(s,n)};return o}var I2=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Bi={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,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},H2=/^(?:[ \t]*(?:\n|$))+/,z2=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$2=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ll=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,U2=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yf=/(?:[*+-]|\d{1,9}[.)])/,nS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rS=ot(nS).replace(/bull/g,Yf).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(),P2=ot(nS).replace(/bull/g,Yf).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(),Vf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,j2=/^[^\n]+/,Xf=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,F2=ot(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),q2=ot(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Yf).getRegex(),cu="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",Zf=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,W2=ot("^ {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",Zf).replace("tag",cu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sS=ot(Vf).replace("hr",ll).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cu).getRegex(),G2=ot(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sS).getRegex(),Qf={blockquote:G2,code:z2,def:F2,fences:$2,heading:U2,hr:ll,html:W2,lheading:rS,list:q2,newline:H2,paragraph:sS,table:Jo,text:j2},jv=ot("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ll).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cu).getRegex(),K2={...Qf,lheading:P2,table:jv,paragraph:ot(Vf).replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",jv).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cu).getRegex()},Y2={...Qf,html:ot(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zf).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:Jo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ot(Vf).replace("hr",ll).replace("heading",` *#{1,6} *[^
139
+ ]`).replace("lheading",rS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},V2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,X2=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,aS=/^( {2,}|\\)\n(?!\s*$)/,Z2=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,uu=/[\p{P}\p{S}]/u,Jf=/[\s\p{P}\p{S}]/u,oS=/[^\s\p{P}\p{S}]/u,Q2=ot(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Jf).getRegex(),lS=/(?!~)[\p{P}\p{S}]/u,J2=/(?!~)[\s\p{P}\p{S}]/u,eT=/(?:[^\s\p{P}\p{S}]|~)/u,tT=ot(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",I2?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),cS=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,iT=ot(cS,"u").replace(/punct/g,uu).getRegex(),nT=ot(cS,"u").replace(/punct/g,lS).getRegex(),uS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",rT=ot(uS,"gu").replace(/notPunctSpace/g,oS).replace(/punctSpace/g,Jf).replace(/punct/g,uu).getRegex(),sT=ot(uS,"gu").replace(/notPunctSpace/g,eT).replace(/punctSpace/g,J2).replace(/punct/g,lS).getRegex(),aT=ot("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,oS).replace(/punctSpace/g,Jf).replace(/punct/g,uu).getRegex(),oT=ot(/\\(punct)/,"gu").replace(/punct/g,uu).getRegex(),lT=ot(/^<(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(),cT=ot(Zf).replace("(?:-->|$)","-->").getRegex(),uT=ot("^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",cT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,hT=ot(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Xc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hS=ot(/^!?\[(label)\]\[(ref)\]/).replace("label",Xc).replace("ref",Xf).getRegex(),dS=ot(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xf).getRegex(),dT=ot("reflink|nolink(?!\\()","g").replace("reflink",hS).replace("nolink",dS).getRegex(),Fv=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,e_={_backpedal:Jo,anyPunctuation:oT,autolink:lT,blockSkip:tT,br:aS,code:X2,del:Jo,emStrongLDelim:iT,emStrongRDelimAst:rT,emStrongRDelimUnd:aT,escape:V2,link:hT,nolink:dS,punctuation:Q2,reflink:hS,reflinkSearch:dT,tag:uT,text:Z2,url:Jo},fT={...e_,link:ot(/^!?\[(label)\]\((.*?)\)/).replace("label",Xc).getRegex(),reflink:ot(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xc).getRegex()},gf={...e_,emStrongRDelimAst:sT,emStrongLDelim:nT,url:ot(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Fv).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:ot(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Fv).getRegex()},_T={...gf,br:ot(aS).replace("{2,}","*").getRegex(),text:ot(gf.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ac={normal:Qf,gfm:K2,pedantic:Y2},Uo={normal:e_,gfm:gf,breaks:_T,pedantic:fT},pT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qv=i=>pT[i];function Yn(i,n){if(n){if(Bi.escapeTest.test(i))return i.replace(Bi.escapeReplace,qv)}else if(Bi.escapeTestNoEncode.test(i))return i.replace(Bi.escapeReplaceNoEncode,qv);return i}function Wv(i){try{i=encodeURI(i).replace(Bi.percentDecode,"%")}catch{return null}return i}function Gv(i,n){let s=i.replace(Bi.findPipe,(y,b,c)=>{let u=!1,h=b;for(;--h>=0&&c[h]==="\\";)u=!u;return u?"|":" |"}),o=s.split(Bi.splitPipe),l=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),n)if(o.length>n)o.splice(n);else for(;o.length<n;)o.push("");for(;l<o.length;l++)o[l]=o[l].trim().replace(Bi.slashPipe,"|");return o}function Po(i,n,s){let o=i.length;if(o===0)return"";let l=0;for(;l<o&&i.charAt(o-l-1)===n;)l++;return i.slice(0,o-l)}function gT(i,n){if(i.indexOf(n[1])===-1)return-1;let s=0;for(let o=0;o<i.length;o++)if(i[o]==="\\")o++;else if(i[o]===n[0])s++;else if(i[o]===n[1]&&(s--,s<0))return o;return s>0?-2:-1}function Kv(i,n,s,o,l){let y=n.href,b=n.title||null,c=i[1].replace(l.other.outputLinkReplace,"$1");o.state.inLink=!0;let u={type:i[0].charAt(0)==="!"?"image":"link",raw:s,href:y,title:b,text:c,tokens:o.inlineTokens(c)};return o.state.inLink=!1,u}function mT(i,n,s){let o=i.match(s.other.indentCodeCompensation);if(o===null)return n;let l=o[1];return n.split(`
140
+ `).map(y=>{let b=y.match(s.other.beginningSpace);if(b===null)return y;let[c]=b;return c.length>=l.length?y.slice(l.length):y}).join(`
141
+ `)}var Zc=class{options;rules;lexer;constructor(i){this.options=i||Us}space(i){let n=this.rules.block.newline.exec(i);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(i){let n=this.rules.block.code.exec(i);if(n){let s=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Po(s,`
142
+ `)}}}fences(i){let n=this.rules.block.fences.exec(i);if(n){let s=n[0],o=mT(s,n[3]||"",this.rules);return{type:"code",raw:s,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:o}}}heading(i){let n=this.rules.block.heading.exec(i);if(n){let s=n[2].trim();if(this.rules.other.endingHash.test(s)){let o=Po(s,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(s=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(i){let n=this.rules.block.hr.exec(i);if(n)return{type:"hr",raw:Po(n[0],`
143
+ `)}}blockquote(i){let n=this.rules.block.blockquote.exec(i);if(n){let s=Po(n[0],`
144
+ `).split(`
145
+ `),o="",l="",y=[];for(;s.length>0;){let b=!1,c=[],u;for(u=0;u<s.length;u++)if(this.rules.other.blockquoteStart.test(s[u]))c.push(s[u]),b=!0;else if(!b)c.push(s[u]);else break;s=s.slice(u);let h=c.join(`
146
+ `),v=h.replace(this.rules.other.blockquoteSetextReplace,`
147
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
148
+ ${h}`:h,l=l?`${l}
149
+ ${v}`:v;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(v,y,!0),this.lexer.state.top=f,s.length===0)break;let C=y.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let x=C,A=x.raw+`
150
+ `+s.join(`
151
+ `),w=this.blockquote(A);y[y.length-1]=w,o=o.substring(0,o.length-x.raw.length)+w.raw,l=l.substring(0,l.length-x.text.length)+w.text;break}else if(C?.type==="list"){let x=C,A=x.raw+`
152
+ `+s.join(`
153
+ `),w=this.list(A);y[y.length-1]=w,o=o.substring(0,o.length-C.raw.length)+w.raw,l=l.substring(0,l.length-x.raw.length)+w.raw,s=A.substring(y.at(-1).raw.length).split(`
154
+ `);continue}}return{type:"blockquote",raw:o,tokens:y,text:l}}}list(i){let n=this.rules.block.list.exec(i);if(n){let s=n[1].trim(),o=s.length>1,l={type:"list",raw:"",ordered:o,start:o?+s.slice(0,-1):"",loose:!1,items:[]};s=o?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=o?s:"[*+-]");let y=this.rules.other.listItemRegex(s),b=!1;for(;i;){let u=!1,h="",v="";if(!(n=y.exec(i))||this.rules.block.hr.test(i))break;h=n[0],i=i.substring(h.length);let f=n[2].split(`
155
+ `,1)[0].replace(this.rules.other.listReplaceTabs,S=>" ".repeat(3*S.length)),C=i.split(`
156
+ `,1)[0],x=!f.trim(),A=0;if(this.options.pedantic?(A=2,v=f.trimStart()):x?A=n[1].length+1:(A=n[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,v=f.slice(A),A+=n[1].length),x&&this.rules.other.blankLine.test(C)&&(h+=C+`
157
+ `,i=i.substring(C.length+1),u=!0),!u){let S=this.rules.other.nextBulletRegex(A),p=this.rules.other.hrRegex(A),m=this.rules.other.fencesBeginRegex(A),E=this.rules.other.headingBeginRegex(A),R=this.rules.other.htmlBeginRegex(A);for(;i;){let L=i.split(`
158
+ `,1)[0],D;if(C=L,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),D=C):D=C.replace(this.rules.other.tabCharGlobal," "),m.test(C)||E.test(C)||R.test(C)||S.test(C)||p.test(C))break;if(D.search(this.rules.other.nonSpaceChar)>=A||!C.trim())v+=`
159
+ `+D.slice(A);else{if(x||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(f)||E.test(f)||p.test(f))break;v+=`
160
+ `+C}!x&&!C.trim()&&(x=!0),h+=L+`
161
+ `,i=i.substring(L.length+1),f=D.slice(A)}}l.loose||(b?l.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(b=!0));let w=null,_;this.options.gfm&&(w=this.rules.other.listIsTask.exec(v),w&&(_=w[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:h,task:!!w,checked:_,loose:!1,text:v,tokens:[]}),l.raw+=h}let c=l.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let u=0;u<l.items.length;u++)if(this.lexer.state.top=!1,l.items[u].tokens=this.lexer.blockTokens(l.items[u].text,[]),!l.loose){let h=l.items[u].tokens.filter(f=>f.type==="space"),v=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));l.loose=v}if(l.loose)for(let u=0;u<l.items.length;u++)l.items[u].loose=!0;return l}}html(i){let n=this.rules.block.html.exec(i);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(i){let n=this.rules.block.def.exec(i);if(n){let s=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:s,raw:n[0],href:o,title:l}}}table(i){let n=this.rules.block.table.exec(i);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let s=Gv(n[1]),o=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
162
+ `):[],y={type:"table",raw:n[0],header:[],align:[],rows:[]};if(s.length===o.length){for(let b of o)this.rules.other.tableAlignRight.test(b)?y.align.push("right"):this.rules.other.tableAlignCenter.test(b)?y.align.push("center"):this.rules.other.tableAlignLeft.test(b)?y.align.push("left"):y.align.push(null);for(let b=0;b<s.length;b++)y.header.push({text:s[b],tokens:this.lexer.inline(s[b]),header:!0,align:y.align[b]});for(let b of l)y.rows.push(Gv(b,y.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:y.align[u]})));return y}}lheading(i){let n=this.rules.block.lheading.exec(i);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(i){let n=this.rules.block.paragraph.exec(i);if(n){let s=n[1].charAt(n[1].length-1)===`
163
+ `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:s,tokens:this.lexer.inline(s)}}}text(i){let n=this.rules.block.text.exec(i);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(i){let n=this.rules.inline.escape.exec(i);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(i){let n=this.rules.inline.tag.exec(i);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(i){let n=this.rules.inline.link.exec(i);if(n){let s=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let y=Po(s.slice(0,-1),"\\");if((s.length-y.length)%2===0)return}else{let y=gT(n[2],"()");if(y===-2)return;if(y>-1){let b=(n[0].indexOf("!")===0?5:4)+n[1].length+y;n[2]=n[2].substring(0,y),n[0]=n[0].substring(0,b).trim(),n[3]=""}}let o=n[2],l="";if(this.options.pedantic){let y=this.rules.other.pedanticHrefTitle.exec(o);y&&(o=y[1],l=y[3])}else l=n[3]?n[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?o=o.slice(1):o=o.slice(1,-1)),Kv(n,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(i,n){let s;if((s=this.rules.inline.reflink.exec(i))||(s=this.rules.inline.nolink.exec(i))){let o=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=n[o.toLowerCase()];if(!l){let y=s[0].charAt(0);return{type:"text",raw:y,text:y}}return Kv(s,l,s[0],this.lexer,this.rules)}}emStrong(i,n,s=""){let o=this.rules.inline.emStrongLDelim.exec(i);if(!(!o||o[3]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!s||this.rules.inline.punctuation.exec(s))){let l=[...o[0]].length-1,y,b,c=l,u=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,n=n.slice(-1*i.length+l);(o=h.exec(n))!=null;){if(y=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!y)continue;if(b=[...y].length,o[3]||o[4]){c+=b;continue}else if((o[5]||o[6])&&l%3&&!((l+b)%3)){u+=b;continue}if(c-=b,c>0)continue;b=Math.min(b,b+c+u);let v=[...o[0]][0].length,f=i.slice(0,l+o.index+v+b);if(Math.min(l,b)%2){let x=f.slice(1,-1);return{type:"em",raw:f,text:x,tokens:this.lexer.inlineTokens(x)}}let C=f.slice(2,-2);return{type:"strong",raw:f,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(i){let n=this.rules.inline.code.exec(i);if(n){let s=n[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(s),l=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return o&&l&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:n[0],text:s}}}br(i){let n=this.rules.inline.br.exec(i);if(n)return{type:"br",raw:n[0]}}del(i){let n=this.rules.inline.del.exec(i);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(i){let n=this.rules.inline.autolink.exec(i);if(n){let s,o;return n[2]==="@"?(s=n[1],o="mailto:"+s):(s=n[1],o=s),{type:"link",raw:n[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}url(i){let n;if(n=this.rules.inline.url.exec(i)){let s,o;if(n[2]==="@")s=n[0],o="mailto:"+s;else{let l;do l=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(l!==n[0]);s=n[0],n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(i){let n=this.rules.inline.text.exec(i);if(n){let s=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:s}}}},On=class mf{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||Us,this.options.tokenizer=this.options.tokenizer||new Zc,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 s={other:Bi,block:Ac.normal,inline:Uo.normal};this.options.pedantic?(s.block=Ac.pedantic,s.inline=Uo.pedantic):this.options.gfm&&(s.block=Ac.gfm,this.options.breaks?s.inline=Uo.breaks:s.inline=Uo.gfm),this.tokenizer.rules=s}static get rules(){return{block:Ac,inline:Uo}}static lex(n,s){return new mf(s).lex(n)}static lexInline(n,s){return new mf(s).inlineTokens(n)}lex(n){n=n.replace(Bi.carriageReturn,`
164
+ `),this.blockTokens(n,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let o=this.inlineQueue[s];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,s=[],o=!1){for(this.options.pedantic&&(n=n.replace(Bi.tabCharGlobal," ").replace(Bi.spaceLine,""));n;){let l;if(this.options.extensions?.block?.some(b=>(l=b.call({lexer:this},n,s))?(n=n.substring(l.raw.length),s.push(l),!0):!1))continue;if(l=this.tokenizer.space(n)){n=n.substring(l.raw.length);let b=s.at(-1);l.raw.length===1&&b!==void 0?b.raw+=`
165
+ `:s.push(l);continue}if(l=this.tokenizer.code(n)){n=n.substring(l.raw.length);let b=s.at(-1);b?.type==="paragraph"||b?.type==="text"?(b.raw+=(b.raw.endsWith(`
166
+ `)?"":`
167
+ `)+l.raw,b.text+=`
168
+ `+l.text,this.inlineQueue.at(-1).src=b.text):s.push(l);continue}if(l=this.tokenizer.fences(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.heading(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.hr(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.blockquote(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.list(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.html(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.def(n)){n=n.substring(l.raw.length);let b=s.at(-1);b?.type==="paragraph"||b?.type==="text"?(b.raw+=(b.raw.endsWith(`
169
+ `)?"":`
170
+ `)+l.raw,b.text+=`
171
+ `+l.raw,this.inlineQueue.at(-1).src=b.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},s.push(l));continue}if(l=this.tokenizer.table(n)){n=n.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.lheading(n)){n=n.substring(l.raw.length),s.push(l);continue}let y=n;if(this.options.extensions?.startBlock){let b=1/0,c=n.slice(1),u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},c),typeof u=="number"&&u>=0&&(b=Math.min(b,u))}),b<1/0&&b>=0&&(y=n.substring(0,b+1))}if(this.state.top&&(l=this.tokenizer.paragraph(y))){let b=s.at(-1);o&&b?.type==="paragraph"?(b.raw+=(b.raw.endsWith(`
172
+ `)?"":`
173
+ `)+l.raw,b.text+=`
174
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):s.push(l),o=y.length!==n.length,n=n.substring(l.raw.length);continue}if(l=this.tokenizer.text(n)){n=n.substring(l.raw.length);let b=s.at(-1);b?.type==="text"?(b.raw+=(b.raw.endsWith(`
175
+ `)?"":`
176
+ `)+l.raw,b.text+=`
177
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):s.push(l);continue}if(n){let b="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return this.state.top=!0,s}inline(n,s=[]){return this.inlineQueue.push({src:n,tokens:s}),s}inlineTokens(n,s=[]){let o=n,l=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)u.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,l.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let y;for(;(l=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)y=l[2]?l[2].length:0,o=o.slice(0,l.index+y)+"["+"a".repeat(l[0].length-y-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let b=!1,c="";for(;n;){b||(c=""),b=!1;let u;if(this.options.extensions?.inline?.some(v=>(u=v.call({lexer:this},n,s))?(n=n.substring(u.raw.length),s.push(u),!0):!1))continue;if(u=this.tokenizer.escape(n)){n=n.substring(u.raw.length),s.push(u);continue}if(u=this.tokenizer.tag(n)){n=n.substring(u.raw.length),s.push(u);continue}if(u=this.tokenizer.link(n)){n=n.substring(u.raw.length),s.push(u);continue}if(u=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(u.raw.length);let v=s.at(-1);u.type==="text"&&v?.type==="text"?(v.raw+=u.raw,v.text+=u.text):s.push(u);continue}if(u=this.tokenizer.emStrong(n,o,c)){n=n.substring(u.raw.length),s.push(u);continue}if(u=this.tokenizer.codespan(n)){n=n.substring(u.raw.length),s.push(u);continue}if(u=this.tokenizer.br(n)){n=n.substring(u.raw.length),s.push(u);continue}if(u=this.tokenizer.del(n)){n=n.substring(u.raw.length),s.push(u);continue}if(u=this.tokenizer.autolink(n)){n=n.substring(u.raw.length),s.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(n))){n=n.substring(u.raw.length),s.push(u);continue}let h=n;if(this.options.extensions?.startInline){let v=1/0,f=n.slice(1),C;this.options.extensions.startInline.forEach(x=>{C=x.call({lexer:this},f),typeof C=="number"&&C>=0&&(v=Math.min(v,C))}),v<1/0&&v>=0&&(h=n.substring(0,v+1))}if(u=this.tokenizer.inlineText(h)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),b=!0;let v=s.at(-1);v?.type==="text"?(v.raw+=u.raw,v.text+=u.text):s.push(u);continue}if(n){let v="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return s}},Qc=class{options;parser;constructor(i){this.options=i||Us}space(i){return""}code({text:i,lang:n,escaped:s}){let o=(n||"").match(Bi.notSpaceStart)?.[0],l=i.replace(Bi.endingNewline,"")+`
178
+ `;return o?'<pre><code class="language-'+Yn(o)+'">'+(s?l:Yn(l,!0))+`</code></pre>
179
+ `:"<pre><code>"+(s?l:Yn(l,!0))+`</code></pre>
180
+ `}blockquote({tokens:i}){return`<blockquote>
181
+ ${this.parser.parse(i)}</blockquote>
182
+ `}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:n}){return`<h${n}>${this.parser.parseInline(i)}</h${n}>
183
+ `}hr(i){return`<hr>
184
+ `}list(i){let n=i.ordered,s=i.start,o="";for(let b=0;b<i.items.length;b++){let c=i.items[b];o+=this.listitem(c)}let l=n?"ol":"ul",y=n&&s!==1?' start="'+s+'"':"";return"<"+l+y+`>
185
+ `+o+"</"+l+`>
186
+ `}listitem(i){let n="";if(i.task){let s=this.checkbox({checked:!!i.checked});i.loose?i.tokens[0]?.type==="paragraph"?(i.tokens[0].text=s+" "+i.tokens[0].text,i.tokens[0].tokens&&i.tokens[0].tokens.length>0&&i.tokens[0].tokens[0].type==="text"&&(i.tokens[0].tokens[0].text=s+" "+Yn(i.tokens[0].tokens[0].text),i.tokens[0].tokens[0].escaped=!0)):i.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):n+=s+" "}return n+=this.parser.parse(i.tokens,!!i.loose),`<li>${n}</li>
187
+ `}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
188
+ `}table(i){let n="",s="";for(let l=0;l<i.header.length;l++)s+=this.tablecell(i.header[l]);n+=this.tablerow({text:s});let o="";for(let l=0;l<i.rows.length;l++){let y=i.rows[l];s="";for(let b=0;b<y.length;b++)s+=this.tablecell(y[b]);o+=this.tablerow({text:s})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
189
+ <thead>
190
+ `+n+`</thead>
191
+ `+o+`</table>
192
+ `}tablerow({text:i}){return`<tr>
193
+ ${i}</tr>
194
+ `}tablecell(i){let n=this.parser.parseInline(i.tokens),s=i.header?"th":"td";return(i.align?`<${s} align="${i.align}">`:`<${s}>`)+n+`</${s}>
195
+ `}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${Yn(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:n,tokens:s}){let o=this.parser.parseInline(s),l=Wv(i);if(l===null)return o;i=l;let y='<a href="'+i+'"';return n&&(y+=' title="'+Yn(n)+'"'),y+=">"+o+"</a>",y}image({href:i,title:n,text:s,tokens:o}){o&&(s=this.parser.parseInline(o,this.parser.textRenderer));let l=Wv(i);if(l===null)return Yn(s);i=l;let y=`<img src="${i}" alt="${s}"`;return n&&(y+=` title="${Yn(n)}"`),y+=">",y}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:Yn(i.text)}},t_=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}},Bn=class vf{options;renderer;textRenderer;constructor(n){this.options=n||Us,this.options.renderer=this.options.renderer||new Qc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new t_}static parse(n,s){return new vf(s).parse(n)}static parseInline(n,s){return new vf(s).parseInline(n)}parse(n,s=!0){let o="";for(let l=0;l<n.length;l++){let y=n[l];if(this.options.extensions?.renderers?.[y.type]){let c=y,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){o+=u||"";continue}}let b=y;switch(b.type){case"space":{o+=this.renderer.space(b);continue}case"hr":{o+=this.renderer.hr(b);continue}case"heading":{o+=this.renderer.heading(b);continue}case"code":{o+=this.renderer.code(b);continue}case"table":{o+=this.renderer.table(b);continue}case"blockquote":{o+=this.renderer.blockquote(b);continue}case"list":{o+=this.renderer.list(b);continue}case"html":{o+=this.renderer.html(b);continue}case"def":{o+=this.renderer.def(b);continue}case"paragraph":{o+=this.renderer.paragraph(b);continue}case"text":{let c=b,u=this.renderer.text(c);for(;l+1<n.length&&n[l+1].type==="text";)c=n[++l],u+=`
196
+ `+this.renderer.text(c);s?o+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):o+=u;continue}default:{let c='Token with "'+b.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return o}parseInline(n,s=this.renderer){let o="";for(let l=0;l<n.length;l++){let y=n[l];if(this.options.extensions?.renderers?.[y.type]){let c=this.options.extensions.renderers[y.type].call({parser:this},y);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(y.type)){o+=c||"";continue}}let b=y;switch(b.type){case"escape":{o+=s.text(b);break}case"html":{o+=s.html(b);break}case"link":{o+=s.link(b);break}case"image":{o+=s.image(b);break}case"strong":{o+=s.strong(b);break}case"em":{o+=s.em(b);break}case"codespan":{o+=s.codespan(b);break}case"br":{o+=s.br(b);break}case"del":{o+=s.del(b);break}case"text":{o+=s.text(b);break}default:{let c='Token with "'+b.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return o}},Yo=class{options;block;constructor(i){this.options=i||Us}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(){return this.block?On.lex:On.lexInline}provideParser(){return this.block?Bn.parse:Bn.parseInline}},fS=class{defaults=Kf();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Bn;Renderer=Qc;TextRenderer=t_;Lexer=On;Tokenizer=Zc;Hooks=Yo;constructor(...i){this.use(...i)}walkTokens(i,n){let s=[];for(let o of i)switch(s=s.concat(n.call(this,o)),o.type){case"table":{let l=o;for(let y of l.header)s=s.concat(this.walkTokens(y.tokens,n));for(let y of l.rows)for(let b of y)s=s.concat(this.walkTokens(b.tokens,n));break}case"list":{let l=o;s=s.concat(this.walkTokens(l.items,n));break}default:{let l=o;this.defaults.extensions?.childTokens?.[l.type]?this.defaults.extensions.childTokens[l.type].forEach(y=>{let b=l[y].flat(1/0);s=s.concat(this.walkTokens(b,n))}):l.tokens&&(s=s.concat(this.walkTokens(l.tokens,n)))}}return s}use(...i){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(s=>{let o={...s};if(o.async=this.defaults.async||o.async||!1,s.extensions&&(s.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let y=n.renderers[l.name];y?n.renderers[l.name]=function(...b){let c=l.renderer.apply(this,b);return c===!1&&(c=y.apply(this,b)),c}: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 y=n[l.level];y?y.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)}),o.extensions=n),s.renderer){let l=this.defaults.renderer||new Qc(this.defaults);for(let y in s.renderer){if(!(y in l))throw new Error(`renderer '${y}' does not exist`);if(["options","parser"].includes(y))continue;let b=y,c=s.renderer[b],u=l[b];l[b]=(...h)=>{let v=c.apply(l,h);return v===!1&&(v=u.apply(l,h)),v||""}}o.renderer=l}if(s.tokenizer){let l=this.defaults.tokenizer||new Zc(this.defaults);for(let y in s.tokenizer){if(!(y in l))throw new Error(`tokenizer '${y}' does not exist`);if(["options","rules","lexer"].includes(y))continue;let b=y,c=s.tokenizer[b],u=l[b];l[b]=(...h)=>{let v=c.apply(l,h);return v===!1&&(v=u.apply(l,h)),v}}o.tokenizer=l}if(s.hooks){let l=this.defaults.hooks||new Yo;for(let y in s.hooks){if(!(y in l))throw new Error(`hook '${y}' does not exist`);if(["options","block"].includes(y))continue;let b=y,c=s.hooks[b],u=l[b];Yo.passThroughHooks.has(y)?l[b]=h=>{if(this.defaults.async&&Yo.passThroughHooksRespectAsync.has(y))return(async()=>{let f=await c.call(l,h);return u.call(l,f)})();let v=c.call(l,h);return u.call(l,v)}:l[b]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await c.apply(l,h);return f===!1&&(f=await u.apply(l,h)),f})();let v=c.apply(l,h);return v===!1&&(v=u.apply(l,h)),v}}o.hooks=l}if(s.walkTokens){let l=this.defaults.walkTokens,y=s.walkTokens;o.walkTokens=function(b){let c=[];return c.push(y.call(this,b)),l&&(c=c.concat(l.call(this,b))),c}}this.defaults={...this.defaults,...o}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,n){return On.lex(i,n??this.defaults)}parser(i,n){return Bn.parse(i,n??this.defaults)}parseMarkdown(i){return(n,s)=>{let o={...s},l={...this.defaults,...o},y=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&o.async===!1)return y(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 y(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return y(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=i),l.async)return(async()=>{let b=l.hooks?await l.hooks.preprocess(n):n,c=await(l.hooks?await l.hooks.provideLexer():i?On.lex:On.lexInline)(b,l),u=l.hooks?await l.hooks.processAllTokens(c):c;l.walkTokens&&await Promise.all(this.walkTokens(u,l.walkTokens));let h=await(l.hooks?await l.hooks.provideParser():i?Bn.parse:Bn.parseInline)(u,l);return l.hooks?await l.hooks.postprocess(h):h})().catch(y);try{l.hooks&&(n=l.hooks.preprocess(n));let b=(l.hooks?l.hooks.provideLexer():i?On.lex:On.lexInline)(n,l);l.hooks&&(b=l.hooks.processAllTokens(b)),l.walkTokens&&this.walkTokens(b,l.walkTokens);let c=(l.hooks?l.hooks.provideParser():i?Bn.parse:Bn.parseInline)(b,l);return l.hooks&&(c=l.hooks.postprocess(c)),c}catch(b){return y(b)}}}onError(i,n){return s=>{if(s.message+=`
197
+ Please report this to https://github.com/markedjs/marked.`,i){let o="<p>An error occurred:</p><pre>"+Yn(s.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(s);throw s}}},zs=new fS;function vt(i,n){return zs.parse(i,n)}vt.options=vt.setOptions=function(i){return zs.setOptions(i),vt.defaults=zs.defaults,iS(vt.defaults),vt};vt.getDefaults=Kf;vt.defaults=Us;vt.use=function(...i){return zs.use(...i),vt.defaults=zs.defaults,iS(vt.defaults),vt};vt.walkTokens=function(i,n){return zs.walkTokens(i,n)};vt.parseInline=zs.parseInline;vt.Parser=Bn;vt.parser=Bn.parse;vt.Renderer=Qc;vt.TextRenderer=t_;vt.Lexer=On;vt.lexer=On.lex;vt.Tokenizer=Zc;vt.Hooks=Yo;vt.parse=vt;vt.options;vt.setOptions;vt.use;vt.walkTokens;vt.parseInline;Bn.parse;On.lex;const{entries:_S,setPrototypeOf:Yv,isFrozen:vT,getPrototypeOf:bT,getOwnPropertyDescriptor:ST}=Object;let{freeze:Ni,seal:xn,create:Aa}=Object,{apply:bf,construct:Sf}=typeof Reflect<"u"&&Reflect;Ni||(Ni=function(n){return n});xn||(xn=function(n){return n});bf||(bf=function(n,s){for(var o=arguments.length,l=new Array(o>2?o-2:0),y=2;y<o;y++)l[y-2]=arguments[y];return n.apply(s,l)});Sf||(Sf=function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),l=1;l<s;l++)o[l-1]=arguments[l];return new n(...o)});const jo=ci(Array.prototype.forEach),yT=ci(Array.prototype.lastIndexOf),Vv=ci(Array.prototype.pop),Fo=ci(Array.prototype.push),CT=ci(Array.prototype.splice),Di=Array.isArray,Vo=ci(String.prototype.toLowerCase),Ud=ci(String.prototype.toString),Xv=ci(String.prototype.match),xa=ci(String.prototype.replace),Zv=ci(String.prototype.indexOf),wT=ci(String.prototype.trim),ET=ci(Number.prototype.toString),xT=ci(Boolean.prototype.toString),Qv=typeof BigInt>"u"?null:ci(BigInt.prototype.toString),Jv=typeof Symbol>"u"?null:ci(Symbol.prototype.toString),qt=ci(Object.prototype.hasOwnProperty),qo=ci(Object.prototype.toString),xi=ci(RegExp.prototype.test),Rc=TT(TypeError);function ci(i){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var s=arguments.length,o=new Array(s>1?s-1:0),l=1;l<s;l++)o[l-1]=arguments[l];return bf(i,n,o)}}function TT(i){return function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return Sf(i,s)}}function Ge(i,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vo;if(Yv&&Yv(i,null),!Di(n))return i;let o=n.length;for(;o--;){let l=n[o];if(typeof l=="string"){const y=s(l);y!==l&&(vT(n)||(n[o]=y),l=y)}i[l]=!0}return i}function AT(i){for(let n=0;n<i.length;n++)qt(i,n)||(i[n]=null);return i}function Ki(i){const n=Aa(null);for(const[s,o]of _S(i))qt(i,s)&&(Di(o)?n[s]=AT(o):o&&typeof o=="object"&&o.constructor===Object?n[s]=Ki(o):n[s]=o);return n}function RT(i){switch(typeof i){case"string":return i;case"number":return ET(i);case"boolean":return xT(i);case"bigint":return Qv?Qv(i):"0";case"symbol":return Jv?Jv(i):"Symbol()";case"undefined":return qo(i);case"function":case"object":{if(i===null)return qo(i);const n=i,s=Ra(n,"toString");if(typeof s=="function"){const o=s(n);return typeof o=="string"?o:qo(o)}return qo(i)}default:return qo(i)}}function Ra(i,n){for(;i!==null;){const o=ST(i,n);if(o){if(o.get)return ci(o.get);if(typeof o.value=="function")return ci(o.value)}i=bT(i)}function s(){return null}return s}function LT(i){try{return xi(i,""),!0}catch{return!1}}const e0=Ni(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pd=Ni(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),jd=Ni(["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"]),kT=Ni(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Fd=Ni(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),MT=Ni(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),t0=Ni(["#text"]),i0=Ni(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),qd=Ni(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),n0=Ni(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Lc=Ni(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),DT=xn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),OT=xn(/<%[\w\W]*|[\w\W]*%>/gm),BT=xn(/\$\{[\w\W]*/gm),NT=xn(/^data-[\-\w.\u00B7-\uFFFF]+$/),IT=xn(/^aria-[\-\w]+$/),pS=xn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),HT=xn(/^(?:\w+script|data):/i),zT=xn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gS=xn(/^html$/i),$T=xn(/^[a-z][.\w]*(-[.\w]+)+$/i);var r0=Object.freeze({__proto__:null,ARIA_ATTR:IT,ATTR_WHITESPACE:zT,CUSTOM_ELEMENT:$T,DATA_ATTR:NT,DOCTYPE_NAME:gS,ERB_EXPR:OT,IS_ALLOWED_URI:pS,IS_SCRIPT_OR_DATA:HT,MUSTACHE_EXPR:DT,TMPLIT_EXPR:BT});const Wo={element:1,text:3,progressingInstruction:7,comment:8,document:9},UT=function(){return typeof window>"u"?null:window},PT=function(n,s){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let o=null;const l="data-tt-policy-suffix";s&&s.hasAttribute(l)&&(o=s.getAttribute(l));const y="dompurify"+(o?"#"+o:"");try{return n.createPolicy(y,{createHTML(b){return b},createScriptURL(b){return b}})}catch{return console.warn("TrustedTypes policy "+y+" could not be created."),null}},s0=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function mS(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:UT();const n=Me=>mS(Me);if(n.version="3.4.2",n.removed=[],!i||!i.document||i.document.nodeType!==Wo.document||!i.Element)return n.isSupported=!1,n;let{document:s}=i;const o=s,l=o.currentScript,{DocumentFragment:y,HTMLTemplateElement:b,Node:c,Element:u,NodeFilter:h,NamedNodeMap:v=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:f,DOMParser:C,trustedTypes:x}=i,A=u.prototype,w=Ra(A,"cloneNode"),_=Ra(A,"remove"),S=Ra(A,"nextSibling"),p=Ra(A,"childNodes"),m=Ra(A,"parentNode");if(typeof b=="function"){const Me=s.createElement("template");Me.content&&Me.content.ownerDocument&&(s=Me.content.ownerDocument)}let E,R="";const{implementation:L,createNodeIterator:D,createDocumentFragment:T,getElementsByTagName:B}=s,{importNode:W}=o;let P=s0();n.isSupported=typeof _S=="function"&&typeof m=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:I,TMPLIT_EXPR:Z,DATA_ATTR:ee,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:Y,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:O}=r0;let{IS_ALLOWED_URI:H}=r0,M=null;const U=Ge({},[...e0,...Pd,...jd,...Fd,...t0]);let V=null;const ae=Ge({},[...i0,...qd,...n0,...Lc]);let ce=Object.seal(Aa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,Q=null;const $=Object.seal(Aa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,pe=!0,Se=!1,be=!0,ze=!1,je=!0,Ke=!1,Ct=!1,Oe=!1,Qt=!1,gi=!1,mi=!1,un=!0,Tn=!1;const Jt="user-content-";let lt=!0,Gt=!1,It={},Ht=null;const ei=Ge({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let An=null;const Ti=Ge({},["audio","video","img","source","image","track"]);let Xi=null;const ut=Ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ii="http://www.w3.org/1998/Math/MathML",Kt="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml";let zt=Yt,us=!1,er=null;const Ps=Ge({},[Ii,Kt,Yt],Ud);let Rn=Ge({},["mi","mo","mn","ms","mtext"]),Pn=Ge({},["annotation-xml"]);const tr=Ge({},["title","style","font","a","script"]);let ti=null;const X=["application/xhtml+xml","text/html"],he="text/html";let ve=null,Ne=null;const St=s.createElement("form"),ht=function(q){return q instanceof RegExp||q instanceof Function},Ee=function(){let q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ne&&Ne===q)return;(!q||typeof q!="object")&&(q={}),q=Ki(q),ti=X.indexOf(q.PARSER_MEDIA_TYPE)===-1?he:q.PARSER_MEDIA_TYPE,ve=ti==="application/xhtml+xml"?Ud:Vo,M=qt(q,"ALLOWED_TAGS")&&Di(q.ALLOWED_TAGS)?Ge({},q.ALLOWED_TAGS,ve):U,V=qt(q,"ALLOWED_ATTR")&&Di(q.ALLOWED_ATTR)?Ge({},q.ALLOWED_ATTR,ve):ae,er=qt(q,"ALLOWED_NAMESPACES")&&Di(q.ALLOWED_NAMESPACES)?Ge({},q.ALLOWED_NAMESPACES,Ud):Ps,Xi=qt(q,"ADD_URI_SAFE_ATTR")&&Di(q.ADD_URI_SAFE_ATTR)?Ge(Ki(ut),q.ADD_URI_SAFE_ATTR,ve):ut,An=qt(q,"ADD_DATA_URI_TAGS")&&Di(q.ADD_DATA_URI_TAGS)?Ge(Ki(Ti),q.ADD_DATA_URI_TAGS,ve):Ti,Ht=qt(q,"FORBID_CONTENTS")&&Di(q.FORBID_CONTENTS)?Ge({},q.FORBID_CONTENTS,ve):ei,me=qt(q,"FORBID_TAGS")&&Di(q.FORBID_TAGS)?Ge({},q.FORBID_TAGS,ve):Ki({}),Q=qt(q,"FORBID_ATTR")&&Di(q.FORBID_ATTR)?Ge({},q.FORBID_ATTR,ve):Ki({}),It=qt(q,"USE_PROFILES")?q.USE_PROFILES&&typeof q.USE_PROFILES=="object"?Ki(q.USE_PROFILES):q.USE_PROFILES:!1,oe=q.ALLOW_ARIA_ATTR!==!1,pe=q.ALLOW_DATA_ATTR!==!1,Se=q.ALLOW_UNKNOWN_PROTOCOLS||!1,be=q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ze=q.SAFE_FOR_TEMPLATES||!1,je=q.SAFE_FOR_XML!==!1,Ke=q.WHOLE_DOCUMENT||!1,Qt=q.RETURN_DOM||!1,gi=q.RETURN_DOM_FRAGMENT||!1,mi=q.RETURN_TRUSTED_TYPE||!1,Oe=q.FORCE_BODY||!1,un=q.SANITIZE_DOM!==!1,Tn=q.SANITIZE_NAMED_PROPS||!1,lt=q.KEEP_CONTENT!==!1,Gt=q.IN_PLACE||!1,H=LT(q.ALLOWED_URI_REGEXP)?q.ALLOWED_URI_REGEXP:pS,zt=typeof q.NAMESPACE=="string"?q.NAMESPACE:Yt,Rn=qt(q,"MATHML_TEXT_INTEGRATION_POINTS")&&q.MATHML_TEXT_INTEGRATION_POINTS&&typeof q.MATHML_TEXT_INTEGRATION_POINTS=="object"?Ki(q.MATHML_TEXT_INTEGRATION_POINTS):Ge({},["mi","mo","mn","ms","mtext"]),Pn=qt(q,"HTML_INTEGRATION_POINTS")&&q.HTML_INTEGRATION_POINTS&&typeof q.HTML_INTEGRATION_POINTS=="object"?Ki(q.HTML_INTEGRATION_POINTS):Ge({},["annotation-xml"]);const _e=qt(q,"CUSTOM_ELEMENT_HANDLING")&&q.CUSTOM_ELEMENT_HANDLING&&typeof q.CUSTOM_ELEMENT_HANDLING=="object"?Ki(q.CUSTOM_ELEMENT_HANDLING):Aa(null);if(ce=Aa(null),qt(_e,"tagNameCheck")&&ht(_e.tagNameCheck)&&(ce.tagNameCheck=_e.tagNameCheck),qt(_e,"attributeNameCheck")&&ht(_e.attributeNameCheck)&&(ce.attributeNameCheck=_e.attributeNameCheck),qt(_e,"allowCustomizedBuiltInElements")&&typeof _e.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=_e.allowCustomizedBuiltInElements),ze&&(pe=!1),gi&&(Qt=!0),It&&(M=Ge({},t0),V=Aa(null),It.html===!0&&(Ge(M,e0),Ge(V,i0)),It.svg===!0&&(Ge(M,Pd),Ge(V,qd),Ge(V,Lc)),It.svgFilters===!0&&(Ge(M,jd),Ge(V,qd),Ge(V,Lc)),It.mathMl===!0&&(Ge(M,Fd),Ge(V,n0),Ge(V,Lc))),$.tagCheck=null,$.attributeCheck=null,qt(q,"ADD_TAGS")&&(typeof q.ADD_TAGS=="function"?$.tagCheck=q.ADD_TAGS:Di(q.ADD_TAGS)&&(M===U&&(M=Ki(M)),Ge(M,q.ADD_TAGS,ve))),qt(q,"ADD_ATTR")&&(typeof q.ADD_ATTR=="function"?$.attributeCheck=q.ADD_ATTR:Di(q.ADD_ATTR)&&(V===ae&&(V=Ki(V)),Ge(V,q.ADD_ATTR,ve))),qt(q,"ADD_URI_SAFE_ATTR")&&Di(q.ADD_URI_SAFE_ATTR)&&Ge(Xi,q.ADD_URI_SAFE_ATTR,ve),qt(q,"FORBID_CONTENTS")&&Di(q.FORBID_CONTENTS)&&(Ht===ei&&(Ht=Ki(Ht)),Ge(Ht,q.FORBID_CONTENTS,ve)),qt(q,"ADD_FORBID_CONTENTS")&&Di(q.ADD_FORBID_CONTENTS)&&(Ht===ei&&(Ht=Ki(Ht)),Ge(Ht,q.ADD_FORBID_CONTENTS,ve)),lt&&(M["#text"]=!0),Ke&&Ge(M,["html","head","body"]),M.table&&(Ge(M,["tbody"]),delete me.tbody),q.TRUSTED_TYPES_POLICY){if(typeof q.TRUSTED_TYPES_POLICY.createHTML!="function")throw Rc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Rc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=q.TRUSTED_TYPES_POLICY,R=E.createHTML("")}else E===void 0&&(E=PT(x,l)),E!==null&&typeof R=="string"&&(R=E.createHTML(""));Ni&&Ni(q),Ne=q},Ce=Ge({},[...Pd,...jd,...kT]),Ie=Ge({},[...Fd,...MT]),Bt=function(q){let _e=m(q);(!_e||!_e.tagName)&&(_e={namespaceURI:zt,tagName:"template"});const we=Vo(q.tagName),it=Vo(_e.tagName);return er[q.namespaceURI]?q.namespaceURI===Kt?_e.namespaceURI===Yt?we==="svg":_e.namespaceURI===Ii?we==="svg"&&(it==="annotation-xml"||Rn[it]):!!Ce[we]:q.namespaceURI===Ii?_e.namespaceURI===Yt?we==="math":_e.namespaceURI===Kt?we==="math"&&Pn[it]:!!Ie[we]:q.namespaceURI===Yt?_e.namespaceURI===Kt&&!Pn[it]||_e.namespaceURI===Ii&&!Rn[it]?!1:!Ie[we]&&(tr[we]||!Ce[we]):!!(ti==="application/xhtml+xml"&&er[q.namespaceURI]):!1},Qe=function(q){Fo(n.removed,{element:q});try{m(q).removeChild(q)}catch{_(q)}},vi=function(q,_e){try{Fo(n.removed,{attribute:_e.getAttributeNode(q),from:_e})}catch{Fo(n.removed,{attribute:null,from:_e})}if(_e.removeAttribute(q),q==="is")if(Qt||gi)try{Qe(_e)}catch{}else try{_e.setAttribute(q,"")}catch{}},ir=function(q){let _e=null,we=null;if(Oe)q="<remove></remove>"+q;else{const Tt=Xv(q,/^[\r\n\t ]+/);we=Tt&&Tt[0]}ti==="application/xhtml+xml"&&zt===Yt&&(q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+q+"</body></html>");const it=E?E.createHTML(q):q;if(zt===Yt)try{_e=new C().parseFromString(it,ti)}catch{}if(!_e||!_e.documentElement){_e=L.createDocument(zt,"template",null);try{_e.documentElement.innerHTML=us?R:it}catch{}}const Ye=_e.body||_e.documentElement;return q&&we&&Ye.insertBefore(s.createTextNode(we),Ye.childNodes[0]||null),zt===Yt?B.call(_e,Ke?"html":"body")[0]:Ke?_e.documentElement:Ye},nr=function(q){return D.call(q.ownerDocument||q,q,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Hi=function(q){return q instanceof f&&(typeof q.nodeName!="string"||typeof q.textContent!="string"||typeof q.removeChild!="function"||!(q.attributes instanceof v)||typeof q.removeAttribute!="function"||typeof q.setAttribute!="function"||typeof q.namespaceURI!="string"||typeof q.insertBefore!="function"||typeof q.hasChildNodes!="function")},xt=function(q){return typeof c=="function"&&q instanceof c};function wt(Me,q,_e){jo(Me,we=>{we.call(n,q,_e,Ne)})}const Ln=function(q){let _e=null;if(wt(P.beforeSanitizeElements,q,null),Hi(q))return Qe(q),!0;const we=ve(q.nodeName);if(wt(P.uponSanitizeElement,q,{tagName:we,allowedTags:M}),je&&q.hasChildNodes()&&!xt(q.firstElementChild)&&xi(/<[/\w!]/g,q.innerHTML)&&xi(/<[/\w!]/g,q.textContent)||je&&q.namespaceURI===Yt&&we==="style"&&xt(q.firstElementChild)||q.nodeType===Wo.progressingInstruction||je&&q.nodeType===Wo.comment&&xi(/<[/\w]/g,q.data))return Qe(q),!0;if(me[we]||!($.tagCheck instanceof Function&&$.tagCheck(we))&&!M[we]){if(!me[we]&&rr(we)&&(ce.tagNameCheck instanceof RegExp&&xi(ce.tagNameCheck,we)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(we)))return!1;if(lt&&!Ht[we]){const it=m(q)||q.parentNode,Ye=p(q)||q.childNodes;if(Ye&&it){const Tt=Ye.length;for(let $t=Tt-1;$t>=0;--$t){const Ut=w(Ye[$t],!0);it.insertBefore(Ut,S(q))}}}return Qe(q),!0}return q instanceof u&&!Bt(q)||(we==="noscript"||we==="noembed"||we==="noframes")&&xi(/<\/no(script|embed|frames)/i,q.innerHTML)?(Qe(q),!0):(ze&&q.nodeType===Wo.text&&(_e=q.textContent,jo([F,I,Z],it=>{_e=xa(_e,it," ")}),q.textContent!==_e&&(Fo(n.removed,{element:q.cloneNode()}),q.textContent=_e)),wt(P.afterSanitizeElements,q,null),!1)},Mr=function(q,_e,we){if(Q[_e]||un&&(_e==="id"||_e==="name")&&(we in s||we in St))return!1;const it=V[_e]||$.attributeCheck instanceof Function&&$.attributeCheck(_e,q);if(!(pe&&!Q[_e]&&xi(ee,_e))){if(!(oe&&xi(j,_e))){if(!it||Q[_e]){if(!(rr(q)&&(ce.tagNameCheck instanceof RegExp&&xi(ce.tagNameCheck,q)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(q))&&(ce.attributeNameCheck instanceof RegExp&&xi(ce.attributeNameCheck,_e)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(_e,q))||_e==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&xi(ce.tagNameCheck,we)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(we))))return!1}else if(!Xi[_e]){if(!xi(H,xa(we,K,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&q!=="script"&&Zv(we,"data:")===0&&An[q])){if(!(Se&&!xi(Y,xa(we,K,"")))){if(we)return!1}}}}}}return!0},js=Ge({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),rr=function(q){return!js[Vo(q)]&&xi(O,q)},hs=function(q){wt(P.beforeSanitizeAttributes,q,null);const{attributes:_e}=q;if(!_e||Hi(q))return;const we={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let it=_e.length;for(;it--;){const Ye=_e[it],{name:Tt,namespaceURI:$t,value:Ut}=Ye,ge=ve(Tt),Le=Ut;let De=Tt==="value"?Le:wT(Le);if(we.attrName=ge,we.attrValue=De,we.keepAttr=!0,we.forceKeepAttr=void 0,wt(P.uponSanitizeAttribute,q,we),De=we.attrValue,Tn&&(ge==="id"||ge==="name")&&Zv(De,Jt)!==0&&(vi(Tt,q),De=Jt+De),je&&xi(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,De)){vi(Tt,q);continue}if(ge==="attributename"&&Xv(De,"href")){vi(Tt,q);continue}if(we.forceKeepAttr)continue;if(!we.keepAttr){vi(Tt,q);continue}if(!be&&xi(/\/>/i,De)){vi(Tt,q);continue}ze&&jo([F,I,Z],Mt=>{De=xa(De,Mt," ")});const rt=ve(q.nodeName);if(!Mr(rt,ge,De)){vi(Tt,q);continue}if(E&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!$t)switch(x.getAttributeType(rt,ge)){case"TrustedHTML":{De=E.createHTML(De);break}case"TrustedScriptURL":{De=E.createScriptURL(De);break}}if(De!==Le)try{$t?q.setAttributeNS($t,Tt,De):q.setAttribute(Tt,De),Hi(q)?Qe(q):Vv(n.removed)}catch{vi(Tt,q)}}wt(P.afterSanitizeAttributes,q,null)},jn=function(q){let _e=null;const we=nr(q);for(wt(P.beforeSanitizeShadowDOM,q,null);_e=we.nextNode();)wt(P.uponSanitizeShadowNode,_e,null),Ln(_e),hs(_e),_e.content instanceof y&&jn(_e.content);wt(P.afterSanitizeShadowDOM,q,null)};return n.sanitize=function(Me){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,we=null,it=null,Ye=null;if(us=!Me,us&&(Me="<!-->"),typeof Me!="string"&&!xt(Me)&&(Me=RT(Me),typeof Me!="string"))throw Rc("dirty is not a string, aborting");if(!n.isSupported)return Me;if(Ct||Ee(q),n.removed=[],typeof Me=="string"&&(Gt=!1),Gt){const Ut=Me.nodeName;if(typeof Ut=="string"){const ge=ve(Ut);if(!M[ge]||me[ge])throw Rc("root node is forbidden and cannot be sanitized in-place")}}else if(Me instanceof c)_e=ir("<!---->"),we=_e.ownerDocument.importNode(Me,!0),we.nodeType===Wo.element&&we.nodeName==="BODY"||we.nodeName==="HTML"?_e=we:_e.appendChild(we);else{if(!Qt&&!ze&&!Ke&&Me.indexOf("<")===-1)return E&&mi?E.createHTML(Me):Me;if(_e=ir(Me),!_e)return Qt?null:mi?R:""}_e&&Oe&&Qe(_e.firstChild);const Tt=nr(Gt?Me:_e);for(;it=Tt.nextNode();)Ln(it),hs(it),it.content instanceof y&&jn(it.content);if(Gt)return Me;if(Qt){if(ze){_e.normalize();let Ut=_e.innerHTML;jo([F,I,Z],ge=>{Ut=xa(Ut,ge," ")}),_e.innerHTML=Ut}if(gi)for(Ye=T.call(_e.ownerDocument);_e.firstChild;)Ye.appendChild(_e.firstChild);else Ye=_e;return(V.shadowroot||V.shadowrootmode)&&(Ye=W.call(o,Ye,!0)),Ye}let $t=Ke?_e.outerHTML:_e.innerHTML;return Ke&&M["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&xi(gS,_e.ownerDocument.doctype.name)&&($t="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
198
+ `+$t),ze&&jo([F,I,Z],Ut=>{$t=xa($t,Ut," ")}),E&&mi?E.createHTML($t):$t},n.setConfig=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ee(Me),Ct=!0},n.clearConfig=function(){Ne=null,Ct=!1},n.isValidAttribute=function(Me,q,_e){Ne||Ee({});const we=ve(Me),it=ve(q);return Mr(we,it,_e)},n.addHook=function(Me,q){typeof q=="function"&&Fo(P[Me],q)},n.removeHook=function(Me,q){if(q!==void 0){const _e=yT(P[Me],q);return _e===-1?void 0:CT(P[Me],_e,1)[0]}return Vv(P[Me])},n.removeHooks=function(Me){P[Me]=[]},n.removeAllHooks=function(){P=s0()},n}var el=mS(),Wd,a0;function jT(){if(a0)return Wd;a0=1;function i(X){return X instanceof Map?X.clear=X.delete=X.set=function(){throw new Error("map is read-only")}:X instanceof Set&&(X.add=X.clear=X.delete=function(){throw new Error("set is read-only")}),Object.freeze(X),Object.getOwnPropertyNames(X).forEach(he=>{const ve=X[he],Ne=typeof ve;(Ne==="object"||Ne==="function")&&!Object.isFrozen(ve)&&i(ve)}),X}class n{constructor(he){he.data===void 0&&(he.data={}),this.data=he.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function s(X){return X.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function o(X,...he){const ve=Object.create(null);for(const Ne in X)ve[Ne]=X[Ne];return he.forEach(function(Ne){for(const St in Ne)ve[St]=Ne[St]}),ve}const l="</span>",y=X=>!!X.scope,b=(X,{prefix:he})=>{if(X.startsWith("language:"))return X.replace("language:","language-");if(X.includes(".")){const ve=X.split(".");return[`${he}${ve.shift()}`,...ve.map((Ne,St)=>`${Ne}${"_".repeat(St+1)}`)].join(" ")}return`${he}${X}`};class c{constructor(he,ve){this.buffer="",this.classPrefix=ve.classPrefix,he.walk(this)}addText(he){this.buffer+=s(he)}openNode(he){if(!y(he))return;const ve=b(he.scope,{prefix:this.classPrefix});this.span(ve)}closeNode(he){y(he)&&(this.buffer+=l)}value(){return this.buffer}span(he){this.buffer+=`<span class="${he}">`}}const u=(X={})=>{const he={children:[]};return Object.assign(he,X),he};class h{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(he){this.top.children.push(he)}openNode(he){const ve=u({scope:he});this.add(ve),this.stack.push(ve)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(he){return this.constructor._walk(he,this.rootNode)}static _walk(he,ve){return typeof ve=="string"?he.addText(ve):ve.children&&(he.openNode(ve),ve.children.forEach(Ne=>this._walk(he,Ne)),he.closeNode(ve)),he}static _collapse(he){typeof he!="string"&&he.children&&(he.children.every(ve=>typeof ve=="string")?he.children=[he.children.join("")]:he.children.forEach(ve=>{h._collapse(ve)}))}}class v extends h{constructor(he){super(),this.options=he}addText(he){he!==""&&this.add(he)}startScope(he){this.openNode(he)}endScope(){this.closeNode()}__addSublanguage(he,ve){const Ne=he.root;ve&&(Ne.scope=`language:${ve}`),this.add(Ne)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(X){return X?typeof X=="string"?X:X.source:null}function C(X){return w("(?=",X,")")}function x(X){return w("(?:",X,")*")}function A(X){return w("(?:",X,")?")}function w(...X){return X.map(ve=>f(ve)).join("")}function _(X){const he=X[X.length-1];return typeof he=="object"&&he.constructor===Object?(X.splice(X.length-1,1),he):{}}function S(...X){return"("+(_(X).capture?"":"?:")+X.map(Ne=>f(Ne)).join("|")+")"}function p(X){return new RegExp(X.toString()+"|").exec("").length-1}function m(X,he){const ve=X&&X.exec(he);return ve&&ve.index===0}const E=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function R(X,{joinWith:he}){let ve=0;return X.map(Ne=>{ve+=1;const St=ve;let ht=f(Ne),Ee="";for(;ht.length>0;){const Ce=E.exec(ht);if(!Ce){Ee+=ht;break}Ee+=ht.substring(0,Ce.index),ht=ht.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?Ee+="\\"+String(Number(Ce[1])+St):(Ee+=Ce[0],Ce[0]==="("&&ve++)}return Ee}).map(Ne=>`(${Ne})`).join(he)}const L=/\b\B/,D="[a-zA-Z]\\w*",T="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",P="\\b(0b[01]+)",F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",I=(X={})=>{const he=/^#![ ]*\//;return X.binary&&(X.begin=w(he,/.*\b/,X.binary,/\b.*/)),o({scope:"meta",begin:he,end:/$/,relevance:0,"on:begin":(ve,Ne)=>{ve.index!==0&&Ne.ignoreMatch()}},X)},Z={begin:"\\\\[\\s\\S]",relevance:0},ee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Z]},j={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Z]},Y={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},K=function(X,he,ve={}){const Ne=o({scope:"comment",begin:X,end:he,contains:[]},ve);Ne.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const St=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ne.contains.push({begin:w(/[ ]+/,"(",St,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ne},O=K("//","$"),H=K("/\\*","\\*/"),M=K("#","$"),U={scope:"number",begin:B,relevance:0},V={scope:"number",begin:W,relevance:0},ae={scope:"number",begin:P,relevance:0},ce={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Z,{begin:/\[/,end:/\]/,relevance:0,contains:[Z]}]},me={scope:"title",begin:D,relevance:0},Q={scope:"title",begin:T,relevance:0},$={begin:"\\.\\s*"+T,relevance:0};var pe=Object.freeze({__proto__:null,APOS_STRING_MODE:ee,BACKSLASH_ESCAPE:Z,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:P,COMMENT:K,C_BLOCK_COMMENT_MODE:H,C_LINE_COMMENT_MODE:O,C_NUMBER_MODE:V,C_NUMBER_RE:W,END_SAME_AS_BEGIN:function(X){return Object.assign(X,{"on:begin":(he,ve)=>{ve.data._beginMatch=he[1]},"on:end":(he,ve)=>{ve.data._beginMatch!==he[1]&&ve.ignoreMatch()}})},HASH_COMMENT_MODE:M,IDENT_RE:D,MATCH_NOTHING_RE:L,METHOD_GUARD:$,NUMBER_MODE:U,NUMBER_RE:B,PHRASAL_WORDS_MODE:Y,QUOTE_STRING_MODE:j,REGEXP_MODE:ce,RE_STARTERS_RE:F,SHEBANG:I,TITLE_MODE:me,UNDERSCORE_IDENT_RE:T,UNDERSCORE_TITLE_MODE:Q});function Se(X,he){X.input[X.index-1]==="."&&he.ignoreMatch()}function be(X,he){X.className!==void 0&&(X.scope=X.className,delete X.className)}function ze(X,he){he&&X.beginKeywords&&(X.begin="\\b("+X.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",X.__beforeBegin=Se,X.keywords=X.keywords||X.beginKeywords,delete X.beginKeywords,X.relevance===void 0&&(X.relevance=0))}function je(X,he){Array.isArray(X.illegal)&&(X.illegal=S(...X.illegal))}function Ke(X,he){if(X.match){if(X.begin||X.end)throw new Error("begin & end are not supported with match");X.begin=X.match,delete X.match}}function Ct(X,he){X.relevance===void 0&&(X.relevance=1)}const Oe=(X,he)=>{if(!X.beforeMatch)return;if(X.starts)throw new Error("beforeMatch cannot be used with starts");const ve=Object.assign({},X);Object.keys(X).forEach(Ne=>{delete X[Ne]}),X.keywords=ve.keywords,X.begin=w(ve.beforeMatch,C(ve.begin)),X.starts={relevance:0,contains:[Object.assign(ve,{endsParent:!0})]},X.relevance=0,delete ve.beforeMatch},Qt=["of","and","for","in","not","or","if","then","parent","list","value"],gi="keyword";function mi(X,he,ve=gi){const Ne=Object.create(null);return typeof X=="string"?St(ve,X.split(" ")):Array.isArray(X)?St(ve,X):Object.keys(X).forEach(function(ht){Object.assign(Ne,mi(X[ht],he,ht))}),Ne;function St(ht,Ee){he&&(Ee=Ee.map(Ce=>Ce.toLowerCase())),Ee.forEach(function(Ce){const Ie=Ce.split("|");Ne[Ie[0]]=[ht,un(Ie[0],Ie[1])]})}}function un(X,he){return he?Number(he):Tn(X)?0:1}function Tn(X){return Qt.includes(X.toLowerCase())}const Jt={},lt=X=>{console.error(X)},Gt=(X,...he)=>{console.log(`WARN: ${X}`,...he)},It=(X,he)=>{Jt[`${X}/${he}`]||(console.log(`Deprecated as of ${X}. ${he}`),Jt[`${X}/${he}`]=!0)},Ht=new Error;function ei(X,he,{key:ve}){let Ne=0;const St=X[ve],ht={},Ee={};for(let Ce=1;Ce<=he.length;Ce++)Ee[Ce+Ne]=St[Ce],ht[Ce+Ne]=!0,Ne+=p(he[Ce-1]);X[ve]=Ee,X[ve]._emit=ht,X[ve]._multi=!0}function An(X){if(Array.isArray(X.begin)){if(X.skip||X.excludeBegin||X.returnBegin)throw lt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ht;if(typeof X.beginScope!="object"||X.beginScope===null)throw lt("beginScope must be object"),Ht;ei(X,X.begin,{key:"beginScope"}),X.begin=R(X.begin,{joinWith:""})}}function Ti(X){if(Array.isArray(X.end)){if(X.skip||X.excludeEnd||X.returnEnd)throw lt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ht;if(typeof X.endScope!="object"||X.endScope===null)throw lt("endScope must be object"),Ht;ei(X,X.end,{key:"endScope"}),X.end=R(X.end,{joinWith:""})}}function Xi(X){X.scope&&typeof X.scope=="object"&&X.scope!==null&&(X.beginScope=X.scope,delete X.scope)}function ut(X){Xi(X),typeof X.beginScope=="string"&&(X.beginScope={_wrap:X.beginScope}),typeof X.endScope=="string"&&(X.endScope={_wrap:X.endScope}),An(X),Ti(X)}function Ii(X){function he(Ee,Ce){return new RegExp(f(Ee),"m"+(X.case_insensitive?"i":"")+(X.unicodeRegex?"u":"")+(Ce?"g":""))}class ve{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,Ie){Ie.position=this.position++,this.matchIndexes[this.matchAt]=Ie,this.regexes.push([Ie,Ce]),this.matchAt+=p(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(Ie=>Ie[1]);this.matcherRe=he(R(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const Ie=this.matcherRe.exec(Ce);if(!Ie)return null;const Bt=Ie.findIndex((vi,ir)=>ir>0&&vi!==void 0),Qe=this.matchIndexes[Bt];return Ie.splice(0,Bt),Object.assign(Ie,Qe)}}class Ne{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ce){if(this.multiRegexes[Ce])return this.multiRegexes[Ce];const Ie=new ve;return this.rules.slice(Ce).forEach(([Bt,Qe])=>Ie.addRule(Bt,Qe)),Ie.compile(),this.multiRegexes[Ce]=Ie,Ie}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,Ie){this.rules.push([Ce,Ie]),Ie.type==="begin"&&this.count++}exec(Ce){const Ie=this.getMatcher(this.regexIndex);Ie.lastIndex=this.lastIndex;let Bt=Ie.exec(Ce);if(this.resumingScanAtSamePosition()&&!(Bt&&Bt.index===this.lastIndex)){const Qe=this.getMatcher(0);Qe.lastIndex=this.lastIndex+1,Bt=Qe.exec(Ce)}return Bt&&(this.regexIndex+=Bt.position+1,this.regexIndex===this.count&&this.considerAll()),Bt}}function St(Ee){const Ce=new Ne;return Ee.contains.forEach(Ie=>Ce.addRule(Ie.begin,{rule:Ie,type:"begin"})),Ee.terminatorEnd&&Ce.addRule(Ee.terminatorEnd,{type:"end"}),Ee.illegal&&Ce.addRule(Ee.illegal,{type:"illegal"}),Ce}function ht(Ee,Ce){const Ie=Ee;if(Ee.isCompiled)return Ie;[be,Ke,ut,Oe].forEach(Qe=>Qe(Ee,Ce)),X.compilerExtensions.forEach(Qe=>Qe(Ee,Ce)),Ee.__beforeBegin=null,[ze,je,Ct].forEach(Qe=>Qe(Ee,Ce)),Ee.isCompiled=!0;let Bt=null;return typeof Ee.keywords=="object"&&Ee.keywords.$pattern&&(Ee.keywords=Object.assign({},Ee.keywords),Bt=Ee.keywords.$pattern,delete Ee.keywords.$pattern),Bt=Bt||/\w+/,Ee.keywords&&(Ee.keywords=mi(Ee.keywords,X.case_insensitive)),Ie.keywordPatternRe=he(Bt,!0),Ce&&(Ee.begin||(Ee.begin=/\B|\b/),Ie.beginRe=he(Ie.begin),!Ee.end&&!Ee.endsWithParent&&(Ee.end=/\B|\b/),Ee.end&&(Ie.endRe=he(Ie.end)),Ie.terminatorEnd=f(Ie.end)||"",Ee.endsWithParent&&Ce.terminatorEnd&&(Ie.terminatorEnd+=(Ee.end?"|":"")+Ce.terminatorEnd)),Ee.illegal&&(Ie.illegalRe=he(Ee.illegal)),Ee.contains||(Ee.contains=[]),Ee.contains=[].concat(...Ee.contains.map(function(Qe){return Yt(Qe==="self"?Ee:Qe)})),Ee.contains.forEach(function(Qe){ht(Qe,Ie)}),Ee.starts&&ht(Ee.starts,Ce),Ie.matcher=St(Ie),Ie}if(X.compilerExtensions||(X.compilerExtensions=[]),X.contains&&X.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return X.classNameAliases=o(X.classNameAliases||{}),ht(X)}function Kt(X){return X?X.endsWithParent||Kt(X.starts):!1}function Yt(X){return X.variants&&!X.cachedVariants&&(X.cachedVariants=X.variants.map(function(he){return o(X,{variants:null},he)})),X.cachedVariants?X.cachedVariants:Kt(X)?o(X,{starts:X.starts?o(X.starts):null}):Object.isFrozen(X)?o(X):X}var zt="11.11.1";class us extends Error{constructor(he,ve){super(he),this.name="HTMLInjectionError",this.html=ve}}const er=s,Ps=o,Rn=Symbol("nomatch"),Pn=7,tr=function(X){const he=Object.create(null),ve=Object.create(null),Ne=[];let St=!0;const ht="Could not find the language '{}', did you forget to load/include a language module?",Ee={disableAutodetect:!0,name:"Plain text",contains:[]};let Ce={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:v};function Ie(ge){return Ce.noHighlightRe.test(ge)}function Bt(ge){let Le=ge.className+" ";Le+=ge.parentNode?ge.parentNode.className:"";const De=Ce.languageDetectRe.exec(Le);if(De){const rt=q(De[1]);return rt||(Gt(ht.replace("{}",De[1])),Gt("Falling back to no-highlight mode for this block.",ge)),rt?De[1]:"no-highlight"}return Le.split(/\s+/).find(rt=>Ie(rt)||q(rt))}function Qe(ge,Le,De){let rt="",Mt="";typeof Le=="object"?(rt=ge,De=Le.ignoreIllegals,Mt=Le.language):(It("10.7.0","highlight(lang, code, ...args) has been deprecated."),It("10.7.0",`Please use highlight(code, options) instead.
199
+ https://github.com/highlightjs/highlight.js/issues/2277`),Mt=ge,rt=Le),De===void 0&&(De=!0);const Ai={code:rt,language:Mt};$t("before:highlight",Ai);const Zi=Ai.result?Ai.result:vi(Ai.language,Ai.code,De);return Zi.code=Ai.code,$t("after:highlight",Zi),Zi}function vi(ge,Le,De,rt){const Mt=Object.create(null);function Ai(ye,Ae){return ye.keywords[Ae]}function Zi(){if(!$e.keywords){ii.addText(dt);return}let ye=0;$e.keywordPatternRe.lastIndex=0;let Ae=$e.keywordPatternRe.exec(dt),Fe="";for(;Ae;){Fe+=dt.substring(ye,Ae.index);const Je=bi.case_insensitive?Ae[0].toLowerCase():Ae[0],Nt=Ai($e,Je);if(Nt){const[hn,qa]=Nt;if(ii.addText(Fe),Fe="",Mt[Je]=(Mt[Je]||0)+1,Mt[Je]<=Pn&&(Dr+=qa),hn.startsWith("_"))Fe+=Ae[0];else{const dl=bi.classNameAliases[hn]||hn;Qi(Ae[0],dl)}}else Fe+=Ae[0];ye=$e.keywordPatternRe.lastIndex,Ae=$e.keywordPatternRe.exec(dt)}Fe+=dt.substring(ye),ii.addText(Fe)}function zi(){if(dt==="")return;let ye=null;if(typeof $e.subLanguage=="string"){if(!he[$e.subLanguage]){ii.addText(dt);return}ye=vi($e.subLanguage,dt,!0,hl[$e.subLanguage]),hl[$e.subLanguage]=ye._top}else ye=nr(dt,$e.subLanguage.length?$e.subLanguage:null);$e.relevance>0&&(Dr+=ye.relevance),ii.__addSublanguage(ye._emitter,ye.language)}function Et(){$e.subLanguage!=null?zi():Zi(),dt=""}function Qi(ye,Ae){ye!==""&&(ii.startScope(Ae),ii.addText(ye),ii.endScope())}function cl(ye,Ae){let Fe=1;const Je=Ae.length-1;for(;Fe<=Je;){if(!ye._emit[Fe]){Fe++;continue}const Nt=bi.classNameAliases[ye[Fe]]||ye[Fe],hn=Ae[Fe];Nt?Qi(hn,Nt):(dt=hn,Zi(),dt=""),Fe++}}function Fs(ye,Ae){return ye.scope&&typeof ye.scope=="string"&&ii.openNode(bi.classNameAliases[ye.scope]||ye.scope),ye.beginScope&&(ye.beginScope._wrap?(Qi(dt,bi.classNameAliases[ye.beginScope._wrap]||ye.beginScope._wrap),dt=""):ye.beginScope._multi&&(cl(ye.beginScope,Ae),dt="")),$e=Object.create(ye,{parent:{value:$e}}),$e}function Pa(ye,Ae,Fe){let Je=m(ye.endRe,Fe);if(Je){if(ye["on:end"]){const Nt=new n(ye);ye["on:end"](Ae,Nt),Nt.isMatchIgnored&&(Je=!1)}if(Je){for(;ye.endsParent&&ye.parent;)ye=ye.parent;return ye}}if(ye.endsWithParent)return Pa(ye.parent,Ae,Fe)}function qs(ye){return $e.matcher.regexIndex===0?(dt+=ye[0],1):(Or=!0,0)}function du(ye){const Ae=ye[0],Fe=ye.rule,Je=new n(Fe),Nt=[Fe.__beforeBegin,Fe["on:begin"]];for(const hn of Nt)if(hn&&(hn(ye,Je),Je.isMatchIgnored))return qs(Ae);return Fe.skip?dt+=Ae:(Fe.excludeBegin&&(dt+=Ae),Et(),!Fe.returnBegin&&!Fe.excludeBegin&&(dt=Ae)),Fs(Fe,ye),Fe.returnBegin?0:Ae.length}function $i(ye){const Ae=ye[0],Fe=Le.substring(ye.index),Je=Pa($e,ye,Fe);if(!Je)return Rn;const Nt=$e;$e.endScope&&$e.endScope._wrap?(Et(),Qi(Ae,$e.endScope._wrap)):$e.endScope&&$e.endScope._multi?(Et(),cl($e.endScope,ye)):Nt.skip?dt+=Ae:(Nt.returnEnd||Nt.excludeEnd||(dt+=Ae),Et(),Nt.excludeEnd&&(dt=Ae));do $e.scope&&ii.closeNode(),!$e.skip&&!$e.subLanguage&&(Dr+=$e.relevance),$e=$e.parent;while($e!==Je.parent);return Je.starts&&Fs(Je.starts,ye),Nt.returnEnd?0:Ae.length}function ja(){const ye=[];for(let Ae=$e;Ae!==bi;Ae=Ae.parent)Ae.scope&&ye.unshift(Ae.scope);ye.forEach(Ae=>ii.openNode(Ae))}let ds={};function Ws(ye,Ae){const Fe=Ae&&Ae[0];if(dt+=ye,Fe==null)return Et(),0;if(ds.type==="begin"&&Ae.type==="end"&&ds.index===Ae.index&&Fe===""){if(dt+=Le.slice(Ae.index,Ae.index+1),!St){const Je=new Error(`0 width match regex (${ge})`);throw Je.languageName=ge,Je.badRule=ds.rule,Je}return 1}if(ds=Ae,Ae.type==="begin")return du(Ae);if(Ae.type==="illegal"&&!De){const Je=new Error('Illegal lexeme "'+Fe+'" for mode "'+($e.scope||"<unnamed>")+'"');throw Je.mode=$e,Je}else if(Ae.type==="end"){const Je=$i(Ae);if(Je!==Rn)return Je}if(Ae.type==="illegal"&&Fe==="")return dt+=`
200
+ `,1;if(Fa>1e5&&Fa>Ae.index*3)throw new Error("potential infinite loop, way more iterations than matches");return dt+=Fe,Fe.length}const bi=q(ge);if(!bi)throw lt(ht.replace("{}",ge)),new Error('Unknown language: "'+ge+'"');const ul=Ii(bi);let Gs="",$e=rt||ul;const hl={},ii=new Ce.__emitter(Ce);ja();let dt="",Dr=0,sr=0,Fa=0,Or=!1;try{if(bi.__emitTokens)bi.__emitTokens(Le,ii);else{for($e.matcher.considerAll();;){Fa++,Or?Or=!1:$e.matcher.considerAll(),$e.matcher.lastIndex=sr;const ye=$e.matcher.exec(Le);if(!ye)break;const Ae=Le.substring(sr,ye.index),Fe=Ws(Ae,ye);sr=ye.index+Fe}Ws(Le.substring(sr))}return ii.finalize(),Gs=ii.toHTML(),{language:ge,value:Gs,relevance:Dr,illegal:!1,_emitter:ii,_top:$e}}catch(ye){if(ye.message&&ye.message.includes("Illegal"))return{language:ge,value:er(Le),illegal:!0,relevance:0,_illegalBy:{message:ye.message,index:sr,context:Le.slice(sr-100,sr+100),mode:ye.mode,resultSoFar:Gs},_emitter:ii};if(St)return{language:ge,value:er(Le),illegal:!1,relevance:0,errorRaised:ye,_emitter:ii,_top:$e};throw ye}}function ir(ge){const Le={value:er(ge),illegal:!1,relevance:0,_top:Ee,_emitter:new Ce.__emitter(Ce)};return Le._emitter.addText(ge),Le}function nr(ge,Le){Le=Le||Ce.languages||Object.keys(he);const De=ir(ge),rt=Le.filter(q).filter(we).map(Et=>vi(Et,ge,!1));rt.unshift(De);const Mt=rt.sort((Et,Qi)=>{if(Et.relevance!==Qi.relevance)return Qi.relevance-Et.relevance;if(Et.language&&Qi.language){if(q(Et.language).supersetOf===Qi.language)return 1;if(q(Qi.language).supersetOf===Et.language)return-1}return 0}),[Ai,Zi]=Mt,zi=Ai;return zi.secondBest=Zi,zi}function Hi(ge,Le,De){const rt=Le&&ve[Le]||De;ge.classList.add("hljs"),ge.classList.add(`language-${rt}`)}function xt(ge){let Le=null;const De=Bt(ge);if(Ie(De))return;if($t("before:highlightElement",{el:ge,language:De}),ge.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ge);return}if(ge.children.length>0&&(Ce.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ge)),Ce.throwUnescapedHTML))throw new us("One of your code blocks includes unescaped HTML.",ge.innerHTML);Le=ge;const rt=Le.textContent,Mt=De?Qe(rt,{language:De,ignoreIllegals:!0}):nr(rt);ge.innerHTML=Mt.value,ge.dataset.highlighted="yes",Hi(ge,De,Mt.language),ge.result={language:Mt.language,re:Mt.relevance,relevance:Mt.relevance},Mt.secondBest&&(ge.secondBest={language:Mt.secondBest.language,relevance:Mt.secondBest.relevance}),$t("after:highlightElement",{el:ge,result:Mt,text:rt})}function wt(ge){Ce=Ps(Ce,ge)}const Ln=()=>{rr(),It("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Mr(){rr(),It("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let js=!1;function rr(){function ge(){rr()}if(document.readyState==="loading"){js||window.addEventListener("DOMContentLoaded",ge,!1),js=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(xt)}function hs(ge,Le){let De=null;try{De=Le(X)}catch(rt){if(lt("Language definition for '{}' could not be registered.".replace("{}",ge)),St)lt(rt);else throw rt;De=Ee}De.name||(De.name=ge),he[ge]=De,De.rawDefinition=Le.bind(null,X),De.aliases&&_e(De.aliases,{languageName:ge})}function jn(ge){delete he[ge];for(const Le of Object.keys(ve))ve[Le]===ge&&delete ve[Le]}function Me(){return Object.keys(he)}function q(ge){return ge=(ge||"").toLowerCase(),he[ge]||he[ve[ge]]}function _e(ge,{languageName:Le}){typeof ge=="string"&&(ge=[ge]),ge.forEach(De=>{ve[De.toLowerCase()]=Le})}function we(ge){const Le=q(ge);return Le&&!Le.disableAutodetect}function it(ge){ge["before:highlightBlock"]&&!ge["before:highlightElement"]&&(ge["before:highlightElement"]=Le=>{ge["before:highlightBlock"](Object.assign({block:Le.el},Le))}),ge["after:highlightBlock"]&&!ge["after:highlightElement"]&&(ge["after:highlightElement"]=Le=>{ge["after:highlightBlock"](Object.assign({block:Le.el},Le))})}function Ye(ge){it(ge),Ne.push(ge)}function Tt(ge){const Le=Ne.indexOf(ge);Le!==-1&&Ne.splice(Le,1)}function $t(ge,Le){const De=ge;Ne.forEach(function(rt){rt[De]&&rt[De](Le)})}function Ut(ge){return It("10.7.0","highlightBlock will be removed entirely in v12.0"),It("10.7.0","Please use highlightElement now."),xt(ge)}Object.assign(X,{highlight:Qe,highlightAuto:nr,highlightAll:rr,highlightElement:xt,highlightBlock:Ut,configure:wt,initHighlighting:Ln,initHighlightingOnLoad:Mr,registerLanguage:hs,unregisterLanguage:jn,listLanguages:Me,getLanguage:q,registerAliases:_e,autoDetection:we,inherit:Ps,addPlugin:Ye,removePlugin:Tt}),X.debugMode=function(){St=!1},X.safeMode=function(){St=!0},X.versionString=zt,X.regex={concat:w,lookahead:C,either:S,optional:A,anyNumberOfTimes:x};for(const ge in pe)typeof pe[ge]=="object"&&i(pe[ge]);return Object.assign(X,pe),X},ti=tr({});return ti.newInstance=()=>tr({}),Wd=ti,ti.HighlightJS=ti,ti.default=ti,Wd}var FT=jT();const Sn=z1(FT);function o0(i){const n=i.regex,s={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[s]}]};Object.assign(s,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[i.BACKSLASH_ESCAPE]},y=i.inherit(i.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),b={begin:/<<-?\s*(?=\w+)/,starts:{contains:[i.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[i.BACKSLASH_ESCAPE,s,l]};l.contains.push(c);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},v={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},i.NUMBER_MODE,s]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=i.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),A={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[i.inherit(i.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],_=["true","false"],S={match:/(\/[a-z._-]+)+/},p=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],m=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],E=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],R=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:w,literal:_,built_in:[...p,...m,"set","shopt",...E,...R]},contains:[x,i.SHEBANG(),A,f,y,b,S,c,u,h,v,s]}}const l0="[A-Za-z$_][0-9A-Za-z$_]*",qT=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],WT=["true","false","null","undefined","NaN","Infinity"],vS=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],bS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],SS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],GT=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],KT=[].concat(SS,vS,bS);function c0(i){const n=i.regex,s=(K,{after:O})=>{const H="</"+K[0].slice(1);return K.input.indexOf(H,O)!==-1},o=l0,l={begin:"<>",end:"</>"},y=/<[A-Za-z0-9\\._:-]+\s*\/>/,b={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,O)=>{const H=K[0].length+K.index,M=K.input[H];if(M==="<"||M===","){O.ignoreMatch();return}M===">"&&(s(K,{after:H})||O.ignoreMatch());let U;const V=K.input.substring(H);if(U=V.match(/^\s*=/)){O.ignoreMatch();return}if((U=V.match(/^\s+extends\s+/))&&U.index===0){O.ignoreMatch();return}}},c={$pattern:l0,keyword:qT,literal:WT,built_in:KT,"variable.language":GT},u="[0-9](_?[0-9])*",h=`\\.(${u})`,v="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${v})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${v})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,C],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[i.BACKSLASH_ESCAPE,C]},p={className:"comment",variants:[i.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),i.C_BLOCK_COMMENT_MODE,i.C_LINE_COMMENT_MODE]},m=[i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,x,A,w,_,{match:/\$\d+/},f];C.contains=m.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(m)});const E=[].concat(p,C.contains),R=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(E)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},D={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,n.concat(o,"(",n.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...vS,...bS]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(K){return n.concat("(?!",K.join("|"),")")}const I={match:n.concat(/\b/,F([...SS,"super","import"].map(K=>`${K}\\s*\\(`)),o,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Z={begin:n.concat(/\./,n.lookahead(n.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ee={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+i.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[i.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,x,A,w,_,p,{match:/\$\d+/},f,T,{scope:"attr",match:o+n.lookahead(":"),relevance:0},Y,{begin:"("+i.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,i.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:i.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:y},{begin:b.begin,"on:begin":b.isTrulyOpeningTag,end:b.end}],subLanguage:"xml",contains:[{begin:b.begin,end:b.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,i.inherit(i.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},I,P,D,ee,{match:/\$[(.]/}]}}function YT(i){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},s={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],l={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:o},contains:[n,s,i.QUOTE_STRING_MODE,l,i.C_NUMBER_MODE,i.C_LINE_COMMENT_MODE,i.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function u0(i){const n=i.regex,s={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},y={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},b={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},v={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=i.inherit(h,{contains:[]}),C=i.inherit(v,{contains:[]});h.contains.push(C),v.contains.push(f);let x=[s,u];return[h,v,f,C].forEach(S=>{S.contains=S.contains.concat(x)}),x=x.concat(h,v),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},s,y,h,v,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},l,o,u,b,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function h0(i){const n=i.regex,s=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},v={begin:/\{\{/,relevance:0},f={className:"string",contains:[i.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[i.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[i.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[i.BACKSLASH_ESCAPE,u,v,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[i.BACKSLASH_ESCAPE,u,v,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[i.BACKSLASH_ESCAPE,v,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[i.BACKSLASH_ESCAPE,v,h]},i.APOS_STRING_MODE,i.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",x=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,A=`\\b|${o.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${x}))[eE][+-]?(${C})[jJ]?(?=${A})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${A})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${A})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${A})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${A})`},{begin:`\\b(${C})[jJ](?=${A})`}]},_={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,w,f,i.HASH_COMMENT_MODE]}]};return h.contains=[f,w,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,_,i.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,s],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,s,/\s*/,/\(\s*/,s,/\s*\)/]},{match:[/\bclass/,/\s+/,s]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,S,f]}]}}const Jc="[A-Za-z$_][0-9A-Za-z$_]*",yS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],CS=["true","false","null","undefined","NaN","Infinity"],wS=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ES=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],TS=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],AS=[].concat(xS,wS,ES);function VT(i){const n=i.regex,s=(K,{after:O})=>{const H="</"+K[0].slice(1);return K.input.indexOf(H,O)!==-1},o=Jc,l={begin:"<>",end:"</>"},y=/<[A-Za-z0-9\\._:-]+\s*\/>/,b={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,O)=>{const H=K[0].length+K.index,M=K.input[H];if(M==="<"||M===","){O.ignoreMatch();return}M===">"&&(s(K,{after:H})||O.ignoreMatch());let U;const V=K.input.substring(H);if(U=V.match(/^\s*=/)){O.ignoreMatch();return}if((U=V.match(/^\s+extends\s+/))&&U.index===0){O.ignoreMatch();return}}},c={$pattern:Jc,keyword:yS,literal:CS,built_in:AS,"variable.language":TS},u="[0-9](_?[0-9])*",h=`\\.(${u})`,v="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${v})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${v})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,C],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[i.BACKSLASH_ESCAPE,C]},p={className:"comment",variants:[i.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),i.C_BLOCK_COMMENT_MODE,i.C_LINE_COMMENT_MODE]},m=[i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,x,A,w,_,{match:/\$\d+/},f];C.contains=m.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(m)});const E=[].concat(p,C.contains),R=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(E)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},D={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,n.concat(o,"(",n.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...wS,...ES]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(K){return n.concat("(?!",K.join("|"),")")}const I={match:n.concat(/\b/,F([...xS,"super","import"].map(K=>`${K}\\s*\\(`)),o,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Z={begin:n.concat(/\./,n.lookahead(n.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ee={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+i.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[i.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,x,A,w,_,p,{match:/\$\d+/},f,T,{scope:"attr",match:o+n.lookahead(":"),relevance:0},Y,{begin:"("+i.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,i.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:i.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:y},{begin:b.begin,"on:begin":b.isTrulyOpeningTag,end:b.end}],subLanguage:"xml",contains:[{begin:b.begin,end:b.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,i.inherit(i.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},I,P,D,ee,{match:/\$[(.]/}]}}function d0(i){const n=i.regex,s=VT(i),o=Jc,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],y={begin:[/namespace/,/\s+/,i.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},b={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[s.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Jc,keyword:yS.concat(u),literal:CS,built_in:AS.concat(l),"variable.language":TS},v={className:"meta",begin:"@"+o},f=(w,_,S)=>{const p=w.contains.findIndex(m=>m.label===_);if(p===-1)throw new Error("can not find mode to replace");w.contains.splice(p,1,S)};Object.assign(s.keywords,h),s.exports.PARAMS_CONTAINS.push(v);const C=s.contains.find(w=>w.scope==="attr"),x=Object.assign({},C,{match:n.concat(o,n.lookahead(/\s*\?:/))});s.exports.PARAMS_CONTAINS.push([s.exports.CLASS_REFERENCE,C,x]),s.contains=s.contains.concat([v,y,b,x]),f(s,"shebang",i.SHEBANG()),f(s,"use_strict",c);const A=s.contains.find(w=>w.label==="func.def");return A.relevance=0,Object.assign(s,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),s}const XT=/\[\[wiki:([^\]]+)\]\]/g,ZT=new fS({gfm:!0,breaks:!1}),f0={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},Gd=oA();function $a(i){const n=eA(i),s=ZT.parse(n,{async:!1}),o=el.sanitize(s,f0),l=new DOMParser().parseFromString(o,"text/html");return tA(l),iA(l),rA(l),{html:el.sanitize(l.body.innerHTML,f0),toc:sA(l)}}function QT(i){const n=new TextEncoder().encode(i);let s="";for(const o of n)s+=String.fromCharCode(o);return btoa(s)}function JT(i){const n=atob(i),s=new Uint8Array(n.length);for(let o=0;o<n.length;o++)s[o]=n.charCodeAt(o);return new TextDecoder().decode(s)}function eA(i){return i.replace(XT,(n,s)=>{const o=s.trim();if(!o)return"";const l=Te(o),y=encodeURIComponent(o);return`<a href="${kr(o)}" data-entry-id="${y}">${l}</a>`})}function tA(i){const n=new Map;for(const s of i.querySelectorAll("h2, h3")){const o=s.textContent?.trim()??"",l=uA(o||"section"),y=n.get(l)??0;n.set(l,y+1),s.id=y===0?l:`${l}-${y+1}`}}function iA(i){for(const n of i.querySelectorAll("pre > code")){const s=lA(n.className),o=n.textContent??"",l=n.parentElement;if(!l)continue;if(s==="mermaid"){const b=i.createElement("div");b.className="diagram-block",b.setAttribute("data-mermaid-source",QT(o)),b.setAttribute("data-diagram-state","pending"),l.replaceWith(b);continue}const y=aA(o,s);n.innerHTML=y,n.classList.add("hljs"),l.classList.add("code-block"),l.dataset.code=o,l.insertBefore(nA(i,s||"text"),l.firstChild)}}function nA(i,n){const s=i.createElement("div");s.className="code-block-toolbar";const o=i.createElement("span");o.className="code-block-dots",o.setAttribute("aria-hidden","true");for(let b=0;b<3;b++)o.append(i.createElement("span"));const l=i.createElement("span");l.className="code-block-language",l.textContent=n;const y=i.createElement("button");return y.className="copy-code",y.type="button",y.dataset.action="copy-code",y.textContent="복사",s.append(o,l,y),s}function rA(i){for(const n of i.querySelectorAll("a")){const s=n.getAttribute("href")??"";cA(s)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function sA(i){return[...i.querySelectorAll("h2, h3")].map(n=>({id:n.id,text:n.textContent?.trim()??n.id,level:n.tagName.toLowerCase()==="h2"?2:3}))}function aA(i,n){return n&&Gd.getLanguage(n)?Gd.highlight(i,{language:n}).value:Gd.highlightAuto(i).value}function oA(){return Sn.registerLanguage("bash",o0),Sn.registerLanguage("sh",o0),Sn.registerLanguage("javascript",c0),Sn.registerLanguage("js",c0),Sn.registerLanguage("json",YT),Sn.registerLanguage("markdown",u0),Sn.registerLanguage("md",u0),Sn.registerLanguage("python",h0),Sn.registerLanguage("py",h0),Sn.registerLanguage("typescript",d0),Sn.registerLanguage("ts",d0),Sn}function lA(i){return i.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function cA(i){return/^[a-z][a-z0-9+.-]*:/i.test(i)&&!i.startsWith(window.location.origin)}function uA(i){return i.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function hA(i){return`
201
+ <article class="document">
202
+ <header class="document-header">
203
+ <p class="eyebrow">MANIFEST · DRYDOCK</p>
204
+ <h1>Conflicts</h1>
205
+ </header>
206
+ ${i.length>0?`
207
+ <ul class="conflict-list">
208
+ ${i.map(n=>`
209
+ <li>
210
+ <a class="conflict-list-item" href="${J5(n.id)}">
211
+ <span class="conflict-list-copy">
212
+ <strong>${Te(n.title)}</strong>
213
+ <small>${Te(n.id)}</small>
214
+ </span>
215
+ <span class="chip ${n.status==="open"?"chip-coral":"chip"}">${Te(n.status)}</span>
216
+ </a>
217
+ </li>
218
+ `).join("")}
219
+ </ul>
220
+ `:'<p class="empty-state">No conflicts to display.</p>'}
221
+ </article>
222
+ `}function dA(i){const n=[Kd("Current",i.current),Kd("Proposed",i.proposed),Kd("Raw Source",i.rawSource)].filter(Boolean).join("");return`
223
+ <article class="document">
224
+ <header class="document-header">
225
+ <p class="eyebrow">MANIFEST · DRYDOCK</p>
226
+ <h1>${Te(i.id)}</h1>
227
+ <div class="meta-chips">
228
+ <span class="chip chip-coral">${Te(String(i.meta.status??"unknown"))}</span>
229
+ </div>
230
+ </header>
231
+ <section class="conflict-meta-card">
232
+ <pre>${Te(JSON.stringify(i.meta,null,2))}</pre>
233
+ </section>
234
+ ${n||'<p class="empty-state">No conflicts to display.</p>'}
235
+ </article>
236
+ `}function Kd(i,n){if(!n)return"";const s=$a(n);return`
237
+ <section class="conflict-section">
238
+ <h2>${Te(i)}</h2>
239
+ <div class="markdown-body">${s.html}</div>
240
+ </section>
241
+ `}function fA(i){return`
242
+ <article class="document">
243
+ <header class="document-header">
244
+ <p class="eyebrow">MANIFEST · CODEX</p>
245
+ <h1>Index</h1>
246
+ </header>
247
+ <div class="markdown-body">${$a(i).html}</div>
248
+ </article>
249
+ `}function yf(i,n){try{return new Date(i).toLocaleString(n??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return i}}function eu(i){const n=Date.now()-new Date(i).getTime(),s=Math.floor(n/6e4);if(s<1)return"just now";if(s<60)return`${s} min ago`;const o=Math.floor(s/60);if(o<24)return`${o} hr ago`;const l=Math.floor(o/24);return l<30?`${l} days ago`:`${Math.floor(l/30)} months ago`}const _A=`
250
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
251
+ <path d="M7 17 17 7M9 7h8v8" />
252
+ </svg>
253
+ `;function pA(i,n,s){if(!i)return"";const{frontmatter:o}=i,l=yf(o.created),y=eu(o.created),b=yf(o.updated),c=eu(o.updated),u=B5(i,n,s),h=o.tags.length>0?`<div class="queue-card-chips">${o.tags.map(f=>`<span class="chip chip-muted">${Te(f)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',v=o.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Ze(Gb(o.rawSourceRef))}" data-raw-ref="${Ze(o.rawSourceRef)}">
254
+ <span class="manifest-ref">${Te(o.rawSourceRef)}</span>
255
+ <span class="manifest-arrow" aria-hidden="true">${_A}</span>
256
+ </a>`:'<span class="queue-dl-muted">None</span>';return`
257
+ <aside class="manifest-card">
258
+ <div class="manifest-header">
259
+ <div class="manifest-titles">
260
+ <p class="drydock-eyebrow">MANIFEST · CODEX</p>
261
+ <p class="manifest-subtitle">Document Manifest</p>
262
+ </div>
263
+ </div>
264
+ <dl class="queue-dl">
265
+ <dt class="queue-dl-key">Created</dt>
266
+ <dd class="queue-dl-value queue-dl-time">
267
+ <time datetime="${Ze(o.created)}" title="${Ze(l)}">
268
+ ${Te(l)}
269
+ <span class="queue-dl-relative">(${Te(y)})</span>
270
+ </time>
271
+ </dd>
272
+ <dt class="queue-dl-key">Updated</dt>
273
+ <dd class="queue-dl-value queue-dl-time">
274
+ <time datetime="${Ze(o.updated)}" title="${Ze(b)}">
275
+ ${Te(b)}
276
+ <span class="queue-dl-relative">(${Te(c)})</span>
277
+ </time>
278
+ </dd>
279
+ <dt class="queue-dl-key">Version</dt>
280
+ <dd class="queue-dl-value queue-dl-mono">v${o.version}</dd>
281
+ <dt class="queue-dl-key">Tags</dt>
282
+ <dd class="queue-dl-value">${h}</dd>
283
+ <dt class="queue-dl-key">Source</dt>
284
+ <dd class="queue-dl-value">${v}</dd>
285
+ </dl>
286
+ ${u?`<div class="manifest-actions">${u}</div>`:""}
287
+ </aside>
288
+ `}const gA="modulepreload",mA=function(i){return"/console/"+i},_0={},vA=function(n,s,o){let l=Promise.resolve();if(s&&s.length>0){let u=function(h){return Promise.all(h.map(v=>Promise.resolve(v).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const b=document.querySelector("meta[property=csp-nonce]"),c=b?.nonce||b?.getAttribute("nonce");l=u(s.map(h=>{if(h=mA(h),h in _0)return;_0[h]=!0;const v=h.endsWith(".css"),f=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${f}`))return;const C=document.createElement("link");if(C.rel=v?"stylesheet":gA,v||(C.as="script"),C.crossOrigin="",C.href=h,c&&C.setAttribute("nonce",c),document.head.appendChild(C),v)return new Promise((x,A)=>{C.addEventListener("load",x),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function y(b){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=b,window.dispatchEvent(c),!c.defaultPrevented)throw b}return l.then(b=>{for(const c of b||[])c.status==="rejected"&&y(c.reason);return n().catch(y)})},bA=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",SA=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),yA=/^on/i,CA={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},p0="diagramInteractionBound",wA=/^oklch\s*\(\s*([^)]+)\s*\)$/i,EA=/^(-?\d+(?:\.\d+)?)(deg)?$/i,wn=[25,50,75,100,125,150,200,300,400],xA=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let Yd=null,g0=!1,TA=0,AA=0,nl=null;function ls(i){const n=i.trim();if(!n)return n;const s=XA(n);return s?ZA(s):n}function RA(i){if(g0)return;g0=!0,m0(i);const n=i instanceof Node?i:document.body;new MutationObserver(o=>{let l=!1;for(const y of o)if(y.type==="childList"){nl&&!nl.trigger.isConnected&&Xo(!1);for(const b of y.addedNodes)if(b instanceof Element&&(b.matches?.(".diagram-block[data-mermaid-source]")||b.querySelector?.(".diagram-block[data-mermaid-source]"))){l=!0;break}if(l)break}l&&m0(i)}).observe(n,{childList:!0,subtree:!0})}function m0(i){const n=i.querySelectorAll(bA);for(const s of n)s.dataset.diagramHydrating!=="true"&&(s.dataset.diagramHydrating="true",s.dataset.diagramState="pending",LA(s))}async function LA(i){const n=i.getAttribute("data-mermaid-source")??"";let s="";try{s=JT(n)}catch{Vd(i,"Invalid diagram source");return}if(!s.trim()){Vd(i,"Empty diagram source");return}try{const o=await MA(),l=`mermaid-diagram-${++TA}`,{svg:y}=await o.render(l,s);i.innerHTML=kA(y),BA(i,y),NA(i),IA(i),i.dataset.diagramState="rendered"}catch(o){const l=o instanceof Error?o.message:String(o);Vd(i,l)}}function Vd(i,n){i.dataset.diagramState="error",i.textContent=`Diagram render failed: ${n}`}function kA(i){const n=(s,o)=>{yA.test(o.attrName)&&(o.keepAttr=!1)};el.addHook("uponSanitizeAttribute",n);try{return el.sanitize(i,CA)}finally{el.removeHook("uponSanitizeAttribute",n)}}async function MA(){return Yd||(Yd=(async()=>{const i=await vA(()=>import("./mermaid.core-CwFfQIZ3.js").then(s=>s.bC),[]),n=i.default??i;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:DA(),themeCSS:OA(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),Yd}function DA(){const i=getComputedStyle(document.documentElement),n=(A,w)=>{const _=i.getPropertyValue(A).trim();return ls(_||w)},s=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),l=n("--brass-deep","#a0782a"),y=n("--aurora","#8bd7e6"),b=n("--aurora-deep","#1f8aa8"),c=n("--coral","#ef7c63"),u=n("--ink-deep","#1d2734"),h=n("--ink-fog","#a6afbb"),v=n("--ink-pearl","#e6e9ef"),f=n("--ink-spectral","#bcc4d0"),C=[o,s,y,c,ls("oklch(70% 0.11 68)"),b,ls("oklch(76% 0.09 205)"),l,ls("oklch(68% 0.14 30)"),h,ls("oklch(62% 0.08 228)"),ls("oklch(52% 0.05 248)")],x=Object.fromEntries(xA.map((A,w)=>[A,C[w]??u]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:v,primaryBorderColor:s,secondaryColor:"transparent",secondaryTextColor:v,secondaryBorderColor:o,tertiaryColor:"transparent",tertiaryTextColor:f,tertiaryBorderColor:s,lineColor:b,edgeLabelBackground:"transparent",titleColor:o,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:s,clusterBkg:"transparent",clusterBorder:s,pieTitleTextColor:o,pieTitleTextSize:"19px",pieSectionTextColor:v,pieSectionTextSize:"13px",pieLegendTextColor:v,pieLegendTextSize:"14px",pieStrokeColor:l,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...x}}function OA(){const i=getComputedStyle(document.documentElement),n=(h,v)=>{const f=i.getPropertyValue(h).trim();return ls(f||v)},s=n("--brass-deep","#a0782a"),o=n("--brass-bright","#e6b86a"),l=n("--aurora-deep","#1f8aa8"),y=n("--ink-abyss","#131920"),b=ls("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),u=n("--ink-pearl","#e6e9ef");return`
289
+ .node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
290
+ stroke: ${s};
291
+ fill: ${c};
292
+ }
293
+ .edgePath path, .messageLine0, .messageLine1, .relation {
294
+ stroke: ${l};
295
+ }
296
+ .nodeLabel, .edgeLabel, .actor text, .messageText {
297
+ fill: ${u};
298
+ font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
299
+ }
300
+ .pieCircle {
301
+ stroke: ${s};
302
+ stroke-width: 1.35px;
303
+ opacity: 0.96;
304
+ filter: drop-shadow(0 0 1.5px ${b});
305
+ }
306
+ .pieOuterCircle {
307
+ stroke: ${o};
308
+ opacity: 0.7;
309
+ }
310
+ .slice, .legend text, .pieTitleText {
311
+ fill: ${u};
312
+ paint-order: stroke;
313
+ stroke: ${y};
314
+ stroke-width: 3px;
315
+ stroke-linejoin: round;
316
+ font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
317
+ }
318
+ .slice {
319
+ font-weight: 600;
320
+ letter-spacing: 0.04em;
321
+ font-style: italic;
322
+ }
323
+ .pieTitleText {
324
+ font-weight: 600;
325
+ letter-spacing: 0.12em;
326
+ font-style: italic;
327
+ }
328
+ .legend text {
329
+ font-weight: 500;
330
+ letter-spacing: 0.03em;
331
+ }
332
+ .legend rect {
333
+ rx: 999px;
334
+ ry: 999px;
335
+ opacity: 0.9;
336
+ stroke: ${y};
337
+ stroke-width: 1.5px;
338
+ paint-order: stroke;
339
+ filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${o});
340
+ }
341
+ `}function BA(i,n){const s=new DOMParser().parseFromString(n,"image/svg+xml"),o=Array.from(s.querySelectorAll("a")),l=Array.from(i.querySelectorAll("a")),y=Math.min(o.length,l.length);for(let b=0;b<y;b++){const c=o[b],u=l[b];if(!c||!u)continue;const h=c.getAttribute("href")??c.getAttribute("xlink:href")??"",v=LS(h);v&&u.setAttribute("href",v)}}function NA(i){const n=i.querySelector("svg");if(!n)return;let s;try{s=n.getBBox()}catch{return}const{x:o,y:l,width:y,height:b}=s;!Number.isFinite(o)||!Number.isFinite(l)||!Number.isFinite(y)||!Number.isFinite(b)||o<0||l<0||y<=0||b<=0||n.setAttribute("viewBox",`${Ma(o)} ${Ma(l)} ${Ma(y)} ${Ma(b)}`)}function IA(i){i.tabIndex=0,i.setAttribute("aria-label","Open diagram in expanded view"),KA(i),i.dataset[p0]!=="true"&&(i.dataset[p0]="true",i.addEventListener("click",HA),i.addEventListener("keydown",zA))}function HA(i){if(i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||i.button!==0||tu(i.target))return;const n=i.currentTarget;n instanceof HTMLElement&&(i.preventDefault(),RS(n))}function zA(i){if(i.key!=="Enter"&&i.key!==" "||tu(i.target))return;const n=i.currentTarget;n instanceof HTMLElement&&(i.preventDefault(),RS(n))}function RS(i){const n=i.querySelector("svg");if(!n)return;Xo(!1);const s=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",o=document.createElement(s?"dialog":"div"),l=++AA,y=`diagram-lightbox-title-${l}`;o.className="diagram-lightbox",o.setAttribute("aria-labelledby",y),s||(o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.tabIndex=-1);const b=document.createElement("div");b.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const u=document.createElement("h2");u.id=y,u.textContent="MANIFEST · DIAGRAM";const h=document.createElement("button");h.className="diagram-lightbox__close",h.type="button",h.setAttribute("aria-label","Close expanded diagram"),h.textContent="Close";const v=document.createElement("div");v.className="diagram-lightbox__controls",v.setAttribute("aria-label","Diagram zoom controls");const f=kc("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const x=kc("+","Zoom in","in"),A=kc("Fit","Fit diagram to viewport","fit"),w=kc("Reset","Reset diagram zoom","reset");v.append(f,C,x,A,w);const _=document.createElement("div");_.className="diagram-lightbox__viewport";const S=PA(n),p=n.cloneNode(!0);p.removeAttribute("style"),FA(p,`diagram-lightbox-svg-${l}`),_.append(p),c.append(u,v,h),b.append(c,_),o.append(b),document.body.append(o);const m=new $A(_,p,C,S);f.addEventListener("click",()=>m.zoomOut()),x.addEventListener("click",()=>m.zoomIn()),A.addEventListener("click",()=>m.fit()),w.addEventListener("click",()=>m.reset());const E=qA(o),R=T=>{(T.target===o||T.target===h)&&Xo(!0)},L=T=>{if(T.key==="Escape"){T.preventDefault(),Xo(!0);return}m.handleKeyboard(T)||T.key==="Tab"&&GA(T,o)},D={dialog:o,trigger:i,inertStates:E,onClick:R,onKeyDown:L,cleanupPanZoom:()=>m.destroy()};s&&(D.onCancel=T=>{T.preventDefault(),Xo(!0)},o.addEventListener("cancel",D.onCancel),o.showModal()),o.addEventListener("click",R),document.addEventListener("keydown",L,!0),nl=D,m.fit(),h.focus()}function kc(i,n,s){const o=document.createElement("button");return o.className="diagram-lightbox__zoom-button",o.type="button",o.dataset.zoomAction=s,o.setAttribute("aria-label",n),o.textContent=i,o}class $A{constructor(n,s,o,l){this.viewport=n,this.svg=s,this.readout=o,this.baseSize=l,this.applyZoom(this.zoomIndex),n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerEnd),n.addEventListener("pointercancel",this.onPointerEnd),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("dblclick",this.onDoubleClick),window.addEventListener("resize",this.onResize)}viewport;svg;readout;baseSize;zoomIndex=wn.indexOf(100);dragStart=null;pinchStart=null;pointers=new Map;destroy(){this.viewport.removeEventListener("pointerdown",this.onPointerDown),this.viewport.removeEventListener("pointermove",this.onPointerMove),this.viewport.removeEventListener("pointerup",this.onPointerEnd),this.viewport.removeEventListener("pointercancel",this.onPointerEnd),this.viewport.removeEventListener("wheel",this.onWheel),this.viewport.removeEventListener("dblclick",this.onDoubleClick),window.removeEventListener("resize",this.onResize),this.pointers.clear()}zoomIn(){this.zoomAroundViewportCenter(Math.min(this.zoomIndex+1,wn.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(wn.indexOf(100))}fit(){const n=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,s=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,o=Math.min(n/this.baseSize.width,s/this.baseSize.height),l=Math.floor(o*100),y=wn.findIndex(c=>c>l),b=y===-1?wn.length-1:Math.max(0,y-1);this.applyZoom(b),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-s)/2)}handleKeyboard(n){return n.key==="+"||n.key==="="?(n.preventDefault(),this.zoomIn(),!0):n.key==="-"||n.key==="_"?(n.preventDefault(),this.zoomOut(),!0):n.key==="0"?(n.preventDefault(),this.reset(),!0):n.key.toLowerCase()==="f"?(n.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(Mc(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(Mc(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const s=Mc(this.zoomIndex),o=s/100;this.svg.setAttribute("width",Ma(this.baseSize.width*o)),this.svg.setAttribute("height",Ma(this.baseSize.height*o)),this.readout.textContent=`${s}%`}zoomAroundViewportCenter(n){const s=this.viewport.getBoundingClientRect();this.zoomAroundPoint(n,s.left+s.width/2,s.top+s.height/2)}zoomAroundPoint(n,s,o){if(n===this.zoomIndex)return;const l=this.svgWidth,y=this.svgHeight,b=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+s-b.left,u=this.viewport.scrollTop+o-b.top;this.applyZoom(n),this.viewport.scrollLeft=c/l*this.svgWidth-(s-b.left),this.viewport.scrollTop=u/y*this.svgHeight-(o-b.top)}onPointerDown=n=>{if(n.button!==0||tu(n.target))return;const s=n.pointerId??1;if(this.pointers.set(s,n),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:n.clientX,y:n.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:s},this.viewport.setPointerCapture?.(s)};onPointerMove=n=>{const s=n.pointerId??1;if(this.pointers.has(s)&&this.pointers.set(s,n),this.pinchStart&&this.pointers.size>=2){const o=this.pointerDistance()/this.pinchStart.distance,l=Mc(this.pinchStart.zoomIndex)*o;this.applyZoom(jA(l));return}!this.dragStart||this.dragStart.pointerId!==s||(n.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(n.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(n.clientY-this.dragStart.y))};onPointerEnd=n=>{const s=n.pointerId??1;this.pointers.delete(s),this.viewport.releasePointerCapture?.(s),this.dragStart?.pointerId===s&&(this.dragStart=null),this.pointers.size<2&&(this.pinchStart=null)};onWheel=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const s=n.deltaY<0?Math.min(this.zoomIndex+1,wn.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(s,n.clientX,n.clientY)};onDoubleClick=n=>{tu(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===wn.indexOf(200)?wn.indexOf(100):wn.indexOf(200),n.clientX,n.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[n,s]=Array.from(this.pointers.values());return!n||!s?1:Math.hypot(s.clientX-n.clientX,s.clientY-n.clientY)}}function UA(i){const n=v0(i.getAttribute("width")),s=v0(i.getAttribute("height"));if(n&&s)return{width:n,height:s};const o=i.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],l=o[2],y=o[3],b=l!==void 0&&Number.isFinite(l)&&l>0?l:null,c=y!==void 0&&Number.isFinite(y)&&y>0?y:null;return{width:n??b??800,height:s??c??600}}function PA(i){const n=i.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:UA(i)}function v0(i){if(!i)return null;const n=/^(\d+(?:\.\d+)?)/.exec(i.trim());if(!n)return null;const s=Number(n[1]);return Number.isFinite(s)&&s>0?s:null}function Ma(i){return Number.isInteger(i)?String(i):i.toFixed(2).replace(/\.?0+$/,"")}function jA(i){let n=0,s=Number.POSITIVE_INFINITY;return wn.forEach((o,l)=>{const y=Math.abs(o-i);y<s&&(s=y,n=l)}),n}function Mc(i){return wn[i]??wn[0]}function FA(i,n){const s=i.getAttribute("id")??"";i.setAttribute("id",n);const o=i.querySelector("style");!s||!o?.textContent||(o.textContent=o.textContent.split(`#${s}`).join(`#${n}`))}function Xo(i){const n=nl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),WA(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),nl=null,i&&n.trigger.isConnected&&n.trigger.focus())}function qA(i){const n=[];for(const s of Array.from(document.body.children))!(s instanceof HTMLElement)||s===i||(n.push({element:s,ariaHidden:s.getAttribute("aria-hidden"),inert:s.inert}),s.inert=!0,s.setAttribute("aria-hidden","true"));return n}function WA(i){for(const n of i)n.element.inert=n.inert,n.ariaHidden===null?n.element.removeAttribute("aria-hidden"):n.element.setAttribute("aria-hidden",n.ariaHidden)}function GA(i,n){const s=Array.from(n.querySelectorAll(SA)).filter(VA);if(s.length===0){i.preventDefault(),n.focus();return}const o=s[0],l=s[s.length-1];!o||!l||(i.shiftKey&&document.activeElement===o?(i.preventDefault(),l.focus()):!i.shiftKey&&document.activeElement===l&&(i.preventDefault(),o.focus()))}function KA(i){i.querySelector("a[href]")?i.removeAttribute("role"):i.setAttribute("role","button")}function tu(i){if(!(i instanceof Element))return!1;const n=i.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!YA(n)}function YA(i){return Array.from(i.children).some(n=>n.tagName.toLowerCase()==="svg")}function VA(i){return!(i.inert||i.hidden||i.getAttribute("aria-hidden")==="true"||"disabled"in i&&i.disabled)}function LS(i){const n=i.trim();if(!n||n.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(n)){if(/^javascript:/i.test(n)||/^data:/i.test(n))return null;let o;try{o=new URL(n)}catch{return null}return o.origin!==window.location.origin?null:LS(o.pathname)}if(/^\/entry\/[^/?#]+$/.exec(n)){const o=n.slice(7);let l;try{l=decodeURIComponent(o)}catch{return null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(l)?`/entry/${encodeURIComponent(l)}`:null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(n)?`/entry/${encodeURIComponent(n)}`:null}function XA(i){const n=wA.exec(i);if(!n)return null;const s=n[1]?.trim();if(!s)return null;const o=s.indexOf("/"),l=o>=0?s.slice(0,o):s,y=o>=0?s.slice(o+1).trim():"",b=l.trim().split(/[\s,]+/).filter(Boolean);if(b.length!==3)return null;const[c,u,h]=b;if(!c||!u||!h)return null;const v=Xd(c,1),f=Xd(u,.4),C=QA(h);if(v===null||f===null||C===null)return null;let x=1;if(o>=0){const A=Xd(y,1);if(A===null)return null;x=A}return{L:v,C:f,h:C,alpha:x}}function ZA(i){const n=i.h*Math.PI/180,s=i.C*Math.cos(n),o=i.C*Math.sin(n),l=i.L,y=l+.3963377774*s+.2158037573*o,b=l-.1055613458*s-.0638541728*o,c=l-.0894841775*s-1.291485548*o,u=y**3,h=b**3,v=c**3,f=4.0767416621*u-3.3077115913*h+.2309699292*v,C=-1.2684380046*u+2.6097574011*h-.3413193965*v,x=-.0041960863*u-.7034186147*h+1.707614701*v,A=Dc(Zd(f)),w=Dc(Zd(C)),_=Dc(Zd(x));if(i.alpha<1){const S=Dc(i.alpha);return`#${ks(A)}${ks(w)}${ks(_)}${ks(S)}`}return`#${ks(A)}${ks(w)}${ks(_)}`}function Xd(i,n){if(!i)return null;if(i.endsWith("%")){const o=Number(i.slice(0,-1));return Number.isFinite(o)?o/100*n:null}const s=Number(i);return Number.isFinite(s)?s:null}function QA(i){const n=EA.exec(i);if(!n)return null;const s=Number(n[1]);return Number.isFinite(s)?s:null}function Zd(i){const n=Math.max(0,Math.min(1,i));return n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n}function Dc(i){return Math.round(Math.max(0,Math.min(1,i))*255)}function ks(i){return i.toString(16).padStart(2,"0")}function JA(i){const n=i.tags.map(o=>`<span class="chip chip-tag">${Te(o)}</span>`).join(""),s=tR(i);return`
342
+ <div class="meta-chips">
343
+ ${n}
344
+ ${s}
345
+ <span class="chip">Updated ${Te(eR(i.updated))}</span>
346
+ </div>
347
+ `}function kS(i){return i.map(n=>`<span class="chip chip-muted">${Te(n)}</span>`).join("")}function eR(i){const n=new Date(i);return Number.isNaN(n.getTime())?i:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function tR(i){const n=iR(i);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${Ze(n.title)}">${Te(n.label)}</span>`:""}function iR(i,n=new Date){const s=i.status,o=typeof i.revalidateAfter=="string"&&!Number.isNaN(Date.parse(i.revalidateAfter))&&Date.parse(i.revalidateAfter)<n.getTime();return s==="deprecated"||s==="superseded"?{label:s,tone:"deprecated",title:o?`${s} · stale`:s}:o?{label:"stale",tone:"stale",title:i.revalidateAfter??"stale"}:s==="current"||s==="draft"?{label:s,tone:"neutral",title:s}:null}function nR(i,n,s){const o=rR(i,n,s);return o.length===0?"":`
348
+ <section class="related-list">
349
+ <h2>Related entries</h2>
350
+ <div class="related-items">
351
+ ${o.map(l=>`
352
+ <a class="related-card" href="${kr(l.entry.id)}" data-entry-id="${Ze(l.entry.id)}">
353
+ <strong>${Te(l.entry.title)}</strong>
354
+ <span>${kS(l.matchingTags)}</span>
355
+ </a>
356
+ `).join("")}
357
+ </div>
358
+ </section>
359
+ `}function rR(i,n,s){const o=new Set(n),l="en-US";return s.filter(y=>y.id!==i).map(y=>({entry:y,matchingTags:y.tags.filter(b=>o.has(b))})).filter(y=>y.matchingTags.length>0).sort((y,b)=>b.matchingTags.length-y.matchingTags.length||y.entry.title.localeCompare(b.entry.title,l,{sensitivity:"base",numeric:!0})).slice(0,5)}const sR=`
360
+ <svg class="arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="16" height="16">
361
+ <path d="M5 12h14M13 6l6 6-6 6" />
362
+ </svg>
363
+ `;function aR(i,n,s=!0){const o=i.length,l=i.slice(0,6),y=i[0]??null;return`
364
+ <article class="document welcome">
365
+ <header class="welcome-title">
366
+ <p class="eyebrow">Fleet · Codex</p>
367
+ <h1>The <em>Codex</em></h1>
368
+ </header>
369
+ <div class="welcome-divider"></div>
370
+ <p class="lead">Navigate your workspace Fleet Wiki. Browse entries by tag from the left compass, or jump instantly with the <kbd>⌘K</kbd> command palette.</p>
371
+ ${s?"":'<p class="error-box">No workspace is registered in this daemon. Re-run <code>fleet-wiki</code> in the target directory.</p>'}
372
+ <div class="workspace-meta">
373
+ <span class="chip chip-aurora">${o} entries</span>
374
+ ${n?`<span class="workspace-path">${Te(n)}</span>`:""}
375
+ </div>
376
+ ${y?`
377
+ <a class="primary-link" href="${Ze(kr(y.id))}" data-entry-id="${Ze(y.id)}">
378
+ <span>Open first entry — ${Te(y.title)}</span>
379
+ ${sR}
380
+ </a>
381
+ `:'<p class="empty-state">No wiki entries yet. Add entries with <code>wiki_ingest</code>.</p>'}
382
+ ${l.length>0?`
383
+ <div class="welcome-grid">
384
+ ${l.map(b=>`
385
+ <a class="welcome-card" href="${Ze(kr(b.id))}" data-entry-id="${Ze(b.id)}">
386
+ <strong>${Te(b.title)}</strong>
387
+ <span class="welcome-card-tags">${kS(b.tags.slice(0,3))}</span>
388
+ </a>
389
+ `).join("")}
390
+ </div>
391
+ `:""}
392
+ </article>
393
+ `}function oR(i,n){const s=$a(i.body);return{toc:s.toc,html:`
394
+ <article class="document">
395
+ <header class="document-header">
396
+ <p class="eyebrow">Wiki Entry</p>
397
+ <h1>${Te(i.frontmatter.title)}</h1>
398
+ ${JA(i.frontmatter)}
399
+ </header>
400
+ <div class="markdown-body" id="markdown-body">
401
+ ${s.html}
402
+ </div>
403
+ ${nR(i.frontmatter.id,i.frontmatter.tags,n)}
404
+ </article>
405
+ `}}function lR(){return`
406
+ <article class="document">
407
+ <p class="loading">Loading entry</p>
408
+ </article>
409
+ `}function cR(i){return`
410
+ <article class="document">
411
+ <p class="error-box">${Te(i)}</p>
412
+ </article>
413
+ `}const jc=new Set;let Tr="entries";const uR=`
414
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
415
+ <circle cx="11" cy="11" r="6.5" />
416
+ <path d="m20 20-3.5-3.5" />
417
+ </svg>
418
+ `,hR=`
419
+ <svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
420
+ <path d="m6 9 6 6 6-6" />
421
+ </svg>
422
+ `,dR=`
423
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="14" height="14">
424
+ <path d="M6 6 18 18M18 6 6 18" />
425
+ </svg>
426
+ `,fR=`
427
+ <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
428
+ <circle cx="12" cy="5" r="2" />
429
+ <path d="M12 7v14M8 11H4a8 8 0 0 0 16 0h-4" />
430
+ </svg>
431
+ `;function _R(i,n,s,o=[],l=null,y){const b=i.length,c=mR(i),u=b===0?'<p class="empty-state">No wiki entries yet.</p>':Tr==="tags"?vR(i,n):bR(i,n),h=Tr==="tags"?`Tags · ${c}`:`Entries · ${b}`,v=Tr==="tags"?"tag-tree":"entry-list",f=Tr==="tags"?"Entries by tag":"All entries",C=CR(y??(typeof window<"u"?window.location.pathname:"")),x=C.startsWith("/queue"),A=C==="/index",w=C==="/log",_=C.startsWith("/conflicts"),S=s>0?`<span class="nav-drydock-badge">${s}</span>`:"";return`
432
+ <aside class="sidebar" id="sidebar">
433
+ <div class="sidebar-header">
434
+ <div class="sidebar-header-actions">
435
+ <button class="icon-button mobile-close" type="button" data-action="toggle-nav" aria-label="Close">${dR}</button>
436
+ </div>
437
+ </div>
438
+ <button class="command-entry" type="button" data-action="open-command">
439
+ <span class="command-entry-label">${uR}<span>Search entries</span></span>
440
+ <kbd>⌘K</kbd>
441
+ </button>
442
+ <div class="nav-drydock-section">
443
+ <a class="nav-drydock-link${x?" active":""}" href="${Ze(Oa())}">
444
+ <span class="nav-drydock-icon">${fR}</span>
445
+ <span class="nav-drydock-label">Drydock</span>
446
+ ${S}
447
+ </a>
448
+ <a class="nav-drydock-link${A?" active":""}" href="${Ze(e2())}">
449
+ <span class="nav-drydock-label">Index</span>
450
+ </a>
451
+ <a class="nav-drydock-link${w?" active":""}" href="${Ze(Kb())}">
452
+ <span class="nav-drydock-label">Log</span>
453
+ </a>
454
+ <a class="nav-drydock-link${_?" active":""}" href="${Ze(Q5())}">
455
+ <span class="nav-drydock-label">Conflicts</span>
456
+ </a>
457
+ </div>
458
+ <div class="nav-tabs" role="tablist" aria-label="Navigation mode">
459
+ <button class="nav-tab${Tr==="entries"?" active":""}" type="button" role="tab" aria-selected="${Tr==="entries"}" data-action="set-nav-mode" data-mode="entries">
460
+ Entries
461
+ </button>
462
+ <button class="nav-tab${Tr==="tags"?" active":""}" type="button" role="tab" aria-selected="${Tr==="tags"}" data-action="set-nav-mode" data-mode="tags">
463
+ Tags
464
+ </button>
465
+ </div>
466
+ <p class="nav-section-label">${h}</p>
467
+ <nav class="${v}" aria-label="${f}">
468
+ ${u}
469
+ </nav>
470
+ </aside>
471
+ `}function pR(i){if(jc.has(i)){jc.delete(i);return}jc.add(i)}function gR(i){Tr=i}function mR(i){const n=new Set;for(const s of i){if(s.tags.length===0){n.add("untagged");continue}for(const o of s.tags)n.add(o)}return n.size}function vR(i,n){return SR(i).map(o=>yR(o,n)).join("")}function bR(i,n){const s="en-US";return[...i].sort((l,y)=>l.title.localeCompare(y.title,s,{sensitivity:"base",numeric:!0})).map(l=>MS(l,n)).join("")}function SR(i){const n="en-US",s=new Map;for(const o of i){const l=o.tags.length>0?o.tags:["untagged"];for(const y of l){const b=s.get(y)??[];b.push(o),s.set(y,b)}}return[...s.entries()].map(([o,l])=>({tag:o,entries:l.sort((y,b)=>y.title.localeCompare(b.title,n,{sensitivity:"base",numeric:!0}))})).sort((o,l)=>o.tag.localeCompare(l.tag,n,{sensitivity:"base",numeric:!0}))}function yR(i,n){const s=jc.has(i.tag),o=s?"":i.entries.map(l=>MS(l,n)).join("");return`
472
+ <section class="tag-group" data-collapsed="${s?"true":"false"}">
473
+ <button class="tag-group-button" type="button" data-action="toggle-tag" data-tag="${Ze(i.tag)}">
474
+ ${hR}
475
+ <span>${i.tag==="untagged"?"Untagged":Te(i.tag)}</span>
476
+ <span class="count">${i.entries.length}</span>
477
+ </button>
478
+ <div class="tag-group-list">${o}</div>
479
+ </section>
480
+ `}function MS(i,n){const s=i.id===n?" active":"",o=Ze(i.title);return`
481
+ <a class="nav-entry${s}" href="${kr(i.id)}" data-entry-id="${Ze(i.id)}" title="${o}">
482
+ <span class="nav-entry-text">${Te(i.title)}</span>
483
+ </a>
484
+ `}function CR(i){const n=i===Nn||i===`${Nn}/`?"/":i.startsWith(`${Nn}/`)?i.slice(Nn.length)||"/":i,s=n.match(/^\/w\/[^/]+(\/.*)?$/);return s?s[1]??"/":n}const wR=`
485
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
486
+ <path d="M15 18 9 12l6-6" />
487
+ </svg>
488
+ `,ER=`
489
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
490
+ <path d="M5 4h11a3 3 0 0 1 3 3v9.5a3.5 3.5 0 0 1-3.5 3.5H8a3 3 0 0 1-3-3V4z" />
491
+ <path d="M9 9h6M9 13h6" />
492
+ </svg>
493
+ `;function xR(i){const n=i.ref??"";let s;return i.loading?s='<p class="loading">Loading source</p>':i.error?s=`<p class="error-box">Failed to load source — ${Te(i.error)}</p>`:i.content?s=`<div class="markdown-body">${$a(i.content).html}</div>`:s='<p class="empty-state">Source is empty.</p>',`
494
+ <div class="raw-shell">
495
+ <header class="raw-header">
496
+ <a class="raw-back" href="/" data-action="navigate-home" aria-label="Back to Codex">
497
+ ${wR}
498
+ <span>Codex</span>
499
+ </a>
500
+ <div class="raw-meta">
501
+ <span class="raw-glyph">${ER}</span>
502
+ <div class="raw-meta-text">
503
+ <p class="eyebrow">Manifest · Raw Source</p>
504
+ <h1 class="raw-title">${Te(n)}</h1>
505
+ </div>
506
+ </div>
507
+ <div class="raw-divider"></div>
508
+ </header>
509
+ <article class="raw-document">
510
+ ${s}
511
+ </article>
512
+ </div>
513
+ `}function i_(i,n){const s=i==="create_wiki"||!n,o=s?"+":"↻",l=s?"CREATE":"UPDATE";return`<span class="op-badge ${s?"op-badge--create":"op-badge--update"}" aria-label="${l}">
514
+ <span class="op-badge-glyph" aria-hidden="true">${o}</span>
515
+ <span class="op-badge-label">${l}</span>
516
+ </span>`}function TR(i){const{tab:n,items:s,pendingCount:o,archivedCount:l,loading:y,error:b}=i;if(y&&s.length===0)return'<div class="queue-view"><p class="loading">Loading patch queue</p></div>';if(b)return`<div class="queue-view"><p class="error-box">Failed to load queue — ${Te(b)}</p></div>`;const c=s.length===0?AR(n):s.map(v=>RR(v)).join(""),u=o>0?`<span class="queue-badge">${o}</span>`:"",h=l>0?`<span class="queue-badge queue-badge--muted">${l}</span>`:"";return`
517
+ <div class="queue-view">
518
+ <div class="queue-header">
519
+ <p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
520
+ <h1 class="queue-title">Patch Queue</h1>
521
+ </div>
522
+ <div class="queue-tabs" role="tablist" aria-label="Queue tabs">
523
+ <a class="queue-tab${n==="pending"?" active":""}"
524
+ href="${Ze(Oa("pending"))}"
525
+ role="tab"
526
+ aria-selected="${n==="pending"}">
527
+ Pending${u}
528
+ </a>
529
+ <a class="queue-tab${n==="archived"?" active":""}"
530
+ href="${Ze(Oa("archived"))}"
531
+ role="tab"
532
+ aria-selected="${n==="archived"}">
533
+ Archived${h}
534
+ </a>
535
+ </div>
536
+ <div class="queue-list">
537
+ ${c}
538
+ </div>
539
+ </div>
540
+ `}function AR(i){return`<p class="queue-empty">${i==="pending"?"No pending patches.":"No archived patches."}</p>`}function RR(i){const{id:n,meta:s,source:o,summary:l,op:y,target:b}=i,c=LR(s.status),u=eu(s.createdAt),h=s.warnings??[],v=h.slice(0,3).map(_=>`<span class="chip chip-muted">${Te(_)}</span>`).join(""),f=h.length>3?`<span class="chip chip-muted">+${h.length-3}</span>`:"",C=o==="archive"?`<span class="chip">${Te(s.status)}</span>`:"",x=y?i_(y,!0):"",A=l?`<p class="queue-card-summary">${Te(l)}</p>`:"",w=b?`<span class="queue-card-target">${Te(b)}</span>`:"";return`
541
+ <a class="queue-card" href="${Ze(Z5(n))}">
542
+ ${A}
543
+ <div class="queue-card-top">
544
+ <span class="queue-card-id">${Te(n)}</span>
545
+ ${c}
546
+ </div>
547
+ <div class="queue-card-meta">
548
+ ${x}
549
+ ${w}
550
+ <span class="queue-card-time">${Te(u)}</span>
551
+ ${C}
552
+ <div class="queue-card-chips">
553
+ ${v}${f}
554
+ </div>
555
+ </div>
556
+ </a>
557
+ `}function LR(i){return`<span class="status-dot ${i==="pending"?"status-dot--pending":i==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ze(i)}"></span>`}const kR=`
558
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
559
+ <path d="M15 18 9 12l6-6" />
560
+ </svg>
561
+ `,MR=`
562
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
563
+ <path d="M7 17 17 7M9 7h8v8" />
564
+ </svg>
565
+ `;function DR(i){const{current:n,loading:s,error:o}=i;return s?'<div class="queue-detail-view"><p class="loading">Loading patch</p></div>':o?`<div class="queue-detail-view"><p class="error-box">Failed to load patch — ${Te(o)}</p></div>`:n?OR(n,i):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function OR(i,n){const{patch:s,meta:o,wikiEntry:l,targetExists:y}=i,{frontmatter:b}=s,c=$a(l.body),u=i_(b.op,y),h=o.rawSourceRef;return`
566
+ <div class="queue-detail-view">
567
+ <div class="queue-detail-layout">
568
+ <div class="queue-detail-main">
569
+ <a class="raw-back queue-back" href="${Ze(Oa())}" aria-label="Back to Drydock">
570
+ ${kR}
571
+ <span>Drydock</span>
572
+ </a>
573
+ <div class="queue-detail-header">
574
+ <p class="drydock-eyebrow">MANIFEST · PATCH</p>
575
+ <p class="queue-patch-id">${Te(o.id)}</p>
576
+ <h1 class="queue-summary">${Te(b.summary)}</h1>
577
+ ${u}
578
+ </div>
579
+ <article class="document">
580
+ <div class="markdown-body" id="markdown-body">${c.html}</div>
581
+ </article>
582
+ </div>
583
+ <aside class="queue-rail">
584
+ ${BR(i,h)}
585
+ ${HR(c.toc)}
586
+ ${IR(i)}
587
+ ${NR(i,n)}
588
+ </aside>
589
+ </div>
590
+ </div>
591
+ `}function BR(i,n){const{patch:s,meta:o,targetExists:l}=i,{frontmatter:y}=s,b=i_(y.op,l),c=yf(o.createdAt),u=eu(o.createdAt),h=zR(o.status),v=o.warnings??[],f=n?`<dd class="queue-dl-value">
592
+ <a class="manifest-link queue-raw-link" href="${Ze(Gb(n))}" data-raw-ref="${Ze(n)}">
593
+ <span class="manifest-ref">${Te(n)}</span>
594
+ <span class="manifest-arrow">${MR}</span>
595
+ </a>
596
+ </dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=v.length>0?`<dt class="queue-dl-key">Warnings</dt>
597
+ <dd class="queue-dl-value">
598
+ <div class="queue-card-chips">
599
+ ${v.map(x=>`<span class="chip chip-muted">${Te(x)}</span>`).join("")}
600
+ </div>
601
+ </dd>`:"";return`
602
+ <div class="queue-rail-card">
603
+ <div class="queue-rail-header">
604
+ <p class="drydock-eyebrow">MANIFEST · PATCH</p>
605
+ <p class="queue-rail-subtitle">Patch Manifest</p>
606
+ </div>
607
+ <dl class="queue-dl">
608
+ <dt class="queue-dl-key">OP</dt>
609
+ <dd class="queue-dl-value">${b}</dd>
610
+ <dt class="queue-dl-key">Target</dt>
611
+ <dd class="queue-dl-value queue-dl-mono">${Te(y.target)}</dd>
612
+ <dt class="queue-dl-key">Proposer</dt>
613
+ <dd class="queue-dl-value">${Te(y.proposer)}</dd>
614
+ <dt class="queue-dl-key">Created</dt>
615
+ <dd class="queue-dl-value queue-dl-time">
616
+ <time datetime="${Ze(o.createdAt)}" title="${Ze(c)}">
617
+ ${Te(c)}
618
+ <span class="queue-dl-relative">(${Te(u)})</span>
619
+ </time>
620
+ </dd>
621
+ <dt class="queue-dl-key">Status</dt>
622
+ <dd class="queue-dl-value queue-dl-status">${h}<span>${Te(o.status)}</span></dd>
623
+ <dt class="queue-dl-key">Source</dt>
624
+ ${f}
625
+ ${C}
626
+ </dl>
627
+ </div>
628
+ `}function NR(i,n){const{meta:s,source:o}=i;if(s.status!=="pending"||o!=="queue")return"";const{actionPending:l,actionError:y}=n,b=l?" disabled":"",c=Ze(s.id),u=y?`<p class="queue-action-error">${Te(y)}</p>`:"";return`
629
+ <div class="queue-rail-card queue-actions-card">
630
+ <div class="queue-rail-header">
631
+ <p class="drydock-eyebrow">ACTIONS</p>
632
+ <p class="queue-rail-subtitle">Decision</p>
633
+ </div>
634
+ ${l?'<span class="queue-action-spinner" aria-label="Processing"></span>':""}
635
+ <div class="queue-action-buttons">
636
+ <button class="queue-action-btn queue-action-btn--approve" type="button"
637
+ data-action="queue-approve" data-patch-id="${c}"${b}
638
+ aria-label="Approve this patch">
639
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
640
+ Approve
641
+ </button>
642
+ <button class="queue-action-btn queue-action-btn--reject" type="button"
643
+ data-action="queue-reject-toggle"${b}
644
+ aria-label="Reject this patch">
645
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg>
646
+ Reject
647
+ </button>
648
+ </div>
649
+ <form class="queue-reject-form" hidden data-action="queue-reject-submit" data-patch-id="${c}">
650
+ <textarea class="queue-reject-textarea" name="reason" minlength="1" maxlength="256" required placeholder="Enter rejection reason (max 256 chars)"></textarea>
651
+ <div class="queue-action-buttons">
652
+ <button class="queue-action-btn queue-action-btn--reject-submit" type="submit"${b}>Confirm</button>
653
+ <button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${b}>Cancel</button>
654
+ </div>
655
+ </form>
656
+ ${u}
657
+ </div>
658
+ `}function IR(i){const n=i.patchSet;return!n||n.members.length===0?"":`
659
+ <div class="queue-rail-card">
660
+ <div class="queue-rail-header">
661
+ <p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
662
+ <p class="queue-rail-subtitle">Patch Set</p>
663
+ </div>
664
+ <p class="queue-patch-id">${Te(n.id)}</p>
665
+ <ul class="patch-set-list">
666
+ ${n.members.map(s=>`
667
+ <li class="patch-set-item">
668
+ <span class="patch-set-item-copy">
669
+ <strong>${Te(s.summary??s.id)}</strong>
670
+ <small>${Te(s.target??s.id)}</small>
671
+ </span>
672
+ <span class="chip ${s.status==="rejected"?"chip-coral":""}">${Te(s.status??s.source)}</span>
673
+ </li>
674
+ `).join("")}
675
+ </ul>
676
+ </div>
677
+ `}function HR(i){return i.length===0?"":`
678
+ <div class="queue-rail-card queue-toc-card">
679
+ <div class="queue-rail-header">
680
+ <p class="drydock-eyebrow">CONTENTS</p>
681
+ </div>
682
+ <nav class="queue-toc-nav" aria-label="Table of contents">
683
+ ${i.map(s=>`<a class="queue-toc-link queue-toc-level-${s.level}" href="#${Ze(s.id)}">${Te(s.text)}</a>`).join("")}
684
+ </nav>
685
+ </div>
686
+ `}function zR(i){return`<span class="status-dot ${i==="pending"?"status-dot--pending":i==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ze(i)}"></span>`}function $R(i){return i.length===0?"":`
687
+ <nav class="toc-panel" aria-label="Table of contents">
688
+ <h2>Contents</h2>
689
+ ${i.map(n=>`
690
+ <a class="toc-level-${n.level}" href="#${Ze(n.id)}" data-toc-id="${Ze(n.id)}">
691
+ ${Te(n.text)}
692
+ </a>
693
+ `).join("")}
694
+ </nav>
695
+ `}function UR(i){const n=i.entries.join(`
696
+
697
+ `),s=$a(n);return`
698
+ <article class="document">
699
+ <header class="document-header">
700
+ <p class="eyebrow">MANIFEST · DRYDOCK</p>
701
+ <h1>Log</h1>
702
+ <div class="log-controls">
703
+ ${[10,20,50,100].map(l=>`
704
+ <a class="chip ${l===i.limit?"chip-tag":""}" href="${Kb(l)}">${l}</a>
705
+ `).join("")}
706
+ </div>
707
+ </header>
708
+ <p class="empty-state">${`Latest ${i.limit} of ${i.totalEntries} entries`}</p>
709
+ <div class="markdown-body">${s.html}</div>
710
+ </article>
711
+ `}const Cf=new Set,$s={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function iu(){return $s}function PR(i){return Cf.add(i),()=>Cf.delete(i)}async function jR(i){Yi({tab:i,loading:!0,error:null,current:null});try{const n=await lu(i);Yi({items:n.items,pendingCount:n.pendingCount,archivedCount:n.archivedCount,loading:!1}),qf(n.pendingCount)}catch(n){Yi({loading:!1,error:hu(n)})}}async function FR(i){Yi({loading:!0,error:null,current:null});try{const n=await j5(i);Yi({current:n,loading:!1})}catch(n){Yi({loading:!1,error:hu(n)})}}function Ms(){Yi({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function qR(){if($s.actionPending)return;const i=$s.current?.meta.id;if(i){Yi({actionPending:!0,actionError:null});try{await F5(i);const n=await lu("pending");Yi({actionPending:!1,pendingCount:n.pendingCount,archivedCount:n.archivedCount}),qf(n.pendingCount),Is(Oa("archived"))}catch(n){Yi({actionPending:!1,actionError:hu(n)})}}}async function WR(i){if($s.actionPending)return;const n=$s.current?.meta.id;if(!n)return;const s=i.trim();if(!s||s.length>256){Yi({actionError:s?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}Yi({actionPending:!0,actionError:null});try{await q5(n,s);const o=await lu("pending");Yi({actionPending:!1,pendingCount:o.pendingCount,archivedCount:o.archivedCount}),qf(o.pendingCount),Is(Oa("archived"))}catch(o){Yi({actionPending:!1,actionError:hu(o)})}}function Yi(i){Object.assign($s,i);for(const n of Cf)n($s)}function hu(i){return i instanceof Error?i.message:String(i)}const wf=new Set,cs={ref:null,content:null,loading:!1,error:null};function GR(){return cs}function KR(i){return wf.add(i),()=>wf.delete(i)}async function YR(i){if(!(cs.ref===i&&cs.content!==null&&!cs.error)){Fc({ref:i,content:null,loading:!0,error:null});try{const n=await P5(i);if(cs.ref!==i)return;Fc({content:n,loading:!1})}catch(n){if(cs.ref!==i)return;Fc({loading:!1,error:VR(n)})}}}function rs(){Fc({ref:null,content:null,loading:!1,error:null})}function Fc(i){Object.assign(cs,i);for(const n of wf)n(cs)}function VR(i){return i instanceof Error?i.message:String(i)}let nu,Ef=!1;function XR(i,n={}){nu=i,Ef=!1,document.documentElement.lang="en",X5(),f2();const s=n2(()=>Ns()),o=KR(()=>Ns()),l=PR(()=>Ns()),y=V5(b=>{DS(b)});return document.addEventListener("click",b0),document.addEventListener("submit",S0),RA(i),n.initialWorkspaceId&&df()!==n.initialWorkspaceId&&Y5($v(n.initialWorkspaceId)),ZR(),{navigateToWorkspace(b){df()!==b&&Is($v(b))},destroy(){s(),o(),l(),y(),document.removeEventListener("click",b0),document.removeEventListener("submit",S0),i.innerHTML=""}}}async function ZR(){Ns(),await r2(),await DS(ol())}async function DS(i){if(i.name==="entry"){Ms(),rs(),await s2(i.id);return}if(i.name==="raw"){Ms(),await YR(i.ref);return}if(i.name==="queue"){$d(),rs(),await jR(i.tab);return}if(i.name==="queue-detail"){$d(),rs(),await FR(i.patchId);return}if(i.name==="index-md"){Ms(),rs(),await a2();return}if(i.name==="log"){Ms(),rs(),await o2(i.limit);return}if(i.name==="conflicts"){Ms(),rs(),await l2();return}if(i.name==="conflict-detail"){Ms(),rs(),await c2(i.id);return}$d(),rs(),Ms(),Ns()}function Ns(){const i=ol();if(i.name==="raw"){QR();return}JR(Pc(),i)}function QR(){nu.innerHTML=`
712
+ ${xR(GR())}
713
+ <div class="toast" id="toast" aria-live="polite"></div>
714
+ `}function JR(i,n){const s=n.name==="entry"?n.id:null,o=n.name==="queue"||n.name==="queue-detail",l=i.currentEntry?oR(i.currentEntry,i.index):null;d2(i.index,i.recentIds),nu.innerHTML=`
715
+ <div class="app-shell${o?" app-shell--wide":""}">
716
+ <button class="mobile-menu" type="button" data-action="toggle-nav" aria-label="Open menu">
717
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
718
+ <path d="M4 7h16M4 12h16M4 17h10" />
719
+ </svg>
720
+ </button>
721
+ ${_R(i.index,s,i.pendingPatchCount,i.workspaces,i.currentWorkspaceId,window.location.pathname)}
722
+ <main class="content">
723
+ ${eL(i,n,l)}
724
+ </main>
725
+ <div class="rail">
726
+ ${tL(i,n,l)}
727
+ </div>
728
+ </div>
729
+ <div class="toast" id="toast" aria-live="polite"></div>
730
+ `,Ef?nu.classList.add("is-revealed"):Ef=!0}function eL(i,n,s){return n.name==="queue"?TR(iu()):n.name==="queue-detail"?DR(iu()):i.error?cR(i.error):i.loading&&!i.currentEntry&&!i.indexMarkdown&&!i.log&&!i.currentConflict?lR():n.name==="index-md"&&i.indexMarkdown?fA(i.indexMarkdown):n.name==="log"&&i.log?UR(i.log):n.name==="conflicts"?hA(i.conflicts):n.name==="conflict-detail"&&i.currentConflict?dA(i.currentConflict):i.currentEntry&&s?s.html:aR(i.index,i.health?.cwd??null,!!i.currentWorkspaceId)}function tL(i,n,s){return n.name==="queue"||n.name==="queue-detail"?"":`
731
+ ${pA(i.currentEntry,i.index,i.currentMatchHint)}
732
+ ${s?$R(s.toc):""}
733
+ `}function b0(i){const n=i.target;if(!(n instanceof Element))return;const s=n.closest("[data-action]");if(s?.dataset.action==="toggle-nav"){document.body.classList.toggle("nav-open");return}if(s?.dataset.action==="navigate-home"){if(C0(i))return;i.preventDefault(),document.body.classList.remove("nav-open"),Is(Yb());return}if(s?.dataset.action==="set-nav-mode"){const b=s.dataset.mode;(b==="tags"||b==="entries")&&(gR(b),Ns());return}if(s?.dataset.action==="toggle-tag"){pR(s.dataset.tag??""),Ns();return}if(s?.dataset.action==="copy-code"){iL(s);return}if(s?.dataset.action==="copy-compact-context"){const b=Pc();b.currentEntry&&qc(Ub(b.currentEntry),"Copied compact context.");return}if(s?.dataset.action==="copy-provenance-context"){const b=Pc();b.currentEntry&&qc(Pb(b.currentEntry),"Copied provenance context.");return}if(s?.dataset.action==="copy-related-context"){const b=Pc();b.currentEntry&&qc(jb(b.currentEntry,b.index),"Copied related context pack.");return}if(s?.dataset.action==="toggle-why-matched"){const b=s.closest(".context-actions-grid")?.querySelector(".context-why-matched");b&&(b.hidden=!b.hidden);return}if(s?.dataset.action==="queue-approve"){if(iu().actionPending||!confirm("Approve this patch?"))return;s.setAttribute("disabled",""),qR();return}if(s?.dataset.action==="queue-reject-toggle"){const c=s.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!c.hidden,c.hidden||c.querySelector("textarea")?.focus());return}if(s?.dataset.action==="queue-reject-cancel"){const c=s.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!0);return}const o=n.closest("[data-toc-id]");if(o){i.preventDefault(),document.getElementById(o.dataset.tocId??"")?.scrollIntoView({behavior:"smooth",block:"start"});return}const l=n.closest("a");if(!l||C0(i))return;const y=nL(l);y&&(i.preventDefault(),document.body.classList.remove("nav-open"),Is(y))}function S0(i){const n=i.target;if(n instanceof HTMLFormElement&&n.dataset.action==="queue-reject-submit"){if(i.preventDefault(),iu().actionPending)return;const s=n.querySelector("button[type='submit']");s&&(s.disabled=!0);const o=n.querySelector("textarea[name='reason']");WR(o?.value??"")}}async function iL(i){const s=i.closest(".code-block")?.dataset.code??"";s&&await qc(s,"Code copied.")}async function qc(i,n){try{await navigator.clipboard.writeText(i),y0(n)}catch{y0("Failed to copy to clipboard.")}}function y0(i){const n=document.querySelector("#toast");n&&(n.textContent=i,n.classList.add("visible"),window.setTimeout(()=>n.classList.remove("visible"),1400))}function C0(i){return i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||i.button!==0}function nL(i){const n=i.getAttribute("href")??"",s=i.dataset.entryId;if(s)return kr(decodeURIComponent(s));if(/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(window.location.origin))return null;const o=new URL(n,window.location.origin);if(o.origin!==window.location.origin)return null;if(o.pathname==="/"||o.pathname==="/console/codex"||o.pathname==="/console/codex/")return Yb();if(o.pathname.match(/^\/w\/[^/]+(\/|$)/)||o.pathname.match(/^\/console\/codex\/w\/[^/]+(\/|$)/))return o.pathname+o.search;if(o.pathname.startsWith("/console/codex/entry/")||o.pathname.startsWith("/console/codex/raw/"))return o.pathname;if(o.pathname.startsWith("/console/codex/queue")||o.pathname.startsWith("/console/codex/conflicts")||o.pathname==="/console/codex/index"||o.pathname==="/console/codex/index-md"||o.pathname==="/console/codex/log")return o.pathname+o.search;if(o.pathname.startsWith("/entry/")||o.pathname.startsWith("/raw/"))return o.pathname;if(o.pathname.startsWith("/queue")||o.pathname.startsWith("/conflicts")||o.pathname==="/index"||o.pathname==="/index-md"||o.pathname==="/log")return o.pathname+o.search;if(!o.pathname.endsWith(".md"))return null;const l=o.pathname.split("/").pop()??"",y=decodeURIComponent(l.replace(/\.md$/,""));return y?kr(y):null}function rL({state:i}){const n=ie.useRef(null),s=ie.useRef(null),o=i.theaters.find(b=>b.id===i.activeTheaterId)??null,l=o?.id??null,y=!!o?.hasWiki;return ie.useEffect(()=>{if(!y){s.current?.destroy(),s.current=null;return}const b=n.current;if(!b||!l||s.current)return;const c=XR(b,{initialWorkspaceId:l});return s.current=c,()=>{c.destroy(),s.current===c&&(s.current=null)}},[y]),ie.useEffect(()=>{!y||!l||s.current?.navigateToWorkspace(l)},[l,y]),!i.activeTheaterId||i.theaters.length===0?z.jsxs("section",{className:"codex-empty-state",children:[z.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),z.jsx("h1",{children:"Add a Theater"}),z.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]}):o?.hasWiki?z.jsx("div",{className:"codex-host",ref:n}):z.jsxs("section",{className:"codex-empty-state",children:[z.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),z.jsx("h1",{children:o?.label??"This Theater"}),z.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]})}function OS(i){return new Date(i).toLocaleTimeString([],{hour12:!1})}function sL(i,n){const s=Math.max(0,Math.round((n-i)/1e3)),o=Math.floor(s/60),l=s%60;return o===0?`${l}s`:o<60?`${o}m ${String(l).padStart(2,"0")}s`:`${Math.floor(o/60)}h ${String(o%60).padStart(2,"0")}m`}function xf(i){return i.length<=14?i:`${i.slice(0,6)}…${i.slice(-6)}`}function aL(i){return i&&i.charAt(0).toUpperCase()+i.slice(1)}function Tf(i){switch(i){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return i}}function oL(i){switch(i){case"queued":return"queued";case"conn":return"connecting";case"stream":return"streaming";case"done":return"done";case"err":return"error";case"aborted":return"aborted";default:return i}}function Ua(i){switch(i){case"stream":case"active":case"conn":return"live";case"done":return"ok";case"err":case"error":return"bad";default:return"idle"}}function lL(i){if(i.status!=="active")return null;const n=i.trackOrder.map(l=>i.tracks[l]).filter(l=>!!l),s=n.filter(l=>l.status==="stream"||l.status==="conn"),o=s.length>0?s:n;for(let l=o.length-1;l>=0;l--){const y=o[l],b=y?cL(y):null;if(b)return b}return null}function cL(i){return w0(i.text)??w0(i.thought)??i.tools[i.tools.length-1]?.title??null}function w0(i){if(!i)return null;const n=i.split(`
734
+ `);for(let s=n.length-1;s>=0;s--){const o=n[s]?.trim();if(o)return o}return null}const uL=56;function hL(i,n){const s=ie.useRef(null),o=ie.useRef(!0),[l,y]=ie.useState(!0),b=ie.useCallback(u=>{o.current!==u&&(o.current=u,y(u))},[]);ie.useEffect(()=>{const u=s.current;if(!u)return;const h=()=>{const v=u.scrollHeight-u.scrollTop-u.clientHeight;b(v<=uL)};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[b]),ie.useLayoutEffect(()=>{b(!0);const u=s.current;u&&(u.scrollTop=u.scrollHeight)},[i,b]),ie.useLayoutEffect(()=>{const u=s.current;!u||!o.current||(u.scrollTop=u.scrollHeight)},[n]);const c=ie.useCallback(()=>{const u=s.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),b(!0))},[b]);return{containerRef:s,pinned:l,jumpToLatest:c}}const E0=400,dL=["text","fallbackText","fallbackThought"],fL=ie.memo(function({events:n}){return z.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[n.length===0?z.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,n.map((s,o)=>{const l=n[n.length-1-o];return l?z.jsx(_L,{event:l},l.id):null})]})}),_L=ie.memo(function({event:n}){return z.jsxs("li",{className:"timeline-row",children:[z.jsx("time",{className:"timeline-time",children:OS(n.at)}),z.jsx("span",{className:"timeline-type",children:n.type}),z.jsx("code",{className:"timeline-payload",children:pL(n.event)})]})});function pL(i){const n={...i};delete n.type;for(const o of dL){const l=n[o];typeof l=="string"&&(n[o]=l.length>60?`${l.slice(0,60)}… (${l.length} chars)`:l)}const s=JSON.stringify(n);return s.length>E0?`${s.slice(0,E0)}…`:s}const gL=ie.memo(function({track:n}){const s=Ua(n.status),o=n.status==="stream",l=n.sentTextLength>n.text.length||n.sentThoughtLength>n.thought.length,y=n.sentTextLength+n.sentThoughtLength;return z.jsxs("article",{className:`track-card track-card--${s}`,children:[z.jsxs("header",{className:"track-head",children:[z.jsx("span",{className:`status-dot status-dot--${s}`,"aria-hidden":"true"}),z.jsx("h3",{className:"track-name",children:n.displayName}),n.displayCli?z.jsx("span",{className:"track-tag",children:n.displayCli}):null,n.model?z.jsx("span",{className:"track-tag track-tag--dim",children:n.model}):null,n.effort?z.jsx("span",{className:"track-tag track-tag--dim",children:n.effort}):null,z.jsx("span",{className:`track-status track-status--${s}`,children:oL(n.status)})]}),n.subtitle?z.jsx("p",{className:"track-subtitle",children:n.subtitle}):null,n.requestPreview?z.jsx(mL,{preview:n.requestPreview}):null,n.thought?z.jsx(vL,{thought:n.thought,streaming:o&&!n.text}):null,z.jsx(bL,{track:n}),n.text?z.jsx("div",{className:"track-output","data-streaming":o||void 0,children:z.jsxs("pre",{className:"track-text",children:[n.text,o?z.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):o||n.status==="conn"||n.status==="queued"?z.jsxs("p",{className:"track-waiting",children:[z.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,l?z.jsxs("p",{className:"track-notice",children:["Output partially retained — ",y.toLocaleString()," chars emitted in total."]}):null,n.error?z.jsx("p",{className:"track-error",children:n.error}):null]})});function mL({preview:i}){return z.jsxs("p",{className:"track-request",title:i,children:[z.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),i]})}function vL({thought:i,streaming:n}){const[s,o]=ie.useState(!1);return z.jsxs("div",{className:`thought-fold ${s?"is-open":""}`,children:[z.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>o(l=>!l),"aria-expanded":s,children:[z.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:s?"▾":"▸"}),"reasoning",n?z.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),s?z.jsx("pre",{className:"thought-text",children:i}):null]})}function bL({track:i}){return i.tools.length===0?null:z.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:i.tools.map(n=>z.jsxs("li",{className:`tool-chip tool-chip--${SL(n.status)}`,children:[z.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),z.jsx("span",{className:"tool-chip-title",children:n.title}),n.status?z.jsx("span",{className:"tool-chip-status",children:n.status}):null]},n.key))})}function SL(i){const n=i.toLowerCase();return n.includes("error")||n.includes("fail")?"bad":n.includes("done")||n.includes("ok")||n.includes("complete")?"ok":n.includes("run")||n.includes("progress")||n.includes("stream")?"live":"idle"}function yL({job:i,timelineOpen:n}){const{containerRef:s,pinned:o,jumpToLatest:l}=hL(i?.jobId??"none",i?.lastEventId??0);return i?z.jsxs("main",{className:"stage",children:[z.jsx(CL,{job:i}),z.jsxs("div",{className:"stage-stream",children:[z.jsx("div",{className:"stage-scroll",ref:s,tabIndex:-1,children:z.jsxs("div",{className:"stage-content",children:[i.trackOrder.length===0?z.jsxs("p",{className:"stage-waiting",children:[z.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):i.trackOrder.map(y=>{const b=i.tracks[y];return b?z.jsx(gL,{track:b},`${i.jobId}:${y}`):null}),i.summary?z.jsx(wL,{summary:i.summary,status:i.status,error:i.error}):null]})}),o?null:z.jsx("button",{type:"button",className:"follow-button",onClick:l,children:"↓ Follow stream"})]}),z.jsxs("section",{className:`timeline-dock ${n?"is-open":""}`,children:[z.jsxs("button",{type:"button",className:"timeline-toggle",onClick:sE,"aria-expanded":n,children:[z.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:n?"▾":"▴"}),"Event timeline",z.jsx("span",{className:"timeline-count",children:i.recentEvents.length})]}),n?z.jsx(fL,{events:i.recentEvents}):null]})]}):z.jsx("main",{className:"stage",children:z.jsxs("div",{className:"stage-idle",children:[z.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),z.jsx("h2",{children:"Standing by"}),z.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const CL=ie.memo(function({job:n}){const s=Ua(n.status),o=n.startedAt?sL(n.startedAt,n.finishedAt??n.updatedAt):null;return z.jsxs("header",{className:"job-head",children:[z.jsxs("div",{className:"job-head-id",children:[z.jsx("span",{className:`status-dot status-dot--${s} status-dot--lg`,"aria-hidden":"true"}),z.jsxs("div",{children:[z.jsx("h2",{className:"job-title",children:n.label??xf(n.jobId)}),z.jsxs("p",{className:"job-meta",children:[z.jsx("span",{className:`job-status job-status--${s}`,children:Tf(n.status)}),n.ownerCarrierId?z.jsxs("span",{children:["· ",n.ownerCarrierId]}):null,n.kind?z.jsxs("span",{children:["· ",n.kind]}):null,o?z.jsxs("span",{children:["· ",o]}):null,n.startedAt?z.jsxs("span",{children:["· started ",OS(n.startedAt)]}):null]})]})]}),z.jsx("code",{className:"job-id",title:n.jobId,children:xf(n.jobId)})]})});function wL({summary:i,status:n,error:s}){return z.jsxs("aside",{className:`job-summary job-summary--${Ua(n)}`,children:[z.jsx("p",{className:"job-summary-eyebrow",children:n==="error"?"Finalized with error":"Finalized"}),z.jsx("p",{className:"job-summary-text",children:i}),s?z.jsx("p",{className:"job-summary-error",children:s}):null]})}function EL({state:i}){const n=hE(i);return ie.useEffect(()=>{const s=o=>{o.key==="Escape"&&wd()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[]),n?z.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[z.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:wd,"aria-label":"Close job stream"}),z.jsxs("div",{className:"job-overlay-card",children:[z.jsx("button",{type:"button",className:"job-overlay-close",onClick:wd,"aria-label":"Close job stream",children:"×"}),z.jsx(yL,{job:n,timelineOpen:i.timelineOpen})]})]}):null}function xL({creating:i,error:n,hasTheaters:s,activeTheaterId:o}){const l=s?o?"No operations in this Theater":"Choose a Theater":"Add a Theater",y=s?o?"Launch an operation from the Operations sidebar.":"Theater-scoped operations and carrier activity will appear here.":"Use the top bar Theater control to add a project root.";return z.jsxs("section",{className:"operations-landing","aria-label":"Operations workspace landing",children:[z.jsx("div",{className:"operations-landing-mark","aria-hidden":"true"}),z.jsxs("div",{children:[z.jsx("p",{className:"operations-landing-eyebrow",children:"Operation"}),z.jsx("h1",{children:l}),z.jsx("p",{children:y})]}),z.jsx("p",{className:`operations-landing-status ${i?"is-live":""}`,children:i?"Launching operation":"No terminal session selected"}),n?z.jsx("p",{className:"operations-landing-error",children:n}):null]})}function TL({state:i}){const n=Hf(i),s=async()=>{if(!(i.creatingTerminalSession||i.addingTheater||!i.activeTheaterId)){iE();try{nE(await Dw(i.activeTheaterId))}catch(o){rE(o instanceof Error?o.message:String(o))}}};return z.jsxs("nav",{className:"sidebar","aria-label":"Operation sessions and carrier jobs",children:[z.jsxs("div",{className:"sidebar-heading",children:[z.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),z.jsx("button",{type:"button",className:"workspace-add-button",onClick:s,disabled:i.creatingTerminalSession||i.addingTheater||!i.activeTheaterId,"aria-label":"Launch operation",children:z.jsx(kL,{})})]}),n.length>0?z.jsx("ol",{className:"session-list",children:n.map(o=>{const l=i.sessions[o];return l?z.jsx(AL,{session:l,active:i.activeTerminalSessionId===o,jobs:fE(i,l),selectedJobId:i.selectedJobId},o):null})}):null,i.terminalSessionError?z.jsx("p",{className:"sidebar-error",children:i.terminalSessionError}):null,n.length===0?z.jsxs("p",{className:"sidebar-empty",children:[i.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",z.jsx("br",{}),i.activeTheaterId?"Use + to launch one here.":"Add a Theater from the top bar."]}):null]})}const AL=ie.memo(function({session:n,active:s,jobs:o,selectedJobId:l}){const b=o.filter(({job:u})=>!Zo(u.status)).length>0||n.status==="registered"||n.status==="live"||n.status==="terminal-only",c=[...o].sort((u,h)=>Number(Zo(u.job.status))-Number(Zo(h.job.status)));return z.jsxs("li",{className:`session-item ${s?"is-active":""}`,children:[z.jsxs("div",{className:"session-row-shell",children:[z.jsxs("button",{type:"button",className:`session-row ${s?"is-active":""}`,onClick:()=>tE(n.sessionId),"aria-current":s||void 0,children:[z.jsx("span",{className:`tenant-beacon ${b?"is-live":""}`,"aria-hidden":"true"}),z.jsxs("span",{className:"tenant-row-text",children:[z.jsx("span",{className:"tenant-label",children:n.cwdLabel}),z.jsx("span",{className:"tenant-path",children:n.status})]}),!s&&o.length>0?z.jsx("span",{className:"tenant-count",children:o.length}):null]}),z.jsx("button",{type:"button",className:"session-close",onClick:()=>{LL(n.sessionId)},"aria-label":`Terminate operation ${n.cwdLabel}`,title:"Terminate operation",children:z.jsx(ML,{})})]}),s?z.jsx("ol",{className:"session-job-list",children:c.length>0?c.map(({job:u})=>z.jsx(RL,{job:u,active:u.jobId===l},u.jobId)):z.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),RL=ie.memo(function({job:n,active:s}){const o=Ua(n.status),l=lL(n);return z.jsx("li",{children:z.jsxs("button",{type:"button",className:`job-row ${s?"is-active":""}`,onClick:()=>oE(n.jobId),"aria-current":s||void 0,children:[z.jsx("span",{className:`status-dot status-dot--${o}`,"aria-hidden":"true"}),z.jsxs("span",{className:"job-row-text",children:[z.jsx("span",{className:"job-row-label",children:n.label??xf(n.jobId)}),l?z.jsx("span",{className:"job-row-stream",children:l}):null,z.jsx("span",{className:"job-row-meta",children:n.ownerCarrierId?`${aL(n.ownerCarrierId)} · ${Tf(n.status)}`:Tf(n.status)})]})]})})});async function LL(i){try{await Ow(i)}catch(n){aE(n instanceof Error?n.message:String(n));return}tb(i)}function kL(){return z.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:z.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function ML(){return z.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:z.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function DL({state:i}){const n=i.activeTerminalSessionId&&Hf(i).includes(i.activeTerminalSessionId)?i.activeTerminalSessionId:null;return z.jsxs("div",{className:"console-body",children:[z.jsx(TL,{state:i}),z.jsx("main",{className:"operations-terminal-stage",children:n?z.jsxs(z.Fragment,{children:[z.jsx(Hb,{sessionId:n,onExit:()=>tb(n)},n),z.jsx(EL,{state:i})]}):z.jsx(xL,{creating:i.creatingTerminalSession,error:i.terminalSessionError,hasTheaters:i.theaters.length>0,activeTheaterId:i.activeTheaterId})})]})}function OL(i){return{activeTheater:IL(i),readiness:NL(i,i.activeTheaterId),theaters:BL(i),connection:i.connection,connectionError:i.connectionError}}function BL(i){return i.theaters.map(n=>{const s=n_(i,n.id),o=r_(i,n.id),l=s_(i,o);return{id:n.id,label:n.label,hasWiki:n.hasWiki,activeAdmiralCount:n.activeAdmiralCount,terminalSessionCount:s.length,liveJobCount:l.filter(y=>Ua(y.status)==="live").length,lastActivityAt:BS([Date.parse(n.lastOpenedAt),...s.map(y=>y.createdAt),...o.map(y=>y.createdAt),...l.map(y=>y.updatedAt)]),active:n.id===i.activeTheaterId}})}function NL(i,n){const s=n?n_(i,n):[],o=n?r_(i,n):[],l=s_(i,o),y=l.filter(h=>Ua(h.status)==="live").length,b=l.filter(h=>Zo(h.status)&&h.status==="done").length,c=l.filter(h=>Zo(h.status)&&(h.status==="error"||h.status==="aborted")).length,u=i.activeTerminalSessionId?i.sessions[i.activeTerminalSessionId]:void 0;return{activeSessionLabel:u&&n&&u.theaterId===n?u.cwdLabel:"No active session",terminalSessionCount:s.length,liveJobCount:y,completedJobCount:b,failedJobCount:c,emptyState:HL(i,s,l)}}function IL(i){const n=i.theaters.find(y=>y.id===i.activeTheaterId);if(!n)return null;const s=n_(i,n.id),o=r_(i,n.id),l=s_(i,o);return{id:n.id,label:n.label,hasWiki:n.hasWiki,activeAdmiralCount:n.activeAdmiralCount,terminalSessionCount:s.length,registeredTenantCount:o.filter(y=>y.status!=="deregistered").length,deregisteredTenantCount:o.filter(y=>y.status==="deregistered").length,lastActivityAt:BS([Date.parse(n.lastOpenedAt),...s.map(y=>y.createdAt),...o.map(y=>y.createdAt),...l.map(y=>y.updatedAt)])}}function n_(i,n){return i.sessionOrder.map(s=>i.sessions[s]).filter(s=>s!==void 0&&s.theaterId===n)}function r_(i,n){return i.tenants.filter(s=>s.theaterId===n)}function s_(i,n){const s=[];for(const o of n){const l=i.tenantJobs[o.tenantId];if(l)for(const y of l.jobOrder){const b=l.jobs[y];b&&s.push(b)}}return s}function HL(i,n,s){return i.theaters.length===0?"no-theaters":n.length===0?"no-sessions":s.length===0?"no-jobs":null}function BS(i){const n=i.filter(s=>Number.isFinite(s));return n.length===0?null:Math.max(...n)}async function zL(i,n){const[s,o,l,y]=await Promise.all([Oc(i,"/index",n),Oc(i,"/queue?status=all",n),Oc(i,"/conflicts",n),Oc(i,"/log?limit=3",n)]);return{entryCount:Array.isArray(s)?s.length:0,pendingQueueCount:typeof o.pendingCount=="number"?o.pendingCount:0,archivedQueueCount:typeof o.archivedCount=="number"?o.archivedCount:0,openConflictCount:Array.isArray(l)?l.length:0,logEntryCount:typeof y.totalEntries=="number"?y.totalEntries:Array.isArray(y.entries)?y.entries.length:0,latestLogStatus:Array.isArray(y.entries)&&y.entries.length>0?"available":"empty"}}async function Oc(i,n,s){const o=n.startsWith("/")?n:`/${n}`,l=await fetch(`/console/codex/w/${encodeURIComponent(i)}/api${o}`,{signal:s});if(!l.ok)throw new cn(l.status,l.statusText||`HTTP ${l.status}`);return l.json()}const Bc={loading:!1,value:null,error:null},$L=15e3;function UL({state:i}){const n=OL(i),s=n.activeTheater,[o,l]=ie.useState(Bc),[y,b]=ie.useState(Bc),[c,u]=ie.useState(Bc);return ie.useEffect(()=>{if(!s?.hasWiki){l(Bc);return}const h=new AbortController;return l({loading:!0,value:null,error:null}),zL(s.id,h.signal).then(v=>l({loading:!1,value:v,error:null})).catch(v=>{h.signal.aborted||l({loading:!1,value:null,error:v instanceof Error?v.message:String(v)})}),()=>h.abort()},[s?.hasWiki,s?.id]),ie.useEffect(()=>{const h=new AbortController;return b(v=>({loading:!0,value:v.value,error:null})),Lw(s?.id??null,h.signal).then(v=>b({loading:!1,value:v,error:null})).catch(v=>{h.signal.aborted||b({loading:!1,value:null,error:v instanceof Error?v.message:String(v)})}),()=>h.abort()},[s?.id]),ie.useEffect(()=>{const h=new AbortController,v=()=>{u(C=>({loading:!0,value:C.value,error:null})),kw(h.signal).then(C=>u({loading:!1,value:C,error:null})).catch(C=>{h.signal.aborted||u(x=>({loading:!1,value:x.value,error:C instanceof Error?C.message:String(C)}))})};v();const f=window.setInterval(v,$L);return()=>{window.clearInterval(f),h.abort()}},[]),z.jsxs("main",{className:"welcome-page",children:[z.jsxs("section",{className:"bridge-matrix","aria-labelledby":"bridge-matrix-title",children:[z.jsxs("div",{className:"bridge-section-heading",children:[z.jsx("p",{className:"bridge-kicker",children:"Theater Capability Matrix"}),z.jsx("h3",{id:"bridge-matrix-title",children:"Registered Theaters"})]}),z.jsxs("div",{className:"bridge-matrix-table",role:"table","aria-label":"Theater capability matrix",children:[z.jsxs("div",{className:"bridge-matrix-row bridge-matrix-head",role:"row",children:[z.jsx("span",{role:"columnheader",children:"Theater"}),z.jsx("span",{role:"columnheader",children:"Codex"}),z.jsx("span",{role:"columnheader",children:"Active"}),z.jsx("span",{role:"columnheader",children:"Terminals"}),z.jsx("span",{role:"columnheader",children:"Updated"})]}),n.theaters.length>0?n.theaters.map(h=>z.jsx(qL,{theater:h},h.id)):z.jsx("p",{className:"bridge-matrix-empty",children:"No Theaters registered."})]})]}),z.jsxs("section",{className:"bridge-carriers","aria-labelledby":"bridge-carriers-title",children:[z.jsxs("div",{className:"bridge-section-heading",children:[z.jsx("p",{className:"bridge-kicker",children:"Carrier Readiness Matrix"}),z.jsx("h3",{id:"bridge-carriers-title",children:"Carrier roster"})]}),z.jsx(FL,{carriers:c})]}),z.jsxs("section",{className:"bridge-knowledge","aria-labelledby":"bridge-knowledge-title",children:[z.jsxs("div",{className:"bridge-section-heading",children:[z.jsx("p",{className:"bridge-kicker",children:"Knowledge Readiness Panel"}),z.jsx("h3",{id:"bridge-knowledge-title",children:"Codex readiness"})]}),z.jsx(PL,{activeTheater:s,knowledge:o})]}),z.jsxs("section",{className:"bridge-health","aria-labelledby":"bridge-health-title",children:[z.jsxs("div",{className:"bridge-section-heading",children:[z.jsx("p",{className:"bridge-kicker",children:"System Information"}),z.jsx("h3",{id:"bridge-health-title",children:"Runtime status"})]}),z.jsx(jL,{health:y})]})]})}function PL({activeTheater:i,knowledge:n}){if(!i)return z.jsx("div",{className:"bridge-empty",children:z.jsx("p",{children:"Add a Theater to inspect Codex readiness."})});if(!i.hasWiki)return z.jsx("div",{className:"bridge-empty",children:z.jsx("p",{children:"Codex unavailable for this Theater."})});if(n.error)return z.jsx("div",{className:"bridge-empty bridge-empty--warn",children:z.jsx("p",{children:"Codex summary degraded."})});const s=n.value,o=[{label:"Entries",value:s?String(s.entryCount):"…",caption:"Indexed knowledge entries"},{label:"Pending",value:s?String(s.pendingQueueCount):"…",caption:"Drydock queue"},{label:"Archived",value:s?String(s.archivedQueueCount):"…",caption:"Archived decisions"},{label:"Conflicts",value:s?String(s.openConflictCount):"…",caption:"Open conflict files",tone:s&&s.openConflictCount>0?"warn":void 0},{label:"Log",value:s?s.latestLogStatus:n.loading?"loading":"empty",caption:s?`${s.logEntryCount} total entries`:"Latest log tail",tone:s?.latestLogStatus==="available"?"good":void 0}];return z.jsx("div",{className:"bridge-knowledge-grid",children:o.map(l=>z.jsx(NS,{metric:l},l.label))})}function jL({health:i}){const n=i.value,s=[{label:"Version",value:n?.version??"…",caption:"Console runtime"},{label:"Channel",value:n?.channel??"…",caption:"Release channel"},{label:"Port",value:n?String(n.port):"…",caption:"Loopback listener"},{label:"Codex",value:n?.wikiServerStatus??"unknown",caption:"Active Theater status",tone:n?.wikiServerStatus==="available"?"good":n?.wikiServerStatus==="unavailable"?"bad":void 0},{label:"Observer",value:n?`${n.workspaces}/${n.jobs}`:i.loading?"loading":"unknown",caption:"Workspaces / jobs"}];return z.jsxs(z.Fragment,{children:[z.jsx("div",{className:"bridge-health-strip",children:s.map(o=>z.jsx(NS,{metric:o},o.label))}),i.error?z.jsx("p",{className:"bridge-health-error",children:"System health unavailable."}):null]})}function FL({carriers:i}){if(i.error)return z.jsx("div",{className:"bridge-empty bridge-empty--warn",children:z.jsx("p",{children:"Carrier readiness degraded."})});const n=i.value??[];return n.length===0?z.jsx("div",{className:"bridge-empty",children:z.jsx("p",{children:i.loading?"Loading carrier readiness.":"No carrier readiness entries available."})}):z.jsxs("div",{className:"bridge-carrier-table",role:"table","aria-label":"Carrier readiness matrix",children:[z.jsxs("div",{className:"bridge-carrier-row bridge-carrier-head",role:"row",children:[z.jsx("span",{role:"columnheader",children:"Carrier"}),z.jsx("span",{role:"columnheader",children:"Role"}),z.jsx("span",{role:"columnheader",children:"Model"}),z.jsx("span",{role:"columnheader",children:"Effort"}),z.jsx("span",{role:"columnheader",children:"Task Force"}),z.jsx("span",{role:"columnheader",children:"Mode"})]}),n.map(s=>z.jsxs("div",{className:"bridge-carrier-row",role:"row",children:[z.jsxs("span",{role:"cell",className:"bridge-carrier-name","data-signature":GL(s),children:[z.jsx("strong",{children:s.displayName}),z.jsx("small",{children:s.category??"unknown"})]}),z.jsx("span",{role:"cell",children:s.role??s.category??"unknown"}),z.jsx("span",{role:"cell",children:s.model||"unknown"}),z.jsx("span",{role:"cell",children:s.effort??"default"}),z.jsx("span",{role:"cell",children:s.taskForceBackendCount}),z.jsx("span",{role:"cell",children:s.subagentMode?"subagent":s.cliType||"cli"})]},s.carrierId))]})}function NS({metric:i}){return z.jsxs("article",{className:`bridge-card ${i.tone?`bridge-card--${i.tone}`:""}`,children:[z.jsx("p",{className:"bridge-card-label",children:i.label}),z.jsx("strong",{children:i.value}),z.jsx("p",{children:i.caption})]})}function qL({theater:i}){return z.jsxs("div",{className:`bridge-matrix-row ${i.active?"is-active":""}`,role:"row",children:[z.jsxs("span",{role:"cell",children:[z.jsx("span",{className:`bridge-theater-live ${i.liveJobCount>0?"is-live":""}`,"aria-hidden":"true"}),i.label]}),z.jsx("span",{role:"cell",children:i.hasWiki?"available":"unavailable"}),z.jsx("span",{role:"cell",children:i.activeAdmiralCount}),z.jsx("span",{role:"cell",children:i.terminalSessionCount}),z.jsx("span",{role:"cell",children:WL(i.lastActivityAt)})]})}function WL(i){return i?new Date(i).toLocaleString([],{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"none"}function GL(i){return!i.subagentMode&&i.taskForceBackendCount>=2?"taskforce":i.cliType}function KL(){const i=Ib();return ie.useEffect(()=>R5(),[]),ie.useEffect(()=>{const n=new AbortController;return Rw(n.signal).then(Vw).catch(s=>{n.signal.aborted||bt({theaterError:s instanceof Error?s.message:String(s)})}),Bw(n.signal).then(Yw).catch(s=>{n.signal.aborted||bt({terminalSessionError:s instanceof Error?s.message:String(s)})}),()=>n.abort()},[]),ie.useEffect(()=>{const n=s=>{(s.metaKey||s.ctrlKey)&&s.key==="`"&&(s.preventDefault(),eb())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),z.jsxs("div",{className:"console-shell",children:[z.jsx(g5,{state:i}),z.jsxs(KC,{children:[z.jsx(Go,{path:"/",element:z.jsx(UL,{state:i})}),z.jsx(Go,{path:"/operations",element:z.jsx(DL,{state:i})}),z.jsx(Go,{path:"/codex/*",element:z.jsx(rL,{state:i})}),z.jsx(Go,{path:"*",element:z.jsx(WC,{to:"/",replace:!0})})]}),z.jsx(f5,{state:i}),z.jsx(_5,{open:i.connectionError!==null,tone:"error",title:"Console link interrupted",message:i.connectionError??void 0})]})}Gw();const x0=document.querySelector("#app");x0&&Y1.createRoot(x0).render(z.jsx(ie.StrictMode,{children:z.jsx(mw,{basename:"/console",children:z.jsx(KL,{})})}));export{vA as _,YL as a,z1 as g,vt as k,el as p};